All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sachin Kumar Garg <sachin.garg@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@kernel.org>,
	Vedang Nagar <quic_vnagar@quicinc.com>,
	Stefan Schmidt <stefan.schmidt@linaro.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	20260709-iris-ar50lt-v7-0-76af9dd4d1f6@oss.qualcomm.com,
	Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>,
	Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Subject: [PATCH v8 2/3] media: iris: force stage 1 work mode for CBR RC on encoder
Date: Tue, 28 Jul 2026 11:32:45 +0530	[thread overview]
Message-ID: <20260728-iris_multi_slice-v8-2-eb18f96f0ed8@oss.qualcomm.com> (raw)
In-Reply-To: <20260728-iris_multi_slice-v8-0-eb18f96f0ed8@oss.qualcomm.com>

iris_set_stage() currently always picks STAGE_2 for encoder sessions.
CBR rate control requires stage 1 operation, so force STAGE_1 when
BITRATE_MODE is set to CBR.

The BITRATE_MODE fw_cap value is used instead of inst->hfi_rc_type
since STAGE precedes BITRATE_MODE in enum platform_inst_fw_cap_type,
so iris_set_properties() would still see the previous hfi_rc_type
when iris_set_stage() runs during initial config

Reviewed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Signed-off-by: Sachin Kumar Garg <sachin.garg@oss.qualcomm.com>
---
 drivers/media/platform/qcom/iris/iris_ctrls.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.c b/drivers/media/platform/qcom/iris/iris_ctrls.c
index 80cb43b8bcf4..74a299f72024 100644
--- a/drivers/media/platform/qcom/iris/iris_ctrls.c
+++ b/drivers/media/platform/qcom/iris/iris_ctrls.c
@@ -519,6 +519,9 @@ int iris_set_stage(struct iris_inst *inst, enum platform_inst_fw_cap_type cap_id
 	if (inst->domain == DECODER) {
 		if (iris_res_is_less_than(width, height, 1280, 720))
 			work_mode = STAGE_1;
+	} else if (inst->domain == ENCODER) {
+		if (inst->fw_caps[BITRATE_MODE].value == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR)
+			work_mode = STAGE_1;
 	}
 
 	inst->fw_caps[cap_id].value = work_mode;

-- 
2.34.1


  parent reply	other threads:[~2026-07-28  6:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25 18:08 [PATCH v7 0/3] media: qcom: iris: add multi slice support Sachin Kumar Garg
2026-07-25 18:08 ` [PATCH v7 1/3] media: iris: cache work mode after computing it in iris_set_stage Sachin Kumar Garg
2026-07-25 18:08 ` [PATCH v7 2/3] media: iris: force stage 1 work mode for CBR RC on encoder Sachin Kumar Garg
2026-07-25 18:08 ` [PATCH v7 3/3] media: iris: add support for multi_slice in iris encoder Sachin Kumar Garg
2026-07-28  4:13   ` Vikash Garodia
2026-07-28  6:02 ` [PATCH v8 0/3] media: qcom: iris: add multi slice support Sachin Kumar Garg
2026-07-28  6:02   ` [PATCH v8 1/3] media: iris: cache work mode after computing it in iris_set_stage Sachin Kumar Garg
2026-07-28  6:02   ` Sachin Kumar Garg [this message]
2026-07-28  6:02   ` [PATCH v8 3/3] media: iris: add support for multi_slice in iris encoder Sachin Kumar Garg
2026-08-01  6:44   ` [PATCH v9 0/3] media: qcom: iris: add multi slice support Sachin Kumar Garg
2026-08-01  6:44     ` [PATCH v9 1/3] media: iris: cache work mode after computing it in iris_set_stage Sachin Kumar Garg
2026-08-01  6:44     ` [PATCH v9 2/3] media: iris: force stage 1 work mode for CBR RC on encoder Sachin Kumar Garg
2026-08-01  6:44     ` [PATCH v9 3/3] media: iris: add support for multi_slice in iris encoder Sachin Kumar Garg

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=20260728-iris_multi_slice-v8-2-eb18f96f0ed8@oss.qualcomm.com \
    --to=sachin.garg@oss.qualcomm.com \
    --cc=20260709-iris-ar50lt-v7-0-76af9dd4d1f6@oss.qualcomm.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=bod@kernel.org \
    --cc=busanna.reddy@oss.qualcomm.com \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=hverkuil@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=quic_vnagar@quicinc.com \
    --cc=stefan.schmidt@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.