mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Bryan O'Donoghue <bod@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil+cisco@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 07/13] media: iris: support read-only controls
Date: Fri, 04 Dec 2026 20:24:48 +0200	[thread overview]
Message-ID: <20261204-iris-vp8-v2-7-462f9b48d246@oss.qualcomm.com> (raw)
In-Reply-To: <20261204-iris-vp8-v2-0-462f9b48d246@oss.qualcomm.com>

Some decoder controls describe the bitstream rather than configure the
decoder, for example the profile and level of the stream being decoded.
Userspace cannot meaningfully set them, and the driver needs to update
them from the parameters reported by the firmware.

Add a CAP_FLAG_READ_ONLY capability flag that marks the V4L2 control
read-only. The V4L2 core already rejects writes from userspace to such
controls, so the only updates reaching the s_ctrl handler come from the
driver itself: store the value without the streaming-state checks that
apply to client-set controls, and without marking it as set by the client.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 drivers/media/platform/qcom/iris/iris_ctrls.c           | 8 ++++++++
 drivers/media/platform/qcom/iris/iris_platform_common.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.c b/drivers/media/platform/qcom/iris/iris_ctrls.c
index 4f2633bbb49f..f1903e028ea8 100644
--- a/drivers/media/platform/qcom/iris/iris_ctrls.c
+++ b/drivers/media/platform/qcom/iris/iris_ctrls.c
@@ -331,6 +331,11 @@ static int iris_op_s_ctrl(struct v4l2_ctrl *ctrl)
 	if (!iris_valid_cap_id(cap_id))
 		return -EINVAL;
 
+	if (ctrl->flags & V4L2_CTRL_FLAG_READ_ONLY) {
+		inst->fw_caps[cap_id].value = ctrl->val;
+		return 0;
+	}
+
 	q = v4l2_m2m_get_src_vq(inst->m2m_ctx);
 	if (vb2_is_streaming(q) &&
 	    (!(inst->fw_caps[cap_id].flags & CAP_FLAG_DYNAMIC_ALLOWED)))
@@ -406,6 +411,9 @@ int iris_ctrls_init(struct iris_inst *inst)
 			goto error;
 		}
 
+		if (cap[idx].flags & CAP_FLAG_READ_ONLY)
+			ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
+
 		ctrl_idx++;
 	}
 
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 30cfa3d793b2..47bca539d50d 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -223,6 +223,7 @@ enum platform_inst_fw_cap_flags {
 	CAP_FLAG_CLIENT_SET		= BIT(4),
 	CAP_FLAG_BITMASK		= BIT(5),
 	CAP_FLAG_VOLATILE		= BIT(6),
+	CAP_FLAG_READ_ONLY		= BIT(7),
 };
 
 struct platform_inst_fw_cap {

-- 
2.47.3


  parent reply	other threads:[~2026-12-04 18:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 18:24 [PATCH v2 00/13] media: iris: enable VP8, MPEG1/MPEG2 and interlaced MPEG2 support Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 01/13] media: iris: apply the capture buffer minimum in queue_setup Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 02/13] media: iris: translate Gen1 profile/level to HFI enumerants Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 03/13] media: iris: default the Gen1 encoder level to a usable value Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 04/13] media: iris: size QC08C buffers to fit field-coded pictures Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 05/13] media: iris: split Gen2 firmware data for vpu2-generation SoCs Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 06/13] media: iris: move the decode format list into the firmware data Dmitry Baryshkov
2026-12-04 18:24 ` Dmitry Baryshkov [this message]
2026-12-04 18:24 ` [PATCH v2 08/13] media: iris: add VP8 decode support on Gen1 firmware Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 09/13] media: iris: add MPEG1 and MPEG2 " Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 10/13] media: iris: support interlaced MPEG2 content Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 11/13] media: iris: move the encode format list into the firmware data Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 12/13] media: iris: accept gen1 encoder output at a non-zero offset Dmitry Baryshkov
2026-12-04 18:24 ` [PATCH v2 13/13] media: iris: add VP8 encode support on Gen1 firmware Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261204-iris-vp8-v2-7-462f9b48d246@oss.qualcomm.com \
    --to=dmitry.baryshkov@oss.qualcomm.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=bod@kernel.org \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=hverkuil+cisco@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=vikash.garodia@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®