Message ID | 20230731-topic-8280_venus-v1-1-8c8bbe1983a5@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp116478vqr; Fri, 4 Aug 2023 14:45:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQ8kw6aaJ4wMCoPIcEwBhn77v/1DFSAA6TEr4c+OsNRsNo3EIGwX1pWqK/evTlcqfQbmv+ X-Received: by 2002:a05:6a20:2590:b0:136:42c8:693c with SMTP id k16-20020a056a20259000b0013642c8693cmr3124656pzd.6.1691185510609; Fri, 04 Aug 2023 14:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691185510; cv=none; d=google.com; s=arc-20160816; b=GktV/LDbro/CdbfPj6hGpSen5ys/fRo4FY/8Nvrf4zvXNcCwXOetPIZWo1c/jzAx7i O87c9RS617b6H0YJSlq+4dwvnMb6jkYAnHPZUzyjY/oOkZ7PsV1T35fktu6mY24+Li75 0/10U+DpEuPXlI+uu5NY4thlyD1qm8GRG+KRK83A7StWyCf6gzhM9xByJwN6MZlQuwr4 87kAFcGYIQf8jAdE4Ym7KCkMT1eaiwzpMMjmT++2p9cv2xNnsZM3ZVLBDvMQAU+VwGix Wgnslq697Woyd899OF5HtKuMc20REdcpDumygwhH5Ori3k615Mxv+dr/Q7Ejzjn9jsXq UJYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=zppFytEjzdHvnbASXFRnuQvztJWuz3oKHgr/oM9IyFM=; fh=YwPEnDP0lHwHsH9CarSShm+/U4DnsczT6gMuGjnjhlA=; b=Nr6C2S0ooc6pghAhRp+Xo5n3+0vcH0gQ+4ngyAesAMTxP3OyzDGRdKP9tC3vM+1W9S u2HTRYfFgJl0KMiYp2HjH5uPZJ3jztc51jPZ0ad7WG0iDEO8iZOCAsF8c1TOWh6r/SKO lObV2hNSUoB7r/6woPuBCk63rZ3jDlakS2y1bJD0/6a662DGWlHTQavhH7I3dCvNDOfJ QF/2P4Ia1AVekeCsvp0U+YMWRb9ho85xS6y33tqxNa01keyOBBI80jWzZciUsIqL8I0z WVIA+hbBpqZeZZ52S1+pbKGsqeezv9kKmN7fN+TDRNAp2jQQHOeBME6DB2dpms+kLEFj Cusg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uaPvqbdJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y18-20020a056a00191200b00687507df746si2311961pfi.170.2023.08.04.14.44.56; Fri, 04 Aug 2023 14:45:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uaPvqbdJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbjHDUJZ (ORCPT <rfc822;wenzhi022@gmail.com> + 99 others); Fri, 4 Aug 2023 16:09:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbjHDUJT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Aug 2023 16:09:19 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97A0410C7 for <linux-kernel@vger.kernel.org>; Fri, 4 Aug 2023 13:09:16 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2ba0f27a4c2so35967451fa.2 for <linux-kernel@vger.kernel.org>; Fri, 04 Aug 2023 13:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691179755; x=1691784555; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zppFytEjzdHvnbASXFRnuQvztJWuz3oKHgr/oM9IyFM=; b=uaPvqbdJ+8Sz28g0QMV8w5OoEdrDJRlM3fseWXCAJt/7UPBzNZ5AYJValvIvpDBXU6 w0fH3gQeRfMQ4mPsM5ClwRCSu2IRbxOdGQBCjzUV21RgK1i0uuD+Z7LEUgK4wUHhH3ZD dXxRwe3tvheb9HJVoDgbHria3Apg+AGB3U/4pvMM0dKR8CekSlhMgZ8ioptMlBb8hU3F uFXzyZqk7AYJUXLnjnjEJNek5J3h014cJLfrlvQd/BpiLpWXjV1vP093s8uP4tmPp6oG XqC/EtWGRotoDOd+H/zdtNx8uwcy65xKFs3D+Zd40UtP8iKQn6yZFt7UIzvIDhOEMLZz J45w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691179755; x=1691784555; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zppFytEjzdHvnbASXFRnuQvztJWuz3oKHgr/oM9IyFM=; b=CIw7L6ddTVmWAcUWGpq7JBe+AyCuMx6okSZYed/rGoSfoUwcyRnEojtCpjOHKxckAz EAttktzUVn2TTVDsfyTNbo6v+LeS2BDfGJjdkn1IVLcR6jsrlUylvn3a2xugkB4bA2Bw 5VXZlvH0EvMsv8cDzkxM/0RaqtJjJiYrbLHDkM3GLmoG9eRyBOtFXERud/AphCyLIlz/ uLYRvsJ+7Meald6ZoLhi8tL63S5QsXYVHDxBjhVpOLsytkkp+mdsGLXO+uDexTELz/4+ G/37VkHXCqfygKUr7ev7V80nNb1dl3Rf5nxRL+Ky7ayhQVEDyHgG5Rfp9PNERzTQnFHP V5dA== X-Gm-Message-State: AOJu0YwSVP3BRPL/BEcWhozuzjE2CbqGO6AqYRRKTROnl545UhINiHiM 77Rbpg0vXJIisGsoWdJICLFEbw== X-Received: by 2002:a2e:9316:0:b0:2b9:bcac:7ba6 with SMTP id e22-20020a2e9316000000b002b9bcac7ba6mr2056339ljh.46.1691179754751; Fri, 04 Aug 2023 13:09:14 -0700 (PDT) Received: from [192.168.1.101] (abym15.neoplus.adsl.tpnet.pl. [83.9.32.15]) by smtp.gmail.com with ESMTPSA id m8-20020a2e97c8000000b002b6fed37b18sm580048ljj.101.2023.08.04.13.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 13:09:14 -0700 (PDT) From: Konrad Dybcio <konrad.dybcio@linaro.org> Date: Fri, 04 Aug 2023 22:09:08 +0200 Subject: [PATCH 1/6] media: dt-bindings: Document SC8280XP/SM8350 Venus MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230731-topic-8280_venus-v1-1-8c8bbe1983a5@linaro.org> References: <20230731-topic-8280_venus-v1-0-8c8bbe1983a5@linaro.org> In-Reply-To: <20230731-topic-8280_venus-v1-0-8c8bbe1983a5@linaro.org> To: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>, Vikash Garodia <quic_vgarodia@quicinc.com>, Bryan O'Donoghue <bryan.odonoghue@linaro.org>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Mauro Carvalho Chehab <mchehab@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: Marijn Suijten <marijn.suijten@somainline.org>, Konrad Dybcio <konradybcio@kernel.org>, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio <konrad.dybcio@linaro.org> X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1691179750; l=4196; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=qPZ+tkyKC+Whn4SENKO8Du3EyX1XBNWI1sx5+8QX9+M=; b=XrOc4Lb7+7O/RxyzONJjYO8r9ksbbpY08duzDjb89Qfu5iuQUFWH4iDxA3kgtp5gODXME0wjd V2An/YoZJrEC/bxGjyWXa6UjA6yY2AgD/tHWXB1LrczKbQcHyJ1Cjyu X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773336538141257439 X-GMAIL-MSGID: 1773336538141257439 |
Series |
SM8350 and SC8280XP venus support
|
|
Commit Message
Konrad Dybcio
Aug. 4, 2023, 8:09 p.m. UTC
Both of these SoCs implement an IRIS2 block, with SC8280XP being able
to clock it a bit higher.
Document it.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
.../bindings/media/qcom,sm8350-venus.yaml | 149 +++++++++++++++++++++
1 file changed, 149 insertions(+)
Comments
On 04/08/2023 22:09, Konrad Dybcio wrote: > Both of these SoCs implement an IRIS2 block, with SC8280XP being able > to clock it a bit higher. > ... > + > + iommus: > + maxItems: 1 > + > + video-decoder: > + type: object > + > + properties: > + compatible: > + const: venus-decoder That's not how compatibles are constructed... missing vendor prefix, SoC or IP block name. > + > + required: > + - compatible > + > + additionalProperties: false Why do you need this child node? Child nodes without properties are usually useless. > + > + video-encoder: > + type: object > + > + properties: > + compatible: > + const: venus-encoder > + > + required: > + - compatible > + > + additionalProperties: false > + > +required: > + - compatible > + - power-domain-names > + - iommus > + - video-decoder > + - video-encoder > + > +unevaluatedProperties: false > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + #include <dt-bindings/clock/qcom,gcc-sm8350.h> > + #include <dt-bindings/clock/qcom,sm8350-videocc.h> > + #include <dt-bindings/interconnect/qcom,sm8350.h> > + #include <dt-bindings/power/qcom-rpmpd.h> > + > + venus: video-codec@aa00000 { > + compatible = "qcom,sm8350-venus"; > + reg = <0x0aa00000 0x100000>; > + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; > + > + clocks = <&gcc GCC_VIDEO_AXI0_CLK>, > + <&videocc VIDEO_CC_MVS0C_CLK>, > + <&videocc VIDEO_CC_MVS0_CLK>; > + clock-names = "iface", > + "core", > + "vcodec0_core"; > + > + resets = <&gcc GCC_VIDEO_AXI0_CLK_ARES>; > + reset-names = "core"; > + > + power-domains = <&videocc MVS0C_GDSC>, > + <&videocc MVS0_GDSC>, > + <&rpmhpd SM8350_MX>; > + power-domain-names = "venus", > + "vcodec0", > + "mx"; > + > + interconnects = <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_VENUS_CFG 0>, > + <&mmss_noc MASTER_VIDEO_P0 0 &mc_virt SLAVE_EBI1 0>, > + <&mmss_noc MASTER_VIDEO_P0 0 &gem_noc SLAVE_LLCC 0>; > + interconnect-names = "cpu-cfg", > + "video-mem", > + "video-llcc"; > + > + operating-points-v2 = <&venus_opp_table>; > + iommus = <&apps_smmu 0x2100 0x400>; > + memory-region = <&pil_video_mem>; > + > + status = "disabled"; Drop status. > + > + video-decoder { Best regards, Krzysztof
On 5.08.2023 21:29, Krzysztof Kozlowski wrote: > On 04/08/2023 22:09, Konrad Dybcio wrote: >> Both of these SoCs implement an IRIS2 block, with SC8280XP being able >> to clock it a bit higher. >> > > ... > >> + >> + iommus: >> + maxItems: 1 >> + >> + video-decoder: >> + type: object >> + >> + properties: >> + compatible: >> + const: venus-decoder > > That's not how compatibles are constructed... missing vendor prefix, SoC > or IP block name. > >> + >> + required: >> + - compatible >> + >> + additionalProperties: false > > Why do you need this child node? Child nodes without properties are > usually useless. For both comments: I aligned with what was there.. The driver abuses these compats to probe enc/dec submodules, even though every Venus implementation (to my knowledge) is implicitly enc/dec capable.. Perhaps a bigger clean-up is due. I guess I could just create the venc/vdec devices from the venus core probe and get rid of this fake stuff? Konrad
On 07/08/2023 14:41, Konrad Dybcio wrote: > On 5.08.2023 21:29, Krzysztof Kozlowski wrote: >> On 04/08/2023 22:09, Konrad Dybcio wrote: >>> Both of these SoCs implement an IRIS2 block, with SC8280XP being able >>> to clock it a bit higher. >>> >> >> ... >> >>> + >>> + iommus: >>> + maxItems: 1 >>> + >>> + video-decoder: >>> + type: object >>> + >>> + properties: >>> + compatible: >>> + const: venus-decoder >> >> That's not how compatibles are constructed... missing vendor prefix, SoC >> or IP block name. >> >>> + >>> + required: >>> + - compatible >>> + >>> + additionalProperties: false >> >> Why do you need this child node? Child nodes without properties are >> usually useless. > For both comments: I aligned with what was there.. > > The driver abuses these compats to probe enc/dec submodules, even though > every Venus implementation (to my knowledge) is implicitly enc/dec capable.. Holy crap, I see... > > Perhaps a bigger clean-up is due. I guess I could just create the venc/vdec > devices from the venus core probe and get rid of this fake stuff? Few devices (qcom,msm8996-venus.yaml, sdm660, sdm845) have clocks there, so we actually could stay with these subnodes, just correct the compatibles to a list with correct prefixes: qcom,sc8280xp-venus-decoder + qcom,venus-decoder Best regards, Krzysztof
On 7.08.2023 16:04, Krzysztof Kozlowski wrote: > On 07/08/2023 14:41, Konrad Dybcio wrote: >> On 5.08.2023 21:29, Krzysztof Kozlowski wrote: >>> On 04/08/2023 22:09, Konrad Dybcio wrote: >>>> Both of these SoCs implement an IRIS2 block, with SC8280XP being able >>>> to clock it a bit higher. >>>> >>> >>> ... >>> >>>> + >>>> + iommus: >>>> + maxItems: 1 >>>> + >>>> + video-decoder: >>>> + type: object >>>> + >>>> + properties: >>>> + compatible: >>>> + const: venus-decoder >>> >>> That's not how compatibles are constructed... missing vendor prefix, SoC >>> or IP block name. >>> >>>> + >>>> + required: >>>> + - compatible >>>> + >>>> + additionalProperties: false >>> >>> Why do you need this child node? Child nodes without properties are >>> usually useless. >> For both comments: I aligned with what was there.. >> >> The driver abuses these compats to probe enc/dec submodules, even though >> every Venus implementation (to my knowledge) is implicitly enc/dec capable.. > > Holy crap, I see... > >> >> Perhaps a bigger clean-up is due. I guess I could just create the venc/vdec >> devices from the venus core probe and get rid of this fake stuff? > > Few devices (qcom,msm8996-venus.yaml, sdm660, sdm845) have clocks there, > so we actually could stay with these subnodes, just correct the > compatibles to a list with correct prefixes: > > qcom,sc8280xp-venus-decoder + qcom,venus-decoder Hm.. looks like pre-845-v2 (with the v2 being "v2 binding" and not "v2 chip" or "v2 hardware") these were used to look up clocks but then they were moved to the root node. I am not quite sure if it makes sense to distinguish e.g. sc8280xp-venus-decoder within sc8280xp-venus.. Perhaps deprecating the "8916 way" (clocks under subnodes), adding some boilerplate to look up clocks/pds in both places and converting everybody to the "7180 way" way of doing things (clocks under venus), and then getting rid of venus encoder/decoder completely (by calling device creation from venus probe) would be better. WDYT? Konrad
On 07/08/2023 17:02, Konrad Dybcio wrote: > On 7.08.2023 16:04, Krzysztof Kozlowski wrote: >> On 07/08/2023 14:41, Konrad Dybcio wrote: >>> On 5.08.2023 21:29, Krzysztof Kozlowski wrote: >>>> On 04/08/2023 22:09, Konrad Dybcio wrote: >>>>> Both of these SoCs implement an IRIS2 block, with SC8280XP being able >>>>> to clock it a bit higher. >>>>> >>>> >>>> ... >>>> >>>>> + >>>>> + iommus: >>>>> + maxItems: 1 >>>>> + >>>>> + video-decoder: >>>>> + type: object >>>>> + >>>>> + properties: >>>>> + compatible: >>>>> + const: venus-decoder >>>> >>>> That's not how compatibles are constructed... missing vendor prefix, SoC >>>> or IP block name. >>>> >>>>> + >>>>> + required: >>>>> + - compatible >>>>> + >>>>> + additionalProperties: false >>>> >>>> Why do you need this child node? Child nodes without properties are >>>> usually useless. >>> For both comments: I aligned with what was there.. >>> >>> The driver abuses these compats to probe enc/dec submodules, even though >>> every Venus implementation (to my knowledge) is implicitly enc/dec capable.. >> >> Holy crap, I see... >> >>> >>> Perhaps a bigger clean-up is due. I guess I could just create the venc/vdec >>> devices from the venus core probe and get rid of this fake stuff? >> >> Few devices (qcom,msm8996-venus.yaml, sdm660, sdm845) have clocks there, >> so we actually could stay with these subnodes, just correct the >> compatibles to a list with correct prefixes: >> >> qcom,sc8280xp-venus-decoder + qcom,venus-decoder > Hm.. looks like pre-845-v2 (with the v2 being "v2 binding" and not > "v2 chip" or "v2 hardware") these were used to look up clocks but > then they were moved to the root node. > > I am not quite sure if it makes sense to distinguish e.g. > sc8280xp-venus-decoder within sc8280xp-venus..> > Perhaps deprecating the "8916 way" (clocks under subnodes), adding > some boilerplate to look up clocks/pds in both places and converting > everybody to the "7180 way" way of doing things (clocks under venus), > and then getting rid of venus encoder/decoder completely (by calling > device creation from venus probe) would be better. WDYT? Yes, this makes more sense. I think this is controlled by "legacy_binding" variable (see drivers/media/platform/qcom/venus/pm_helpers.c). Once all bindings are converted to new one (clocks in main/parent node), then we can drop the children and instantiate devices as MFD. Best regards, Krzysztof
On 07/08/2023 16:02, Konrad Dybcio wrote: > On 7.08.2023 16:04, Krzysztof Kozlowski wrote: >> On 07/08/2023 14:41, Konrad Dybcio wrote: >>> On 5.08.2023 21:29, Krzysztof Kozlowski wrote: >>>> On 04/08/2023 22:09, Konrad Dybcio wrote: >>>>> Both of these SoCs implement an IRIS2 block, with SC8280XP being able >>>>> to clock it a bit higher. >>>>> >>>> >>>> ... >>>> >>>>> + >>>>> + iommus: >>>>> + maxItems: 1 >>>>> + >>>>> + video-decoder: >>>>> + type: object >>>>> + >>>>> + properties: >>>>> + compatible: >>>>> + const: venus-decoder >>>> >>>> That's not how compatibles are constructed... missing vendor prefix, SoC >>>> or IP block name. >>>> >>>>> + >>>>> + required: >>>>> + - compatible >>>>> + >>>>> + additionalProperties: false >>>> >>>> Why do you need this child node? Child nodes without properties are >>>> usually useless. >>> For both comments: I aligned with what was there.. >>> >>> The driver abuses these compats to probe enc/dec submodules, even though >>> every Venus implementation (to my knowledge) is implicitly enc/dec capable.. >> >> Holy crap, I see... >> >>> >>> Perhaps a bigger clean-up is due. I guess I could just create the venc/vdec >>> devices from the venus core probe and get rid of this fake stuff? >> >> Few devices (qcom,msm8996-venus.yaml, sdm660, sdm845) have clocks there, >> so we actually could stay with these subnodes, just correct the >> compatibles to a list with correct prefixes: >> >> qcom,sc8280xp-venus-decoder + qcom,venus-decoder > Hm.. looks like pre-845-v2 (with the v2 being "v2 binding" and not > "v2 chip" or "v2 hardware") these were used to look up clocks but > then they were moved to the root node. > > I am not quite sure if it makes sense to distinguish e.g. > sc8280xp-venus-decoder within sc8280xp-venus.. > > Perhaps deprecating the "8916 way" (clocks under subnodes), adding > some boilerplate to look up clocks/pds in both places and converting > everybody to the "7180 way" way of doing things (clocks under venus), > and then getting rid of venus encoder/decoder completely (by calling > device creation from venus probe) would be better. WDYT? > > Konrad As I understand it though, for some classes of venus hardware - earlier, it was possible to have two encoders or two decoders and it really didn't - perhaps still doesn't matter which order they are declared in. That's the logic behind having a compat string that assigns either encoder or decoder to one of the logical blocks. You can have any mixture of - encoder - decoder - encoder - encoder - decoder - decoder - decoder - encoder - encoder - decoder I think it should *still* be the case - whether it is a practical reality or not, that any of those mapping can be selected and supported. --- bod
On 7.08.2023 20:44, Bryan O'Donoghue wrote: > On 07/08/2023 16:02, Konrad Dybcio wrote: >> On 7.08.2023 16:04, Krzysztof Kozlowski wrote: >>> On 07/08/2023 14:41, Konrad Dybcio wrote: >>>> On 5.08.2023 21:29, Krzysztof Kozlowski wrote: >>>>> On 04/08/2023 22:09, Konrad Dybcio wrote: >>>>>> Both of these SoCs implement an IRIS2 block, with SC8280XP being able >>>>>> to clock it a bit higher. >>>>>> >>>>> >>>>> ... >>>>> >>>>>> + >>>>>> + iommus: >>>>>> + maxItems: 1 >>>>>> + >>>>>> + video-decoder: >>>>>> + type: object >>>>>> + >>>>>> + properties: >>>>>> + compatible: >>>>>> + const: venus-decoder >>>>> >>>>> That's not how compatibles are constructed... missing vendor prefix, SoC >>>>> or IP block name. >>>>> >>>>>> + >>>>>> + required: >>>>>> + - compatible >>>>>> + >>>>>> + additionalProperties: false >>>>> >>>>> Why do you need this child node? Child nodes without properties are >>>>> usually useless. >>>> For both comments: I aligned with what was there.. >>>> >>>> The driver abuses these compats to probe enc/dec submodules, even though >>>> every Venus implementation (to my knowledge) is implicitly enc/dec capable.. >>> >>> Holy crap, I see... >>> >>>> >>>> Perhaps a bigger clean-up is due. I guess I could just create the venc/vdec >>>> devices from the venus core probe and get rid of this fake stuff? >>> >>> Few devices (qcom,msm8996-venus.yaml, sdm660, sdm845) have clocks there, >>> so we actually could stay with these subnodes, just correct the >>> compatibles to a list with correct prefixes: >>> >>> qcom,sc8280xp-venus-decoder + qcom,venus-decoder >> Hm.. looks like pre-845-v2 (with the v2 being "v2 binding" and not >> "v2 chip" or "v2 hardware") these were used to look up clocks but >> then they were moved to the root node. >> >> I am not quite sure if it makes sense to distinguish e.g. >> sc8280xp-venus-decoder within sc8280xp-venus.. >> >> Perhaps deprecating the "8916 way" (clocks under subnodes), adding >> some boilerplate to look up clocks/pds in both places and converting >> everybody to the "7180 way" way of doing things (clocks under venus), >> and then getting rid of venus encoder/decoder completely (by calling >> device creation from venus probe) would be better. WDYT? >> >> Konrad > > As I understand it though, for some classes of venus hardware - earlier, it was possible to have two encoders or two decoders and it really didn't - perhaps still doesn't matter which order they are declared in. > > That's the logic behind having a compat string that assigns either encoder or decoder to one of the logical blocks. > > You can have any mixture of > - encoder > - decoder > > - encoder > - encoder > > - decoder > - decoder > > - decoder > - encoder > > - encoder > > - decoder > > I think it should *still* be the case - whether it is a practical reality or not, that any of those mapping can be selected and supported. That can be taken care of with match data. Konrad
On 07/08/2023 19:45, Konrad Dybcio wrote: > That can be taken care of with match data. > > Konrad Well perhaps. I'm just sticking my oar in, to elucidate. The compat sub-nodes aren't just a random choice with no logic. They exist to select between what you assign the blocks to be, encoder, decoder or any admixture thereof. A functionality we want to maintain. --- bod
On 7.08.2023 20:49, Bryan O'Donoghue wrote: > On 07/08/2023 19:45, Konrad Dybcio wrote: >> That can be taken care of with match data. >> >> Konrad > > Well perhaps. > > I'm just sticking my oar in, to elucidate. > > The compat sub-nodes aren't just a random choice with no logic. They exist to select between what you assign the blocks to be, encoder, decoder or any admixture thereof. > > A functionality we want to maintain. Surely something like a modparam would be more suitable here? Konrad
On 07/08/2023 19:55, Konrad Dybcio wrote: > On 7.08.2023 20:49, Bryan O'Donoghue wrote: >> On 07/08/2023 19:45, Konrad Dybcio wrote: >>> That can be taken care of with match data. >>> >>> Konrad >> >> Well perhaps. >> >> I'm just sticking my oar in, to elucidate. >> >> The compat sub-nodes aren't just a random choice with no logic. They exist to select between what you assign the blocks to be, encoder, decoder or any admixture thereof. >> >> A functionality we want to maintain. > Surely something like a modparam would be more suitable here? > > Konrad Hmm. Well from earlier in the thread the question "why do we have these compat strings" is because we can have any combination of encoder/decoder assigned. If there's a cogent argument _still_ to be made to transition to some new way of assignment then fine so long as we don't break that basic flexibility. Though my own €0.02 is that a module parameter is more of a PITA than a compat string. OTOH I could make the argument, that the high probability is most people - probably all, just instantiate a single encoder and decoder and aren't aware of or using the inbuilt flexibility. @stan probably has the right idea what to do. --- bod
On 7.08.2023 21:05, Bryan O'Donoghue wrote: > On 07/08/2023 19:55, Konrad Dybcio wrote: >> On 7.08.2023 20:49, Bryan O'Donoghue wrote: >>> On 07/08/2023 19:45, Konrad Dybcio wrote: >>>> That can be taken care of with match data. >>>> >>>> Konrad >>> >>> Well perhaps. >>> >>> I'm just sticking my oar in, to elucidate. >>> >>> The compat sub-nodes aren't just a random choice with no logic. They exist to select between what you assign the blocks to be, encoder, decoder or any admixture thereof. >>> >>> A functionality we want to maintain. >> Surely something like a modparam would be more suitable here? >> >> Konrad > > Hmm. > > Well from earlier in the thread the question "why do we have these compat strings" is because we can have any combination of encoder/decoder assigned. > > If there's a cogent argument _still_ to be made to transition to some new way of assignment then fine so long as we don't break that basic flexibility. > > Though my own €0.02 is that a module parameter is more of a PITA than a compat string. > > OTOH I could make the argument, that the high probability is most people - probably all, just instantiate a single encoder and decoder and aren't aware of or using the inbuilt flexibility. > > @stan probably has the right idea what to do. Actually.. Has anybody tested this, ever, with the mainline driver? Do we have anyone using this? Is anybody willing to maintain that, test for regressions and fix them in a reasonable amount of time? If we don't have at least 2x "yes" here, I don't think it makes sense to worry about it.. Konrad
On 09/08/2023 13:15, Konrad Dybcio wrote: >> Hmm. >> >> Well from earlier in the thread the question "why do we have these compat strings" is because we can have any combination of encoder/decoder assigned. >> >> If there's a cogent argument_still_ to be made to transition to some new way of assignment then fine so long as we don't break that basic flexibility. >> >> Though my own €0.02 is that a module parameter is more of a PITA than a compat string. >> >> OTOH I could make the argument, that the high probability is most people - probably all, just instantiate a single encoder and decoder and aren't aware of or using the inbuilt flexibility. >> >> @stan probably has the right idea what to do. > Actually.. > > Has anybody tested this, ever, with the mainline driver? I assume Stan has. > Do we have anyone using this? Can't say. > Is anybody willing to maintain that, test for regressions and > fix them in a reasonable amount of time? > > > If we don't have at least 2x "yes" here, I don't think it makes sense > to worry about it.. Hmm. We decide if we are encoding or decoding when we init a session and the blocks are symmetrical. The hw blocks themselves are not bound to a particular encode/decode mode. Having two parallel encoders or decoders is exactly the same effort as having a parallel encoder/decoder. We don't test parallel encoding/decoding but we should. I'd not be surprised to find there are bugs but, that's not a reason to exclude rather to find and fix bugs. --- bod
diff --git a/Documentation/devicetree/bindings/media/qcom,sm8350-venus.yaml b/Documentation/devicetree/bindings/media/qcom,sm8350-venus.yaml new file mode 100644 index 000000000000..8a31bce27c18 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,sm8350-venus.yaml @@ -0,0 +1,149 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,sm8350-venus.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SM8350 Venus video encode and decode accelerators + +maintainers: + - Konrad Dybcio <konradybcio@kernel.org> + +description: | + The Venus Iris2 IP is a video encode and decode accelerator present + on Qualcomm platforms + +allOf: + - $ref: qcom,venus-common.yaml# + +properties: + compatible: + enum: + - qcom,sc8280xp-venus + - qcom,sm8350-venus + + clocks: + maxItems: 3 + + clock-names: + items: + - const: iface + - const: core + - const: vcodec0_core + + resets: + maxItems: 1 + + reset-names: + items: + - const: core + + power-domains: + maxItems: 3 + + power-domain-names: + items: + - const: venus + - const: vcodec0 + - const: mx + + interconnects: + maxItems: 3 + + interconnect-names: + items: + - const: cpu-cfg + - const: video-mem + - const: video-llcc + + operating-points-v2: true + opp-table: + type: object + + iommus: + maxItems: 1 + + video-decoder: + type: object + + properties: + compatible: + const: venus-decoder + + required: + - compatible + + additionalProperties: false + + video-encoder: + type: object + + properties: + compatible: + const: venus-encoder + + required: + - compatible + + additionalProperties: false + +required: + - compatible + - power-domain-names + - iommus + - video-decoder + - video-encoder + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/clock/qcom,gcc-sm8350.h> + #include <dt-bindings/clock/qcom,sm8350-videocc.h> + #include <dt-bindings/interconnect/qcom,sm8350.h> + #include <dt-bindings/power/qcom-rpmpd.h> + + venus: video-codec@aa00000 { + compatible = "qcom,sm8350-venus"; + reg = <0x0aa00000 0x100000>; + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; + + clocks = <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>; + clock-names = "iface", + "core", + "vcodec0_core"; + + resets = <&gcc GCC_VIDEO_AXI0_CLK_ARES>; + reset-names = "core"; + + power-domains = <&videocc MVS0C_GDSC>, + <&videocc MVS0_GDSC>, + <&rpmhpd SM8350_MX>; + power-domain-names = "venus", + "vcodec0", + "mx"; + + interconnects = <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_VENUS_CFG 0>, + <&mmss_noc MASTER_VIDEO_P0 0 &mc_virt SLAVE_EBI1 0>, + <&mmss_noc MASTER_VIDEO_P0 0 &gem_noc SLAVE_LLCC 0>; + interconnect-names = "cpu-cfg", + "video-mem", + "video-llcc"; + + operating-points-v2 = <&venus_opp_table>; + iommus = <&apps_smmu 0x2100 0x400>; + memory-region = <&pil_video_mem>; + + status = "disabled"; + + video-decoder { + compatible = "venus-decoder"; + }; + + video-encoder { + compatible = "venus-encoder"; + }; + };