linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] media: venus: Enable venus support on sc7280
@ 2021-05-19  9:36 Dikshita Agarwal
  2021-05-19  9:36 ` [PATCH 1/7] venus: firmware: enable no tz fw loading for sc7280 Dikshita Agarwal
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Dikshita Agarwal @ 2021-05-19  9:36 UTC (permalink / raw)
  To: linux-media, stanimir.varbanov; +Cc: linux-kernel, vgarodia, Dikshita Agarwal

This series enables support for 6xx venus encode/decode on sc7280.

The driver changes are dependent on [1]yaml and [2]dts patches.

[1] https://patchwork.kernel.org/project/linux-arm-msm/list/?series=484019
[2] https://patchwork.kernel.org/project/linux-arm-msm/list/?series=484727

Dikshita Agarwal (7):
  venus: firmware: enable no tz fw loading for sc7280
  media: venus: core: Add sc7280 DT compatible and resource data
  media: venus: Add num_vpp_pipes to resource structure
  media: venus: hfi: Skip AON register programming for V6 1pipe
  venus: vdec: set work route to fw
  media: venus: helpers: update NUM_MBS macro calculation
  media: venus: Set buffer to FW based on FW min count requirement.

 drivers/media/platform/qcom/venus/core.c           | 54 ++++++++++++++++++++++
 drivers/media/platform/qcom/venus/core.h           |  2 +
 drivers/media/platform/qcom/venus/firmware.c       | 42 ++++++++++++++---
 drivers/media/platform/qcom/venus/helpers.c        | 41 ++++++++++------
 drivers/media/platform/qcom/venus/hfi.h            |  1 +
 drivers/media/platform/qcom/venus/hfi_cmds.c       |  7 +++
 drivers/media/platform/qcom/venus/hfi_helper.h     | 14 ++++++
 drivers/media/platform/qcom/venus/hfi_msgs.c       |  7 +++
 .../media/platform/qcom/venus/hfi_plat_bufs_v6.c   |  3 +-
 drivers/media/platform/qcom/venus/hfi_platform.c   | 13 ------
 drivers/media/platform/qcom/venus/hfi_platform.h   |  2 -
 .../media/platform/qcom/venus/hfi_platform_v6.c    |  6 ---
 drivers/media/platform/qcom/venus/hfi_venus.c      |  4 ++
 drivers/media/platform/qcom/venus/hfi_venus_io.h   |  2 +
 drivers/media/platform/qcom/venus/vdec.c           | 43 +++++++++++++----
 15 files changed, 188 insertions(+), 53 deletions(-)

-- 
2.7.4


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

* [PATCH 1/7] venus: firmware: enable no tz fw loading for sc7280
  2021-05-19  9:36 [PATCH 0/7] media: venus: Enable venus support on sc7280 Dikshita Agarwal
@ 2021-05-19  9:36 ` 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
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Dikshita Agarwal @ 2021-05-19  9:36 UTC (permalink / raw)
  To: linux-media, stanimir.varbanov; +Cc: linux-kernel, vgarodia, Dikshita Agarwal

- Enable no tz FW loading.
- add routine to reset XTSS.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
 drivers/media/platform/qcom/venus/firmware.c     | 42 ++++++++++++++++++++----
 drivers/media/platform/qcom/venus/hfi_venus_io.h |  2 ++
 2 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
index 227bd3b..e05e01a 100644
--- a/drivers/media/platform/qcom/venus/firmware.c
+++ b/drivers/media/platform/qcom/venus/firmware.c
@@ -42,6 +42,22 @@ static void venus_reset_cpu(struct venus_core *core)
 	writel(0, wrapper_base + WRAPPER_A9SS_SW_RESET);
 }
 
+static void venus_reset_cpu_V6(struct venus_core *core)
+{
+	u32 fw_size = core->fw.mapped_mem_size;
+	void __iomem *wrapper_tz_base = core->wrapper_tz_base;
+
+	writel(0, wrapper_tz_base + WRAPPER_FW_START_ADDR);
+	writel(fw_size, wrapper_tz_base + WRAPPER_FW_END_ADDR);
+	writel(0, wrapper_tz_base + WRAPPER_CPA_START_ADDR);
+	writel(fw_size, wrapper_tz_base + WRAPPER_CPA_END_ADDR);
+	writel(fw_size, wrapper_tz_base + WRAPPER_NONPIX_START_ADDR);
+	writel(fw_size, wrapper_tz_base + WRAPPER_NONPIX_END_ADDR);
+
+	/* Bring XTSS out of reset */
+	writel(0, wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
+}
+
 int venus_set_hw_state(struct venus_core *core, bool resume)
 {
 	int ret;
@@ -54,10 +70,15 @@ int venus_set_hw_state(struct venus_core *core, bool resume)
 	}
 
 	if (resume) {
-		venus_reset_cpu(core);
+		if (IS_V6(core))
+			venus_reset_cpu_V6(core);
+		else
+			venus_reset_cpu(core);
 	} else {
 		if (!IS_V6(core))
 			writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET);
+		else
+			writel(1, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
 	}
 
 	return 0;
@@ -149,7 +170,10 @@ static int venus_boot_no_tz(struct venus_core *core, phys_addr_t mem_phys,
 		return ret;
 	}
 
-	venus_reset_cpu(core);
+	if (IS_V6(core))
+		venus_reset_cpu_V6(core);
+	else
+		venus_reset_cpu(core);
 
 	return 0;
 }
@@ -162,12 +186,18 @@ static int venus_shutdown_no_tz(struct venus_core *core)
 	u32 reg;
 	struct device *dev = core->fw.dev;
 	void __iomem *wrapper_base = core->wrapper_base;
+	void __iomem *wrapper_tz_base = core->wrapper_tz_base;
 
+	if (IS_V6(core)) {
+		reg = readl_relaxed(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
+		reg |= WRAPPER_XTSS_SW_RESET_BIT;
+		writel_relaxed(reg, wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
+	} else {
 	/* Assert the reset to ARM9 */
-	reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET);
-	reg |= WRAPPER_A9SS_SW_RESET_BIT;
-	writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET);
-
+		reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET);
+		reg |= WRAPPER_A9SS_SW_RESET_BIT;
+		writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET);
+	}
 	/* Make sure reset is asserted before the mapping is removed */
 	mb();
 
diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h
index 300c6e47..9735a24 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus_io.h
+++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h
@@ -149,6 +149,8 @@
 /* Wrapper TZ 6xx */
 #define WRAPPER_TZ_BASE_V6			0x000c0000
 #define WRAPPER_TZ_CPU_STATUS_V6		0x10
+#define WRAPPER_TZ_XTSS_SW_RESET		0x1000
+#define WRAPPER_XTSS_SW_RESET_BIT		BIT(0)
 
 /* Venus AON */
 #define AON_BASE_V6				0x000e0000
