Venus cleanups
Subsystems (4)
cover Venus cleanups
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
---
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,
Signature · 1 line
Konrad Dybcio <[email protected]>
PATCH 1/20 media: venus: pm_helpers: Only set rate of the core clock in core_clks_enable
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.
--- drivers/media/platform/qcom/venus/pm_helpers.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
drivers/media/platform/qcom/venus/pm_helpers.c +11 -12
@@ -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;
Signature · 1 line
2.42.0
PATCH 2/20 media: venus: pm_helpers: Rename core_clks_get to venus_clks_get
In reply to Konrad Dybcio"core" is used in multiple contexts when talking about Venus, rename the function to save on confusion.
--- drivers/media/platform/qcom/venus/pm_helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/pm_helpers.c +3 -3
@@ -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;
Signature · 1 line
2.42.0
PATCH 3/20 media: venus: pm_helpers: Add kerneldoc to venus_clks_get()
In reply to Konrad DybcioTo make it easier to understand the various clock requirements within this driver, add kerneldoc to venus_clk_get() explaining the fluff.
--- drivers/media/platform/qcom/venus/pm_helpers.c | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/media/platform/qcom/venus/pm_helpers.c +28 -0
@@ -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;
Signature · 1 line
2.42.0
PATCH 4/20 media: venus: core: Set OPP clkname in a common code path
In reply to Konrad DybcioCalling 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.
--- drivers/media/platform/qcom/venus/core.c | 5 +++++ drivers/media/platform/qcom/venus/pm_helpers.c | 23 ++--------------------- 2 files changed, 7 insertions(+), 21 deletions(-)
drivers/media/platform/qcom/venus/core.c +5 -0
@@ -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)
drivers/media/platform/qcom/venus/pm_helpers.c +2 -21
@@ -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;
Signature · 1 line
2.42.0
PATCH 5/20 media: venus: pm_helpers: Kill dead code
In reply to Konrad DybcioA 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.
--- drivers/media/platform/qcom/venus/pm_helpers.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/media/platform/qcom/venus/pm_helpers.c +0 -14
@@ -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]);
Signature · 1 line
2.42.0
PATCH 6/20 media: venus: pm_helpers: Move reset acquisition to common code
In reply to Konrad DybcioThere is no reason to keep reset_get code local to HFIv4/v6.
Move it to the common part.
--- drivers/media/platform/qcom/venus/core.c | 9 ++++++++- drivers/media/platform/qcom/venus/pm_helpers.c | 23 ----------------------- 2 files changed, 8 insertions(+), 24 deletions(-)
drivers/media/platform/qcom/venus/core.c +8 -1
@@ -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)
drivers/media/platform/qcom/venus/pm_helpers.c +0 -23
@@ -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 ;
Signature · 1 line
2.42.0
PATCH 7/20 media: venus: pm_helpers: Use reset_bulk API
In reply to Konrad DybcioAll 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.
--- 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(-)
drivers/media/platform/qcom/venus/core.c +10 -5
@@ -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);
drivers/media/platform/qcom/venus/core.h +2 -2
@@ -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;
drivers/media/platform/qcom/venus/pm_helpers.c +5 -12
@@ -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)
Signature · 1 line
2.42.0
PATCH 8/20 media: venus: core: Constify all members of the resource struct
In reply to Konrad DybcioNothing inside the resource struct needs to be mutable. Sprinkle 'const' all over it. A lot of 'const'.
--- drivers/media/platform/qcom/venus/core.h | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-)
drivers/media/platform/qcom/venus/core.h +28 -28
@@ -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 {
Signature · 1 line
2.42.0
PATCH 9/20 media: venus: core: Deduplicate OPP genpd names
In reply to Konrad DybcioInstead of redefining the same literals over and over again, define them once and point the reference to that definition.
--- drivers/media/platform/qcom/venus/core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/media/platform/qcom/venus/core.c +7 -4
@@ -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,
Signature · 1 line
2.42.0
PATCH 10/20 media: venus: core: Get rid of vcodec_num
In reply to Konrad DybcioThat field was only introduced to differentiate between the legacy and non-legacy SDM845 binding. Get rid of it.
--- 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(-)
drivers/media/platform/qcom/venus/core.c +0 -5
@@ -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,
drivers/media/platform/qcom/venus/core.h +0 -1
@@ -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;
drivers/media/platform/qcom/venus/pm_helpers.c +1 -1
@@ -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; }
Signature · 1 line
2.42.0
PATCH 11/20 media: venus: core: Drop cache properties in resource struct
In reply to Konrad DybcioCurrently 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.
--- 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(-)
drivers/media/platform/qcom/venus/core.c +0 -24
@@ -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", };
drivers/media/platform/qcom/venus/core.h +0 -3
@@ -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;
drivers/media/platform/qcom/venus/hfi_venus.c +4 -3
@@ -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 :
Signature · 1 line
2.42.0
kernel test robot
build botRe: [PATCH RFT 11/20] media: venus: core: Drop cache properties in resource struct
kernel test robot noticed the following build warnings:
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/[email protected]/config) compiler: m68k-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230912/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
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 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH 12/20 media: venus: core: Use GENMASK for dma_mask
In reply to Konrad DybcioThe raw literals mean very little. Substitute it with more telling bitops macros.
--- drivers/media/platform/qcom/venus/core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/media/platform/qcom/venus/core.c +7 -7
@@ -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", };
Signature · 1 line
2.42.0
PATCH 13/20 media: venus: core: Remove cp_start
In reply to Konrad DybcioIt's hardcoded to be zero. Always. Ever since msm-3.10. Or maybe even before. Remove it!
--- 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(-)
drivers/media/platform/qcom/venus/core.c +0 -3
@@ -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,
drivers/media/platform/qcom/venus/core.h +0 -1
@@ -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;
drivers/media/platform/qcom/venus/firmware.c +1 -2
@@ -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);
Signature · 1 line
2.42.0
PATCH 14/20 media: venus: pm_helpers: Commonize core_power
In reply to Konrad Dybciocore_power_v4 called with num_resets = 0 and core->pmdomains[0] == NULL does exactly the same thing as core_power_v1. Unify them!
--- 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(-)
drivers/media/platform/qcom/venus/core.c +7 -14
@@ -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); }
drivers/media/platform/qcom/venus/pm_helpers.c +1 -16
@@ -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,
drivers/media/platform/qcom/venus/pm_helpers.h +1 -1
@@ -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) {
Signature · 1 line
2.42.0
PATCH 15/20 media: venus: pm_helpers: Remove pm_ops->core_put
In reply to Konrad DybcioWithout 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!
--- 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(-)
drivers/media/platform/qcom/venus/core.c +3 -5
@@ -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);
drivers/media/platform/qcom/venus/pm_helpers.c +1 -16
@@ -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,
drivers/media/platform/qcom/venus/pm_helpers.h +1 -1
@@ -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) {
Signature · 1 line
2.42.0
PATCH 16/20 media: venus: core: Define a pointer to core->res
In reply to Konrad DybcioTo make the code more concise, define a new variable 'res' pointing to the abundantly referenced core->res.
--- drivers/media/platform/qcom/venus/core.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/media/platform/qcom/venus/core.c +10 -7
@@ -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;
Signature · 1 line
2.42.0
PATCH 17/20 media: venus: pm_helpers: Simplify vcodec clock handling
In reply to Konrad DybcioCurrently 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.
--- 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(-)
drivers/media/platform/qcom/venus/core.c +0 -18
@@ -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,
drivers/media/platform/qcom/venus/core.h +4 -5
@@ -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;
drivers/media/platform/qcom/venus/pm_helpers.c +65 -64
263 lines not on this page · raw message
Signature · 1 line
2.42.0
PATCH 18/20 media: venus: pm_helpers: Commonize getting clocks and GenPDs
In reply to Konrad DybcioAs 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.
--- 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(-)
drivers/media/platform/qcom/venus/core.c +3 -5
@@ -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)
drivers/media/platform/qcom/venus/pm_helpers.c +1 -4
@@ -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,
drivers/media/platform/qcom/venus/pm_helpers.h +1 -2
@@ -10,8 +10,6 @@ struct venus_core;#define POWER_OFF 0struct 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) {
Signature · 1 line
2.42.0
PATCH 19/20 media: venus: pm_helpers: Commonize vdec_get()
In reply to Konrad DybcioThis function can be very easily commonized between the supported gens. Do so!
--- 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(-)
drivers/media/platform/qcom/venus/pm_helpers.c +1 -20
@@ -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,
drivers/media/platform/qcom/venus/pm_helpers.h +1 -1
@@ -10,7 +10,6 @@ struct venus_core;#define POWER_OFF 0struct 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) {
drivers/media/platform/qcom/venus/vdec.c +7 -2
@@ -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; }
Signature · 1 line
2.42.0
kernel test robot
build botRe: [PATCH RFT 19/20] media: venus: pm_helpers: Commonize vdec_get()
kernel test robot noticed the following build errors:
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/[email protected]/config) compiler: m68k-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230913/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
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!
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH 20/20 media: venus: pm_helpers: Commonize venc_get()
In reply to Konrad DybcioThis function can be very easily commonized between the supported gens. Do so!
--- 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(-)
drivers/media/platform/qcom/venus/pm_helpers.c +0 -19
@@ -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,
drivers/media/platform/qcom/venus/pm_helpers.h +0 -1
@@ -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);
drivers/media/platform/qcom/venus/venc.c +7 -2
@@ -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; }
Signature · 1 line
2.42.0
kernel test robot
build botRe: [PATCH RFT 20/20] media: venus: pm_helpers: Commonize venc_get()
kernel test robot noticed the following build errors:
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/[email protected]/config) compiler: m68k-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230913/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
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!
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 8 lines · 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.
Quoted 8 lines
Definitely needs testing on:
- SDM845 with old bindings
- SDM845 with new bindings or 7180
- MSM8916
- MSM8996Signed-off-by Konrad Dybcio <[email protected]>
Don't we have both a db410c and db845c in Bjorn's lab you could test this on ?
---
bod
Quoted 11 lines · Bryan O'Donoghue
Quoted 10 lines · 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:
Quoted 8 lines
Quoted 6 lines
- SDM845 with old bindings
- SDM845 with new bindings or 7180
- MSM8916
- MSM8996Signed-off-by Konrad Dybcio <[email protected]>Don't we have both a db410c and db845c in Bjorn's lab you could test this on ?
None that work
Konrad
Quoted 17 lines · Konrad Dybcio
Quoted 16 lines · Bryan O'Donoghue
Quoted 15 lines · 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
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Konrad Dybcio <[email protected]>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
Quoted 48 lines · 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
- MSM8996Signed-off-by Konrad Dybcio <[email protected]>---
Konrad Dybcio (20):
media: venus:pm_helpers: Only set rate of the core clock incore_clks_enable
media: venus:pm_helpers: Renamecore_clks_gettovenus_clks_get
media: venus:pm_helpers: Add kerneldoc tovenus_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: Usereset_bulkAPI
media: venus: core: Constify all members of the resource struct
media: venus: core: Deduplicate OPP genpd names
media: venus: core: Get rid ofvcodec_num
media: venus: core: Drop cache properties in resource struct
media: venus: core: Use GENMASK fordma_mask
media: venus: core: Removecp_start
media: venus:pm_helpers: Commonizecore_power
media: venus:pm_helpers: Removepm_ops->core_put
media: venus: core: Define a pointer tocore->res
media: venus:pm_helpers: Simplify vcodec clock handling
media: venus:pm_helpers: Commonize getting clocks and GenPDs
media: venus:pm_helpers: Commonizevdec_get()
media: venus:pm_helpers: Commonizevenc_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(-)
Quoted 5 lines
---
base-commit:7bc675554773f09d88101bf1ccfc8537dc7c0be9
change-id: 20230911-topic-mars-e60bb2269411Best regards,
b4 shazam [email protected]
Grabbing thread from lore.kernel.org/all/[email protected]/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 tovenus_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/[email protected]
---
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
Quoted 111 lines · Bryan O'Donoghue
Quoted 47 lines · 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
- MSM8996Signed-off-by Konrad Dybcio <[email protected]>---
Konrad Dybcio (20):
media: venus:pm_helpers: Only set rate of the core clock incore_clks_enable
media: venus:pm_helpers: Renamecore_clks_gettovenus_clks_get
media: venus:pm_helpers: Add kerneldoc tovenus_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: Usereset_bulkAPI
media: venus: core: Constify all members of the resource struct
media: venus: core: Deduplicate OPP genpd names
media: venus: core: Get rid ofvcodec_num
media: venus: core: Drop cache properties in resource struct
media: venus: core: Use GENMASK fordma_mask
media: venus: core: Removecp_start
media: venus:pm_helpers: Commonizecore_power
media: venus:pm_helpers: Removepm_ops->core_put
media: venus: core: Define a pointer tocore->res
media: venus:pm_helpers: Simplify vcodec clock handling
media: venus:pm_helpers: Commonize getting clocks and GenPDs
media: venus:pm_helpers: Commonizevdec_get()
media: venus:pm_helpers: Commonizevenc_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 +-Quoted 6 lines
8 files changed, 213 insertions(+), 355 deletions(-)---
base-commit:7bc675554773f09d88101bf1ccfc8537dc7c0be9
change-id: 20230911-topic-mars-e60bb2269411Best regards,
b4 shazam [email protected]
Grabbing thread from lore.kernel.org/all/[email protected]/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 incore_clks_enable[PATCH 2/20] media: venus:pm_helpers: Renamecore_clks_gettovenus_clks_get[PATCH 3/20] media: venus:pm_helpers: Add kerneldoc tovenus_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: Usereset_bulkAPI
[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 ofvcodec_num
[PATCH 11/20] media: venus: core: Drop cache properties in resource struct
[PATCH 12/20] media: venus: core: Use GENMASK fordma_mask
[PATCH 13/20] media: venus: core: Removecp_start
[PATCH 14/20] media: venus:pm_helpers: Commonizecore_power
[PATCH 15/20] media: venus:pm_helpers: Removepm_ops->core_put
[PATCH 16/20] media: venus: core: Define a pointer tocore->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: Commonizevdec_get()
[PATCH 20/20] media: venus:pm_helpers: Commonizevenc_get()
---
✗ No key: ed25519/[email protected]
---
NOTE: install dkimpy for DKIM signature verification
---
Total patches: 20
---
Base: base-commit7bc675554773f09d88101bf1ccfc8537dc7c0be9not known, ignoring
Applying: media: venus:pm_helpers: Only set rate of the core clock incore_clks_enable
Applying: media: venus:pm_helpers: Renamecore_clks_gettovenus_clks_get
Applying: media: venus:pm_helpers: Add kerneldoc tovenus_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: Usereset_bulkAPI
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 ofvcodec_num
Applying: media: venus: core: Drop cache properties in resource struct
Applying: media: venus: core: Use GENMASK fordma_mask
Applying: media: venus: core: Removecp_start
Applying: media: venus:pm_helpers: Commonizecore_power
Applying: media: venus:pm_helpers: Removepm_ops->core_put
Applying: media: venus: core: Define a pointer tocore->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: Commonizevdec_get()
Applying: media: venus:pm_helpers: Commonizevenc_get()
Quoted 6 lines
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