diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-02-20 08:58:38 -0500 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-03-03 09:16:13 -0500 |
commit | 287bdf03033709becec8b7d4a38f044939946abd (patch) | |
tree | 6b163dbb353d11034e880fc3a993d4cd0ac157fd | |
parent | 3e8da87d0c04e585f4af0f223376128f923cf7bc (diff) |
drm: rcar-du: Remove private copy of plane size and position
The plane source and destination size and positions are stored in the
plane state, and a private copy is kept in the rcar_du_plane objects.
Remove the private copy as it just duplicates the state.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_plane.c | 25 | ||||
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_plane.h | 8 |
2 files changed, 10 insertions, 23 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index c4e4fd293eee..f247b1fcf791 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c | |||
@@ -132,6 +132,8 @@ static void rcar_du_plane_release(struct rcar_du_plane *plane) | |||
132 | void rcar_du_plane_update_base(struct rcar_du_plane *plane) | 132 | void rcar_du_plane_update_base(struct rcar_du_plane *plane) |
133 | { | 133 | { |
134 | struct rcar_du_group *rgrp = plane->group; | 134 | struct rcar_du_group *rgrp = plane->group; |
135 | unsigned int src_x = plane->plane.state->src_x >> 16; | ||
136 | unsigned int src_y = plane->plane.state->src_y >> 16; | ||
135 | unsigned int index = plane->hwindex; | 137 | unsigned int index = plane->hwindex; |
136 | bool interlaced; | 138 | bool interlaced; |
137 | u32 mwr; | 139 | u32 mwr; |
@@ -163,8 +165,8 @@ void rcar_du_plane_update_base(struct rcar_du_plane *plane) | |||
163 | * require a halved Y position value, in both progressive and interlaced | 165 | * require a halved Y position value, in both progressive and interlaced |
164 | * modes. | 166 | * modes. |
165 | */ | 167 | */ |
166 | rcar_du_plane_write(rgrp, index, PnSPXR, plane->src_x); | 168 | rcar_du_plane_write(rgrp, index, PnSPXR, src_x); |
167 | rcar_du_plane_write(rgrp, index, PnSPYR, plane->src_y * | 169 | rcar_du_plane_write(rgrp, index, PnSPYR, src_y * |
168 | (!interlaced && plane->format->bpp == 32 ? 2 : 1)); | 170 | (!interlaced && plane->format->bpp == 32 ? 2 : 1)); |
169 | rcar_du_plane_write(rgrp, index, PnDSA0R, plane->dma[0]); | 171 | rcar_du_plane_write(rgrp, index, PnDSA0R, plane->dma[0]); |
170 | 172 | ||
@@ -173,8 +175,8 @@ void rcar_du_plane_update_base(struct rcar_du_plane *plane) | |||
173 | 175 | ||
174 | rcar_du_plane_write(rgrp, index, PnMWR, plane->pitch); | 176 | rcar_du_plane_write(rgrp, index, PnMWR, plane->pitch); |
175 | 177 | ||
176 | rcar_du_plane_write(rgrp, index, PnSPXR, plane->src_x); | 178 | rcar_du_plane_write(rgrp, index, PnSPXR, src_x); |
177 | rcar_du_plane_write(rgrp, index, PnSPYR, plane->src_y * | 179 | rcar_du_plane_write(rgrp, index, PnSPYR, src_y * |
178 | (plane->format->bpp == 16 ? 2 : 1) / 2); | 180 | (plane->format->bpp == 16 ? 2 : 1) / 2); |
179 | rcar_du_plane_write(rgrp, index, PnDSA0R, plane->dma[1]); | 181 | rcar_du_plane_write(rgrp, index, PnDSA0R, plane->dma[1]); |
180 | } | 182 | } |
@@ -294,10 +296,10 @@ static void __rcar_du_plane_setup(struct rcar_du_plane *plane, | |||
294 | rcar_du_plane_write(rgrp, index, PnDDCR4, ddcr4); | 296 | rcar_du_plane_write(rgrp, index, PnDDCR4, ddcr4); |
295 | 297 | ||
296 | /* Destination position and size */ | 298 | /* Destination position and size */ |
297 | rcar_du_plane_write(rgrp, index, PnDSXR, plane->width); | 299 | rcar_du_plane_write(rgrp, index, PnDSXR, plane->plane.state->crtc_w); |
298 | rcar_du_plane_write(rgrp, index, PnDSYR, plane->height); | 300 | rcar_du_plane_write(rgrp, index, PnDSYR, plane->plane.state->crtc_h); |
299 | rcar_du_plane_write(rgrp, index, PnDPXR, plane->dst_x); | 301 | rcar_du_plane_write(rgrp, index, PnDPXR, plane->plane.state->crtc_x); |
300 | rcar_du_plane_write(rgrp, index, PnDPYR, plane->dst_y); | 302 | rcar_du_plane_write(rgrp, index, PnDPYR, plane->plane.state->crtc_y); |
301 | 303 | ||
302 | /* Wrap-around and blinking, disabled */ | 304 | /* Wrap-around and blinking, disabled */ |
303 | rcar_du_plane_write(rgrp, index, PnWASPR, 0); | 305 | rcar_du_plane_write(rgrp, index, PnWASPR, 0); |
@@ -399,13 +401,6 @@ static void rcar_du_plane_atomic_update(struct drm_plane *plane, | |||
399 | rplane->crtc = state->crtc; | 401 | rplane->crtc = state->crtc; |
400 | rplane->format = format; | 402 | rplane->format = format; |
401 | 403 | ||
402 | rplane->src_x = state->src_x >> 16; | ||
403 | rplane->src_y = state->src_y >> 16; | ||
404 | rplane->dst_x = state->crtc_x; | ||
405 | rplane->dst_y = state->crtc_y; | ||
406 | rplane->width = state->crtc_w; | ||
407 | rplane->height = state->crtc_h; | ||
408 | |||
409 | rcar_du_plane_compute_base(rplane, state->fb); | 404 | rcar_du_plane_compute_base(rplane, state->fb); |
410 | rcar_du_plane_setup(rplane); | 405 | rcar_du_plane_setup(rplane); |
411 | 406 | ||
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.h b/drivers/gpu/drm/rcar-du/rcar_du_plane.h index 55d2f55faece..3420ff07f2c6 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.h | |||
@@ -47,14 +47,6 @@ struct rcar_du_plane { | |||
47 | 47 | ||
48 | unsigned long dma[2]; | 48 | unsigned long dma[2]; |
49 | unsigned int pitch; | 49 | unsigned int pitch; |
50 | |||
51 | unsigned int width; | ||
52 | unsigned int height; | ||
53 | |||
54 | unsigned int src_x; | ||
55 | unsigned int src_y; | ||
56 | unsigned int dst_x; | ||
57 | unsigned int dst_y; | ||
58 | }; | 50 | }; |
59 | 51 | ||
60 | struct rcar_du_planes { | 52 | struct rcar_du_planes { |