diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-05-15 06:40:08 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-06-02 04:04:17 -0400 |
commit | 218ed5358a4045382674f8feeee0efb526f9431b (patch) | |
tree | 79255e2496c91d8a6adf6bee873cc2fdc507a49e /drivers/gpu/drm/omapdrm/omap_fb.c | |
parent | 8958aeb9c7bc86c89667af049243c47836111ab7 (diff) |
drm/omap: remove omap_drm_win
struct omap_drm_window is only used to pass plane setup data to
omap_framebuffer_update_scanout(). This can as well be accomplished by
just passing the DRM state.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fb.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_fb.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 2f461d427924..4093e0e38a90 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c | |||
@@ -155,7 +155,7 @@ static uint32_t drm_rotation_to_tiler(unsigned int drm_rot) | |||
155 | /* update ovl info for scanout, handles cases of multi-planar fb's, etc. | 155 | /* update ovl info for scanout, handles cases of multi-planar fb's, etc. |
156 | */ | 156 | */ |
157 | void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, | 157 | void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, |
158 | struct omap_drm_window *win, struct omap_overlay_info *info) | 158 | struct drm_plane_state *state, struct omap_overlay_info *info) |
159 | { | 159 | { |
160 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); | 160 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); |
161 | const struct drm_format_info *format = omap_fb->format; | 161 | const struct drm_format_info *format = omap_fb->format; |
@@ -164,25 +164,27 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, | |||
164 | 164 | ||
165 | info->fourcc = fb->format->format; | 165 | info->fourcc = fb->format->format; |
166 | 166 | ||
167 | info->pos_x = win->crtc_x; | 167 | info->pos_x = state->crtc_x; |
168 | info->pos_y = win->crtc_y; | 168 | info->pos_y = state->crtc_y; |
169 | info->out_width = win->crtc_w; | 169 | info->out_width = state->crtc_w; |
170 | info->out_height = win->crtc_h; | 170 | info->out_height = state->crtc_h; |
171 | info->width = win->src_w; | 171 | info->width = state->src_w >> 16; |
172 | info->height = win->src_h; | 172 | info->height = state->src_h >> 16; |
173 | 173 | ||
174 | x = win->src_x; | 174 | /* DSS driver wants the w & h in rotated orientation */ |
175 | y = win->src_y; | 175 | if (drm_rotation_90_or_270(state->rotation)) |
176 | swap(info->width, info->height); | ||
177 | |||
178 | x = state->src_x >> 16; | ||
179 | y = state->src_y >> 16; | ||
176 | 180 | ||
177 | if (omap_gem_flags(plane->bo) & OMAP_BO_TILED) { | 181 | if (omap_gem_flags(plane->bo) & OMAP_BO_TILED) { |
178 | uint32_t w = win->src_w; | 182 | uint32_t w = state->src_w >> 16; |
179 | uint32_t h = win->src_h; | 183 | uint32_t h = state->src_h >> 16; |
180 | 184 | ||
181 | orient = drm_rotation_to_tiler(win->rotation); | 185 | orient = drm_rotation_to_tiler(state->rotation); |
182 | 186 | ||
183 | /* adjust x,y offset for flip/invert: */ | 187 | /* adjust x,y offset for invert: */ |
184 | if (orient & MASK_XY_FLIP) | ||
185 | swap(w, h); | ||
186 | if (orient & MASK_Y_INVERT) | 188 | if (orient & MASK_Y_INVERT) |
187 | y += h - 1; | 189 | y += h - 1; |
188 | if (orient & MASK_X_INVERT) | 190 | if (orient & MASK_X_INVERT) |
@@ -193,7 +195,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, | |||
193 | info->rotation_type = OMAP_DSS_ROT_TILER; | 195 | info->rotation_type = OMAP_DSS_ROT_TILER; |
194 | info->screen_width = omap_gem_tiled_stride(plane->bo, orient); | 196 | info->screen_width = omap_gem_tiled_stride(plane->bo, orient); |
195 | } else { | 197 | } else { |
196 | switch (win->rotation & DRM_MODE_ROTATE_MASK) { | 198 | switch (state->rotation & DRM_MODE_ROTATE_MASK) { |
197 | case 0: | 199 | case 0: |
198 | case DRM_MODE_ROTATE_0: | 200 | case DRM_MODE_ROTATE_0: |
199 | /* OK */ | 201 | /* OK */ |
@@ -202,8 +204,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, | |||
202 | default: | 204 | default: |
203 | dev_warn(fb->dev->dev, | 205 | dev_warn(fb->dev->dev, |
204 | "rotation '%d' ignored for non-tiled fb\n", | 206 | "rotation '%d' ignored for non-tiled fb\n", |
205 | win->rotation); | 207 | state->rotation); |
206 | win->rotation = 0; | ||
207 | break; | 208 | break; |
208 | } | 209 | } |
209 | 210 | ||