summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/allegro-dvt/allegro-mail.c
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-12-03 12:01:06 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-27 16:15:04 +0100
commitb08797d1b2ec25165768c841a2ac484fecd72be1 (patch)
treeb0e01415539b134a0adaadedd86c65daa11be246 /drivers/media/platform/allegro-dvt/allegro-mail.c
parent99b05ce74ceeb474ff4db37a0861b135063b7c7f (diff)
downloadlinux-b08797d1b2ec25165768c841a2ac484fecd72be1.tar.bz2
media: allegro: add support for HEVC encoding
The Allegro Codec supports HEVC encoding. The messages to the MCU are the same for H.264 and HEVC, but some options have to be changed. These are actually only a few options. The driver, however, must add the HEVC VPS/SPS/PPS NAL Units to the coded stream and must properly provide the HEVC format and controls to user space. [hverkuil: fix warning for wrong enum type (h264 instead of hevc)] Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/allegro-dvt/allegro-mail.c')
-rw-r--r--drivers/media/platform/allegro-dvt/allegro-mail.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/platform/allegro-dvt/allegro-mail.c b/drivers/media/platform/allegro-dvt/allegro-mail.c
index 5dbc1c029020..7e08c5050f2e 100644
--- a/drivers/media/platform/allegro-dvt/allegro-mail.c
+++ b/drivers/media/platform/allegro-dvt/allegro-mail.c
@@ -67,12 +67,16 @@ static inline u32 settings_get_mcu_codec(struct create_channel_param *param)
if (version < MCU_MSG_VERSION_2019_2) {
switch (pixelformat) {
+ case V4L2_PIX_FMT_HEVC:
+ return 2;
case V4L2_PIX_FMT_H264:
default:
return 1;
}
} else {
switch (pixelformat) {
+ case V4L2_PIX_FMT_HEVC:
+ return 1;
case V4L2_PIX_FMT_H264:
default:
return 0;
@@ -117,7 +121,9 @@ allegro_encode_config_blob(u32 *dst, struct create_channel_param *param)
dst[i++] = val;
val = 0;
+ val |= param->enable_reordering ? BIT(0) : 0;
val |= param->dbf_ovr_en ? BIT(2) : 0;
+ val |= param->override_lf ? BIT(12) : 0;
dst[i++] = val;
if (version >= MCU_MSG_VERSION_2019_2) {