media: Fix P010 tiled format description
PATCH 1/1 media: Fix P010 tiled format description
There is only 31 bytes of space (without null character) for format description. P010 tiled format description overflows that for 1 character and warning is generated when used. Fix that by changing Cb to U and Cr to V, which is also consistent with some other descriptions.
--- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/v4l2-core/v4l2-ioctl.c +1 -1
@@ -1357,7 +1357,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_NV12_4L4 : descr ="Y/CbCr 4:2:0 (4x4 Linear)" ;break ;case V4L2_PIX_FMT_NV12_16L16 : descr ="Y/CbCr 4:2:0 (16x16 Linear)" ;break ;case V4L2_PIX_FMT_NV12_32L32 : descr ="Y/CbCr 4:2:0 (32x32 Linear)" ;break ; -case V4L2_PIX_FMT_P010_4L4 : descr ="10-bit Y/CbCr 4:2:0 (4x4 Linear)" ;break ; +case V4L2_PIX_FMT_P010_4L4 : descr ="10-bit Y/UV 4:2:0 (4x4 Linear)" ;break ;case V4L2_PIX_FMT_NV12M : descr ="Y/CbCr 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV21M : descr ="Y/CrCb 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV16M : descr ="Y/CbCr 4:2:2 (N-C)" ;break ;
Signature · 1 line
2.38.0
Hi Jernej,
Quoted 16 lines · Jernej Skrabec
There is only 31 bytes of space (without null character) for format description. P010 tiled format description overflows that for 1 character and warning is generated when used. Fix that by changing Cb to U and Cr to V, which is also consistent with some other descriptions.
Fixes 3c8e19d3d3f9 ("media: Add P010 tiled format")Signed-off-by Jernej Skrabec <[email protected]>--- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/v4l2-core/v4l2-ioctl.c +0
-0
drivers/media/v4l2-core/v4l2-ioctl.c static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) · line 1363
Quoted 8 lines
drivers/media/v4l2-core/v4l2-ioctl.c +1
-1@@ -1357,7 +1357,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)case V4L2_PIX_FMT_NV12_4L4 : descr ="Y/CbCr 4:2:0 (4x4 Linear)" ;break ;case V4L2_PIX_FMT_NV12_16L16 : descr ="Y/CbCr 4:2:0 (16x16 Linear)" ;break ;case V4L2_PIX_FMT_NV12_32L32 : descr ="Y/CbCr 4:2:0 (32x32 Linear)" ;break ; -case V4L2_PIX_FMT_P010_4L4 : descr ="10-bit Y/CbCr 4:2:0 (4x4 Linear)" ;break ; +case V4L2_PIX_FMT_P010_4L4 : descr ="10-bit Y/UV 4:2:0 (4x4 Linear)" ;break ;case V4L2_PIX_FMT_NV12M : descr ="Y/CbCr 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV21M : descr ="Y/CrCb 4:2:0 (N-C)" ;break ;case V4L2_PIX_FMT_NV16M : descr ="Y/CbCr 4:2:2 (N-C)" ;break ;
Sorry, I wasn't clear on irc: you should replace Cb and Cr with UV for ALL these descriptions.
That way all the pixelformat descriptions use the same terminology and it fixes your issue as well.
Regards,
Hans
Dne sobota, 15. oktober 2022 ob 10:59:28 CEST je Hans Verkuil napisal(a):
Quoted 15 lines
Hi Jernej,
Quoted 12 lines · Jernej Skrabec
There is only 31 bytes of space (without null character) for format description. P010 tiled format description overflows that for 1 character and warning is generated when used. Fix that by changing Cb to U and Cr to V, which is also consistent with some other descriptions.
Fixes 3c8e19d3d3f9 ("media: Add P010 tiled format")Signed-off-by Jernej Skrabec <[email protected]>---
drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
drivers/media/v4l2-core/v4l2-ioctl.c static void v4l_fill_fmtdesc(struct v4l2_fmtdesc · line 1358
Quoted 8 lines
(quoted diff) +0
-0
b/drivers/media/v4l2-core/v4l2-ioctl.cindexe6fd355a2e92..5e5616d5915a100644drivers/media/v4l2-core/v4l2-ioctl.c +0
-0@@ -1357,7 +1357,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)> case V4L2_PIX_FMT_NV12_4L4: descr = "Y/CbCr 4:2:0 (4x4
Linear)"; break;
Quoted 1 line
drivers/media/v4l2-core/v4l2-ioctl.c static void v4l_fill_fmtdesc(struct v4l2_fmtdesc · line 1359
Quoted 1 line
drivers/media/v4l2-core/v4l2-ioctl.c +0
-0case V4L2_PIX_FMT_NV12_16L16: descr = "Y/CbCr 4:2:0 (16x16
Linear)";
Quoted 2 lines
drivers/media/v4l2-core/v4l2-ioctl.c static void v4l_fill_fmtdesc(struct v4l2_fmtdesc · line 1361
Quoted 2 lines
drivers/media/v4l2-core/v4l2-ioctl.c +0
-0break ; case V4L2_PIX_FMT_NV12_32L32: descr = "Y/CbCr 4:2:0 (32x32
Linear)";
Quoted 2 lines
drivers/media/v4l2-core/v4l2-ioctl.c static void v4l_fill_fmtdesc(struct v4l2_fmtdesc · line 1363
Quoted 2 lines
drivers/media/v4l2-core/v4l2-ioctl.c +0
-1break;> - case V4L2_PIX_FMT_P010_4L4: descr = "10-bit Y/CbCr 4:2:0
(4x4 Linear)";
Quoted 1 line
Quoted 1 line
break; + case
V4L2_PIX_FMT_P010_4L4: descr = "10-bit Y/UV 4:2:0
(4x4
Quoted 2 lines
Quoted 2 lines
Linear)"; break;>
caseV4L2_PIX_FMT_NV12M: descr = "Y/CbCr 4:2:0 (N-C)";
break;
Quoted 1 line
Quoted 1 line
case
V4L2_PIX_FMT_NV21M: descr = "Y/CrCb 4:2:0 (N-C)";
break;
Quoted 1 line
Quoted 1 line
case
V4L2_PIX_FMT_NV16M: descr = "Y/CbCr 4:2:2 (N-C)";
break;
Quoted 6 lines
Sorry, I wasn't clear on irc: you should replace Cb and Cr with UV for ALL these descriptions.
That way all the pixelformat descriptions use the same terminology and it fixes your issue as well.
Ok, will do.
Best regards,
Jernej