linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFT 00/20] Venus cleanups
@ 2023-09-11 15:10 Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 01/20] media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable Konrad Dybcio
                   ` (21 more replies)
  0 siblings, 22 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

With the driver supporting multiple generations of hardware, some mold
has definitely grown over the code..

This series attempts to amend this situation a bit by commonizing some
code paths and fixing some bugs while at it.

Only tested on SM8250.

Definitely needs testing on:

- SDM845 with old bindings
- SDM845 with new bindings or 7180
- MSM8916
- MSM8996

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Konrad Dybcio (20):
      media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable
      media: venus: pm_helpers: Rename core_clks_get to venus_clks_get
      media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
      media: venus: core: Set OPP clkname in a common code path
      media: venus: pm_helpers: Kill dead code
      media: venus: pm_helpers: Move reset acquisition to common code
      media: venus: pm_helpers: Use reset_bulk API
      media: venus: core: Constify all members of the resource struct
      media: venus: core: Deduplicate OPP genpd names
      media: venus: core: Get rid of vcodec_num
      media: venus: core: Drop cache properties in resource struct
      media: venus: core: Use GENMASK for dma_mask
      media: venus: core: Remove cp_start
      media: venus: pm_helpers: Commonize core_power
      media: venus: pm_helpers: Remove pm_ops->core_put
      media: venus: core: Define a pointer to core->res
      media: venus: pm_helpers: Simplify vcodec clock handling
      media: venus: pm_helpers: Commonize getting clocks and GenPDs
      media: venus: pm_helpers: Commonize vdec_get()
      media: venus: pm_helpers: Commonize venc_get()

 drivers/media/platform/qcom/venus/core.c       | 138 ++++-------
 drivers/media/platform/qcom/venus/core.h       |  64 +++--
 drivers/media/platform/qcom/venus/firmware.c   |   3 +-
 drivers/media/platform/qcom/venus/hfi_venus.c  |   7 +-
 drivers/media/platform/qcom/venus/pm_helpers.c | 328 +++++++++----------------
 drivers/media/platform/qcom/venus/pm_helpers.h |  10 +-
 drivers/media/platform/qcom/venus/vdec.c       |   9 +-
 drivers/media/platform/qcom/venus/venc.c       |   9 +-
 8 files changed, 213 insertions(+), 355 deletions(-)
---
base-commit: 7bc675554773f09d88101bf1ccfc8537dc7c0be9
change-id: 20230911-topic-mars-e60bb2269411

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@linaro.org>


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

* [PATCH RFT 01/20] media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 02/20] media: venus: pm_helpers: Rename core_clks_get to venus_clks_get Konrad Dybcio
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

Commit c22b1a29497c ("media: venus: core,pm: Vote for min clk freq
during venus boot") intended to up the rate of the Venus core clock
from the XO minimum to something more reasonable, based on the per-
SoC frequency table.

Unfortunately, it ended up calling set_rate with that same argument
on all clocks in res->clks. Fix that using the OPP API.

Fixes: c22b1a29497c ("media: venus: core,pm: Vote for min clk freq during venus boot")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 48c9084bb4db..2bd9c63d0253 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -41,24 +41,23 @@ static int core_clks_get(struct venus_core *core)
 static int core_clks_enable(struct venus_core *core)
 {
 	const struct venus_resources *res = core->res;
-	const struct freq_tbl *freq_tbl = core->res->freq_tbl;
-	unsigned int freq_tbl_size = core->res->freq_tbl_size;
-	unsigned long freq;
+	struct dev_pm_opp *opp;
+	unsigned long freq = 0;
 	unsigned int i;
 	int ret;
 
-	if (!freq_tbl)
-		return -EINVAL;
+	if (core->has_opp_table) {
+		opp = dev_pm_opp_find_freq_ceil(core->dev, &freq);
+		if (IS_ERR(opp))
+			return PTR_ERR(opp);
+		dev_pm_opp_put(opp);
 
-	freq = freq_tbl[freq_tbl_size - 1].freq;
+		ret = dev_pm_opp_set_rate(core->dev, freq);
+		if (ret)
+			return ret;
+	}
 
 	for (i = 0; i < res->clks_num; i++) {
-		if (IS_V6(core)) {
-			ret = clk_set_rate(core->clks[i], freq);
-			if (ret)
-				goto err;
-		}
-
 		ret = clk_prepare_enable(core->clks[i]);
 		if (ret)
 			goto err;

-- 
2.42.0


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

* [PATCH RFT 02/20] media: venus: pm_helpers: Rename core_clks_get to venus_clks_get
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 01/20] media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 03/20] media: venus: pm_helpers: Add kerneldoc to venus_clks_get() Konrad Dybcio
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

"core" is used in multiple contexts when talking about Venus, rename
the function to save on confusion.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 2bd9c63d0253..e2aec0b46126 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -23,7 +23,7 @@
 
 static bool legacy_binding;
 
-static int core_clks_get(struct venus_core *core)
+static int venus_clks_get(struct venus_core *core)
 {
 	const struct venus_resources *res = core->res;
 	struct device *dev = core->dev;
@@ -294,7 +294,7 @@ static int core_get_v1(struct venus_core *core)
 {
 	int ret;
 
-	ret = core_clks_get(core);
+	ret = venus_clks_get(core);
 	if (ret)
 		return ret;
 
@@ -978,7 +978,7 @@ static int core_get_v4(struct venus_core *core)
 	const struct venus_resources *res = core->res;
 	int ret;
 
-	ret = core_clks_get(core);
+	ret = venus_clks_get(core);
 	if (ret)
 		return ret;
 

-- 
2.42.0


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

* [PATCH RFT 03/20] media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 01/20] media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 02/20] media: venus: pm_helpers: Rename core_clks_get to venus_clks_get Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 04/20] media: venus: core: Set OPP clkname in a common code path Konrad Dybcio
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

To make it easier to understand the various clock requirements within
this driver, add kerneldoc to venus_clk_get() explaining the fluff.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 28 ++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index e2aec0b46126..59e3eaad97ed 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -23,6 +23,34 @@
 
 static bool legacy_binding;
 
+/**
+ * venus_clks_get() - Get Venus clocks that are not bound to a vcodec
+ * @core: A pointer to the venus core resource
+ *
+ * The Venus block (depending on the generation) can be split into a couple
+ * of clock domains: one for "main logic" and one for each video core (0-2pcs).
+ *
+ * MSM8916 (and possibly other HFIv1 users) only feature the "main logic"
+ * domain, so this function is the only kind if clk_get necessary there.
+ *
+ * MSM8996 (and other HFIv3 users) feature two video cores, with core0 being
+ * statically proclaimed a decoder and core1 an encoder, with both having
+ * their own clock domains.
+ *
+ * SDM845 features two video cores, each one of which may or may not be
+ * subdivided into 2 enc/dec threads.
+ *
+ * Other SoCs either feature a single video core (with its own clock domain)
+ * or 1 video core and 1 CVP (Computer Vision Processor) core. In both cases
+ * we treat it the same (CVP only happens to live near-by Venus on the SoC).
+ *
+ * Due to unfortunate developments in the past, we have to support bindings
+ * (MSM8996, SDM660, SDM845) that require specifying the clocks and
+ * power-domains associated with a video core domain in a bogus subnode,
+ * which means that additional fluff is necessary..
+ *
+ * Return: 0 on success, negative errno on failure.
+ */
 static int venus_clks_get(struct venus_core *core)
 {
 	const struct venus_resources *res = core->res;

-- 
2.42.0


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

* [PATCH RFT 04/20] media: venus: core: Set OPP clkname in a common code path
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (2 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 03/20] media: venus: pm_helpers: Add kerneldoc to venus_clks_get() Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 05/20] media: venus: pm_helpers: Kill dead code Konrad Dybcio
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

Calling devm_pm_opp_set_clkname() is repeated for all HFI versions in
pm_ops->core_power.

Move it to the common codepath.

This also lets us get rid of core_get_v1.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c       |  5 +++++
 drivers/media/platform/qcom/venus/pm_helpers.c | 23 ++---------------------
 2 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 054b8e74ba4f..f32b20c3a565 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -14,6 +14,7 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
+#include <linux/pm_opp.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/pm_runtime.h>
@@ -317,6 +318,10 @@ static int venus_probe(struct platform_device *pdev)
 	if (!core->pm_ops)
 		return -ENODEV;
 
+	ret = devm_pm_opp_set_clkname(dev, "core");
+	if (ret)
+		return ret;
+
 	if (core->pm_ops->core_get) {
 		ret = core->pm_ops->core_get(core);
 		if (ret)
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 59e3eaad97ed..9bedb3bc7223 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -318,21 +318,6 @@ static int load_scale_v1(struct venus_inst *inst)
 	return ret;
 }
 
-static int core_get_v1(struct venus_core *core)
-{
-	int ret;
-
-	ret = venus_clks_get(core);
-	if (ret)
-		return ret;
-
-	ret = devm_pm_opp_set_clkname(core->dev, "core");
-	if (ret)
-		return ret;
-
-	return 0;
-}
-
 static void core_put_v1(struct venus_core *core)
 {
 }
@@ -350,7 +335,7 @@ static int core_power_v1(struct venus_core *core, int on)
 }
 
 static const struct venus_pm_ops pm_ops_v1 = {
-	.core_get = core_get_v1,
+	.core_get = venus_clks_get,
 	.core_put = core_put_v1,
 	.core_power = core_power_v1,
 	.load_scale = load_scale_v1,
@@ -423,7 +408,7 @@ static int venc_power_v3(struct device *dev, int on)
 }
 
 static const struct venus_pm_ops pm_ops_v3 = {
-	.core_get = core_get_v1,
+	.core_get = venus_clks_get,
 	.core_put = core_put_v1,
 	.core_power = core_power_v1,
 	.vdec_get = vdec_get_v3,
@@ -1030,10 +1015,6 @@ static int core_get_v4(struct venus_core *core)
 	if (legacy_binding)
 		return 0;
 
-	ret = devm_pm_opp_set_clkname(dev, "core");
-	if (ret)
-		return ret;
-
 	ret = vcodec_domains_get(core);
 	if (ret)
 		return ret;

-- 
2.42.0


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

* [PATCH RFT 05/20] media: venus: pm_helpers: Kill dead code
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (3 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 04/20] media: venus: core: Set OPP clkname in a common code path Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 06/20] media: venus: pm_helpers: Move reset acquisition to common code Konrad Dybcio
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

A situation like:

if (!foo)
	goto bar;

for (i = 0; i < foo; i++)
	...1...

bar:
	...2...

is totally identical to:

for (i = 0; i < 0; i++) // === if (0)
	...1...

...2...

Get rid of such boilerplate.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 9bedb3bc7223..f5130aa3ddfc 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -875,9 +875,6 @@ static int vcodec_domains_get(struct venus_core *core)
 	struct device *pd;
 	unsigned int i;
 
-	if (!res->vcodec_pmdomains_num)
-		goto skip_pmdomains;
-
 	for (i = 0; i < res->vcodec_pmdomains_num; i++) {
 		pd = dev_pm_domain_attach_by_name(dev,
 						  res->vcodec_pmdomains[i]);
@@ -886,7 +883,6 @@ static int vcodec_domains_get(struct venus_core *core)
 		core->pmdomains[i] = pd;
 	}
 
-skip_pmdomains:
 	if (!core->res->opp_pmdomain)
 		return 0;
 
@@ -922,16 +918,12 @@ static void vcodec_domains_put(struct venus_core *core)
 	const struct venus_resources *res = core->res;
 	unsigned int i;
 
-	if (!res->vcodec_pmdomains_num)
-		goto skip_pmdomains;
-
 	for (i = 0; i < res->vcodec_pmdomains_num; i++) {
 		if (IS_ERR_OR_NULL(core->pmdomains[i]))
 			continue;
 		dev_pm_domain_detach(core->pmdomains[i], true);
 	}
 
-skip_pmdomains:
 	if (!core->has_opp_table)
 		return;
 
@@ -945,9 +937,6 @@ static int core_resets_reset(struct venus_core *core)
 	unsigned int i;
 	int ret;
 
-	if (!res->resets_num)
-		return 0;
-
 	for (i = 0; i < res->resets_num; i++) {
 		ret = reset_control_assert(core->resets[i]);
 		if (ret)
@@ -970,9 +959,6 @@ static int core_resets_get(struct venus_core *core)
 	unsigned int i;
 	int ret;
 
-	if (!res->resets_num)
-		return 0;
-
 	for (i = 0; i < res->resets_num; i++) {
 		core->resets[i] =
 			devm_reset_control_get_exclusive(dev, res->resets[i]);

-- 
2.42.0


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

* [PATCH RFT 06/20] media: venus: pm_helpers: Move reset acquisition to common code
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (4 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 05/20] media: venus: pm_helpers: Kill dead code Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 07/20] media: venus: pm_helpers: Use reset_bulk API Konrad Dybcio
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

There is no reason to keep reset_get code local to HFIv4/v6.

Move it to the common part.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c       |  9 ++++++++-
 drivers/media/platform/qcom/venus/pm_helpers.c | 23 -----------------------
 2 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index f32b20c3a565..2445a814b39f 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -15,6 +15,7 @@
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
+#include <linux/reset.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/pm_runtime.h>
@@ -284,7 +285,7 @@ static int venus_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct venus_core *core;
-	int ret;
+	int i, ret;
 
 	core = devm_kzalloc(dev, sizeof(*core), GFP_KERNEL);
 	if (!core)
@@ -322,6 +323,12 @@ static int venus_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	for (i = 0; i < core->res->resets_num; i++) {
+		core->resets[i] = devm_reset_control_get_exclusive(dev, core->res->resets[i]);
+		if (IS_ERR(core->resets[i]))
+			return PTR_ERR(core->resets[i]);
+	}
+
 	if (core->pm_ops->core_get) {
 		ret = core->pm_ops->core_get(core);
 		if (ret)
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index f5130aa3ddfc..0e04da8d7eb5 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -952,25 +952,6 @@ static int core_resets_reset(struct venus_core *core)
 	return ret;
 }
 
-static int core_resets_get(struct venus_core *core)
-{
-	struct device *dev = core->dev;
-	const struct venus_resources *res = core->res;
-	unsigned int i;
-	int ret;
-
-	for (i = 0; i < res->resets_num; i++) {
-		core->resets[i] =
-			devm_reset_control_get_exclusive(dev, res->resets[i]);
-		if (IS_ERR(core->resets[i])) {
-			ret = PTR_ERR(core->resets[i]);
-			return ret;
-		}
-	}
-
-	return 0;
-}
-
 static int core_get_v4(struct venus_core *core)
 {
 	struct device *dev = core->dev;
@@ -994,10 +975,6 @@ static int core_get_v4(struct venus_core *core)
 	if (ret)
 		return ret;
 
-	ret = core_resets_get(core);
-	if (ret)
-		return ret;
-
 	if (legacy_binding)
 		return 0;
 

-- 
2.42.0


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

* [PATCH RFT 07/20] media: venus: pm_helpers: Use reset_bulk API
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (5 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 06/20] media: venus: pm_helpers: Move reset acquisition to common code Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 08/20] media: venus: core: Constify all members of the resource struct Konrad Dybcio
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

All of the resets are toggled together. Use the bulk api to save on some
code complexity.

Note, this change is not exactly a NOP. Instead of waiting 150-250us
between each reset toggle, the behavior now is to assert all the resets,
wait 150-250us and deassert all the resets. This should be fine, but the
logic here is really abusive, as such assertion requirements should be
expressed per-reset_control, in the provider driver.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c       | 15 ++++++++++-----
 drivers/media/platform/qcom/venus/core.h       |  4 ++--
 drivers/media/platform/qcom/venus/pm_helpers.c | 17 +++++------------
 3 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 2445a814b39f..be633e62263c 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -323,11 +323,16 @@ static int venus_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	for (i = 0; i < core->res->resets_num; i++) {
-		core->resets[i] = devm_reset_control_get_exclusive(dev, core->res->resets[i]);
-		if (IS_ERR(core->resets[i]))
-			return PTR_ERR(core->resets[i]);
-	}
+	core->resets = devm_kcalloc(dev, core->res->resets_num, sizeof(*core->resets), GFP_KERNEL);
+	if (core->res->resets_num && !core->resets)
+		return -ENOMEM;
+
+	for (i = 0; i < core->res->resets_num; i++)
+		core->resets[i].id = core->res->resets[i];
+
+	ret = devm_reset_control_bulk_get_exclusive(dev, core->res->resets_num, core->resets);
+	if (ret)
+		return ret;
 
 	if (core->pm_ops->core_get) {
 		ret = core->pm_ops->core_get(core);
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 4a633261ece4..515e7d78b7ab 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -137,7 +137,7 @@ struct venus_format {
  * @pmdomains:	an array of pmdomains struct device pointers
  * @opp_dl_venus: an device-link for device OPP
  * @opp_pmdomain: an OPP power-domain
- * @resets: an array of reset signals
+ * @resets: a reset_control_bulk_data array of hardware reset signals
  * @vdev_dec:	a reference to video device structure for decoder instances
  * @vdev_enc:	a reference to video device structure for encoder instances
  * @v4l2_dev:	a holder for v4l2 device structure
@@ -190,7 +190,7 @@ struct venus_core {
 	struct device *pmdomains[VIDC_PMDOMAINS_NUM_MAX];
 	struct device_link *opp_dl_venus;
 	struct device *opp_pmdomain;
-	struct reset_control *resets[VIDC_RESETS_NUM_MAX];
+	struct reset_control_bulk_data *resets;
 	struct video_device *vdev_dec;
 	struct video_device *vdev_enc;
 	struct v4l2_device v4l2_dev;
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 0e04da8d7eb5..7f22a078b38a 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -934,22 +934,15 @@ static void vcodec_domains_put(struct venus_core *core)
 static int core_resets_reset(struct venus_core *core)
 {
 	const struct venus_resources *res = core->res;
-	unsigned int i;
 	int ret;
 
-	for (i = 0; i < res->resets_num; i++) {
-		ret = reset_control_assert(core->resets[i]);
-		if (ret)
-			goto err;
+	ret = reset_control_bulk_assert(res->resets_num, core->resets);
+	if (ret)
+		return ret;
 
-		usleep_range(150, 250);
-		ret = reset_control_deassert(core->resets[i]);
-		if (ret)
-			goto err;
-	}
+	usleep_range(150, 250);
 
-err:
-	return ret;
+	return reset_control_bulk_deassert(res->resets_num, core->resets);
 }
 
 static int core_get_v4(struct venus_core *core)

-- 
2.42.0


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

* [PATCH RFT 08/20] media: venus: core: Constify all members of the resource struct
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (6 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 07/20] media: venus: pm_helpers: Use reset_bulk API Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 09/20] media: venus: core: Deduplicate OPP genpd names Konrad Dybcio
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

Nothing inside the resource struct needs to be mutable. Sprinkle
'const' all over it. A lot of 'const'.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.h | 56 ++++++++++++++++----------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 515e7d78b7ab..9a38d568117a 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -57,39 +57,39 @@ enum vpu_version {
 };
 
 struct venus_resources {
-	u64 dma_mask;
-	const struct freq_tbl *freq_tbl;
-	unsigned int freq_tbl_size;
-	const struct bw_tbl *bw_tbl_enc;
-	unsigned int bw_tbl_enc_size;
-	const struct bw_tbl *bw_tbl_dec;
-	unsigned int bw_tbl_dec_size;
-	const struct reg_val *reg_tbl;
-	unsigned int reg_tbl_size;
-	const struct hfi_ubwc_config *ubwc_conf;
+	const u64 dma_mask;
+	const struct freq_tbl * const freq_tbl;
+	const unsigned int freq_tbl_size;
+	const struct bw_tbl * const bw_tbl_enc;
+	const unsigned int bw_tbl_enc_size;
+	const struct bw_tbl * const bw_tbl_dec;
+	const unsigned int bw_tbl_dec_size;
+	const struct reg_val * const reg_tbl;
+	const unsigned int reg_tbl_size;
+	const struct hfi_ubwc_config * const ubwc_conf;
 	const char * const clks[VIDC_CLKS_NUM_MAX];
-	unsigned int clks_num;
+	const unsigned int clks_num;
 	const char * const vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX];
 	const char * const vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX];
-	unsigned int vcodec_clks_num;
+	const unsigned int vcodec_clks_num;
 	const char * const vcodec_pmdomains[VIDC_PMDOMAINS_NUM_MAX];
-	unsigned int vcodec_pmdomains_num;
-	const char **opp_pmdomain;
-	unsigned int vcodec_num;
+	const unsigned int vcodec_pmdomains_num;
+	const char * const * const opp_pmdomain;
+	const unsigned int vcodec_num;
 	const char * const resets[VIDC_RESETS_NUM_MAX];
-	unsigned int resets_num;
-	enum hfi_version hfi_version;
-	enum vpu_version vpu_version;
-	u8 num_vpp_pipes;
-	u32 max_load;
-	unsigned int vmem_id;
-	u32 vmem_size;
-	u32 vmem_addr;
-	u32 cp_start;
-	u32 cp_size;
-	u32 cp_nonpixel_start;
-	u32 cp_nonpixel_size;
-	const char *fwname;
+	const unsigned int resets_num;
+	const enum hfi_version hfi_version;
+	const enum vpu_version vpu_version;
+	const u8 num_vpp_pipes;
+	const u32 max_load;
+	const unsigned int vmem_id;
+	const u32 vmem_size;
+	const u32 vmem_addr;
+	const u32 cp_start;
+	const u32 cp_size;
+	const u32 cp_nonpixel_start;
+	const u32 cp_nonpixel_size;
+	const char * const fwname;
 };
 
 enum venus_fmt {

-- 
2.42.0


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

* [PATCH RFT 09/20] media: venus: core: Deduplicate OPP genpd names
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (7 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 08/20] media: venus: core: Constify all members of the resource struct Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 10/20] media: venus: core: Get rid of vcodec_num Konrad Dybcio
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

Instead of redefining the same literals over and over again, define
them once and point the reference to that definition.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index be633e62263c..8aac7f60fc81 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -541,6 +541,9 @@ static const struct dev_pm_ops venus_pm_ops = {
 	SET_RUNTIME_PM_OPS(venus_runtime_suspend, venus_runtime_resume, NULL)
 };
 
+static const char * const pd_names_cx[] = { "cx", NULL };
+static const char * const pd_names_mx[] = { "mx", NULL };
+
 static const struct freq_tbl msm8916_freq_table[] = {
 	{ 352800, 228570000 },	/* 1920x1088 @ 30 + 1280x720 @ 30 */
 	{ 244800, 160000000 },	/* 1920x1088 @ 30 */
@@ -724,7 +727,7 @@ static const struct venus_resources sdm845_res_v2 = {
 	.vcodec_clks_num = 2,
 	.vcodec_pmdomains = { "venus", "vcodec0", "vcodec1" },
 	.vcodec_pmdomains_num = 3,
-	.opp_pmdomain = (const char *[]) { "cx", NULL },
+	.opp_pmdomain = pd_names_cx,
 	.vcodec_num = 2,
 	.max_load = 3110400,	/* 4096x2160@90 */
 	.hfi_version = HFI_VERSION_4XX,
@@ -773,7 +776,7 @@ static const struct venus_resources sc7180_res = {
 	.vcodec_clks_num = 2,
 	.vcodec_pmdomains = { "venus", "vcodec0" },
 	.vcodec_pmdomains_num = 2,
-	.opp_pmdomain = (const char *[]) { "cx", NULL },
+	.opp_pmdomain = pd_names_cx,
 	.vcodec_num = 1,
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
@@ -830,7 +833,7 @@ static const struct venus_resources sm8250_res = {
 	.vcodec_clks_num = 1,
 	.vcodec_pmdomains = { "venus", "vcodec0" },
 	.vcodec_pmdomains_num = 2,
-	.opp_pmdomain = (const char *[]) { "mx", NULL },
+	.opp_pmdomain = pd_names_mx,
 	.vcodec_num = 1,
 	.max_load = 7833600,
 	.hfi_version = HFI_VERSION_6XX,
@@ -889,7 +892,7 @@ static const struct venus_resources sc7280_res = {
 	.vcodec_clks_num = 2,
 	.vcodec_pmdomains = { "venus", "vcodec0" },
 	.vcodec_pmdomains_num = 2,
-	.opp_pmdomain = (const char *[]) { "cx", NULL },
+	.opp_pmdomain = pd_names_cx,
 	.vcodec_num = 1,
 	.hfi_version = HFI_VERSION_6XX,
 	.vpu_version = VPU_VERSION_IRIS2_1,

-- 
2.42.0


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

* [PATCH RFT 10/20] media: venus: core: Get rid of vcodec_num
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (8 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 09/20] media: venus: core: Deduplicate OPP genpd names Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 11/20] media: venus: core: Drop cache properties in resource struct Konrad Dybcio
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

That field was only introduced to differentiate between the legacy and
non-legacy SDM845 binding. Get rid of it.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c       | 5 -----
 drivers/media/platform/qcom/venus/core.h       | 1 -
 drivers/media/platform/qcom/venus/pm_helpers.c | 2 +-
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 8aac7f60fc81..e83c790ccc80 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -654,7 +654,6 @@ static const struct venus_resources sdm660_res = {
 	.vcodec0_clks = { "vcodec0_core" },
 	.vcodec1_clks = { "vcodec0_core" },
 	.vcodec_clks_num = 1,
-	.vcodec_num = 1,
 	.max_load = 1036800,
 	.hfi_version = HFI_VERSION_3XX,
 	.vmem_id = VIDC_RESOURCE_NONE,
@@ -728,7 +727,6 @@ static const struct venus_resources sdm845_res_v2 = {
 	.vcodec_pmdomains = { "venus", "vcodec0", "vcodec1" },
 	.vcodec_pmdomains_num = 3,
 	.opp_pmdomain = pd_names_cx,
-	.vcodec_num = 2,
 	.max_load = 3110400,	/* 4096x2160@90 */
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
@@ -777,7 +775,6 @@ static const struct venus_resources sc7180_res = {
 	.vcodec_pmdomains = { "venus", "vcodec0" },
 	.vcodec_pmdomains_num = 2,
 	.opp_pmdomain = pd_names_cx,
-	.vcodec_num = 1,
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
 	.vmem_id = VIDC_RESOURCE_NONE,
@@ -834,7 +831,6 @@ static const struct venus_resources sm8250_res = {
 	.vcodec_pmdomains = { "venus", "vcodec0" },
 	.vcodec_pmdomains_num = 2,
 	.opp_pmdomain = pd_names_mx,
-	.vcodec_num = 1,
 	.max_load = 7833600,
 	.hfi_version = HFI_VERSION_6XX,
 	.vpu_version = VPU_VERSION_IRIS2,
@@ -893,7 +889,6 @@ static const struct venus_resources sc7280_res = {
 	.vcodec_pmdomains = { "venus", "vcodec0" },
 	.vcodec_pmdomains_num = 2,
 	.opp_pmdomain = pd_names_cx,
-	.vcodec_num = 1,
 	.hfi_version = HFI_VERSION_6XX,
 	.vpu_version = VPU_VERSION_IRIS2_1,
 	.num_vpp_pipes = 1,
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 9a38d568117a..de180f8e7973 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -75,7 +75,6 @@ struct venus_resources {
 	const char * const vcodec_pmdomains[VIDC_PMDOMAINS_NUM_MAX];
 	const unsigned int vcodec_pmdomains_num;
 	const char * const * const opp_pmdomain;
-	const unsigned int vcodec_num;
 	const char * const resets[VIDC_RESETS_NUM_MAX];
 	const unsigned int resets_num;
 	const enum hfi_version hfi_version;
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 7f22a078b38a..816d16f9153a 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -622,7 +622,7 @@ min_loaded_core(struct venus_inst *inst, u32 *min_coreid, u32 *min_load, bool lo
 			VIDC_CORE_ID_1 : VIDC_CORE_ID_2;
 	*min_load = min(core1_load, core2_load);
 
-	if (cores_max < VIDC_CORE_ID_2 || core->res->vcodec_num < 2) {
+	if (cores_max < VIDC_CORE_ID_2 || legacy_binding) {
 		*min_coreid = VIDC_CORE_ID_1;
 		*min_load = core1_load;
 	}

-- 
2.42.0


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

* [PATCH RFT 11/20] media: venus: core: Drop cache properties in resource struct
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (9 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 10/20] media: venus: core: Get rid of vcodec_num Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 23:53   ` kernel test robot
  2023-09-11 15:10 ` [PATCH RFT 12/20] media: venus: core: Use GENMASK for dma_mask Konrad Dybcio
                   ` (10 subsequent siblings)
  21 siblings, 1 reply; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

