[PATCH 5/9] drm/i915: Use drm_plane_helper_check_state()
Sean Paul
seanpaul at chromium.org
Mon Aug 1 15:10:25 UTC 2016
On Tue, Jul 26, 2016 at 12:07 PM, <ville.syrjala at linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Replace the use of drm_plane_helper_check_update() with
> drm_plane_helper_check_state() since we have a plane state.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Reviewed-by: Sean Paul <seanpaul at chromium.org>
> ---
> drivers/gpu/drm/i915/intel_atomic_plane.c | 14 --------------
> drivers/gpu/drm/i915/intel_display.c | 26 +++++++++-----------------
> drivers/gpu/drm/i915/intel_sprite.c | 10 ++++++++++
> 3 files changed, 19 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
> index 14d40261db21..2d831dd43d44 100644
> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
> @@ -134,20 +134,6 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
>
> crtc_state = to_intel_crtc_state(drm_crtc_state);
>
> - /*
> - * The original src/dest coordinates are stored in state->base, but
> - * we want to keep another copy internal to our driver that we can
> - * clip/modify ourselves.
> - */
> - intel_state->base.src.x1 = state->src_x;
> - intel_state->base.src.y1 = state->src_y;
> - intel_state->base.src.x2 = state->src_x + state->src_w;
> - intel_state->base.src.y2 = state->src_y + state->src_h;
> - intel_state->base.dst.x1 = state->crtc_x;
> - intel_state->base.dst.y1 = state->crtc_y;
> - intel_state->base.dst.x2 = state->crtc_x + state->crtc_w;
> - intel_state->base.dst.y2 = state->crtc_y + state->crtc_h;
> -
> /* Clip all planes to CRTC size, or 0x0 if CRTC is disabled */
> intel_state->clip.x1 = 0;
> intel_state->clip.y1 = 0;
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 4f67b7c19b75..eae8a72bad5a 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14126,7 +14126,6 @@ intel_check_primary_plane(struct drm_plane *plane,
> struct intel_plane_state *state)
> {
> struct drm_crtc *crtc = state->base.crtc;
> - struct drm_framebuffer *fb = state->base.fb;
> int min_scale = DRM_PLANE_HELPER_NO_SCALING;
> int max_scale = DRM_PLANE_HELPER_NO_SCALING;
> bool can_position = false;
> @@ -14140,14 +14139,10 @@ intel_check_primary_plane(struct drm_plane *plane,
> can_position = true;
> }
>
> - return drm_plane_helper_check_update(plane, crtc, fb,
> - &state->base.src,
> - &state->base.dst,
> - &state->base.clip,
> - state->base.rotation,
> - min_scale, max_scale,
> - can_position, true,
> - &state->base.visible);
> + return drm_plane_helper_check_state(&state->base,
> + &state->clip,
> + min_scale, max_scale,
> + can_position, true);
> }
>
> static void intel_begin_crtc_commit(struct drm_crtc *crtc,
> @@ -14327,20 +14322,17 @@ intel_check_cursor_plane(struct drm_plane *plane,
> struct intel_crtc_state *crtc_state,
> struct intel_plane_state *state)
> {
> - struct drm_crtc *crtc = crtc_state->base.crtc;
> struct drm_framebuffer *fb = state->base.fb;
> struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> enum pipe pipe = to_intel_plane(plane)->pipe;
> unsigned stride;
> int ret;
>
> - ret = drm_plane_helper_check_update(plane, crtc, fb, &state->base.src,
> - &state->base.dst,
> - &state->base.clip,
> - state->base.rotation,
> - DRM_PLANE_HELPER_NO_SCALING,
> - DRM_PLANE_HELPER_NO_SCALING,
> - true, true, &state->base.visible);
> + ret = drm_plane_helper_check_state(&state->base,
> + &state->clip,
> + DRM_PLANE_HELPER_NO_SCALING,
> + DRM_PLANE_HELPER_NO_SCALING,
> + true, true);
> if (ret)
> return ret;
>
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 10f10915c0bc..b38956624f04 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -785,6 +785,16 @@ intel_check_sprite_plane(struct drm_plane *plane,
> int max_scale, min_scale;
> bool can_scale;
>
> + src->x1 = state->base.src_x;
> + src->y1 = state->base.src_y;
> + src->x2 = state->base.src_x + state->base.src_w;
> + src->y2 = state->base.src_y + state->base.src_h;
> +
> + dst->x1 = state->base.crtc_x;
> + dst->y1 = state->base.crtc_y;
> + dst->x2 = state->base.crtc_x + state->base.crtc_w;
> + dst->y2 = state->base.crtc_y + state->base.crtc_h;
> +
> if (!fb) {
> state->base.visible = false;
> return 0;
> --
> 2.7.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
More information about the dri-devel
mailing list