Skip to contentSkip to conversation

media: Fix P010 tiled format description

PATCH In review Jernej Skrabec 2 participants 3 messages Oct 15, 2022 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

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.

Fixes 3c8e19d3d3f9 ("media: Add P010 tiled format")
---
 drivers/media/v4l2-core/v4l2-ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/v4l2-core/v4l2-ioctl.c +1 -1
index e6fd355a2e92..5e5616d5915a 100644
@@ -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
#1 lore raw

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")
---
 drivers/media/v4l2-core/v4l2-ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/v4l2-core/v4l2-ioctl.c +0 -0
index e6fd355a2e92..5e5616d5915a 100644

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

#2 lore raw

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")

---

 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.c index e6fd355a2e92..5e5616d5915a 100644

drivers/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 -0
 	case 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 -0
 	break;
 	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 -1
 	break;> 
-	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;>
case V4L2_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