diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2012-12-14 01:48:23 -0500 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2012-12-14 01:54:36 -0500 |
commit | f56aad3a697a0189c76100236190e26c1f8e446b (patch) | |
tree | f93c840c3b3f61e09199946d2506f1a46e84bae4 /drivers/gpu/drm/exynos/exynos_drm_fimd.c | |
parent | 60a705a9f97b83b1daf03295bf123af84a46116a (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fimd.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimd.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 90ca4b279a0d..ae0153badaf9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -471,6 +471,8 @@ static void fimd_win_commit(struct device *dev, int zpos) | |||
471 | struct fimd_win_data *win_data; | 471 | struct fimd_win_data *win_data; |
472 | int win = zpos; | 472 | int win = zpos; |
473 | unsigned long val, alpha, size; | 473 | unsigned long val, alpha, size; |
474 | unsigned int last_x; | ||
475 | unsigned int last_y; | ||
474 | 476 | ||
475 | DRM_DEBUG_KMS("%s\n", __FILE__); | 477 | DRM_DEBUG_KMS("%s\n", __FILE__); |
476 | 478 | ||
@@ -524,16 +526,18 @@ static void fimd_win_commit(struct device *dev, int zpos) | |||
524 | VIDOSDxA_TOPLEFT_Y(win_data->offset_y); | 526 | VIDOSDxA_TOPLEFT_Y(win_data->offset_y); |
525 | writel(val, ctx->regs + VIDOSD_A(win)); | 527 | writel(val, ctx->regs + VIDOSD_A(win)); |
526 | 528 | ||
527 | val = VIDOSDxB_BOTRIGHT_X(win_data->offset_x + | 529 | last_x = win_data->offset_x + win_data->ovl_width; |
528 | win_data->ovl_width - 1) | | 530 | if (last_x) |
529 | VIDOSDxB_BOTRIGHT_Y(win_data->offset_y + | 531 | last_x--; |
530 | win_data->ovl_height - 1); | 532 | last_y = win_data->offset_y + win_data->ovl_height; |
533 | if (last_y) | ||
534 | last_y--; | ||
535 | |||
536 | val = VIDOSDxB_BOTRIGHT_X(last_x) | VIDOSDxB_BOTRIGHT_Y(last_y); | ||
531 | writel(val, ctx->regs + VIDOSD_B(win)); | 537 | writel(val, ctx->regs + VIDOSD_B(win)); |
532 | 538 | ||
533 | DRM_DEBUG_KMS("osd pos: tx = %d, ty = %d, bx = %d, by = %d\n", | 539 | DRM_DEBUG_KMS("osd pos: tx = %d, ty = %d, bx = %d, by = %d\n", |
534 | win_data->offset_x, win_data->offset_y, | 540 | win_data->offset_x, win_data->offset_y, last_x, last_y); |
535 | win_data->offset_x + win_data->ovl_width - 1, | ||
536 | win_data->offset_y + win_data->ovl_height - 1); | ||
537 | 541 | ||
538 | /* hardware window 0 doesn't support alpha channel. */ | 542 | /* hardware window 0 doesn't support alpha channel. */ |
539 | if (win != 0) { | 543 | if (win != 0) { |