-- 
2.7.4


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

* [PATCH 2/7] media: venus: core: Add sc7280 DT compatible and resource data
  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-19  9:36 ` 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
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Dikshita Agarwal @ 2021-05-19  9:36 UTC (permalink / raw)
  To: linux-media, stanimir.varbanov; +Cc: linux-kernel, vgarodia, Dikshita Agarwal

Adds a sm7280 compatible binding to the venus core.

Co-developed-by: Mansur Alisha Shaik <mansur@codeaurora.org>
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
 drivers/media/platform/qcom/venus/core.c | 52 ++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 91b1584..f9e4a3eb 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -736,6 +736,57 @@ static const struct venus_resources sm8250_res = {
 	.fwname = "qcom/vpu-1.0/venus.mdt",
 };
 
+static const struct freq_tbl sc7280_freq_table[] = {
+	{ 0, 460000000 },
+	{ 0, 424000000 },
+	{ 0, 335000000 },
+	{ 0, 240000000 },
+	{ 0, 133333333 },
+};
+
+static const struct bw_tbl sc7280_bw_table_enc[] = {
+	{ 1944000, 1896000, 0, 3657000, 0 },	/* 3840x2160@60 */
+	{  972000,  968000, 0, 1848000, 0 },	/* 3840x2160@30 */
+	{  489600,  618000, 0,  941000, 0 },	/* 1920x1080@60 */
+	{  244800,  318000, 0,	480000, 0 },	/* 1920x1080@30 */
+};
+
+static const struct bw_tbl sc7280_bw_table_dec[] = {
+	{ 2073600, 2128000, 0, 3831000, 0 },	/* 4096x2160@60 */
+	{ 1036800, 1085000, 0, 1937000, 0 },	/* 4096x2160@30 */
+	{  489600,  779000, 0,  998000, 0 },	/* 1920x1080@60 */
+	{  244800,  400000, 0,  509000, 0 },	/* 1920x1080@30 */
+};
+
+static const struct reg_val sm7280_reg_preset[] = {
+	{ 0xb0088, 0 },
+};
+
+static const struct venus_resources sc7280_res = {
+	.freq_tbl = sc7280_freq_table,
+	.freq_tbl_size = ARRAY_SIZE(sc7280_freq_table),
+	.reg_tbl = sm7280_reg_preset,
+	.reg_tbl_size = ARRAY_SIZE(sm7280_reg_preset),
+	.bw_tbl_enc = sc7280_bw_table_enc,
+	.bw_tbl_enc_size = ARRAY_SIZE(sc7280_bw_table_enc),
+	.bw_tbl_dec = sc7280_bw_table_dec,
+	.bw_tbl_dec_size = ARRAY_SIZE(sc7280_bw_table_dec),
+	.clks = {"core", "bus", "iface"},
+	.clks_num = 3,
+	.vcodec0_clks = {"vcodec_core", "vcodec_bus"},
+	.vcodec_clks_num = 2,
+	.vcodec_pmdomains = { "venus", "vcodec0" },
+	.vcodec_pmdomains_num = 2,
+	.opp_pmdomain = NULL,
+	.vcodec_num = 1,
+	.hfi_version = HFI_VERSION_6XX,
+	.vmem_id = VIDC_RESOURCE_NONE,
+	.vmem_size = 0,
+	.vmem_addr = 0,
+	.dma_mask = 0xe0000000 - 1,
+	.fwname = "qcom/vpu-2.0/venus.mdt",
+};
+
 static const struct of_device_id venus_dt_match[] = {
 	{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
 	{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
@@ -743,6 +794,7 @@ static const struct of_device_id venus_dt_match[] = {
 	{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
 	{ .compatible = "qcom,sc7180-venus", .data = &sc7180_res, },
 	{ .compatible = "qcom,sm8250-venus", .data = &sm8250_res, },
+	{ .compatible = "qcom,sc7280-venus", .data = &sc7280_res, },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, venus_dt_match);
-- 
2.7.4


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

* [PATCH 3/7] media: venus: Add num_vpp_pipes to resource structure
  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-19  9:36 ` [PATCH 2/7] media: venus: core: Add sc7280 DT compatible and resource data Dikshita Agarwal
