summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_plane.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2015-04-07 15:59:39 +0900
committerInki Dae <inki.dae@samsung.com>2015-04-13 11:39:41 +0900
commit3cabaf7ea7044d6a75fd76e2fc53304a55abe965 (patch)
tree0e3e9eed4bb33e4a5121e5eed2b93ee3674e9434 /drivers/gpu/drm/exynos/exynos_drm_plane.c
parentcb8a3db29f8fa8186185ba716f3f485a7f3fabe7 (diff)
downloadtalos-obmc-linux-3cabaf7ea7044d6a75fd76e2fc53304a55abe965.tar.gz
talos-obmc-linux-3cabaf7ea7044d6a75fd76e2fc53304a55abe965.zip
drm/exynos: add ratio calculation
Calculation ratio from exynos_drm plane codes, then each hw drivers can use it without extra operation. Also this fixes width and height of source used for actual crtc shown via screen. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_plane.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_plane.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index 5cb4ced9c4b5..13ea3349363b 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -110,11 +110,15 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,
crtc_y = 0;
}
+ /* set ratio */
+ exynos_plane->h_ratio = (src_w << 16) / crtc_w;
+ exynos_plane->v_ratio = (src_h << 16) / crtc_h;
+
/* set drm framebuffer data. */
exynos_plane->src_x = src_x;
exynos_plane->src_y = src_y;
- exynos_plane->src_width = src_w;
- exynos_plane->src_height = src_h;
+ exynos_plane->src_width = (actual_w * exynos_plane->h_ratio) >> 16;
+ exynos_plane->src_height = (actual_h * exynos_plane->v_ratio) >> 16;
exynos_plane->fb_width = fb->width;
exynos_plane->fb_height = fb->height;
exynos_plane->bpp = fb->bits_per_pixel;
OpenPOWER on IntegriCloud