Commit a350da8b authored by Laurent Pinchart's avatar Laurent Pinchart

drm: omapdrm: Pass integer source coordinates to omap_plane_mode_set()

The function will convert the Q16 source coordinates to integers, avoid
converting integers to Q16 first and perform the opposite conversion.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 2a438c5b
...@@ -308,8 +308,7 @@ static int omap_crtc_mode_set(struct drm_crtc *crtc, ...@@ -308,8 +308,7 @@ static int omap_crtc_mode_set(struct drm_crtc *crtc,
return omap_plane_mode_set(crtc->primary, crtc, crtc->primary->fb, return omap_plane_mode_set(crtc->primary, crtc, crtc->primary->fb,
0, 0, mode->hdisplay, mode->vdisplay, 0, 0, mode->hdisplay, mode->vdisplay,
x << 16, y << 16, x, y, mode->hdisplay, mode->vdisplay,
mode->hdisplay << 16, mode->vdisplay << 16,
NULL, NULL); NULL, NULL);
} }
...@@ -335,8 +334,7 @@ static int omap_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, ...@@ -335,8 +334,7 @@ static int omap_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
return omap_plane_mode_set(plane, crtc, crtc->primary->fb, return omap_plane_mode_set(plane, crtc, crtc->primary->fb,
0, 0, mode->hdisplay, mode->vdisplay, 0, 0, mode->hdisplay, mode->vdisplay,
x << 16, y << 16, x, y, mode->hdisplay, mode->vdisplay,
mode->hdisplay << 16, mode->vdisplay << 16,
NULL, NULL); NULL, NULL);
} }
...@@ -370,8 +368,7 @@ static void page_flip_worker(struct work_struct *work) ...@@ -370,8 +368,7 @@ static void page_flip_worker(struct work_struct *work)
drm_modeset_lock(&crtc->mutex, NULL); drm_modeset_lock(&crtc->mutex, NULL);
omap_plane_mode_set(crtc->primary, crtc, crtc->primary->fb, omap_plane_mode_set(crtc->primary, crtc, crtc->primary->fb,
0, 0, mode->hdisplay, mode->vdisplay, 0, 0, mode->hdisplay, mode->vdisplay,
crtc->x << 16, crtc->y << 16, crtc->x, crtc->y, mode->hdisplay, mode->vdisplay,
mode->hdisplay << 16, mode->vdisplay << 16,
vblank_cb, crtc); vblank_cb, crtc);
drm_modeset_unlock(&crtc->mutex); drm_modeset_unlock(&crtc->mutex);
......
...@@ -166,8 +166,8 @@ int omap_plane_mode_set(struct drm_plane *plane, ...@@ -166,8 +166,8 @@ int omap_plane_mode_set(struct drm_plane *plane,
struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_crtc *crtc, struct drm_framebuffer *fb,
int crtc_x, int crtc_y, int crtc_x, int crtc_y,
unsigned int crtc_w, unsigned int crtc_h, unsigned int crtc_w, unsigned int crtc_h,
uint32_t src_x, uint32_t src_y, unsigned int src_x, unsigned int src_y,
uint32_t src_w, uint32_t src_h, unsigned int src_w, unsigned int src_h,
void (*fxn)(void *), void *arg); void (*fxn)(void *), void *arg);
void omap_plane_install_properties(struct drm_plane *plane, void omap_plane_install_properties(struct drm_plane *plane,
struct drm_mode_object *obj); struct drm_mode_object *obj);
......
...@@ -187,8 +187,8 @@ int omap_plane_mode_set(struct drm_plane *plane, ...@@ -187,8 +187,8 @@ int omap_plane_mode_set(struct drm_plane *plane,
struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_crtc *crtc, struct drm_framebuffer *fb,
int crtc_x, int crtc_y, int crtc_x, int crtc_y,
unsigned int crtc_w, unsigned int crtc_h, unsigned int crtc_w, unsigned int crtc_h,
uint32_t src_x, uint32_t src_y, unsigned int src_x, unsigned int src_y,
uint32_t src_w, uint32_t src_h, unsigned int src_w, unsigned int src_h,
void (*fxn)(void *), void *arg) void (*fxn)(void *), void *arg)
{ {
struct omap_plane *omap_plane = to_omap_plane(plane); struct omap_plane *omap_plane = to_omap_plane(plane);
...@@ -199,11 +199,10 @@ int omap_plane_mode_set(struct drm_plane *plane, ...@@ -199,11 +199,10 @@ int omap_plane_mode_set(struct drm_plane *plane,
win->crtc_w = crtc_w; win->crtc_w = crtc_w;
win->crtc_h = crtc_h; win->crtc_h = crtc_h;
/* src values are in Q16 fixed point, convert to integer: */ win->src_x = src_x;
win->src_x = src_x >> 16; win->src_y = src_y;
win->src_y = src_y >> 16; win->src_w = src_w;
win->src_w = src_w >> 16; win->src_h = src_h;
win->src_h = src_h >> 16;
if (fxn) { if (fxn) {
/* omap_crtc should ensure that a new page flip /* omap_crtc should ensure that a new page flip
...@@ -243,9 +242,10 @@ static int omap_plane_update(struct drm_plane *plane, ...@@ -243,9 +242,10 @@ static int omap_plane_update(struct drm_plane *plane,
plane->fb = fb; plane->fb = fb;
plane->crtc = crtc; plane->crtc = crtc;
/* src values are in Q16 fixed point, convert to integer: */
return omap_plane_mode_set(plane, crtc, fb, return omap_plane_mode_set(plane, crtc, fb,
crtc_x, crtc_y, crtc_w, crtc_h, crtc_x, crtc_y, crtc_w, crtc_h,
src_x, src_y, src_w, src_h, src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16,
NULL, NULL); NULL, NULL);
} }
......
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