diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-01-17 04:07:18 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-02-05 20:30:14 +0100 |
commit | 62ce272d87f09f34f70a9b3f783783af6c1a09d8 (patch) | |
tree | 7948ec1c0b9daaaae985b92aefaf362a74007d83 /drivers/media/platform/s5p-g2d/g2d.c | |
parent | [media] s5p-mfc: Use NULL instead of 0 for pointer (diff) | |
download | linux-62ce272d87f09f34f70a9b3f783783af6c1a09d8.tar.xz linux-62ce272d87f09f34f70a9b3f783783af6c1a09d8.zip |
[media] s5p-g2d: Add support for G2D H/W Rev.4.1
Modified the G2D driver (which initially supported only H/W Rev.3)
to support H/W Rev.4.1 present on Exynos4x12 and Exynos52x0 SOCs.
- Set the SRC and DST type to 'memory' instead of using reset values.
- FIMG2D v4.1 H/W uses different logic for stretching(scaling).
- Use CACHECTL_REG only with FIMG2D v3.
[s.nawrocki: removed empty line at end of file]]
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/s5p-g2d/g2d.c')
-rw-r--r-- | drivers/media/platform/s5p-g2d/g2d.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c index dcd53357704d..7e415297e174 100644 --- a/drivers/media/platform/s5p-g2d/g2d.c +++ b/drivers/media/platform/s5p-g2d/g2d.c @@ -604,8 +604,13 @@ static void device_run(void *prv) g2d_set_flip(dev, ctx->flip); if (ctx->in.c_width != ctx->out.c_width || - ctx->in.c_height != ctx->out.c_height) - cmd |= g2d_cmd_stretch(1); + ctx->in.c_height != ctx->out.c_height) { + if (dev->variant->hw_rev == TYPE_G2D_3X) + cmd |= CMD_V3_ENABLE_STRETCH; + else + g2d_set_v41_stretch(dev, &ctx->in, &ctx->out); + } + g2d_set_cmd(dev, cmd); g2d_start(dev); @@ -791,6 +796,7 @@ static int g2d_probe(struct platform_device *pdev) } def_frame.stride = (def_frame.width * def_frame.fmt->depth) >> 3; + dev->variant = g2d_get_drv_data(pdev); return 0; @@ -830,9 +836,30 @@ static int g2d_remove(struct platform_device *pdev) return 0; } +static struct g2d_variant g2d_drvdata_v3x = { + .hw_rev = TYPE_G2D_3X, +}; + +static struct g2d_variant g2d_drvdata_v4x = { + .hw_rev = TYPE_G2D_4X, /* Revision 4.1 for Exynos4X12 and Exynos5 */ +}; + +static struct platform_device_id g2d_driver_ids[] = { + { + .name = "s5p-g2d", + .driver_data = (unsigned long)&g2d_drvdata_v3x, + }, { + .name = "s5p-g2d-v4x", + .driver_data = (unsigned long)&g2d_drvdata_v4x, + }, + {}, +}; +MODULE_DEVICE_TABLE(platform, g2d_driver_ids); + static struct platform_driver g2d_pdrv = { .probe = g2d_probe, .remove = g2d_remove, + .id_table = g2d_driver_ids, .driver = { .name = G2D_NAME, .owner = THIS_MODULE, |