Commit 790cc994 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Clean up intel_plane_atomic_check_with_state()

Rename some of the state variables in
intel_plane_atomic_check_with_state() to make it less confusing.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190111170823.4441-2-ville.syrjala@linux.intel.comReviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
parent 0bb1ffe4
...@@ -110,41 +110,39 @@ intel_plane_destroy_state(struct drm_plane *plane, ...@@ -110,41 +110,39 @@ intel_plane_destroy_state(struct drm_plane *plane,
} }
int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state, int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
struct intel_crtc_state *crtc_state, struct intel_crtc_state *new_crtc_state,
const struct intel_plane_state *old_plane_state, const struct intel_plane_state *old_plane_state,
struct intel_plane_state *intel_state) struct intel_plane_state *new_plane_state)
{ {
struct drm_plane *plane = intel_state->base.plane; struct intel_plane *plane = to_intel_plane(new_plane_state->base.plane);
struct drm_plane_state *state = &intel_state->base;
struct intel_plane *intel_plane = to_intel_plane(plane);
int ret; int ret;
crtc_state->active_planes &= ~BIT(intel_plane->id); new_crtc_state->active_planes &= ~BIT(plane->id);
crtc_state->nv12_planes &= ~BIT(intel_plane->id); new_crtc_state->nv12_planes &= ~BIT(plane->id);
intel_state->base.visible = false; new_plane_state->base.visible = false;
/* If this is a cursor plane, no further checks are needed. */ if (!new_plane_state->base.crtc && !old_plane_state->base.crtc)
if (!intel_state->base.crtc && !old_plane_state->base.crtc)
return 0; return 0;
ret = intel_plane->check_plane(crtc_state, intel_state); ret = plane->check_plane(new_crtc_state, new_plane_state);
if (ret) if (ret)
return ret; return ret;
/* FIXME pre-g4x don't work like this */ /* FIXME pre-g4x don't work like this */
if (state->visible) if (new_plane_state->base.visible)
crtc_state->active_planes |= BIT(intel_plane->id); new_crtc_state->active_planes |= BIT(plane->id);
if (state->visible && state->fb->format->format == DRM_FORMAT_NV12) if (new_plane_state->base.visible &&
crtc_state->nv12_planes |= BIT(intel_plane->id); new_plane_state->base.fb->format->format == DRM_FORMAT_NV12)
new_crtc_state->nv12_planes |= BIT(plane->id);
if (state->visible || old_plane_state->base.visible) if (new_plane_state->base.visible || old_plane_state->base.visible)
crtc_state->update_planes |= BIT(intel_plane->id); new_crtc_state->update_planes |= BIT(plane->id);
return intel_plane_atomic_calc_changes(old_crtc_state, return intel_plane_atomic_calc_changes(old_crtc_state,
&crtc_state->base, &new_crtc_state->base,
old_plane_state, old_plane_state,
state); &new_plane_state->base);
} }
static int intel_plane_atomic_check(struct drm_plane *plane, static int intel_plane_atomic_check(struct drm_plane *plane,
......
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