drm/exynos: gsc: Use real buffer width for configuring the hardware
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 28 May 2018 12:10:14 +0000 (14:10 +0200)
committerInki Dae <inki.dae@samsung.com>
Mon, 3 Dec 2018 00:56:49 +0000 (09:56 +0900)
DMA hardware should respect buffer pitch, so use the width calculated from
the buffer pitch instead of the virtual one.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Id35299775cb6064e4c0af4542c34061223ff9d16

drivers/gpu/drm/exynos/exynos_drm_gsc.c

index 9d4af1921545250c9559487624637d389b545b4e..0ad5346de038ce9d6d7f21eeb190930b8da5f948 100644 (file)
@@ -581,7 +581,7 @@ static void gsc_src_set_size(struct gsc_context *ctx,
        cfg &= ~(GSC_SRCIMG_HEIGHT_MASK |
                GSC_SRCIMG_WIDTH_MASK);
 
-       cfg |= (GSC_SRCIMG_WIDTH(buf->buf.width) |
+       cfg |= (GSC_SRCIMG_WIDTH(buf->buf.pitch[0] / buf->format->cpp[0]) |
                GSC_SRCIMG_HEIGHT(buf->buf.height));
 
        gsc_write(cfg, GSC_SRCIMG_SIZE);
@@ -879,7 +879,7 @@ static void gsc_dst_set_size(struct gsc_context *ctx,
        /* original size */
        cfg = gsc_read(GSC_DSTIMG_SIZE);
        cfg &= ~(GSC_DSTIMG_HEIGHT_MASK | GSC_DSTIMG_WIDTH_MASK);
-       cfg |= GSC_DSTIMG_WIDTH(buf->buf.width) |
+       cfg |= GSC_DSTIMG_WIDTH(buf->buf.pitch[0] / buf->format->cpp[0]) |
               GSC_DSTIMG_HEIGHT(buf->buf.height);
        gsc_write(cfg, GSC_DSTIMG_SIZE);