mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
media: hantro: Fix JPEG encoder ENUM_FRMSIZE on RK3399
Since79c987de8b
, 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:79c987de8b
("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>
This commit is contained in:
parent
637046bb5a
commit
29bd426764
1 changed files with 5 additions and 2 deletions
|
@ -161,8 +161,11 @@ static int vidioc_enum_framesizes(struct file *file, void *priv,
|
|||
}
|
||||
|
||||
/* For non-coded formats check if postprocessing scaling is possible */
|
||||
if (fmt->codec_mode == HANTRO_MODE_NONE && hantro_needs_postproc(ctx, fmt)) {
|
||||
return hanto_postproc_enum_framesizes(ctx, fsize);
|
||||
if (fmt->codec_mode == HANTRO_MODE_NONE) {
|
||||
if (hantro_needs_postproc(ctx, fmt))
|
||||
return hanto_postproc_enum_framesizes(ctx, fsize);
|
||||
else
|
||||
return -ENOTTY;
|
||||
} else if (fsize->index != 0) {
|
||||
vpu_debug(0, "invalid frame size index (expected 0, got %d)\n",
|
||||
fsize->index);
|
||||
|
|
Loading…
Reference in a new issue