@ 2021-05-19  9:36 ` 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
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Dikshita Agarwal @ 2021-05-19  9:36 UTC (permalink / raw)
  To: linux-media, stanimir.varbanov; +Cc: linux-kernel, vgarodia, Dikshita Agarwal

V6 HW can have vpp pipes as 1 or 4, add num_vpp_pipes
to resource struture to differentiate.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
 drivers/media/platform/qcom/venus/core.c            |  2 ++
 drivers/media/platform/qcom/venus/core.h            |  1 +
 drivers/media/platform/qcom/venus/helpers.c         |  2 +-
 drivers/media/platform/qcom/venus/hfi_platform.c    | 13 -------------
 drivers/media/platform/qcom/venus/hfi_platform.h    |  2 --
 drivers/media/platform/qcom/venus/hfi_platform_v6.c |  6 ------
 6 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index f9e4a3eb..10da433 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -729,6 +729,7 @@ static const struct venus_resources sm8250_res = {
 	.vcodec_num = 1,
 	.max_load = 7833600,
 	.hfi_version = HFI_VERSION_6XX,
+	.num_vpp_pipes = 4,
 	.vmem_id = VIDC_RESOURCE_NONE,
 	.vmem_size = 0,
 	.vmem_addr = 0,
@@ -780,6 +781,7 @@ static const struct venus_resources sc7280_res = {
 	.opp_pmdomain = NULL,
 	.vcodec_num = 1,
 	.hfi_version = HFI_VERSION_6XX,
+	.num_vpp_pipes = 1,
 	.vmem_id = VIDC_RESOURCE_NONE,
 	.vmem_size = 0,
 	.vmem_addr = 0,
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 745f226..1ff20d9 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -68,6 +68,7 @@ struct venus_resources {
 	const char * const resets[VIDC_RESETS_NUM_MAX];
 	unsigned int resets_num;
 	enum hfi_version hfi_version;
+	u8 num_vpp_pipes;
 	u32 max_load;
 	unsigned int vmem_id;
 	u32 vmem_size;
diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index b813d6dba..2223f55 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -583,7 +583,7 @@ static int platform_get_bufreq(struct venus_inst *inst, u32 buftype,
 		return -EINVAL;
 
 	params.version = version;
-	params.num_vpp_pipes = hfi_platform_num_vpp_pipes(version);
+	params.num_vpp_pipes = inst->core->res->num_vpp_pipes;
 
 	if (is_dec) {
 		params.width = inst->width;
diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/media/platform/qcom/venus/hfi_platform.c
index 8f47804..683ab67 100644
--- a/drivers/media/platform/qcom/venus/hfi_platform.c
+++ b/drivers/media/platform/qcom/venus/hfi_platform.c
@@ -50,16 +50,3 @@ hfi_platform_get_codec_vsp_freq(enum hfi_version version, u32 codec, u32 session
 	return freq;
 }
 
-u8 hfi_platform_num_vpp_pipes(enum hfi_version version)
-{
-	const struct hfi_platform *plat;
-
-	plat = hfi_platform_get(version);
-	if (!plat)
-		return 0;
-
-	if (plat->num_vpp_pipes)
-		return plat->num_vpp_pipes();
-
-	return 0;
-}
diff --git a/drivers/media/platform/qcom/venus/hfi_platform.h b/drivers/media/platform/qcom/venus/hfi_platform.h
index 3819bb2..ef768bf 100644
--- a/drivers/media/platform/qcom/venus/hfi_platform.h
+++ b/drivers/media/platform/qcom/venus/hfi_platform.h
@@ -50,7 +50,6 @@ struct hfi_platform {
 	unsigned long (*codec_vsp_freq)(u32 session_type, u32 codec);
 	void (*codecs)(u32 *enc_codecs, u32 *dec_codecs, u32 *count);
 	const struct hfi_plat_caps *(*capabilities)(unsigned int *entries);
-	u8 (*num_vpp_pipes)(void);
 	int (*bufreq)(struct hfi_plat_buffers_params *params, u32 session_type,
 		      u32 buftype, struct hfi_buffer_requirements *bufreq);
 };
@@ -63,5 +62,4 @@ unsigned long hfi_platform_get_codec_vpp_freq(enum hfi_version version, u32 code
 					      u32 session_type);
 unsigned long hfi_platform_get_codec_vsp_freq(enum hfi_version version, u32 codec,
 					      u32 session_type);
-u8 hfi_platform_num_vpp_pipes(enum hfi_version version);
 #endif
diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v6.c b/drivers/media/platform/qcom/venus/hfi_platform_v6.c
index dd1a039..c1f00f8 100644
--- a/drivers/media/platform/qcom/venus/hfi_platform_v6.c
+++ b/drivers/media/platform/qcom/venus/hfi_platform_v6.c
@@ -311,16 +311,10 @@ static unsigned long codec_vsp_freq(u32 session_type, u32 codec)
 	return 0;
 }
 
-static u8 num_vpp_pipes(void)
-{
-	return 4;
-}
-
 const struct hfi_platform hfi_plat_v6 = {
 	.codec_vpp_freq = codec_vpp_freq,
 	.codec_vsp_freq = codec_vsp_freq,
 	.codecs = get_codecs,
 	.capabilities = get_capabilities,
-	.num_vpp_pipes = num_vpp_pipes,
 	.bufreq = hfi_plat_bufreq_v6,
 };
-- 
2.7.4


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

* [PATCH 4/7] media: venus: hfi: Skip AON register programming for V6 1pipe
  2021-05-19  9:36 [PATCH 0/7] media: venus: Enable venus support on sc7280 Dikshita Agarwal
                   ` (2 preceding siblings ...)
  2021-05-19  9:36 ` [PATCH 3/7] media: venus: Add num_vpp_pipes to resource structure Dikshita Agarwal
@ 2021-05-19  9:36 ` Dikshita Agarwal
  2021-05-31 11:19   ` Stanimir Varbanov
  2021-05-19  9:36 ` [PATCH 5/7] venus: vdec: set work route to fw Dikshita Agarwal
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Dikshita Agarwal @ 2021-05-19  9:36 UTC (permalink / raw)
  To: linux-media, stanimir.varbanov; +Cc: linux-kernel, vgarodia, Dikshita Agarwal

AON register programming is used to set NOC to low
power mode during V6 power off sequence. However
AON register memory map is not applicable to 1pipe,
hence skipping AON register programming.

Co-developed-by: Mansur Alisha Shaik <mansur@codeaurora.org>
Co-developed-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index ce98c52..3a75a27 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -551,6 +551,9 @@ static int venus_halt_axi(struct venus_hfi_device *hdev)
 	if (IS_V6(hdev->core)) {
 		writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6);
 
