media: cedrus: Add a quirk for not setting DMA offset
authorJernej Skrabec <jernej.skrabec@siol.net>
Mon, 28 Jan 2019 20:55:00 +0000 (15:55 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 19 Mar 2019 17:55:45 +0000 (13:55 -0400)
H6 VPU doesn't work if DMA offset is set.

Add a quirk for it.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/staging/media/sunxi/cedrus/cedrus.h
drivers/staging/media/sunxi/cedrus/cedrus_hw.c

index 4aedd24a9848013ce469d2211607b05a72a3b2e6..c57c04b41d2e8f451a1d5628644c1209b01de3cb 100644 (file)
@@ -28,6 +28,8 @@
 
 #define CEDRUS_CAPABILITY_UNTILED      BIT(0)
 
+#define CEDRUS_QUIRK_NO_DMA_OFFSET     BIT(0)
+
 enum cedrus_codec {
        CEDRUS_CODEC_MPEG2,
 
@@ -91,6 +93,7 @@ struct cedrus_dec_ops {
 
 struct cedrus_variant {
        unsigned int    capabilities;
+       unsigned int    quirks;
 };
 
 struct cedrus_dev {
index 0acf219a8c9186b1a708c7b4a368a44d351611a5..fbfff7c1c771f78e85eb366443a0e469f56b8686 100644 (file)
@@ -177,7 +177,8 @@ int cedrus_hw_probe(struct cedrus_dev *dev)
         */
 
 #ifdef PHYS_PFN_OFFSET
-       dev->dev->dma_pfn_offset = PHYS_PFN_OFFSET;
+       if (!(variant->quirks & CEDRUS_QUIRK_NO_DMA_OFFSET))
+               dev->dev->dma_pfn_offset = PHYS_PFN_OFFSET;
 #endif
 
        ret = of_reserved_mem_device_init(dev->dev);