drm/i915: Do not use commit_plane for sprite planes.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 7 Jan 2016 10:54:07 +0000 (11:54 +0100)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 7 Jan 2016 12:50:21 +0000 (13:50 +0100)
Use update_plane and disable_plane directly.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1452164052-21752-3-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
drivers/gpu/drm/i915/intel_atomic_plane.c
drivers/gpu/drm/i915/intel_sprite.c

index 856c3118bb87b756633fe3477bcae3b994ad2b6d..969aa410deaae67ba4599c7e32b8d673cc693dd5 100644 (file)
@@ -194,8 +194,18 @@ static void intel_plane_atomic_update(struct drm_plane *plane,
        struct intel_plane *intel_plane = to_intel_plane(plane);
        struct intel_plane_state *intel_state =
                to_intel_plane_state(plane->state);
+       struct drm_crtc *crtc = plane->state->crtc ?: old_state->crtc;
+       struct drm_crtc_state *crtc_state =
+               drm_atomic_get_existing_crtc_state(old_state->state, crtc);
 
-       intel_plane->commit_plane(plane, intel_state);
+       if (intel_plane->commit_plane)
+               intel_plane->commit_plane(plane, intel_state);
+       else if (intel_state->visible)
+               intel_plane->update_plane(plane,
+                                         to_intel_crtc_state(crtc_state),
+                                         intel_state);
+       else
+               intel_plane->disable_plane(plane, crtc);
 }
 
 const struct drm_plane_helper_funcs intel_plane_helper_funcs = {
index 4f9ebc117a34bf9cf947920d45a696a6574ecc0e..73dfb38886b9fd27600d25b5501156093b88b475 100644 (file)
@@ -931,24 +931,6 @@ intel_check_sprite_plane(struct drm_plane *plane,
        return 0;
 }
 
-static void
-intel_commit_sprite_plane(struct drm_plane *plane,
-                         struct intel_plane_state *state)
-{
-       struct intel_plane *intel_plane = to_intel_plane(plane);
-
-       if (state->visible) {
-               struct intel_crtc_state *crtc_state =
-                       to_intel_crtc(state->base.crtc)->config;
-
-               intel_plane->update_plane(plane, crtc_state, state);
-       } else {
-               struct drm_crtc *crtc = state->base.crtc;
-
-               intel_plane->disable_plane(plane, crtc ?: plane->crtc);
-       }
-}
-
 int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
                              struct drm_file *file_priv)
 {
@@ -1130,7 +1112,6 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)
        intel_plane->plane = plane;
        intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER_SPRITE(pipe, plane);
        intel_plane->check_plane = intel_check_sprite_plane;
-       intel_plane->commit_plane = intel_commit_sprite_plane;
        possible_crtcs = (1 << pipe);
        ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs,
                                       &intel_plane_funcs,