Commit c47b7ddb authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/i915: Rename planar linked plane variables

Rename linked_plane to planar_linked_plane and slave to planar_slave,
this will make it easier to keep apart bigjoiner linking and planar plane
linking.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190920114235.22411-8-maarten.lankhorst@linux.intel.comReviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
parent c22d62e6
......@@ -263,10 +263,13 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta
*/
mode = PS_SCALER_MODE_NORMAL;
} else {
struct intel_plane *linked =
plane_state->planar_linked_plane;
mode = PS_SCALER_MODE_PLANAR;
if (plane_state->linked_plane)
mode |= PS_PLANE_Y_SEL(plane_state->linked_plane->id);
if (linked)
mode |= PS_PLANE_Y_SEL(linked->id);
}
} else if (INTEL_GEN(dev_priv) > 9 || IS_GEMINILAKE(dev_priv)) {
mode = PS_SCALER_MODE_NORMAL;
......
......@@ -321,9 +321,9 @@ void skl_update_planes_on_crtc(struct intel_atomic_state *state,
if (new_plane_state->base.visible) {
intel_update_plane(plane, new_crtc_state, new_plane_state);
} else if (new_plane_state->slave) {
} else if (new_plane_state->planar_slave) {
struct intel_plane *master =
new_plane_state->linked_plane;
new_plane_state->planar_linked_plane;
/*
* We update the slave plane from this function because
......
......@@ -11729,7 +11729,7 @@ static int icl_add_linked_planes(struct intel_atomic_state *state)
int i;
for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
linked = plane_state->linked_plane;
linked = plane_state->planar_linked_plane;
if (!linked)
continue;
......@@ -11738,8 +11738,8 @@ static int icl_add_linked_planes(struct intel_atomic_state *state)
if (IS_ERR(linked_plane_state))
return PTR_ERR(linked_plane_state);
WARN_ON(linked_plane_state->linked_plane != plane);
WARN_ON(linked_plane_state->slave == plane_state->slave);
WARN_ON(linked_plane_state->planar_linked_plane != plane);
WARN_ON(linked_plane_state->planar_slave == plane_state->planar_slave);
}
return 0;
......@@ -11762,16 +11762,16 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
* in the crtc_state->active_planes mask.
*/
for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
if (plane->pipe != crtc->pipe || !plane_state->linked_plane)
if (plane->pipe != crtc->pipe || !plane_state->planar_linked_plane)
continue;
plane_state->linked_plane = NULL;
if (plane_state->slave && !plane_state->base.visible) {
plane_state->planar_linked_plane = NULL;
if (plane_state->planar_slave && !plane_state->base.visible) {
crtc_state->active_planes &= ~BIT(plane->id);
crtc_state->update_planes |= BIT(plane->id);
}
plane_state->slave = false;
plane_state->planar_slave = false;
}
if (!crtc_state->nv12_planes)
......@@ -11805,10 +11805,10 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
return -EINVAL;
}
plane_state->linked_plane = linked;
plane_state->planar_linked_plane = linked;
linked_state->slave = true;
linked_state->linked_plane = plane;
linked_state->planar_slave = true;
linked_state->planar_linked_plane = plane;
crtc_state->active_planes |= BIT(linked->id);
crtc_state->update_planes |= BIT(linked->id);
DRM_DEBUG_KMS("Using %s as Y plane for %s\n", linked->base.name, plane->base.name);
......@@ -13257,7 +13257,7 @@ intel_verify_planes(struct intel_atomic_state *state)
for_each_new_intel_plane_in_state(state, plane,
plane_state, i)
assert_plane(plane, plane_state->slave ||
assert_plane(plane, plane_state->planar_slave ||
plane_state->base.visible);
}
......
......@@ -559,24 +559,24 @@ struct intel_plane_state {
int scaler_id;
/*
* linked_plane:
* planar_linked_plane:
*
* ICL planar formats require 2 planes that are updated as pairs.
* This member is used to make sure the other plane is also updated
* when required, and for update_slave() to find the correct
* plane_state to pass as argument.
*/
struct intel_plane *linked_plane;
struct intel_plane *planar_linked_plane;
/*
* slave:
* planar_slave:
* If set don't update use the linked plane's state for updating
* this plane during atomic commit with the update_slave() callback.
*
* It's also used by the watermark code to ignore wm calculations on
* this plane. They're calculated by the linked plane's wm code.
*/
u32 slave;
u32 planar_slave;
struct drm_intel_sprite_colorkey ckey;
};
......
......@@ -542,7 +542,7 @@ skl_program_plane(struct intel_plane *plane,
u32 y = plane_state->color_plane[color_plane].y;
u32 src_w = drm_rect_width(&plane_state->base.src) >> 16;
u32 src_h = drm_rect_height(&plane_state->base.src) >> 16;
struct intel_plane *linked = plane_state->linked_plane;
struct intel_plane *linked = plane_state->planar_linked_plane;
const struct drm_framebuffer *fb = plane_state->base.fb;
u8 alpha = plane_state->base.alpha >> 8;
u32 plane_color_ctl = 0;
......@@ -641,7 +641,7 @@ skl_update_plane(struct intel_plane *plane,
{
int color_plane = 0;
if (plane_state->linked_plane) {
if (plane_state->planar_linked_plane) {
/* Program the UV plane */
color_plane = 1;
}
......
......@@ -4293,7 +4293,7 @@ icl_get_total_relative_data_rate(struct intel_crtc_state *crtc_state,
enum plane_id plane_id = to_intel_plane(plane)->id;
u64 rate;
if (!plane_state->linked_plane) {
if (!plane_state->planar_linked_plane) {
rate = skl_plane_relative_data_rate(crtc_state, plane_state, 0);
plane_data_rate[plane_id] = rate;
total_data_rate += rate;
......@@ -4307,12 +4307,12 @@ icl_get_total_relative_data_rate(struct intel_crtc_state *crtc_state,
* NULL if we try get_new_plane_state(), so we
* always calculate from the master.
*/
if (plane_state->slave)
if (plane_state->planar_slave)
continue;
/* Y plane rate is calculated on the slave */
rate = skl_plane_relative_data_rate(crtc_state, plane_state, 0);
y_plane_id = plane_state->linked_plane->id;
y_plane_id = plane_state->planar_linked_plane->id;
plane_data_rate[y_plane_id] = rate;
total_data_rate += rate;
......@@ -5051,12 +5051,12 @@ static int icl_build_plane_wm(struct intel_crtc_state *crtc_state,
int ret;
/* Watermarks calculated in master */
if (plane_state->slave)
if (plane_state->planar_slave)
return 0;
if (plane_state->linked_plane) {
if (plane_state->planar_linked_plane) {
const struct drm_framebuffer *fb = plane_state->base.fb;
enum plane_id y_plane_id = plane_state->linked_plane->id;
enum plane_id y_plane_id = plane_state->planar_linked_plane->id;
WARN_ON(!intel_wm_plane_visible(crtc_state, plane_state));
WARN_ON(!fb->format->is_yuv ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment