]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/exynos: added source size to overlay structure
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 24 Apr 2012 09:43:10 +0000 (18:43 +0900)
committerInki Dae <inki.dae@samsung.com>
Thu, 17 May 2012 11:14:29 +0000 (20:14 +0900)
Set plane has source size but exynos overlay structure did
not consider it. This patch adds source size to overlay
structure. For set crtc, source size is set from crtc size.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_crtc.h
drivers/gpu/drm/exynos/exynos_drm_drv.h
drivers/gpu/drm/exynos/exynos_drm_plane.c

index 3486ffed0bf05935082965327c11eb3b679a55af..4afb625128d787bc5824f3737c92f9885f38b3bb 100644 (file)
@@ -105,6 +105,8 @@ int exynos_drm_overlay_update(struct exynos_drm_overlay *overlay,
        overlay->fb_y = pos->fb_y;
        overlay->fb_width = fb->width;
        overlay->fb_height = fb->height;
+       overlay->src_width = pos->src_w;
+       overlay->src_height = pos->src_h;
        overlay->bpp = fb->bits_per_pixel;
        overlay->pitch = fb->pitches[0];
        overlay->pixel_format = fb->pixel_format;
@@ -153,6 +155,8 @@ static int exynos_drm_crtc_update(struct drm_crtc *crtc)
        pos.crtc_y = 0;
        pos.crtc_w = fb->width - crtc->x;
        pos.crtc_h = fb->height - crtc->y;
+       pos.src_w = pos.crtc_w;
+       pos.src_h = pos.crtc_h;
 
        return exynos_drm_overlay_update(overlay, crtc->fb, mode, &pos);
 }
index 25f72a62cb880b757b54e0514693eedd624ce27b..16b8e2195a0de2f1b8778b697e707f50f527843f 100644 (file)
@@ -42,6 +42,8 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc);
  *     - the unit is screen coordinates.
  * @fb_y: offset y on a framebuffer to be displayed
  *     - the unit is screen coordinates.
+ * @src_w: width of source area to be displayed from a framebuffer.
+ * @src_h: height of source area to be displayed from a framebuffer.
  * @crtc_x: offset x on hardware screen.
  * @crtc_y: offset y on hardware screen.
  * @crtc_w: width of hardware screen.
@@ -50,6 +52,8 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int crtc);
 struct exynos_drm_crtc_pos {
        unsigned int fb_x;
        unsigned int fb_y;
+       unsigned int src_w;
+       unsigned int src_h;
        unsigned int crtc_x;
        unsigned int crtc_y;
        unsigned int crtc_w;
index 1d814175cd491d39d0411b31fa330c498f02c8c3..5f5b36256731609cd77dccb7eff40638cdb39573 100644 (file)
@@ -77,6 +77,8 @@ struct exynos_drm_overlay_ops {
  *     - the unit is screen coordinates.
  * @fb_width: width of a framebuffer.
  * @fb_height: height of a framebuffer.
+ * @src_width: width of a partial image to be displayed from framebuffer.
+ * @src_height: height of a partial image to be displayed from framebuffer.
  * @crtc_x: offset x on hardware screen.
  * @crtc_y: offset y on hardware screen.
  * @crtc_width: window width to be displayed (hardware screen).
@@ -108,6 +110,8 @@ struct exynos_drm_overlay {
        unsigned int fb_y;
        unsigned int fb_width;
        unsigned int fb_height;
+       unsigned int src_width;
+       unsigned int src_height;
        unsigned int crtc_x;
        unsigned int crtc_y;
        unsigned int crtc_width;
index f92fe4c6174ad163bf250786e77949c9e2d9230e..c4c6525d46532392414902079ec5aa18efdedfbc 100644 (file)
@@ -41,8 +41,6 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
                container_of(plane, struct exynos_plane, base);
        struct exynos_drm_overlay *overlay = &exynos_plane->overlay;
        struct exynos_drm_crtc_pos pos;
-       unsigned int x = src_x >> 16;
-       unsigned int y = src_y >> 16;
        int ret;
 
        DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
@@ -53,10 +51,12 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
        pos.crtc_w = crtc_w;
        pos.crtc_h = crtc_h;
 
-       pos.fb_x = x;
-       pos.fb_y = y;
+       /* considering 16.16 fixed point of source values */
+       pos.fb_x = src_x >> 16;
+       pos.fb_y = src_y >> 16;
+       pos.src_w = src_w >> 16;
+       pos.src_h = src_h >> 16;
 
-       /* TODO: scale feature */
        ret = exynos_drm_overlay_update(overlay, fb, &crtc->mode, &pos);
        if (ret < 0)
                return ret;