drm/i915: clean up plane commit functions
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Mon, 15 Jun 2015 10:33:45 +0000 (12:33 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 22 Jun 2015 12:20:32 +0000 (14:20 +0200)
No point in hiding behind big ifs. This will be true most of the time.

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>
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_sprite.c

index 39f6b80f990f9523094e664ed38017a42dfd7877..2f50c73653d956abdb153d2788069931008c514a 100644 (file)
@@ -13769,14 +13769,14 @@ intel_commit_primary_plane(struct drm_plane *plane,
        crtc->x = src->x1 >> 16;
        crtc->y = src->y1 >> 16;
 
-       if (intel_crtc->active) {
-               if (state->visible)
-                       /* FIXME: kill this fastboot hack */
-                       intel_update_pipe_size(intel_crtc);
+       if (!intel_crtc->active)
+               return;
 
-               dev_priv->display.update_primary_plane(crtc, plane->fb,
-                                                      crtc->x, crtc->y);
-       }
+       if (state->visible)
+               /* FIXME: kill this fastboot hack */
+               intel_update_pipe_size(intel_crtc);
+
+       dev_priv->display.update_primary_plane(crtc, fb, crtc->x, crtc->y);
 }
 
 static void
@@ -14078,8 +14078,8 @@ intel_commit_cursor_plane(struct drm_plane *plane,
 
        intel_crtc->cursor_addr = addr;
        intel_crtc->cursor_bo = obj;
-update:
 
+update:
        if (intel_crtc->active)
                intel_crtc_update_cursor(crtc, state->visible);
 }
index e36bef805576f3ca9e37147ae8dfb378c70f6365..48353b34d0f52eac3aae44eb028255008ffb36a3 100644 (file)
@@ -930,31 +930,26 @@ intel_commit_sprite_plane(struct drm_plane *plane,
        struct intel_crtc *intel_crtc;
        struct intel_plane *intel_plane = to_intel_plane(plane);
        struct drm_framebuffer *fb = state->base.fb;
-       int crtc_x, crtc_y;
-       unsigned int crtc_w, crtc_h;
-       uint32_t src_x, src_y, src_w, src_h;
 
        crtc = crtc ? crtc : plane->crtc;
        intel_crtc = to_intel_crtc(crtc);
 
        plane->fb = fb;
 
-       if (intel_crtc->active) {
-               if (state->visible) {
-                       crtc_x = state->dst.x1;
-                       crtc_y = state->dst.y1;
-                       crtc_w = drm_rect_width(&state->dst);
-                       crtc_h = drm_rect_height(&state->dst);
-                       src_x = state->src.x1 >> 16;
-                       src_y = state->src.y1 >> 16;
-                       src_w = drm_rect_width(&state->src) >> 16;
-                       src_h = drm_rect_height(&state->src) >> 16;
-                       intel_plane->update_plane(plane, crtc, fb,
-                                                 crtc_x, crtc_y, crtc_w, crtc_h,
-                                                 src_x, src_y, src_w, src_h);
-               } else {
-                       intel_plane->disable_plane(plane, crtc, false);
-               }
+       if (!intel_crtc->active)
+               return;
+
+       if (state->visible) {
+               intel_plane->update_plane(plane, crtc, fb,
+                                         state->dst.x1, state->dst.y1,
+                                         drm_rect_width(&state->dst),
+                                         drm_rect_height(&state->dst),
+                                         state->src.x1 >> 16,
+                                         state->src.y1 >> 16,
+                                         drm_rect_width(&state->src) >> 16,
+                                         drm_rect_height(&state->src) >> 16);
+       } else {
+               intel_plane->disable_plane(plane, crtc, false);
        }
 }