Patch "media: hantro: Fix JPEG encoder ENUM_FRMSIZE on RK3399" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    media: hantro: Fix JPEG encoder ENUM_FRMSIZE on RK3399

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     media-hantro-fix-jpeg-encoder-enum_frmsize-on-rk3399.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 72cc273b05e122964a7d13ae94672f830d30df11
Author: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx>
Date:   Fri Dec 23 19:16:47 2022 +0100

    media: hantro: Fix JPEG encoder ENUM_FRMSIZE on RK3399
    
    [ Upstream commit 29bd426764dee14a09e37700406f4a5920825fcc ]
    
    Since 79c987de8b354, 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: 79c987de8b35 ("media: hantro: Use post processor scaling capacities")
    Reported-by: Robert Mader <robert.mader@xxxxxxxxxxxxx>
    Signed-off-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx>
    Reviewed-by: Benjamin Gaignard <benjamin.gaignard@xxxxxxxxxxxxx>
    Reviewed-by: Ezequiel Garcia <ezequiel@xxxxxxxxxxxxxxxxxxxx>
    Tested-by: Robert Mader <robert.mader@xxxxxxxxxxxxx>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
index 2c7a805289e7b..30e650edaea8a 100644
--- a/drivers/media/platform/verisilicon/hantro_v4l2.c
+++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
@@ -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);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux