summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArash Golgol <arash.golgol@gmail.com>2026-07-22 20:14:51 +0330
committerHans Verkuil <hverkuil+cisco@kernel.org>2026-07-28 15:17:54 +0200
commitad4c65fa30cfb00e2e06adae9a8eb407086eaa66 (patch)
tree5446c96c39ba13bb655bbf93d731fd07f7e84e4e
parent4e143d662ca94888b494b2427fc9e34494eb933a (diff)
downloadlinux-next-ad4c65fa30cfb00e2e06adae9a8eb407086eaa66.tar.gz
linux-next-ad4c65fa30cfb00e2e06adae9a8eb407086eaa66.zip
media: vimc: fix pixel format lookup in enum_framesizes
vimc_capture_enum_framesizes() looks up the requested format using vimc_pix_map_by_code(), which searches the pix map table by media bus code (MEDIA_BUS_FMT_*). However, v4l2_frmsizeenum::pixel_format holds a V4L2 pixel format (V4L2_PIX_FMT_*), not a media bus code, so valid pixel formats end up being rejected with -EINVAL. Fix this by using vimc_pix_map_by_pixelformat() instead, which performs the lookup by pixel format as the ioctl expects. Fixes: 09c41a23a2e2 ("media: Revert "media: vimc: propagate pixel format in the stream"") Cc: stable@vger.kernel.org Signed-off-by: Arash Golgol <arash.golgol@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
-rw-r--r--drivers/media/test-drivers/vimc/vimc-capture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/test-drivers/vimc/vimc-capture.c b/drivers/media/test-drivers/vimc/vimc-capture.c
index e0c6bc9f8f20..ac60c9b5418e 100644
--- a/drivers/media/test-drivers/vimc/vimc-capture.c
+++ b/drivers/media/test-drivers/vimc/vimc-capture.c
@@ -175,8 +175,8 @@ static int vimc_capture_enum_framesizes(struct file *file, void *priv,
if (fsize->index)
return -EINVAL;
- /* Only accept code in the pix map table */
- vpix = vimc_pix_map_by_code(fsize->pixel_format);
+ /* Only accept pixel_format in the pix map table */
+ vpix = vimc_pix_map_by_pixelformat(fsize->pixel_format);
if (!vpix)
return -EINVAL;