]> git.baikalelectronics.ru Git - kernel.git/commit
media: hantro: Fix JPEG encoder ENUM_FRMSIZE on RK3399
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 23 Dec 2022 18:16:47 +0000 (19:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:43 +0000 (09:33 +0100)
commita2b70351b18558a593f7622c3ceb7dbc41aeecc4
treef10a42ca077fa9d1d8b0c17c8491bb3477b4ccf7
parent8d2f4e5a72a6c4110ea5dd18c3e2684ea1b86d1b
media: hantro: Fix JPEG encoder ENUM_FRMSIZE on RK3399

[ Upstream commit 3debfe3fd302f5d03fc104d8f80ba64a7cdc725f ]

Since f497f696d2c9a, enumerating framesize on format set with "MODE_NONE"
(any raw formats) is reporting an invalid frmsize.

  Size: Stepwise 0x0 - 0x0 with step 0/0

Before this change, the driver would return EINVAL, which is also invalid
but worked in GStreamer. The original intent was not to implement it, hence
the -ENOTTY return in this change. While drivers should implement
ENUM_FRMSIZE for all formats and queues, this change is limited in scope to
fix the regression.

This fixes taking picture in Gnome Cheese software, or any software using
GSteamer to encode JPEG with hardware acceleration.

Fixes: f497f696d2c9 ("media: hantro: Use post processor scaling capacities")
Reported-by: Robert Mader <robert.mader@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Robert Mader <robert.mader@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/verisilicon/hantro_v4l2.c