[media] exynos-gsc: Adding tiled multi-planar format to G-Scaler
authorShaik Ameer Basha <shaik.ameer@samsung.com>
Wed, 7 Nov 2012 06:37:07 +0000 (03:37 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 21 Dec 2012 12:18:48 +0000 (10:18 -0200)
Adding V4L2_PIX_FMT_NV12MT_16X16 to G-Scaler supported formats.
If the output or input format is V4L2_PIX_FMT_NV12MT_16X16, configure
G-Scaler to use GSC_IN_TILE_MODE.

[s.nawrocki: shortened the pixel format description]

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/exynos-gsc/gsc-core.c
drivers/media/platform/exynos-gsc/gsc-core.h
drivers/media/platform/exynos-gsc/gsc-regs.c

index cc7b218d047cffb5e48e0e031eaae6ae7a0bbffb..6d6f65d8c1e562c1be9ddda9d8bdebab9f3fb7d0 100644 (file)
@@ -185,6 +185,15 @@ static const struct gsc_fmt gsc_formats[] = {
                .corder         = GSC_CRCB,
                .num_planes     = 3,
                .num_comp       = 3,
+       }, {
+               .name           = "YUV 4:2:0 n.c. 2p, Y/CbCr tiled",
+               .pixelformat    = V4L2_PIX_FMT_NV12MT_16X16,
+               .depth          = { 8, 4 },
+               .color          = GSC_YUV420,
+               .yorder         = GSC_LSB_Y,
+               .corder         = GSC_CBCR,
+               .num_planes     = 2,
+               .num_comp       = 2,
        }
 };
 
index 5f157efd24f0fcc36f0bf72f7bf8fdf1b4a362c0..cc19bba09bd173720b2e8fc7b35813ea409da703 100644 (file)
@@ -427,6 +427,11 @@ static inline void gsc_ctx_state_lock_clear(u32 state, struct gsc_ctx *ctx)
        spin_unlock_irqrestore(&ctx->gsc_dev->slock, flags);
 }
 
+static inline int is_tiled(const struct gsc_fmt *fmt)
+{
+       return fmt->pixelformat == V4L2_PIX_FMT_NV12MT_16X16;
+}
+
 static inline void gsc_hw_enable_control(struct gsc_dev *dev, bool on)
 {
        u32 cfg = readl(dev->regs + GSC_ENABLE);
index 0146b354dc22a785961dfe0e1dd5df6214311c53..6f5b5a486cf361f8c52f74db5bc5e62e94a31491 100644 (file)
@@ -214,6 +214,9 @@ void gsc_hw_set_in_image_format(struct gsc_ctx *ctx)
                break;
        }
 
+       if (is_tiled(frame->fmt))
+               cfg |= GSC_IN_TILE_C_16x8 | GSC_IN_TILE_MODE;
+
        writel(cfg, dev->regs + GSC_IN_CON);
 }
 
@@ -334,6 +337,9 @@ void gsc_hw_set_out_image_format(struct gsc_ctx *ctx)
                break;
        }
 
+       if (is_tiled(frame->fmt))
+               cfg |= GSC_OUT_TILE_C_16x8 | GSC_OUT_TILE_MODE;
+
 end_set:
        writel(cfg, dev->regs + GSC_OUT_CON);
 }