drm/exynos: fix x, y coordinates for right bottom pixel
The x, y coordinates of right bottom pixel cannot be negative numbers. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
This commit is contained in:
parent
60a705a9f9
commit
f56aad3a69
1 changed files with 11 additions and 7 deletions
|
@ -471,6 +471,8 @@ static void fimd_win_commit(struct device *dev, int zpos)
|
||||||
struct fimd_win_data *win_data;
|
struct fimd_win_data *win_data;
|
||||||
int win = zpos;
|
int win = zpos;
|
||||||
unsigned long val, alpha, size;
|
unsigned long val, alpha, size;
|
||||||
|
unsigned int last_x;
|
||||||
|
unsigned int last_y;
|
||||||
|
|
||||||
DRM_DEBUG_KMS("%s\n", __FILE__);
|
DRM_DEBUG_KMS("%s\n", __FILE__);
|
||||||
|
|
||||||
|
@ -524,16 +526,18 @@ static void fimd_win_commit(struct device *dev, int zpos)
|
||||||
VIDOSDxA_TOPLEFT_Y(win_data->offset_y);
|
VIDOSDxA_TOPLEFT_Y(win_data->offset_y);
|
||||||
writel(val, ctx->regs + VIDOSD_A(win));
|
writel(val, ctx->regs + VIDOSD_A(win));
|
||||||
|
|
||||||
val = VIDOSDxB_BOTRIGHT_X(win_data->offset_x +
|
last_x = win_data->offset_x + win_data->ovl_width;
|
||||||
win_data->ovl_width - 1) |
|
if (last_x)
|
||||||
VIDOSDxB_BOTRIGHT_Y(win_data->offset_y +
|
last_x--;
|
||||||
win_data->ovl_height - 1);
|
last_y = win_data->offset_y + win_data->ovl_height;
|
||||||
|
if (last_y)
|
||||||
|
last_y--;
|
||||||
|
|
||||||
|
val = VIDOSDxB_BOTRIGHT_X(last_x) | VIDOSDxB_BOTRIGHT_Y(last_y);
|
||||||
writel(val, ctx->regs + VIDOSD_B(win));
|
writel(val, ctx->regs + VIDOSD_B(win));
|
||||||
|
|
||||||
DRM_DEBUG_KMS("osd pos: tx = %d, ty = %d, bx = %d, by = %d\n",
|
DRM_DEBUG_KMS("osd pos: tx = %d, ty = %d, bx = %d, by = %d\n",
|
||||||
win_data->offset_x, win_data->offset_y,
|
win_data->offset_x, win_data->offset_y, last_x, last_y);
|
||||||
win_data->offset_x + win_data->ovl_width - 1,
|
|
||||||
win_data->offset_y + win_data->ovl_height - 1);
|
|
||||||
|
|
||||||
/* hardware window 0 doesn't support alpha channel. */
|
/* hardware window 0 doesn't support alpha channel. */
|
||||||
if (win != 0) {
|
if (win != 0) {
|
||||||
|
|
Loading…
Reference in a new issue