Currently VMEM/OCMEM/LLCC is disabled on all platforms.

Make it unconditional to save on space.

These caches will not be enabled until the Venus driver can reference
them as chunks of SRAM (they're modelled as separate devices) to avoid
hardcoding magic addresses and rougely accessing the hardware,
bypassing the normal accessors.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c      | 24 ------------------------
 drivers/media/platform/qcom/venus/core.h      |  3 ---
 drivers/media/platform/qcom/venus/hfi_venus.c |  7 ++++---
 3 files changed, 4 insertions(+), 30 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index e83c790ccc80..5d4d62751357 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -565,9 +565,6 @@ static const struct venus_resources msm8916_res = {
 	.clks_num = 3,
 	.max_load = 352800, /* 720p@30 + 1080p@30 */
 	.hfi_version = HFI_VERSION_1XX,
-	.vmem_id = VIDC_RESOURCE_NONE,
-	.vmem_size = 0,
-	.vmem_addr = 0,
 	.dma_mask = 0xddc00000 - 1,
 	.fwname = "qcom/venus-1.8/venus.mdt",
 };
@@ -598,9 +595,6 @@ static const struct venus_resources msm8996_res = {
 	.vcodec_clks_num = 1,
 	.max_load = 2563200,
 	.hfi_version = HFI_VERSION_3XX,
-	.vmem_id = VIDC_RESOURCE_NONE,
-	.vmem_size = 0,
-	.vmem_addr = 0,
 	.dma_mask = 0xddc00000 - 1,
 	.fwname = "qcom/venus-4.2/venus.mdt",
 };
@@ -656,9 +650,6 @@ static const struct venus_resources sdm660_res = {
 	.vcodec_clks_num = 1,
 	.max_load = 1036800,
 	.hfi_version = HFI_VERSION_3XX,
-	.vmem_id = VIDC_RESOURCE_NONE,
-	.vmem_size = 0,
-	.vmem_addr = 0,
 	.cp_start = 0,
 	.cp_size = 0x79000000,
 	.cp_nonpixel_start = 0x1000000,
@@ -705,9 +696,6 @@ static const struct venus_resources sdm845_res = {
 	.max_load = 3110400,	/* 4096x2160@90 */
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
-	.vmem_id = VIDC_RESOURCE_NONE,
-	.vmem_size = 0,
-	.vmem_addr = 0,
 	.dma_mask = 0xe0000000 - 1,
 	.fwname = "qcom/venus-5.2/venus.mdt",
 };
@@ -730,9 +718,6 @@ static const struct venus_resources sdm845_res_v2 = {
 	.max_load = 3110400,	/* 4096x2160@90 */
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
-	.vmem_id = VIDC_RESOURCE_NONE,
-	.vmem_size = 0,
-	.vmem_addr = 0,
 	.dma_mask = 0xe0000000 - 1,
 	.cp_start = 0,
 	.cp_size = 0x70800000,
@@ -777,9 +762,6 @@ static const struct venus_resources sc7180_res = {
 	.opp_pmdomain = pd_names_cx,
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
-	.vmem_id = VIDC_RESOURCE_NONE,
-	.vmem_size = 0,
-	.vmem_addr = 0,
 	.dma_mask = 0xe0000000 - 1,
 	.cp_start = 0,
 	.cp_size = 0x70800000,
@@ -835,9 +817,6 @@ static const struct venus_resources sm8250_res = {
 	.hfi_version = HFI_VERSION_6XX,
 	.vpu_version = VPU_VERSION_IRIS2,
 	.num_vpp_pipes = 4,
-	.vmem_id = VIDC_RESOURCE_NONE,
-	.vmem_size = 0,
-	.vmem_addr = 0,
 	.dma_mask = 0xe0000000 - 1,
 	.fwname = "qcom/vpu-1.0/venus.mbn",
 };
@@ -892,9 +871,6 @@ static const struct venus_resources sc7280_res = {
 	.hfi_version = HFI_VERSION_6XX,
 	.vpu_version = VPU_VERSION_IRIS2_1,
 	.num_vpp_pipes = 1,
-	.vmem_id = VIDC_RESOURCE_NONE,
-	.vmem_size = 0,
-	.vmem_addr = 0,
 	.dma_mask = 0xe0000000 - 1,
 	.fwname = "qcom/vpu-2.0/venus.mbn",
 };
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index de180f8e7973..fe4cb566d8e9 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -81,9 +81,6 @@ struct venus_resources {
 	const enum vpu_version vpu_version;
 	const u8 num_vpp_pipes;
 	const u32 max_load;
-	const unsigned int vmem_id;
-	const u32 vmem_size;
-	const u32 vmem_addr;
 	const u32 cp_start;
 	const u32 cp_size;
 	const u32 cp_nonpixel_start;
diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c
index 19fc6575a489..e6db820a1d5e 100644
--- a/drivers/media/platform/qcom/venus/hfi_venus.c
+++ b/drivers/media/platform/qcom/venus/hfi_venus.c
@@ -1075,9 +1075,10 @@ static irqreturn_t venus_isr_thread(struct venus_core *core)
 			venus_process_msg_sys_error(hdev, pkt);
 			break;
 		case HFI_MSG_SYS_INIT:
-			venus_hfi_core_set_resource(core, res->vmem_id,
-						    res->vmem_size,
-						    res->vmem_addr,
+			/* Disable OCMEM/VMEM unconditionally until support is added */
+			venus_hfi_core_set_resource(core, VIDC_RESOURCE_NONE,
+						    0,
+						    0,
 						    hdev);
 			break;
 		case HFI_MSG_SYS_RELEASE_RESOURCE:

-- 
2.42.0


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

* [PATCH RFT 12/20] media: venus: core: Use GENMASK for dma_mask
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (10 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 11/20] media: venus: core: Drop cache properties in resource struct Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 13/20] media: venus: core: Remove cp_start Konrad Dybcio
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

The raw literals mean very little. Substitute it with more telling
bitops macros.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 5d4d62751357..4dec10d21b05 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -565,7 +565,7 @@ static const struct venus_resources msm8916_res = {
 	.clks_num = 3,
 	.max_load = 352800, /* 720p@30 + 1080p@30 */
 	.hfi_version = HFI_VERSION_1XX,
-	.dma_mask = 0xddc00000 - 1,
+	.dma_mask = (GENMASK(31, 30) | GENMASK(28, 26) | GENMASK(24, 22)) - 1,
 	.fwname = "qcom/venus-1.8/venus.mdt",
 };
 
@@ -595,7 +595,7 @@ static const struct venus_resources msm8996_res = {
 	.vcodec_clks_num = 1,
 	.max_load = 2563200,
 	.hfi_version = HFI_VERSION_3XX,
-	.dma_mask = 0xddc00000 - 1,
+	.dma_mask = (GENMASK(31, 30) | GENMASK(28, 26) | GENMASK(24, 22)) - 1,
 	.fwname = "qcom/venus-4.2/venus.mdt",
 };
 
@@ -696,7 +696,7 @@ static const struct venus_resources sdm845_res = {
 	.max_load = 3110400,	/* 4096x2160@90 */
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
-	.dma_mask = 0xe0000000 - 1,
+	.dma_mask = GENMASK(31, 29) - 1,
 	.fwname = "qcom/venus-5.2/venus.mdt",
 };
 
@@ -718,7 +718,7 @@ static const struct venus_resources sdm845_res_v2 = {
 	.max_load = 3110400,	/* 4096x2160@90 */
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
-	.dma_mask = 0xe0000000 - 1,
+	.dma_mask = GENMASK(31, 29) - 1,
 	.cp_start = 0,
 	.cp_size = 0x70800000,
 	.cp_nonpixel_start = 0x1000000,
@@ -762,7 +762,7 @@ static const struct venus_resources sc7180_res = {
 	.opp_pmdomain = pd_names_cx,
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
-	.dma_mask = 0xe0000000 - 1,
+	.dma_mask = GENMASK(31, 29) - 1,
 	.cp_start = 0,
 	.cp_size = 0x70800000,
 	.cp_nonpixel_start = 0x1000000,
@@ -817,7 +817,7 @@ static const struct venus_resources sm8250_res = {
 	.hfi_version = HFI_VERSION_6XX,
 	.vpu_version = VPU_VERSION_IRIS2,
 	.num_vpp_pipes = 4,
-	.dma_mask = 0xe0000000 - 1,
+	.dma_mask = GENMASK(31, 29) - 1,
 	.fwname = "qcom/vpu-1.0/venus.mbn",
 };
 
@@ -871,7 +871,7 @@ static const struct venus_resources sc7280_res = {
 	.hfi_version = HFI_VERSION_6XX,
 	.vpu_version = VPU_VERSION_IRIS2_1,
 	.num_vpp_pipes = 1,
-	.dma_mask = 0xe0000000 - 1,
+	.dma_mask = GENMASK(31, 29) - 1,
 	.fwname = "qcom/vpu-2.0/venus.mbn",
 };
 

-- 
2.42.0


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

* [PATCH RFT 13/20] media: venus: core: Remove cp_start
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (11 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 12/20] media: venus: core: Use GENMASK for dma_mask Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 14/20] media: venus: pm_helpers: Commonize core_power Konrad Dybcio
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

It's hardcoded to be zero. Always. Ever since msm-3.10. Or maybe
even before. Remove it!

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c     | 3 ---
 drivers/media/platform/qcom/venus/core.h     | 1 -
 drivers/media/platform/qcom/venus/firmware.c | 3 +--
 3 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 4dec10d21b05..bd624e965a92 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -650,7 +650,6 @@ static const struct venus_resources sdm660_res = {
 	.vcodec_clks_num = 1,
 	.max_load = 1036800,
 	.hfi_version = HFI_VERSION_3XX,
-	.cp_start = 0,
 	.cp_size = 0x79000000,
 	.cp_nonpixel_start = 0x1000000,
 	.cp_nonpixel_size = 0x28000000,
@@ -719,7 +718,6 @@ static const struct venus_resources sdm845_res_v2 = {
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
 	.dma_mask = GENMASK(31, 29) - 1,
-	.cp_start = 0,
 	.cp_size = 0x70800000,
 	.cp_nonpixel_start = 0x1000000,
 	.cp_nonpixel_size = 0x24800000,
@@ -763,7 +761,6 @@ static const struct venus_resources sc7180_res = {
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
 	.dma_mask = GENMASK(31, 29) - 1,
-	.cp_start = 0,
 	.cp_size = 0x70800000,
 	.cp_nonpixel_start = 0x1000000,
 	.cp_nonpixel_size = 0x24800000,
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index fe4cb566d8e9..16acf738fd6c 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -81,7 +81,6 @@ struct venus_resources {
 	const enum vpu_version vpu_version;
 	const u8 num_vpp_pipes;
 	const u32 max_load;
-	const u32 cp_start;
 	const u32 cp_size;
 	const u32 cp_nonpixel_start;
 	const u32 cp_nonpixel_size;
diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
index fe7da2b30482..16e578780be7 100644
--- a/drivers/media/platform/qcom/venus/firmware.c
+++ b/drivers/media/platform/qcom/venus/firmware.c
@@ -245,7 +245,6 @@ int venus_boot(struct venus_core *core)
 	if (core->use_tz && res->cp_size) {
 		/*
 		 * Clues for porting using downstream data:
-		 * cp_start = 0
 		 * cp_size = venus_ns/virtual-addr-pool[0] - yes, address and not size!
 		 *   This works, as the non-secure context bank is placed
 		 *   contiguously right after the Content Protection region.
@@ -253,7 +252,7 @@ int venus_boot(struct venus_core *core)
 		 * cp_nonpixel_start = venus_sec_non_pixel/virtual-addr-pool[0]
 		 * cp_nonpixel_size = venus_sec_non_pixel/virtual-addr-pool[1]
 		 */
-		ret = qcom_scm_mem_protect_video_var(res->cp_start,
+		ret = qcom_scm_mem_protect_video_var(0,
 						     res->cp_size,
 						     res->cp_nonpixel_start,
 						     res->cp_nonpixel_size);

-- 
2.42.0


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

* [PATCH RFT 14/20] media: venus: pm_helpers: Commonize core_power
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (12 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 13/20] media: venus: core: Remove cp_start Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 15/20] media: venus: pm_helpers: Remove pm_ops->core_put Konrad Dybcio
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

core_power_v4 called with num_resets = 0 and core->pmdomains[0] == NULL
does exactly the same thing as core_power_v1. Unify them!

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c       | 21 +++++++--------------
 drivers/media/platform/qcom/venus/pm_helpers.c | 17 +----------------
 drivers/media/platform/qcom/venus/pm_helpers.h |  2 +-
 3 files changed, 9 insertions(+), 31 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index bd624e965a92..0ae118257296 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -480,18 +480,15 @@ static void venus_core_shutdown(struct platform_device *pdev)
 static __maybe_unused int venus_runtime_suspend(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
-	const struct venus_pm_ops *pm_ops = core->pm_ops;
 	int ret;
 
 	ret = hfi_core_suspend(core);
 	if (ret)
 		return ret;
 
-	if (pm_ops->core_power) {
-		ret = pm_ops->core_power(core, POWER_OFF);
-		if (ret)
-			return ret;
-	}
+	ret = venus_core_power(core, POWER_OFF);
+	if (ret)
+		return ret;
 
 	ret = icc_set_bw(core->cpucfg_path, 0, 0);
 	if (ret)
@@ -506,8 +503,7 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
 err_video_path:
 	icc_set_bw(core->cpucfg_path, kbps_to_icc(1000), 0);
 err_cpucfg_path:
-	if (pm_ops->core_power)
-		pm_ops->core_power(core, POWER_ON);
+	venus_core_power(core, POWER_ON);
 
 	return ret;
 }
@@ -515,7 +511,6 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
 static __maybe_unused int venus_runtime_resume(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
-	const struct venus_pm_ops *pm_ops = core->pm_ops;
 	int ret;
 
 	ret = icc_set_bw(core->video_path, kbps_to_icc(20000), 0);
@@ -526,11 +521,9 @@ static __maybe_unused int venus_runtime_resume(struct device *dev)
 	if (ret)
 		return ret;
 
-	if (pm_ops->core_power) {
-		ret = pm_ops->core_power(core, POWER_ON);
-		if (ret)
-			return ret;
-	}
+	ret = venus_core_power(core, POWER_ON);
+	if (ret)
+		return ret;
 
 	return hfi_core_resume(core, false);
 }
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 816d16f9153a..ddaa9944fa44 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -322,22 +322,9 @@ static void core_put_v1(struct venus_core *core)
 {
 }
 
-static int core_power_v1(struct venus_core *core, int on)
-{
-	int ret = 0;
-
-	if (on == POWER_ON)
-		ret = core_clks_enable(core);
-	else
-		core_clks_disable(core);
-
-	return ret;
-}
-
 static const struct venus_pm_ops pm_ops_v1 = {
 	.core_get = venus_clks_get,
 	.core_put = core_put_v1,
-	.core_power = core_power_v1,
 	.load_scale = load_scale_v1,
 };
 
@@ -410,7 +397,6 @@ static int venc_power_v3(struct device *dev, int on)
 static const struct venus_pm_ops pm_ops_v3 = {
 	.core_get = venus_clks_get,
 	.core_put = core_put_v1,
-	.core_power = core_power_v1,
 	.vdec_get = vdec_get_v3,
 	.vdec_power = vdec_power_v3,
 	.venc_get = venc_get_v3,
@@ -996,7 +982,7 @@ static void core_put_v4(struct venus_core *core)
 	vcodec_domains_put(core);
 }
 
-static int core_power_v4(struct venus_core *core, int on)
+int venus_core_power(struct venus_core *core, int on)
 {
 	struct device *dev = core->dev;
 	struct device *pmctrl = core->pmdomains[0];
@@ -1143,7 +1129,6 @@ static int load_scale_v4(struct venus_inst *inst)
 static const struct venus_pm_ops pm_ops_v4 = {
 	.core_get = core_get_v4,
 	.core_put = core_put_v4,
-	.core_power = core_power_v4,
 	.vdec_get = vdec_get_v4,
 	.vdec_put = vdec_put_v4,
 	.vdec_power = vdec_power_v4,
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h
index a492c50c5543..77db940a265c 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.h
+++ b/drivers/media/platform/qcom/venus/pm_helpers.h
@@ -12,7 +12,6 @@ struct venus_core;
 struct venus_pm_ops {
 	int (*core_get)(struct venus_core *core);
 	void (*core_put)(struct venus_core *core);
-	int (*core_power)(struct venus_core *core, int on);
 
 	int (*vdec_get)(struct device *dev);
 	void (*vdec_put)(struct device *dev);
@@ -28,6 +27,7 @@ struct venus_pm_ops {
 };
 
 const struct venus_pm_ops *venus_pm_get(enum hfi_version version);
+int venus_core_power(struct venus_core *core, int on);
 
 static inline int venus_pm_load_scale(struct venus_inst *inst)
 {

-- 
2.42.0


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

* [PATCH RFT 15/20] media: venus: pm_helpers: Remove pm_ops->core_put
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (13 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 14/20] media: venus: pm_helpers: Commonize core_power Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 16/20] media: venus: core: Define a pointer to core->res Konrad Dybcio
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

Without and OPP table and with vcodec_pmdomains_num (so, v1, v3 and
sdm845_legacy targets), core_put_v4 is a NOP, jut like core_put_v1.
Unify them!

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c       |  8 +++-----
 drivers/media/platform/qcom/venus/pm_helpers.c | 17 +----------------
 drivers/media/platform/qcom/venus/pm_helpers.h |  2 +-
 3 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 0ae118257296..9a1b0be5d067 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -429,15 +429,14 @@ static int venus_probe(struct platform_device *pdev)
 err_core_deinit:
 	hfi_core_deinit(core, false);
 err_core_put:
-	if (core->pm_ops->core_put)
-		core->pm_ops->core_put(core);
+	vcodec_domains_put(core);
+
 	return ret;
 }
 
 static void venus_remove(struct platform_device *pdev)
 {
 	struct venus_core *core = platform_get_drvdata(pdev);
-	const struct venus_pm_ops *pm_ops = core->pm_ops;
 	struct device *dev = core->dev;
 	int ret;
 
@@ -455,8 +454,7 @@ static void venus_remove(struct platform_device *pdev)
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 
-	if (pm_ops->core_put)
-		pm_ops->core_put(core);
+	vcodec_domains_put(core);
 
 	v4l2_device_unregister(&core->v4l2_dev);
 
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index ddaa9944fa44..9a0e2a00f383 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -318,13 +318,8 @@ static int load_scale_v1(struct venus_inst *inst)
 	return ret;
 }
 
-static void core_put_v1(struct venus_core *core)
-{
-}
-
 static const struct venus_pm_ops pm_ops_v1 = {
 	.core_get = venus_clks_get,
-	.core_put = core_put_v1,
 	.load_scale = load_scale_v1,
 };
 
@@ -396,7 +391,6 @@ static int venc_power_v3(struct device *dev, int on)
 
 static const struct venus_pm_ops pm_ops_v3 = {
 	.core_get = venus_clks_get,
-	.core_put = core_put_v1,
 	.vdec_get = vdec_get_v3,
 	.vdec_power = vdec_power_v3,
 	.venc_get = venc_get_v3,
@@ -899,7 +893,7 @@ static int vcodec_domains_get(struct venus_core *core)
 	return ret;
 }
 
-static void vcodec_domains_put(struct venus_core *core)
+void vcodec_domains_put(struct venus_core *core)
 {
 	const struct venus_resources *res = core->res;
 	unsigned int i;
@@ -974,14 +968,6 @@ static int core_get_v4(struct venus_core *core)
 	return 0;
 }
 
-static void core_put_v4(struct venus_core *core)
-{
-	if (legacy_binding)
-		return;
-
-	vcodec_domains_put(core);
-}
-
 int venus_core_power(struct venus_core *core, int on)
 {
 	struct device *dev = core->dev;
@@ -1128,7 +1114,6 @@ static int load_scale_v4(struct venus_inst *inst)
 
 static const struct venus_pm_ops pm_ops_v4 = {
 	.core_get = core_get_v4,
-	.core_put = core_put_v4,
 	.vdec_get = vdec_get_v4,
 	.vdec_put = vdec_put_v4,
 	.vdec_power = vdec_power_v4,
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h
index 77db940a265c..3014b39aa6e3 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.h
+++ b/drivers/media/platform/qcom/venus/pm_helpers.h
@@ -11,7 +11,6 @@ struct venus_core;
 
 struct venus_pm_ops {
 	int (*core_get)(struct venus_core *core);
-	void (*core_put)(struct venus_core *core);
 
 	int (*vdec_get)(struct device *dev);
 	void (*vdec_put)(struct device *dev);
@@ -28,6 +27,7 @@ struct venus_pm_ops {
 
 const struct venus_pm_ops *venus_pm_get(enum hfi_version version);
 int venus_core_power(struct venus_core *core, int on);
+void vcodec_domains_put(struct venus_core *core);
 
 static inline int venus_pm_load_scale(struct venus_inst *inst)
 {

-- 
2.42.0


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

* [PATCH RFT 16/20] media: venus: core: Define a pointer to core->res
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (14 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 15/20] media: venus: pm_helpers: Remove pm_ops->core_put Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 17/20] media: venus: pm_helpers: Simplify vcodec clock handling Konrad Dybcio
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

To make the code more concise, define a new variable 'res' pointing to
the abundantly referenced core->res.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 9a1b0be5d067..435f6f10a905 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -283,6 +283,7 @@ static irqreturn_t venus_isr_thread(int irq, void *dev_id)
 
 static int venus_probe(struct platform_device *pdev)
 {
+	const struct venus_resources *res;
 	struct device *dev = &pdev->dev;
 	struct venus_core *core;
 	int i, ret;
@@ -313,9 +314,11 @@ static int venus_probe(struct platform_device *pdev)
 	if (!core->res)
 		return -ENODEV;
 
+	res = core->res;
+
 	mutex_init(&core->pm_lock);
 
-	core->pm_ops = venus_pm_get(core->res->hfi_version);
+	core->pm_ops = venus_pm_get(res->hfi_version);
 	if (!core->pm_ops)
 		return -ENODEV;
 
@@ -323,14 +326,14 @@ static int venus_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	core->resets = devm_kcalloc(dev, core->res->resets_num, sizeof(*core->resets), GFP_KERNEL);
-	if (core->res->resets_num && !core->resets)
+	core->resets = devm_kcalloc(dev, res->resets_num, sizeof(*core->resets), GFP_KERNEL);
+	if (res->resets_num && !core->resets)
 		return -ENOMEM;
 
-	for (i = 0; i < core->res->resets_num; i++)
-		core->resets[i].id = core->res->resets[i];
+	for (i = 0; i < res->resets_num; i++)
+		core->resets[i].id = res->resets[i];
 
-	ret = devm_reset_control_bulk_get_exclusive(dev, core->res->resets_num, core->resets);
+	ret = devm_reset_control_bulk_get_exclusive(dev, res->resets_num, core->resets);
 	if (ret)
 		return ret;
 
@@ -340,7 +343,7 @@ static int venus_probe(struct platform_device *pdev)
 			return ret;
 	}
 
-	ret = dma_set_mask_and_coherent(dev, core->res->dma_mask);
+	ret = dma_set_mask_and_coherent(dev, res->dma_mask);
 	if (ret)
 		goto err_core_put;
 

-- 
2.42.0


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

* [PATCH RFT 17/20] media: venus: pm_helpers: Simplify vcodec clock handling
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (15 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 16/20] media: venus: core: Define a pointer to core->res Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 18/20] media: venus: pm_helpers: Commonize getting clocks and GenPDs Konrad Dybcio
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

Currently the infrastructure is set up for vast expandability, but
it's far too complex for what is just 0-2 clocks. Categorize the
clocks and simplify their getting.

One notable change is that vcodec clocks are switched to use
devm_clk_get_optional, which will let us commonize the code further
while leaving the burden of figuring out which SoCs need codec-specific
clocks and which don't to the bindings checker.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c       |  18 ----
 drivers/media/platform/qcom/venus/core.h       |   9 +-
 drivers/media/platform/qcom/venus/pm_helpers.c | 129 +++++++++++++------------
 3 files changed, 69 insertions(+), 87 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 435f6f10a905..42bfcef9449a 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -584,9 +584,6 @@ static const struct venus_resources msm8996_res = {
 	.reg_tbl_size = ARRAY_SIZE(msm8996_reg_preset),
 	.clks = {"core", "iface", "bus", "mbus" },
 	.clks_num = 4,
-	.vcodec0_clks = { "core" },
-	.vcodec1_clks = { "core" },
-	.vcodec_clks_num = 1,
 	.max_load = 2563200,
 	.hfi_version = HFI_VERSION_3XX,
 	.dma_mask = (GENMASK(31, 30) | GENMASK(28, 26) | GENMASK(24, 22)) - 1,
@@ -639,9 +636,6 @@ static const struct venus_resources sdm660_res = {
 	.bw_tbl_dec_size = ARRAY_SIZE(sdm660_bw_table_dec),
 	.clks = {"core", "iface", "bus", "bus_throttle" },
 	.clks_num = 4,
-	.vcodec0_clks = { "vcodec0_core" },
-	.vcodec1_clks = { "vcodec0_core" },
-	.vcodec_clks_num = 1,
 	.max_load = 1036800,
 	.hfi_version = HFI_VERSION_3XX,
 	.cp_size = 0x79000000,
@@ -683,9 +677,6 @@ static const struct venus_resources sdm845_res = {
 	.bw_tbl_dec_size = ARRAY_SIZE(sdm845_bw_table_dec),
 	.clks = {"core", "iface", "bus" },
 	.clks_num = 3,
-	.vcodec0_clks = { "core", "bus" },
-	.vcodec1_clks = { "core", "bus" },
-	.vcodec_clks_num = 2,
 	.max_load = 3110400,	/* 4096x2160@90 */
 	.hfi_version = HFI_VERSION_4XX,
 	.vpu_version = VPU_VERSION_AR50,
@@ -702,9 +693,6 @@ static const struct venus_resources sdm845_res_v2 = {
 	.bw_tbl_dec_size = ARRAY_SIZE(sdm845_bw_table_dec),
 	.clks = {"core", "iface", "bus" },
 	.clks_num = 3,
-	.vcodec0_clks = { "vcodec0_core", "vcodec0_bus" },
-	.vcodec1_clks = { "vcodec1_core", "vcodec1_bus" },
-	.vcodec_clks_num = 2,
 	.vcodec_pmdomains = { "venus", "vcodec0", "vcodec1" },
 	.vcodec_pmdomains_num = 3,
 	.opp_pmdomain = pd_names_cx,
@@ -747,8 +735,6 @@ static const struct venus_resources sc7180_res = {
 	.bw_tbl_dec_size = ARRAY_SIZE(sc7180_bw_table_dec),
 	.clks = {"core", "iface", "bus" },
 	.clks_num = 3,
-	.vcodec0_clks = { "vcodec0_core", "vcodec0_bus" },
-	.vcodec_clks_num = 2,
 	.vcodec_pmdomains = { "venus", "vcodec0" },
 	.vcodec_pmdomains_num = 2,
 	.opp_pmdomain = pd_names_cx,
@@ -799,8 +785,6 @@ static const struct venus_resources sm8250_res = {
 	.clks_num = 2,
 	.resets = { "bus", "core" },
 	.resets_num = 2,
-	.vcodec0_clks = { "vcodec0_core" },
-	.vcodec_clks_num = 1,
 	.vcodec_pmdomains = { "venus", "vcodec0" },
 	.vcodec_pmdomains_num = 2,
 	.opp_pmdomain = pd_names_mx,
@@ -854,8 +838,6 @@ static const struct venus_resources sc7280_res = {
 	.ubwc_conf = &sc7280_ubwc_config,
 	.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 = pd_names_cx,
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 16acf738fd6c..fd78f17c12d8 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -24,10 +24,11 @@
 #define VDBGFW	"VenusFW  : "
 
 #define VIDC_CLKS_NUM_MAX		4
-#define VIDC_VCODEC_CLKS_NUM_MAX	2
 #define VIDC_PMDOMAINS_NUM_MAX		3
 #define VIDC_RESETS_NUM_MAX		2
 
+#define MAX_NUM_VCODECS			2
+
 extern int venus_fw_debug;
 
 struct freq_tbl {
@@ -69,8 +70,6 @@ struct venus_resources {
 	const struct hfi_ubwc_config * const ubwc_conf;
 	const char * const clks[VIDC_CLKS_NUM_MAX];
 	const unsigned int clks_num;
-	const char * const vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX];
-	const char * const vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX];
 	const unsigned int vcodec_clks_num;
 	const char * const vcodec_pmdomains[VIDC_PMDOMAINS_NUM_MAX];
 	const unsigned int vcodec_pmdomains_num;
@@ -177,8 +176,8 @@ struct venus_core {
 	void __iomem *aon_base;
 	int irq;
 	struct clk *clks[VIDC_CLKS_NUM_MAX];
-	struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX];
-	struct clk *vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX];
+	struct clk *vcodec_core_clks[MAX_NUM_VCODECS];
+	struct clk *vcodec_bus_clks[MAX_NUM_VCODECS];
 	struct icc_path *video_path;
 	struct icc_path *cpucfg_path;
 	bool has_opp_table;
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 9a0e2a00f383..741b29cc76c9 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -110,67 +110,74 @@ static void core_clks_disable(struct venus_core *core)
 
 static int core_clks_set_rate(struct venus_core *core, unsigned long freq)
 {
-	int ret;
+	int i, ret;
 
 	ret = dev_pm_opp_set_rate(core->dev, freq);
 	if (ret)
 		return ret;
 
-	ret = clk_set_rate(core->vcodec0_clks[0], freq);
-	if (ret)
-		return ret;
-
-	ret = clk_set_rate(core->vcodec1_clks[0], freq);
-	if (ret)
-		return ret;
+	for (i = 0; i < MAX_NUM_VCODECS; i++) {
+		ret = clk_set_rate(core->vcodec_core_clks[i], freq);
+		if (ret)
+			return ret;
+	}
 
 	return 0;
 }
 
-static int vcodec_clks_get(struct venus_core *core, struct device *dev,
-			   struct clk **clks, const char * const *id)
+static int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id)
 {
-	const struct venus_resources *res = core->res;
-	unsigned int i;
+	char buf[13] = { 0 }; /* vcodecX_core\0 */
 
-	for (i = 0; i < res->vcodec_clks_num; i++) {
-		if (!id[i])
-			continue;
-		clks[i] = devm_clk_get(dev, id[i]);
-		if (IS_ERR(clks[i]))
-			return PTR_ERR(clks[i]);
+	/* Best we can do is 2 cores */
+	if (id > MAX_NUM_VCODECS - 1) {
+		dev_err(dev, "Got impossible vcodec id %u\n", id);
+		return -EINVAL;
+	};
+
+	snprintf(buf, sizeof(buf), "vcodec%u_core", id);
+
+	/* First try the non-legacy name */
+	core->vcodec_core_clks[id] = devm_clk_get_optional(dev, buf);
+	if (IS_ERR(core->vcodec_core_clks[id])) {
+		/* Try again, with the legacy name */
+		core->vcodec_core_clks[id] = devm_clk_get_optional(dev, "core");
+		if (IS_ERR(core->vcodec_core_clks[id]))
+			return PTR_ERR(core->vcodec_core_clks[id]);
+	}
+
+	memset(buf, 0, sizeof(buf));
+	snprintf(buf, sizeof(buf), "vcodec%u_bus", id);
+
+	core->vcodec_bus_clks[id] = devm_clk_get_optional(dev, buf);
+	if (IS_ERR(core->vcodec_bus_clks[id])) {
+		core->vcodec_bus_clks[id] = devm_clk_get_optional(dev, "bus");
+		if (IS_ERR(core->vcodec_bus_clks[id]))
+			return PTR_ERR(core->vcodec_bus_clks[id]);
 	}
 
 	return 0;
 }
 
-static int vcodec_clks_enable(struct venus_core *core, struct clk **clks)
+static int vcodec_clks_enable(struct venus_core *core, u8 id)
 {
-	const struct venus_resources *res = core->res;
-	unsigned int i;
 	int ret;
 
-	for (i = 0; i < res->vcodec_clks_num; i++) {
-		ret = clk_prepare_enable(clks[i]);
-		if (ret)
-			goto err;
-	}
+	ret = clk_prepare_enable(core->vcodec_core_clks[id]);
+	if (ret)
+		return ret;
 
-	return 0;
-err:
-	while (i--)
-		clk_disable_unprepare(clks[i]);
+	ret = clk_prepare_enable(core->vcodec_bus_clks[id]);
+	if (ret)
+		clk_disable_unprepare(core->vcodec_core_clks[id]);
 
 	return ret;
 }
 
-static void vcodec_clks_disable(struct venus_core *core, struct clk **clks)
+static void vcodec_clks_disable(struct venus_core *core, u8 id)
 {
-	const struct venus_resources *res = core->res;
-	unsigned int i = res->vcodec_clks_num;
-
-	while (i--)
-		clk_disable_unprepare(clks[i]);
+	clk_disable_unprepare(core->vcodec_bus_clks[id]);
+	clk_disable_unprepare(core->vcodec_core_clks[id]);
 }
 
 static u32 load_per_instance(struct venus_inst *inst)
@@ -343,8 +350,7 @@ static int vdec_get_v3(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
 
-	return vcodec_clks_get(core, dev, core->vcodec0_clks,
-			       core->res->vcodec0_clks);
+	return vcodec_clks_get(core, dev, 0);
 }
 
 static int vdec_power_v3(struct device *dev, int on)
@@ -355,9 +361,9 @@ static int vdec_power_v3(struct device *dev, int on)
 	vcodec_control_v3(core, VIDC_SESSION_TYPE_DEC, true);
 
 	if (on == POWER_ON)
-		ret = vcodec_clks_enable(core, core->vcodec0_clks);
+		ret = vcodec_clks_enable(core, 0);
 	else
-		vcodec_clks_disable(core, core->vcodec0_clks);
+		vcodec_clks_disable(core, 0);
 
 	vcodec_control_v3(core, VIDC_SESSION_TYPE_DEC, false);
 
@@ -368,8 +374,7 @@ static int venc_get_v3(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
 
-	return vcodec_clks_get(core, dev, core->vcodec1_clks,
-			       core->res->vcodec1_clks);
+	return vcodec_clks_get(core, dev, 1);
 }
 
 static int venc_power_v3(struct device *dev, int on)
@@ -380,9 +385,9 @@ static int venc_power_v3(struct device *dev, int on)
 	vcodec_control_v3(core, VIDC_SESSION_TYPE_ENC, true);
 
 	if (on == POWER_ON)
-		ret = vcodec_clks_enable(core, core->vcodec1_clks);
+		ret = vcodec_clks_enable(core, 1);
 	else
-		vcodec_clks_disable(core, core->vcodec1_clks);
+		vcodec_clks_disable(core, 1);
 
 	vcodec_control_v3(core, VIDC_SESSION_TYPE_ENC, false);
 
@@ -441,7 +446,7 @@ static int poweroff_coreid(struct venus_core *core, unsigned int coreid_mask)
 		if (ret)
 			return ret;
 
-		vcodec_clks_disable(core, core->vcodec0_clks);
+		vcodec_clks_disable(core, 0);
 
 		ret = vcodec_control_v4(core, VIDC_CORE_ID_1, false);
 		if (ret)
@@ -457,7 +462,7 @@ static int poweroff_coreid(struct venus_core *core, unsigned int coreid_mask)
 		if (ret)
 			return ret;
 
-		vcodec_clks_disable(core, core->vcodec1_clks);
+		vcodec_clks_disable(core, 1);
 
 		ret = vcodec_control_v4(core, VIDC_CORE_ID_2, false);
 		if (ret)
@@ -484,7 +489,7 @@ static int poweron_coreid(struct venus_core *core, unsigned int coreid_mask)
 		if (ret)
 			return ret;
 
-		ret = vcodec_clks_enable(core, core->vcodec0_clks);
+		ret = vcodec_clks_enable(core, 0);
 		if (ret)
 			return ret;
 
@@ -502,7 +507,7 @@ static int poweron_coreid(struct venus_core *core, unsigned int coreid_mask)
 		if (ret)
 			return ret;
 
-		ret = vcodec_clks_enable(core, core->vcodec1_clks);
+		ret = vcodec_clks_enable(core, 1);
 		if (ret)
 			return ret;
 
@@ -763,20 +768,18 @@ static int vdec_get_v4(struct device *dev)
 	if (!legacy_binding)
 		return 0;
 
-	return vcodec_clks_get(core, dev, core->vcodec0_clks,
-			       core->res->vcodec0_clks);
+	return vcodec_clks_get(core, dev, 0);
 }
 
 static void vdec_put_v4(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
-	unsigned int i;
 
 	if (!legacy_binding)
 		return;
 
-	for (i = 0; i < core->res->vcodec_clks_num; i++)
-		core->vcodec0_clks[i] = NULL;
+	core->vcodec_core_clks[0] = NULL;
+	core->vcodec_bus_clks[0] = NULL;
 }
 
 static int vdec_power_v4(struct device *dev, int on)
@@ -792,9 +795,9 @@ static int vdec_power_v4(struct device *dev, int on)
 		return ret;
 
 	if (on == POWER_ON)
-		ret = vcodec_clks_enable(core, core->vcodec0_clks);
+		ret = vcodec_clks_enable(core, 0);
 	else
-		vcodec_clks_disable(core, core->vcodec0_clks);
+		vcodec_clks_disable(core, 0);
 
 	vcodec_control_v4(core, VIDC_CORE_ID_1, false);
 
@@ -808,20 +811,18 @@ static int venc_get_v4(struct device *dev)
 	if (!legacy_binding)
 		return 0;
 
-	return vcodec_clks_get(core, dev, core->vcodec1_clks,
-			       core->res->vcodec1_clks);
+	return vcodec_clks_get(core, dev, 1);
 }
 
 static void venc_put_v4(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
-	unsigned int i;
 
 	if (!legacy_binding)
 		return;
 
-	for (i = 0; i < core->res->vcodec_clks_num; i++)
-		core->vcodec1_clks[i] = NULL;
+	core->vcodec_core_clks[1] = NULL;
+	core->vcodec_bus_clks[1] = NULL;
 }
 
 static int venc_power_v4(struct device *dev, int on)
@@ -837,9 +838,9 @@ static int venc_power_v4(struct device *dev, int on)
 		return ret;
 
 	if (on == POWER_ON)
-		ret = vcodec_clks_enable(core, core->vcodec1_clks);
+		ret = vcodec_clks_enable(core, 1);
 	else
-		vcodec_clks_disable(core, core->vcodec1_clks);
+		vcodec_clks_disable(core, 1);
 
 	vcodec_control_v4(core, VIDC_CORE_ID_2, false);
 
@@ -940,11 +941,11 @@ static int core_get_v4(struct venus_core *core)
 
 	dev_info(dev, "%s legacy binding\n", legacy_binding ? "" : "non");
 
-	ret = vcodec_clks_get(core, dev, core->vcodec0_clks, res->vcodec0_clks);
+	ret = vcodec_clks_get(core, dev, 0);
 	if (ret)
 		return ret;
 
-	ret = vcodec_clks_get(core, dev, core->vcodec1_clks, res->vcodec1_clks);
+	ret = vcodec_clks_get(core, dev, 1);
 	if (ret)
 		return ret;
 

-- 
2.42.0


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

* [PATCH RFT 18/20] media: venus: pm_helpers: Commonize getting clocks and GenPDs
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (16 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 17/20] media: venus: pm_helpers: Simplify vcodec clock handling Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-11 15:10 ` [PATCH RFT 19/20] media: venus: pm_helpers: Commonize vdec_get() Konrad Dybcio
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

As has been the story with the past few commits, much of the resource
acquisition logic is totally identical between different generations
and there's no good reason to invent a new function for each one.

Commonize core_get() and rename it to venus_get_resources() to be more
meaningful.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/core.c       | 8 +++-----
 drivers/media/platform/qcom/venus/pm_helpers.c | 5 +----
 drivers/media/platform/qcom/venus/pm_helpers.h | 3 +--
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 42bfcef9449a..e8a16355d39e 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -337,11 +337,9 @@ static int venus_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	if (core->pm_ops->core_get) {
-		ret = core->pm_ops->core_get(core);
-		if (ret)
-			return ret;
-	}
+	ret = venus_get_resources(core);
+	if (ret)
+		return ret;
 
 	ret = dma_set_mask_and_coherent(dev, res->dma_mask);
 	if (ret)
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 741b29cc76c9..6e282a69c7c5 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -326,7 +326,6 @@ static int load_scale_v1(struct venus_inst *inst)
 }
 
 static const struct venus_pm_ops pm_ops_v1 = {
-	.core_get = venus_clks_get,
 	.load_scale = load_scale_v1,
 };
 
@@ -395,7 +394,6 @@ static int venc_power_v3(struct device *dev, int on)
 }
 
 static const struct venus_pm_ops pm_ops_v3 = {
-	.core_get = venus_clks_get,
 	.vdec_get = vdec_get_v3,
 	.vdec_power = vdec_power_v3,
 	.venc_get = venc_get_v3,
@@ -926,7 +924,7 @@ static int core_resets_reset(struct venus_core *core)
 	return reset_control_bulk_deassert(res->resets_num, core->resets);
 }
 
-static int core_get_v4(struct venus_core *core)
+int venus_get_resources(struct venus_core *core)
 {
 	struct device *dev = core->dev;
 	const struct venus_resources *res = core->res;
@@ -1114,7 +1112,6 @@ static int load_scale_v4(struct venus_inst *inst)
 }
 
 static const struct venus_pm_ops pm_ops_v4 = {
-	.core_get = core_get_v4,
 	.vdec_get = vdec_get_v4,
 	.vdec_put = vdec_put_v4,
 	.vdec_power = vdec_power_v4,
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h
index 3014b39aa6e3..7a55a55029f3 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.h
+++ b/drivers/media/platform/qcom/venus/pm_helpers.h
@@ -10,8 +10,6 @@ struct venus_core;
 #define POWER_OFF	0
 
 struct venus_pm_ops {
-	int (*core_get)(struct venus_core *core);
-
 	int (*vdec_get)(struct device *dev);
 	void (*vdec_put)(struct device *dev);
 	int (*vdec_power)(struct device *dev, int on);
@@ -28,6 +26,7 @@ struct venus_pm_ops {
 const struct venus_pm_ops *venus_pm_get(enum hfi_version version);
 int venus_core_power(struct venus_core *core, int on);
 void vcodec_domains_put(struct venus_core *core);
+int venus_get_resources(struct venus_core *core);
 
 static inline int venus_pm_load_scale(struct venus_inst *inst)
 {

-- 
2.42.0


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

* [PATCH RFT 19/20] media: venus: pm_helpers: Commonize vdec_get()
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (17 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 18/20] media: venus: pm_helpers: Commonize getting clocks and GenPDs Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-13  3:52   ` kernel test robot
  2023-09-11 15:10 ` [PATCH RFT 20/20] media: venus: pm_helpers: Commonize venc_get() Konrad Dybcio
                   ` (2 subsequent siblings)
  21 siblings, 1 reply; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

This function can be very easily commonized between the supported gens.
Do so!

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 21 +--------------------
 drivers/media/platform/qcom/venus/pm_helpers.h |  2 +-
 drivers/media/platform/qcom/venus/vdec.c       |  9 +++++++--
 3 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 6e282a69c7c5..dfb89d2e7387 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -125,7 +125,7 @@ static int core_clks_set_rate(struct venus_core *core, unsigned long freq)
 	return 0;
 }
 
-static int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id)
+int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id)
 {
 	char buf[13] = { 0 }; /* vcodecX_core\0 */
 
@@ -345,13 +345,6 @@ vcodec_control_v3(struct venus_core *core, u32 session_type, bool enable)
 		writel(1, ctrl);
 }
 
-static int vdec_get_v3(struct device *dev)
-{
-	struct venus_core *core = dev_get_drvdata(dev);
-
-	return vcodec_clks_get(core, dev, 0);
-}
-
 static int vdec_power_v3(struct device *dev, int on)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
@@ -394,7 +387,6 @@ static int venc_power_v3(struct device *dev, int on)
 }
 
 static const struct venus_pm_ops pm_ops_v3 = {
-	.vdec_get = vdec_get_v3,
 	.vdec_power = vdec_power_v3,
 	.venc_get = venc_get_v3,
 	.venc_power = venc_power_v3,
@@ -759,16 +751,6 @@ static int coreid_power_v4(struct venus_inst *inst, int on)
 	return ret;
 }
 
-static int vdec_get_v4(struct device *dev)
-{
-	struct venus_core *core = dev_get_drvdata(dev);
-
-	if (!legacy_binding)
-		return 0;
-
-	return vcodec_clks_get(core, dev, 0);
-}
-
 static void vdec_put_v4(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
@@ -1112,7 +1094,6 @@ static int load_scale_v4(struct venus_inst *inst)
 }
 
 static const struct venus_pm_ops pm_ops_v4 = {
-	.vdec_get = vdec_get_v4,
 	.vdec_put = vdec_put_v4,
 	.vdec_power = vdec_power_v4,
 	.venc_get = venc_get_v4,
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h
index 7a55a55029f3..4afc57dac865 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.h
+++ b/drivers/media/platform/qcom/venus/pm_helpers.h
@@ -10,7 +10,6 @@ struct venus_core;
 #define POWER_OFF	0
 
 struct venus_pm_ops {
-	int (*vdec_get)(struct device *dev);
 	void (*vdec_put)(struct device *dev);
 	int (*vdec_power)(struct device *dev, int on);
 
@@ -27,6 +26,7 @@ const struct venus_pm_ops *venus_pm_get(enum hfi_version version);
 int venus_core_power(struct venus_core *core, int on);
 void vcodec_domains_put(struct venus_core *core);
 int venus_get_resources(struct venus_core *core);
+int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id);
 
 static inline int venus_pm_load_scale(struct venus_inst *inst)
 {
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index dbf305cec120..610beba5ca6d 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1788,8 +1788,13 @@ static int vdec_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, core);
 
-	if (core->pm_ops->vdec_get) {
-		ret = core->pm_ops->vdec_get(dev);
+	/*
+	 * If the vcodec core clock is missing by now, it either doesn't exist
+	 * (8916) or deprecated bindings with pre-assigned core functions and
+	 * resources under the decoder node are in use.
+	 */
+	if (!core->vcodec_core_clks[0]) {
+		ret = vcodec_clks_get(core, dev, 0);
 		if (ret)
 			return ret;
 	}

-- 
2.42.0


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

* [PATCH RFT 20/20] media: venus: pm_helpers: Commonize venc_get()
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (18 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 19/20] media: venus: pm_helpers: Commonize vdec_get() Konrad Dybcio
@ 2023-09-11 15:10 ` Konrad Dybcio
  2023-09-13 11:24   ` kernel test robot
  2023-09-12  6:19 ` [PATCH RFT 00/20] Venus cleanups Bryan O'Donoghue
  2023-09-15 14:13 ` Bryan O'Donoghue
  21 siblings, 1 reply; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-11 15:10 UTC (permalink / raw)
  To: Stanimir Varbanov, Vikash Garodia, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel, Konrad Dybcio

This function can be very easily commonized between the supported gens.
Do so!

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/media/platform/qcom/venus/pm_helpers.c | 19 -------------------
 drivers/media/platform/qcom/venus/pm_helpers.h |  1 -
 drivers/media/platform/qcom/venus/venc.c       |  9 +++++++--
 3 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index dfb89d2e7387..9546ad577b5d 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -362,13 +362,6 @@ static int vdec_power_v3(struct device *dev, int on)
 	return ret;
 }
 
-static int venc_get_v3(struct device *dev)
-{
-	struct venus_core *core = dev_get_drvdata(dev);
-
-	return vcodec_clks_get(core, dev, 1);
-}
-
 static int venc_power_v3(struct device *dev, int on)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
@@ -388,7 +381,6 @@ static int venc_power_v3(struct device *dev, int on)
 
 static const struct venus_pm_ops pm_ops_v3 = {
 	.vdec_power = vdec_power_v3,
-	.venc_get = venc_get_v3,
 	.venc_power = venc_power_v3,
 	.load_scale = load_scale_v1,
 };
@@ -784,16 +776,6 @@ static int vdec_power_v4(struct device *dev, int on)
 	return ret;
 }
 
-static int venc_get_v4(struct device *dev)
-{
-	struct venus_core *core = dev_get_drvdata(dev);
-
-	if (!legacy_binding)
-		return 0;
-
-	return vcodec_clks_get(core, dev, 1);
-}
-
 static void venc_put_v4(struct device *dev)
 {
 	struct venus_core *core = dev_get_drvdata(dev);
@@ -1096,7 +1078,6 @@ static int load_scale_v4(struct venus_inst *inst)
 static const struct venus_pm_ops pm_ops_v4 = {
 	.vdec_put = vdec_put_v4,
 	.vdec_power = vdec_power_v4,
-	.venc_get = venc_get_v4,
 	.venc_put = venc_put_v4,
 	.venc_power = venc_power_v4,
 	.coreid_power = coreid_power_v4,
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.h b/drivers/media/platform/qcom/venus/pm_helpers.h
index 4afc57dac865..cbf54e6c6eab 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.h
+++ b/drivers/media/platform/qcom/venus/pm_helpers.h
@@ -13,7 +13,6 @@ struct venus_pm_ops {
 	void (*vdec_put)(struct device *dev);
 	int (*vdec_power)(struct device *dev, int on);
 
-	int (*venc_get)(struct device *dev);
 	void (*venc_put)(struct device *dev);
 	int (*venc_power)(struct device *dev, int on);
 
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index 44b13696cf82..fd3a1dd7f16c 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -1557,8 +1557,13 @@ static int venc_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, core);
 
-	if (core->pm_ops->venc_get) {
-		ret = core->pm_ops->venc_get(dev);
+	/*
+	 * If the vcodec core clock is missing by now, it either doesn't exist
+	 * (8916) or deprecated bindings with pre-assigned core functions and
+	 * resources under the decoder node are in use.
+	 */
+	if (!core->vcodec_core_clks[1]) {
+		ret = vcodec_clks_get(core, dev, 1);
 		if (ret)
 			return ret;
 	}

-- 
2.42.0


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

* Re: [PATCH RFT 11/20] media: venus: core: Drop cache properties in resource struct
  2023-09-11 15:10 ` [PATCH RFT 11/20] media: venus: core: Drop cache properties in resource struct Konrad Dybcio
@ 2023-09-11 23:53   ` kernel test robot
  0 siblings, 0 replies; 29+ messages in thread
From: kernel test robot @ 2023-09-11 23:53 UTC (permalink / raw)
  To: Konrad Dybcio, Stanimir Varbanov, Vikash Garodia,
	Bryan O'Donoghue, Andy Gross, Bjorn Andersson,
	Mauro Carvalho Chehab, Dikshita Agarwal, Philipp Zabel
  Cc: oe-kbuild-all, linux-media, Marijn Suijten, linux-arm-msm,
	linux-kernel, Konrad Dybcio

Hi Konrad,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 7bc675554773f09d88101bf1ccfc8537dc7c0be9]

url:    https://github.com/intel-lab-lkp/linux/commits/Konrad-Dybcio/media-venus-pm_helpers-Only-set-rate-of-the-core-clock-in-core_clks_enable/20230912-051942
base:   7bc675554773f09d88101bf1ccfc8537dc7c0be9
patch link:    https://lore.kernel.org/r/20230911-topic-mars-v1-11-a7d38bf87bdb%40linaro.org
patch subject: [PATCH RFT 11/20] media: venus: core: Drop cache properties in resource struct
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230912/202309120738.fip6vVJN-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230912/202309120738.fip6vVJN-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309120738.fip6vVJN-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/media/platform/qcom/venus/hfi_venus.c: In function 'venus_isr_thread':
>> drivers/media/platform/qcom/venus/hfi_venus.c:1060:39: warning: variable 'res' set but not used [-Wunused-but-set-variable]
    1060 |         const struct venus_resources *res;
         |                                       ^~~


vim +/res +1060 drivers/media/platform/qcom/venus/hfi_venus.c

d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1056  
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1057  static irqreturn_t venus_isr_thread(struct venus_core *core)
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1058  {
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1059  	struct venus_hfi_device *hdev = to_hfi_priv(core);
4cb3548a87c4a3 Stanimir Varbanov 2017-06-15 @1060  	const struct venus_resources *res;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1061  	void *pkt;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1062  	u32 msg_ret;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1063  
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1064  	if (!hdev)
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1065  		return IRQ_NONE;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1066  
4cb3548a87c4a3 Stanimir Varbanov 2017-06-15  1067  	res = hdev->core->res;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1068  	pkt = hdev->pkt_buf;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1069  
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1070  
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1071  	while (!venus_iface_msgq_read(hdev, pkt)) {
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1072  		msg_ret = hfi_process_msg_packet(core, pkt);
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1073  		switch (msg_ret) {
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1074  		case HFI_MSG_EVENT_NOTIFY:
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1075  			venus_process_msg_sys_error(hdev, pkt);
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1076  			break;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1077  		case HFI_MSG_SYS_INIT:
8b05e503e6c2dd Konrad Dybcio     2023-09-11  1078  			/* Disable OCMEM/VMEM unconditionally until support is added */
8b05e503e6c2dd Konrad Dybcio     2023-09-11  1079  			venus_hfi_core_set_resource(core, VIDC_RESOURCE_NONE,
8b05e503e6c2dd Konrad Dybcio     2023-09-11  1080  						    0,
8b05e503e6c2dd Konrad Dybcio     2023-09-11  1081  						    0,
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1082  						    hdev);
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1083  			break;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1084  		case HFI_MSG_SYS_RELEASE_RESOURCE:
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1085  			complete(&hdev->release_resource);
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1086  			break;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1087  		case HFI_MSG_SYS_PC_PREP:
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1088  			complete(&hdev->pwr_collapse_prep);
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1089  			break;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1090  		default:
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1091  			break;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1092  		}
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1093  	}
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1094  
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1095  	venus_flush_debug_queue(hdev);
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1096  
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1097  	return IRQ_HANDLED;
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1098  }
d96d3f30c0f2f5 Stanimir Varbanov 2017-06-15  1099  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH RFT 00/20] Venus cleanups
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (19 preceding siblings ...)
  2023-09-11 15:10 ` [PATCH RFT 20/20] media: venus: pm_helpers: Commonize venc_get() Konrad Dybcio
@ 2023-09-12  6:19 ` Bryan O'Donoghue
  2023-09-13 12:03   ` Konrad Dybcio
  2023-09-15 14:13 ` Bryan O'Donoghue
  21 siblings, 1 reply; 29+ messages in thread
From: Bryan O'Donoghue @ 2023-09-12  6:19 UTC (permalink / raw)
  To: Konrad Dybcio, Stanimir Varbanov, Vikash Garodia, Andy Gross,
	Bjorn Andersson, Mauro Carvalho Chehab, Dikshita Agarwal,
	Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel

On 11/09/2023 16:10, Konrad Dybcio wrote:
> With the driver supporting multiple generations of hardware, some mold
> has definitely grown over the code..
> 
> This series attempts to amend this situation a bit by commonizing some
> code paths and fixing some bugs while at it.
> 
> Only tested on SM8250.
> 
> Definitely needs testing on:
> 
> - SDM845 with old bindings
> - SDM845 with new bindings or 7180
> - MSM8916
> - MSM8996
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Don't we have both a db410c and db845c in Bjorn's lab you could test 
this on ?

---
bod


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

* Re: [PATCH RFT 19/20] media: venus: pm_helpers: Commonize vdec_get()
  2023-09-11 15:10 ` [PATCH RFT 19/20] media: venus: pm_helpers: Commonize vdec_get() Konrad Dybcio
@ 2023-09-13  3:52   ` kernel test robot
  0 siblings, 0 replies; 29+ messages in thread
From: kernel test robot @ 2023-09-13  3:52 UTC (permalink / raw)
  To: Konrad Dybcio, Stanimir Varbanov, Vikash Garodia,
	Bryan O'Donoghue, Andy Gross, Bjorn Andersson,
	Mauro Carvalho Chehab, Dikshita Agarwal, Philipp Zabel
  Cc: oe-kbuild-all, linux-media, Marijn Suijten, linux-arm-msm,
	linux-kernel, Konrad Dybcio

Hi Konrad,

kernel test robot noticed the following build errors:

[auto build test ERROR on 7bc675554773f09d88101bf1ccfc8537dc7c0be9]

url:    https://github.com/intel-lab-lkp/linux/commits/Konrad-Dybcio/media-venus-pm_helpers-Only-set-rate-of-the-core-clock-in-core_clks_enable/20230912-051942
base:   7bc675554773f09d88101bf1ccfc8537dc7c0be9
patch link:    https://lore.kernel.org/r/20230911-topic-mars-v1-19-a7d38bf87bdb%40linaro.org
patch subject: [PATCH RFT 19/20] media: venus: pm_helpers: Commonize vdec_get()
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20230913/202309131132.yfX42orR-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230913/202309131132.yfX42orR-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309131132.yfX42orR-lkp@intel.com/

All errors (new ones prefixed by >>, old ones prefixed by <<):

WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_rr.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_wrr.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_lc.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_wlc.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_fo.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_ovf.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_lblc.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_lblcr.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_dh.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_sh.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_sed.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_nq.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_twos.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_ftp.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_pe_sip.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/netfilter/nf_defrag_ipv4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/netfilter/nf_reject_ipv4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/netfilter/iptable_nat.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/netfilter/iptable_raw.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ip_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ipip.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ip_gre.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/udp_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ip_vti.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ah4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/esp4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/xfrm4_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/tunnel4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/inet_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/tcp_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/udp_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/raw_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/xfrm/xfrm_algo.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/xfrm/xfrm_user.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/unix/unix_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/netfilter/ip6table_raw.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/netfilter/ip6table_nat.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/netfilter/nf_defrag_ipv6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/netfilter/nf_reject_ipv6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/ah6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/esp6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/xfrm6_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/tunnel6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/mip6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/sit.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/ip6_udp_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_ar9331.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_brcm.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_dsa.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_gswip.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_hellcreek.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_ksz.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_lan9303.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_mtk.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_none.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_ocelot.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_ocelot_8021q.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_qca.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_rtl4_a.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_rtl8_4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_rzn1_a5psw.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_sja1105.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_trailer.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_xrs700x.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/8021q/8021q.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/xdp/xsk_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/mptcp/mptcp_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/mptcp/mptcp_crypto_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/mptcp/mptcp_token_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/packet/af_packet.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/packet/af_packet_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/key/af_key.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/nf_conntrack_bridge.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/ebtables.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/ebtable_broute.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/ebtable_filter.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/ebtable_nat.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/bridge.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/sunrpc/sunrpc.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/sunrpc/auth_gss/auth_rpcgss.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/sunrpc/auth_gss/rpcsec_gss_krb5.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/kcm/kcm.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/atm/atm.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/atm/lec.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/atm/mpoa.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/sctp/sctp_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/tipc/diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/smc/smc_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/caif/caif.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/caif/chnl_net.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/caif/caif_socket.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/caif/caif_usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/6lowpan/6lowpan.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ieee802154/6lowpan/ieee802154_6lowpan.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ieee802154/ieee802154_socket.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/nfc/nci/nci.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/nfc/nci/nci_spi.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/nfc/nfc_digital.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/vmw_vsock/vsock_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/hsr/hsr.o
>> ERROR: modpost: "vcodec_clks_get" [drivers/media/platform/qcom/venus/venus-dec.ko] undefined!

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH RFT 20/20] media: venus: pm_helpers: Commonize venc_get()
  2023-09-11 15:10 ` [PATCH RFT 20/20] media: venus: pm_helpers: Commonize venc_get() Konrad Dybcio
@ 2023-09-13 11:24   ` kernel test robot
  0 siblings, 0 replies; 29+ messages in thread
From: kernel test robot @ 2023-09-13 11:24 UTC (permalink / raw)
  To: Konrad Dybcio, Stanimir Varbanov, Vikash Garodia,
	Bryan O'Donoghue, Andy Gross, Bjorn Andersson,
	Mauro Carvalho Chehab, Dikshita Agarwal, Philipp Zabel
  Cc: oe-kbuild-all, linux-media, Marijn Suijten, linux-arm-msm,
	linux-kernel, Konrad Dybcio

Hi Konrad,

kernel test robot noticed the following build errors:

[auto build test ERROR on 7bc675554773f09d88101bf1ccfc8537dc7c0be9]

url:    https://github.com/intel-lab-lkp/linux/commits/Konrad-Dybcio/media-venus-pm_helpers-Only-set-rate-of-the-core-clock-in-core_clks_enable/20230912-051942
base:   7bc675554773f09d88101bf1ccfc8537dc7c0be9
patch link:    https://lore.kernel.org/r/20230911-topic-mars-v1-20-a7d38bf87bdb%40linaro.org
patch subject: [PATCH RFT 20/20] media: venus: pm_helpers: Commonize venc_get()
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20230913/202309131956.LhWot959-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230913/202309131956.LhWot959-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309131956.LhWot959-lkp@intel.com/

All errors (new ones prefixed by >>, old ones prefixed by <<):

WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_wrr.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_lc.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_wlc.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_fo.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_ovf.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_lblc.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_lblcr.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_dh.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_sh.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_sed.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_nq.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_twos.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_ftp.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/netfilter/ipvs/ip_vs_pe_sip.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/netfilter/nf_defrag_ipv4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/netfilter/nf_reject_ipv4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/netfilter/iptable_nat.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/netfilter/iptable_raw.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ip_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ipip.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ip_gre.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/udp_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ip_vti.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/ah4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/esp4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/xfrm4_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/tunnel4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/inet_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/tcp_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/udp_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv4/raw_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/xfrm/xfrm_algo.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/xfrm/xfrm_user.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/unix/unix_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/netfilter/ip6table_raw.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/netfilter/ip6table_nat.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/netfilter/nf_defrag_ipv6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/netfilter/nf_reject_ipv6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/ah6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/esp6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/xfrm6_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/tunnel6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/mip6.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/sit.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ipv6/ip6_udp_tunnel.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_ar9331.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_brcm.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_dsa.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_gswip.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_hellcreek.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_ksz.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_lan9303.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_mtk.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_none.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_ocelot.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_ocelot_8021q.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_qca.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_rtl4_a.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_rtl8_4.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_rzn1_a5psw.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_sja1105.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_trailer.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/dsa/tag_xrs700x.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/8021q/8021q.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/xdp/xsk_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/mptcp/mptcp_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/mptcp/mptcp_crypto_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/mptcp/mptcp_token_test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/packet/af_packet.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/packet/af_packet_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/key/af_key.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/nf_conntrack_bridge.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/ebtables.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/ebtable_broute.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/ebtable_filter.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/netfilter/ebtable_nat.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/bridge/bridge.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/sunrpc/sunrpc.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/sunrpc/auth_gss/auth_rpcgss.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/sunrpc/auth_gss/rpcsec_gss_krb5.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/kcm/kcm.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/atm/atm.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/atm/lec.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/atm/mpoa.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/sctp/sctp_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/tipc/diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/smc/smc_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/caif/caif.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/caif/chnl_net.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/caif/caif_socket.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/caif/caif_usb.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/6lowpan/6lowpan.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ieee802154/6lowpan/ieee802154_6lowpan.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/ieee802154/ieee802154_socket.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/nfc/nci/nci.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/nfc/nci/nci_spi.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/nfc/nfc_digital.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/vmw_vsock/vsock_diag.o
WARNING: modpost: missing MODULE_DESCRIPTION() in net/hsr/hsr.o
ERROR: modpost: "vcodec_clks_get" [drivers/media/platform/qcom/venus/venus-dec.ko] undefined!
>> ERROR: modpost: "vcodec_clks_get" [drivers/media/platform/qcom/venus/venus-enc.ko] undefined!

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH RFT 00/20] Venus cleanups
  2023-09-12  6:19 ` [PATCH RFT 00/20] Venus cleanups Bryan O'Donoghue
@ 2023-09-13 12:03   ` Konrad Dybcio
  2023-09-13 12:26     ` Bryan O'Donoghue
  0 siblings, 1 reply; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-13 12:03 UTC (permalink / raw)
  To: Bryan O'Donoghue, Stanimir Varbanov, Vikash Garodia,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel

On 12.09.2023 08:19, Bryan O'Donoghue wrote:
> On 11/09/2023 16:10, Konrad Dybcio wrote:
>> With the driver supporting multiple generations of hardware, some mold
>> has definitely grown over the code..
>>
>> This series attempts to amend this situation a bit by commonizing some
>> code paths and fixing some bugs while at it.
>>
>> Only tested on SM8250.
>>
>> Definitely needs testing on:
>>
>> - SDM845 with old bindings
>> - SDM845 with new bindings or 7180
>> - MSM8916
>> - MSM8996
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> 
> Don't we have both a db410c and db845c in Bjorn's lab you could test this on ?
None that work

Konrad

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

* Re: [PATCH RFT 00/20] Venus cleanups
  2023-09-13 12:03   ` Konrad Dybcio
@ 2023-09-13 12:26     ` Bryan O'Donoghue
  0 siblings, 0 replies; 29+ messages in thread
From: Bryan O'Donoghue @ 2023-09-13 12:26 UTC (permalink / raw)
  To: Konrad Dybcio, Stanimir Varbanov, Vikash Garodia, Andy Gross,
	Bjorn Andersson, Mauro Carvalho Chehab, Dikshita Agarwal,
	Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel

On 13/09/2023 13:03, Konrad Dybcio wrote:
> On 12.09.2023 08:19, Bryan O'Donoghue wrote:
>> On 11/09/2023 16:10, Konrad Dybcio wrote:
>>> With the driver supporting multiple generations of hardware, some mold
>>> has definitely grown over the code..
>>>
>>> This series attempts to amend this situation a bit by commonizing some
>>> code paths and fixing some bugs while at it.
>>>
>>> Only tested on SM8250.
>>>
>>> Definitely needs testing on:
>>>
>>> - SDM845 with old bindings
>>> - SDM845 with new bindings or 7180
>>> - MSM8916
>>> - MSM8996
>>>
>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>
>> Don't we have both a db410c and db845c in Bjorn's lab you could test this on ?
> None that work
> 
> Konrad

If you agree to bring more Polish candy to Ams, I will test this series 
for you.

Fair exchange.

---
bod

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

* Re: [PATCH RFT 00/20] Venus cleanups
  2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
                   ` (20 preceding siblings ...)
  2023-09-12  6:19 ` [PATCH RFT 00/20] Venus cleanups Bryan O'Donoghue
@ 2023-09-15 14:13 ` Bryan O'Donoghue
  2023-09-15 14:15   ` Konrad Dybcio
  21 siblings, 1 reply; 29+ messages in thread
From: Bryan O'Donoghue @ 2023-09-15 14:13 UTC (permalink / raw)
  To: Konrad Dybcio, Stanimir Varbanov, Vikash Garodia, Andy Gross,
	Bjorn Andersson, Mauro Carvalho Chehab, Dikshita Agarwal,
	Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel

On 11/09/2023 16:10, Konrad Dybcio wrote:
> With the driver supporting multiple generations of hardware, some mold
> has definitely grown over the code..
> 
> This series attempts to amend this situation a bit by commonizing some
> code paths and fixing some bugs while at it.
> 
> Only tested on SM8250.
> 
> Definitely needs testing on:
> 
> - SDM845 with old bindings
> - SDM845 with new bindings or 7180
> - MSM8916
> - MSM8996
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
> Konrad Dybcio (20):
>        media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable
>        media: venus: pm_helpers: Rename core_clks_get to venus_clks_get
>        media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
>        media: venus: core: Set OPP clkname in a common code path
>        media: venus: pm_helpers: Kill dead code
>        media: venus: pm_helpers: Move reset acquisition to common code
>        media: venus: pm_helpers: Use reset_bulk API
>        media: venus: core: Constify all members of the resource struct
>        media: venus: core: Deduplicate OPP genpd names
>        media: venus: core: Get rid of vcodec_num
>        media: venus: core: Drop cache properties in resource struct
>        media: venus: core: Use GENMASK for dma_mask
>        media: venus: core: Remove cp_start
>        media: venus: pm_helpers: Commonize core_power
>        media: venus: pm_helpers: Remove pm_ops->core_put
>        media: venus: core: Define a pointer to core->res
>        media: venus: pm_helpers: Simplify vcodec clock handling
>        media: venus: pm_helpers: Commonize getting clocks and GenPDs
>        media: venus: pm_helpers: Commonize vdec_get()
>        media: venus: pm_helpers: Commonize venc_get()
> 
>   drivers/media/platform/qcom/venus/core.c       | 138 ++++-------
>   drivers/media/platform/qcom/venus/core.h       |  64 +++--
>   drivers/media/platform/qcom/venus/firmware.c   |   3 +-
>   drivers/media/platform/qcom/venus/hfi_venus.c  |   7 +-
>   drivers/media/platform/qcom/venus/pm_helpers.c | 328 +++++++++----------------
>   drivers/media/platform/qcom/venus/pm_helpers.h |  10 +-
>   drivers/media/platform/qcom/venus/vdec.c       |   9 +-
>   drivers/media/platform/qcom/venus/venc.c       |   9 +-
>   8 files changed, 213 insertions(+), 355 deletions(-)
> ---
> base-commit: 7bc675554773f09d88101bf1ccfc8537dc7c0be9
> change-id: 20230911-topic-mars-e60bb2269411
> 
> Best regards,

b4 shazam 20230911-topic-mars-v1-0-a7d38bf87bdb@linaro.org
Grabbing thread from 
lore.kernel.org/all/20230911-topic-mars-v1-0-a7d38bf87bdb@linaro.org/t.mbox.gz
Checking for newer revisions
Grabbing search results from lore.kernel.org
Analyzing 27 messages in the thread
Checking attestation on all messages, may take a moment...
---
   [PATCH 1/20] media: venus: pm_helpers: Only set rate of the core 
clock in core_clks_enable
   [PATCH 2/20] media: venus: pm_helpers: Rename core_clks_get to 
venus_clks_get
   [PATCH 3/20] media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
   [PATCH 4/20] media: venus: core: Set OPP clkname in a common code path
   [PATCH 5/20] media: venus: pm_helpers: Kill dead code
   [PATCH 6/20] media: venus: pm_helpers: Move reset acquisition to 
common code
   [PATCH 7/20] media: venus: pm_helpers: Use reset_bulk API
   [PATCH 8/20] media: venus: core: Constify all members of the resource 
struct
   [PATCH 9/20] media: venus: core: Deduplicate OPP genpd names
   [PATCH 10/20] media: venus: core: Get rid of vcodec_num
   [PATCH 11/20] media: venus: core: Drop cache properties in resource 
struct
   [PATCH 12/20] media: venus: core: Use GENMASK for dma_mask
   [PATCH 13/20] media: venus: core: Remove cp_start
   [PATCH 14/20] media: venus: pm_helpers: Commonize core_power
   [PATCH 15/20] media: venus: pm_helpers: Remove pm_ops->core_put
   [PATCH 16/20] media: venus: core: Define a pointer to core->res
   [PATCH 17/20] media: venus: pm_helpers: Simplify vcodec clock handling
   [PATCH 18/20] media: venus: pm_helpers: Commonize getting clocks and 
GenPDs
   [PATCH 19/20] media: venus: pm_helpers: Commonize vdec_get()
   [PATCH 20/20] media: venus: pm_helpers: Commonize venc_get()
   ---
   ✗ No key: ed25519/konrad.dybcio@linaro.org
   ---
   NOTE: install dkimpy for DKIM signature verification
---
Total patches: 20
---
  Base: base-commit 7bc675554773f09d88101bf1ccfc8537dc7c0be9 not known, 
ignoring
Applying: media: venus: pm_helpers: Only set rate of the core clock in 
core_clks_enable
Applying: media: venus: pm_helpers: Rename core_clks_get to venus_clks_get
Applying: media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
Applying: media: venus: core: Set OPP clkname in a common code path
Applying: media: venus: pm_helpers: Kill dead code
Applying: media: venus: pm_helpers: Move reset acquisition to common code
Applying: media: venus: pm_helpers: Use reset_bulk API
Applying: media: venus: core: Constify all members of the resource struct
Applying: media: venus: core: Deduplicate OPP genpd names
Applying: media: venus: core: Get rid of vcodec_num
Applying: media: venus: core: Drop cache properties in resource struct
Applying: media: venus: core: Use GENMASK for dma_mask
Applying: media: venus: core: Remove cp_start
Applying: media: venus: pm_helpers: Commonize core_power
Applying: media: venus: pm_helpers: Remove pm_ops->core_put
Applying: media: venus: core: Define a pointer to core->res
Applying: media: venus: pm_helpers: Simplify vcodec clock handling
Applying: media: venus: pm_helpers: Commonize getting clocks and GenPDs
Applying: media: venus: pm_helpers: Commonize vdec_get()
Applying: media: venus: pm_helpers: Commonize venc_get()

   MODPOST Module.symvers
^[[BERROR: modpost: "vcodec_clks_get" 
[drivers/media/platform/qcom/venus/venus-dec.ko] undefined!
ERROR: modpost: "vcodec_clks_get" 
[drivers/media/platform/qcom/venus/venus-enc.ko] undefined!
make[3]: *** 
[/home/deckard/Development/qualcomm/qlt-kernel/scripts/Makefile.modpost:145: 
Module.symvers] Error 1
make[2]: *** 
[/home/deckard/Development/qualcomm/qlt-kernel/Makefile:1865: modpost] 
Error 2
make[1]: *** 
[/home/deckard/Development/qualcomm/qlt-kernel/Makefile:234: __sub-make] 
Error 2

---
bod


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

* Re: [PATCH RFT 00/20] Venus cleanups
  2023-09-15 14:13 ` Bryan O'Donoghue
@ 2023-09-15 14:15   ` Konrad Dybcio
  0 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2023-09-15 14:15 UTC (permalink / raw)
  To: Bryan O'Donoghue, Stanimir Varbanov, Vikash Garodia,
	Andy Gross, Bjorn Andersson, Mauro Carvalho Chehab,
	Dikshita Agarwal, Philipp Zabel
  Cc: Marijn Suijten, Stanimir Varbanov, Mauro Carvalho Chehab,
	linux-media, linux-arm-msm, linux-kernel

On 15.09.2023 16:13, Bryan O'Donoghue wrote:
> On 11/09/2023 16:10, Konrad Dybcio wrote:
>> With the driver supporting multiple generations of hardware, some mold
>> has definitely grown over the code..
>>
>> This series attempts to amend this situation a bit by commonizing some
>> code paths and fixing some bugs while at it.
>>
>> Only tested on SM8250.
>>
>> Definitely needs testing on:
>>
>> - SDM845 with old bindings
>> - SDM845 with new bindings or 7180
>> - MSM8916
>> - MSM8996
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>> Konrad Dybcio (20):
>>        media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable
>>        media: venus: pm_helpers: Rename core_clks_get to venus_clks_get
>>        media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
>>        media: venus: core: Set OPP clkname in a common code path
>>        media: venus: pm_helpers: Kill dead code
>>        media: venus: pm_helpers: Move reset acquisition to common code
>>        media: venus: pm_helpers: Use reset_bulk API
>>        media: venus: core: Constify all members of the resource struct
>>        media: venus: core: Deduplicate OPP genpd names
>>        media: venus: core: Get rid of vcodec_num
>>        media: venus: core: Drop cache properties in resource struct
>>        media: venus: core: Use GENMASK for dma_mask
>>        media: venus: core: Remove cp_start
>>        media: venus: pm_helpers: Commonize core_power
>>        media: venus: pm_helpers: Remove pm_ops->core_put
>>        media: venus: core: Define a pointer to core->res
>>        media: venus: pm_helpers: Simplify vcodec clock handling
>>        media: venus: pm_helpers: Commonize getting clocks and GenPDs
>>        media: venus: pm_helpers: Commonize vdec_get()
>>        media: venus: pm_helpers: Commonize venc_get()
>>
>>   drivers/media/platform/qcom/venus/core.c       | 138 ++++-------
>>   drivers/media/platform/qcom/venus/core.h       |  64 +++--
>>   drivers/media/platform/qcom/venus/firmware.c   |   3 +-
>>   drivers/media/platform/qcom/venus/hfi_venus.c  |   7 +-
>>   drivers/media/platform/qcom/venus/pm_helpers.c | 328 +++++++++----------------
>>   drivers/media/platform/qcom/venus/pm_helpers.h |  10 +-
>>   drivers/media/platform/qcom/venus/vdec.c       |   9 +-
>>   drivers/media/platform/qcom/venus/venc.c       |   9 +-
>>   8 files changed, 213 insertions(+), 355 deletions(-)
>> ---
>> base-commit: 7bc675554773f09d88101bf1ccfc8537dc7c0be9
>> change-id: 20230911-topic-mars-e60bb2269411
>>
>> Best regards,
> 
> b4 shazam 20230911-topic-mars-v1-0-a7d38bf87bdb@linaro.org
> Grabbing thread from lore.kernel.org/all/20230911-topic-mars-v1-0-a7d38bf87bdb@linaro.org/t.mbox.gz
> Checking for newer revisions
> Grabbing search results from lore.kernel.org
> Analyzing 27 messages in the thread
> Checking attestation on all messages, may take a moment...
> ---
>   [PATCH 1/20] media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable
>   [PATCH 2/20] media: venus: pm_helpers: Rename core_clks_get to venus_clks_get
>   [PATCH 3/20] media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
>   [PATCH 4/20] media: venus: core: Set OPP clkname in a common code path
>   [PATCH 5/20] media: venus: pm_helpers: Kill dead code
>   [PATCH 6/20] media: venus: pm_helpers: Move reset acquisition to common code
>   [PATCH 7/20] media: venus: pm_helpers: Use reset_bulk API
>   [PATCH 8/20] media: venus: core: Constify all members of the resource struct
>   [PATCH 9/20] media: venus: core: Deduplicate OPP genpd names
>   [PATCH 10/20] media: venus: core: Get rid of vcodec_num
>   [PATCH 11/20] media: venus: core: Drop cache properties in resource struct
>   [PATCH 12/20] media: venus: core: Use GENMASK for dma_mask
>   [PATCH 13/20] media: venus: core: Remove cp_start
>   [PATCH 14/20] media: venus: pm_helpers: Commonize core_power
>   [PATCH 15/20] media: venus: pm_helpers: Remove pm_ops->core_put
>   [PATCH 16/20] media: venus: core: Define a pointer to core->res
>   [PATCH 17/20] media: venus: pm_helpers: Simplify vcodec clock handling
>   [PATCH 18/20] media: venus: pm_helpers: Commonize getting clocks and GenPDs
>   [PATCH 19/20] media: venus: pm_helpers: Commonize vdec_get()
>   [PATCH 20/20] media: venus: pm_helpers: Commonize venc_get()
>   ---
>   ✗ No key: ed25519/konrad.dybcio@linaro.org
>   ---
>   NOTE: install dkimpy for DKIM signature verification
> ---
> Total patches: 20
> ---
>  Base: base-commit 7bc675554773f09d88101bf1ccfc8537dc7c0be9 not known, ignoring
> Applying: media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable
> Applying: media: venus: pm_helpers: Rename core_clks_get to venus_clks_get
> Applying: media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
> Applying: media: venus: core: Set OPP clkname in a common code path
> Applying: media: venus: pm_helpers: Kill dead code
> Applying: media: venus: pm_helpers: Move reset acquisition to common code
> Applying: media: venus: pm_helpers: Use reset_bulk API
> Applying: media: venus: core: Constify all members of the resource struct
> Applying: media: venus: core: Deduplicate OPP genpd names
> Applying: media: venus: core: Get rid of vcodec_num
> Applying: media: venus: core: Drop cache properties in resource struct
> Applying: media: venus: core: Use GENMASK for dma_mask
> Applying: media: venus: core: Remove cp_start
> Applying: media: venus: pm_helpers: Commonize core_power
> Applying: media: venus: pm_helpers: Remove pm_ops->core_put
> Applying: media: venus: core: Define a pointer to core->res
> Applying: media: venus: pm_helpers: Simplify vcodec clock handling
> Applying: media: venus: pm_helpers: Commonize getting clocks and GenPDs
> Applying: media: venus: pm_helpers: Commonize vdec_get()
> Applying: media: venus: pm_helpers: Commonize venc_get()
> 
>   MODPOST Module.symvers
> ^[[BERROR: modpost: "vcodec_clks_get" [drivers/media/platform/qcom/venus/venus-dec.ko] undefined!
> ERROR: modpost: "vcodec_clks_get" [drivers/media/platform/qcom/venus/venus-enc.ko] undefined!
> make[3]: *** [/home/deckard/Development/qualcomm/qlt-kernel/scripts/Makefile.modpost:145: Module.symvers] Error 1
> make[2]: *** [/home/deckard/Development/qualcomm/qlt-kernel/Makefile:1865: modpost] Error 2
> make[1]: *** [/home/deckard/Development/qualcomm/qlt-kernel/Makefile:234: __sub-make] Error 2
Yeah I noticed after sending..

I have some fixups locally, see output of `b4 prep --compare-to v1`:

 1:  ef4effbdd61b =  1:  07193da8f8b2 media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable
 2:  46a6466fff36 =  2:  c8598ffa711a media: venus: pm_helpers: Rename core_clks_get to venus_clks_get
 3:  733411cd167d =  3:  bcc0385fe8a3 media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
 4:  42f089b8ee90 =  4:  181a2a4f7a4b media: venus: core: Set OPP clkname in a common code path
 5:  e0cd37c576cf =  5:  182ba8feb561 media: venus: pm_helpers: Kill dead code
 6:  232c32d813b8 =  6:  06fd32b2f112 media: venus: pm_helpers: Move reset acquisition to common code
 7:  0ab76762c149 =  7:  f0aaaca1fe70 media: venus: pm_helpers: Use reset_bulk API
 8:  e47564b87e77 =  8:  2ddb02b05d0f media: venus: core: Constify all members of the resource struct
 9:  c5e157de604e =  9:  918f3dc5f2f6 media: venus: core: Deduplicate OPP genpd names
10:  3500b515c0cb = 10:  ee194c584ce0 media: venus: core: Get rid of vcodec_num
11:  b179e47b6db6 ! 11:  81fa7517b057 media: venus: core: Drop cache properties in resource struct
    @@ drivers/media/platform/qcom/venus/core.h: struct venus_resources {
        const u32 cp_nonpixel_start;
     
      ## drivers/media/platform/qcom/venus/hfi_venus.c ##
    +@@ drivers/media/platform/qcom/venus/hfi_venus.c: static void venus_process_msg_sys_error(struct venus_hfi_device *hdev,
    + static irqreturn_t venus_isr_thread(struct venus_core *core)
    + {
    +   struct venus_hfi_device *hdev = to_hfi_priv(core);
    +-  const struct venus_resources *res;
    +   void *pkt;
    +   u32 msg_ret;
    + 
    +   if (!hdev)
    +           return IRQ_NONE;
    + 
    +-  res = hdev->core->res;
    +   pkt = hdev->pkt_buf;
    + 
    +-
    +   while (!venus_iface_msgq_read(hdev, pkt)) {
    +           msg_ret = hfi_process_msg_packet(core, pkt);
    +           switch (msg_ret) {
     @@ drivers/media/platform/qcom/venus/hfi_venus.c: static irqreturn_t venus_isr_thread(struct venus_core *core)
                        venus_process_msg_sys_error(hdev, pkt);
                        break;
12:  aa122db08d64 = 12:  8cf3d701f0b4 media: venus: core: Use GENMASK for dma_mask
13:  548235220fcd = 13:  3aa4f40a1818 media: venus: core: Remove cp_start
14:  9fd8a8515795 = 14:  7f65994f7c7c media: venus: pm_helpers: Commonize core_power
15:  09c778667817 = 15:  45c51bcaeb17 media: venus: pm_helpers: Remove pm_ops->core_put
16:  955470ceffa0 = 16:  63aba2146a15 media: venus: core: Define a pointer to core->res
17:  3a6fbeac1f5c = 17:  bafeb6dc5525 media: venus: pm_helpers: Simplify vcodec clock handling
18:  ee1234ce5c19 = 18:  e4500b65ff24 media: venus: pm_helpers: Commonize getting clocks and GenPDs
19:  155ca91c4ece ! 19:  8d86b33d0614 media: venus: pm_helpers: Commonize vdec_get()
    @@ drivers/media/platform/qcom/venus/pm_helpers.c: static int core_clks_set_rate(st
      {
        char buf[13] = { 0 }; /* vcodecX_core\0 */
      
    +@@ drivers/media/platform/qcom/venus/pm_helpers.c: static int vcodec_clks_get(struct venus_core *core, struct device *dev, u8 id)
    + 
    +   return 0;
    + }
    ++EXPORT_SYMBOL_GPL(vcodec_clks_get);
    + 
    + static int vcodec_clks_enable(struct venus_core *core, u8 id)
    + {
     @@ drivers/media/platform/qcom/venus/pm_helpers.c: vcodec_control_v3(struct venus_core *core, u32 session_type, bool enable)
                writel(1, ctrl);
      }


Konrad

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

end of thread, other threads:[~2023-09-15 14:15 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-11 15:10 [PATCH RFT 00/20] Venus cleanups Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 01/20] media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 02/20] media: venus: pm_helpers: Rename core_clks_get to venus_clks_get Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 03/20] media: venus: pm_helpers: Add kerneldoc to venus_clks_get() Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 04/20] media: venus: core: Set OPP clkname in a common code path Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 05/20] media: venus: pm_helpers: Kill dead code Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 06/20] media: venus: pm_helpers: Move reset acquisition to common code Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 07/20] media: venus: pm_helpers: Use reset_bulk API Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 08/20] media: venus: core: Constify all members of the resource struct Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 09/20] media: venus: core: Deduplicate OPP genpd names Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 10/20] media: venus: core: Get rid of vcodec_num Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 11/20] media: venus: core: Drop cache properties in resource struct Konrad Dybcio
2023-09-11 23:53   ` kernel test robot
2023-09-11 15:10 ` [PATCH RFT 12/20] media: venus: core: Use GENMASK for dma_mask Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 13/20] media: venus: core: Remove cp_start Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 14/20] media: venus: pm_helpers: Commonize core_power Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 15/20] media: venus: pm_helpers: Remove pm_ops->core_put Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 16/20] media: venus: core: Define a pointer to core->res Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 17/20] media: venus: pm_helpers: Simplify vcodec clock handling Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 18/20] media: venus: pm_helpers: Commonize getting clocks and GenPDs Konrad Dybcio
2023-09-11 15:10 ` [PATCH RFT 19/20] media: venus: pm_helpers: Commonize vdec_get() Konrad Dybcio
2023-09-13  3:52   ` kernel test robot
2023-09-11 15:10 ` [PATCH RFT 20/20] media: venus: pm_helpers: Commonize venc_get() Konrad Dybcio
2023-09-13 11:24   ` kernel test robot
2023-09-12  6:19 ` [PATCH RFT 00/20] Venus cleanups Bryan O'Donoghue
2023-09-13 12:03   ` Konrad Dybcio
2023-09-13 12:26     ` Bryan O'Donoghue
2023-09-15 14:13 ` Bryan O'Donoghue
2023-09-15 14:15   ` Konrad Dybcio

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