All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Venus msm8916 fixes
@ 2021-03-08 10:52 Stanimir Varbanov
  2021-03-08 10:52 ` [PATCH 1/5] venus: hfi_parser: Don't initialize parser on v1 Stanimir Varbanov
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Stanimir Varbanov @ 2021-03-08 10:52 UTC (permalink / raw)
  To: linux-media, linux-arm-msm, linux-kernel
  Cc: bryan.odonoghue, Stanimir Varbanov

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


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

* [PATCH 1/5] venus: hfi_parser: Don't initialize parser on v1
  2021-03-08 10:52 [PATCH 0/5] Venus msm8916 fixes Stanimir Varbanov
@ 2021-03-08 10:52 ` Stanimir Varbanov
  2021-03-08 10:52 ` [PATCH 2/5] venus: hfi_parser: Check for instance after hfi platform get Stanimir Varbanov
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stanimir Varbanov @ 2021-03-08 10:52 UTC (permalink / raw)
  To: linux-media, linux-arm-msm, linux-kernel
  Cc: bryan.odonoghue, Stanimir Varbanov, stable

The Venus v1 behaves differently comparing with the other Venus
version in respect to capability parsing and when they are send
to the driver. So we don't need to initialize hfi parser for
multiple invocations like what we do for > v1 Venus versions.

Fixes: 10865c98986b ("media: venus: parser: Prepare parser for multiple invocations")
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 drivers/media/platform/qcom/venus/hfi_parser.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c
index 7263c0c32695..ce230974761d 100644
--- a/drivers/media/platform/qcom/venus/hfi_parser.c
+++ b/drivers/media/platform/qcom/venus/hfi_parser.c
@@ -277,8 +277,10 @@ u32 hfi_parser(struct venus_core *core, struct venus_inst *inst, void *buf,
 
 	parser_init(inst, &codecs, &domain);
 
-	core->codecs_count = 0;
-	memset(core->caps, 0, sizeof(core->caps));
+	if (core->res->hfi_version > HFI_VERSION_1XX) {
+		core->codecs_count = 0;
+		memset(core->caps, 0, sizeof(core->caps));
+	}
 
 	while (words_count) {
 		data = word + 1;
-- 
2.25.1


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

* [PATCH 2/5] venus: hfi_parser: Check for instance after hfi platform get
  2021-03-08 10:52 [PATCH 0/5] Venus msm8916 fixes Stanimir Varbanov
  2021-03-08 10:52 ` [PATCH 1/5] venus: hfi_parser: Don't initialize parser on v1 Stanimir Varbanov
@ 2021-03-08 10:52 ` Stanimir Varbanov
  2021-03-08 10:52 ` [PATCH 3/5] venus: pm_helpers: Set opp clock name for v1 Stanimir Varbanov
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stanimir Varbanov @ 2021-03-08 10:52 UTC (permalink / raw)
  To: linux-media, linux-arm-msm, linux-kernel
  Cc: bryan.odonoghue, Stanimir Varbanov, stable

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: stable@vger.kernel.org # v5.12+
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 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


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

* [PATCH 3/5] venus: pm_helpers: Set opp clock name for v1
  2021-03-08 10:52 [PATCH 0/5] Venus msm8916 fixes Stanimir Varbanov
  2021-03-08 10:52 ` [PATCH 1/5] venus: hfi_parser: Don't initialize parser on v1 Stanimir Varbanov
  2021-03-08 10:52 ` [PATCH 2/5] venus: hfi_parser: Check for instance after hfi platform get Stanimir Varbanov
@ 2021-03-08 10:52 ` Stanimir Varbanov
  2021-03-08 10:52 ` [PATCH 4/5] venus: venc_ctrls: Change default header mode Stanimir Varbanov
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stanimir Varbanov @ 2021-03-08 10:52 UTC (permalink / raw)
  To: linux-media, linux-arm-msm, linux-kernel
  Cc: bryan.odonoghue, Stanimir Varbanov, stable

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: stable@vger.kernel.org # v5.10+
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 .../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


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

* [PATCH 4/5] venus: venc_ctrls: Change default header mode
  2021-03-08 10:52 [PATCH 0/5] Venus msm8916 fixes Stanimir Varbanov
                   ` (2 preceding siblings ...)
  2021-03-08 10:52 ` [PATCH 3/5] venus: pm_helpers: Set opp clock name for v1 Stanimir Varbanov
@ 2021-03-08 10:52 ` Stanimir Varbanov
  2021-03-08 10:52 ` [PATCH 5/5] venus: hfi_cmds: Support plane-actual-info property from v1 Stanimir Varbanov
  2021-03-09 20:55 ` [PATCH 0/5] Venus msm8916 fixes Bryan O'Donoghue
  5 siblings, 0 replies; 7+ messages in thread
From: Stanimir Varbanov @ 2021-03-08 10:52 UTC (permalink / raw)
  To: linux-media, linux-arm-msm, linux-kernel
  Cc: bryan.odonoghue, Stanimir Varbanov, stable

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: stable@vger.kernel.org # v5.12+
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 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


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

* [PATCH 5/5] venus: hfi_cmds: Support plane-actual-info property from v1
  2021-03-08 10:52 [PATCH 0/5] Venus msm8916 fixes Stanimir Varbanov
                   ` (3 preceding siblings ...)
  2021-03-08 10:52 ` [PATCH 4/5] venus: venc_ctrls: Change default header mode Stanimir Varbanov
@ 2021-03-08 10:52 ` Stanimir Varbanov
  2021-03-09 20:55 ` [PATCH 0/5] Venus msm8916 fixes Bryan O'Donoghue
  5 siblings, 0 replies; 7+ messages in thread
From: Stanimir Varbanov @ 2021-03-08 10:52 UTC (permalink / raw)
  To: linux-media, linux-arm-msm, linux-kernel
  Cc: bryan.odonoghue, Stanimir Varbanov, stable

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: stable@vger.kernel.org # v5.12+
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 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


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

* Re: [PATCH 0/5] Venus msm8916 fixes
  2021-03-08 10:52 [PATCH 0/5] Venus msm8916 fixes Stanimir Varbanov
                   ` (4 preceding siblings ...)
  2021-03-08 10:52 ` [PATCH 5/5] venus: hfi_cmds: Support plane-actual-info property from v1 Stanimir Varbanov
@ 2021-03-09 20:55 ` Bryan O'Donoghue
  5 siblings, 0 replies; 7+ messages in thread
From: Bryan O'Donoghue @ 2021-03-09 20:55 UTC (permalink / raw)
  To: Stanimir Varbanov, linux-media, linux-arm-msm, linux-kernel

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 <bryan.odonoghue@linaro.org>

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

end of thread, other threads:[~2021-03-09 20:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 10:52 [PATCH 0/5] Venus msm8916 fixes Stanimir Varbanov
2021-03-08 10:52 ` [PATCH 1/5] venus: hfi_parser: Don't initialize parser on v1 Stanimir Varbanov
2021-03-08 10:52 ` [PATCH 2/5] venus: hfi_parser: Check for instance after hfi platform get Stanimir Varbanov
2021-03-08 10:52 ` [PATCH 3/5] venus: pm_helpers: Set opp clock name for v1 Stanimir Varbanov
2021-03-08 10:52 ` [PATCH 4/5] venus: venc_ctrls: Change default header mode Stanimir Varbanov
2021-03-08 10:52 ` [PATCH 5/5] venus: hfi_cmds: Support plane-actual-info property from v1 Stanimir Varbanov
2021-03-09 20:55 ` [PATCH 0/5] Venus msm8916 fixes Bryan O'Donoghue

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.