]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/imx: Add support for interlaced scanout
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 11 Jul 2014 16:02:06 +0000 (18:02 +0200)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 31 Mar 2015 09:59:32 +0000 (11:59 +0200)
This patch allows interlaced frame buffer scanout for interlaced output
via HDMI or TV-Encoder.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/ipuv3-crtc.c
drivers/gpu/drm/imx/ipuv3-plane.c
drivers/gpu/drm/imx/ipuv3-plane.h

index 98551e356e12a4d2c2fdbff21b00a4e22e8b4f3f..09d6f98f4cbd427a548c23a9b410e2b0de523bdc 100644 (file)
@@ -202,7 +202,8 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc,
        return ipu_plane_mode_set(ipu_crtc->plane[0], crtc, mode,
                                  crtc->primary->fb,
                                  0, 0, mode->hdisplay, mode->vdisplay,
-                                 x, y, mode->hdisplay, mode->vdisplay);
+                                 x, y, mode->hdisplay, mode->vdisplay,
+                                 mode->flags & DRM_MODE_FLAG_INTERLACE);
 }
 
 static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc)
index 6987e16fe99b03f507307beddbe2ed228d603b8d..878a643d72e4c1cc7f9bbba257d88719b4b0703f 100644 (file)
@@ -99,7 +99,7 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,
                       struct drm_framebuffer *fb, int crtc_x, int crtc_y,
                       unsigned int crtc_w, unsigned int crtc_h,
                       uint32_t src_x, uint32_t src_y,
-                      uint32_t src_w, uint32_t src_h)
+                      uint32_t src_w, uint32_t src_h, bool interlaced)
 {
        struct device *dev = ipu_plane->base.dev->dev;
        int ret;
@@ -213,6 +213,8 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,
        ret = ipu_plane_set_base(ipu_plane, fb, src_x, src_y);
        if (ret < 0)
                return ret;
+       if (interlaced)
+               ipu_cpmem_interlaced_scan(ipu_plane->ipu_ch, fb->pitches[0]);
 
        ipu_plane->w = src_w;
        ipu_plane->h = src_h;
@@ -312,7 +314,8 @@ static int ipu_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 
        ret = ipu_plane_mode_set(ipu_plane, crtc, &crtc->hwmode, fb,
                        crtc_x, crtc_y, crtc_w, crtc_h,
-                       src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16);
+                       src_x >> 16, src_y >> 16, src_w >> 16, src_h >> 16,
+                       false);
        if (ret < 0) {
                ipu_plane_put_resources(ipu_plane);
                return ret;
index af125fb40ef5c03736a94f2b98968f9cf9a87426..9b5eff18f5b826b722d97b8e763dbd3017197aee 100644 (file)
@@ -42,7 +42,7 @@ int ipu_plane_mode_set(struct ipu_plane *plane, struct drm_crtc *crtc,
                       struct drm_framebuffer *fb, int crtc_x, int crtc_y,
                       unsigned int crtc_w, unsigned int crtc_h,
                       uint32_t src_x, uint32_t src_y, uint32_t src_w,
-                      uint32_t src_h);
+                      uint32_t src_h, bool interlaced);
 
 void ipu_plane_enable(struct ipu_plane *plane);
 void ipu_plane_disable(struct ipu_plane *plane);