From patchwork Fri Dec 20 07:59:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 11304961 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A87DA14F6 for ; Fri, 20 Dec 2019 08:00:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8770F24684 for ; Fri, 20 Dec 2019 08:00:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727190AbfLTIA0 (ORCPT ); Fri, 20 Dec 2019 03:00:26 -0500 Received: from alexa-out-blr-02.qualcomm.com ([103.229.18.198]:33528 "EHLO alexa-out-blr-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbfLTIA0 (ORCPT ); Fri, 20 Dec 2019 03:00:26 -0500 Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by alexa-out-blr-02.qualcomm.com with ESMTP/TLS/AES256-SHA; 20 Dec 2019 13:30:23 +0530 Received: from dikshita-linux.qualcomm.com ([10.204.65.237]) by ironmsg01-blr.qualcomm.com with ESMTP; 20 Dec 2019 13:30:13 +0530 Received: by dikshita-linux.qualcomm.com (Postfix, from userid 347544) id 0AA35348A; Fri, 20 Dec 2019 13:30:13 +0530 (IST) From: Dikshita Agarwal To: linux-media@vger.kernel.org, stanimir.varbanov@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal Subject: [PATCH 1/3] arm64: dts: sc7180: Add Venus video codec DT node Date: Fri, 20 Dec 2019 13:29:18 +0530 Message-Id: <1576828760-13176-2-git-send-email-dikshita@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1576828760-13176-1-git-send-email-dikshita@codeaurora.org> References: <1576828760-13176-1-git-send-email-dikshita@codeaurora.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This adds Venus video codec DT node for sc7180. Signed-off-by: Dikshita Agarwal --- arch/arm64/boot/dts/qcom/sc7180.dtsi | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi index 6876aae2..42c70f5 100644 --- a/arch/arm64/boot/dts/qcom/sc7180.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi @@ -10,6 +10,7 @@ #include #include #include +#include / { interrupt-parent = <&intc>; @@ -66,6 +67,11 @@ compatible = "qcom,cmd-db"; no-map; }; + + venus_mem: memory@8F600000 { + reg = <0 0x8F600000 0 0x500000>; + no-map; + }; }; cpus { @@ -1042,6 +1048,36 @@ }; }; + venus: video-codec@aa00000 { + compatible = "qcom,sc7180-venus"; + reg = <0 0x0aa00000 0 0xff000>; + interrupts = ; + power-domains = <&videocc VENUS_GDSC>, + <&videocc VCODEC0_GDSC>; + power-domain-names = "venus", "vcodec0"; + clocks = <&videocc VIDEO_CC_VENUS_CTL_CORE_CLK>, + <&videocc VIDEO_CC_VENUS_AHB_CLK>, + <&videocc VIDEO_CC_VENUS_CTL_AXI_CLK>, + <&videocc VIDEO_CC_VCODEC0_CORE_CLK>, + <&videocc VIDEO_CC_VCODEC0_AXI_CLK>; + clock-names = "core", "iface", "bus", + "vcodec0_core", "vcodec0_bus"; + iommus = <&apps_smmu 0x0C00 0x60>; + memory-region = <&venus_mem>; + + video-core0 { + compatible = "venus-decoder"; + }; + + video-core1 { + compatible = "venus-encoder"; + }; + + video-firmware { + iommus = <&apps_smmu 0x0C42 0x0>; + }; + }; + pdc: interrupt-controller@b220000 { compatible = "qcom,sc7180-pdc", "qcom,pdc"; reg = <0 0x0b220000 0 0x30000>; From patchwork Fri Dec 20 07:59:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 11304957 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EE31138D for ; Fri, 20 Dec 2019 08:00:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3790C20716 for ; Fri, 20 Dec 2019 08:00:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727277AbfLTIAe (ORCPT ); Fri, 20 Dec 2019 03:00:34 -0500 Received: from alexa-out-blr-02.qualcomm.com ([103.229.18.198]:33528 "EHLO alexa-out-blr-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727197AbfLTIA2 (ORCPT ); Fri, 20 Dec 2019 03:00:28 -0500 Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by alexa-out-blr-02.qualcomm.com with ESMTP/TLS/AES256-SHA; 20 Dec 2019 13:30:23 +0530 Received: from dikshita-linux.qualcomm.com ([10.204.65.237]) by ironmsg01-blr.qualcomm.com with ESMTP; 20 Dec 2019 13:30:16 +0530 Received: by dikshita-linux.qualcomm.com (Postfix, from userid 347544) id 296A3348A; Fri, 20 Dec 2019 13:30:15 +0530 (IST) From: Dikshita Agarwal To: linux-media@vger.kernel.org, stanimir.varbanov@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal Subject: [PATCH 2/3] dt-bindings: media: venus: Add sc7180 DT schema Date: Fri, 20 Dec 2019 13:29:19 +0530 Message-Id: <1576828760-13176-3-git-send-email-dikshita@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1576828760-13176-1-git-send-email-dikshita@codeaurora.org> References: <1576828760-13176-1-git-send-email-dikshita@codeaurora.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add new qcom,sc7180-venus DT binding schema. Signed-off-by: Dikshita Agarwal --- .../bindings/media/qcom,venus-sc7180.yaml | 131 +++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,venus-sc7180.yaml diff --git a/Documentation/devicetree/bindings/media/qcom,venus-sc7180.yaml b/Documentation/devicetree/bindings/media/qcom,venus-sc7180.yaml new file mode 100644 index 0000000..a609739 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,venus-sc7180.yaml @@ -0,0 +1,131 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/media/qcom,venus-sc7180.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm Venus video encode and decode accelerators + +maintainers: + - Stanimir Varbanov + +description: | + The Venus IP is a video encode and decode accelerator present + on Qualcomm platforms + +properties: + compatible: + enum: + - qcom,sc7180-venus + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + power-domains: + maxItems: 2 + + power-domain-names: + maxItems: 2 + items: + - const: venus + - const: vcodec0 + + clocks: + maxItems: 5 + + clock-names: + maxItems: 5 + items: + - const: core + - const: iface + - const: bus + - const: vcodec0_core + - const: vcodec0_bus + + iommus: + minItems: 1 + maxItems: 20 + + memory-region: + maxItems: 1 + + video-core0: + type: object + + properties: + compatible: + const: "venus-decoder" + + required: + - compatible + + video-core1: + type: object + + properties: + compatible: + const: "venus-encoder" + + required: + - compatible + + video-firmware: + type: object + + description: | + Firmware subnode is needed when the platform does not + have TrustZone. + + properties: + iommus: + minItems: 1 + +required: + - compatible + - reg + - interrupts + - power-domains + - power-domain-names + - clocks + - clock-names + - iommus + - memory-region + - video-core0 + - video-core1 + +examples: + - | + #include + #include + + venus: video-codec@aa00000 { + compatible = "qcom,sc7180-venus"; + reg = <0 0x0aa00000 0 0xff000>; + interrupts = ; + power-domains = <&videocc VENUS_GDSC>, + <&videocc VCODEC0_GDSC>; + + power-domain-names = "venus", "vcodec0"; + clocks = <&videocc VIDEO_CC_VENUS_CTL_CORE_CLK>, + <&videocc VIDEO_CC_VENUS_AHB_CLK>, + <&videocc VIDEO_CC_VENUS_CTL_AXI_CLK>, + <&videocc VIDEO_CC_VCODEC0_CORE_CLK>, + <&videocc VIDEO_CC_VCODEC0_AXI_CLK>; + clock-names = "core", "iface", "bus", + "vcodec0_core", "vcodec0_bus"; + iommus = <&apps_smmu 0x0C00 0x60>; + memory-region = <&venus_mem>; + video-core0 { + compatible = "venus-decoder"; + }; + video-core1 { + compatible = "venus-encoder"; + }; + video-firmware { + iommus = <&apps_smmu 0x0C42 0x0>; + }; + }; From patchwork Fri Dec 20 07:59:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dikshita Agarwal X-Patchwork-Id: 11304967 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 93B2F138D for ; Fri, 20 Dec 2019 08:01:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B7A320716 for ; Fri, 20 Dec 2019 08:01:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727197AbfLTIBT (ORCPT ); Fri, 20 Dec 2019 03:01:19 -0500 Received: from alexa-out-blr-02.qualcomm.com ([103.229.18.198]:23184 "EHLO alexa-out-blr-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbfLTIBS (ORCPT ); Fri, 20 Dec 2019 03:01:18 -0500 Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by alexa-out-blr-02.qualcomm.com with ESMTP/TLS/AES256-SHA; 20 Dec 2019 13:30:23 +0530 Received: from dikshita-linux.qualcomm.com ([10.204.65.237]) by ironmsg01-blr.qualcomm.com with ESMTP; 20 Dec 2019 13:30:18 +0530 Received: by dikshita-linux.qualcomm.com (Postfix, from userid 347544) id 5E922348A; Fri, 20 Dec 2019 13:30:17 +0530 (IST) From: Dikshita Agarwal To: linux-media@vger.kernel.org, stanimir.varbanov@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal Subject: [PATCH 3/3] venus: core: add sc7180 DT compatible and resource struct Date: Fri, 20 Dec 2019 13:29:20 +0530 Message-Id: <1576828760-13176-4-git-send-email-dikshita@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1576828760-13176-1-git-send-email-dikshita@codeaurora.org> References: <1576828760-13176-1-git-send-email-dikshita@codeaurora.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This add DT compatible string and resource structure for sc7180. Signed-off-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/core.c | 58 +++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index c7525d9..e8c8b28 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -469,7 +469,7 @@ static __maybe_unused int venus_runtime_resume(struct device *dev) { 2073600, 3929000, 0, 5551000, 0 }, /* 4096x2160@60 */ { 1036800, 1987000, 0, 2797000, 0 }, /* 4096x2160@30 */ { 489600, 1040000, 0, 1298000, 0 }, /* 1920x1080@60 */ - { 244800, 530000, 0, 659000, 0 }, /* 1920x1080@30 */ + { 244800, 442000, 0, 659000, 0 }, /* 1920x1080@30 */ }; static const struct venus_resources sdm845_res = { @@ -521,11 +521,67 @@ static __maybe_unused int venus_runtime_resume(struct device *dev) .fwname = "qcom/venus-5.2/venus.mdt", }; +static const struct freq_tbl sc7180_freq_table[] = { + { 0, 380000000 }, + { 0, 340000000 }, + { 0, 270000000 }, + { 0, 150000000 }, +}; + +static struct codec_freq_data sc7180_codec_freq_data[] = { + { V4L2_PIX_FMT_H264, VIDC_SESSION_TYPE_ENC, 675, 10 }, + { V4L2_PIX_FMT_HEVC, VIDC_SESSION_TYPE_ENC, 675, 10 }, + { V4L2_PIX_FMT_VP8, VIDC_SESSION_TYPE_ENC, 675, 10 }, + { V4L2_PIX_FMT_MPEG2, VIDC_SESSION_TYPE_DEC, 200, 10 }, + { V4L2_PIX_FMT_H264, VIDC_SESSION_TYPE_DEC, 200, 10 }, + { V4L2_PIX_FMT_HEVC, VIDC_SESSION_TYPE_DEC, 200, 10 }, + { V4L2_PIX_FMT_VP8, VIDC_SESSION_TYPE_DEC, 200, 10 }, + { V4L2_PIX_FMT_VP9, VIDC_SESSION_TYPE_DEC, 200, 10 }, +}; + +static const struct bw_tbl sc7180_bw_table_enc[] = { + { 972000, 750000, 0, 0, 0 }, /* 3840x2160@30 */ + { 489600, 451000, 0, 0, 0 }, /* 1920x1080@60 */ + { 244800, 234000, 0, 0, 0 }, /* 1920x1080@30 */ +}; + +static const struct bw_tbl sc7180_bw_table_dec[] = { + { 1036800, 1386000, 0, 1875000, 0 }, /* 4096x2160@30 */ + { 489600, 865000, 0, 1146000, 0 }, /* 1920x1080@60 */ + { 244800, 530000, 0, 583000, 0 }, /* 1920x1080@30 */ +}; + +static const struct venus_resources sc7180_res = { + .freq_tbl = sc7180_freq_table, + .freq_tbl_size = ARRAY_SIZE(sc7180_freq_table), + .bw_tbl_enc = sc7180_bw_table_enc, + .bw_tbl_enc_size = ARRAY_SIZE(sc7180_bw_table_enc), + .bw_tbl_dec = sc7180_bw_table_dec, + .bw_tbl_dec_size = ARRAY_SIZE(sc7180_bw_table_dec), + .codec_freq_data = sc7180_codec_freq_data, + .codec_freq_data_size = ARRAY_SIZE(sc7180_codec_freq_data), + .clks = {"core", "iface", "bus" }, + .clks_num = 3, + .vcodec0_clks = { "vcodec0_core", "vcodec0_bus" }, + .vcodec_clks_num = 2, + .vcodec_pmdomains = { "venus", "vcodec0" }, + .vcodec_pmdomains_num = 2, + .vcodec_num = 1, + .max_load = 3110400, /* 4096x2160@90 */ + .hfi_version = HFI_VERSION_4XX, + .vmem_id = VIDC_RESOURCE_NONE, + .vmem_size = 0, + .vmem_addr = 0, + .dma_mask = 0xe0000000 - 1, + .fwname = "qcom/venus-5.4/venus.mdt", +}; + static const struct of_device_id venus_dt_match[] = { { .compatible = "qcom,msm8916-venus", .data = &msm8916_res, }, { .compatible = "qcom,msm8996-venus", .data = &msm8996_res, }, { .compatible = "qcom,sdm845-venus", .data = &sdm845_res, }, { .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, }, + { .compatible = "qcom,sc7180-venus", .data = &sc7180_res, }, { } }; MODULE_DEVICE_TABLE(of, venus_dt_match);