Commit 218ed535 authored by Tomi Valkeinen's avatar Tomi Valkeinen

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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 8958aeb9
...@@ -38,15 +38,6 @@ ...@@ -38,15 +38,6 @@
struct omap_drm_usergart; struct omap_drm_usergart;
/* parameters which describe (unrotated) coordinates of scanout within a fb: */
struct omap_drm_window {
uint32_t rotation;
int32_t crtc_x, crtc_y; /* signed because can be offscreen */
uint32_t crtc_w, crtc_h;
uint32_t src_x, src_y;
uint32_t src_w, src_h;
};
/* For KMS code that needs to wait for a certain # of IRQs: /* For KMS code that needs to wait for a certain # of IRQs:
*/ */
struct omap_irq_wait; struct omap_irq_wait;
...@@ -157,7 +148,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, ...@@ -157,7 +148,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
int omap_framebuffer_pin(struct drm_framebuffer *fb); int omap_framebuffer_pin(struct drm_framebuffer *fb);
void omap_framebuffer_unpin(struct drm_framebuffer *fb); void omap_framebuffer_unpin(struct drm_framebuffer *fb);
void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
struct omap_drm_window *win, struct omap_overlay_info *info); struct drm_plane_state *state, struct omap_overlay_info *info);
struct drm_connector *omap_framebuffer_get_next_connector( struct drm_connector *omap_framebuffer_get_next_connector(
struct drm_framebuffer *fb, struct drm_connector *from); struct drm_framebuffer *fb, struct drm_connector *from);
bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb); bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb);
......
...@@ -155,7 +155,7 @@ static uint32_t drm_rotation_to_tiler(unsigned int drm_rot) ...@@ -155,7 +155,7 @@ static uint32_t drm_rotation_to_tiler(unsigned int drm_rot)
/* update ovl info for scanout, handles cases of multi-planar fb's, etc. /* update ovl info for scanout, handles cases of multi-planar fb's, etc.
*/ */
void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
struct omap_drm_window *win, struct omap_overlay_info *info) struct drm_plane_state *state, struct omap_overlay_info *info)
{ {
struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb);
const struct drm_format_info *format = omap_fb->format; const struct drm_format_info *format = omap_fb->format;
...@@ -164,25 +164,27 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, ...@@ -164,25 +164,27 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
info->fourcc = fb->format->format; info->fourcc = fb->format->format;
info->pos_x = win->crtc_x; info->pos_x = state->crtc_x;
info->pos_y = win->crtc_y; info->pos_y = state->crtc_y;
info->out_width = win->crtc_w; info->out_width = state->crtc_w;
info->out_height = win->crtc_h; info->out_height = state->crtc_h;
info->width = win->src_w; info->width = state->src_w >> 16;
info->height = win->src_h; info->height = state->src_h >> 16;
x = win->src_x; /* DSS driver wants the w & h in rotated orientation */
y = win->src_y; if (drm_rotation_90_or_270(state->rotation))
swap(info->width, info->height);
x = state->src_x >> 16;
y = state->src_y >> 16;
if (omap_gem_flags(plane->bo) & OMAP_BO_TILED) { if (omap_gem_flags(plane->bo) & OMAP_BO_TILED) {
uint32_t w = win->src_w; uint32_t w = state->src_w >> 16;
uint32_t h = win->src_h; uint32_t h = state->src_h >> 16;
orient = drm_rotation_to_tiler(win->rotation); orient = drm_rotation_to_tiler(state->rotation);
/* adjust x,y offset for flip/invert: */ /* adjust x,y offset for invert: */
if (orient & MASK_XY_FLIP)
swap(w, h);
if (orient & MASK_Y_INVERT) if (orient & MASK_Y_INVERT)
y += h - 1; y += h - 1;
if (orient & MASK_X_INVERT) if (orient & MASK_X_INVERT)
...@@ -193,7 +195,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, ...@@ -193,7 +195,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
info->rotation_type = OMAP_DSS_ROT_TILER; info->rotation_type = OMAP_DSS_ROT_TILER;
info->screen_width = omap_gem_tiled_stride(plane->bo, orient); info->screen_width = omap_gem_tiled_stride(plane->bo, orient);
} else { } else {
switch (win->rotation & DRM_MODE_ROTATE_MASK) { switch (state->rotation & DRM_MODE_ROTATE_MASK) {
case 0: case 0:
case DRM_MODE_ROTATE_0: case DRM_MODE_ROTATE_0:
/* OK */ /* OK */
...@@ -202,8 +204,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, ...@@ -202,8 +204,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
default: default:
dev_warn(fb->dev->dev, dev_warn(fb->dev->dev,
"rotation '%d' ignored for non-tiled fb\n", "rotation '%d' ignored for non-tiled fb\n",
win->rotation); state->rotation);
win->rotation = 0;
break; break;
} }
......
...@@ -59,7 +59,6 @@ static void omap_plane_atomic_update(struct drm_plane *plane, ...@@ -59,7 +59,6 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
struct omap_plane *omap_plane = to_omap_plane(plane); struct omap_plane *omap_plane = to_omap_plane(plane);
struct drm_plane_state *state = plane->state; struct drm_plane_state *state = plane->state;
struct omap_overlay_info info; struct omap_overlay_info info;
struct omap_drm_window win;
int ret; int ret;
DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb); DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb);
...@@ -71,30 +70,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, ...@@ -71,30 +70,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
info.mirror = 0; info.mirror = 0;
info.zorder = state->zpos; info.zorder = state->zpos;
memset(&win, 0, sizeof(win));
win.rotation = state->rotation;
win.crtc_x = state->crtc_x;
win.crtc_y = state->crtc_y;
win.crtc_w = state->crtc_w;
win.crtc_h = state->crtc_h;
/*
* src values are in Q16 fixed point, convert to integer.
* omap_framebuffer_update_scanout() takes adjusted src.
*/
win.src_x = state->src_x >> 16;
win.src_y = state->src_y >> 16;
if (drm_rotation_90_or_270(state->rotation)) {
win.src_w = state->src_h >> 16;
win.src_h = state->src_w >> 16;
} else {
win.src_w = state->src_w >> 16;
win.src_h = state->src_h >> 16;
}
/* update scanout: */ /* update scanout: */
omap_framebuffer_update_scanout(state->fb, &win, &info); omap_framebuffer_update_scanout(state->fb, state, &info);
DBG("%dx%d -> %dx%d (%d)", info.width, info.height, DBG("%dx%d -> %dx%d (%d)", info.width, info.height,
info.out_width, info.out_height, info.out_width, info.out_height,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment