OSDN Git Service

drm/i915: Drop unused position fields (v2)
authorMatt Roper <matthew.d.roper@intel.com>
Tue, 23 Dec 2014 18:41:53 +0000 (10:41 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 12 Jan 2015 22:59:41 +0000 (23:59 +0100)
The userspace-requested plane coordinates are now always available via
plane->state.base (and the i915-adjusted values are stored in
plane->state), so we no longer use the coordinate fields in intel_plane
and can drop them.

Also, note that the error case for pageflip calls update_plane() to
program the values from plane->state; it's simpler to just call
intel_plane_restore() which does the same thing.

v2: Replace manual update_plane() with intel_plane_restore() in pageflip
    error handler.

Reviewed-by(v1): Bob Paauwe <bob.j.paauwe@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_sprite.c

index 73f9a75..78a199e 100644 (file)
@@ -9616,7 +9616,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
        struct drm_i915_gem_object *obj = intel_fb_obj(fb);
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        struct drm_plane *primary = crtc->primary;
-       struct intel_plane *intel_plane = to_intel_plane(primary);
        enum pipe pipe = intel_crtc->pipe;
        struct intel_unpin_work *work;
        struct intel_engine_cs *ring;
@@ -9775,15 +9774,7 @@ free_work:
 
        if (ret == -EIO) {
 out_hang:
-               ret = primary->funcs->update_plane(primary, crtc, fb,
-                                                  intel_plane->crtc_x,
-                                                  intel_plane->crtc_y,
-                                                  intel_plane->crtc_h,
-                                                  intel_plane->crtc_w,
-                                                  intel_plane->src_x,
-                                                  intel_plane->src_y,
-                                                  intel_plane->src_h,
-                                                  intel_plane->src_w);
+               ret = intel_plane_restore(primary);
                if (ret == 0 && event) {
                        spin_lock_irq(&dev->event_lock);
                        drm_send_vblank_event(dev, pipe, event);
@@ -11823,14 +11814,6 @@ intel_commit_primary_plane(struct drm_plane *plane,
        crtc->x = src->x1 >> 16;
        crtc->y = src->y1 >> 16;
 
-       intel_plane->crtc_x = state->base.crtc_x;
-       intel_plane->crtc_y = state->base.crtc_y;
-       intel_plane->crtc_w = state->base.crtc_w;
-       intel_plane->crtc_h = state->base.crtc_h;
-       intel_plane->src_x = state->base.src_x;
-       intel_plane->src_y = state->base.src_y;
-       intel_plane->src_w = state->base.src_w;
-       intel_plane->src_h = state->base.src_h;
        intel_plane->obj = obj;
 
        if (intel_crtc->active) {
@@ -12111,14 +12094,6 @@ intel_commit_cursor_plane(struct drm_plane *plane,
        crtc->cursor_x = state->base.crtc_x;
        crtc->cursor_y = state->base.crtc_y;
 
-       intel_plane->crtc_x = state->base.crtc_x;
-       intel_plane->crtc_y = state->base.crtc_y;
-       intel_plane->crtc_w = state->base.crtc_w;
-       intel_plane->crtc_h = state->base.crtc_h;
-       intel_plane->src_x = state->base.src_x;
-       intel_plane->src_y = state->base.src_y;
-       intel_plane->src_w = state->base.src_w;
-       intel_plane->src_h = state->base.src_h;
        intel_plane->obj = obj;
 
        if (intel_crtc->cursor_bo == obj)
index be85ae9..eca2395 100644 (file)
@@ -517,10 +517,6 @@ struct intel_plane {
        struct drm_i915_gem_object *obj;
        bool can_scale;
        int max_downscale;
-       int crtc_x, crtc_y;
-       unsigned int crtc_w, crtc_h;
-       uint32_t src_x, src_y;
-       uint32_t src_w, src_h;
        unsigned int rotation;
 
        /* Since we need to change the watermarks before/after
index c7e7051..dca3f70 100644 (file)
@@ -1277,15 +1277,6 @@ intel_commit_sprite_plane(struct drm_plane *plane,
        unsigned int crtc_w, crtc_h;
        uint32_t src_x, src_y, src_w, src_h;
 
-       intel_plane->crtc_x = state->base.crtc_x;
-       intel_plane->crtc_y = state->base.crtc_y;
-       intel_plane->crtc_w = state->base.crtc_w;
-       intel_plane->crtc_h = state->base.crtc_h;
-       intel_plane->src_x = state->base.src_x;
-       intel_plane->src_y = state->base.src_y;
-       intel_plane->src_w = state->base.src_w;
-       intel_plane->src_h = state->base.src_h;
-
        crtc = crtc ? crtc : plane->crtc;
        intel_crtc = to_intel_crtc(crtc);
 
@@ -1400,16 +1391,14 @@ int intel_plane_set_property(struct drm_plane *plane,
 
 int intel_plane_restore(struct drm_plane *plane)
 {
-       struct intel_plane *intel_plane = to_intel_plane(plane);
-
        if (!plane->crtc || !plane->fb)
                return 0;
 
        return plane->funcs->update_plane(plane, plane->crtc, plane->fb,
-                                 intel_plane->crtc_x, intel_plane->crtc_y,
-                                 intel_plane->crtc_w, intel_plane->crtc_h,
-                                 intel_plane->src_x, intel_plane->src_y,
-                                 intel_plane->src_w, intel_plane->src_h);
+                                 plane->state->crtc_x, plane->state->crtc_y,
+                                 plane->state->crtc_w, plane->state->crtc_h,
+                                 plane->state->src_x, plane->state->src_y,
+                                 plane->state->src_w, plane->state->src_h);
 }
 
 static const struct drm_plane_funcs intel_sprite_plane_funcs = {