aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
diff options
context:
space:
mode:
authorJernej Skrabec <jernej.skrabec@siol.net>2019-11-10 07:30:01 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2019-11-10 07:30:01 +0100
commit3aef46bd5bf24a845e05d2531ed61f53ee8c7797 (patch)
tree82b371dcf63967e1278788de01ce6274765dac45 /drivers/staging/media/sunxi/cedrus/cedrus_hw.c
parentdf4a3e7f88e3b0d7ae46d70b9ff8e3c0ea730785 (diff)
media: cedrus: Properly signal size in mode register
Mode register also holds information if video width is bigger than 2048 and if it is equal to 4096. Rework cedrus_engine_enable() to properly signal this properties. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media/sunxi/cedrus/cedrus_hw.c')
-rw-r--r--drivers/staging/media/sunxi/cedrus/cedrus_hw.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
index 93347d3ba360..daf5f244f93b 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
@@ -30,7 +30,7 @@
#include "cedrus_hw.h"
#include "cedrus_regs.h"
-int cedrus_engine_enable(struct cedrus_dev *dev, enum cedrus_codec codec)
+int cedrus_engine_enable(struct cedrus_ctx *ctx, enum cedrus_codec codec)
{
u32 reg = 0;
@@ -58,7 +58,12 @@ int cedrus_engine_enable(struct cedrus_dev *dev, enum cedrus_codec codec)
return -EINVAL;
}
- cedrus_write(dev, VE_MODE, reg);
+ if (ctx->src_fmt.width == 4096)
+ reg |= VE_MODE_PIC_WIDTH_IS_4096;
+ if (ctx->src_fmt.width > 2048)
+ reg |= VE_MODE_PIC_WIDTH_MORE_2048;
+
+ cedrus_write(ctx->dev, VE_MODE, reg);
return 0;
}

Privacy Policy