Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
@ 2026-05-21  9:24 Neil Armstrong
  2026-05-21  9:24 ` [PATCH v4 1/6] media: qcom: iris: add helpers for 8bit and " Neil Armstrong
                   ` (7 more replies)
  0 siblings, 8 replies; 23+ messages in thread
From: Neil Armstrong @ 2026-05-21  9:24 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Neil Armstrong,
	Dmitry Baryshkov, Bryan O'Donoghue

This adds the plumbing to support decoding HEVC, VP9 and AV1
streams into 10bit pixel formats, linear and compressed.

This has only been tested on SM8550 & SM8650 with HEVC, and was
inspired by Venus, DRM MSM and the downstream vidc driver for the
buffer calculations and HFI messages.

Gstreamer support for QC08 and QC10 need the MR at [1] to be applied,
but NV12 and P010 works out of the box with mainline Gstreamer.

Fluster HEVC results on SM8650 using Gstreamer:

./fluster.py run -ts JCT-VC-HEVC_V1 -d GStreamer-H.265-V4L2-Gst1.0 - 141/147
The failing test case:
- Pixel Format mismatch
 - TSUNEQBD_A_MAIN10_Technicolor_2 - Gstreamer waits NV12 but decoder returns P010
- Unsupported resolution
 - PICSIZE_A_Bossen_1 - resolution is higher than max supported
 - PICSIZE_B_Bossen_1 - resolution is higher than max supported
 - WPP_D_ericsson_MAIN_2 - resolution is lower than min supported
 - WPP_D_ericsson_MAIN10_2 - resolution is lower than min supported
- CRC mismatch
 - RAP_A_docomo_6

v4l2-compliance results on SM8550 & SM8650:

$ v4l2-compliance -d /dev/video1 -s
v4l2-compliance 1.33.0-5456, 64 bits, 64-bit time_t
v4l2-compliance SHA: 8aa593bda182 2026-04-11 10:54:25

Compliance test for iris_driver device /dev/video1:

Driver Info:
	Driver name      : iris_driver
	Card type        : Iris Encoder
	Bus info         : platform:aa00000.video-codec
	Driver version   : 7.0.0
	Capabilities     : 0x84204000
		Video Memory-to-Memory Multiplanar
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04204000
		Video Memory-to-Memory Multiplanar
		Streaming
		Extended Pix Format
	Detected Stateful Encoder

Required ioctls:
	test VIDIOC_QUERYCAP: OK
	test invalid ioctls: OK

Allow for multiple opens:
	test second /dev/video1 open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK
	test for unlimited opens: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls:
	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
	test VIDIOC_QUERYCTRL: OK
	test VIDIOC_G/S_CTRL: OK
	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
	Standard Controls: 43 Private Controls: 0

Format ioctls:
	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
	test VIDIOC_G/S_PARM: OK
	test VIDIOC_G_FBUF: OK (Not Supported)
	test VIDIOC_G_FMT: OK
	test VIDIOC_TRY_FMT: OK
	test VIDIOC_S_FMT: OK
	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
	test Cropping: OK
	test Composing: OK (Not Supported)
	test Scaling: OK (Not Supported)

Codec ioctls:
	test VIDIOC_(TRY_)ENCODER_CMD: OK
	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
	test CREATE_BUFS maximum buffers: OK
	test VIDIOC_REMOVE_BUFS: OK
	test VIDIOC_EXPBUF: OK
	test Requests: OK (Not Supported)
	test blocking wait: OK

Test input 0:

Streaming ioctls:
	test read/write: OK (Not Supported)
	Video Capture Multiplanar: Captured 61 buffers    
	test MMAP (select, REQBUFS): OK
	Video Capture Multiplanar: Captured 61 buffers    
	test MMAP (epoll, REQBUFS): OK
	Video Capture Multiplanar: Captured 61 buffers    
	test MMAP (select, CREATE_BUFS): OK
	Video Capture Multiplanar: Captured 61 buffers    
	test MMAP (epoll, CREATE_BUFS): OK
	test USERPTR (select): OK (Not Supported)
	test DMABUF: Cannot test, specify --expbuf-device

Total for iris_driver device /dev/video1: 54, Succeeded: 54, Failed: 0, Warnings: 0

$ v4l2-compliance -d /dev/video0 -s5 --stream-from=test_video_10s.h264
v4l2-compliance 1.33.0-5456, 64 bits, 64-bit time_t
v4l2-compliance SHA: 8aa593bda182 2026-04-11 10:54:25

Compliance test for iris_driver device /dev/video0:

Driver Info:
	Driver name      : iris_driver
	Card type        : Iris Decoder
	Bus info         : platform:aa00000.video-codec
	Driver version   : 7.0.0
	Capabilities     : 0x84204000
		Video Memory-to-Memory Multiplanar
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x04204000
		Video Memory-to-Memory Multiplanar
		Streaming
		Extended Pix Format
	Detected Stateful Decoder

Required ioctls:
	test VIDIOC_QUERYCAP: OK
	test invalid ioctls: OK

Allow for multiple opens:
	test second /dev/video0 open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK
	test for unlimited opens: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Control ioctls:
	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
	test VIDIOC_QUERYCTRL: OK
	test VIDIOC_G/S_CTRL: OK
	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
	Standard Controls: 12 Private Controls: 0

Format ioctls:
	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
	test VIDIOC_G/S_PARM: OK (Not Supported)
	test VIDIOC_G_FBUF: OK (Not Supported)
	test VIDIOC_G_FMT: OK
	test VIDIOC_TRY_FMT: OK
	test VIDIOC_S_FMT: OK
	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
	test Cropping: OK
	test Composing: OK
	test Scaling: OK (Not Supported)

Codec ioctls:
	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
	test VIDIOC_(TRY_)DECODER_CMD: OK

Buffer ioctls:
	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
	test CREATE_BUFS maximum buffers: OK
	test VIDIOC_REMOVE_BUFS: OK
	test VIDIOC_EXPBUF: OK
	test Requests: OK (Not Supported)
	test blocking wait: OK

Test input 0:

Streaming ioctls:
	test read/write: OK (Not Supported)
the input file is smaller than 7077888 bytes
	Video Capture Multiplanar: Captured 601 buffers   
	test MMAP (select, REQBUFS): OK
the input file is smaller than 7077888 bytes
	Video Capture Multiplanar: Captured 601 buffers   
	test MMAP (epoll, REQBUFS): OK
the input file is smaller than 7077888 bytes
	Video Capture Multiplanar: Captured 601 buffers   
	test MMAP (select, CREATE_BUFS): OK
the input file is smaller than 7077888 bytes
	Video Capture Multiplanar: Captured 601 buffers   
	test MMAP (epoll, CREATE_BUFS): OK
	test USERPTR (select): OK (Not Supported)
	test DMABUF: Cannot test, specify --expbuf-device

Total for iris_driver device /dev/video0: 54, Succeeded: 54, Failed: 0, Warnings: 0

