summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_atomic_plane.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2015-06-15 13:33:46 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-06-22 15:20:48 +0300
commit061e4b8d650afd16ebe447d454431c717265b89f (patch)
tree786b47159fc72d7ea6a9eb6ff033f3c0502692d5 /drivers/gpu/drm/i915/intel_atomic_plane.c
parent302d19ac76ae5abacfcffcc76fb384d0b8d54c80 (diff)
downloadlinux-061e4b8d650afd16ebe447d454431c717265b89f.tar.xz
drm/i915: clean up atomic plane check functions, v2.
By passing crtc_state to the check_plane functions a lot of duplicated code can be removed. There are still some transitional helper calls, they will be removed later. Changes since v1: - Revert state->visible changes. - Use plane->state->crtc instead of plane->crtc. - Use drm_atomic_get_existing_crtc_state. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Tested-by(IVB): Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_atomic_plane.c')
-rw-r--r--drivers/gpu/drm/i915/intel_atomic_plane.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index aa2128369a0a..91d53768df9d 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -116,7 +116,7 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
struct intel_plane_state *intel_state = to_intel_plane_state(state);
int ret;
- crtc = crtc ? crtc : plane->crtc;
+ crtc = crtc ? crtc : plane->state->crtc;
intel_crtc = to_intel_crtc(crtc);
/*
@@ -131,10 +131,13 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
/* FIXME: temporary hack necessary while we still use the plane update
* helper. */
if (state->state) {
- crtc_state =
- intel_atomic_get_crtc_state(state->state, intel_crtc);
- if (IS_ERR(crtc_state))
- return PTR_ERR(crtc_state);
+ struct drm_crtc_state *drm_crtc_state =
+ drm_atomic_get_existing_crtc_state(state->state, crtc);
+
+ if (WARN_ON(!drm_crtc_state))
+ return -EINVAL;
+
+ crtc_state = to_intel_crtc_state(drm_crtc_state);
} else {
crtc_state = intel_crtc->config;
}
@@ -185,7 +188,8 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
}
}
- ret = intel_plane->check_plane(plane, intel_state);
+ intel_state->visible = false;
+ ret = intel_plane->check_plane(plane, crtc_state, intel_state);
if (ret || !state->state)
return ret;