2021-03-08 10:53:54

by Stanimir Varbanov

[permalink] [raw]
Subject: [PATCH 0/5] Venus msm8916 fixes

Hello,

Here are few fixes for msm8916 (Venus v1x):
* Two fixes in hfi_parser
* One fix related to opp_set_clk_rate
* Default header-mode for encoder is changed to join-with-1st-frame
* Added support for actual-plane-info for v1x too

regards,
Stan

Stanimir Varbanov (5):
venus: hfi_parser: Don't initialize parser on v1
venus: hfi_parser: Check for instance after hfi platform get
venus: pm_helpers: Set opp clock name for v1
venus: venc_ctrls: Change default header mode
venus: hfi_cmds: Support plane-actual-info property from v1

drivers/media/platform/qcom/venus/hfi_cmds.c | 24 +++++++++----------
.../media/platform/qcom/venus/hfi_parser.c | 12 ++++++----
.../media/platform/qcom/venus/pm_helpers.c | 20 +++++++++++++++-
.../media/platform/qcom/venus/venc_ctrls.c | 2 +-
4 files changed, 39 insertions(+), 19 deletions(-)

--
2.25.1


2021-03-08 10:53:54

by Stanimir Varbanov

[permalink] [raw]
Subject: [PATCH 2/5] venus: hfi_parser: Check for instance after hfi platform get

The inst function argument is != NULL only for Venus v1 and
we did not migrate v1 to a hfi_platform abstraction yet. So
check for instance != NULL only after hfi_platform_get returns
no error.

Fixes: e29929266be1 ("media: venus: Get codecs and capabilities from hfi platform")
Cc: [email protected] # v5.12+
Signed-off-by: Stanimir Varbanov <[email protected]>
---
drivers/media/platform/qcom/venus/hfi_parser.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c
index ce230974761d..5b8389b98299 100644
--- a/drivers/media/platform/qcom/venus/hfi_parser.c
+++ b/drivers/media/platform/qcom/venus/hfi_parser.c
@@ -235,13 +235,13 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
u32 enc_codecs, dec_codecs, count = 0;
unsigned int entries;

- if (inst)
- return 0;
-
plat = hfi_platform_get(core->res->hfi_version);
if (!plat)
return -EINVAL;

+ if (inst)
+ return 0;
+
if (plat->codecs)
plat->codecs(&enc_codecs, &dec_codecs, &count);

--
2.25.1

2021-03-08 10:54:00

by Stanimir Varbanov

[permalink] [raw]
Subject: [PATCH 3/5] venus: pm_helpers: Set opp clock name for v1

The rate of the core clock is set through devm_pm_opp_set_rate and
to avoid errors from it we have to set the name of the clock via
dev_pm_opp_set_clkname.

Fixes: 9a538b83612c ("media: venus: core: Add support for opp tables/perf voting")
Cc: [email protected] # v5.10+
Signed-off-by: Stanimir Varbanov <[email protected]>
---
.../media/platform/qcom/venus/pm_helpers.c | 20 ++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 43c4e3d9e281..12f6d3ab89ff 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -280,8 +280,24 @@ static int load_scale_v1(struct venus_inst *inst)
static int core_get_v1(struct device *dev)
{
struct venus_core *core = dev_get_drvdata(dev);
+ int ret;
+
+ ret = core_clks_get(core);
+ if (ret)
+ return ret;
+
+ core->opp_table = dev_pm_opp_set_clkname(core->dev, "core");
+ if (IS_ERR(core->opp_table))
+ return PTR_ERR(core->opp_table);

- return core_clks_get(core);
+ return 0;
+}
+
+static void core_put_v1(struct device *dev)
+{
+ struct venus_core *core = dev_get_drvdata(dev);
+
+ dev_pm_opp_put_clkname(core->opp_table);
}

static int core_power_v1(struct device *dev, int on)
@@ -299,6 +315,7 @@ static int core_power_v1(struct device *dev, int on)

static const struct venus_pm_ops pm_ops_v1 = {
.core_get = core_get_v1,
+ .core_put = core_put_v1,
.core_power = core_power_v1,
.load_scale = load_scale_v1,
};
@@ -371,6 +388,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_put = core_put_v1,
.core_power = core_power_v1,
.vdec_get = vdec_get_v3,
.vdec_power = vdec_power_v3,
--
2.25.1

2021-03-08 10:54:08

by Stanimir Varbanov

[permalink] [raw]
Subject: [PATCH 4/5] venus: venc_ctrls: Change default header mode

It is observed that on Venus v1 the default header-mode is producing
a bitstream which is not playble. Change the default header-mode to
joined with 1st frame.