+		if (hdev->core->res->num_vpp_pipes == 1)
+			goto skip_aon_mvp_noc;
+
 		writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL);
 		ret = readl_poll_timeout(aon_base + AON_WRAPPER_MVP_NOC_LPI_STATUS,
 					 val,
@@ -560,6 +563,7 @@ static int venus_halt_axi(struct venus_hfi_device *hdev)
 		if (ret)
 			return -ETIMEDOUT;
 
+skip_aon_mvp_noc:
 		mask_val = (BIT(2) | BIT(1) | BIT(0));
 		writel(mask_val, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6);
 
-- 
2.7.4


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

* [PATCH 5/7] venus: vdec: set work route to fw
  2021-05-19  9:36 [PATCH 0/7] media: venus: Enable venus support on sc7280 Dikshita Agarwal
                   ` (3 preceding siblings ...)
  2021-05-19  9:36 ` [PATCH 4/7] media: venus: hfi: Skip AON register programming for V6 1pipe Dikshita Agarwal
@ 2021-05-19  9:36 ` Dikshita Agarwal
  2021-05-31 10:32   ` Stanimir Varbanov
  2021-05-19  9:36 ` [PATCH 6/7] media: venus: helpers: update NUM_MBS macro calculation Dikshita Agarwal
  2021-05-19  9:36 ` [PATCH 7/7] media: venus: Set buffer to FW based on FW min count requirement Dikshita Agarwal
  6 siblings, 1 reply; 15+ messages in thread
From: Dikshita Agarwal @ 2021-05-19  9:36 UTC (permalink / raw)
  To: linux-media, stanimir.varbanov; +Cc: linux-kernel, vgarodia, Dikshita Agarwal

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


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

* [PATCH 6/7] media: venus: helpers: update NUM_MBS macro calculation
  2021-05-19  9:36 [PATCH 0/7] media: venus: Enable venus support on sc7280 Dikshita Agarwal
                   ` (4 preceding siblings ...)
  2021-05-19  9:36 ` [PATCH 5/7] venus: vdec: set work route to fw Dikshita Agarwal
@ 2021-05-19  9:36 ` 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
  6 siblings, 1 reply; 15+ messages in thread
From: Dikshita Agarwal @ 2021-05-19  9:36 UTC (permalink / raw)
  To: linux-media, stanimir.varbanov; +Cc: linux-kernel, vgarodia, Dikshita Agarwal

Consider alignment while calculating NUM_MBS.

Co-developed-by: Mansur Alisha Shaik <mansur@codeaurora.org>
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
 drivers/media/platform/qcom/venus/helpers.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index 2223f55..cbe653f 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -18,8 +18,8 @@
 #include "hfi_platform.h"
 #include "hfi_parser.h"
 
-#define NUM_MBS_720P	(((1280 + 15) >> 4) * ((720 + 15) >> 4))
-#define NUM_MBS_4K	(((4096 + 15) >> 4) * ((2304 + 15) >> 4))
+#define NUM_MBS_720P	(((ALIGN(1280, 16)) >> 4) * ((ALIGN(736, 16)) >> 4))
+#define NUM_MBS_4K	(((ALIGN(4096, 16)) >> 4) * ((ALIGN(2304, 16)) >> 4))
 
 struct intbuf {
 	struct list_head list;
@@ -1099,17 +1099,19 @@ static u32 venus_helper_get_work_mode(struct venus_inst *inst)
 	u32 num_mbs;
 
 	mode = VIDC_WORK_MODE_2;
-	if (inst->session_type == VIDC_SESSION_TYPE_DEC) {
-		num_mbs = (ALIGN(inst->height, 16) * ALIGN(inst->width, 16)) / 256;
-		if (inst->hfi_codec == HFI_VIDEO_CODEC_MPEG2 ||
-		    inst->pic_struct != HFI_INTERLACE_FRAME_PROGRESSIVE ||
-		    num_mbs <= NUM_MBS_720P)
-			mode = VIDC_WORK_MODE_1;
-	} else {
-		num_mbs = (ALIGN(inst->out_height, 16) * ALIGN(inst->out_width, 16)) / 256;
-		if (inst->hfi_codec == HFI_VIDEO_CODEC_VP8 &&
-		    num_mbs <= NUM_MBS_4K)
-			mode = VIDC_WORK_MODE_1;
+	if (IS_V6(inst->core)) {
+		if (inst->session_type == VIDC_SESSION_TYPE_DEC) {
+			num_mbs = ((ALIGN(inst->height, 16))/16 * (ALIGN(inst->width, 16)))/16;
+			if (inst->hfi_codec == HFI_VIDEO_CODEC_MPEG2 ||
+			    inst->pic_struct != HFI_INTERLACE_FRAME_PROGRESSIVE ||
+			    num_mbs <= NUM_MBS_720P)
+				mode = VIDC_WORK_MODE_1;
+		} else {
+			num_mbs = (ALIGN(inst->out_height, 16) * ALIGN(inst->out_width, 16)) / 256;
+			if (inst->hfi_codec == HFI_VIDEO_CODEC_VP8 &&
+			    num_mbs <= NUM_MBS_4K)
+				mode = VIDC_WORK_MODE_1;
+		}
 	}
 
 	return mode;
-- 
2.7.4


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

* [PATCH 7/7] media: venus: Set buffer to FW based on FW min count requirement.
  2021-05-19  9:36 [PATCH 0/7] media: venus: Enable venus support on sc7280 Dikshita Agarwal
                   ` (5 preceding siblings ...)
  2021-05-19  9:36 ` [PATCH 6/7] media: venus: helpers: update NUM_MBS macro calculation Dikshita Agarwal
@ 2021-05-19  9:36 ` Dikshita Agarwal
  2021-05-31 11:28   ` Stanimir Varbanov
  6 siblings, 1 reply; 15+ messages in thread
From: Dikshita Agarwal @ 2021-05-19  9:36 UTC (permalink / raw)
  To: linux-media, stanimir.varbanov; +Cc: linux-kernel, vgarodia, Dikshita Agarwal

- Get the min buffer count required by FW from source event change
  and use the same value to decide actual buffer count and for
  buffer size calculation.
- Setup DPB and OPB buffers after session continue incase of
  reconfig.

Co-developed-by: Mansur Alisha Shaik <mansur@codeaurora.org>
Co-developed-by: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
 drivers/media/platform/qcom/venus/core.h           |  1 +
 drivers/media/platform/qcom/venus/helpers.c        | 11 ++++++++++-
 drivers/media/platform/qcom/venus/hfi.h            |  1 +
 drivers/media/platform/qcom/venus/hfi_helper.h     |  9 +++++++++
 drivers/media/platform/qcom/venus/hfi_msgs.c       |  7 +++++++
 .../media/platform/qcom/venus/hfi_plat_bufs_v6.c   |  3 ++-
 drivers/media/platform/qcom/venus/vdec.c           | 22 ++++++++++++----------
 7 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 1ff20d9..b2b023e 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -403,6 +403,7 @@ struct venus_inst {
 	u32 width;
 	u32 height;
 	struct v4l2_rect crop;
+	u32 fw_min_cnt;
 	u32 out_width;
 	u32 out_height;
 	u32 colorspace;
diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index cbe653f..83c3009 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -576,6 +576,7 @@ static int platform_get_bufreq(struct venus_inst *inst, u32 buftype,
 	struct hfi_plat_buffers_params params;
 	bool is_dec = inst->session_type == VIDC_SESSION_TYPE_DEC;
 	struct venc_controls *enc_ctr = &inst->controls.enc;
+	int ret = 0;
 
 	hfi_plat = hfi_platform_get(version);
 
@@ -610,7 +611,15 @@ static int platform_get_bufreq(struct venus_inst *inst, u32 buftype,
 		params.enc.is_tenbit = inst->bit_depth == VIDC_BITDEPTH_10;
 	}
 
-	return hfi_plat->bufreq(&params, inst->session_type, buftype, req);
+	if (buftype == HFI_BUFFER_OUTPUT || buftype == HFI_BUFFER_OUTPUT2 ||
+	    buftype == HFI_BUFFER_INTERNAL_SCRATCH_1(version))
+		req->count_min = inst->fw_min_cnt;
+
+	ret = hfi_plat->bufreq(&params, inst->session_type, buftype, req);
+	if (buftype == HFI_BUFFER_OUTPUT || buftype == HFI_BUFFER_OUTPUT2)
+		if (inst->fw_min_cnt != req->count_min)
+			inst->fw_min_cnt = req->count_min;
+	return ret;
 }
 
 int venus_helper_get_bufreq(struct venus_inst *inst, u32 type,
diff --git a/drivers/media/platform/qcom/venus/hfi.h b/drivers/media/platform/qcom/venus/hfi.h
index f25d412..287d544 100644
--- a/drivers/media/platform/qcom/venus/hfi.h
+++ b/drivers/media/platform/qcom/venus/hfi.h
@@ -75,6 +75,7 @@ struct hfi_event_data {
 		u32 left, top;
 		u32 width, height;
 	} input_crop;
+	u32 fw_min_cnt;
 };
 
 /* define core states */
diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h
index 185c302..5162f09 100644
--- a/drivers/media/platform/qcom/venus/hfi_helper.h
+++ b/drivers/media/platform/qcom/venus/hfi_helper.h
@@ -167,6 +167,7 @@
 #define HFI_PROPERTY_PARAM_VDEC_RECOVERY_POINT_SEI_EXTRADATA	0x120300c
 #define HFI_PROPERTY_PARAM_VDEC_THUMBNAIL_MODE			0x120300d
 #define HFI_PROPERTY_PARAM_VDEC_FRAME_ASSEMBLY			0x120300e
+#define HFI_PROPERTY_PARAM_VDEC_DPB_COUNTS			0x120300e
 #define HFI_PROPERTY_PARAM_VDEC_VC1_FRAMEDISP_EXTRADATA		0x1203011
 #define HFI_PROPERTY_PARAM_VDEC_VC1_SEQDISP_EXTRADATA		0x1203012
 #define HFI_PROPERTY_PARAM_VDEC_TIMESTAMP_EXTRADATA		0x1203013
@@ -906,6 +907,14 @@ struct hfi_extradata_input_crop {
 	u32 height;
 };
 
+struct hfi_dpb_counts {
+	u32 max_dpb_count;
+	u32 max_ref_frames;
+	u32 max_dec_buffering;
+	u32 max_reorder_frames;
+	u32 fw_min_cnt;
+};
+
 #define HFI_COLOR_FORMAT_MONOCHROME		0x01
 #define HFI_COLOR_FORMAT_NV12			0x02
 #define HFI_COLOR_FORMAT_NV21			0x03
diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c
index a2d436d..2d207254 100644
--- a/drivers/media/platform/qcom/venus/hfi_msgs.c
+++ b/drivers/media/platform/qcom/venus/hfi_msgs.c
@@ -32,6 +32,7 @@ static void event_seq_changed(struct venus_core *core, struct venus_inst *inst,
 	struct hfi_colour_space *colour_info;
 	struct hfi_buffer_requirements *bufreq;
 	struct hfi_extradata_input_crop *crop;
+	struct hfi_dpb_counts *dpb_count;
 	u8 *data_ptr;
 	u32 ptype;
 
@@ -110,6 +111,12 @@ static void event_seq_changed(struct venus_core *core, struct venus_inst *inst,
 			event.input_crop.height = crop->height;
 			data_ptr += sizeof(*crop);
 			break;
+		case HFI_PROPERTY_PARAM_VDEC_DPB_COUNTS:
+			data_ptr += sizeof(u32);
+			dpb_count = (struct hfi_dpb_counts *)data_ptr;
+			event.fw_min_cnt = dpb_count->fw_min_cnt;
+			data_ptr += sizeof(*dpb_count);
+			break;
 		default:
 			break;
 		}
diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
index 479178b..c7aea06 100644
--- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
+++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
@@ -1164,7 +1164,7 @@ static int output_buffer_count(u32 session_type, u32 codec)
 			output_min_count = 6;
 			break;
 		case V4L2_PIX_FMT_VP9:
-			output_min_count = 9;
+			output_min_count = 11;
 			break;
 		case V4L2_PIX_FMT_H264:
 		case V4L2_PIX_FMT_HEVC:
@@ -1213,6 +1213,7 @@ static int bufreq_dec(struct hfi_plat_buffers_params *params, u32 buftype,
 	}
 
 	out_min_count = output_buffer_count(VIDC_SESSION_TYPE_DEC, codec);
+	out_min_count = max(out_min_count, bufreq->count_min);
 
 	bufreq->type = buftype;
 	bufreq->region_size = 0;
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index a674281..d8f0529 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -977,7 +977,7 @@ static int vdec_start_capture(struct venus_inst *inst)
 		return ret;
 
 	ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs,
-					VB2_MAX_FRAME, VB2_MAX_FRAME);
+					inst->num_output_bufs, inst->num_output_bufs);
 	if (ret)
 		return ret;
 
@@ -985,6 +985,14 @@ static int vdec_start_capture(struct venus_inst *inst)
 	if (ret)
 		goto err;
 
+	venus_pm_load_scale(inst);
+
+	inst->next_buf_last = false;
+
+	ret = hfi_session_continue(inst);
+	if (ret)
+		goto err;
+
 	ret = venus_helper_alloc_dpb_bufs(inst);
 	if (ret)
 		goto err;
@@ -997,14 +1005,6 @@ static int vdec_start_capture(struct venus_inst *inst)
 	if (ret)
 		goto free_dpb_bufs;
 
-	venus_pm_load_scale(inst);
-
-	inst->next_buf_last = false;
-
-	ret = hfi_session_continue(inst);
-	if (ret)
-		goto free_dpb_bufs;
-
 	inst->codec_state = VENUS_DEC_STATE_DECODING;
 
 	if (inst->drain_active)
@@ -1069,7 +1069,7 @@ static int vdec_start_output(struct venus_inst *inst)
 		return ret;
 
 	ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs,
-					VB2_MAX_FRAME, VB2_MAX_FRAME);
+					inst->num_output_bufs, inst->num_output_bufs);
 	if (ret)
 		return ret;
 
@@ -1410,6 +1410,7 @@ static void vdec_event_change(struct venus_inst *inst,
 		inst->crop.height = ev_data->height;
 	}
 
+	inst->fw_min_cnt = ev_data->fw_min_cnt;
 	inst->out_width = ev_data->width;
 	inst->out_height = ev_data->height;
 
@@ -1513,6 +1514,7 @@ static void vdec_inst_init(struct venus_inst *inst)
 	inst->crop.top = 0;
 	inst->crop.width = inst->width;
 	inst->crop.height = inst->height;
+	inst->fw_min_cnt = 8;
 	inst->out_width = frame_width_min(inst);
 	inst->out_height = frame_height_min(inst);
 	inst->fps = 30;
-- 
2.7.4


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

* Re: [PATCH 1/7] venus: firmware: enable no tz fw loading for sc7280
  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
  0 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2021-05-31  9:01 UTC (permalink / raw)
  To: Dikshita Agarwal, linux-media; +Cc: linux-kernel, vgarodia



On 5/19/21 12:36 PM, Dikshita Agarwal wrote:
> - Enable no tz FW loading.
> - add routine to reset XTSS.
> 
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
>  drivers/media/platform/qcom/venus/firmware.c     | 42 ++++++++++++++++++++----
>  drivers/media/platform/qcom/venus/hfi_venus_io.h |  2 ++
>  2 files changed, 38 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
> index 227bd3b..e05e01a 100644
> --- a/drivers/media/platform/qcom/venus/firmware.c
> +++ b/drivers/media/platform/qcom/venus/firmware.c
> @@ -42,6 +42,22 @@ static void venus_reset_cpu(struct venus_core *core)
>  	writel(0, wrapper_base + WRAPPER_A9SS_SW_RESET);
>  }
>  
> +static void venus_reset_cpu_V6(struct venus_core *core)
> +{
> +	u32 fw_size = core->fw.mapped_mem_size;
> +	void __iomem *wrapper_tz_base = core->wrapper_tz_base;
> +
> +	writel(0, wrapper_tz_base + WRAPPER_FW_START_ADDR);
> +	writel(fw_size, wrapper_tz_base + WRAPPER_FW_END_ADDR);
> +	writel(0, wrapper_tz_base + WRAPPER_CPA_START_ADDR);
> +	writel(fw_size, wrapper_tz_base + WRAPPER_CPA_END_ADDR);
> +	writel(fw_size, wrapper_tz_base + WRAPPER_NONPIX_START_ADDR);
> +	writel(fw_size, wrapper_tz_base + WRAPPER_NONPIX_END_ADDR);
> +
> +	/* Bring XTSS out of reset */
> +	writel(0, wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
> +}

Could you squash this v6 cpu reset into venus_reset_cpu() and add
IS_V6() checks there ...

> +
>  int venus_set_hw_state(struct venus_core *core, bool resume)
>  {
>  	int ret;
> @@ -54,10 +70,15 @@ int venus_set_hw_state(struct venus_core *core, bool resume)
>  	}
>  
>  	if (resume) {
> -		venus_reset_cpu(core);
> +		if (IS_V6(core))
> +			venus_reset_cpu_V6(core);
> +		else
> +			venus_reset_cpu(core);

... then this IS_V6() is not needed.

>  	} else {
>  		if (!IS_V6(core))
>  			writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET);
> +		else
> +			writel(1, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);

Could you invert the logic here:

if (IS_V6(core)
	writel(1, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
else
	writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET);

>  	}
>  
>  	return 0;
> @@ -149,7 +170,10 @@ static int venus_boot_no_tz(struct venus_core *core, phys_addr_t mem_phys,
>  		return ret;
>  	}
>  
> -	venus_reset_cpu(core);
> +	if (IS_V6(core))
> +		venus_reset_cpu_V6(core);
> +	else
> +		venus_reset_cpu(core);
>  
>  	return 0;
>  }
> @@ -162,12 +186,18 @@ static int venus_shutdown_no_tz(struct venus_core *core)
>  	u32 reg;
>  	struct device *dev = core->fw.dev;
>  	void __iomem *wrapper_base = core->wrapper_base;
> +	void __iomem *wrapper_tz_base = core->wrapper_tz_base;
>  
> +	if (IS_V6(core)) {
> +		reg = readl_relaxed(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
> +		reg |= WRAPPER_XTSS_SW_RESET_BIT;
> +		writel_relaxed(reg, wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
> +	} else {
>  	/* Assert the reset to ARM9 */

This comment should be moved above.

> -	reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET);
> -	reg |= WRAPPER_A9SS_SW_RESET_BIT;
> -	writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET);
> -
> +		reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET);
> +		reg |= WRAPPER_A9SS_SW_RESET_BIT;
> +		writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET);
> +	}
>  	/* Make sure reset is asserted before the mapping is removed */
>  	mb();
>  
> diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h
> index 300c6e47..9735a24 100644
> --- a/drivers/media/platform/qcom/venus/hfi_venus_io.h
> +++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h
> @@ -149,6 +149,8 @@
>  /* Wrapper TZ 6xx */
>  #define WRAPPER_TZ_BASE_V6			0x000c0000
>  #define WRAPPER_TZ_CPU_STATUS_V6		0x10
> +#define WRAPPER_TZ_XTSS_SW_RESET		0x1000
> +#define WRAPPER_XTSS_SW_RESET_BIT		BIT(0)
>  
>  /* Venus AON */
>  #define AON_BASE_V6				0x000e0000
> 

-- 
regards,
Stan

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

* Re: [PATCH 5/7] venus: vdec: set work route to fw
  2021-05-19  9:36 ` [PATCH 5/7] venus: vdec: set work route to fw Dikshita Agarwal
@ 2021-05-31 10:32   ` Stanimir Varbanov
  0 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2021-05-31 10:32 UTC (permalink / raw)
  To: Dikshita Agarwal, linux-media; +Cc: linux-kernel, vgarodia



On 5/19/21 12:36 PM, Dikshita Agarwal wrote:
> 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)) {

Please move this IS_V6 check in vdec_set_work_route().

> +		ret = vdec_set_work_route(inst);
> +		if (ret)
> +			return ret;
> +	}
> +
>  	ret = vdec_output_conf(inst);
>  	if (ret)
>  		return ret;
> 

-- 
regards,
Stan

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

* Re: [PATCH 2/7] media: venus: core: Add sc7280 DT compatible and resource data
  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
  0 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2021-05-31 11:18 UTC (permalink / raw)
  To: Dikshita Agarwal, linux-media; +Cc: linux-kernel, vgarodia



On 5/19/21 12:36 PM, Dikshita Agarwal wrote:
> Adds a sm7280 compatible binding to the venus core.
> 
> Co-developed-by: Mansur Alisha Shaik <mansur@codeaurora.org>
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
>  drivers/media/platform/qcom/venus/core.c | 52 ++++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

-- 
regards,
Stan

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

* Re: [PATCH 3/7] media: venus: Add num_vpp_pipes to resource structure
  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
  0 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2021-05-31 11:19 UTC (permalink / raw)
  To: Dikshita Agarwal, linux-media; +Cc: linux-kernel, vgarodia



On 5/19/21 12:36 PM, Dikshita Agarwal wrote:
> V6 HW can have vpp pipes as 1 or 4, add num_vpp_pipes
> to resource struture to differentiate.
> 
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
>  drivers/media/platform/qcom/venus/core.c            |  2 ++
>  drivers/media/platform/qcom/venus/core.h            |  1 +
>  drivers/media/platform/qcom/venus/helpers.c         |  2 +-
>  drivers/media/platform/qcom/venus/hfi_platform.c    | 13 -------------
>  drivers/media/platform/qcom/venus/hfi_platform.h    |  2 --
>  drivers/media/platform/qcom/venus/hfi_platform_v6.c |  6 ------
>  6 files changed, 4 insertions(+), 22 deletions(-)
> 

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

-- 
regards,
Stan

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

* Re: [PATCH 4/7] media: venus: hfi: Skip AON register programming for V6 1pipe
  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
  0 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2021-05-31 11:19 UTC (permalink / raw)
  To: Dikshita Agarwal, linux-media; +Cc: linux-kernel, vgarodia



On 5/19/21 12:36 PM, Dikshita Agarwal wrote:
> AON register programming is used to set NOC to low
> power mode during V6 power off sequence. However
> AON register memory map is not applicable to 1pipe,
> hence skipping AON register programming.
> 
> Co-developed-by: Mansur Alisha Shaik <mansur@codeaurora.org>
> Co-developed-by: Vikash Garodia <vgarodia@codeaurora.org>
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
>  drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

-- 
regards,
Stan

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

* Re: [PATCH 6/7] media: venus: helpers: update NUM_MBS macro calculation
  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
  0 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2021-05-31 11:21 UTC (permalink / raw)
  To: Dikshita Agarwal, linux-media; +Cc: linux-kernel, vgarodia



On 5/19/21 12:36 PM, Dikshita Agarwal wrote:
> Consider alignment while calculating NUM_MBS.
> 
> Co-developed-by: Mansur Alisha Shaik <mansur@codeaurora.org>
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
>  drivers/media/platform/qcom/venus/helpers.c | 28 +++++++++++++++-------------
>  1 file changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index 2223f55..cbe653f 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -18,8 +18,8 @@
>  #include "hfi_platform.h"
>  #include "hfi_parser.h"
>  
> -#define NUM_MBS_720P	(((1280 + 15) >> 4) * ((720 + 15) >> 4))
> -#define NUM_MBS_4K	(((4096 + 15) >> 4) * ((2304 + 15) >> 4))
> +#define NUM_MBS_720P	(((ALIGN(1280, 16)) >> 4) * ((ALIGN(736, 16)) >> 4))
> +#define NUM_MBS_4K	(((ALIGN(4096, 16)) >> 4) * ((ALIGN(2304, 16)) >> 4))
>  
>  struct intbuf {
>  	struct list_head list;
> @@ -1099,17 +1099,19 @@ static u32 venus_helper_get_work_mode(struct venus_inst *inst)
>  	u32 num_mbs;
>  
>  	mode = VIDC_WORK_MODE_2;
> -	if (inst->session_type == VIDC_SESSION_TYPE_DEC) {
> -		num_mbs = (ALIGN(inst->height, 16) * ALIGN(inst->width, 16)) / 256;
> -		if (inst->hfi_codec == HFI_VIDEO_CODEC_MPEG2 ||
> -		    inst->pic_struct != HFI_INTERLACE_FRAME_PROGRESSIVE ||
> -		    num_mbs <= NUM_MBS_720P)
> -			mode = VIDC_WORK_MODE_1;
> -	} else {
> -		num_mbs = (ALIGN(inst->out_height, 16) * ALIGN(inst->out_width, 16)) / 256;
> -		if (inst->hfi_codec == HFI_VIDEO_CODEC_VP8 &&
> -		    num_mbs <= NUM_MBS_4K)
> -			mode = VIDC_WORK_MODE_1;
> +	if (IS_V6(inst->core)) {

IS_V6() is not needed - we already have this check in
venus_helper_set_work_mode()

> +		if (inst->session_type == VIDC_SESSION_TYPE_DEC) {
> +			num_mbs = ((ALIGN(inst->height, 16))/16 * (ALIGN(inst->width, 16)))/16;
> +			if (inst->hfi_codec == HFI_VIDEO_CODEC_MPEG2 ||
> +			    inst->pic_struct != HFI_INTERLACE_FRAME_PROGRESSIVE ||
> +			    num_mbs <= NUM_MBS_720P)
> +				mode = VIDC_WORK_MODE_1;
> +		} else {
> +			num_mbs = (ALIGN(inst->out_height, 16) * ALIGN(inst->out_width, 16)) / 256;
> +			if (inst->hfi_codec == HFI_VIDEO_CODEC_VP8 &&
> +			    num_mbs <= NUM_MBS_4K)
> +				mode = VIDC_WORK_MODE_1;
> +		}
>  	}
>  
>  	return mode;
> 

-- 
regards,
Stan

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

* Re: [PATCH 7/7] media: venus: Set buffer to FW based on FW min count requirement.
  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
  0 siblings, 0 replies; 15+ messages in thread
From: Stanimir Varbanov @ 2021-05-31 11:28 UTC (permalink / raw)
  To: Dikshita Agarwal, linux-media; +Cc: linux-kernel, vgarodia



On 5/19/21 12:36 PM, Dikshita Agarwal wrote:
> - Get the min buffer count required by FW from source event change
>   and use the same value to decide actual buffer count and for
>   buffer size calculation.
> - Setup DPB and OPB buffers after session continue incase of
>   reconfig.
> 
> Co-developed-by: Mansur Alisha Shaik <mansur@codeaurora.org>
> Co-developed-by: Vikash Garodia <vgarodia@codeaurora.org>
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
>  drivers/media/platform/qcom/venus/core.h           |  1 +
>  drivers/media/platform/qcom/venus/helpers.c        | 11 ++++++++++-
>  drivers/media/platform/qcom/venus/hfi.h            |  1 +
>  drivers/media/platform/qcom/venus/hfi_helper.h     |  9 +++++++++
>  drivers/media/platform/qcom/venus/hfi_msgs.c       |  7 +++++++
>  .../media/platform/qcom/venus/hfi_plat_bufs_v6.c   |  3 ++-
>  drivers/media/platform/qcom/venus/vdec.c           | 22 ++++++++++++----------
>  7 files changed, 42 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
> index 1ff20d9..b2b023e 100644
> --- a/drivers/media/platform/qcom/venus/core.h
> +++ b/drivers/media/platform/qcom/venus/core.h
> @@ -403,6 +403,7 @@ struct venus_inst {
>  	u32 width;
>  	u32 height;
>  	struct v4l2_rect crop;
> +	u32 fw_min_cnt;
>  	u32 out_width;
>  	u32 out_height;
>  	u32 colorspace;
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index cbe653f..83c3009 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -576,6 +576,7 @@ static int platform_get_bufreq(struct venus_inst *inst, u32 buftype,
>  	struct hfi_plat_buffers_params params;
>  	bool is_dec = inst->session_type == VIDC_SESSION_TYPE_DEC;
>  	struct venc_controls *enc_ctr = &inst->controls.enc;
> +	int ret = 0;
>  
>  	hfi_plat = hfi_platform_get(version);
>  
> @@ -610,7 +611,15 @@ static int platform_get_bufreq(struct venus_inst *inst, u32 buftype,
>  		params.enc.is_tenbit = inst->bit_depth == VIDC_BITDEPTH_10;
>  	}
>  
> -	return hfi_plat->bufreq(&params, inst->session_type, buftype, req);
> +	if (buftype == HFI_BUFFER_OUTPUT || buftype == HFI_BUFFER_OUTPUT2 ||
> +	    buftype == HFI_BUFFER_INTERNAL_SCRATCH_1(version))
> +		req->count_min = inst->fw_min_cnt;
> +
> +	ret = hfi_plat->bufreq(&params, inst->session_type, buftype, req);
> +	if (buftype == HFI_BUFFER_OUTPUT || buftype == HFI_BUFFER_OUTPUT2)
> +		if (inst->fw_min_cnt != req->count_min)
> +			inst->fw_min_cnt = req->count_min;
> +	return ret;
>  }
>  
>  int venus_helper_get_bufreq(struct venus_inst *inst, u32 type,
> diff --git a/drivers/media/platform/qcom/venus/hfi.h b/drivers/media/platform/qcom/venus/hfi.h
> index f25d412..287d544 100644
> --- a/drivers/media/platform/qcom/venus/hfi.h
> +++ b/drivers/media/platform/qcom/venus/hfi.h
> @@ -75,6 +75,7 @@ struct hfi_event_data {
>  		u32 left, top;
>  		u32 width, height;
>  	} input_crop;
> +	u32 fw_min_cnt;
>  };
>  
>  /* define core states */
> diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h
> index 185c302..5162f09 100644
> --- a/drivers/media/platform/qcom/venus/hfi_helper.h
> +++ b/drivers/media/platform/qcom/venus/hfi_helper.h
> @@ -167,6 +167,7 @@
>  #define HFI_PROPERTY_PARAM_VDEC_RECOVERY_POINT_SEI_EXTRADATA	0x120300c
>  #define HFI_PROPERTY_PARAM_VDEC_THUMBNAIL_MODE			0x120300d
>  #define HFI_PROPERTY_PARAM_VDEC_FRAME_ASSEMBLY			0x120300e
> +#define HFI_PROPERTY_PARAM_VDEC_DPB_COUNTS			0x120300e
>  #define HFI_PROPERTY_PARAM_VDEC_VC1_FRAMEDISP_EXTRADATA		0x1203011
>  #define HFI_PROPERTY_PARAM_VDEC_VC1_SEQDISP_EXTRADATA		0x1203012
>  #define HFI_PROPERTY_PARAM_VDEC_TIMESTAMP_EXTRADATA		0x1203013
> @@ -906,6 +907,14 @@ struct hfi_extradata_input_crop {
>  	u32 height;
>  };
>  
> +struct hfi_dpb_counts {
> +	u32 max_dpb_count;
> +	u32 max_ref_frames;
> +	u32 max_dec_buffering;
> +	u32 max_reorder_frames;
> +	u32 fw_min_cnt;
> +};
> +
>  #define HFI_COLOR_FORMAT_MONOCHROME		0x01
>  #define HFI_COLOR_FORMAT_NV12			0x02
>  #define HFI_COLOR_FORMAT_NV21			0x03
> diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c
> index a2d436d..2d207254 100644
> --- a/drivers/media/platform/qcom/venus/hfi_msgs.c
> +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c
> @@ -32,6 +32,7 @@ static void event_seq_changed(struct venus_core *core, struct venus_inst *inst,
>  	struct hfi_colour_space *colour_info;
>  	struct hfi_buffer_requirements *bufreq;
>  	struct hfi_extradata_input_crop *crop;
> +	struct hfi_dpb_counts *dpb_count;
>  	u8 *data_ptr;
>  	u32 ptype;
>  
> @@ -110,6 +111,12 @@ static void event_seq_changed(struct venus_core *core, struct venus_inst *inst,
>  			event.input_crop.height = crop->height;
>  			data_ptr += sizeof(*crop);
>  			break;
> +		case HFI_PROPERTY_PARAM_VDEC_DPB_COUNTS:
> +			data_ptr += sizeof(u32);
> +			dpb_count = (struct hfi_dpb_counts *)data_ptr;
> +			event.fw_min_cnt = dpb_count->fw_min_cnt;
> +			data_ptr += sizeof(*dpb_count);
> +			break;
>  		default:
>  			break;
>  		}
> diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
> index 479178b..c7aea06 100644
> --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
> +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c
> @@ -1164,7 +1164,7 @@ static int output_buffer_count(u32 session_type, u32 codec)
>  			output_min_count = 6;
>  			break;
>  		case V4L2_PIX_FMT_VP9:
> -			output_min_count = 9;
> +			output_min_count = 11;
>  			break;
>  		case V4L2_PIX_FMT_H264:
>  		case V4L2_PIX_FMT_HEVC:
> @@ -1213,6 +1213,7 @@ static int bufreq_dec(struct hfi_plat_buffers_params *params, u32 buftype,
>  	}
>  
>  	out_min_count = output_buffer_count(VIDC_SESSION_TYPE_DEC, codec);
> +	out_min_count = max(out_min_count, bufreq->count_min);
>  
>  	bufreq->type = buftype;
>  	bufreq->region_size = 0;
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index a674281..d8f0529 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -977,7 +977,7 @@ static int vdec_start_capture(struct venus_inst *inst)
>  		return ret;
>  
>  	ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs,
> -					VB2_MAX_FRAME, VB2_MAX_FRAME);
> +					inst->num_output_bufs, inst->num_output_bufs);

Please keep VB2_MAX_FRAME for output and output2 num buffers. We need
this to implement vidioc_create_bufs ...

>  	if (ret)
>  		return ret;
>  
> @@ -985,6 +985,14 @@ static int vdec_start_capture(struct venus_inst *inst)
>  	if (ret)
>  		goto err;
>  
> +	venus_pm_load_scale(inst);
> +
> +	inst->next_buf_last = false;
> +
> +	ret = hfi_session_continue(inst);
> +	if (ret)
> +		goto err;
> +
>  	ret = venus_helper_alloc_dpb_bufs(inst);
>  	if (ret)
>  		goto err;
> @@ -997,14 +1005,6 @@ static int vdec_start_capture(struct venus_inst *inst)
>  	if (ret)
>  		goto free_dpb_bufs;
>  
> -	venus_pm_load_scale(inst);
> -
> -	inst->next_buf_last = false;
> -
> -	ret = hfi_session_continue(inst);
> -	if (ret)
> -		goto free_dpb_bufs;
> -
>  	inst->codec_state = VENUS_DEC_STATE_DECODING;
>  
>  	if (inst->drain_active)
> @@ -1069,7 +1069,7 @@ static int vdec_start_output(struct venus_inst *inst)
>  		return ret;
>  
>  	ret = venus_helper_set_num_bufs(inst, inst->num_input_bufs,
> -					VB2_MAX_FRAME, VB2_MAX_FRAME);
> +					inst->num_output_bufs, inst->num_output_bufs);

... ditto

>  	if (ret)
>  		return ret;
>  
> @@ -1410,6 +1410,7 @@ static void vdec_event_change(struct venus_inst *inst,
>  		inst->crop.height = ev_data->height;
>  	}
>  
> +	inst->fw_min_cnt = ev_data->fw_min_cnt;
>  	inst->out_width = ev_data->width;
>  	inst->out_height = ev_data->height;
>  
> @@ -1513,6 +1514,7 @@ static void vdec_inst_init(struct venus_inst *inst)
>  	inst->crop.top = 0;
>  	inst->crop.width = inst->width;
>  	inst->crop.height = inst->height;
> +	inst->fw_min_cnt = 8;

Why 8? Is this the default value for h264 and resolution 96x96?

>  	inst->out_width = frame_width_min(inst);
>  	inst->out_height = frame_height_min(inst);
>  	inst->fps = 30;
> 

-- 
regards,
Stan

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

end of thread, other threads:[~2021-05-31 11:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 5/7] venus: vdec: set work route to fw Dikshita Agarwal
2021-05-31 10:32   ` 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

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).