mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] media: qcom: iris: venc: fix encoder crop handling
@ 2026-11-12 16:15 Loic Poulain
  2026-11-12 16:15 ` [PATCH 1/2] media: qcom: iris: venc: keep the crop rectangle in visible resolution space Loic Poulain
  2026-11-12 16:15 ` [PATCH 2/2] media: qcom: iris: venc: reject encoder crop rectangles larger than the source Loic Poulain
  0 siblings, 2 replies; 3+ messages in thread
From: Loic Poulain @ 2026-11-12 16:15 UTC (permalink / raw)
  To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
	Bryan O'Donoghue, Mauro Carvalho Chehab, Wangao Wang,
	Hans Verkuil
  Cc: Bryan O'Donoghue, linux-media, linux-arm-msm, linux-kernel,
	Loic Poulain

The encoder keeps the source resolution in two places. inst->fmt_src holds
the padded buffer geometry reported to userspace, with width aligned to 128
and height to 32. enc_raw_width and enc_raw_height hold the visible
resolution sent to the firmware.

inst->crop belongs to the second space, because iris_hfi_gen2_set_crop_offsets()
computes the offsets as enc_raw_* minus crop. Both patches fix a place where
the padded size was used instead.

Patch 1 seeds inst->crop and fmt_dst from the visible size. Before, a plain
1280x720 session ended up with crop.height 736 and a bottom offset of
0xfffffff0. fmt_dst now also carries the codec alignment on every path, so
the CAPTURE queue keeps reporting the coded size.

Patch 2 bounds the S_SELECTION rectangle by the visible size, so userspace
can no longer select a crop larger than the frame it submits and silently
get an empty bitstream.

Tested on QCS8300 with v4l2-ctl and ffmpeg.

Signed-off-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
---
Loic Poulain (2):
      media: qcom: iris: venc: keep the crop rectangle in visible resolution space
      media: qcom: iris: venc: reject encoder crop rectangles larger than the source

 drivers/media/platform/qcom/iris/iris_venc.c | 24 ++++++++++++++----------
 drivers/media/platform/qcom/iris/iris_vidc.c |  4 ++--
 2 files changed, 16 insertions(+), 12 deletions(-)
---
base-commit: e726cf08ee6ba7e8b852c77760f12c59f90f1338
change-id: 20261112-iris-fixes-f6130f20caf9

Best regards,
-- 
Loic Poulain <loic.poulain@oss.qualcomm.com>


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

end of thread, other threads:[~2026-11-12 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 16:15 [PATCH 0/2] media: qcom: iris: venc: fix encoder crop handling Loic Poulain
2026-11-12 16:15 ` [PATCH 1/2] media: qcom: iris: venc: keep the crop rectangle in visible resolution space Loic Poulain
2026-11-12 16:15 ` [PATCH 2/2] media: qcom: iris: venc: reject encoder crop rectangles larger than the source Loic Poulain

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

all inboxes | Powered by JetHome®