linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dikshita Agarwal <dikshita@codeaurora.org>
To: linux-media@vger.kernel.org, stanimir.varbanov@linaro.org
Cc: linux-kernel@vger.kernel.org, vgarodia@codeaurora.org,
	Dikshita Agarwal <dikshita@codeaurora.org>
Subject: [PATCH 5/7] venus: vdec: set work route to fw
Date: Wed, 19 May 2021 15:06:46 +0530	[thread overview]
Message-ID: <1621417008-6117-6-git-send-email-dikshita@codeaurora.org> (raw)
In-Reply-To: <1621417008-6117-1-git-send-email-dikshita@codeaurora.org>

Set work route to FW based on num of vpp pipes.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
 drivers/media/platform/qcom/venus/hfi_cmds.c   |  7 +++++++
 drivers/media/platform/qcom/venus/hfi_helper.h |  5 +++++
 drivers/media/platform/qcom/venus/vdec.c       | 21 +++++++++++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c
index 11a8347..837fb80 100644
--- a/drivers/media/platform/qcom/venus/hfi_cmds.c
+++ b/drivers/media/platform/qcom/venus/hfi_cmds.c
@@ -1290,6 +1290,13 @@ pkt_session_set_property_6xx(struct hfi_session_set_property_pkt *pkt,
 		pkt->shdr.hdr.size += sizeof(u32) + sizeof(*color);
 		break;
 	}
+	case HFI_PROPERTY_PARAM_WORK_ROUTE: {
+		struct hfi_video_work_route *in = pdata, *wr = prop_data;
+
+		wr->video_work_route = in->video_work_route;
+		pkt->shdr.hdr.size += sizeof(u32) + sizeof(*wr);
+		break;
+	}
 	default:
 		return pkt_session_set_property_4xx(pkt, cookie, ptype, pdata);
 	}
diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h
index 63cd347..185c302 100644
--- a/drivers/media/platform/qcom/venus/hfi_helper.h
+++ b/drivers/media/platform/qcom/venus/hfi_helper.h
@@ -451,6 +451,7 @@
 #define HFI_PROPERTY_PARAM_MVC_BUFFER_LAYOUT			0x100f
 #define HFI_PROPERTY_PARAM_MAX_SESSIONS_SUPPORTED		0x1010
 #define HFI_PROPERTY_PARAM_WORK_MODE				0x1015
+#define HFI_PROPERTY_PARAM_WORK_ROUTE				0x1017
 
 /*
  * HFI_PROPERTY_CONFIG_COMMON_START
@@ -864,6 +865,10 @@ struct hfi_video_work_mode {
 	u32 video_work_mode;
 };
 
+struct hfi_video_work_route {
+	u32 video_work_route;
+};
+
 struct hfi_h264_vui_timing_info {
 	u32 enable;
 	u32 fixed_framerate;
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index ddb7cd3..a674281 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -653,6 +653,21 @@ static int vdec_set_properties(struct venus_inst *inst)
 	return 0;
 }
 
+static int vdec_set_work_route(struct venus_inst *inst)
+{
+	struct hfi_video_work_route wr;
+	u32 ptype;
+	int ret;
+
+	wr.video_work_route = inst->core->res->num_vpp_pipes;
+
+	ptype = HFI_PROPERTY_PARAM_WORK_ROUTE;
+	ret = hfi_session_set_property(inst, ptype, &wr);
+	if (ret)
+		return ret;
+	return 0;
+}
+
 #define is_ubwc_fmt(fmt) (!!((fmt) & HFI_COLOR_FORMAT_UBWC_BASE))
 
 static int vdec_output_conf(struct venus_inst *inst)
@@ -1039,6 +1054,12 @@ static int vdec_start_output(struct venus_inst *inst)
 	if (ret)
 		return ret;
 
+	if (IS_V6(inst->core)) {
+		ret = vdec_set_work_route(inst);
+		if (ret)
+			return ret;
+	}
+
 	ret = vdec_output_conf(inst);
 	if (ret)
 		return ret;
-- 
2.7.4


  parent reply	other threads:[~2021-05-19  9:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19  9:36 [PATCH 0/7] media: venus: Enable venus support on sc7280 Dikshita Agarwal
2021-05-19  9:36 ` [PATCH 1/7] venus: firmware: enable no tz fw loading for sc7280 Dikshita Agarwal
2021-05-31  9:01   ` Stanimir Varbanov
2021-05-19  9:36 ` [PATCH 2/7] media: venus: core: Add sc7280 DT compatible and resource data Dikshita Agarwal
2021-05-31 11:18   ` Stanimir Varbanov
2021-05-19  9:36 ` [PATCH 3/7] media: venus: Add num_vpp_pipes to resource structure Dikshita Agarwal
2021-05-31 11:19   ` Stanimir Varbanov
2021-05-19  9:36 ` [PATCH 4/7] media: venus: hfi: Skip AON register programming for V6 1pipe Dikshita Agarwal
2021-05-31 11:19   ` Stanimir Varbanov
2021-05-19  9:36 ` Dikshita Agarwal [this message]
2021-05-31 10:32   ` [PATCH 5/7] venus: vdec: set work route to fw Stanimir Varbanov
2021-05-19  9:36 ` [PATCH 6/7] media: venus: helpers: update NUM_MBS macro calculation Dikshita Agarwal
2021-05-31 11:21   ` Stanimir Varbanov
2021-05-19  9:36 ` [PATCH 7/7] media: venus: Set buffer to FW based on FW min count requirement Dikshita Agarwal
2021-05-31 11:28   ` Stanimir Varbanov

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=1621417008-6117-6-git-send-email-dikshita@codeaurora.org \
    --to=dikshita@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=stanimir.varbanov@linaro.org \
    --cc=vgarodia@codeaurora.org \
    /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;
as well as URLs for NNTP newsgroup(s).