[1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8195

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v4:
- Picked review tags
- Use u32 instead of __u32
- Explicit DPB
- Drop NULL and use >>1 in q10c buffer calc
- Drop selicolon after switch statementr
- Correctly align HFI_PROP_UBWC_STRIDE_SCANLINE entry
- Rebase on media next tree after the file split
- Link to v3: https://patch.msgid.link/20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org

Changes in v3:
- Added review tag on patch 1
- Limited stride command to AV1 decoding only
- Link to v2: https://patch.msgid.link/20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org

Changes in v2:
- Fixed bug breaking 8bit decoding
- Dropped filtering on G_FMT while waiting for soure change
- Dropped format filtering on ENUMFMT
- Switched ALIGN(x, 192) to roundup(x, 192) because ALIGN works only with Power Of Two numbers
- Cleaned and refactors the width/height/stride calculations
- Cleaned and redesigned the buffer calculations functions with proper comments and var names
- Passed fluster and v4l2-compliance to check for non regression
- Tested on SM8550
- Added missing V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 with made gstreamer fail decoding
- Link to v1: https://patch.msgid.link/20260408-topic-sm8x50-iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org

---
Neil Armstrong (6):
      media: qcom: iris: add helpers for 8bit and 10bit formats
      media: qcom: iris: add QC10C & P010 buffer size calculations
      media: qcom: iris: gen2: add support for 10bit decoding
      media: qcom: iris: vdec: update size and stride calculations for 10bit formats
      media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
      media: qcom: iris: vdec: allow GEN2 decoding into 10bit format

 drivers/media/platform/qcom/iris/iris_buffer.c     | 195 ++++++++++++++++++++-
 drivers/media/platform/qcom/iris/iris_hfi_gen2.c   |   8 +-
 .../platform/qcom/iris/iris_hfi_gen2_command.c     |  75 +++++++-
 .../platform/qcom/iris/iris_hfi_gen2_defines.h     |   1 +
 .../platform/qcom/iris/iris_hfi_gen2_response.c    |  37 +++-
 drivers/media/platform/qcom/iris/iris_instance.h   |   2 +
 .../platform/qcom/iris/iris_platform_common.h      |   1 +
 drivers/media/platform/qcom/iris/iris_utils.c      |  16 +-
 drivers/media/platform/qcom/iris/iris_utils.h      |   2 +
 drivers/media/platform/qcom/iris/iris_vdec.c       |  42 ++++-
 10 files changed, 364 insertions(+), 15 deletions(-)
---
base-commit: 86693e86019a7466be961fd4f45d407cc0b0ba0a
change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c

Best regards,
--  
Neil Armstrong <neil.armstrong@linaro.org>


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v4 1/6] media: qcom: iris: add helpers for 8bit and 10bit formats
  2026-05-21  9:24 [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
@ 2026-05-21  9:24 ` Neil Armstrong
  2026-05-21  9:24 ` [PATCH v4 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations Neil Armstrong
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 23+ messages in thread
From: Neil Armstrong @ 2026-05-21  9:24 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Neil Armstrong,
	Dmitry Baryshkov

To simplify code checking for pixel formats, add helpers to
check for 8bit and 10bit formats.

Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 drivers/media/platform/qcom/iris/iris_utils.c | 12 ++++++++++++
 drivers/media/platform/qcom/iris/iris_utils.h |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/drivers/media/platform/qcom/iris/iris_utils.c b/drivers/media/platform/qcom/iris/iris_utils.c
index 29b07d88507e..085665cd74ff 100644
--- a/drivers/media/platform/qcom/iris/iris_utils.c
+++ b/drivers/media/platform/qcom/iris/iris_utils.c
@@ -38,6 +38,18 @@ bool iris_split_mode_enabled(struct iris_inst *inst)
 		inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C;
 }
 
+bool iris_fmt_is_8bit(u32 pixelformat)
+{
+	return pixelformat == V4L2_PIX_FMT_NV12 ||
+		pixelformat == V4L2_PIX_FMT_QC08C;
+}
+
+bool iris_fmt_is_10bit(u32 pixelformat)
+{
+	return pixelformat == V4L2_PIX_FMT_P010 ||
+		pixelformat == V4L2_PIX_FMT_QC10C;
+}
+
 void iris_helper_buffers_done(struct iris_inst *inst, unsigned int type,
 			      enum vb2_buffer_state state)
 {
diff --git a/drivers/media/platform/qcom/iris/iris_utils.h b/drivers/media/platform/qcom/iris/iris_utils.h
index b5705d156431..228a5f963812 100644
--- a/drivers/media/platform/qcom/iris/iris_utils.h
+++ b/drivers/media/platform/qcom/iris/iris_utils.h
@@ -45,6 +45,8 @@ bool iris_res_is_less_than(u32 width, u32 height,
 			   u32 ref_width, u32 ref_height);
 int iris_get_mbpf(struct iris_inst *inst);
 bool iris_split_mode_enabled(struct iris_inst *inst);
+bool iris_fmt_is_8bit(u32 pixelformat);
+bool iris_fmt_is_10bit(u32 pixelformat);
 struct iris_inst *iris_get_instance(struct iris_core *core, u32 session_id);
 void iris_helper_buffers_done(struct iris_inst *inst, unsigned int type,
 			      enum vb2_buffer_state state);

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v4 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations
  2026-05-21  9:24 [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
  2026-05-21  9:24 ` [PATCH v4 1/6] media: qcom: iris: add helpers for 8bit and " Neil Armstrong
@ 2026-05-21  9:24 ` Neil Armstrong
  2026-05-25 23:32   ` bod
  2026-05-21  9:24 ` [PATCH v4 3/6] media: qcom: iris: gen2: add support for 10bit decoding Neil Armstrong
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Neil Armstrong @ 2026-05-21  9:24 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Neil Armstrong

The P010 (YUV format with 16-bits per pixel with interleaved UV)
and QC10C (P010 compressed mode similar to QC08C) requires specific
buffer calculations to allocate the right buffer size for the DPB
(decoded picture buffer) frames and frames consumed by userspace.

Similar to 8bit, the 10bit DPB frames uses QC10C format.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 drivers/media/platform/qcom/iris/iris_buffer.c | 195 ++++++++++++++++++++++++-
 1 file changed, 194 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
index ef7f6f931557..fbe2dd87f0d6 100644
--- a/drivers/media/platform/qcom/iris/iris_buffer.c
+++ b/drivers/media/platform/qcom/iris/iris_buffer.c
@@ -15,8 +15,11 @@
 #define MAX_WIDTH 4096
 #define MAX_HEIGHT 2304
 #define Y_STRIDE_ALIGN 128
+#define Y_STRIDE_ALIGN_P010 256
 #define UV_STRIDE_ALIGN 128
+#define UV_STRIDE_ALIGN_P010 256
 #define Y_SCANLINE_ALIGN 32
+#define Y_SCANLINE_ALIGN_QC10C 16
 #define UV_SCANLINE_ALIGN 16
 #define UV_SCANLINE_ALIGN_QC08C 32
 #define META_STRIDE_ALIGNED 64
@@ -80,6 +83,63 @@ static u32 iris_yuv_buffer_size_nv12(struct iris_inst *inst)
 	return ALIGN(y_plane + uv_plane, PIXELS_4K);
 }
 
+/*
+ * P010:
+ * YUV 4:2:0 image with a plane of 10 bit Y samples followed
+ * by an interleaved U/V plane containing 10 bit 2x2 subsampled
+ * colour difference samples.
+ *
+ * <-Y/UV_Stride (aligned to 256)->
+ * <----- Width*2 ------->
+ * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  ^           ^
+ * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |           |
+ * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  Height      |
+ * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |          y_scanlines (aligned to 32)
+ * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |           |
+ * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |           |
+ * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |           |
+ * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  V           |
+ * . . . . . . . . . . . . . . . .              |
+ * . . . . . . . . . . . . . . . .              |
+ * . . . . . . . . . . . . . . . .              |
+ * . . . . . . . . . . . . . . . .              V
+ * U V U V U V U V U V U V . . . .  ^
+ * U V U V U V U V U V U V . . . .  |
+ * U V U V U V U V U V U V . . . .  |
+ * U V U V U V U V U V U V . . . .  uv_scanlines (aligned to 16)
+ * . . . . . . . . . . . . . . . .  |
+ * . . . . . . . . . . . . . . . .  V
+ * . . . . . . . . . . . . . . . .  --> Buffer size aligned to 4K
+ *
+ * y_stride : Width*2 aligned to 256
+ * uv_stride : Width*2 aligned to 256
+ * y_scanlines: Height aligned to 32
+ * uv_scanlines: Height/2 aligned to 16
+ * Total size = align((y_stride * y_scanlines
+ *          + uv_stride * uv_scanlines , 4096)
+ *
+ * Note: All the alignments are hardware requirements.
+ */
+static u32 iris_yuv_buffer_size_p010(struct iris_inst *inst)
+{
+	u32 y_plane, uv_plane, y_stride, uv_stride, y_scanlines, uv_scanlines;
+	struct v4l2_format *f;
+
+	if (inst->domain == DECODER)
+		f = inst->fmt_dst;
+	else
+		f = inst->fmt_src;
+
+	y_stride = ALIGN(f->fmt.pix_mp.width * 2, Y_STRIDE_ALIGN_P010);
+	uv_stride = ALIGN(f->fmt.pix_mp.width * 2, UV_STRIDE_ALIGN_P010);
+	y_scanlines = ALIGN(f->fmt.pix_mp.height, Y_SCANLINE_ALIGN);
+	uv_scanlines = ALIGN((f->fmt.pix_mp.height + 1) >> 1, UV_SCANLINE_ALIGN);
+	y_plane = y_stride * y_scanlines;
+	uv_plane = uv_stride * uv_scanlines;
+
+	return ALIGN(y_plane + uv_plane, PIXELS_4K);
+}
+
 /*
  * QC08C:
  * Compressed Macro-tile format for NV12.
@@ -204,6 +264,132 @@ static u32 iris_yuv_buffer_size_qc08c(struct iris_inst *inst)
 	return ALIGN(y_meta_plane + y_plane + uv_meta_plane + uv_plane, PIXELS_4K);
 }
 
+/*
+ * QC10C:
+ * UBWC-compressed format for P010.
+ * Contains 4 planes in the following order -
+ * (A) Y_Meta_Plane
+ * (B) Y_UBWC_Plane
+ * (C) UV_Meta_Plane
+ * (D) UV_UBWC_Plane
+ *
+ * Y_Meta_Plane consists of meta information to decode compressed
+ * tile data in Y_UBWC_Plane.
+ * Y_UBWC_Plane consists of Y data in compressed macro-tile format.
+ * UBWC decoder block will use the Y_Meta_Plane data together with
+ * Y_UBWC_Plane data to produce loss-less uncompressed 10 bit Y samples.
+ *
+ * UV_Meta_Plane consists of meta information to decode compressed
+ * tile data in UV_UBWC_Plane.
+ * UV_UBWC_Plane consists of UV data in compressed macro-tile format.
+ * UBWC decoder block will use UV_Meta_Plane data together with
+ * UV_UBWC_Plane data to produce loss-less uncompressed 10 bit 2x2
+ * subsampled color difference samples.
+ *
+ * Each tile in Y_UBWC_Plane/UV_UBWC_Plane is independently decodable
+ * and randomly accessible. There is no dependency between tiles.
+ *
+ * <----- Y Meta stride -----> (aligned to 64)
+ * <-------- Width ----------> (aligned to 48)
+ * M M M M M M M M M M M M . .      ^           ^
+ * M M M M M M M M M M M M . .      |           |
+ * M M M M M M M M M M M M . .      Height      |
+ * M M M M M M M M M M M M . .      |         Meta_Y_Scanlines (aligned to 16)
+ * M M M M M M M M M M M M . .      |           |
+ * M M M M M M M M M M M M . .      |           |
+ * M M M M M M M M M M M M . .      |           |
+ * M M M M M M M M M M M M . .      V           |
+ * . . . . . . . . . . . . . .                  |
+ * . . . . . . . . . . . . . .                  |
+ * . . . . . . . . . . . . . .      -------> Buffer size aligned to 4k
+ * . . . . . . . . . . . . . .                  V
+ * <--Compressed tile Y stride --> (aligned to 256)
+ * <------- Width * 4/3 ---------> (aligned to 48)
+ * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  ^           ^
+ * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |           |
+ * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  Height      |
+ * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |        Macro_tile_Y_Scanlines (aligned to 16)
+ * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |           |
+ * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |           |
+ * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |           |
+ * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  V           |
+ * . . . . . . . . . . . . . . . .              |
+ * . . . . . . . . . . . . . . . .              |
+ * . . . . . . . . . . . . . . . .  -------> Buffer size aligned to 4k
+ * . . . . . . . . . . . . . . . .              V
+ * <---- UV Meta stride ----> (aligned to 64)
+ * <----- Width / 2 --------> (aligned to 24)
+ * M M M M M M M M M M M M . .    ^           ^
+ * M M M M M M M M M M M M . .    |           |
+ * M M M M M M M M M M M M . .    Height/2    |
+ * M M M M M M M M M M M M . .    V           M_UV_Scanlines (aligned to 16)
+ * . . . . . . . . . . . . . .                |
+ * . . . . . . . . . . . . . .                V
+ * . . . . . . . . . . . . . .      -------> Buffer size aligned to 4k
+ * <--Compressed tile UV stride--> (aligned to 256)
+ * <------- Width * 4/3 ---------> (aligned to 48)
+ * U* V* U* V* U* V* U* V* . . . .  ^
+ * U* V* U* V* U* V* U* V* . . . .  |
+ * U* V* U* V* U* V* U* V* . . . .  |
+ * U* V* U* V* U* V* U* V* . . . .  UV_Scanlines (aligned to 16)
+ * . . . . . . . . . . . . . . . .  |
+ * . . . . . . . . . . . . . . . .  V
+ * . . . . . . . . . . . . . . . .  -------> Buffer size aligned to 4k
+ *
+ * y_stride: width aligned to 256
+ * uv_stride: width aligned to 256
+ * y_scanlines: height aligned to 16
+ * uv_scanlines: height aligned to 16
+ * y_plane: buffer size aligned to 4096
+ * uv_plane: buffer size aligned to 4096
+ * y_meta_stride: width aligned to 64
+ * y_meta_scanlines: height aligned to 16
+ * y_meta_plane: buffer size aligned to 4096
+ * uv_meta_stride: width aligned to 64
+ * uv_meta_scanlines: height aligned to 16
+ * uv_meta_plane: buffer size aligned to 4096
+ *
+ * Total size = align( y_plane + uv_plane +
+ *           y_meta_plane + uv_meta_plane, 4096)
+ *
+ * Note: All the alignments are hardware requirements.
+ */
+static u32 iris_yuv_buffer_size_qc10c(struct iris_inst *inst)
+{
+	u32 y_plane, uv_plane, y_stride, uv_stride;
+	u32 uv_meta_stride, uv_meta_plane;
+	u32 y_meta_stride, y_meta_plane;
+	struct v4l2_format *f;
+
+	if (inst->domain == DECODER)
+		f = inst->fmt_dst;
+	else
+		f = inst->fmt_src;
+
+	y_meta_stride = ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.width, 48),
+			      META_STRIDE_ALIGNED);
+	y_meta_plane = y_meta_stride * ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.height, 4),
+					     META_SCANLINE_ALIGNED);
+	y_meta_plane = ALIGN(y_meta_plane, PIXELS_4K);
+
+	y_stride = ALIGN(f->fmt.pix_mp.width * 4 / 3, Y_STRIDE_ALIGN_P010);
+	y_plane = ALIGN(y_stride * ALIGN(f->fmt.pix_mp.height, Y_SCANLINE_ALIGN_QC10C),
+			PIXELS_4K);
+
+	uv_meta_stride = ALIGN(DIV_ROUND_UP((f->fmt.pix_mp.width + 1) >> 1, 24),
+			       META_STRIDE_ALIGNED);
+	uv_meta_plane = uv_meta_stride *
+			ALIGN(DIV_ROUND_UP((f->fmt.pix_mp.height + 1) >> 1, 4),
+			      META_SCANLINE_ALIGNED);
+	uv_meta_plane = ALIGN(uv_meta_plane, PIXELS_4K);
+
+	uv_stride = ALIGN(f->fmt.pix_mp.width * 4 / 3, UV_STRIDE_ALIGN_P010);
+	uv_plane = ALIGN(uv_stride * ALIGN((f->fmt.pix_mp.height + 1) >> 1, UV_SCANLINE_ALIGN),
+			 PIXELS_4K);
+
+	return ALIGN(y_meta_plane + y_plane + uv_meta_plane + uv_plane, PIXELS_4K);
+}
+
 static u32 iris_dec_bitstream_buffer_size(struct iris_inst *inst)
 {
 	struct platform_inst_caps *caps = inst->core->iris_platform_data->inst_caps;
@@ -268,10 +454,17 @@ int iris_get_buffer_size(struct iris_inst *inst,
 		case BUF_OUTPUT:
 			if (inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C)
 				return iris_yuv_buffer_size_qc08c(inst);
+			else if (inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC10C)
+				return iris_yuv_buffer_size_qc10c(inst);
+			else if (inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_P010)
+				return iris_yuv_buffer_size_p010(inst);
 			else
 				return iris_yuv_buffer_size_nv12(inst);
 		case BUF_DPB:
-			return iris_yuv_buffer_size_qc08c(inst);
+			if (iris_fmt_is_10bit(inst->fmt_dst->fmt.pix_mp.pixelformat))
+				return iris_yuv_buffer_size_qc10c(inst);
+			else
+				return iris_yuv_buffer_size_qc08c(inst);
 		default:
 			return 0;
 		}

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v4 3/6] media: qcom: iris: gen2: add support for 10bit decoding
  2026-05-21  9:24 [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
  2026-05-21  9:24 ` [PATCH v4 1/6] media: qcom: iris: add helpers for 8bit and " Neil Armstrong
  2026-05-21  9:24 ` [PATCH v4 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations Neil Armstrong
@ 2026-05-21  9:24 ` Neil Armstrong
  2026-05-21  9:24 ` [PATCH v4 4/6] media: qcom: iris: vdec: update size and stride calculations for 10bit formats Neil Armstrong
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 23+ messages in thread
From: Neil Armstrong @ 2026-05-21  9:24 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Neil Armstrong,
	Dmitry Baryshkov

Add the necessary plumbing into the HFi Gen2 to signal the decoder
the right 10bit pixel format and stride when in compressed mode.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 .../platform/qcom/iris/iris_hfi_gen2_command.c     | 75 +++++++++++++++++++++-
 .../platform/qcom/iris/iris_hfi_gen2_defines.h     |  1 +
 drivers/media/platform/qcom/iris/iris_utils.c      |  4 +-
 3 files changed, 76 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
index c90b22a75bc5..1d0ab30093db 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
@@ -481,8 +481,20 @@ static int iris_hfi_gen2_set_colorformat(struct iris_inst *inst, u32 plane)
 
 	if (inst->domain == DECODER) {
 		pixelformat = inst->fmt_dst->fmt.pix_mp.pixelformat;
-		hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
-			HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
+		switch (pixelformat) {
+		case V4L2_PIX_FMT_NV12:
+			hfi_colorformat = HFI_COLOR_FMT_NV12;
+			break;
+		case V4L2_PIX_FMT_QC08C:
+			hfi_colorformat = HFI_COLOR_FMT_NV12_UBWC;
+			break;
+		case V4L2_PIX_FMT_P010:
+			hfi_colorformat = HFI_COLOR_FMT_P010;
+			break;
+		case V4L2_PIX_FMT_QC10C:
+			hfi_colorformat = HFI_COLOR_FMT_TP10_UBWC;
+			break;
+		}
 	} else {
 		pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
 		hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
@@ -517,7 +529,8 @@ static int iris_hfi_gen2_set_linear_stride_scanline(struct iris_inst *inst, u32
 	stride_uv = stride_y;
 	scanline_uv = scanline_y / 2;
 
-	if (pixelformat != V4L2_PIX_FMT_NV12)
+	if (pixelformat != V4L2_PIX_FMT_NV12 &&
+	    pixelformat != V4L2_PIX_FMT_P010)
 		return 0;
 
 	payload[0] = stride_y << 16 | scanline_y;
@@ -532,6 +545,61 @@ static int iris_hfi_gen2_set_linear_stride_scanline(struct iris_inst *inst, u32
 						  sizeof(u64));
 }
 
+static int iris_hfi_gen2_set_ubwc_stride_scanline(struct iris_inst *inst, u32 plane)
+{
+	u32 meta_stride_y, meta_scanline_y, meta_stride_uv, meta_scanline_uv;
+	u32 stride_y, scanline_y, stride_uv, scanline_uv;
+	u32 port = iris_hfi_gen2_get_port(inst, plane);
+	u32 pixelformat, width, height;
+	u32 payload[4];
+
+	if (inst->domain != DECODER ||
+	    inst->fmt_src->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_AV1)
+		return 0;
+
+	pixelformat = inst->fmt_dst->fmt.pix_mp.pixelformat;
+	width = inst->fmt_dst->fmt.pix_mp.width;
+	height = inst->fmt_dst->fmt.pix_mp.height;
+
+	switch (pixelformat) {
+	case V4L2_PIX_FMT_QC08C:
+		stride_y = ALIGN(width, 128);
+		scanline_y = ALIGN(height, 32);
+		stride_uv = ALIGN(width, 128);
+		scanline_uv = ALIGN((height + 1) >> 1, 32);
+		meta_stride_y = ALIGN(DIV_ROUND_UP(width, 32), 64);
+		meta_scanline_y = ALIGN(DIV_ROUND_UP(height, 8), 16);
+		meta_stride_uv = ALIGN(DIV_ROUND_UP((width + 1) >> 1, 16), 64);
+		meta_scanline_uv = ALIGN(DIV_ROUND_UP((height + 1) >> 1, 8), 16);
+		break;
+	case V4L2_PIX_FMT_QC10C:
+		stride_y = ALIGN(width * 4 / 3, 256);
+		scanline_y = ALIGN(height, 16);
+		stride_uv = ALIGN(width * 4 / 3, 256);
+		scanline_uv = ALIGN((height + 1) >> 1, 16);
+		meta_stride_y = ALIGN(DIV_ROUND_UP(width, 48), 64);
+		meta_scanline_y = ALIGN(DIV_ROUND_UP(height, 4), 16);
+		meta_stride_uv = ALIGN(DIV_ROUND_UP((width + 1) >> 1, 24), 64);
+		meta_scanline_uv = ALIGN(DIV_ROUND_UP((height + 1) >> 1, 4), 16);
+		break;
+	default:
+		return 0;
+	}
+
+	payload[0] = stride_y << 16 | scanline_y;
+	payload[1] = stride_uv << 16 | scanline_uv;
+	payload[2] = meta_stride_y << 16 | meta_scanline_y;
+	payload[3] = meta_stride_uv << 16 | meta_scanline_uv;
+
+	return iris_hfi_gen2_session_set_property(inst,
+						  HFI_PROP_UBWC_STRIDE_SCANLINE,
+						  HFI_HOST_FLAGS_NONE,
+						  port,
+						  HFI_PAYLOAD_U32_ARRAY,
+						  &payload[0],
+						  sizeof(u32) * 4);
+}
+
 static int iris_hfi_gen2_set_tier(struct iris_inst *inst, u32 plane)
 {
 	u32 port = iris_hfi_gen2_get_port(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
@@ -620,6 +688,7 @@ static int iris_hfi_gen2_session_set_config_params(struct iris_inst *inst, u32 p
 		{HFI_PROP_OPB_ENABLE,                 iris_hfi_gen2_set_opb_enable             },
 		{HFI_PROP_COLOR_FORMAT,               iris_hfi_gen2_set_colorformat            },
 		{HFI_PROP_LINEAR_STRIDE_SCANLINE,     iris_hfi_gen2_set_linear_stride_scanline },
+		{HFI_PROP_UBWC_STRIDE_SCANLINE,       iris_hfi_gen2_set_ubwc_stride_scanline   },
 		{HFI_PROP_TIER,                       iris_hfi_gen2_set_tier                   },
 		{HFI_PROP_FRAME_RATE,                 iris_hfi_gen2_set_frame_rate             },
 		{HFI_PROP_AV1_FILM_GRAIN_PRESENT,     iris_hfi_gen2_set_film_grain             },
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h
index cecf771c55dd..68f849232906 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h
@@ -118,6 +118,7 @@ enum hfi_flip {
 #define HFI_PROP_OPB_ENABLE			0x03000184
 #define HFI_PROP_AV1_TILE_ROWS_COLUMNS		0x03000187
 #define HFI_PROP_AV1_DRAP_CONFIG		0x03000189
+#define HFI_PROP_UBWC_STRIDE_SCANLINE		0x03000190
 #define HFI_PROP_COMV_BUFFER_COUNT		0x03000193
 #define HFI_PROP_AV1_UNIFORM_TILE_SPACING	0x03000197
 #define HFI_PROP_END				0x03FFFFFF
diff --git a/drivers/media/platform/qcom/iris/iris_utils.c b/drivers/media/platform/qcom/iris/iris_utils.c
index 085665cd74ff..ba5c8dc1280c 100644
--- a/drivers/media/platform/qcom/iris/iris_utils.c
+++ b/drivers/media/platform/qcom/iris/iris_utils.c
@@ -35,7 +35,9 @@ int iris_get_mbpf(struct iris_inst *inst)
 bool iris_split_mode_enabled(struct iris_inst *inst)
 {
 	return inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV12 ||
-		inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C;
+		inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C ||
+		inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_P010 ||
+		inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC10C;
 }
 
 bool iris_fmt_is_8bit(u32 pixelformat)

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v4 4/6] media: qcom: iris: vdec: update size and stride calculations for 10bit formats
  2026-05-21  9:24 [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
                   ` (2 preceding siblings ...)
  2026-05-21  9:24 ` [PATCH v4 3/6] media: qcom: iris: gen2: add support for 10bit decoding Neil Armstrong
@ 2026-05-21  9:24 ` Neil Armstrong
  2026-05-21  9:24 ` [PATCH v4 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and " Neil Armstrong
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 23+ messages in thread
From: Neil Armstrong @ 2026-05-21  9:24 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Neil Armstrong,
	Dmitry Baryshkov

Update the gen2 response and vdec s_fmt code to take in account
the P010 and QC010 when calculating the width, height and stride.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 .../platform/qcom/iris/iris_hfi_gen2_response.c    | 21 ++++++++++++++++---
 drivers/media/platform/qcom/iris/iris_vdec.c       | 24 +++++++++++++++++++---
 2 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
index c350d231265e..aca90aab8548 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
@@ -542,9 +542,24 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst)
 	pixmp_ip->width = width;
 	pixmp_ip->height = height;
 
-	pixmp_op->width = ALIGN(width, 128);
-	pixmp_op->height = ALIGN(height, 32);
-	pixmp_op->plane_fmt[0].bytesperline = ALIGN(width, 128);
+	switch (pixmp_op->pixelformat) {
+	case V4L2_PIX_FMT_P010:
+		pixmp_op->width = ALIGN(width, 128);
+		pixmp_op->height = ALIGN(height, 32);
+		pixmp_op->plane_fmt[0].bytesperline = ALIGN(width * 2, 256);
+		break;
+	case V4L2_PIX_FMT_QC10C:
+		pixmp_op->width = roundup(width, 192);
+		pixmp_op->height = ALIGN(height, 16);
+		pixmp_op->plane_fmt[0].bytesperline = ALIGN(pixmp_op->width * 4 / 3, 256);
+		break;
+	case V4L2_PIX_FMT_NV12:
+	case V4L2_PIX_FMT_QC08C:
+		pixmp_op->width = ALIGN(width, 128);
+		pixmp_op->height = ALIGN(height, 32);
+		pixmp_op->plane_fmt[0].bytesperline = pixmp_op->width;
+		break;
+	}
 	pixmp_op->plane_fmt[0].sizeimage = iris_get_buffer_size(inst, BUF_OUTPUT);
 
 	matrix_coeff = subsc_params.color_info & 0xFF;
diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c
index ccda3b9fb845..3846d73b4d23 100644
--- a/drivers/media/platform/qcom/iris/iris_vdec.c
+++ b/drivers/media/platform/qcom/iris/iris_vdec.c
@@ -272,10 +272,28 @@ int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f)
 		fmt = inst->fmt_dst;
 		fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
 		fmt->fmt.pix_mp.pixelformat = f->fmt.pix_mp.pixelformat;
-		fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
-		fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
 		fmt->fmt.pix_mp.num_planes = 1;
-		fmt->fmt.pix_mp.plane_fmt[0].bytesperline = ALIGN(f->fmt.pix_mp.width, 128);
+		switch (f->fmt.pix_mp.pixelformat) {
+		case V4L2_PIX_FMT_P010:
+			fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
+			fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
+			fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
+				ALIGN(f->fmt.pix_mp.width * 2, 256);
+			break;
+		case V4L2_PIX_FMT_QC10C:
+			fmt->fmt.pix_mp.width = roundup(f->fmt.pix_mp.width, 192);
+			fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 16);
+			fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
+				ALIGN(f->fmt.pix_mp.width * 4 / 3, 256);
+			break;
+		case V4L2_PIX_FMT_NV12:
+		case V4L2_PIX_FMT_QC08C:
+			fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
+			fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
+			fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
+				ALIGN(f->fmt.pix_mp.width, 128);
+			break;
+		}
 		fmt->fmt.pix_mp.plane_fmt[0].sizeimage = iris_get_buffer_size(inst, BUF_OUTPUT);
 		inst->buffers[BUF_OUTPUT].min_count = iris_vpu_buf_count(inst, BUF_OUTPUT);
 		inst->buffers[BUF_OUTPUT].size = fmt->fmt.pix_mp.plane_fmt[0].sizeimage;

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v4 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
  2026-05-21  9:24 [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
                   ` (3 preceding siblings ...)
  2026-05-21  9:24 ` [PATCH v4 4/6] media: qcom: iris: vdec: update size and stride calculations for 10bit formats Neil Armstrong
@ 2026-05-21  9:24 ` Neil Armstrong
  2026-05-21  9:24 ` [PATCH v4 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format Neil Armstrong
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 23+ messages in thread
From: Neil Armstrong @ 2026-05-21  9:24 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Neil Armstrong,
	Dmitry Baryshkov, Bryan O'Donoghue

The 10bit pixel format can be only used when the decoder identifies the
stream as decoding into 10bit pixel format buffers, so update the
find_format helper to filter the formats and only allow the proper
formats when setting or trying a capture format.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 drivers/media/platform/qcom/iris/iris_platform_common.h |  1 +
 drivers/media/platform/qcom/iris/iris_vdec.c            | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 6a108173be35..7595e21277b0 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -17,6 +17,7 @@ struct iris_inst;
 
 #define REGISTER_BIT_DEPTH(luma, chroma)	((luma) << 16 | (chroma))
 #define BIT_DEPTH_8				REGISTER_BIT_DEPTH(8, 8)
+#define BIT_DEPTH_10				REGISTER_BIT_DEPTH(10, 10)
 #define CODED_FRAMES_PROGRESSIVE		0x0
 #define DEFAULT_MAX_HOST_BUF_COUNT		64
 #define DEFAULT_MAX_HOST_BURST_BUF_COUNT	256
diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c
index 3846d73b4d23..f1366a1865c1 100644
--- a/drivers/media/platform/qcom/iris/iris_vdec.c
+++ b/drivers/media/platform/qcom/iris/iris_vdec.c
@@ -105,6 +105,16 @@ find_format(struct iris_inst *inst, u32 pixfmt, u32 type)
 	if (i == size || fmt[i].type != type)
 		return NULL;
 
+	if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
+		if (iris_fmt_is_8bit(fmt[i].pixfmt) &&
+		    inst->fw_caps[BIT_DEPTH].value == BIT_DEPTH_10)
+			return NULL;
+
+		if (iris_fmt_is_10bit(fmt[i].pixfmt) &&
+		    inst->fw_caps[BIT_DEPTH].value != BIT_DEPTH_10)
+			return NULL;
+	}
+
 	return &fmt[i];
 }
 

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v4 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
  2026-05-21  9:24 [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
                   ` (4 preceding siblings ...)
  2026-05-21  9:24 ` [PATCH v4 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and " Neil Armstrong
@ 2026-05-21  9:24 ` Neil Armstrong
  2026-05-26  7:53 ` [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Vikash Garodia
  2026-06-01  9:01 ` Wangao Wang
  7 siblings, 0 replies; 23+ messages in thread
From: Neil Armstrong @ 2026-05-21  9:24 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Neil Armstrong,
	Dmitry Baryshkov

Add the necessary bits into the gen2 platforms tables and handlers
to allow decoding streams into 10bit pixel formats.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 drivers/media/platform/qcom/iris/iris_hfi_gen2.c         |  8 +++++---
 .../media/platform/qcom/iris/iris_hfi_gen2_response.c    | 16 +++++++++++++++-
 drivers/media/platform/qcom/iris/iris_instance.h         |  2 ++
 drivers/media/platform/qcom/iris/iris_vdec.c             |  8 ++++++++
 4 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2.c
index ce8490d64854..88c338e64e0d 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2.c
@@ -31,9 +31,10 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] = {
 	{
 		.cap_id = PROFILE_HEVC,
 		.min = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
-		.max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE,
+		.max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10,
 		.step_or_mask = BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN) |
-				BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE),
+				BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE) |
+				BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10),
 		.value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN,
 		.hfi_id = HFI_PROP_PROFILE,
 		.flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU,
@@ -262,7 +263,7 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] = {
 	{
 		.cap_id = BIT_DEPTH,
 		.min = BIT_DEPTH_8,
-		.max = BIT_DEPTH_8,
+		.max = BIT_DEPTH_10,
 		.step_or_mask = 1,
 		.value = BIT_DEPTH_8,
 		.hfi_id = HFI_PROP_LUMA_CHROMA_BIT_DEPTH,
@@ -774,6 +775,7 @@ static const u32 sm8550_vdec_output_config_params[] = {
 	HFI_PROP_OPB_ENABLE,
 	HFI_PROP_COLOR_FORMAT,
 	HFI_PROP_LINEAR_STRIDE_SCANLINE,
+	HFI_PROP_UBWC_STRIDE_SCANLINE,
 };
 
 static const u32 sm8550_venc_output_config_params[] = {
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
index aca90aab8548..25162ae71357 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
@@ -542,6 +542,15 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst)
 	pixmp_ip->width = width;
 	pixmp_ip->height = height;
 
+	if (subsc_params.bit_depth == BIT_DEPTH_8 &&
+	    pixmp_op->pixelformat != V4L2_PIX_FMT_NV12 &&
+	    pixmp_op->pixelformat != V4L2_PIX_FMT_QC08C)
+		pixmp_op->pixelformat = V4L2_PIX_FMT_NV12;
+	else if (subsc_params.bit_depth == BIT_DEPTH_10 &&
+		 pixmp_op->pixelformat != V4L2_PIX_FMT_P010 &&
+		 pixmp_op->pixelformat != V4L2_PIX_FMT_QC10C)
+		pixmp_op->pixelformat = V4L2_PIX_FMT_P010;
+
 	switch (pixmp_op->pixelformat) {
 	case V4L2_PIX_FMT_P010:
 		pixmp_op->width = ALIGN(width, 128);
@@ -625,7 +634,12 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst)
 	inst->fw_caps[POC].value = subsc_params.pic_order_cnt;
 	inst->fw_caps[TIER].value = subsc_params.tier;
 
-	if (subsc_params.bit_depth != BIT_DEPTH_8 ||
+	if (subsc_params.bit_depth == BIT_DEPTH_8)
+		inst->fw_caps[BIT_DEPTH].value = BIT_DEPTH_8;
+	else
+		inst->fw_caps[BIT_DEPTH].value = BIT_DEPTH_10;
+
+	if ((subsc_params.bit_depth != BIT_DEPTH_8 && subsc_params.bit_depth != BIT_DEPTH_10) ||
 	    !(subsc_params.coded_frames & HFI_BITMASK_FRAME_MBS_ONLY_FLAG)) {
 		dev_err(core->dev, "unsupported content, bit depth: %x, pic_struct = %x\n",
 			subsc_params.bit_depth, subsc_params.coded_frames);
diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/media/platform/qcom/iris/iris_instance.h
index 352af99699dd..672f02b8f8f8 100644
--- a/drivers/media/platform/qcom/iris/iris_instance.h
+++ b/drivers/media/platform/qcom/iris/iris_instance.h
@@ -27,6 +27,8 @@ enum iris_fmt_type_out {
 enum iris_fmt_type_cap {
 	IRIS_FMT_NV12,
 	IRIS_FMT_QC08C,
+	IRIS_FMT_TP10,
+	IRIS_FMT_QC10C,
 };
 
 struct iris_fmt {
diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c
index f1366a1865c1..39a02d4e5379 100644
--- a/drivers/media/platform/qcom/iris/iris_vdec.c
+++ b/drivers/media/platform/qcom/iris/iris_vdec.c
@@ -76,6 +76,14 @@ static const struct iris_fmt iris_vdec_formats_cap[] = {
 		.pixfmt = V4L2_PIX_FMT_QC08C,
 		.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
 	},
+	[IRIS_FMT_TP10] = {
+		.pixfmt = V4L2_PIX_FMT_P010,
+		.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+	},
+	[IRIS_FMT_QC10C] = {
+		.pixfmt = V4L2_PIX_FMT_QC10C,
+		.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+	},
 };
 
 static const struct iris_fmt *

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations
  2026-05-21  9:24 ` [PATCH v4 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations Neil Armstrong
@ 2026-05-25 23:32   ` bod
  0 siblings, 0 replies; 23+ messages in thread
From: bod @ 2026-05-25 23:32 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab, linux-media,
	linux-arm-msm, linux-kernel

On 2026-05-21 11:24 +0200, Neil Armstrong wrote:
> The P010 (YUV format with 16-bits per pixel with interleaved UV)
> and QC10C (P010 compressed mode similar to QC08C) requires specific
> buffer calculations to allocate the right buffer size for the DPB
> (decoded picture buffer) frames and frames consumed by userspace.
> 
> Similar to 8bit, the 10bit DPB frames uses QC10C format.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>  drivers/media/platform/qcom/iris/iris_buffer.c | 195 ++++++++++++++++++++++++-
>  1 file changed, 194 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
> index ef7f6f931557..fbe2dd87f0d6 100644
> --- a/drivers/media/platform/qcom/iris/iris_buffer.c
> +++ b/drivers/media/platform/qcom/iris/iris_buffer.c
> @@ -15,8 +15,11 @@
>  #define MAX_WIDTH 4096
>  #define MAX_HEIGHT 2304
>  #define Y_STRIDE_ALIGN 128
> +#define Y_STRIDE_ALIGN_P010 256
>  #define UV_STRIDE_ALIGN 128
> +#define UV_STRIDE_ALIGN_P010 256
>  #define Y_SCANLINE_ALIGN 32
> +#define Y_SCANLINE_ALIGN_QC10C 16
>  #define UV_SCANLINE_ALIGN 16
>  #define UV_SCANLINE_ALIGN_QC08C 32
>  #define META_STRIDE_ALIGNED 64
> @@ -80,6 +83,63 @@ static u32 iris_yuv_buffer_size_nv12(struct iris_inst *inst)
>  	return ALIGN(y_plane + uv_plane, PIXELS_4K);
>  }
>  
> +/*
> + * P010:
> + * YUV 4:2:0 image with a plane of 10 bit Y samples followed
> + * by an interleaved U/V plane containing 10 bit 2x2 subsampled
> + * colour difference samples.
> + *
> + * <-Y/UV_Stride (aligned to 256)->
> + * <----- Width*2 ------->
> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  ^           ^
> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |           |
> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  Height      |
> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |          y_scanlines (aligned to 32)
> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |           |
> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |           |
> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  |           |
> + * Y Y Y Y Y Y Y Y Y Y Y Y . . . .  V           |
> + * . . . . . . . . . . . . . . . .              |
> + * . . . . . . . . . . . . . . . .              |
> + * . . . . . . . . . . . . . . . .              |
> + * . . . . . . . . . . . . . . . .              V
> + * U V U V U V U V U V U V . . . .  ^
> + * U V U V U V U V U V U V . . . .  |
> + * U V U V U V U V U V U V . . . .  |
> + * U V U V U V U V U V U V . . . .  uv_scanlines (aligned to 16)
> + * . . . . . . . . . . . . . . . .  |
> + * . . . . . . . . . . . . . . . .  V
> + * . . . . . . . . . . . . . . . .  --> Buffer size aligned to 4K
> + *
> + * y_stride : Width*2 aligned to 256
> + * uv_stride : Width*2 aligned to 256
> + * y_scanlines: Height aligned to 32
> + * uv_scanlines: Height/2 aligned to 16
> + * Total size = align((y_stride * y_scanlines
> + *          + uv_stride * uv_scanlines , 4096)
> + *
> + * Note: All the alignments are hardware requirements.
> + */
> +static u32 iris_yuv_buffer_size_p010(struct iris_inst *inst)
> +{
> +	u32 y_plane, uv_plane, y_stride, uv_stride, y_scanlines, uv_scanlines;
> +	struct v4l2_format *f;
> +
> +	if (inst->domain == DECODER)
> +		f = inst->fmt_dst;
> +	else
> +		f = inst->fmt_src;
> +
> +	y_stride = ALIGN(f->fmt.pix_mp.width * 2, Y_STRIDE_ALIGN_P010);
> +	uv_stride = ALIGN(f->fmt.pix_mp.width * 2, UV_STRIDE_ALIGN_P010);
> +	y_scanlines = ALIGN(f->fmt.pix_mp.height, Y_SCANLINE_ALIGN);
> +	uv_scanlines = ALIGN((f->fmt.pix_mp.height + 1) >> 1, UV_SCANLINE_ALIGN);
> +	y_plane = y_stride * y_scanlines;
> +	uv_plane = uv_stride * uv_scanlines;
> +
> +	return ALIGN(y_plane + uv_plane, PIXELS_4K);
> +}
> +
>  /*
>   * QC08C:
>   * Compressed Macro-tile format for NV12.
> @@ -204,6 +264,132 @@ static u32 iris_yuv_buffer_size_qc08c(struct iris_inst *inst)
>  	return ALIGN(y_meta_plane + y_plane + uv_meta_plane + uv_plane, PIXELS_4K);
>  }
>  
> +/*
> + * QC10C:
> + * UBWC-compressed format for P010.
> + * Contains 4 planes in the following order -
> + * (A) Y_Meta_Plane
> + * (B) Y_UBWC_Plane
> + * (C) UV_Meta_Plane
> + * (D) UV_UBWC_Plane
> + *
> + * Y_Meta_Plane consists of meta information to decode compressed
> + * tile data in Y_UBWC_Plane.
> + * Y_UBWC_Plane consists of Y data in compressed macro-tile format.
> + * UBWC decoder block will use the Y_Meta_Plane data together with
> + * Y_UBWC_Plane data to produce loss-less uncompressed 10 bit Y samples.
> + *
> + * UV_Meta_Plane consists of meta information to decode compressed
> + * tile data in UV_UBWC_Plane.
> + * UV_UBWC_Plane consists of UV data in compressed macro-tile format.
> + * UBWC decoder block will use UV_Meta_Plane data together with
> + * UV_UBWC_Plane data to produce loss-less uncompressed 10 bit 2x2
> + * subsampled color difference samples.
> + *
> + * Each tile in Y_UBWC_Plane/UV_UBWC_Plane is independently decodable
> + * and randomly accessible. There is no dependency between tiles.
> + *
> + * <----- Y Meta stride -----> (aligned to 64)
> + * <-------- Width ----------> (aligned to 48)
> + * M M M M M M M M M M M M . .      ^           ^
> + * M M M M M M M M M M M M . .      |           |
> + * M M M M M M M M M M M M . .      Height      |
> + * M M M M M M M M M M M M . .      |         Meta_Y_Scanlines (aligned to 16)
> + * M M M M M M M M M M M M . .      |           |
> + * M M M M M M M M M M M M . .      |           |
> + * M M M M M M M M M M M M . .      |           |
> + * M M M M M M M M M M M M . .      V           |
> + * . . . . . . . . . . . . . .                  |
> + * . . . . . . . . . . . . . .                  |
> + * . . . . . . . . . . . . . .      -------> Buffer size aligned to 4k
> + * . . . . . . . . . . . . . .                  V
> + * <--Compressed tile Y stride --> (aligned to 256)
> + * <------- Width * 4/3 ---------> (aligned to 48)
> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  ^           ^
> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |           |
> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  Height      |
> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |        Macro_tile_Y_Scanlines (aligned to 16)
> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |           |
> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |           |
> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  |           |
> + * Y* Y* Y* Y* Y* Y* Y* Y* . . . .  V           |
> + * . . . . . . . . . . . . . . . .              |
> + * . . . . . . . . . . . . . . . .              |
> + * . . . . . . . . . . . . . . . .  -------> Buffer size aligned to 4k
> + * . . . . . . . . . . . . . . . .              V
> + * <---- UV Meta stride ----> (aligned to 64)
> + * <----- Width / 2 --------> (aligned to 24)
> + * M M M M M M M M M M M M . .    ^           ^
> + * M M M M M M M M M M M M . .    |           |
> + * M M M M M M M M M M M M . .    Height/2    |
> + * M M M M M M M M M M M M . .    V           M_UV_Scanlines (aligned to 16)
> + * . . . . . . . . . . . . . .                |
> + * . . . . . . . . . . . . . .                V
> + * . . . . . . . . . . . . . .      -------> Buffer size aligned to 4k
> + * <--Compressed tile UV stride--> (aligned to 256)
> + * <------- Width * 4/3 ---------> (aligned to 48)
> + * U* V* U* V* U* V* U* V* . . . .  ^
> + * U* V* U* V* U* V* U* V* . . . .  |
> + * U* V* U* V* U* V* U* V* . . . .  |
> + * U* V* U* V* U* V* U* V* . . . .  UV_Scanlines (aligned to 16)
> + * . . . . . . . . . . . . . . . .  |
> + * . . . . . . . . . . . . . . . .  V
> + * . . . . . . . . . . . . . . . .  -------> Buffer size aligned to 4k
> + *
> + * y_stride: width aligned to 256
> + * uv_stride: width aligned to 256
> + * y_scanlines: height aligned to 16
> + * uv_scanlines: height aligned to 16
> + * y_plane: buffer size aligned to 4096
> + * uv_plane: buffer size aligned to 4096
> + * y_meta_stride: width aligned to 64
> + * y_meta_scanlines: height aligned to 16
> + * y_meta_plane: buffer size aligned to 4096
> + * uv_meta_stride: width aligned to 64
> + * uv_meta_scanlines: height aligned to 16
> + * uv_meta_plane: buffer size aligned to 4096
> + *
> + * Total size = align( y_plane + uv_plane +
> + *           y_meta_plane + uv_meta_plane, 4096)
> + *
> + * Note: All the alignments are hardware requirements.
> + */
> +static u32 iris_yuv_buffer_size_qc10c(struct iris_inst *inst)
> +{
> +	u32 y_plane, uv_plane, y_stride, uv_stride;
> +	u32 uv_meta_stride, uv_meta_plane;
> +	u32 y_meta_stride, y_meta_plane;
> +	struct v4l2_format *f;
> +
> +	if (inst->domain == DECODER)
> +		f = inst->fmt_dst;
> +	else
> +		f = inst->fmt_src;
> +
> +	y_meta_stride = ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.width, 48),
> +			      META_STRIDE_ALIGNED);
> +	y_meta_plane = y_meta_stride * ALIGN(DIV_ROUND_UP(f->fmt.pix_mp.height, 4),
> +					     META_SCANLINE_ALIGNED);
> +	y_meta_plane = ALIGN(y_meta_plane, PIXELS_4K);
> +
> +	y_stride = ALIGN(f->fmt.pix_mp.width * 4 / 3, Y_STRIDE_ALIGN_P010);
> +	y_plane = ALIGN(y_stride * ALIGN(f->fmt.pix_mp.height, Y_SCANLINE_ALIGN_QC10C),
> +			PIXELS_4K);
> +
> +	uv_meta_stride = ALIGN(DIV_ROUND_UP((f->fmt.pix_mp.width + 1) >> 1, 24),
> +			       META_STRIDE_ALIGNED);
> +	uv_meta_plane = uv_meta_stride *
> +			ALIGN(DIV_ROUND_UP((f->fmt.pix_mp.height + 1) >> 1, 4),
> +			      META_SCANLINE_ALIGNED);
> +	uv_meta_plane = ALIGN(uv_meta_plane, PIXELS_4K);
> +
> +	uv_stride = ALIGN(f->fmt.pix_mp.width * 4 / 3, UV_STRIDE_ALIGN_P010);
> +	uv_plane = ALIGN(uv_stride * ALIGN((f->fmt.pix_mp.height + 1) >> 1, UV_SCANLINE_ALIGN),
> +			 PIXELS_4K);
> +
> +	return ALIGN(y_meta_plane + y_plane + uv_meta_plane + uv_plane, PIXELS_4K);
> +}
> +
>  static u32 iris_dec_bitstream_buffer_size(struct iris_inst *inst)
>  {
>  	struct platform_inst_caps *caps = inst->core->iris_platform_data->inst_caps;
> @@ -268,10 +454,17 @@ int iris_get_buffer_size(struct iris_inst *inst,
>  		case BUF_OUTPUT:
>  			if (inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC08C)
>  				return iris_yuv_buffer_size_qc08c(inst);
> +			else if (inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_QC10C)
> +				return iris_yuv_buffer_size_qc10c(inst);
> +			else if (inst->fmt_dst->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_P010)
> +				return iris_yuv_buffer_size_p010(inst);
>  			else
>  				return iris_yuv_buffer_size_nv12(inst);
>  		case BUF_DPB:
> -			return iris_yuv_buffer_size_qc08c(inst);
> +			if (iris_fmt_is_10bit(inst->fmt_dst->fmt.pix_mp.pixelformat))
> +				return iris_yuv_buffer_size_qc10c(inst);
> +			else
> +				return iris_yuv_buffer_size_qc08c(inst);
>  		default:
>  			return 0;
>  		}
> 
> -- 
> 2.34.1
> 
> 

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

---
bod


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-21  9:24 [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
                   ` (5 preceding siblings ...)
  2026-05-21  9:24 ` [PATCH v4 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format Neil Armstrong
@ 2026-05-26  7:53 ` Vikash Garodia
  2026-05-26 12:39   ` Neil Armstrong
  2026-06-01  9:01 ` Wangao Wang
  7 siblings, 1 reply; 23+ messages in thread
From: Vikash Garodia @ 2026-05-26  7:53 UTC (permalink / raw)
  To: Neil Armstrong, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue


On 5/21/2026 2:54 PM, Neil Armstrong wrote:
> This adds the plumbing to support decoding HEVC, VP9 and AV1
> streams into 10bit pixel formats, linear and compressed.
> 
> This has only been tested on SM8550 & SM8650 with HEVC, and was
> inspired by Venus, DRM MSM and the downstream vidc driver for the
> buffer calculations and HFI messages.
> 
> Gstreamer support for QC08 and QC10 need the MR at [1] to be applied,
> but NV12 and P010 works out of the box with mainline Gstreamer.
> 
> Fluster HEVC results on SM8650 using Gstreamer:
> 
> ./fluster.py run -ts JCT-VC-HEVC_V1 -d GStreamer-H.265-V4L2-Gst1.0 - 141/147
> The failing test case:
> - Pixel Format mismatch
>   - TSUNEQBD_A_MAIN10_Technicolor_2 - Gstreamer waits NV12 but decoder returns P010
> - Unsupported resolution
>   - PICSIZE_A_Bossen_1 - resolution is higher than max supported
>   - PICSIZE_B_Bossen_1 - resolution is higher than max supported
>   - WPP_D_ericsson_MAIN_2 - resolution is lower than min supported
>   - WPP_D_ericsson_MAIN10_2 - resolution is lower than min supported
> - CRC mismatch
>   - RAP_A_docomo_6
>

<snip>


> 
> Total for iris_driver device /dev/video0: 54, Succeeded: 54, Failed: 0, Warnings: 0
> 
> [1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8195
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
> Changes in v4:
> - Picked review tags
> - Use u32 instead of __u32
> - Explicit DPB
> - Drop NULL and use >>1 in q10c buffer calc
> - Drop selicolon after switch statementr
> - Correctly align HFI_PROP_UBWC_STRIDE_SCANLINE entry

Its not very clear. Does this fix the issue reported here [1] ?

https://lore.kernel.org/linux-media/fb377b11-c54c-4bd9-bf12-cf19d6484c66@oss.qualcomm.com/

> - Rebase on media next tree after the file split
> - Link to v3: https://patch.msgid.link/20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org
> 
> Changes in v3:
> - Added review tag on patch 1
> - Limited stride command to AV1 decoding only
> - Link to v2: https://patch.msgid.link/20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org
> 
> Changes in v2:
> - Fixed bug breaking 8bit decoding
> - Dropped filtering on G_FMT while waiting for soure change
> - Dropped format filtering on ENUMFMT
> - Switched ALIGN(x, 192) to roundup(x, 192) because ALIGN works only with Power Of Two numbers
> - Cleaned and refactors the width/height/stride calculations
> - Cleaned and redesigned the buffer calculations functions with proper comments and var names
> - Passed fluster and v4l2-compliance to check for non regression
> - Tested on SM8550
> - Added missing V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 with made gstreamer fail decoding
> - Link to v1: https://patch.msgid.link/20260408-topic-sm8x50-iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org
> 
> ---
> Neil Armstrong (6):
>        media: qcom: iris: add helpers for 8bit and 10bit formats
>        media: qcom: iris: add QC10C & P010 buffer size calculations
>        media: qcom: iris: gen2: add support for 10bit decoding
>        media: qcom: iris: vdec: update size and stride calculations for 10bit formats
>        media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
>        media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
> 
>   drivers/media/platform/qcom/iris/iris_buffer.c     | 195 ++++++++++++++++++++-
>   drivers/media/platform/qcom/iris/iris_hfi_gen2.c   |   8 +-
>   .../platform/qcom/iris/iris_hfi_gen2_command.c     |  75 +++++++-
>   .../platform/qcom/iris/iris_hfi_gen2_defines.h     |   1 +
>   .../platform/qcom/iris/iris_hfi_gen2_response.c    |  37 +++-
>   drivers/media/platform/qcom/iris/iris_instance.h   |   2 +
>   .../platform/qcom/iris/iris_platform_common.h      |   1 +
>   drivers/media/platform/qcom/iris/iris_utils.c      |  16 +-
>   drivers/media/platform/qcom/iris/iris_utils.h      |   2 +
>   drivers/media/platform/qcom/iris/iris_vdec.c       |  42 ++++-
>   10 files changed, 364 insertions(+), 15 deletions(-)
> ---
> base-commit: 86693e86019a7466be961fd4f45d407cc0b0ba0a
> change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c
> 
> Best regards,
> --
> Neil Armstrong <neil.armstrong@linaro.org>
> 

Regards,
Vikash

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-26  7:53 ` [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Vikash Garodia
@ 2026-05-26 12:39   ` Neil Armstrong
  2026-05-26 12:45     ` Vikash Garodia
  0 siblings, 1 reply; 23+ messages in thread
From: Neil Armstrong @ 2026-05-26 12:39 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue

On 5/26/26 09:53, Vikash Garodia wrote:
> 
> On 5/21/2026 2:54 PM, Neil Armstrong wrote:
>> This adds the plumbing to support decoding HEVC, VP9 and AV1
>> streams into 10bit pixel formats, linear and compressed.
>>
>> This has only been tested on SM8550 & SM8650 with HEVC, and was
>> inspired by Venus, DRM MSM and the downstream vidc driver for the
>> buffer calculations and HFI messages.
>>
>> Gstreamer support for QC08 and QC10 need the MR at [1] to be applied,
>> but NV12 and P010 works out of the box with mainline Gstreamer.
>>
>> Fluster HEVC results on SM8650 using Gstreamer:
>>
>> ./fluster.py run -ts JCT-VC-HEVC_V1 -d GStreamer-H.265-V4L2-Gst1.0 - 141/147
>> The failing test case:
>> - Pixel Format mismatch
>>   - TSUNEQBD_A_MAIN10_Technicolor_2 - Gstreamer waits NV12 but decoder returns P010
>> - Unsupported resolution
>>   - PICSIZE_A_Bossen_1 - resolution is higher than max supported
>>   - PICSIZE_B_Bossen_1 - resolution is higher than max supported
>>   - WPP_D_ericsson_MAIN_2 - resolution is lower than min supported
>>   - WPP_D_ericsson_MAIN10_2 - resolution is lower than min supported
>> - CRC mismatch
>>   - RAP_A_docomo_6
>>
> 
> <snip>
> 
> 
>>
>> Total for iris_driver device /dev/video0: 54, Succeeded: 54, Failed: 0, Warnings: 0
>>
>> [1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8195
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>> Changes in v4:
>> - Picked review tags
>> - Use u32 instead of __u32
>> - Explicit DPB
>> - Drop NULL and use >>1 in q10c buffer calc
>> - Drop selicolon after switch statementr
>> - Correctly align HFI_PROP_UBWC_STRIDE_SCANLINE entry
> 
> Its not very clear. Does this fix the issue reported here [1] ?
> 
> https://lore.kernel.org/linux-media/fb377b11-c54c-4bd9-bf12-cf19d6484c66@oss.qualcomm.com/

I wasn't able to reproduce the issue, and the reporter never answered my questions so far.

Neil

> 
>> - Rebase on media next tree after the file split
>> - Link to v3: https://patch.msgid.link/20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org
>>
>> Changes in v3:
>> - Added review tag on patch 1
>> - Limited stride command to AV1 decoding only
>> - Link to v2: https://patch.msgid.link/20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org
>>
>> Changes in v2:
>> - Fixed bug breaking 8bit decoding
>> - Dropped filtering on G_FMT while waiting for soure change
>> - Dropped format filtering on ENUMFMT
>> - Switched ALIGN(x, 192) to roundup(x, 192) because ALIGN works only with Power Of Two numbers
>> - Cleaned and refactors the width/height/stride calculations
>> - Cleaned and redesigned the buffer calculations functions with proper comments and var names
>> - Passed fluster and v4l2-compliance to check for non regression
>> - Tested on SM8550
>> - Added missing V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 with made gstreamer fail decoding
>> - Link to v1: https://patch.msgid.link/20260408-topic-sm8x50-iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org
>>
>> ---
>> Neil Armstrong (6):
>>        media: qcom: iris: add helpers for 8bit and 10bit formats
>>        media: qcom: iris: add QC10C & P010 buffer size calculations
>>        media: qcom: iris: gen2: add support for 10bit decoding
>>        media: qcom: iris: vdec: update size and stride calculations for 10bit formats
>>        media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
>>        media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
>>
>>   drivers/media/platform/qcom/iris/iris_buffer.c     | 195 ++++++++++++++++++++-
>>   drivers/media/platform/qcom/iris/iris_hfi_gen2.c   |   8 +-
>>   .../platform/qcom/iris/iris_hfi_gen2_command.c     |  75 +++++++-
>>   .../platform/qcom/iris/iris_hfi_gen2_defines.h     |   1 +
>>   .../platform/qcom/iris/iris_hfi_gen2_response.c    |  37 +++-
>>   drivers/media/platform/qcom/iris/iris_instance.h   |   2 +
>>   .../platform/qcom/iris/iris_platform_common.h      |   1 +
>>   drivers/media/platform/qcom/iris/iris_utils.c      |  16 +-
>>   drivers/media/platform/qcom/iris/iris_utils.h      |   2 +
>>   drivers/media/platform/qcom/iris/iris_vdec.c       |  42 ++++-
>>   10 files changed, 364 insertions(+), 15 deletions(-)
>> ---
>> base-commit: 86693e86019a7466be961fd4f45d407cc0b0ba0a
>> change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c
>>
>> Best regards,
>> -- 
>> Neil Armstrong <neil.armstrong@linaro.org>
>>
> 
> Regards,
> Vikash


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-26 12:39   ` Neil Armstrong
@ 2026-05-26 12:45     ` Vikash Garodia
  2026-05-27  4:15       ` Wangao Wang
  0 siblings, 1 reply; 23+ messages in thread
From: Vikash Garodia @ 2026-05-26 12:45 UTC (permalink / raw)
  To: Neil Armstrong, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab, Wangao Wang
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue


On 5/26/2026 6:09 PM, Neil Armstrong wrote:
> On 5/26/26 09:53, Vikash Garodia wrote:
>>
>> On 5/21/2026 2:54 PM, Neil Armstrong wrote:
>>> This adds the plumbing to support decoding HEVC, VP9 and AV1
>>> streams into 10bit pixel formats, linear and compressed.
>>>
>>> This has only been tested on SM8550 & SM8650 with HEVC, and was
>>> inspired by Venus, DRM MSM and the downstream vidc driver for the
>>> buffer calculations and HFI messages.
>>>
>>> Gstreamer support for QC08 and QC10 need the MR at [1] to be applied,
>>> but NV12 and P010 works out of the box with mainline Gstreamer.
>>>
>>> Fluster HEVC results on SM8650 using Gstreamer:
>>>
>>> ./fluster.py run -ts JCT-VC-HEVC_V1 -d GStreamer-H.265-V4L2-Gst1.0 - 
>>> 141/147
>>> The failing test case:
>>> - Pixel Format mismatch
>>>   - TSUNEQBD_A_MAIN10_Technicolor_2 - Gstreamer waits NV12 but 
>>> decoder returns P010
>>> - Unsupported resolution
>>>   - PICSIZE_A_Bossen_1 - resolution is higher than max supported
>>>   - PICSIZE_B_Bossen_1 - resolution is higher than max supported
>>>   - WPP_D_ericsson_MAIN_2 - resolution is lower than min supported
>>>   - WPP_D_ericsson_MAIN10_2 - resolution is lower than min supported
>>> - CRC mismatch
>>>   - RAP_A_docomo_6
>>>
>>
>> <snip>
>>
>>
>>>
>>> Total for iris_driver device /dev/video0: 54, Succeeded: 54, Failed: 
>>> 0, Warnings: 0
>>>
>>> [1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/ 
>>> merge_requests/8195
>>>
>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>> ---
>>> Changes in v4:
>>> - Picked review tags
>>> - Use u32 instead of __u32
>>> - Explicit DPB
>>> - Drop NULL and use >>1 in q10c buffer calc
>>> - Drop selicolon after switch statementr
>>> - Correctly align HFI_PROP_UBWC_STRIDE_SCANLINE entry
>>
>> Its not very clear. Does this fix the issue reported here [1] ?
>>
>> https://lore.kernel.org/linux-media/fb377b11-c54c-4bd9-bf12- 
>> cf19d6484c66@oss.qualcomm.com/
> 
> I wasn't able to reproduce the issue, and the reporter never answered my 
> questions so far.
> 
> Neil

It would be nice to add the reviewers directly as well.

adding Wangao now.

> 
>>
>>> - Rebase on media next tree after the file split
>>> - Link to v3: https://patch.msgid.link/20260511-topic-sm8x50- 
>>> iris-10bit-decoding-v3-0-7fc049b93042@linaro.org
>>>
>>> Changes in v3:
>>> - Added review tag on patch 1
>>> - Limited stride command to AV1 decoding only
>>> - Link to v2: https://patch.msgid.link/20260417-topic-sm8x50- 
>>> iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org
>>>
>>> Changes in v2:
>>> - Fixed bug breaking 8bit decoding
>>> - Dropped filtering on G_FMT while waiting for soure change
>>> - Dropped format filtering on ENUMFMT
>>> - Switched ALIGN(x, 192) to roundup(x, 192) because ALIGN works only 
>>> with Power Of Two numbers
>>> - Cleaned and refactors the width/height/stride calculations
>>> - Cleaned and redesigned the buffer calculations functions with 
>>> proper comments and var names
>>> - Passed fluster and v4l2-compliance to check for non regression
>>> - Tested on SM8550
>>> - Added missing V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 with made 
>>> gstreamer fail decoding
>>> - Link to v1: https://patch.msgid.link/20260408-topic-sm8x50- 
>>> iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org
>>>
>>> ---
>>> Neil Armstrong (6):
>>>        media: qcom: iris: add helpers for 8bit and 10bit formats
>>>        media: qcom: iris: add QC10C & P010 buffer size calculations
>>>        media: qcom: iris: gen2: add support for 10bit decoding
>>>        media: qcom: iris: vdec: update size and stride calculations 
>>> for 10bit formats
>>>        media: qcom: iris: vdec: update find_format to handle 8bit and 
>>> 10bit formats
>>>        media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
>>>
>>>   drivers/media/platform/qcom/iris/iris_buffer.c     | 195 ++++++++++ 
>>> ++++++++++-
>>>   drivers/media/platform/qcom/iris/iris_hfi_gen2.c   |   8 +-
>>>   .../platform/qcom/iris/iris_hfi_gen2_command.c     |  75 +++++++-
>>>   .../platform/qcom/iris/iris_hfi_gen2_defines.h     |   1 +
>>>   .../platform/qcom/iris/iris_hfi_gen2_response.c    |  37 +++-
>>>   drivers/media/platform/qcom/iris/iris_instance.h   |   2 +
>>>   .../platform/qcom/iris/iris_platform_common.h      |   1 +
>>>   drivers/media/platform/qcom/iris/iris_utils.c      |  16 +-
>>>   drivers/media/platform/qcom/iris/iris_utils.h      |   2 +
>>>   drivers/media/platform/qcom/iris/iris_vdec.c       |  42 ++++-
>>>   10 files changed, 364 insertions(+), 15 deletions(-)
>>> ---
>>> base-commit: 86693e86019a7466be961fd4f45d407cc0b0ba0a
>>> change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c
>>>
>>> Best regards,
>>> -- 
>>> Neil Armstrong <neil.armstrong@linaro.org>
>>>
>>
>> Regards,
>> Vikash
> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-26 12:45     ` Vikash Garodia
@ 2026-05-27  4:15       ` Wangao Wang
  2026-05-28 13:26         ` Neil Armstrong
  0 siblings, 1 reply; 23+ messages in thread
From: Wangao Wang @ 2026-05-27  4:15 UTC (permalink / raw)
  To: Vikash Garodia, Neil Armstrong, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: wangao.wang, linux-media, linux-arm-msm, linux-kernel,
	Dmitry Baryshkov, Bryan O'Donoghue

[-- Attachment #1: Type: text/plain, Size: 5602 bytes --]

I tested the v4 patch using the gst command you provided earlier. The 
decoded output still has the previous plane misalignment issue, but all 
frames are decoded successfully. When viewing the raw data with an image 
player at 1920x1080 resolution, the first frame looks correct but 
subsequent frames appear shifted. If viewed at 1920x1088 resolution, 
there are artifacts at the bottom of each frame. I've attached the images.

Also, have you tested the 720p case? I can't get it to run on my end.

On 2026/5/26 20:45, Vikash Garodia wrote:
> 
> On 5/26/2026 6:09 PM, Neil Armstrong wrote:
>> On 5/26/26 09:53, Vikash Garodia wrote:
>>>
>>> On 5/21/2026 2:54 PM, Neil Armstrong wrote:
>>>> This adds the plumbing to support decoding HEVC, VP9 and AV1
>>>> streams into 10bit pixel formats, linear and compressed.
>>>>
>>>> This has only been tested on SM8550 & SM8650 with HEVC, and was
>>>> inspired by Venus, DRM MSM and the downstream vidc driver for the
>>>> buffer calculations and HFI messages.
>>>>
>>>> Gstreamer support for QC08 and QC10 need the MR at [1] to be applied,
>>>> but NV12 and P010 works out of the box with mainline Gstreamer.
>>>>
>>>> Fluster HEVC results on SM8650 using Gstreamer:
>>>>
>>>> ./fluster.py run -ts JCT-VC-HEVC_V1 -d GStreamer-H.265-V4L2-Gst1.0 - 
>>>> 141/147
>>>> The failing test case:
>>>> - Pixel Format mismatch
>>>>   - TSUNEQBD_A_MAIN10_Technicolor_2 - Gstreamer waits NV12 but 
>>>> decoder returns P010
>>>> - Unsupported resolution
>>>>   - PICSIZE_A_Bossen_1 - resolution is higher than max supported
>>>>   - PICSIZE_B_Bossen_1 - resolution is higher than max supported
>>>>   - WPP_D_ericsson_MAIN_2 - resolution is lower than min supported
>>>>   - WPP_D_ericsson_MAIN10_2 - resolution is lower than min supported
>>>> - CRC mismatch
>>>>   - RAP_A_docomo_6
>>>>
>>>
>>> <snip>
>>>
>>>
>>>>
>>>> Total for iris_driver device /dev/video0: 54, Succeeded: 54, Failed: 
>>>> 0, Warnings: 0
>>>>
>>>> [1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/ 
>>>> merge_requests/8195
>>>>
>>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>>> ---
>>>> Changes in v4:
>>>> - Picked review tags
>>>> - Use u32 instead of __u32
>>>> - Explicit DPB
>>>> - Drop NULL and use >>1 in q10c buffer calc
>>>> - Drop selicolon after switch statementr
>>>> - Correctly align HFI_PROP_UBWC_STRIDE_SCANLINE entry
>>>
>>> Its not very clear. Does this fix the issue reported here [1] ?
>>>
>>> https://lore.kernel.org/linux-media/fb377b11-c54c-4bd9-bf12- 
>>> cf19d6484c66@oss.qualcomm.com/
>>
>> I wasn't able to reproduce the issue, and the reporter never answered 
>> my questions so far.
>>
>> Neil
> 
> It would be nice to add the reviewers directly as well.
> 
> adding Wangao now.
> 
>>
>>>
>>>> - Rebase on media next tree after the file split
>>>> - Link to v3: https://patch.msgid.link/20260511-topic-sm8x50- 
>>>> iris-10bit-decoding-v3-0-7fc049b93042@linaro.org
>>>>
>>>> Changes in v3:
>>>> - Added review tag on patch 1
>>>> - Limited stride command to AV1 decoding only
>>>> - Link to v2: https://patch.msgid.link/20260417-topic-sm8x50- 
>>>> iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org
>>>>
>>>> Changes in v2:
>>>> - Fixed bug breaking 8bit decoding
>>>> - Dropped filtering on G_FMT while waiting for soure change
>>>> - Dropped format filtering on ENUMFMT
>>>> - Switched ALIGN(x, 192) to roundup(x, 192) because ALIGN works only 
>>>> with Power Of Two numbers
>>>> - Cleaned and refactors the width/height/stride calculations
>>>> - Cleaned and redesigned the buffer calculations functions with 
>>>> proper comments and var names
>>>> - Passed fluster and v4l2-compliance to check for non regression
>>>> - Tested on SM8550
>>>> - Added missing V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 with made 
>>>> gstreamer fail decoding
>>>> - Link to v1: https://patch.msgid.link/20260408-topic-sm8x50- 
>>>> iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org
>>>>
>>>> ---
>>>> Neil Armstrong (6):
>>>>        media: qcom: iris: add helpers for 8bit and 10bit formats
>>>>        media: qcom: iris: add QC10C & P010 buffer size calculations
>>>>        media: qcom: iris: gen2: add support for 10bit decoding
>>>>        media: qcom: iris: vdec: update size and stride calculations 
>>>> for 10bit formats
>>>>        media: qcom: iris: vdec: update find_format to handle 8bit 
>>>> and 10bit formats
>>>>        media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
>>>>
>>>>   drivers/media/platform/qcom/iris/iris_buffer.c     | 195 +++++++++ 
>>>> + ++++++++++-
>>>>   drivers/media/platform/qcom/iris/iris_hfi_gen2.c   |   8 +-
>>>>   .../platform/qcom/iris/iris_hfi_gen2_command.c     |  75 +++++++-
>>>>   .../platform/qcom/iris/iris_hfi_gen2_defines.h     |   1 +
>>>>   .../platform/qcom/iris/iris_hfi_gen2_response.c    |  37 +++-
>>>>   drivers/media/platform/qcom/iris/iris_instance.h   |   2 +
>>>>   .../platform/qcom/iris/iris_platform_common.h      |   1 +
>>>>   drivers/media/platform/qcom/iris/iris_utils.c      |  16 +-
>>>>   drivers/media/platform/qcom/iris/iris_utils.h      |   2 +
>>>>   drivers/media/platform/qcom/iris/iris_vdec.c       |  42 ++++-
>>>>   10 files changed, 364 insertions(+), 15 deletions(-)
>>>> ---
>>>> base-commit: 86693e86019a7466be961fd4f45d407cc0b0ba0a
>>>> change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c
>>>>
>>>> Best regards,
>>>> -- 
>>>> Neil Armstrong <neil.armstrong@linaro.org>
>>>>
>>>
>>> Regards,
>>> Vikash
>>
> 

-- 
Best Regards,
Wangao

[-- Attachment #2: screenshot 2026-05-27.zip --]
[-- Type: application/x-zip-compressed, Size: 5695172 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-27  4:15       ` Wangao Wang
@ 2026-05-28 13:26         ` Neil Armstrong
  2026-05-28 23:55           ` Bryan O'Donoghue
  2026-05-29  8:21           ` Wangao Wang
  0 siblings, 2 replies; 23+ messages in thread
From: Neil Armstrong @ 2026-05-28 13:26 UTC (permalink / raw)
  To: Wangao Wang, Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue

Hi Wangao,

On 5/27/26 06:15, Wangao Wang wrote:
> I tested the v4 patch using the gst command you provided earlier. The decoded output still has the previous plane misalignment issue, but all frames are decoded successfully. When viewing the raw data with an image player at 1920x1080 resolution, the first frame looks correct but subsequent frames appear shifted. If viewed at 1920x1088 resolution, there are artifacts at the bottom of each frame. I've attached the images.
> 
> Also, have you tested the 720p case? I can't get it to run on my end.

Thanks for the report but I don't have access to the Purwa platform you use,
I've run test with multiple resolutions with display using P010
and QC10, and ran fluster aswell and all passed on SM8550 and SM8650.

I'll test it on the Hamoa T14S I have which should be the closest to purwa,
but it uses the same driver setup as SM8550 so I expected it to work the same.

Could you indicate which iris firmware you're using ?

Could you try passing the fluster h265 main10 test suite with gstreamer ?

fluster download -c h.265
fluster run -d GStreamer-H.265-V4L2 -ts JCT-VC-HEVC_V1 -q -s -j1

The picture you send looks like there's a mismatch with the kernel
and firmware setup of planes offsets.
Could you check if there's a Purwa specific firmware property
to set for 10bit decoding ?

Neil

> 
> On 2026/5/26 20:45, Vikash Garodia wrote:
>>
>> On 5/26/2026 6:09 PM, Neil Armstrong wrote:
>>> On 5/26/26 09:53, Vikash Garodia wrote:
>>>>
>>>> On 5/21/2026 2:54 PM, Neil Armstrong wrote:
>>>>> This adds the plumbing to support decoding HEVC, VP9 and AV1
>>>>> streams into 10bit pixel formats, linear and compressed.
>>>>>
>>>>> This has only been tested on SM8550 & SM8650 with HEVC, and was
>>>>> inspired by Venus, DRM MSM and the downstream vidc driver for the
>>>>> buffer calculations and HFI messages.
>>>>>
>>>>> Gstreamer support for QC08 and QC10 need the MR at [1] to be applied,
>>>>> but NV12 and P010 works out of the box with mainline Gstreamer.
>>>>>
>>>>> Fluster HEVC results on SM8650 using Gstreamer:
>>>>>
>>>>> ./fluster.py run -ts JCT-VC-HEVC_V1 -d GStreamer-H.265-V4L2-Gst1.0 - 141/147
>>>>> The failing test case:
>>>>> - Pixel Format mismatch
>>>>>   - TSUNEQBD_A_MAIN10_Technicolor_2 - Gstreamer waits NV12 but decoder returns P010
>>>>> - Unsupported resolution
>>>>>   - PICSIZE_A_Bossen_1 - resolution is higher than max supported
>>>>>   - PICSIZE_B_Bossen_1 - resolution is higher than max supported
>>>>>   - WPP_D_ericsson_MAIN_2 - resolution is lower than min supported
>>>>>   - WPP_D_ericsson_MAIN10_2 - resolution is lower than min supported
>>>>> - CRC mismatch
>>>>>   - RAP_A_docomo_6
>>>>>
>>>>
>>>> <snip>
>>>>
>>>>
>>>>>
>>>>> Total for iris_driver device /dev/video0: 54, Succeeded: 54, Failed: 0, Warnings: 0
>>>>>
>>>>> [1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/ merge_requests/8195
>>>>>
>>>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>>>> ---
>>>>> Changes in v4:
>>>>> - Picked review tags
>>>>> - Use u32 instead of __u32
>>>>> - Explicit DPB
>>>>> - Drop NULL and use >>1 in q10c buffer calc
>>>>> - Drop selicolon after switch statementr
>>>>> - Correctly align HFI_PROP_UBWC_STRIDE_SCANLINE entry
>>>>
>>>> Its not very clear. Does this fix the issue reported here [1] ?
>>>>
>>>> https://lore.kernel.org/linux-media/fb377b11-c54c-4bd9-bf12- cf19d6484c66@oss.qualcomm.com/
>>>
>>> I wasn't able to reproduce the issue, and the reporter never answered my questions so far.
>>>
>>> Neil
>>
>> It would be nice to add the reviewers directly as well.
>>
>> adding Wangao now.
>>
>>>
>>>>
>>>>> - Rebase on media next tree after the file split
>>>>> - Link to v3: https://patch.msgid.link/20260511-topic-sm8x50- iris-10bit-decoding-v3-0-7fc049b93042@linaro.org
>>>>>
>>>>> Changes in v3:
>>>>> - Added review tag on patch 1
>>>>> - Limited stride command to AV1 decoding only
>>>>> - Link to v2: https://patch.msgid.link/20260417-topic-sm8x50- iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org
>>>>>
>>>>> Changes in v2:
>>>>> - Fixed bug breaking 8bit decoding
>>>>> - Dropped filtering on G_FMT while waiting for soure change
>>>>> - Dropped format filtering on ENUMFMT
>>>>> - Switched ALIGN(x, 192) to roundup(x, 192) because ALIGN works only with Power Of Two numbers
>>>>> - Cleaned and refactors the width/height/stride calculations
>>>>> - Cleaned and redesigned the buffer calculations functions with proper comments and var names
>>>>> - Passed fluster and v4l2-compliance to check for non regression
>>>>> - Tested on SM8550
>>>>> - Added missing V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 with made gstreamer fail decoding
>>>>> - Link to v1: https://patch.msgid.link/20260408-topic-sm8x50- iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org
>>>>>
>>>>> ---
>>>>> Neil Armstrong (6):
>>>>>        media: qcom: iris: add helpers for 8bit and 10bit formats
>>>>>        media: qcom: iris: add QC10C & P010 buffer size calculations
>>>>>        media: qcom: iris: gen2: add support for 10bit decoding
>>>>>        media: qcom: iris: vdec: update size and stride calculations for 10bit formats
>>>>>        media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
>>>>>        media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
>>>>>
>>>>>   drivers/media/platform/qcom/iris/iris_buffer.c     | 195 +++++++++ + ++++++++++-
>>>>>   drivers/media/platform/qcom/iris/iris_hfi_gen2.c   |   8 +-
>>>>>   .../platform/qcom/iris/iris_hfi_gen2_command.c     |  75 +++++++-
>>>>>   .../platform/qcom/iris/iris_hfi_gen2_defines.h     |   1 +
>>>>>   .../platform/qcom/iris/iris_hfi_gen2_response.c    |  37 +++-
>>>>>   drivers/media/platform/qcom/iris/iris_instance.h   |   2 +
>>>>>   .../platform/qcom/iris/iris_platform_common.h      |   1 +
>>>>>   drivers/media/platform/qcom/iris/iris_utils.c      |  16 +-
>>>>>   drivers/media/platform/qcom/iris/iris_utils.h      |   2 +
>>>>>   drivers/media/platform/qcom/iris/iris_vdec.c       |  42 ++++-
>>>>>   10 files changed, 364 insertions(+), 15 deletions(-)
>>>>> ---
>>>>> base-commit: 86693e86019a7466be961fd4f45d407cc0b0ba0a
>>>>> change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c
>>>>>
>>>>> Best regards,
>>>>> -- 
>>>>> Neil Armstrong <neil.armstrong@linaro.org>
>>>>>
>>>>
>>>> Regards,
>>>> Vikash
>>>
>>
> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-28 13:26         ` Neil Armstrong
@ 2026-05-28 23:55           ` Bryan O'Donoghue
  2026-05-29  8:21           ` Wangao Wang
  1 sibling, 0 replies; 23+ messages in thread
From: Bryan O'Donoghue @ 2026-05-28 23:55 UTC (permalink / raw)
  To: Neil Armstrong, Wangao Wang, Vikash Garodia, Dikshita Agarwal,
	Abhinav Kumar, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue

On 28/05/2026 14:26, Neil Armstrong wrote:
> I'll test it on the Hamoa T14S I have which should be the closest to purwa,
> but it uses the same driver setup as SM8550 so I expected it to work the same.

Is purwa Iris upstream yet ?

It your series works on Hamoa, I see no good reason to gate it further 
for !upstream Purwa.

---
bod

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-28 13:26         ` Neil Armstrong
  2026-05-28 23:55           ` Bryan O'Donoghue
@ 2026-05-29  8:21           ` Wangao Wang
  2026-05-29  9:55             ` Neil Armstrong
  1 sibling, 1 reply; 23+ messages in thread
From: Wangao Wang @ 2026-05-29  8:21 UTC (permalink / raw)
  To: Neil Armstrong, Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: wangao.wang, linux-media, linux-arm-msm, linux-kernel,
	Dmitry Baryshkov, Bryan O'Donoghue



On 2026/5/28 21:26, Neil Armstrong wrote:
> Hi Wangao,
> 
> On 5/27/26 06:15, Wangao Wang wrote:
>> I tested the v4 patch using the gst command you provided earlier. The 
>> decoded output still has the previous plane misalignment issue, but 
>> all frames are decoded successfully. When viewing the raw data with an 
>> image player at 1920x1080 resolution, the first frame looks correct 
>> but subsequent frames appear shifted. If viewed at 1920x1088 
>> resolution, there are artifacts at the bottom of each frame. I've 
>> attached the images.
>>
>> Also, have you tested the 720p case? I can't get it to run on my end.
> 
> Thanks for the report but I don't have access to the Purwa platform you 
> use,
> I've run test with multiple resolutions with display using P010
> and QC10, and ran fluster aswell and all passed on SM8550 and SM8650.
> 
> I'll test it on the Hamoa T14S I have which should be the closest to purwa,
> but it uses the same driver setup as SM8550 so I expected it to work the 
> same.
> 
> Could you indicate which iris firmware you're using ?
> 
> Could you try passing the fluster h265 main10 test suite with gstreamer ?
> 
> fluster download -c h.265
> fluster run -d GStreamer-H.265-V4L2 -ts JCT-VC-HEVC_V1 -q -s -j1
> 
> The picture you send looks like there's a mismatch with the kernel
> and firmware setup of planes offsets.
> Could you check if there's a Purwa specific firmware property
> to set for 10bit decoding ?
> 
> Neil
> 
>>

Hi Neil,

I also tested on hamoa, and it has the same issue as purwa. The firmware 
used on purwa is vpu30_p1_s7.mbn.

This is the result of fluster:
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WP_MAIN10_B_Toshiba_3 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_A_ericsson_MAIN10_2 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_A_ericsson_MAIN_2 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_B_ericsson_MAIN10_2 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_B_ericsson_MAIN_2 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_C_ericsson_MAIN10_2 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_C_ericsson_MAIN_2 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_D_ericsson_MAIN10_2 
       ... Error
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_D_ericsson_MAIN_2 
       ... Error
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_E_ericsson_MAIN10_2 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_E_ericsson_MAIN_2 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_F_ericsson_MAIN10_2 
       ... Success
[JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_F_ericsson_MAIN_2 
       ... Success



-- 
Best Regards,
Wangao


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-29  8:21           ` Wangao Wang
@ 2026-05-29  9:55             ` Neil Armstrong
  2026-05-29 10:33               ` Wangao Wang
  0 siblings, 1 reply; 23+ messages in thread
From: Neil Armstrong @ 2026-05-29  9:55 UTC (permalink / raw)
  To: Wangao Wang, Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue

Hi,

On 5/29/26 10:21, Wangao Wang wrote:
> 
> 
> On 2026/5/28 21:26, Neil Armstrong wrote:
>> Hi Wangao,
>>
>> On 5/27/26 06:15, Wangao Wang wrote:
>>> I tested the v4 patch using the gst command you provided earlier. The decoded output still has the previous plane misalignment issue, but all frames are decoded successfully. When viewing the raw data with an image player at 1920x1080 resolution, the first frame looks correct but subsequent frames appear shifted. If viewed at 1920x1088 resolution, there are artifacts at the bottom of each frame. I've attached the images.
>>>
>>> Also, have you tested the 720p case? I can't get it to run on my end.
>>
>> Thanks for the report but I don't have access to the Purwa platform you use,
>> I've run test with multiple resolutions with display using P010
>> and QC10, and ran fluster aswell and all passed on SM8550 and SM8650.
>>
>> I'll test it on the Hamoa T14S I have which should be the closest to purwa,
>> but it uses the same driver setup as SM8550 so I expected it to work the same.
>>
>> Could you indicate which iris firmware you're using ?
>>
>> Could you try passing the fluster h265 main10 test suite with gstreamer ?
>>
>> fluster download -c h.265
>> fluster run -d GStreamer-H.265-V4L2 -ts JCT-VC-HEVC_V1 -q -s -j1
>>
>> The picture you send looks like there's a mismatch with the kernel
>> and firmware setup of planes offsets.
>> Could you check if there's a Purwa specific firmware property
>> to set for 10bit decoding ?
>>
>> Neil
>>
>>>
> 
> Hi Neil,
> 
> I also tested on hamoa, and it has the same issue as purwa. The firmware used on purwa is vpu30_p1_s7.mbn.
> 
> This is the result of fluster:
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WP_MAIN10_B_Toshiba_3       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_A_ericsson_MAIN10_2       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_A_ericsson_MAIN_2       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_B_ericsson_MAIN10_2       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_B_ericsson_MAIN_2       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_C_ericsson_MAIN10_2       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_C_ericsson_MAIN_2       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_D_ericsson_MAIN10_2       ... Error
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_D_ericsson_MAIN_2       ... Error
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_E_ericsson_MAIN10_2       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_E_ericsson_MAIN_2       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_F_ericsson_MAIN10_2       ... Success
> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_F_ericsson_MAIN_2       ... Success
> 

Ok so this works fine, so I'm really wondering if your main10 HEVC is not properly encoded.

Could you try playing a well know HEVC main10 files ?

For example I just tried the 1080p and 4k 10bit files on Hamoa + fluster and it just worked as expected:
https://larmoire.org/jellyfish/
https://larmoire.org/jellyfish/media/jellyfish-10-mbps-hd-hevc-10bit.mkv
https://larmoire.org/jellyfish/media/jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv

Neil


> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-29  9:55             ` Neil Armstrong
@ 2026-05-29 10:33               ` Wangao Wang
  2026-05-29 13:25                 ` Neil Armstrong
  0 siblings, 1 reply; 23+ messages in thread
From: Wangao Wang @ 2026-05-29 10:33 UTC (permalink / raw)
  To: Neil Armstrong, Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: wangao.wang, linux-media, linux-arm-msm, linux-kernel,
	Dmitry Baryshkov, Bryan O'Donoghue



On 2026/5/29 17:55, Neil Armstrong wrote:
> Hi,
> 
> On 5/29/26 10:21, Wangao Wang wrote:
>>
>>
>> On 2026/5/28 21:26, Neil Armstrong wrote:
>>> Hi Wangao,
>>>
>>> On 5/27/26 06:15, Wangao Wang wrote:
>>>> I tested the v4 patch using the gst command you provided earlier. 
>>>> The decoded output still has the previous plane misalignment issue, 
>>>> but all frames are decoded successfully. When viewing the raw data 
>>>> with an image player at 1920x1080 resolution, the first frame looks 
>>>> correct but subsequent frames appear shifted. If viewed at 1920x1088 
>>>> resolution, there are artifacts at the bottom of each frame. I've 
>>>> attached the images.
>>>>
>>>> Also, have you tested the 720p case? I can't get it to run on my end.
>>>
>>> Thanks for the report but I don't have access to the Purwa platform 
>>> you use,
>>> I've run test with multiple resolutions with display using P010
>>> and QC10, and ran fluster aswell and all passed on SM8550 and SM8650.
>>>
>>> I'll test it on the Hamoa T14S I have which should be the closest to 
>>> purwa,
>>> but it uses the same driver setup as SM8550 so I expected it to work 
>>> the same.
>>>
>>> Could you indicate which iris firmware you're using ?
>>>
>>> Could you try passing the fluster h265 main10 test suite with 
>>> gstreamer ?
>>>
>>> fluster download -c h.265
>>> fluster run -d GStreamer-H.265-V4L2 -ts JCT-VC-HEVC_V1 -q -s -j1
>>>
>>> The picture you send looks like there's a mismatch with the kernel
>>> and firmware setup of planes offsets.
>>> Could you check if there's a Purwa specific firmware property
>>> to set for 10bit decoding ?
>>>
>>> Neil
>>>
>>>>
>>
>> Hi Neil,
>>
>> I also tested on hamoa, and it has the same issue as purwa. The 
>> firmware used on purwa is vpu30_p1_s7.mbn.
>>
>> This is the result of fluster:
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WP_MAIN10_B_Toshiba_3 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_A_ericsson_MAIN10_2 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_A_ericsson_MAIN_2 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_B_ericsson_MAIN10_2 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_B_ericsson_MAIN_2 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_C_ericsson_MAIN10_2 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_C_ericsson_MAIN_2 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_D_ericsson_MAIN10_2 
>>       ... Error
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_D_ericsson_MAIN_2 
>>       ... Error
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_E_ericsson_MAIN10_2 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_E_ericsson_MAIN_2 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_F_ericsson_MAIN10_2 
>>       ... Success
>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_F_ericsson_MAIN_2 
>>       ... Success
>>
> 
> Ok so this works fine, so I'm really wondering if your main10 HEVC is 
> not properly encoded.
> 
> Could you try playing a well know HEVC main10 files ?
> 
> For example I just tried the 1080p and 4k 10bit files on Hamoa + fluster 
> and it just worked as expected:
> https://larmoire.org/jellyfish/
> https://larmoire.org/jellyfish/media/jellyfish-10-mbps-hd-hevc-10bit.mkv
> https://larmoire.org/jellyfish/media/jellyfish-120-mbps-4k-uhd- 
> hevc-10bit.mkv
> 
> Neil
> 
> 
>>
> 

Could you provide the test commands? I tried both files and the results 
from gst still show anomalies, but the results from iris_test_app are 
normal. I'm wondering if there are any additional settings needed on the 
client side.

Here are my test commands:
gst-launch-1.0 -v -m filesrc 
location=jellyfish-10-mbps-hd-hevc-10bit.mkv ! matroskademux ! h265parse 
! v4l2h265dec ! filesink location=1080P_out.yuv
gst-launch-1.0 -v -m filesrc 
location=jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv ! matroskademux ! 
h265parse ! v4l2h265dec ! filesink location=4K_out.yuv

-- 
Best Regards,
Wangao


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-29 10:33               ` Wangao Wang
@ 2026-05-29 13:25                 ` Neil Armstrong
  2026-06-01  5:52                   ` Wangao Wang
  0 siblings, 1 reply; 23+ messages in thread
From: Neil Armstrong @ 2026-05-29 13:25 UTC (permalink / raw)
  To: Wangao Wang, Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue

On 5/29/26 12:33, Wangao Wang wrote:
> 
> 
> On 2026/5/29 17:55, Neil Armstrong wrote:
>> Hi,
>>
>> On 5/29/26 10:21, Wangao Wang wrote:
>>>
>>>
>>> On 2026/5/28 21:26, Neil Armstrong wrote:
>>>> Hi Wangao,
>>>>
>>>> On 5/27/26 06:15, Wangao Wang wrote:
>>>>> I tested the v4 patch using the gst command you provided earlier. The decoded output still has the previous plane misalignment issue, but all frames are decoded successfully. When viewing the raw data with an image player at 1920x1080 resolution, the first frame looks correct but subsequent frames appear shifted. If viewed at 1920x1088 resolution, there are artifacts at the bottom of each frame. I've attached the images.
>>>>>
>>>>> Also, have you tested the 720p case? I can't get it to run on my end.
>>>>
>>>> Thanks for the report but I don't have access to the Purwa platform you use,
>>>> I've run test with multiple resolutions with display using P010
>>>> and QC10, and ran fluster aswell and all passed on SM8550 and SM8650.
>>>>
>>>> I'll test it on the Hamoa T14S I have which should be the closest to purwa,
>>>> but it uses the same driver setup as SM8550 so I expected it to work the same.
>>>>
>>>> Could you indicate which iris firmware you're using ?
>>>>
>>>> Could you try passing the fluster h265 main10 test suite with gstreamer ?
>>>>
>>>> fluster download -c h.265
>>>> fluster run -d GStreamer-H.265-V4L2 -ts JCT-VC-HEVC_V1 -q -s -j1
>>>>
>>>> The picture you send looks like there's a mismatch with the kernel
>>>> and firmware setup of planes offsets.
>>>> Could you check if there's a Purwa specific firmware property
>>>> to set for 10bit decoding ?
>>>>
>>>> Neil
>>>>
>>>>>
>>>
>>> Hi Neil,
>>>
>>> I also tested on hamoa, and it has the same issue as purwa. The firmware used on purwa is vpu30_p1_s7.mbn.
>>>
>>> This is the result of fluster:
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WP_MAIN10_B_Toshiba_3       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_A_ericsson_MAIN10_2       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_A_ericsson_MAIN_2       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_B_ericsson_MAIN10_2       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_B_ericsson_MAIN_2       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_C_ericsson_MAIN10_2       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_C_ericsson_MAIN_2       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_D_ericsson_MAIN10_2       ... Error
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_D_ericsson_MAIN_2       ... Error
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_E_ericsson_MAIN10_2       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_E_ericsson_MAIN_2       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_F_ericsson_MAIN10_2       ... Success
>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_F_ericsson_MAIN_2       ... Success
>>>
>>
>> Ok so this works fine, so I'm really wondering if your main10 HEVC is not properly encoded.
>>
>> Could you try playing a well know HEVC main10 files ?
>>
>> For example I just tried the 1080p and 4k 10bit files on Hamoa + fluster and it just worked as expected:
>> https://larmoire.org/jellyfish/
>> https://larmoire.org/jellyfish/media/jellyfish-10-mbps-hd-hevc-10bit.mkv
>> https://larmoire.org/jellyfish/media/jellyfish-120-mbps-4k-uhd- hevc-10bit.mkv
>>
>> Neil
>>
>>
>>>
>>
> 
> Could you provide the test commands? I tried both files and the results from gst still show anomalies, but the results from iris_test_app are normal. I'm wondering if there are any additional settings needed on the client side.
> 
> Here are my test commands:
> gst-launch-1.0 -v -m filesrc location=jellyfish-10-mbps-hd-hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! filesink location=1080P_out.yuv
> gst-launch-1.0 -v -m filesrc location=jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! filesink location=4K_out.yuv
> 

If I run those exact commands, I can correctly visualize the files with:
gst-launch-1.0 -v -m filesrc location=1080P_out.yuv ! rawvideoparse format=p010-10le width=1920 height=1080 frame-size=6266880 ! waylandsink
gst-launch-1.0 -v -m filesrc location=4K_out.yuv ! rawvideoparse format=p010-10le width=3840 height=2160 frame-size=25067520 ! waylandsink

I have to use the decoder full aligned buffer size because gst just dumps the whole v4l2 buffer into filesink and frames are not tighly packed together.

If you want to output tighly packed frames, this worked for me:
gst-launch-1.0 -v -m filesrc location=jellyfish-10-mbps-hd-hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! rawvideoparse format=p010-10le width=1920 height=1080 frame-size=6266880 ! filesink location=1080P_out.yuv
gst-launch-1.0 -v -m filesrc location=jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv.1 ! matroskademux ! h265parse ! v4l2h265dec ! rawvideoparse format=p010-10le width=3840 height=2160 frame-size=25067520 ! filesink location=4K_out.yuv

There's probably a better way I don't know, but in any case gstreamer will only use the "frame-size" portion of each frame and process it.

For example, you can convert it nv12 and dump to file, it will then dump only the nv12 data:
gst-launch-1.0 -v -m filesrc location=jellyfish-10-mbps-hd-hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! videoconvert ! video/x-raw, format=NV12 ! filesink location=1080P_out.yuv
gst-launch-1.0 -v -m filesrc location=1080P_out.yuv ! rawvideoparse format=nv12 width=1920 height=1080 ! waylandsink

If the plane offset/alignment was wrong, the convert frames would be wrong and playback would also be wrong.

Neil

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-29 13:25                 ` Neil Armstrong
@ 2026-06-01  5:52                   ` Wangao Wang
  2026-06-01  8:41                     ` Vikash Garodia
  0 siblings, 1 reply; 23+ messages in thread
From: Wangao Wang @ 2026-06-01  5:52 UTC (permalink / raw)
  To: Neil Armstrong, Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: wangao.wang, linux-media, linux-arm-msm, linux-kernel,
	Dmitry Baryshkov, Bryan O'Donoghue



On 2026/5/29 21:25, Neil Armstrong wrote:
> On 5/29/26 12:33, Wangao Wang wrote:
>>
>>
>> On 2026/5/29 17:55, Neil Armstrong wrote:
>>> Hi,
>>>
>>> On 5/29/26 10:21, Wangao Wang wrote:
>>>>
>>>>
>>>> On 2026/5/28 21:26, Neil Armstrong wrote:
>>>>> Hi Wangao,
>>>>>
>>>>> On 5/27/26 06:15, Wangao Wang wrote:
>>>>>> I tested the v4 patch using the gst command you provided earlier. 
>>>>>> The decoded output still has the previous plane misalignment 
>>>>>> issue, but all frames are decoded successfully. When viewing the 
>>>>>> raw data with an image player at 1920x1080 resolution, the first 
>>>>>> frame looks correct but subsequent frames appear shifted. If 
>>>>>> viewed at 1920x1088 resolution, there are artifacts at the bottom 
>>>>>> of each frame. I've attached the images.
>>>>>>
>>>>>> Also, have you tested the 720p case? I can't get it to run on my end.
>>>>>
>>>>> Thanks for the report but I don't have access to the Purwa platform 
>>>>> you use,
>>>>> I've run test with multiple resolutions with display using P010
>>>>> and QC10, and ran fluster aswell and all passed on SM8550 and SM8650.
>>>>>
>>>>> I'll test it on the Hamoa T14S I have which should be the closest 
>>>>> to purwa,
>>>>> but it uses the same driver setup as SM8550 so I expected it to 
>>>>> work the same.
>>>>>
>>>>> Could you indicate which iris firmware you're using ?
>>>>>
>>>>> Could you try passing the fluster h265 main10 test suite with 
>>>>> gstreamer ?
>>>>>
>>>>> fluster download -c h.265
>>>>> fluster run -d GStreamer-H.265-V4L2 -ts JCT-VC-HEVC_V1 -q -s -j1
>>>>>
>>>>> The picture you send looks like there's a mismatch with the kernel
>>>>> and firmware setup of planes offsets.
>>>>> Could you check if there's a Purwa specific firmware property
>>>>> to set for 10bit decoding ?
>>>>>
>>>>> Neil
>>>>>
>>>>>>
>>>>
>>>> Hi Neil,
>>>>
>>>> I also tested on hamoa, and it has the same issue as purwa. The 
>>>> firmware used on purwa is vpu30_p1_s7.mbn.
>>>>
>>>> This is the result of fluster:
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WP_MAIN10_B_Toshiba_3 
>>>>       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>> WPP_A_ericsson_MAIN10_2       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_A_ericsson_MAIN_2 
>>>>       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>> WPP_B_ericsson_MAIN10_2       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_B_ericsson_MAIN_2 
>>>>       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>> WPP_C_ericsson_MAIN10_2       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_C_ericsson_MAIN_2 
>>>>       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>> WPP_D_ericsson_MAIN10_2       ... Error
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_D_ericsson_MAIN_2 
>>>>       ... Error
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>> WPP_E_ericsson_MAIN10_2       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_E_ericsson_MAIN_2 
>>>>       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>> WPP_F_ericsson_MAIN10_2       ... Success
>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) WPP_F_ericsson_MAIN_2 
>>>>       ... Success
>>>>
>>>
>>> Ok so this works fine, so I'm really wondering if your main10 HEVC is 
>>> not properly encoded.
>>>
>>> Could you try playing a well know HEVC main10 files ?
>>>
>>> For example I just tried the 1080p and 4k 10bit files on Hamoa + 
>>> fluster and it just worked as expected:
>>> https://larmoire.org/jellyfish/
>>> https://larmoire.org/jellyfish/media/jellyfish-10-mbps-hd-hevc-10bit.mkv
>>> https://larmoire.org/jellyfish/media/jellyfish-120-mbps-4k-uhd- 
>>> hevc-10bit.mkv
>>>
>>> Neil
>>
>> Could you provide the test commands? I tried both files and the 
>> results from gst still show anomalies, but the results from 
>> iris_test_app are normal. I'm wondering if there are any additional 
>> settings needed on the client side.
>>
>> Here are my test commands:
>> gst-launch-1.0 -v -m filesrc location=jellyfish-10-mbps-hd- 
>> hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! filesink 
>> location=1080P_out.yuv
>> gst-launch-1.0 -v -m filesrc location=jellyfish-120-mbps-4k-uhd- 
>> hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! filesink 
>> location=4K_out.yuv
>>
> 
> If I run those exact commands, I can correctly visualize the files with:
> gst-launch-1.0 -v -m filesrc location=1080P_out.yuv ! rawvideoparse 
> format=p010-10le width=1920 height=1080 frame-size=6266880 ! waylandsink
> gst-launch-1.0 -v -m filesrc location=4K_out.yuv ! rawvideoparse 
> format=p010-10le width=3840 height=2160 frame-size=25067520 ! waylandsink
> 
> I have to use the decoder full aligned buffer size because gst just 
> dumps the whole v4l2 buffer into filesink and frames are not tighly 
> packed together.
> 
> If you want to output tighly packed frames, this worked for me:
> gst-launch-1.0 -v -m filesrc location=jellyfish-10-mbps-hd- 
> hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! rawvideoparse 
> format=p010-10le width=1920 height=1080 frame-size=6266880 ! filesink 
> location=1080P_out.yuv
> gst-launch-1.0 -v -m filesrc location=jellyfish-120-mbps-4k-uhd- 
> hevc-10bit.mkv.1 ! matroskademux ! h265parse ! v4l2h265dec ! 
> rawvideoparse format=p010-10le width=3840 height=2160 frame- 
> size=25067520 ! filesink location=4K_out.yuv
> 
> There's probably a better way I don't know, but in any case gstreamer 
> will only use the "frame-size" portion of each frame and process it.
> 
> For example, you can convert it nv12 and dump to file, it will then dump 
> only the nv12 data:
> gst-launch-1.0 -v -m filesrc location=jellyfish-10-mbps-hd- 
> hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! 
> videoconvert ! video/x-raw, format=NV12 ! filesink location=1080P_out.yuv
> gst-launch-1.0 -v -m filesrc location=1080P_out.yuv ! rawvideoparse 
> format=nv12 width=1920 height=1080 ! waylandsink
> 
> If the plane offset/alignment was wrong, the convert frames would be 
> wrong and playback would also be wrong.
> 
> Neil

Thanks. Using the commands you provided, the output file no longer has 
the previous issues.

-- 
Best Regards,
Wangao


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-06-01  5:52                   ` Wangao Wang
@ 2026-06-01  8:41                     ` Vikash Garodia
  0 siblings, 0 replies; 23+ messages in thread
From: Vikash Garodia @ 2026-06-01  8:41 UTC (permalink / raw)
  To: Wangao Wang, Neil Armstrong, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue


On 6/1/2026 11:22 AM, Wangao Wang wrote:
> 
> 
> On 2026/5/29 21:25, Neil Armstrong wrote:
>> On 5/29/26 12:33, Wangao Wang wrote:
>>>
>>>
>>> On 2026/5/29 17:55, Neil Armstrong wrote:
>>>> Hi,
>>>>
>>>> On 5/29/26 10:21, Wangao Wang wrote:
>>>>>
>>>>>
>>>>> On 2026/5/28 21:26, Neil Armstrong wrote:
>>>>>> Hi Wangao,
>>>>>>
>>>>>> On 5/27/26 06:15, Wangao Wang wrote:
>>>>>>> I tested the v4 patch using the gst command you provided earlier. 
>>>>>>> The decoded output still has the previous plane misalignment 
>>>>>>> issue, but all frames are decoded successfully. When viewing the 
>>>>>>> raw data with an image player at 1920x1080 resolution, the first 
>>>>>>> frame looks correct but subsequent frames appear shifted. If 
>>>>>>> viewed at 1920x1088 resolution, there are artifacts at the bottom 
>>>>>>> of each frame. I've attached the images.
>>>>>>>
>>>>>>> Also, have you tested the 720p case? I can't get it to run on my 
>>>>>>> end.
>>>>>>
>>>>>> Thanks for the report but I don't have access to the Purwa 
>>>>>> platform you use,
>>>>>> I've run test with multiple resolutions with display using P010
>>>>>> and QC10, and ran fluster aswell and all passed on SM8550 and SM8650.
>>>>>>
>>>>>> I'll test it on the Hamoa T14S I have which should be the closest 
>>>>>> to purwa,
>>>>>> but it uses the same driver setup as SM8550 so I expected it to 
>>>>>> work the same.
>>>>>>
>>>>>> Could you indicate which iris firmware you're using ?
>>>>>>
>>>>>> Could you try passing the fluster h265 main10 test suite with 
>>>>>> gstreamer ?
>>>>>>
>>>>>> fluster download -c h.265
>>>>>> fluster run -d GStreamer-H.265-V4L2 -ts JCT-VC-HEVC_V1 -q -s -j1
>>>>>>
>>>>>> The picture you send looks like there's a mismatch with the kernel
>>>>>> and firmware setup of planes offsets.
>>>>>> Could you check if there's a Purwa specific firmware property
>>>>>> to set for 10bit decoding ?
>>>>>>
>>>>>> Neil
>>>>>>
>>>>>>>
>>>>>
>>>>> Hi Neil,
>>>>>
>>>>> I also tested on hamoa, and it has the same issue as purwa. The 
>>>>> firmware used on purwa is vpu30_p1_s7.mbn.
>>>>>
>>>>> This is the result of fluster:
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WP_MAIN10_B_Toshiba_3       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_A_ericsson_MAIN10_2       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_A_ericsson_MAIN_2       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_B_ericsson_MAIN10_2       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_B_ericsson_MAIN_2       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_C_ericsson_MAIN10_2       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_C_ericsson_MAIN_2       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_D_ericsson_MAIN10_2       ... Error
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_D_ericsson_MAIN_2       ... Error
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_E_ericsson_MAIN10_2       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_E_ericsson_MAIN_2       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_F_ericsson_MAIN10_2       ... Success
>>>>> [JCT-VC-HEVC_V1] (GStreamer-H.265-V4L2-Gst1.0) 
>>>>> WPP_F_ericsson_MAIN_2       ... Success
>>>>>
>>>>
>>>> Ok so this works fine, so I'm really wondering if your main10 HEVC 
>>>> is not properly encoded.
>>>>
>>>> Could you try playing a well know HEVC main10 files ?
>>>>
>>>> For example I just tried the 1080p and 4k 10bit files on Hamoa + 
>>>> fluster and it just worked as expected:
>>>> https://larmoire.org/jellyfish/
>>>> https://larmoire.org/jellyfish/media/jellyfish-10-mbps-hd- 
>>>> hevc-10bit.mkv
>>>> https://larmoire.org/jellyfish/media/jellyfish-120-mbps-4k-uhd- 
>>>> hevc-10bit.mkv
>>>>
>>>> Neil
>>>
>>> Could you provide the test commands? I tried both files and the 
>>> results from gst still show anomalies, but the results from 
>>> iris_test_app are normal. I'm wondering if there are any additional 
>>> settings needed on the client side.
>>>
>>> Here are my test commands:
>>> gst-launch-1.0 -v -m filesrc location=jellyfish-10-mbps-hd- 
>>> hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! filesink 
>>> location=1080P_out.yuv
>>> gst-launch-1.0 -v -m filesrc location=jellyfish-120-mbps-4k-uhd- 
>>> hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! filesink 
>>> location=4K_out.yuv
>>>
>>
>> If I run those exact commands, I can correctly visualize the files with:
>> gst-launch-1.0 -v -m filesrc location=1080P_out.yuv ! rawvideoparse 
>> format=p010-10le width=1920 height=1080 frame-size=6266880 ! waylandsink
>> gst-launch-1.0 -v -m filesrc location=4K_out.yuv ! rawvideoparse 
>> format=p010-10le width=3840 height=2160 frame-size=25067520 ! waylandsink
>>
>> I have to use the decoder full aligned buffer size because gst just 
>> dumps the whole v4l2 buffer into filesink and frames are not tighly 
>> packed together.
>>
>> If you want to output tighly packed frames, this worked for me:
>> gst-launch-1.0 -v -m filesrc location=jellyfish-10-mbps-hd- 
>> hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! 
>> rawvideoparse format=p010-10le width=1920 height=1080 frame- 
>> size=6266880 ! filesink location=1080P_out.yuv
>> gst-launch-1.0 -v -m filesrc location=jellyfish-120-mbps-4k-uhd- 
>> hevc-10bit.mkv.1 ! matroskademux ! h265parse ! v4l2h265dec ! 
>> rawvideoparse format=p010-10le width=3840 height=2160 frame- 
>> size=25067520 ! filesink location=4K_out.yuv
>>
>> There's probably a better way I don't know, but in any case gstreamer 
>> will only use the "frame-size" portion of each frame and process it.
>>
>> For example, you can convert it nv12 and dump to file, it will then 
>> dump only the nv12 data:
>> gst-launch-1.0 -v -m filesrc location=jellyfish-10-mbps-hd- 
>> hevc-10bit.mkv ! matroskademux ! h265parse ! v4l2h265dec ! 
>> videoconvert ! video/x-raw, format=NV12 ! filesink location=1080P_out.yuv
>> gst-launch-1.0 -v -m filesrc location=1080P_out.yuv ! rawvideoparse 
>> format=nv12 width=1920 height=1080 ! waylandsink
>>
>> If the plane offset/alignment was wrong, the convert frames would be 
>> wrong and playback would also be wrong.
>>
>> Neil
> 
> Thanks. Using the commands you provided, the output file no longer has 
> the previous issues.
> 

Thanks Wangao and Neil.

Wangao, pls add your tested-by.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-05-21  9:24 [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
                   ` (6 preceding siblings ...)
  2026-05-26  7:53 ` [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Vikash Garodia
@ 2026-06-01  9:01 ` Wangao Wang
  2026-06-01 15:03   ` Bryan O'Donoghue
  7 siblings, 1 reply; 23+ messages in thread
From: Wangao Wang @ 2026-06-01  9:01 UTC (permalink / raw)
  To: Neil Armstrong, Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab
  Cc: wangao.wang, linux-media, linux-arm-msm, linux-kernel,
	Dmitry Baryshkov, Bryan O'Donoghue



On 2026/5/21 17:24, Neil Armstrong wrote:
> This adds the plumbing to support decoding HEVC, VP9 and AV1
> streams into 10bit pixel formats, linear and compressed.
> 
> This has only been tested on SM8550 & SM8650 with HEVC, and was
> inspired by Venus, DRM MSM and the downstream vidc driver for the
> buffer calculations and HFI messages.
> 
> Gstreamer support for QC08 and QC10 need the MR at [1] to be applied,
> but NV12 and P010 works out of the box with mainline Gstreamer.
> 
> Fluster HEVC results on SM8650 using Gstreamer:
> 
> ./fluster.py run -ts JCT-VC-HEVC_V1 -d GStreamer-H.265-V4L2-Gst1.0 - 141/147
> The failing test case:
> - Pixel Format mismatch
>   - TSUNEQBD_A_MAIN10_Technicolor_2 - Gstreamer waits NV12 but decoder returns P010
> - Unsupported resolution
>   - PICSIZE_A_Bossen_1 - resolution is higher than max supported
>   - PICSIZE_B_Bossen_1 - resolution is higher than max supported
>   - WPP_D_ericsson_MAIN_2 - resolution is lower than min supported
>   - WPP_D_ericsson_MAIN10_2 - resolution is lower than min supported
> - CRC mismatch
>   - RAP_A_docomo_6
> 
> v4l2-compliance results on SM8550 & SM8650:
> 
> $ v4l2-compliance -d /dev/video1 -s
> v4l2-compliance 1.33.0-5456, 64 bits, 64-bit time_t
> v4l2-compliance SHA: 8aa593bda182 2026-04-11 10:54:25
> 
> Compliance test for iris_driver device /dev/video1:
> 
> Driver Info:
> 	Driver name      : iris_driver
> 	Card type        : Iris Encoder
> 	Bus info         : platform:aa00000.video-codec
> 	Driver version   : 7.0.0
> 	Capabilities     : 0x84204000
> 		Video Memory-to-Memory Multiplanar
> 		Streaming
> 		Extended Pix Format
> 		Device Capabilities
> 	Device Caps      : 0x04204000
> 		Video Memory-to-Memory Multiplanar
> 		Streaming
> 		Extended Pix Format
> 	Detected Stateful Encoder
> 
> Required ioctls:
> 	test VIDIOC_QUERYCAP: OK
> 	test invalid ioctls: OK
> 
> Allow for multiple opens:
> 	test second /dev/video1 open: OK
> 	test VIDIOC_QUERYCAP: OK
> 	test VIDIOC_G/S_PRIORITY: OK
> 	test for unlimited opens: OK
> 
> Debug ioctls:
> 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> 	test VIDIOC_LOG_STATUS: OK (Not Supported)
> 
> Input ioctls:
> 	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
> 	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
> 	Inputs: 0 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
> 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> 	Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Input/Output configuration ioctls:
> 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> 	test VIDIOC_G/S_EDID: OK (Not Supported)
> 
> Control ioctls:
> 	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> 	test VIDIOC_QUERYCTRL: OK
> 	test VIDIOC_G/S_CTRL: OK
> 	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> 	Standard Controls: 43 Private Controls: 0
> 
> Format ioctls:
> 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> 	test VIDIOC_G/S_PARM: OK
> 	test VIDIOC_G_FBUF: OK (Not Supported)
> 	test VIDIOC_G_FMT: OK
> 	test VIDIOC_TRY_FMT: OK
> 	test VIDIOC_S_FMT: OK
> 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> 	test Cropping: OK
> 	test Composing: OK (Not Supported)
> 	test Scaling: OK (Not Supported)
> 
> Codec ioctls:
> 	test VIDIOC_(TRY_)ENCODER_CMD: OK
> 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> 	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
> 
> Buffer ioctls:
> 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> 	test CREATE_BUFS maximum buffers: OK
> 	test VIDIOC_REMOVE_BUFS: OK
> 	test VIDIOC_EXPBUF: OK
> 	test Requests: OK (Not Supported)
> 	test blocking wait: OK
> 
> Test input 0:
> 
> Streaming ioctls:
> 	test read/write: OK (Not Supported)
> 	Video Capture Multiplanar: Captured 61 buffers
> 	test MMAP (select, REQBUFS): OK
> 	Video Capture Multiplanar: Captured 61 buffers
> 	test MMAP (epoll, REQBUFS): OK
> 	Video Capture Multiplanar: Captured 61 buffers
> 	test MMAP (select, CREATE_BUFS): OK
> 	Video Capture Multiplanar: Captured 61 buffers
> 	test MMAP (epoll, CREATE_BUFS): OK
> 	test USERPTR (select): OK (Not Supported)
> 	test DMABUF: Cannot test, specify --expbuf-device
> 
> Total for iris_driver device /dev/video1: 54, Succeeded: 54, Failed: 0, Warnings: 0
> 
> $ v4l2-compliance -d /dev/video0 -s5 --stream-from=test_video_10s.h264
> v4l2-compliance 1.33.0-5456, 64 bits, 64-bit time_t
> v4l2-compliance SHA: 8aa593bda182 2026-04-11 10:54:25
> 
> Compliance test for iris_driver device /dev/video0:
> 
> Driver Info:
> 	Driver name      : iris_driver
> 	Card type        : Iris Decoder
> 	Bus info         : platform:aa00000.video-codec
> 	Driver version   : 7.0.0
> 	Capabilities     : 0x84204000
> 		Video Memory-to-Memory Multiplanar
> 		Streaming
> 		Extended Pix Format
> 		Device Capabilities
> 	Device Caps      : 0x04204000
> 		Video Memory-to-Memory Multiplanar
> 		Streaming
> 		Extended Pix Format
> 	Detected Stateful Decoder
> 
> Required ioctls:
> 	test VIDIOC_QUERYCAP: OK
> 	test invalid ioctls: OK
> 
> Allow for multiple opens:
> 	test second /dev/video0 open: OK
> 	test VIDIOC_QUERYCAP: OK
> 	test VIDIOC_G/S_PRIORITY: OK
> 	test for unlimited opens: OK
> 
> Debug ioctls:
> 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
> 	test VIDIOC_LOG_STATUS: OK (Not Supported)
> 
> Input ioctls:
> 	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
> 	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
> 	Inputs: 0 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
> 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> 	Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Input/Output configuration ioctls:
> 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
> 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
> 	test VIDIOC_G/S_EDID: OK (Not Supported)
> 
> Control ioctls:
> 	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
> 	test VIDIOC_QUERYCTRL: OK
> 	test VIDIOC_G/S_CTRL: OK
> 	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
> 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
> 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> 	Standard Controls: 12 Private Controls: 0
> 
> Format ioctls:
> 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
> 	test VIDIOC_G/S_PARM: OK (Not Supported)
> 	test VIDIOC_G_FBUF: OK (Not Supported)
> 	test VIDIOC_G_FMT: OK
> 	test VIDIOC_TRY_FMT: OK
> 	test VIDIOC_S_FMT: OK
> 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
> 	test Cropping: OK
> 	test Composing: OK
> 	test Scaling: OK (Not Supported)
> 
> Codec ioctls:
> 	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
> 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
> 	test VIDIOC_(TRY_)DECODER_CMD: OK
> 
> Buffer ioctls:
> 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
> 	test CREATE_BUFS maximum buffers: OK
> 	test VIDIOC_REMOVE_BUFS: OK
> 	test VIDIOC_EXPBUF: OK
> 	test Requests: OK (Not Supported)
> 	test blocking wait: OK
> 
> Test input 0:
> 
> Streaming ioctls:
> 	test read/write: OK (Not Supported)
> the input file is smaller than 7077888 bytes
> 	Video Capture Multiplanar: Captured 601 buffers
> 	test MMAP (select, REQBUFS): OK
> the input file is smaller than 7077888 bytes
> 	Video Capture Multiplanar: Captured 601 buffers
> 	test MMAP (epoll, REQBUFS): OK
> the input file is smaller than 7077888 bytes
> 	Video Capture Multiplanar: Captured 601 buffers
> 	test MMAP (select, CREATE_BUFS): OK
> the input file is smaller than 7077888 bytes
> 	Video Capture Multiplanar: Captured 601 buffers
> 	test MMAP (epoll, CREATE_BUFS): OK
> 	test USERPTR (select): OK (Not Supported)
> 	test DMABUF: Cannot test, specify --expbuf-device
> 
> Total for iris_driver device /dev/video0: 54, Succeeded: 54, Failed: 0, Warnings: 0
> 
> [1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8195
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
> Changes in v4:
> - Picked review tags
> - Use u32 instead of __u32
> - Explicit DPB
> - Drop NULL and use >>1 in q10c buffer calc
> - Drop selicolon after switch statementr
> - Correctly align HFI_PROP_UBWC_STRIDE_SCANLINE entry
> - Rebase on media next tree after the file split
> - Link to v3: https://patch.msgid.link/20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org
> 
> Changes in v3:
> - Added review tag on patch 1
> - Limited stride command to AV1 decoding only
> - Link to v2: https://patch.msgid.link/20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org
> 
> Changes in v2:
> - Fixed bug breaking 8bit decoding
> - Dropped filtering on G_FMT while waiting for soure change
> - Dropped format filtering on ENUMFMT
> - Switched ALIGN(x, 192) to roundup(x, 192) because ALIGN works only with Power Of Two numbers
> - Cleaned and refactors the width/height/stride calculations
> - Cleaned and redesigned the buffer calculations functions with proper comments and var names
> - Passed fluster and v4l2-compliance to check for non regression
> - Tested on SM8550
> - Added missing V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 with made gstreamer fail decoding
> - Link to v1: https://patch.msgid.link/20260408-topic-sm8x50-iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org
> 
> ---
> Neil Armstrong (6):
>        media: qcom: iris: add helpers for 8bit and 10bit formats
>        media: qcom: iris: add QC10C & P010 buffer size calculations
>        media: qcom: iris: gen2: add support for 10bit decoding
>        media: qcom: iris: vdec: update size and stride calculations for 10bit formats
>        media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
>        media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
> 
>   drivers/media/platform/qcom/iris/iris_buffer.c     | 195 ++++++++++++++++++++-
>   drivers/media/platform/qcom/iris/iris_hfi_gen2.c   |   8 +-
>   .../platform/qcom/iris/iris_hfi_gen2_command.c     |  75 +++++++-
>   .../platform/qcom/iris/iris_hfi_gen2_defines.h     |   1 +
>   .../platform/qcom/iris/iris_hfi_gen2_response.c    |  37 +++-
>   drivers/media/platform/qcom/iris/iris_instance.h   |   2 +
>   .../platform/qcom/iris/iris_platform_common.h      |   1 +
>   drivers/media/platform/qcom/iris/iris_utils.c      |  16 +-
>   drivers/media/platform/qcom/iris/iris_utils.h      |   2 +
>   drivers/media/platform/qcom/iris/iris_vdec.c       |  42 ++++-
>   10 files changed, 364 insertions(+), 15 deletions(-)
> ---
> base-commit: 86693e86019a7466be961fd4f45d407cc0b0ba0a
> change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c
> 
> Best regards,
> --
> Neil Armstrong <neil.armstrong@linaro.org>
> 
> 

Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>

-- 
Best Regards,
Wangao


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-06-01  9:01 ` Wangao Wang
@ 2026-06-01 15:03   ` Bryan O'Donoghue
  2026-06-01 18:59     ` Neil Armstrong
  0 siblings, 1 reply; 23+ messages in thread
From: Bryan O'Donoghue @ 2026-06-01 15:03 UTC (permalink / raw)
  To: Wangao Wang, Neil Armstrong, Vikash Garodia, Dikshita Agarwal,
	Abhinav Kumar, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue

On 01/06/2026 10:01, Wangao Wang wrote:
> 
> 
> On 2026/5/21 17:24, Neil Armstrong wrote:
>> This adds the plumbing to support decoding HEVC, VP9 and AV1
>> streams into 10bit pixel formats, linear and compressed.
>>
>> This has only been tested on SM8550 & SM8650 with HEVC, and was
>> inspired by Venus, DRM MSM and the downstream vidc driver for the
>> buffer calculations and HFI messages.
>>
>> Gstreamer support for QC08 and QC10 need the MR at [1] to be applied,
>> but NV12 and P010 works out of the box with mainline Gstreamer.
>>
>> Fluster HEVC results on SM8650 using Gstreamer:
>>
>> ./fluster.py run -ts JCT-VC-HEVC_V1 -d GStreamer-H.265-V4L2-Gst1.0 - 141/147
>> The failing test case:
>> - Pixel Format mismatch
>>    - TSUNEQBD_A_MAIN10_Technicolor_2 - Gstreamer waits NV12 but decoder returns P010
>> - Unsupported resolution
>>    - PICSIZE_A_Bossen_1 - resolution is higher than max supported
>>    - PICSIZE_B_Bossen_1 - resolution is higher than max supported
>>    - WPP_D_ericsson_MAIN_2 - resolution is lower than min supported
>>    - WPP_D_ericsson_MAIN10_2 - resolution is lower than min supported
>> - CRC mismatch
>>    - RAP_A_docomo_6
>>
>> v4l2-compliance results on SM8550 & SM8650:
>>
>> $ v4l2-compliance -d /dev/video1 -s
>> v4l2-compliance 1.33.0-5456, 64 bits, 64-bit time_t
>> v4l2-compliance SHA: 8aa593bda182 2026-04-11 10:54:25
>>
>> Compliance test for iris_driver device /dev/video1:
>>
>> Driver Info:
>> 	Driver name      : iris_driver
>> 	Card type        : Iris Encoder
>> 	Bus info         : platform:aa00000.video-codec
>> 	Driver version   : 7.0.0
>> 	Capabilities     : 0x84204000
>> 		Video Memory-to-Memory Multiplanar
>> 		Streaming
>> 		Extended Pix Format
>> 		Device Capabilities
>> 	Device Caps      : 0x04204000
>> 		Video Memory-to-Memory Multiplanar
>> 		Streaming
>> 		Extended Pix Format
>> 	Detected Stateful Encoder
>>
>> Required ioctls:
>> 	test VIDIOC_QUERYCAP: OK
>> 	test invalid ioctls: OK
>>
>> Allow for multiple opens:
>> 	test second /dev/video1 open: OK
>> 	test VIDIOC_QUERYCAP: OK
>> 	test VIDIOC_G/S_PRIORITY: OK
>> 	test for unlimited opens: OK
>>
>> Debug ioctls:
>> 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>> 	test VIDIOC_LOG_STATUS: OK (Not Supported)
>>
>> Input ioctls:
>> 	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>> 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>> 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
>> 	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>> 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
>> 	Inputs: 0 Audio Inputs: 0 Tuners: 0
>>
>> Output ioctls:
>> 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>> 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>> 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>> 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>> 	Outputs: 0 Audio Outputs: 0 Modulators: 0
>>
>> Input/Output configuration ioctls:
>> 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>> 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>> 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>> 	test VIDIOC_G/S_EDID: OK (Not Supported)
>>
>> Control ioctls:
>> 	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>> 	test VIDIOC_QUERYCTRL: OK
>> 	test VIDIOC_G/S_CTRL: OK
>> 	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>> 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
>> 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>> 	Standard Controls: 43 Private Controls: 0
>>
>> Format ioctls:
>> 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>> 	test VIDIOC_G/S_PARM: OK
>> 	test VIDIOC_G_FBUF: OK (Not Supported)
>> 	test VIDIOC_G_FMT: OK
>> 	test VIDIOC_TRY_FMT: OK
>> 	test VIDIOC_S_FMT: OK
>> 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>> 	test Cropping: OK
>> 	test Composing: OK (Not Supported)
>> 	test Scaling: OK (Not Supported)
>>
>> Codec ioctls:
>> 	test VIDIOC_(TRY_)ENCODER_CMD: OK
>> 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>> 	test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>
>> Buffer ioctls:
>> 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>> 	test CREATE_BUFS maximum buffers: OK
>> 	test VIDIOC_REMOVE_BUFS: OK
>> 	test VIDIOC_EXPBUF: OK
>> 	test Requests: OK (Not Supported)
>> 	test blocking wait: OK
>>
>> Test input 0:
>>
>> Streaming ioctls:
>> 	test read/write: OK (Not Supported)
>> 	Video Capture Multiplanar: Captured 61 buffers
>> 	test MMAP (select, REQBUFS): OK
>> 	Video Capture Multiplanar: Captured 61 buffers
>> 	test MMAP (epoll, REQBUFS): OK
>> 	Video Capture Multiplanar: Captured 61 buffers
>> 	test MMAP (select, CREATE_BUFS): OK
>> 	Video Capture Multiplanar: Captured 61 buffers
>> 	test MMAP (epoll, CREATE_BUFS): OK
>> 	test USERPTR (select): OK (Not Supported)
>> 	test DMABUF: Cannot test, specify --expbuf-device
>>
>> Total for iris_driver device /dev/video1: 54, Succeeded: 54, Failed: 0, Warnings: 0
>>
>> $ v4l2-compliance -d /dev/video0 -s5 --stream-from=test_video_10s.h264
>> v4l2-compliance 1.33.0-5456, 64 bits, 64-bit time_t
>> v4l2-compliance SHA: 8aa593bda182 2026-04-11 10:54:25
>>
>> Compliance test for iris_driver device /dev/video0:
>>
>> Driver Info:
>> 	Driver name      : iris_driver
>> 	Card type        : Iris Decoder
>> 	Bus info         : platform:aa00000.video-codec
>> 	Driver version   : 7.0.0
>> 	Capabilities     : 0x84204000
>> 		Video Memory-to-Memory Multiplanar
>> 		Streaming
>> 		Extended Pix Format
>> 		Device Capabilities
>> 	Device Caps      : 0x04204000
>> 		Video Memory-to-Memory Multiplanar
>> 		Streaming
>> 		Extended Pix Format
>> 	Detected Stateful Decoder
>>
>> Required ioctls:
>> 	test VIDIOC_QUERYCAP: OK
>> 	test invalid ioctls: OK
>>
>> Allow for multiple opens:
>> 	test second /dev/video0 open: OK
>> 	test VIDIOC_QUERYCAP: OK
>> 	test VIDIOC_G/S_PRIORITY: OK
>> 	test for unlimited opens: OK
>>
>> Debug ioctls:
>> 	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>> 	test VIDIOC_LOG_STATUS: OK (Not Supported)
>>
>> Input ioctls:
>> 	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>> 	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>> 	test VIDIOC_ENUMAUDIO: OK (Not Supported)
>> 	test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>> 	test VIDIOC_G/S_AUDIO: OK (Not Supported)
>> 	Inputs: 0 Audio Inputs: 0 Tuners: 0
>>
>> Output ioctls:
>> 	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>> 	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>> 	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>> 	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>> 	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>> 	Outputs: 0 Audio Outputs: 0 Modulators: 0
>>
>> Input/Output configuration ioctls:
>> 	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>> 	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>> 	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>> 	test VIDIOC_G/S_EDID: OK (Not Supported)
>>
>> Control ioctls:
>> 	test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>> 	test VIDIOC_QUERYCTRL: OK
>> 	test VIDIOC_G/S_CTRL: OK
>> 	test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>> 	test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
>> 	test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>> 	Standard Controls: 12 Private Controls: 0
>>
>> Format ioctls:
>> 	test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>> 	test VIDIOC_G/S_PARM: OK (Not Supported)
>> 	test VIDIOC_G_FBUF: OK (Not Supported)
>> 	test VIDIOC_G_FMT: OK
>> 	test VIDIOC_TRY_FMT: OK
>> 	test VIDIOC_S_FMT: OK
>> 	test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>> 	test Cropping: OK
>> 	test Composing: OK
>> 	test Scaling: OK (Not Supported)
>>
>> Codec ioctls:
>> 	test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>> 	test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>> 	test VIDIOC_(TRY_)DECODER_CMD: OK
>>
>> Buffer ioctls:
>> 	test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>> 	test CREATE_BUFS maximum buffers: OK
>> 	test VIDIOC_REMOVE_BUFS: OK
>> 	test VIDIOC_EXPBUF: OK
>> 	test Requests: OK (Not Supported)
>> 	test blocking wait: OK
>>
>> Test input 0:
>>
>> Streaming ioctls:
>> 	test read/write: OK (Not Supported)
>> the input file is smaller than 7077888 bytes
>> 	Video Capture Multiplanar: Captured 601 buffers
>> 	test MMAP (select, REQBUFS): OK
>> the input file is smaller than 7077888 bytes
>> 	Video Capture Multiplanar: Captured 601 buffers
>> 	test MMAP (epoll, REQBUFS): OK
>> the input file is smaller than 7077888 bytes
>> 	Video Capture Multiplanar: Captured 601 buffers
>> 	test MMAP (select, CREATE_BUFS): OK
>> the input file is smaller than 7077888 bytes
>> 	Video Capture Multiplanar: Captured 601 buffers
>> 	test MMAP (epoll, CREATE_BUFS): OK
>> 	test USERPTR (select): OK (Not Supported)
>> 	test DMABUF: Cannot test, specify --expbuf-device
>>
>> Total for iris_driver device /dev/video0: 54, Succeeded: 54, Failed: 0, Warnings: 0
>>
>> [1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8195
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>> Changes in v4:
>> - Picked review tags
>> - Use u32 instead of __u32
>> - Explicit DPB
>> - Drop NULL and use >>1 in q10c buffer calc
>> - Drop selicolon after switch statementr
>> - Correctly align HFI_PROP_UBWC_STRIDE_SCANLINE entry
>> - Rebase on media next tree after the file split
>> - Link to v3: https://patch.msgid.link/20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org
>>
>> Changes in v3:
>> - Added review tag on patch 1
>> - Limited stride command to AV1 decoding only
>> - Link to v2: https://patch.msgid.link/20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org
>>
>> Changes in v2:
>> - Fixed bug breaking 8bit decoding
>> - Dropped filtering on G_FMT while waiting for soure change
>> - Dropped format filtering on ENUMFMT
>> - Switched ALIGN(x, 192) to roundup(x, 192) because ALIGN works only with Power Of Two numbers
>> - Cleaned and refactors the width/height/stride calculations
>> - Cleaned and redesigned the buffer calculations functions with proper comments and var names
>> - Passed fluster and v4l2-compliance to check for non regression
>> - Tested on SM8550
>> - Added missing V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 with made gstreamer fail decoding
>> - Link to v1: https://patch.msgid.link/20260408-topic-sm8x50-iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org
>>
>> ---
>> Neil Armstrong (6):
>>         media: qcom: iris: add helpers for 8bit and 10bit formats
>>         media: qcom: iris: add QC10C & P010 buffer size calculations
>>         media: qcom: iris: gen2: add support for 10bit decoding
>>         media: qcom: iris: vdec: update size and stride calculations for 10bit formats
>>         media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
>>         media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
>>
>>    drivers/media/platform/qcom/iris/iris_buffer.c     | 195 ++++++++++++++++++++-
>>    drivers/media/platform/qcom/iris/iris_hfi_gen2.c   |   8 +-
>>    .../platform/qcom/iris/iris_hfi_gen2_command.c     |  75 +++++++-
>>    .../platform/qcom/iris/iris_hfi_gen2_defines.h     |   1 +
>>    .../platform/qcom/iris/iris_hfi_gen2_response.c    |  37 +++-
>>    drivers/media/platform/qcom/iris/iris_instance.h   |   2 +
>>    .../platform/qcom/iris/iris_platform_common.h      |   1 +
>>    drivers/media/platform/qcom/iris/iris_utils.c      |  16 +-
>>    drivers/media/platform/qcom/iris/iris_utils.h      |   2 +
>>    drivers/media/platform/qcom/iris/iris_vdec.c       |  42 ++++-
>>    10 files changed, 364 insertions(+), 15 deletions(-)
>> ---
>> base-commit: 86693e86019a7466be961fd4f45d407cc0b0ba0a
>> change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c
>>
>> Best regards,
>> --
>> Neil Armstrong <neil.armstrong@linaro.org>
>>
>>
> 
> Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
> 
> --
> Best Regards,
> Wangao
> 

Neil can you rebase this - I can pick it up once you are happy.

https://gitlab.freedesktop.org/linux-media/users/bodonoghue/-/tree/next-smoketest?ref_type=heads

---
bod

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats
  2026-06-01 15:03   ` Bryan O'Donoghue
@ 2026-06-01 18:59     ` Neil Armstrong
  0 siblings, 0 replies; 23+ messages in thread
From: Neil Armstrong @ 2026-06-01 18:59 UTC (permalink / raw)
  To: Bryan O'Donoghue, Wangao Wang, Vikash Garodia,
	Dikshita Agarwal, Abhinav Kumar, Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Dmitry Baryshkov,
	Bryan O'Donoghue

On 6/1/26 17:03, Bryan O'Donoghue wrote:
> On 01/06/2026 10:01, Wangao Wang wrote:
>>
>>
>> On 2026/5/21 17:24, Neil Armstrong wrote:
>>> This adds the plumbing to support decoding HEVC, VP9 and AV1
>>> streams into 10bit pixel formats, linear and compressed.
>>>
>>> This has only been tested on SM8550 & SM8650 with HEVC, and was
>>> inspired by Venus, DRM MSM and the downstream vidc driver for the
>>> buffer calculations and HFI messages.
>>>
>>> Gstreamer support for QC08 and QC10 need the MR at [1] to be applied,
>>> but NV12 and P010 works out of the box with mainline Gstreamer.
>>>
>>> Fluster HEVC results on SM8650 using Gstreamer:
>>>
>>> ./fluster.py run -ts JCT-VC-HEVC_V1 -d GStreamer-H.265-V4L2-Gst1.0 - 141/147
>>> The failing test case:
>>> - Pixel Format mismatch
>>>    - TSUNEQBD_A_MAIN10_Technicolor_2 - Gstreamer waits NV12 but decoder returns P010
>>> - Unsupported resolution
>>>    - PICSIZE_A_Bossen_1 - resolution is higher than max supported
>>>    - PICSIZE_B_Bossen_1 - resolution is higher than max supported
>>>    - WPP_D_ericsson_MAIN_2 - resolution is lower than min supported
>>>    - WPP_D_ericsson_MAIN10_2 - resolution is lower than min supported
>>> - CRC mismatch
>>>    - RAP_A_docomo_6
>>>
>>> v4l2-compliance results on SM8550 & SM8650:
>>>
>>> $ v4l2-compliance -d /dev/video1 -s
>>> v4l2-compliance 1.33.0-5456, 64 bits, 64-bit time_t
>>> v4l2-compliance SHA: 8aa593bda182 2026-04-11 10:54:25
>>>
>>> Compliance test for iris_driver device /dev/video1:
>>>
>>> Driver Info:
>>>     Driver name      : iris_driver
>>>     Card type        : Iris Encoder
>>>     Bus info         : platform:aa00000.video-codec
>>>     Driver version   : 7.0.0
>>>     Capabilities     : 0x84204000
>>>         Video Memory-to-Memory Multiplanar
>>>         Streaming
>>>         Extended Pix Format
>>>         Device Capabilities
>>>     Device Caps      : 0x04204000
>>>         Video Memory-to-Memory Multiplanar
>>>         Streaming
>>>         Extended Pix Format
>>>     Detected Stateful Encoder
>>>
>>> Required ioctls:
>>>     test VIDIOC_QUERYCAP: OK
>>>     test invalid ioctls: OK
>>>
>>> Allow for multiple opens:
>>>     test second /dev/video1 open: OK
>>>     test VIDIOC_QUERYCAP: OK
>>>     test VIDIOC_G/S_PRIORITY: OK
>>>     test for unlimited opens: OK
>>>
>>> Debug ioctls:
>>>     test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>>>     test VIDIOC_LOG_STATUS: OK (Not Supported)
>>>
>>> Input ioctls:
>>>     test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>>>     test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>     test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>>>     test VIDIOC_ENUMAUDIO: OK (Not Supported)
>>>     test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>>>     test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>>     Inputs: 0 Audio Inputs: 0 Tuners: 0
>>>
>>> Output ioctls:
>>>     test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>>>     test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>     test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>>>     test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>>>     test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>>>     Outputs: 0 Audio Outputs: 0 Modulators: 0
>>>
>>> Input/Output configuration ioctls:
>>>     test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>>>     test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>>>     test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>>>     test VIDIOC_G/S_EDID: OK (Not Supported)
>>>
>>> Control ioctls:
>>>     test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>>>     test VIDIOC_QUERYCTRL: OK
>>>     test VIDIOC_G/S_CTRL: OK
>>>     test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>>>     test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
>>>     test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>>     Standard Controls: 43 Private Controls: 0
>>>
>>> Format ioctls:
>>>     test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>>>     test VIDIOC_G/S_PARM: OK
>>>     test VIDIOC_G_FBUF: OK (Not Supported)
>>>     test VIDIOC_G_FMT: OK
>>>     test VIDIOC_TRY_FMT: OK
>>>     test VIDIOC_S_FMT: OK
>>>     test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>>     test Cropping: OK
>>>     test Composing: OK (Not Supported)
>>>     test Scaling: OK (Not Supported)
>>>
>>> Codec ioctls:
>>>     test VIDIOC_(TRY_)ENCODER_CMD: OK
>>>     test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>>     test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
>>>
>>> Buffer ioctls:
>>>     test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>>     test CREATE_BUFS maximum buffers: OK
>>>     test VIDIOC_REMOVE_BUFS: OK
>>>     test VIDIOC_EXPBUF: OK
>>>     test Requests: OK (Not Supported)
>>>     test blocking wait: OK
>>>
>>> Test input 0:
>>>
>>> Streaming ioctls:
>>>     test read/write: OK (Not Supported)
>>>     Video Capture Multiplanar: Captured 61 buffers
>>>     test MMAP (select, REQBUFS): OK
>>>     Video Capture Multiplanar: Captured 61 buffers
>>>     test MMAP (epoll, REQBUFS): OK
>>>     Video Capture Multiplanar: Captured 61 buffers
>>>     test MMAP (select, CREATE_BUFS): OK
>>>     Video Capture Multiplanar: Captured 61 buffers
>>>     test MMAP (epoll, CREATE_BUFS): OK
>>>     test USERPTR (select): OK (Not Supported)
>>>     test DMABUF: Cannot test, specify --expbuf-device
>>>
>>> Total for iris_driver device /dev/video1: 54, Succeeded: 54, Failed: 0, Warnings: 0
>>>
>>> $ v4l2-compliance -d /dev/video0 -s5 --stream-from=test_video_10s.h264
>>> v4l2-compliance 1.33.0-5456, 64 bits, 64-bit time_t
>>> v4l2-compliance SHA: 8aa593bda182 2026-04-11 10:54:25
>>>
>>> Compliance test for iris_driver device /dev/video0:
>>>
>>> Driver Info:
>>>     Driver name      : iris_driver
>>>     Card type        : Iris Decoder
>>>     Bus info         : platform:aa00000.video-codec
>>>     Driver version   : 7.0.0
>>>     Capabilities     : 0x84204000
>>>         Video Memory-to-Memory Multiplanar
>>>         Streaming
>>>         Extended Pix Format
>>>         Device Capabilities
>>>     Device Caps      : 0x04204000
>>>         Video Memory-to-Memory Multiplanar
>>>         Streaming
>>>         Extended Pix Format
>>>     Detected Stateful Decoder
>>>
>>> Required ioctls:
>>>     test VIDIOC_QUERYCAP: OK
>>>     test invalid ioctls: OK
>>>
>>> Allow for multiple opens:
>>>     test second /dev/video0 open: OK
>>>     test VIDIOC_QUERYCAP: OK
>>>     test VIDIOC_G/S_PRIORITY: OK
>>>     test for unlimited opens: OK
>>>
>>> Debug ioctls:
>>>     test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
>>>     test VIDIOC_LOG_STATUS: OK (Not Supported)
>>>
>>> Input ioctls:
>>>     test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
>>>     test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>     test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
>>>     test VIDIOC_ENUMAUDIO: OK (Not Supported)
>>>     test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
>>>     test VIDIOC_G/S_AUDIO: OK (Not Supported)
>>>     Inputs: 0 Audio Inputs: 0 Tuners: 0
>>>
>>> Output ioctls:
>>>     test VIDIOC_G/S_MODULATOR: OK (Not Supported)
>>>     test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
>>>     test VIDIOC_ENUMAUDOUT: OK (Not Supported)
>>>     test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
>>>     test VIDIOC_G/S_AUDOUT: OK (Not Supported)
>>>     Outputs: 0 Audio Outputs: 0 Modulators: 0
>>>
>>> Input/Output configuration ioctls:
>>>     test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
>>>     test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
>>>     test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
>>>     test VIDIOC_G/S_EDID: OK (Not Supported)
>>>
>>> Control ioctls:
>>>     test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
>>>     test VIDIOC_QUERYCTRL: OK
>>>     test VIDIOC_G/S_CTRL: OK
>>>     test VIDIOC_G/S/TRY_EXT_CTRLS: OK
>>>     test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
>>>     test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
>>>     Standard Controls: 12 Private Controls: 0
>>>
>>> Format ioctls:
>>>     test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
>>>     test VIDIOC_G/S_PARM: OK (Not Supported)
>>>     test VIDIOC_G_FBUF: OK (Not Supported)
>>>     test VIDIOC_G_FMT: OK
>>>     test VIDIOC_TRY_FMT: OK
>>>     test VIDIOC_S_FMT: OK
>>>     test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
>>>     test Cropping: OK
>>>     test Composing: OK
>>>     test Scaling: OK (Not Supported)
>>>
>>> Codec ioctls:
>>>     test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
>>>     test VIDIOC_G_ENC_INDEX: OK (Not Supported)
>>>     test VIDIOC_(TRY_)DECODER_CMD: OK
>>>
>>> Buffer ioctls:
>>>     test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
>>>     test CREATE_BUFS maximum buffers: OK
>>>     test VIDIOC_REMOVE_BUFS: OK
>>>     test VIDIOC_EXPBUF: OK
>>>     test Requests: OK (Not Supported)
>>>     test blocking wait: OK
>>>
>>> Test input 0:
>>>
>>> Streaming ioctls:
>>>     test read/write: OK (Not Supported)
>>> the input file is smaller than 7077888 bytes
>>>     Video Capture Multiplanar: Captured 601 buffers
>>>     test MMAP (select, REQBUFS): OK
>>> the input file is smaller than 7077888 bytes
>>>     Video Capture Multiplanar: Captured 601 buffers
>>>     test MMAP (epoll, REQBUFS): OK
>>> the input file is smaller than 7077888 bytes
>>>     Video Capture Multiplanar: Captured 601 buffers
>>>     test MMAP (select, CREATE_BUFS): OK
>>> the input file is smaller than 7077888 bytes
>>>     Video Capture Multiplanar: Captured 601 buffers
>>>     test MMAP (epoll, CREATE_BUFS): OK
>>>     test USERPTR (select): OK (Not Supported)
>>>     test DMABUF: Cannot test, specify --expbuf-device
>>>
>>> Total for iris_driver device /dev/video0: 54, Succeeded: 54, Failed: 0, Warnings: 0
>>>
>>> [1] https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8195
>>>
>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>> ---
>>> Changes in v4:
>>> - Picked review tags
>>> - Use u32 instead of __u32
>>> - Explicit DPB
>>> - Drop NULL and use >>1 in q10c buffer calc
>>> - Drop selicolon after switch statementr
>>> - Correctly align HFI_PROP_UBWC_STRIDE_SCANLINE entry
>>> - Rebase on media next tree after the file split
>>> - Link to v3: https://patch.msgid.link/20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org
>>>
>>> Changes in v3:
>>> - Added review tag on patch 1
>>> - Limited stride command to AV1 decoding only
>>> - Link to v2: https://patch.msgid.link/20260417-topic-sm8x50-iris-10bit-decoding-v2-0-c987b65a31d5@linaro.org
>>>
>>> Changes in v2:
>>> - Fixed bug breaking 8bit decoding
>>> - Dropped filtering on G_FMT while waiting for soure change
>>> - Dropped format filtering on ENUMFMT
>>> - Switched ALIGN(x, 192) to roundup(x, 192) because ALIGN works only with Power Of Two numbers
>>> - Cleaned and refactors the width/height/stride calculations
>>> - Cleaned and redesigned the buffer calculations functions with proper comments and var names
>>> - Passed fluster and v4l2-compliance to check for non regression
>>> - Tested on SM8550
>>> - Added missing V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10 with made gstreamer fail decoding
>>> - Link to v1: https://patch.msgid.link/20260408-topic-sm8x50-iris-10bit-decoding-v1-0-428c1ec2e3f3@linaro.org
>>>
>>> ---
>>> Neil Armstrong (6):
>>>         media: qcom: iris: add helpers for 8bit and 10bit formats
>>>         media: qcom: iris: add QC10C & P010 buffer size calculations
>>>         media: qcom: iris: gen2: add support for 10bit decoding
>>>         media: qcom: iris: vdec: update size and stride calculations for 10bit formats
>>>         media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats
>>>         media: qcom: iris: vdec: allow GEN2 decoding into 10bit format
>>>
>>>    drivers/media/platform/qcom/iris/iris_buffer.c     | 195 ++++++++++++++++++++-
>>>    drivers/media/platform/qcom/iris/iris_hfi_gen2.c   |   8 +-
>>>    .../platform/qcom/iris/iris_hfi_gen2_command.c     |  75 +++++++-
>>>    .../platform/qcom/iris/iris_hfi_gen2_defines.h     |   1 +
>>>    .../platform/qcom/iris/iris_hfi_gen2_response.c    |  37 +++-
>>>    drivers/media/platform/qcom/iris/iris_instance.h   |   2 +
>>>    .../platform/qcom/iris/iris_platform_common.h      |   1 +
>>>    drivers/media/platform/qcom/iris/iris_utils.c      |  16 +-
>>>    drivers/media/platform/qcom/iris/iris_utils.h      |   2 +
>>>    drivers/media/platform/qcom/iris/iris_vdec.c       |  42 ++++-
>>>    10 files changed, 364 insertions(+), 15 deletions(-)
>>> ---
>>> base-commit: 86693e86019a7466be961fd4f45d407cc0b0ba0a
>>> change-id: 20260408-topic-sm8x50-iris-10bit-decoding-074c3ac7975c
>>>
>>> Best regards,
>>> -- 
>>> Neil Armstrong <neil.armstrong@linaro.org>
>>>
>>>
>>
>> Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
>>
>> -- 
>> Best Regards,
>> Wangao
>>
> 
> Neil can you rebase this - I can pick it up once you are happy.
> 
> https://gitlab.freedesktop.org/linux-media/users/bodonoghue/-/tree/next-smoketest?ref_type=heads

Ok will rebase asap

Thanks,
Neil

> 
> ---
> bod


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2026-06-01 18:59 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21  9:24 [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
2026-05-21  9:24 ` [PATCH v4 1/6] media: qcom: iris: add helpers for 8bit and " Neil Armstrong
2026-05-21  9:24 ` [PATCH v4 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations Neil Armstrong
2026-05-25 23:32   ` bod
2026-05-21  9:24 ` [PATCH v4 3/6] media: qcom: iris: gen2: add support for 10bit decoding Neil Armstrong
2026-05-21  9:24 ` [PATCH v4 4/6] media: qcom: iris: vdec: update size and stride calculations for 10bit formats Neil Armstrong
2026-05-21  9:24 ` [PATCH v4 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and " Neil Armstrong
2026-05-21  9:24 ` [PATCH v4 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format Neil Armstrong
2026-05-26  7:53 ` [PATCH v4 0/6] media: qcom: iris: add support for decoding 10bit formats Vikash Garodia
2026-05-26 12:39   ` Neil Armstrong
2026-05-26 12:45     ` Vikash Garodia
2026-05-27  4:15       ` Wangao Wang
2026-05-28 13:26         ` Neil Armstrong
2026-05-28 23:55           ` Bryan O'Donoghue
2026-05-29  8:21           ` Wangao Wang
2026-05-29  9:55             ` Neil Armstrong
2026-05-29 10:33               ` Wangao Wang
2026-05-29 13:25                 ` Neil Armstrong
2026-06-01  5:52                   ` Wangao Wang
2026-06-01  8:41                     ` Vikash Garodia
2026-06-01  9:01 ` Wangao Wang
2026-06-01 15:03   ` Bryan O'Donoghue
2026-06-01 18:59     ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox