diff mbox series

[07/13] venus: hfi_plat: Add platform ops for getting number of VPP pipes

Message ID 20200827092417.16040-8-stanimir.varbanov@linaro.org
State Accepted
Commit 367b619ae70d25a0ccbbb7cf97db80cf2660657a
Headers show
Series Introduce new hfi platform layer | expand

Commit Message

Stanimir Varbanov Aug. 27, 2020, 9:24 a.m. UTC
Starting from v6 we have one more hfi property which will be needed
to calculate buffer sizes/count for particular codec and session type.

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

---
 drivers/media/platform/qcom/venus/hfi_platform.c | 14 ++++++++++++++
 drivers/media/platform/qcom/venus/hfi_platform.h |  2 ++
 2 files changed, 16 insertions(+)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/media/platform/qcom/venus/hfi_platform.c
index 65559cae21aa..06f46900cae8 100644
--- a/drivers/media/platform/qcom/venus/hfi_platform.c
+++ b/drivers/media/platform/qcom/venus/hfi_platform.c
@@ -47,3 +47,17 @@  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 8084d092d5d1..f2a6512b3950 100644
--- a/drivers/media/platform/qcom/venus/hfi_platform.h
+++ b/drivers/media/platform/qcom/venus/hfi_platform.h
@@ -48,6 +48,7 @@  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);
 };
 
 extern const struct hfi_platform hfi_plat_v4;
@@ -57,4 +58,5 @@  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