drm/i915: Use drm_plane_helper_check_state()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 26 Jul 2016 16:07:00 +0000 (19:07 +0300)
committerSean Paul <seanpaul@chromium.org>
Mon, 8 Aug 2016 18:19:56 +0000 (14:19 -0400)
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@linux.intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1469549224-1860-6-git-send-email-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/intel_atomic_plane.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_sprite.c

index ffc5730..e06d1f5 100644 (file)
@@ -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;
index 8ecfa95..15bb92b 100644 (file)
@@ -14128,7 +14128,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;
@@ -14142,14 +14141,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,
@@ -14329,20 +14324,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;
 
index efb8324..1d9736b 100644 (file)
@@ -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;