Fixes: 002c22bd360e ("media: venus: venc: set inband mode property to FW.")
Cc: [email protected] # v5.12+
Signed-off-by: Stanimir Varbanov <[email protected]>
---
drivers/media/platform/qcom/venus/venc_ctrls.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c
index a52b80055173..abef0037bf55 100644
--- a/drivers/media/platform/qcom/venus/venc_ctrls.c
+++ b/drivers/media/platform/qcom/venus/venc_ctrls.c
@@ -359,7 +359,7 @@ int venc_ctrl_init(struct venus_inst *inst)
V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME,
~((1 << V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE) |
(1 << V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME)),
- V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE);
+ V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME);

v4l2_ctrl_new_std_menu(&inst->ctrl_handler, &venc_ctrl_ops,
V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE,
--
2.25.1

2021-03-08 10:56:06

by Stanimir Varbanov

[permalink] [raw]
Subject: [PATCH 5/5] venus: hfi_cmds: Support plane-actual-info property from v1

The property is supported from v1 and upwards. So move it to
set_property_1x.

Fixes: 01e869e78756 ("media: venus: venc: fix handlig of S_SELECTION and G_SELECTION")
Cc: [email protected] # v5.12+
Signed-off-by: Stanimir Varbanov <[email protected]>
---
drivers/media/platform/qcom/venus/hfi_cmds.c | 24 ++++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c
index 4f7565834469..558510a8dfc8 100644
--- a/drivers/media/platform/qcom/venus/hfi_cmds.c
+++ b/drivers/media/platform/qcom/venus/hfi_cmds.c
@@ -1039,6 +1039,18 @@ static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt,
pkt->shdr.hdr.size += sizeof(u32) + sizeof(*hierp);
break;
}
+ case HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_INFO: {
+ struct hfi_uncompressed_plane_actual_info *in = pdata;
+ struct hfi_uncompressed_plane_actual_info *info = prop_data;
+
+ info->buffer_type = in->buffer_type;
+ info->num_planes = in->num_planes;
+ info->plane_format[0] = in->plane_format[0];
+ if (in->num_planes > 1)
+ info->plane_format[1] = in->plane_format[1];
+ pkt->shdr.hdr.size += sizeof(u32) + sizeof(*info);
+ break;
+ }

/* FOLLOWING PROPERTIES ARE NOT IMPLEMENTED IN CORE YET */
case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS:
@@ -1205,18 +1217,6 @@ pkt_session_set_property_4xx(struct hfi_session_set_property_pkt *pkt,
pkt->shdr.hdr.size += sizeof(u32) + sizeof(*cu);
break;
}
- case HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_INFO: {
- struct hfi_uncompressed_plane_actual_info *in = pdata;
- struct hfi_uncompressed_plane_actual_info *info = prop_data;
-
- info->buffer_type = in->buffer_type;
- info->num_planes = in->num_planes;
- info->plane_format[0] = in->plane_format[0];
- if (in->num_planes > 1)
- info->plane_format[1] = in->plane_format[1];
- pkt->shdr.hdr.size += sizeof(u32) + sizeof(*info);
- break;
- }
case HFI_PROPERTY_CONFIG_VENC_MAX_BITRATE:
case HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER:
case HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE:
--
2.25.1

2021-03-09 20:57:37

by Bryan O'Donoghue

[permalink] [raw]
Subject: Re: [PATCH 0/5] Venus msm8916 fixes

On 08/03/2021 10:52, Stanimir Varbanov wrote:
> Hello,
>
> Here are few fixes for msm8916 (Venus v1x):
> * Two fixes in hfi_parser
> * One fix related to opp_set_clk_rate
> * Default header-mode for encoder is changed to join-with-1st-frame
> * Added support for actual-plane-info for v1x too
>
> regards,
> Stan
>
> Stanimir Varbanov (5):
> venus: hfi_parser: Don't initialize parser on v1
> venus: hfi_parser: Check for instance after hfi platform get
> venus: pm_helpers: Set opp clock name for v1
> venus: venc_ctrls: Change default header mode
> venus: hfi_cmds: Support plane-actual-info property from v1
>
> drivers/media/platform/qcom/venus/hfi_cmds.c | 24 +++++++++----------
> .../media/platform/qcom/venus/hfi_parser.c | 12 ++++++----
> .../media/platform/qcom/venus/pm_helpers.c | 20 +++++++++++++++-
> .../media/platform/qcom/venus/venc_ctrls.c | 2 +-
> 4 files changed, 39 insertions(+), 19 deletions(-)
>

Tested-by: Bryan O'Donoghue <[email protected]>