* [PATCH RFC v3 01/11] media: dt-bindings: venus: Add qcom,msm8939 schema
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-28 6:58 ` Bryan O'Donoghue
2026-04-27 17:58 ` [PATCH RFC v3 02/11] media: qcom: venus: add pmdomains to the struct based on the purpose of cores Erikas Bitovtas
` (9 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
From: André Apitzsch <git@apitzsch.eu>
Add a schema description for the Venus video decoder/encoder IP in
MSM8939.
Signed-off-by: André Apitzsch <git@apitzsch.eu>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
.../bindings/media/qcom,msm8939-venus.yaml | 147 +++++++++++++++++++++
1 file changed, 147 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml b/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml
new file mode 100644
index 000000000000..5790b3bf5aef
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml
@@ -0,0 +1,147 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/qcom,msm8939-venus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm MSM8939 Venus video encode and decode accelerators
+
+maintainers:
+ - André Apitzsch <git@apitzsch.eu>
+ - Erikas Bitovtas <xerikasxx@gmail.com>
+
+description: |
+ The Venus IP is a video encode and decode accelerator present
+ on Qualcomm platforms
+
+allOf:
+ - $ref: qcom,venus-common.yaml#
+
+properties:
+ compatible:
+ const: qcom,msm8939-venus
+
+ power-domains:
+ maxItems: 1
+
+ clocks:
+ maxItems: 3
+
+ clock-names:
+ items:
+ - const: core
+ - const: iface
+ - const: bus
+
+ iommus:
+ maxItems: 1
+
+ video-decoder:
+ type: object
+
+ properties:
+ compatible:
+ const: venus-decoder
+
+ clocks:
+ maxItems: 2
+
+ clock-names:
+ items:
+ - const: core0
+ - const: core1
+
+ power-domains:
+ maxItems: 2
+
+ power-domain-names:
+ items:
+ - const: core0
+ - const: core1
+
+ required:
+ - compatible
+ - clocks
+ - clock-names
+ - power-domains
+ - power-domain-names
+
+ additionalProperties: false
+
+ video-encoder:
+ type: object
+
+ properties:
+ compatible:
+ const: venus-encoder
+
+ clocks:
+ maxItems: 2
+
+ clock-names:
+ items:
+ - const: core0
+ - const: core1
+
+ power-domains:
+ maxItems: 2
+
+ power-domain-names:
+ items:
+ - const: core0
+ - const: core1
+
+ required:
+ - compatible
+ - clocks
+ - clock-names
+ - power-domains
+ - power-domain-names
+
+ additionalProperties: false
+
+required:
+ - compatible
+ - iommus
+ - video-decoder
+ - video-encoder
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/qcom,gcc-msm8939.h>
+
+ video-codec@1d00000 {
+ compatible = "qcom,msm8939-venus";
+ reg = <0x01d00000 0xff000>;
+ interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>,
+ <&gcc GCC_VENUS0_AHB_CLK>,
+ <&gcc GCC_VENUS0_AXI_CLK>;
+ clock-names = "core", "iface", "bus";
+ power-domains = <&gcc VENUS_GDSC>;
+ iommus = <&apps_iommu 5>;
+ memory-region = <&venus_mem>;
+
+ video-decoder {
+ compatible = "venus-decoder";
+ clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
+ <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
+ clock-names = "core0", "core1";
+ power-domains = <&gcc VENUS_CORE0_GDSC>,
+ <&gcc VENUS_CORE1_GDSC>;
+ power-domain-names = "core0", "core1";
+ };
+
+ video-encoder {
+ compatible = "venus-encoder";
+ clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
+ <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
+ clock-names = "core0", "core1";
+ power-domains = <&gcc VENUS_CORE0_GDSC>,
+ <&gcc VENUS_CORE1_GDSC>;
+ power-domain-names = "core0", "core1";
+ };
+ };
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH RFC v3 01/11] media: dt-bindings: venus: Add qcom,msm8939 schema
2026-04-27 17:58 ` [PATCH RFC v3 01/11] media: dt-bindings: venus: Add qcom,msm8939 schema Erikas Bitovtas
@ 2026-04-28 6:58 ` Bryan O'Donoghue
0 siblings, 0 replies; 16+ messages in thread
From: Bryan O'Donoghue @ 2026-04-28 6:58 UTC (permalink / raw)
To: Erikas Bitovtas, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel
On 27/04/2026 18:58, Erikas Bitovtas wrote:
> + video-encoder:
> + type: object
> +
> + properties:
> + compatible:
> + const: venus-encoder
This should be dropped.
The new way is to declare encoder/decoder inline in the driver, I
pointed this out to you at the last revision.
---
bod
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH RFC v3 02/11] media: qcom: venus: add pmdomains to the struct based on the purpose of cores
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 01/11] media: dt-bindings: venus: Add qcom,msm8939 schema Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 03/11] media: qcom: venus: Add msm8939 resource struct Erikas Bitovtas
` (8 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
Add vcodec0_pmdomains and vcodec1_pmdomains to indicate power domains
for Venus cores.
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
drivers/media/platform/qcom/venus/core.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 7506f5d0f609..1a919439abc1 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -80,6 +80,8 @@ struct venus_resources {
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 char **vcodec0_pmdomains;
+ const char **vcodec1_pmdomains;
const char **vcodec_pmdomains;
unsigned int vcodec_pmdomains_num;
const char **opp_pmdomain;
@@ -144,6 +146,8 @@ struct venus_format {
* @vcodec1_clks: an array of vcodec1 struct clk pointers
* @video_path: an interconnect handle to video to/from memory path
* @cpucfg_path: an interconnect handle to cpu configuration path
+ * @vcodec0_pmdomans: a pointer to a list of pmdomains for vcodec0 cores
+ * @vcodec1_pmdomans: a pointer to a list of pmdomains for vcodec1 cores
* @pmdomains: a pointer to a list of pmdomains
* @opp_pmdomain: an OPP power-domain
* @resets: an array of reset signals
@@ -198,6 +202,8 @@ struct venus_core {
struct clk *vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX];
struct icc_path *video_path;
struct icc_path *cpucfg_path;
+ struct dev_pm_domain_list *vcodec0_pmdomains;
+ struct dev_pm_domain_list *vcodec1_pmdomains;
struct dev_pm_domain_list *pmdomains;
struct dev_pm_domain_list *opp_pmdomain;
struct reset_control *resets[VIDC_RESETS_NUM_MAX];
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RFC v3 03/11] media: qcom: venus: Add msm8939 resource struct
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 01/11] media: dt-bindings: venus: Add qcom,msm8939 schema Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 02/11] media: qcom: venus: add pmdomains to the struct based on the purpose of cores Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 04/11] arm64: dts: qcom: msm8939: Add venus node Erikas Bitovtas
` (7 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas,
Dmitry Baryshkov
From: André Apitzsch <git@apitzsch.eu>
Add msm8939 configuration data and related compatible.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: André Apitzsch <git@apitzsch.eu>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
drivers/media/platform/qcom/venus/core.c | 40 ++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 7e639760c41d..5bd3ad21b366 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -688,6 +688,45 @@ static const struct venus_resources msm8916_res = {
.enc_nodename = "video-encoder",
};
+static const struct freq_tbl msm8939_freq_table[] = {
+ { 489600, 266670000 }, /* 1080p @ 60 */
+ { 244800, 133330000 }, /* 1080p @ 30 */
+ { 244800, 200000000 }, /* 1080p @ 30 */
+ { 220800, 133330000 }, /* 720p @ 60 */
+ { 108000, 133330000 }, /* 720p @ 30 */
+ { 108000, 200000000 }, /* 720p @ 30 */
+ { 72000, 133330000 }, /* VGA @ 60 */
+ { 36000, 133330000 }, /* VGA @ 30 */
+};
+
+static const struct reg_val msm8939_reg_preset[] = {
+ { 0xe0020, 0x0aaaaaaa },
+ { 0xe0024, 0x0aaaaaaa },
+ { 0x80124, 0x00000003 },
+};
+
+static const struct venus_resources msm8939_res = {
+ .freq_tbl = msm8939_freq_table,
+ .freq_tbl_size = ARRAY_SIZE(msm8939_freq_table),
+ .reg_tbl = msm8939_reg_preset,
+ .reg_tbl_size = ARRAY_SIZE(msm8939_reg_preset),
+ .clks = { "core", "iface", "bus", },
+ .clks_num = 3,
+ .vcodec0_clks = { "core0", "core1" },
+ .vcodec1_clks = { "core0", "core1" },
+ .vcodec_clks_num = 2,
+ .vcodec0_pmdomains = (const char *[]) { "core0", "core1" },
+ .vcodec1_pmdomains = (const char *[]) { "core0", "core1" },
+ .vcodec_pmdomains_num = 2,
+ .max_load = 489600, /* 1080p@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.mbn",
+};
+
static const struct freq_tbl msm8996_freq_table[] = {
{ 1944000, 520000000 }, /* 4k UHD @ 60 (decode only) */
{ 972000, 520000000 }, /* 4k UHD @ 30 */
@@ -1121,6 +1160,7 @@ static const struct venus_resources qcm2290_res = {
static const struct of_device_id venus_dt_match[] = {
{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
+ { .compatible = "qcom,msm8939-venus", .data = &msm8939_res, },
{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
{ .compatible = "qcom,msm8998-venus", .data = &msm8998_res, },
{ .compatible = "qcom,qcm2290-venus", .data = &qcm2290_res, },
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RFC v3 04/11] arm64: dts: qcom: msm8939: Add venus node
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (2 preceding siblings ...)
2026-04-27 17:58 ` [PATCH RFC v3 03/11] media: qcom: venus: Add msm8939 resource struct Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-28 7:10 ` Bryan O'Donoghue
2026-04-27 17:58 ` [PATCH RFC v3 05/11] arm64: dts: qcom: msm8939-longcheer-l9100: Enable " Erikas Bitovtas
` (6 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
From: André Apitzsch <git@apitzsch.eu>
Add DT entries for the msm8939 venus encoder/decoder.
Signed-off-by: André Apitzsch <git@apitzsch.eu>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
arch/arm64/boot/dts/qcom/msm8939.dtsi | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi b/arch/arm64/boot/dts/qcom/msm8939.dtsi
index d4d7b0c9206c..6b295d3f8256 100644
--- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
@@ -1627,6 +1627,40 @@ opp-19200000 {
};
};
+ venus: video-codec@1d00000 {
+ compatible = "qcom,msm8939-venus";
+ reg = <0x01d00000 0xff000>;
+ interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>,
+ <&gcc GCC_VENUS0_AHB_CLK>,
+ <&gcc GCC_VENUS0_AXI_CLK>;
+ clock-names = "core", "iface", "bus";
+ power-domains = <&gcc VENUS_GDSC>;
+ iommus = <&apps_iommu 5>;
+ memory-region = <&venus_mem>;
+ status = "disabled";
+
+ video-decoder {
+ compatible = "venus-decoder";
+ clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
+ <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
+ clock-names = "core0", "core1";
+ power-domains = <&gcc VENUS_CORE0_GDSC>,
+ <&gcc VENUS_CORE1_GDSC>;
+ power-domain-names = "core0", "core1";
+ };
+
+ video-encoder {
+ compatible = "venus-encoder";
+ clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
+ <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
+ clock-names = "core0", "core1";
+ power-domains = <&gcc VENUS_CORE0_GDSC>,
+ <&gcc VENUS_CORE1_GDSC>;
+ power-domain-names = "core0", "core1";
+ };
+ };
+
apps_iommu: iommu@1ef0000 {
compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
reg = <0x01ef0000 0x3000>;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* Re: [PATCH RFC v3 04/11] arm64: dts: qcom: msm8939: Add venus node
2026-04-27 17:58 ` [PATCH RFC v3 04/11] arm64: dts: qcom: msm8939: Add venus node Erikas Bitovtas
@ 2026-04-28 7:10 ` Bryan O'Donoghue
2026-04-28 9:47 ` Erikas Bitovtas
0 siblings, 1 reply; 16+ messages in thread
From: Bryan O'Donoghue @ 2026-04-28 7:10 UTC (permalink / raw)
To: Erikas Bitovtas, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel
On 27/04/2026 18:58, Erikas Bitovtas wrote:
> + video-decoder {
> + compatible = "venus-decoder";
> + clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
> + <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
> + clock-names = "core0", "core1";
> + power-domains = <&gcc VENUS_CORE0_GDSC>,
> + <&gcc VENUS_CORE1_GDSC>;
> + power-domain-names = "core0", "core1";
> + };
> +
> + video-encoder {
> + compatible = "venus-encoder";
> + clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
> + <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
> + clock-names = "core0", "core1";
> + power-domains = <&gcc VENUS_CORE0_GDSC>,
> + <&gcc VENUS_CORE1_GDSC>;
> + power-domain-names = "core0", "core1";
> + };
So to be fair in this case you do have a reason to have an encoder and
decoder compatible here _but_ it should be the case that one one of the
sub-devices contains CORE0 related stuff and the other CORE1 related stuff.
Because in that case the sub-devices actually represent individual
hardware settings.
So listing power-domains and clocks for both cores in each node like
this militates against that.
The other thing is to double check of the encoder and decoder are
inter-changable here i.e. can either core be encoder or decoder or is it
fixed ?
I believe on older generations - perhaps not on 8939 it is not
interchangable.
If it is interchangable then declaring either node specifically encoder
or decoder is incorrect so you should declare that inline in venus itself.
Perhaps Vikash or Dikshita could confirm whether or not the cores have
fixed encoder/decoder functionality.
TBH I think you should stick to the inline declaration.
---
bod
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH RFC v3 04/11] arm64: dts: qcom: msm8939: Add venus node
2026-04-28 7:10 ` Bryan O'Donoghue
@ 2026-04-28 9:47 ` Erikas Bitovtas
2026-04-28 13:36 ` Bryan O'Donoghue
0 siblings, 1 reply; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-28 9:47 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel
On 4/28/26 10:10 AM, Bryan O'Donoghue wrote:
> On 27/04/2026 18:58, Erikas Bitovtas wrote:
>> + video-decoder {
>> + compatible = "venus-decoder";
>> + clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
>> + <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
>> + clock-names = "core0", "core1";
>> + power-domains = <&gcc VENUS_CORE0_GDSC>,
>> + <&gcc VENUS_CORE1_GDSC>;
>> + power-domain-names = "core0", "core1";
>> + };
>> +
>> + video-encoder {
>> + compatible = "venus-encoder";
>> + clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
>> + <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
>> + clock-names = "core0", "core1";
>> + power-domains = <&gcc VENUS_CORE0_GDSC>,
>> + <&gcc VENUS_CORE1_GDSC>;
>> + power-domain-names = "core0", "core1";
>> + };
>
> So to be fair in this case you do have a reason to have an encoder and
> decoder compatible here _but_ it should be the case that one one of the
> sub-devices contains CORE0 related stuff and the other CORE1 related stuff.
>
> Because in that case the sub-devices actually represent individual
> hardware settings.
>
> So listing power-domains and clocks for both cores in each node like
> this militates against that.
>
> The other thing is to double check of the encoder and decoder are inter-
> changable here i.e. can either core be encoder or decoder or is it fixed ?
>
> I believe on older generations - perhaps not on 8939 it is not
> interchangable.
>
I found this in LA.BR.1.2.9.1_rb1.5:
https://github.com/msm8916-mainline/linux-downstream/blob/b20608408caff817ec874f325127b07609fbaeb8/arch/arm/boot/dts/qcom/msm8939-common.dtsi#L1589
Only decoder bits are being set in bus configs. This suggests that the
cores are not interchangeable.
Then again, I never managed to get encoding working on MSM8939. Testing
it with
gst-launch-1.0 videotestsrc ! videoconvert ! v4l2vp8enc ! queue !
v4l2vp8dec ! xvimagesink
Fails with the following log: https://pastebin.com/nmZcLgPV
And in dmesg it reports a firmware error:
[ 784.461031] qcom-venus 1d00000.video-codec: no valid instance(pkt
session_id:dead, pkt:21001)
[ 784.461126] qcom-venus-decoder 1d00000.video-codec:video-decoder:
dec: event session error 0
[ 784.461200] qcom-venus-encoder 1d00000.video-codec:video-encoder:
enc: event session error 0
[ 784.468799] qcom-venus 1d00000.video-codec: SFR message from FW:
QC_IMAGE_VERSION_STRING=VIDEO.VE.1.8-00099, Err_Fatal -
Z:\b\venus\utils\src\vbuffer.c:1319:
[ 785.791641] qcom-venus 1d00000.video-codec: System error has
occurred, recovery failed to init HFI
[ 787.018339] qcom-venus 1d00000.video-codec: System error has
occurred, recovery failed to init HFI
[ 787.097253] qcom-venus 1d00000.video-codec: system error has occurred
(recovered)
This happens regardless of whether I enable the cores for encoding too
or not. The same errors were happening on MSM8916 as well. So I can't
tell if these cores are interchangeable just by testing.
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH RFC v3 04/11] arm64: dts: qcom: msm8939: Add venus node
2026-04-28 9:47 ` Erikas Bitovtas
@ 2026-04-28 13:36 ` Bryan O'Donoghue
0 siblings, 0 replies; 16+ messages in thread
From: Bryan O'Donoghue @ 2026-04-28 13:36 UTC (permalink / raw)
To: Erikas Bitovtas, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel
On 28/04/2026 10:47, Erikas Bitovtas wrote:
>
>
> On 4/28/26 10:10 AM, Bryan O'Donoghue wrote:
>> On 27/04/2026 18:58, Erikas Bitovtas wrote:
>>> + video-decoder {
>>> + compatible = "venus-decoder";
>>> + clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
>>> + <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
>>> + clock-names = "core0", "core1";
>>> + power-domains = <&gcc VENUS_CORE0_GDSC>,
>>> + <&gcc VENUS_CORE1_GDSC>;
>>> + power-domain-names = "core0", "core1";
>>> + };
>>> +
>>> + video-encoder {
>>> + compatible = "venus-encoder";
>>> + clocks = <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
>>> + <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
>>> + clock-names = "core0", "core1";
>>> + power-domains = <&gcc VENUS_CORE0_GDSC>,
>>> + <&gcc VENUS_CORE1_GDSC>;
>>> + power-domain-names = "core0", "core1";
>>> + };
>>
>> So to be fair in this case you do have a reason to have an encoder and
>> decoder compatible here _but_ it should be the case that one one of the
>> sub-devices contains CORE0 related stuff and the other CORE1 related stuff.
>>
>> Because in that case the sub-devices actually represent individual
>> hardware settings.
>>
>> So listing power-domains and clocks for both cores in each node like
>> this militates against that.
>>
>> The other thing is to double check of the encoder and decoder are inter-
>> changable here i.e. can either core be encoder or decoder or is it fixed ?
>>
>> I believe on older generations - perhaps not on 8939 it is not
>> interchangable.
>>
> I found this in LA.BR.1.2.9.1_rb1.5:
> https://github.com/msm8916-mainline/linux-downstream/blob/b20608408caff817ec874f325127b07609fbaeb8/arch/arm/boot/dts/qcom/msm8939-common.dtsi#L1589
> Only decoder bits are being set in bus configs. This suggests that the
> cores are not interchangeable.
> Then again, I never managed to get encoding working on MSM8939. Testing
> it with
> gst-launch-1.0 videotestsrc ! videoconvert ! v4l2vp8enc ! queue !
> v4l2vp8dec ! xvimagesink
> Fails with the following log: https://pastebin.com/nmZcLgPV
> And in dmesg it reports a firmware error:
> [ 784.461031] qcom-venus 1d00000.video-codec: no valid instance(pkt
> session_id:dead, pkt:21001)
> [ 784.461126] qcom-venus-decoder 1d00000.video-codec:video-decoder:
> dec: event session error 0
> [ 784.461200] qcom-venus-encoder 1d00000.video-codec:video-encoder:
> enc: event session error 0
> [ 784.468799] qcom-venus 1d00000.video-codec: SFR message from FW:
> QC_IMAGE_VERSION_STRING=VIDEO.VE.1.8-00099, Err_Fatal -
> Z:\b\venus\utils\src\vbuffer.c:1319:
> [ 785.791641] qcom-venus 1d00000.video-codec: System error has
> occurred, recovery failed to init HFI
> [ 787.018339] qcom-venus 1d00000.video-codec: System error has
> occurred, recovery failed to init HFI
> [ 787.097253] qcom-venus 1d00000.video-codec: system error has occurred
> (recovered)
> This happens regardless of whether I enable the cores for encoding too
> or not. The same errors were happening on MSM8916 as well. So I can't
> tell if these cores are interchangeable just by testing.
Right so if you swap around the definition of which core is encoder and
which decoder do you get the same or different result ?
i.e. is it because you are trying to get encoder running generally or
because of the core you are doing it on ?
How about declaring both cores a decoder ?
---
bod
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH RFC v3 05/11] arm64: dts: qcom: msm8939-longcheer-l9100: Enable venus node
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (3 preceding siblings ...)
2026-04-27 17:58 ` [PATCH RFC v3 04/11] arm64: dts: qcom: msm8939: Add venus node Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 06/11] arm64: dts: qcom: msm8939-asus-z00t: add Venus Erikas Bitovtas
` (5 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
From: André Apitzsch <git@apitzsch.eu>
Enable the venus node so that the video encoder/decoder will start
working.
Default paths for firmware work on BQ Aquaris M5, which means
firmware-name property can be left out.
Signed-off-by: André Apitzsch <git@apitzsch.eu>
---
arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts b/arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts
index 13422a19c26a..48514c3df718 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-longcheer-l9100.dts
@@ -314,6 +314,14 @@ &usb_hs_phy {
extcon = <&usb_id>;
};
+&venus {
+ status = "okay";
+};
+
+&venus_mem {
+ status = "okay";
+};
+
&wcnss {
status = "okay";
};
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RFC v3 06/11] arm64: dts: qcom: msm8939-asus-z00t: add Venus
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (4 preceding siblings ...)
2026-04-27 17:58 ` [PATCH RFC v3 05/11] arm64: dts: qcom: msm8939-longcheer-l9100: Enable " Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 07/11] clk: qcom: gcc-msm8939: mark Venus core GDSCs as hardware controlled Erikas Bitovtas
` (4 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
Enable Venus video encoder/decoder for Asus ZenFone 2 Laser/Selfie.
Default firmware paths work on Asus ZenFone 2 Laser/Selfie, which
means firmware-name property can be left out.
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
index 90e966242720..231a3e9c1929 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
@@ -267,6 +267,14 @@ &usb_hs_phy {
extcon = <&usb_id>;
};
+&venus {
+ status = "okay";
+};
+
+&venus_mem {
+ status = "okay";
+};
+
&wcnss {
status = "okay";
};
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RFC v3 07/11] clk: qcom: gcc-msm8939: mark Venus core GDSCs as hardware controlled
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (5 preceding siblings ...)
2026-04-27 17:58 ` [PATCH RFC v3 06/11] arm64: dts: qcom: msm8939-asus-z00t: add Venus Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 08/11] media: qcom: venus: move getting vdec and venc for later Erikas Bitovtas
` (3 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
Since in downstream kernel VENUS_CORE0_GDSC and VENUS_CORE1_GDSC have a
device tree property "qcom,supports-hw-trigger", add a HW_CTRL flag
to these GDSCs to indicate that they are hardware controlled.
Venus core clock cannot be enabled if Venus core GDSCs are switched off.
But since they are hardware controlled, they can be switched off at
any moment. Vote for the Venus core clock to enable it later when GDSCs
get turned on.
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
drivers/clk/qcom/gcc-msm8939.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/clk/qcom/gcc-msm8939.c b/drivers/clk/qcom/gcc-msm8939.c
index 45193b3d714b..420997b00ae0 100644
--- a/drivers/clk/qcom/gcc-msm8939.c
+++ b/drivers/clk/qcom/gcc-msm8939.c
@@ -3664,6 +3664,7 @@ static struct clk_branch gcc_venus0_vcodec0_clk = {
static struct clk_branch gcc_venus0_core0_vcodec0_clk = {
.halt_reg = 0x4c02c,
+ .halt_check = BRANCH_HALT_SKIP,
.clkr = {
.enable_reg = 0x4c02c,
.enable_mask = BIT(0),
@@ -3681,6 +3682,7 @@ static struct clk_branch gcc_venus0_core0_vcodec0_clk = {
static struct clk_branch gcc_venus0_core1_vcodec0_clk = {
.halt_reg = 0x4c034,
+ .halt_check = BRANCH_HALT_SKIP,
.clkr = {
.enable_reg = 0x4c034,
.enable_mask = BIT(0),
@@ -3753,6 +3755,7 @@ static struct gdsc venus_core0_gdsc = {
.pd = {
.name = "venus_core0",
},
+ .flags = HW_CTRL,
.pwrsts = PWRSTS_OFF_ON,
};
@@ -3761,6 +3764,7 @@ static struct gdsc venus_core1_gdsc = {
.pd = {
.name = "venus_core1",
},
+ .flags = HW_CTRL,
.pwrsts = PWRSTS_OFF_ON,
};
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RFC v3 08/11] media: qcom: venus: move getting vdec and venc for later
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (6 preceding siblings ...)
2026-04-27 17:58 ` [PATCH RFC v3 07/11] clk: qcom: gcc-msm8939: mark Venus core GDSCs as hardware controlled Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 09/11] media: qcom: venus: Move HFI v3 venc and vdec methods to HFI v1 Erikas Bitovtas
` (2 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
Call vdec_get() and venc_get() later in the probe so dev_dec and dev_enc
are initialized when getting clocks and power domains. This allows us to
attach necessary power domains to dev_dec and dev_enc.
This is required for the subsequent patch which adds power domains for
HFI v1 and attaches them to dev_dec and dev_enc.
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
drivers/media/platform/qcom/venus/vdec.c | 12 ++++++------
drivers/media/platform/qcom/venus/venc.c | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index daa8f56610c7..a4aacf5e535b 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1792,12 +1792,6 @@ 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 (ret)
- return ret;
- }
-
vdev = video_device_alloc();
if (!vdev)
return -ENOMEM;
@@ -1817,6 +1811,12 @@ static int vdec_probe(struct platform_device *pdev)
core->vdev_dec = vdev;
core->dev_dec = dev;
+ if (core->pm_ops->vdec_get) {
+ ret = core->pm_ops->vdec_get(dev);
+ if (ret)
+ return ret;
+ }
+
video_set_drvdata(vdev, core);
pm_runtime_set_autosuspend_delay(dev, 2000);
pm_runtime_use_autosuspend(dev);
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index bf53267cb68d..5f6844d3d9d0 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -1568,12 +1568,6 @@ 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 (ret)
- return ret;
- }
-
vdev = video_device_alloc();
if (!vdev)
return -ENOMEM;
@@ -1593,6 +1587,12 @@ static int venc_probe(struct platform_device *pdev)
core->vdev_enc = vdev;
core->dev_enc = dev;
+ if (core->pm_ops->venc_get) {
+ ret = core->pm_ops->venc_get(dev);
+ if (ret)
+ return ret;
+ }
+
video_set_drvdata(vdev, core);
pm_runtime_set_autosuspend_delay(dev, 2000);
pm_runtime_use_autosuspend(dev);
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RFC v3 09/11] media: qcom: venus: Move HFI v3 venc and vdec methods to HFI v1
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (7 preceding siblings ...)
2026-04-27 17:58 ` [PATCH RFC v3 08/11] media: qcom: venus: move getting vdec and venc for later Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 10/11] media: qcom: venus: add power domain enable logic for Venus cores Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 11/11] media: qcom: venus: Enable HEVC decoding for MSM8939 Erikas Bitovtas
10 siblings, 0 replies; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
Some Qualcomm SoCs which come with HFI v1 like MSM8909 and MSM8939 also
have dedicated cores for Venus, like in HFI v3. Move methods from HFI v3
to HFI v1 so they can be reused.
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
drivers/media/platform/qcom/venus/pm_helpers.c | 66 +++++++++++++++++++-------
1 file changed, 48 insertions(+), 18 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index f0269524ac70..cc21a4762188 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -328,10 +328,56 @@ static int core_power_v1(struct venus_core *core, int on)
return ret;
}
+static int vdec_get_v1(struct device *dev)
+{
+ struct venus_core *core = dev_get_drvdata(dev);
+
+ return vcodec_clks_get(core, dev, core->vcodec0_clks,
+ core->res->vcodec0_clks);
+}
+
+static int vdec_power_v1(struct device *dev, int on)
+{
+ struct venus_core *core = dev_get_drvdata(dev);
+ int ret = 0;
+
+ if (on == POWER_ON)
+ ret = vcodec_clks_enable(core, core->vcodec0_clks);
+ else
+ vcodec_clks_disable(core, core->vcodec0_clks);
+
+ return ret;
+}
+
+static int venc_get_v1(struct device *dev)
+{
+ struct venus_core *core = dev_get_drvdata(dev);
+
+ return vcodec_clks_get(core, dev, core->vcodec1_clks,
+ core->res->vcodec1_clks);
+}
+
+static int venc_power_v1(struct device *dev, int on)
+{
+ struct venus_core *core = dev_get_drvdata(dev);
+ int ret = 0;
+
+ if (on == POWER_ON)
+ ret = vcodec_clks_enable(core, core->vcodec1_clks);
+ else
+ vcodec_clks_disable(core, core->vcodec1_clks);
+
+ return ret;
+}
+
static const struct venus_pm_ops pm_ops_v1 = {
.core_get = core_get_v1,
.core_put = core_put_v1,
.core_power = core_power_v1,
+ .vdec_get = vdec_get_v1,
+ .vdec_power = vdec_power_v1,
+ .venc_get = venc_get_v1,
+ .venc_power = venc_power_v1,
.load_scale = load_scale_v1,
};
@@ -351,14 +397,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, core->vcodec0_clks,
- core->res->vcodec0_clks);
-}
-
static int vdec_power_v3(struct device *dev, int on)
{
struct venus_core *core = dev_get_drvdata(dev);
@@ -376,14 +414,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, core->vcodec1_clks,
- core->res->vcodec1_clks);
-}
-
static int venc_power_v3(struct device *dev, int on)
{
struct venus_core *core = dev_get_drvdata(dev);
@@ -405,9 +435,9 @@ 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_get = vdec_get_v1,
.vdec_power = vdec_power_v3,
- .venc_get = venc_get_v3,
+ .venc_get = venc_get_v1,
.venc_power = venc_power_v3,
.load_scale = load_scale_v1,
};
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RFC v3 10/11] media: qcom: venus: add power domain enable logic for Venus cores
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (8 preceding siblings ...)
2026-04-27 17:58 ` [PATCH RFC v3 09/11] media: qcom: venus: Move HFI v3 venc and vdec methods to HFI v1 Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
2026-04-27 17:58 ` [PATCH RFC v3 11/11] media: qcom: venus: Enable HEVC decoding for MSM8939 Erikas Bitovtas
10 siblings, 0 replies; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
Attach power domains for vdec and venc cores and power them up if a vdec
or venc session is started.
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
drivers/media/platform/qcom/venus/pm_helpers.c | 121 ++++++++++++++++++++++++-
1 file changed, 119 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index cc21a4762188..41272c194a6d 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -246,6 +246,94 @@ static int load_scale_bw(struct venus_core *core)
return icc_set_bw(core->video_path, total_avg, total_peak);
}
+static int vcodec_domains_get_v1(struct venus_core *core, struct device *dev,
+ struct dev_pm_domain_list **pmdomains,
+ const char **pmdomain_names,
+ unsigned int pmdomains_num)
+{
+ int ret;
+ struct dev_pm_domain_attach_data vcodec_data = {
+ .pd_names = pmdomain_names,
+ .num_pd_names = pmdomains_num,
+ .pd_flags = PD_FLAG_NO_DEV_LINK,
+ };
+
+ if (!pmdomain_names)
+ return 0;
+
+ ret = devm_pm_domain_attach_list(dev, &vcodec_data, pmdomains);
+ return ret;
+}
+
+static int vdec_domains_attach(struct venus_core *core)
+{
+ struct device *dev = core->dev_dec;
+ const struct venus_resources *res = core->res;
+
+ return vcodec_domains_get_v1(core, dev, &core->vcodec0_pmdomains,
+ res->vcodec0_pmdomains,
+ res->vcodec_pmdomains_num);
+}
+
+static int venc_domains_attach(struct venus_core *core)
+{
+ struct device *dev = core->dev_enc;
+ const struct venus_resources *res = core->res;
+
+ return vcodec_domains_get_v1(core, dev, &core->vcodec1_pmdomains,
+ res->vcodec1_pmdomains,
+ res->vcodec_pmdomains_num);
+}
+
+static int vcodec_domains_enable_v1(struct venus_core *core,
+ struct dev_pm_domain_list *pmdomains,
+ unsigned int pmdomains_num)
+{
+ int i, ret;
+
+ if (!pmdomains)
+ return 0;
+
+ for (i = 0; i < pmdomains_num; i++) {
+ ret = pm_runtime_resume_and_get(pmdomains->pd_devs[i]);
+ if (ret)
+ goto err;
+ }
+
+ return ret;
+
+err:
+ while (i--)
+ pm_runtime_put_sync(pmdomains->pd_devs[i]);
+
+ return ret;
+}
+
+static int vdec_domains_get(struct venus_core *core)
+{
+ const struct venus_resources *res = core->res;
+
+ return vcodec_domains_enable_v1(core, core->vcodec0_pmdomains,
+ res->vcodec_pmdomains_num);
+}
+
+static int venc_domains_get(struct venus_core *core)
+{
+ const struct venus_resources *res = core->res;
+
+ return vcodec_domains_enable_v1(core, core->vcodec1_pmdomains,
+ res->vcodec_pmdomains_num);
+}
+
+static void vcodec_domains_put_v1(struct dev_pm_domain_list *pmdomains,
+ unsigned int pmdomains_num)
+{
+ unsigned int i = pmdomains_num;
+
+ while (i--)
+ pm_runtime_put_sync(pmdomains->pd_devs[i]);
+}
+
static int load_scale_v1(struct venus_inst *inst)
{
struct venus_core *core = inst->core;
@@ -331,6 +419,11 @@ static int core_power_v1(struct venus_core *core, int on)
static int vdec_get_v1(struct device *dev)
{
struct venus_core *core = dev_get_drvdata(dev);
+ int ret;
+
+ ret = vdec_domains_attach(core);
+ if (ret < 0)
+ return ret;
return vcodec_clks_get(core, dev, core->vcodec0_clks,
core->res->vcodec0_clks);
@@ -339,8 +432,18 @@ static int vdec_get_v1(struct device *dev)
static int vdec_power_v1(struct device *dev, int on)
{
struct venus_core *core = dev_get_drvdata(dev);
+ const struct venus_resources *res = core->res;
int ret = 0;
+ if (on == POWER_ON)
+ ret = vdec_domains_get(core);
+ else
+ vcodec_domains_put_v1(core->vcodec0_pmdomains,
+ res->vcodec_pmdomains_num);
+
+ if (ret)
+ return ret;
+
if (on == POWER_ON)
ret = vcodec_clks_enable(core, core->vcodec0_clks);
else
@@ -352,6 +455,11 @@ static int vdec_power_v1(struct device *dev, int on)
static int venc_get_v1(struct device *dev)
{
struct venus_core *core = dev_get_drvdata(dev);
+ int ret;
+
+ ret = venc_domains_attach(core);
+ if (ret < 0)
+ return ret;
return vcodec_clks_get(core, dev, core->vcodec1_clks,
core->res->vcodec1_clks);
@@ -360,8 +468,17 @@ static int venc_get_v1(struct device *dev)
static int venc_power_v1(struct device *dev, int on)
{
struct venus_core *core = dev_get_drvdata(dev);
+ const struct venus_resources *res = core->res;
int ret = 0;
+ if (on == POWER_ON)
+ ret = venc_domains_get(core);
+ else
+ vcodec_domains_put_v1(core->vcodec1_pmdomains,
+ res->vcodec_pmdomains_num);
+ if (ret)
+ return ret;
+
if (on == POWER_ON)
ret = vcodec_clks_enable(core, core->vcodec1_clks);
else
@@ -905,7 +1022,7 @@ static int venc_power_v4(struct device *dev, int on)
return ret;
}
-static int vcodec_domains_get(struct venus_core *core)
+static int vcodec_domains_get_v4(struct venus_core *core)
{
int ret;
struct device *dev = core->dev;
@@ -1023,7 +1140,7 @@ static int core_get_v4(struct venus_core *core)
if (ret)
return ret;
- ret = vcodec_domains_get(core);
+ ret = vcodec_domains_get_v4(core);
if (ret)
return ret;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread* [PATCH RFC v3 11/11] media: qcom: venus: Enable HEVC decoding for MSM8939
2026-04-27 17:58 [PATCH RFC v3 00/11] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (9 preceding siblings ...)
2026-04-27 17:58 ` [PATCH RFC v3 10/11] media: qcom: venus: add power domain enable logic for Venus cores Erikas Bitovtas
@ 2026-04-27 17:58 ` Erikas Bitovtas
10 siblings, 0 replies; 16+ messages in thread
From: Erikas Bitovtas @ 2026-04-27 17:58 UTC (permalink / raw)
To: Bryan O'Donoghue, Vikash Garodia, Dikshita Agarwal,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, André Apitzsch, Bjorn Andersson, Konrad Dybcio,
Michael Turquette, Stephen Boyd
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
MSM8939 supports HEVC decoding. Do not disable the HEVC codec HFI bit
and add it to codec type converter method so it can be recognized.
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
drivers/media/platform/qcom/venus/core.c | 2 ++
drivers/media/platform/qcom/venus/hfi_parser.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 5bd3ad21b366..943d498f4e4e 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -178,6 +178,8 @@ static void venus_sys_error_handler(struct work_struct *work)
static u32 to_v4l2_codec_type(u32 codec)
{
switch (codec) {
+ case HFI_VIDEO_CODEC_HEVC:
+ return V4L2_PIX_FMT_HEVC;
case HFI_VIDEO_CODEC_H264:
return V4L2_PIX_FMT_H264;
case HFI_VIDEO_CODEC_H263:
diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c
index 92765f9c8873..178274d10c02 100644
--- a/drivers/media/platform/qcom/venus/hfi_parser.c
+++ b/drivers/media/platform/qcom/venus/hfi_parser.c
@@ -207,7 +207,8 @@ static int parse_codecs(struct venus_core *core, void *data)
core->enc_codecs = codecs->enc_codecs;
if (IS_V1(core)) {
- core->dec_codecs &= ~HFI_VIDEO_CODEC_HEVC;
+ if (!device_is_compatible(core->dev, "qcom,msm8939-venus"))
+ core->dec_codecs &= ~HFI_VIDEO_CODEC_HEVC;
core->dec_codecs &= ~HFI_VIDEO_CODEC_SPARK;
core->enc_codecs &= ~HFI_VIDEO_CODEC_HEVC;
}
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread