drm/i915: Make intel_plane_state subclass drm_plane_state
authorMatt Roper <matthew.d.roper@intel.com>
Mon, 1 Dec 2014 23:40:13 +0000 (15:40 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 6 Dec 2014 00:46:23 +0000 (01:46 +0100)
Reviewed-by: 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 78c0e1c10c441bdc9a2dc889066487e8e4ae868b..de6768f3846657908af979c291f0b5f0d64a520a 100644 (file)
@@ -11693,8 +11693,8 @@ static int
 intel_check_primary_plane(struct drm_plane *plane,
                          struct intel_plane_state *state)
 {
-       struct drm_crtc *crtc = state->crtc;
-       struct drm_framebuffer *fb = state->fb;
+       struct drm_crtc *crtc = state->base.crtc;
+       struct drm_framebuffer *fb = state->base.fb;
        struct drm_rect *dest = &state->dst;
        struct drm_rect *src = &state->src;
        const struct drm_rect *clip = &state->clip;
@@ -11710,8 +11710,8 @@ static int
 intel_prepare_primary_plane(struct drm_plane *plane,
                            struct intel_plane_state *state)
 {
-       struct drm_crtc *crtc = state->crtc;
-       struct drm_framebuffer *fb = state->fb;
+       struct drm_crtc *crtc = state->base.crtc;
+       struct drm_framebuffer *fb = state->base.fb;
        struct drm_device *dev = crtc->dev;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        enum pipe pipe = intel_crtc->pipe;
@@ -11746,9 +11746,9 @@ static void
 intel_commit_primary_plane(struct drm_plane *plane,
                           struct intel_plane_state *state)
 {
-       struct drm_crtc *crtc = state->crtc;
-       struct drm_framebuffer *fb = state->fb;
-       struct drm_device *dev = crtc->dev;
+       struct drm_crtc *crtc = state->base.crtc;
+       struct drm_framebuffer *fb = state->base.fb;
+       struct drm_device *dev = plane->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        enum pipe pipe = intel_crtc->pipe;
@@ -11847,8 +11847,8 @@ intel_primary_plane_setplane(struct drm_plane *plane, struct drm_crtc *crtc,
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        int ret;
 
-       state.crtc = crtc;
-       state.fb = fb;
+       state.base.crtc = crtc;
+       state.base.fb = fb;
 
        /* sample coordinates in 16.16 fixed point */
        state.src.x1 = src_x;
@@ -11961,9 +11961,9 @@ static int
 intel_check_cursor_plane(struct drm_plane *plane,
                         struct intel_plane_state *state)
 {
-       struct drm_crtc *crtc = state->crtc;
+       struct drm_crtc *crtc = state->base.crtc;
        struct drm_device *dev = crtc->dev;
-       struct drm_framebuffer *fb = state->fb;
+       struct drm_framebuffer *fb = state->base.fb;
        struct drm_rect *dest = &state->dst;
        struct drm_rect *src = &state->src;
        const struct drm_rect *clip = &state->clip;
@@ -12018,8 +12018,8 @@ intel_prepare_cursor_plane(struct drm_plane *plane,
                           struct intel_plane_state *state)
 {
        struct drm_device *dev = plane->dev;
-       struct drm_framebuffer *fb = state->fb;
-       struct intel_crtc *intel_crtc = to_intel_crtc(state->crtc);
+       struct drm_framebuffer *fb = state->base.fb;
+       struct intel_crtc *intel_crtc = to_intel_crtc(state->base.crtc);
        struct drm_i915_gem_object *obj = intel_fb_obj(fb);
        struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->fb);
        enum pipe pipe = intel_crtc->pipe;
@@ -12053,16 +12053,16 @@ static void
 intel_commit_cursor_plane(struct drm_plane *plane,
                          struct intel_plane_state *state)
 {
-       struct drm_crtc *crtc = state->crtc;
+       struct drm_crtc *crtc = state->base.crtc;
        struct drm_device *dev = crtc->dev;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        struct intel_plane *intel_plane = to_intel_plane(plane);
-       struct drm_i915_gem_object *obj = intel_fb_obj(state->fb);
+       struct drm_i915_gem_object *obj = intel_fb_obj(state->base.fb);
        enum pipe pipe = intel_crtc->pipe;
        unsigned old_width;
        uint32_t addr;
 
-       plane->fb = state->fb;
+       plane->fb = state->base.fb;
        crtc->cursor_x = state->orig_dst.x1;
        crtc->cursor_y = state->orig_dst.y1;
 
@@ -12122,8 +12122,8 @@ intel_cursor_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
        struct intel_plane_state state;
        int ret;
 
-       state.crtc = crtc;
-       state.fb = fb;
+       state.base.crtc = crtc;
+       state.base.fb = fb;
 
        /* sample coordinates in 16.16 fixed point */
        state.src.x1 = src_x;
index abb2cf4162b2026be5ae6a842c824ba869fc1059..b4d181fd94125b7c588eeb42a3d43536e3413ed7 100644 (file)
@@ -244,8 +244,7 @@ typedef struct dpll {
 } intel_clock_t;
 
 struct intel_plane_state {
-       struct drm_crtc *crtc;
-       struct drm_framebuffer *fb;
+       struct drm_plane_state base;
        struct drm_rect src;
        struct drm_rect dst;
        struct drm_rect clip;
index 7d9c340f7693a8ff950541213e7a0d4e8f61aa06..fc96d1326310e88995a019c45b333e3a0d6cc98c 100644 (file)
@@ -1096,9 +1096,9 @@ static int
 intel_check_sprite_plane(struct drm_plane *plane,
                         struct intel_plane_state *state)
 {
-       struct intel_crtc *intel_crtc = to_intel_crtc(state->crtc);
+       struct intel_crtc *intel_crtc = to_intel_crtc(state->base.crtc);
        struct intel_plane *intel_plane = to_intel_plane(plane);
-       struct drm_framebuffer *fb = state->fb;
+       struct drm_framebuffer *fb = state->base.fb;
        struct drm_i915_gem_object *obj = intel_fb_obj(fb);
        int crtc_x, crtc_y;
        unsigned int crtc_w, crtc_h;
@@ -1262,11 +1262,11 @@ intel_prepare_sprite_plane(struct drm_plane *plane,
                           struct intel_plane_state *state)
 {
        struct drm_device *dev = plane->dev;
-       struct drm_crtc *crtc = state->crtc;
+       struct drm_crtc *crtc = state->base.crtc;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        struct intel_plane *intel_plane = to_intel_plane(plane);
        enum pipe pipe = intel_crtc->pipe;
-       struct drm_framebuffer *fb = state->fb;
+       struct drm_framebuffer *fb = state->base.fb;
        struct drm_i915_gem_object *obj = intel_fb_obj(fb);
        struct drm_i915_gem_object *old_obj = intel_plane->obj;
        int ret;
@@ -1297,11 +1297,11 @@ intel_commit_sprite_plane(struct drm_plane *plane,
                          struct intel_plane_state *state)
 {
        struct drm_device *dev = plane->dev;
-       struct drm_crtc *crtc = state->crtc;
+       struct drm_crtc *crtc = state->base.crtc;
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        struct intel_plane *intel_plane = to_intel_plane(plane);
        enum pipe pipe = intel_crtc->pipe;
-       struct drm_framebuffer *fb = state->fb;
+       struct drm_framebuffer *fb = state->base.fb;
        struct drm_i915_gem_object *obj = intel_fb_obj(fb);
        struct drm_i915_gem_object *old_obj = intel_plane->obj;
        int crtc_x, crtc_y;
@@ -1391,8 +1391,8 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
        int ret;
 
-       state.crtc = crtc;
-       state.fb = fb;
+       state.base.crtc = crtc;
+       state.base.fb = fb;
 
        /* sample coordinates in 16.16 fixed point */
        state.src.x1 = src_x;