* [PATCH v4 1/9] media: dt-bindings: venus: Add qcom,msm8939 schema
2026-05-05 21:44 [PATCH v4 0/9] media: qcom: venus: add MSM8939 support Erikas Bitovtas
@ 2026-05-05 21:44 ` Erikas Bitovtas
2026-05-05 23:26 ` Bryan O'Donoghue
2026-05-06 7:33 ` Krzysztof Kozlowski
2026-05-05 21:44 ` [PATCH v4 2/9] media: qcom: venus: add common clocks used by both vdec and venc Erikas Bitovtas
` (7 subsequent siblings)
8 siblings, 2 replies; 14+ messages in thread
From: Erikas Bitovtas @ 2026-05-05 21:44 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, Brian Masney
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 | 75 ++++++++++++++++++++++
1 file changed, 75 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..5bbc7cfb61c0
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml
@@ -0,0 +1,75 @@
+# 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: 3
+
+ power-domain-names:
+ items:
+ - const: venus
+ - const: core0
+ - const: core1
+
+ clocks:
+ maxItems: 5
+
+ clock-names:
+ items:
+ - const: core
+ - const: iface
+ - const: bus
+ - const: core0
+ - const: core1
+
+ iommus:
+ maxItems: 1
+
+required:
+ - compatible
+ - iommus
+
+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>,
+ <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
+ <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
+ clock-names = "core", "iface", "bus", "core0", "core1";
+ power-domains = <&gcc VENUS_GDSC>,
+ <&gcc VENUS_CORE0_GDSC>,
+ <&gcc VENUS_CORE1_GDSC>;
+ power-domain-names = "venus", "core0", "core1";
+ iommus = <&apps_iommu 5>;
+ memory-region = <&venus_mem>;
+ status = "disabled";
+ };
--
2.54.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4 1/9] media: dt-bindings: venus: Add qcom,msm8939 schema
2026-05-05 21:44 ` [PATCH v4 1/9] media: dt-bindings: venus: Add qcom,msm8939 schema Erikas Bitovtas
@ 2026-05-05 23:26 ` Bryan O'Donoghue
2026-05-06 7:33 ` Krzysztof Kozlowski
1 sibling, 0 replies; 14+ messages in thread
From: Bryan O'Donoghue @ 2026-05-05 23:26 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, Brian Masney
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel
On 05/05/2026 22:44, Erikas Bitovtas wrote:
> +required:
> + - compatible
> + - iommus
This required list looks sparse, patch #8 makes power-domain-names
required here.
---
bod
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 1/9] media: dt-bindings: venus: Add qcom,msm8939 schema
2026-05-05 21:44 ` [PATCH v4 1/9] media: dt-bindings: venus: Add qcom,msm8939 schema Erikas Bitovtas
2026-05-05 23:26 ` Bryan O'Donoghue
@ 2026-05-06 7:33 ` Krzysztof Kozlowski
1 sibling, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-05-06 7:33 UTC (permalink / raw)
To: Erikas Bitovtas
Cc: 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, Brian Masney, linux-media,
linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel
On Wed, May 06, 2026 at 12:44:38AM +0300, Erikas Bitovtas wrote:
> 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 | 75 ++++++++++++++++++++++
> 1 file changed, 75 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..5bbc7cfb61c0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/qcom,msm8939-venus.yaml
> @@ -0,0 +1,75 @@
> +# 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: |
Do not need '|' unless you need to preserve formatting.
> + 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: 3
> +
> + power-domain-names:
> + items:
> + - const: venus
> + - const: core0
vcodec0
> + - const: core1
vcodec1
> +
> + clocks:
> + maxItems: 5
> +
> + clock-names:
> + items:
> + - const: core
> + - const: iface
> + - const: bus
> + - const: core0
vcodec0_core
> + - const: core1
vcodec1_core
To match other bindings.
> +
> + iommus:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - iommus
> +
> +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>,
> + <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
> + <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
> + clock-names = "core", "iface", "bus", "core0", "core1";
> + power-domains = <&gcc VENUS_GDSC>,
> + <&gcc VENUS_CORE0_GDSC>,
> + <&gcc VENUS_CORE1_GDSC>;
> + power-domain-names = "venus", "core0", "core1";
> + iommus = <&apps_iommu 5>;
> + memory-region = <&venus_mem>;
> + status = "disabled";
Examples cannot be disabled. Please add here complete example.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 2/9] media: qcom: venus: add common clocks used by both vdec and venc
2026-05-05 21:44 [PATCH v4 0/9] media: qcom: venus: add MSM8939 support Erikas Bitovtas
2026-05-05 21:44 ` [PATCH v4 1/9] media: dt-bindings: venus: Add qcom,msm8939 schema Erikas Bitovtas
@ 2026-05-05 21:44 ` Erikas Bitovtas
2026-05-06 7:37 ` Krzysztof Kozlowski
2026-05-05 21:44 ` [PATCH v4 3/9] media: qcom: venus: Add msm8939 resource struct Erikas Bitovtas
` (6 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Erikas Bitovtas @ 2026-05-05 21:44 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, Brian Masney
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Erikas Bitovtas
Add clocks which are enabled during both decode and encode. This shall
be used in newer bindings for Venus, where subnodes for video decoder
and video encoder are not included and clocks are not differentiated
between decode and encode.
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
drivers/media/platform/qcom/venus/core.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 7506f5d0f609..c1d772c7ae9b 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -77,6 +77,7 @@ struct venus_resources {
const struct hfi_ubwc_config *ubwc_conf;
const char * const clks[VIDC_CLKS_NUM_MAX];
unsigned int clks_num;
+ const char * const vcodec_clks[VIDC_VCODEC_CLKS_NUM_MAX];
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;
@@ -140,6 +141,7 @@ struct venus_format {
* @aon_base: AON base address
* @irq: Venus irq
* @clks: an array of struct clk pointers
+ * @vcodec_clks: an array of vcodec0 struct clk pointers
* @vcodec0_clks: an array of vcodec0 struct clk pointers
* @vcodec1_clks: an array of vcodec1 struct clk pointers
* @video_path: an interconnect handle to video to/from memory path
@@ -194,6 +196,7 @@ struct venus_core {
void __iomem *aon_base;
int irq;
struct clk *clks[VIDC_CLKS_NUM_MAX];
+ struct clk *vcodec_clks[VIDC_VCODEC_CLKS_NUM_MAX];
struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX];
struct clk *vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX];
struct icc_path *video_path;
--
2.54.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4 2/9] media: qcom: venus: add common clocks used by both vdec and venc
2026-05-05 21:44 ` [PATCH v4 2/9] media: qcom: venus: add common clocks used by both vdec and venc Erikas Bitovtas
@ 2026-05-06 7:37 ` Krzysztof Kozlowski
0 siblings, 0 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2026-05-06 7:37 UTC (permalink / raw)
To: Erikas Bitovtas
Cc: 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, Brian Masney, linux-media,
linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel
On Wed, May 06, 2026 at 12:44:39AM +0300, Erikas Bitovtas wrote:
> Add clocks which are enabled during both decode and encode. This shall
> be used in newer bindings for Venus, where subnodes for video decoder
> and video encoder are not included and clocks are not differentiated
> between decode and encode.
>
> Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
> ---
> drivers/media/platform/qcom/venus/core.h | 3 +++
> 1 file changed, 3 insertions(+)
I still do not understand why this patchset has such mixed arrangement.
First media patches, then SoC, then clock, then again media.
Please follow submitting patches in DT - DTS CANNOT be stuffed in the
middle.
>
> diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
> index 7506f5d0f609..c1d772c7ae9b 100644
> --- a/drivers/media/platform/qcom/venus/core.h
> +++ b/drivers/media/platform/qcom/venus/core.h
> @@ -77,6 +77,7 @@ struct venus_resources {
> const struct hfi_ubwc_config *ubwc_conf;
> const char * const clks[VIDC_CLKS_NUM_MAX];
> unsigned int clks_num;
> + const char * const vcodec_clks[VIDC_VCODEC_CLKS_NUM_MAX];
This is dead code. Drop or organize your patches correctly, so there
will be user of this. Each patch is one logical change. Adding dead code
is not a logical change, because it is unused, thus completely
redundant.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 3/9] media: qcom: venus: Add msm8939 resource struct
2026-05-05 21:44 [PATCH v4 0/9] media: qcom: venus: add MSM8939 support Erikas Bitovtas
2026-05-05 21:44 ` [PATCH v4 1/9] media: dt-bindings: venus: Add qcom,msm8939 schema Erikas Bitovtas
2026-05-05 21:44 ` [PATCH v4 2/9] media: qcom: venus: add common clocks used by both vdec and venc Erikas Bitovtas
@ 2026-05-05 21:44 ` Erikas Bitovtas
2026-05-05 23:33 ` Bryan O'Donoghue
2026-05-05 21:44 ` [PATCH v4 4/9] arm64: dts: qcom: msm8939: Add venus node Erikas Bitovtas
` (5 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Erikas Bitovtas @ 2026-05-05 21:44 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, Brian Masney
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..1871cf3830ac 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,
+ .vcodec_clks = { "core0", "core1" },
+ .vcodec_clks_num = 2,
+ .vcodec_pmdomains = (const char *[]) { "venus", "core0", "core1" },
+ .vcodec_pmdomains_num = 3,
+ .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",
+ .dec_nodename = "video-decoder",
+ .enc_nodename = "video-encoder",
+};
+
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] 14+ messages in thread* Re: [PATCH v4 3/9] media: qcom: venus: Add msm8939 resource struct
2026-05-05 21:44 ` [PATCH v4 3/9] media: qcom: venus: Add msm8939 resource struct Erikas Bitovtas
@ 2026-05-05 23:33 ` Bryan O'Donoghue
0 siblings, 0 replies; 14+ messages in thread
From: Bryan O'Donoghue @ 2026-05-05 23:33 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, Brian Masney
Cc: linux-media, linux-arm-msm, devicetree, linux-kernel, linux-clk,
~postmarketos/upstreaming, phone-devel, Dmitry Baryshkov
On 05/05/2026 22:44, Erikas Bitovtas wrote:
> + .vcodec_clks = { "core0", "core1" },
> + .vcodec_clks_num = 2,
This smells a bit dodgy to me.
You already have
struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX];
struct clk *vcodec1_clks[VIDC_VCODEC_CLKS_NUM_MAX];
so why add vcodec_clks and put core0 and core1 into a new array.
vcodec0_clks and vcodec1_clks seem like a very natural place for core0
and core1 clocks to live ?
---
bod
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 4/9] arm64: dts: qcom: msm8939: Add venus node
2026-05-05 21:44 [PATCH v4 0/9] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (2 preceding siblings ...)
2026-05-05 21:44 ` [PATCH v4 3/9] media: qcom: venus: Add msm8939 resource struct Erikas Bitovtas
@ 2026-05-05 21:44 ` Erikas Bitovtas
2026-05-05 21:44 ` [PATCH v4 5/9] arm64: dts: qcom: msm8939-longcheer-l9100: Enable " Erikas Bitovtas
` (4 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Erikas Bitovtas @ 2026-05-05 21:44 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, Brian Masney
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 | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi b/arch/arm64/boot/dts/qcom/msm8939.dtsi
index d4d7b0c9206c..cc6c4353497e 100644
--- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
@@ -1627,6 +1627,25 @@ 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>,
+ <&gcc GCC_VENUS0_CORE0_VCODEC0_CLK>,
+ <&gcc GCC_VENUS0_CORE1_VCODEC0_CLK>;
+ clock-names = "core", "iface", "bus", "core0", "core1";
+ power-domains = <&gcc VENUS_GDSC>,
+ <&gcc VENUS_CORE0_GDSC>,
+ <&gcc VENUS_CORE1_GDSC>;
+ power-domain-names = "venus", "core0", "core1";
+ iommus = <&apps_iommu 5>;
+ memory-region = <&venus_mem>;
+ status = "disabled";
+ };
+
apps_iommu: iommu@1ef0000 {
compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1";
reg = <0x01ef0000 0x3000>;
--
2.54.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v4 5/9] arm64: dts: qcom: msm8939-longcheer-l9100: Enable venus node
2026-05-05 21:44 [PATCH v4 0/9] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (3 preceding siblings ...)
2026-05-05 21:44 ` [PATCH v4 4/9] arm64: dts: qcom: msm8939: Add venus node Erikas Bitovtas
@ 2026-05-05 21:44 ` Erikas Bitovtas
2026-05-05 21:44 ` [PATCH v4 6/9] arm64: dts: qcom: msm8939-asus-z00t: add Venus Erikas Bitovtas
` (3 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Erikas Bitovtas @ 2026-05-05 21:44 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, Brian Masney
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] 14+ messages in thread* [PATCH v4 6/9] arm64: dts: qcom: msm8939-asus-z00t: add Venus
2026-05-05 21:44 [PATCH v4 0/9] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (4 preceding siblings ...)
2026-05-05 21:44 ` [PATCH v4 5/9] arm64: dts: qcom: msm8939-longcheer-l9100: Enable " Erikas Bitovtas
@ 2026-05-05 21:44 ` Erikas Bitovtas
2026-05-05 21:44 ` [PATCH v4 7/9] clk: qcom: gcc-msm8939: mark Venus core GDSCs as hardware controlled Erikas Bitovtas
` (2 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Erikas Bitovtas @ 2026-05-05 21:44 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, Brian Masney
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] 14+ messages in thread* [PATCH v4 7/9] clk: qcom: gcc-msm8939: mark Venus core GDSCs as hardware controlled
2026-05-05 21:44 [PATCH v4 0/9] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (5 preceding siblings ...)
2026-05-05 21:44 ` [PATCH v4 6/9] arm64: dts: qcom: msm8939-asus-z00t: add Venus Erikas Bitovtas
@ 2026-05-05 21:44 ` Erikas Bitovtas
2026-05-05 21:44 ` [PATCH v4 8/9] media: qcom: venus: add power domain enable logic for Venus cores Erikas Bitovtas
2026-05-05 21:44 ` [PATCH v4 9/9] media: qcom: venus: Enable HEVC decoding for MSM8939 Erikas Bitovtas
8 siblings, 0 replies; 14+ messages in thread
From: Erikas Bitovtas @ 2026-05-05 21:44 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, Brian Masney
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] 14+ messages in thread* [PATCH v4 8/9] media: qcom: venus: add power domain enable logic for Venus cores
2026-05-05 21:44 [PATCH v4 0/9] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (6 preceding siblings ...)
2026-05-05 21:44 ` [PATCH v4 7/9] clk: qcom: gcc-msm8939: mark Venus core GDSCs as hardware controlled Erikas Bitovtas
@ 2026-05-05 21:44 ` Erikas Bitovtas
2026-05-05 21:44 ` [PATCH v4 9/9] media: qcom: venus: Enable HEVC decoding for MSM8939 Erikas Bitovtas
8 siblings, 0 replies; 14+ messages in thread
From: Erikas Bitovtas @ 2026-05-05 21:44 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, Brian Masney
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 | 80 +++++++++++++++++++++++++-
1 file changed, 78 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index f0269524ac70..c8f7f220c713 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -299,8 +299,22 @@ static int load_scale_v1(struct venus_inst *inst)
static int core_get_v1(struct venus_core *core)
{
+ struct device *dev = core->dev;
+ const struct venus_resources *res = core->res;
+ const struct dev_pm_domain_attach_data vcodec_data = {
+ .pd_names = res->vcodec_pmdomains,
+ .num_pd_names = res->vcodec_pmdomains_num,
+ .pd_flags = PD_FLAG_NO_DEV_LINK,
+ };
int ret;
+ if (res->vcodec_pmdomains) {
+ ret = dev_pm_domain_attach_list(dev, &vcodec_data,
+ &core->pmdomains);
+ if (ret < 0)
+ return ret;
+ }
+
ret = core_clks_get(core);
if (ret)
return ret;
@@ -319,12 +333,70 @@ static void core_put_v1(struct venus_core *core)
static int core_power_v1(struct venus_core *core, int on)
{
int ret = 0;
+ struct device *pd_dev = core->res->vcodec_pmdomains ?
+ core->pmdomains->pd_devs[0] : NULL;
- if (on == POWER_ON)
+ if (on == POWER_ON) {
+ if (pd_dev) {
+ ret = pm_runtime_resume_and_get(pd_dev);
+ if (ret)
+ return ret;
+ }
ret = core_clks_enable(core);
- else
+ if (ret) {
+ pm_runtime_put_sync(pd_dev);
+ return ret;
+ }
+ } else {
+ if (pd_dev)
+ pm_runtime_put_sync(pd_dev);
core_clks_disable(core);
+ }
+ return 0;
+}
+
+static int vcodec_get_v1(struct device *dev)
+{
+ struct venus_core *core = dev_get_drvdata(dev);
+
+ return vcodec_clks_get(core, core->dev, core->vcodec_clks,
+ core->res->vcodec_clks);
+}
+
+static int vcodec_power_v1(struct device *dev, int on)
+{
+ struct venus_core *core = dev_get_drvdata(dev);
+ const struct venus_resources *res = core->res;
+ struct device *pd_dev;
+ int i = 1, ret;
+
+ if (on == POWER_ON) {
+ if (res->vcodec_pmdomains) {
+ for (; i < res->vcodec_pmdomains_num; i++) {
+ pd_dev = core->pmdomains->pd_devs[i];
+ ret = pm_runtime_resume_and_get(pd_dev);
+ if (ret)
+ goto err;
+ }
+ }
+
+ ret = vcodec_clks_enable(core, core->vcodec_clks);
+ if (ret)
+ goto err;
+ } else {
+ if (res->vcodec_pmdomains)
+ for (; i < res->vcodec_pmdomains_num; i++) {
+ pd_dev = core->pmdomains->pd_devs[i];
+ pm_runtime_put_sync(pd_dev);
+ }
+ vcodec_clks_disable(core, core->vcodec_clks);
+ }
+
+ return 0;
+err:
+ while (i-- > 1)
+ pm_runtime_put_sync(core->pmdomains->pd_devs[i]);
return ret;
}
@@ -332,6 +404,10 @@ 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 = vcodec_get_v1,
+ .vdec_power = vcodec_power_v1,
+ .venc_get = vcodec_get_v1,
+ .venc_power = vcodec_power_v1,
.load_scale = load_scale_v1,
};
--
2.54.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v4 9/9] media: qcom: venus: Enable HEVC decoding for MSM8939
2026-05-05 21:44 [PATCH v4 0/9] media: qcom: venus: add MSM8939 support Erikas Bitovtas
` (7 preceding siblings ...)
2026-05-05 21:44 ` [PATCH v4 8/9] media: qcom: venus: add power domain enable logic for Venus cores Erikas Bitovtas
@ 2026-05-05 21:44 ` Erikas Bitovtas
8 siblings, 0 replies; 14+ messages in thread
From: Erikas Bitovtas @ 2026-05-05 21:44 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, Brian Masney
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 1871cf3830ac..eda6b19708ab 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] 14+ messages in thread