From patchwork Fri Jun 13 14:03:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez X-Patchwork-Id: 896816 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CFD01B424D for ; Fri, 13 Jun 2025 14:04:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749823472; cv=none; b=TtAskl2DZGa+zv8NSTiRdDhyUqgPg+zzL7XMXOVgUum+4j+du4PaGE6ZSbxv5sLFudQ5wmb7jLBuExskVS4vt9GHoKxkFRS4faFhQV/7F5Svb0nLdax4MSAwXyGUKK38zzT2BEXQeco6He9x7h+sa1jnUQqNSsj7JEIwKeo8yU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749823472; c=relaxed/simple; bh=gdhfUspPyqBiEzOlF6EWkZ6U0ttrz2LFWzzIn0eDJFA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XzAR++7On3svSDGDBc1vICEQXWFTRyoGqXAYoSbm5fW4G+wJLEsBqb2MMWZzlxcfw+lyudQXTN1C/N8uawBMGbgNnqFoIgYRy6ji+PlLlqVKgKBjug3mUktfaSLGD68Z0sI3NliHGAqA3h/TWrz35ZPBYHFgobHAhFC8w3rr3rU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=R/pXrXiH; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="R/pXrXiH" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55DBuxPq001917 for ; Fri, 13 Jun 2025 14:04:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=dRjk/GIaSQo 1IqS/32SDSp43gzWPCoXG2x1Joi96rvA=; b=R/pXrXiHkOGAxiUHCmLBipGR2bq MikV93dz4G2AvH0QoJf0D49xrjuHxB1qzKpmPL1L1BIxvBuCvOSeGxjsjJkuWqC3 I2MSPEOZ45y+44EjNGXMWM/gRJYkFtMBwrCQJBxp5N9owSYOSLgfAUSK/va5fHAv x4zxdiUpitdIh1PIBBEUv6rtc3oILju8pp/ZyDOV30e6romAFdYOD4HavOtAmtHw kCe+R0rfrmccQ7yr59LSImIwuqQAn3ElfuOAjS21ewi+2IMvI/MsOabDztZ820xB o8c7tTHeWHbT33iLnScgEpbDvrrQ4TJc1EhlwuA54AbtirnPjkTA6JZRw2Q== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 474ccvkmf0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 13 Jun 2025 14:04:29 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2350804a43eso33461345ad.0 for ; Fri, 13 Jun 2025 07:04:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749823468; x=1750428268; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dRjk/GIaSQo1IqS/32SDSp43gzWPCoXG2x1Joi96rvA=; b=cSGJpshsMyTxq2sUrFa3cI3Vzl9ilVuAltHvEaB4tDisbkMo4NQDl0c80IWRCmmbVk yAwCREEb89g9TQyCVOsYdn4sbL+2y2jXaHezkMXY1fzo7n9KXKO6fGnEMqTGfivFz4fy N6+xwptpmpVnGBG18PPS4KeZm1/VMAlwIbiIy5CB6JkbhOLiF5lk2OuJAVZ0Nylcbisk czx3wy877j4ws3FxqA9hXizG1VOn7r4rRBRmOPdXOex1CGX8UaT6IgB1XHe1fY8jJXQg b46DVUmgGy/NDBin/UIB1T6GHPT/8hTdAfX/g79P1IuAVlchymLZdeHUILLv7HSxu1pe V1ng== X-Forwarded-Encrypted: i=1; AJvYcCUe+LdtVv1/eyl85U0OpVnHDfWL+h2oAWjiBlU5B1WtK3jFKTQSfssNHSqjGyAsNqYeK36AjKuBRRdLkA==@vger.kernel.org X-Gm-Message-State: AOJu0Yw3hCrwLRbiNMh/NuQ3Q0rPcsXDmzCPYPeep1435ohjhOnJ2elN VgQVFlQzUgIpjjGRqV3Q7p7SE3Onlj1l39XcRh2lDJ7z82PcSPDVMOGBqimyLShl+9pYl8IwlTp uq2rxwEGiAQYyIdlTSegoqksxbpPM97zxoklEVmNaAq3Fq8K4Bz6k/m0FfnM4nc69+kYNXD43uQ == X-Gm-Gg: ASbGnctFD6CtzsrK8A51LnG7Di15dTuA21ghb9WxOHfO+FKkGOv7eS+V4Qly3DBLS7C V/cq4McKFFs8Pn2ZlotEvS4dq9zaB9ic6//JJ3TdMC4LN1LHdiZRRcr9wva0Wz23VuUttkppRKY pIY+jzmb5RdNHhjFFVEl4zNp0tMKyV2XgSWC9wx5U69TKf7sRB6p9xDnI/cWWgoi13tkTqJVECc KWS/1qNuP/8WxDwvx3AvlB3fsmBk6su/zIs8HutMyuApwHz6n+u6xLNUwj14AhrIgzxXVSc/CHL QXlJLvaUcUC3n4r0UAqKP49ypASnLgrqWE7VOVrdGDQh5lhe7zsDraQCynXv8URpNlWW2dz82rU b X-Received: by 2002:a17:902:ea11:b0:234:ed31:fca8 with SMTP id d9443c01a7336-2365db04ca2mr42307585ad.27.1749823467287; Fri, 13 Jun 2025 07:04:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFR8jsfnA0oH2YzM9LYN0RUmbEBZjUfR9KtG7h9Y5VC+XY+k59J/pusktrBSu7tajQ58/h8lw== X-Received: by 2002:a17:902:ea11:b0:234:ed31:fca8 with SMTP id d9443c01a7336-2365db04ca2mr42306475ad.27.1749823465796; Fri, 13 Jun 2025 07:04:25 -0700 (PDT) Received: from trex.. (132.red-79-144-190.dynamicip.rima-tde.net. [79.144.190.132]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4532e268de2sm53503615e9.40.2025.06.13.07.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jun 2025 07:04:25 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez@oss.qualcomm.com, quic_vgarodia@quicinc.com, quic_dikshita@quicinc.com, bryan.odonoghue@linaro.org, mchehab@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, stanimir.varbanov@linaro.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] dt-bindings: media: venus: Add qcm2290 dt schema Date: Fri, 13 Jun 2025 16:03:58 +0200 Message-Id: <20250613140402.3619465-2-jorge.ramirez@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250613140402.3619465-1-jorge.ramirez@oss.qualcomm.com> References: <20250613140402.3619465-1-jorge.ramirez@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: dwZROZeO_pGkTwZhOCnoihVTKNdjb4yg X-Authority-Analysis: v=2.4 cv=TsLmhCXh c=1 sm=1 tr=0 ts=684c2fed cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=wjE3nLva0YkvARyJ+Gfmxg==:17 a=6IFa9wvqVegA:10 a=gEfo2CItAAAA:8 a=EUspDBNiAAAA:8 a=KKAkSRfTAAAA:8 a=1mX_ai67dwKzVtmm1w4A:9 a=GvdueXVYPmCkWapjIL-Q:22 a=sptkURWiP4Gy88Gu7hUp:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: dwZROZeO_pGkTwZhOCnoihVTKNdjb4yg X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjEzMDEwMyBTYWx0ZWRfX2gX+xuraXi4M u1BMCSZLMWjHK2J4eNfsg/idbUSyuMSFO3wN0Zegh/qAit5FF0SpucqjVvVJNzqRAVLxgzx2/YY nRgC5r1Q7hrrS0zNviVDxM1G5Qg+tT4uP160lfAEBKc/X/5yX4YDEac8wBCls+Sk/+WUb1Mu+AG INbLHvQfWjl1pOq98G/VBXmYJOG2O3SOxSoXtIZtohnOOjBHm3GrMlIHJPMoC1MrcPydFLBeH0j 2whyLA81jCT+LlbcO5lOXx5kX9tSk4McA/oiI5zGEwAyOJBvsXTYfiZl0t1enkbtRQCk1DSTkN+ /EeZTv3QloUmoKHkV2Qs8aNGA6L7jTXBodM1xoPNm7nnRHMraC+aI8vnVRzz2mdi29r+7QH/X2c tbZwjV1wxg7cUKB6fpLPPH0kn0gCMDtgRAUeXrkF7IZ54NsJ2XKqsgNarK48k6mN7lMpRW7A X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-13_01,2025-06-12_02,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=999 impostorscore=0 priorityscore=1501 bulkscore=0 adultscore=0 clxscore=1015 mlxscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506130103 Add a schema for the venus video encoder/decoder on the qcm2290. Signed-off-by: Jorge Ramirez-Ortiz --- .../bindings/media/qcom,qcm2290-venus.yaml | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,qcm2290-venus.yaml diff --git a/Documentation/devicetree/bindings/media/qcom,qcm2290-venus.yaml b/Documentation/devicetree/bindings/media/qcom,qcm2290-venus.yaml new file mode 100644 index 000000000000..ffa72f1e27f3 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,qcm2290-venus.yaml @@ -0,0 +1,153 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,qcm2290-venus.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm QCM2290 Venus video encode and decode accelerators + +maintainers: + - Stanimir Varbanov + +description: | + The Venus AR50_LITE IP is a video encode and decode accelerator present + on Qualcomm platforms + +allOf: + - $ref: qcom,venus-common.yaml# + +properties: + compatible: + const: qcom,qcm2290-venus + + power-domains: + minItems: 2 + maxItems: 3 + + power-domain-names: + minItems: 2 + items: + - const: venus + - const: vcodec0 + - const: cx + + clocks: + maxItems: 6 + + clock-names: + items: + - const: core + - const: iface + - const: bus + - const: throttle + - const: vcodec0_core + - const: vcodec0_bus + + iommus: + minItems: 1 + maxItems: 5 + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: video-mem + - const: cpu-cfg + + operating-points-v2: true + opp-table: + type: object + + video-decoder: + type: object + + properties: + compatible: + const: venus-decoder + + required: + - compatible + + deprecated: true + additionalProperties: false + + video-encoder: + type: object + + properties: + compatible: + const: venus-encoder + + required: + - compatible + + deprecated: true + additionalProperties: false + +required: + - compatible + - power-domain-names + - iommus + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + #include + #include + + venus: video-codec@5a00000 { + compatible = "qcom,qcm2290-venus"; + reg = <0x5a00000 0xff000>; + interrupts = ; + + power-domains = <&gcc GCC_VENUS_GDSC>, + <&gcc GCC_VCODEC0_GDSC>, + <&rpmpd QCM2290_VDDCX>; + power-domain-names = "venus", "vcodec0", "cx"; + operating-points-v2 = <&venus_opp_table>; + + clocks = <&gcc GCC_VIDEO_VENUS_CTL_CLK>, + <&gcc GCC_VIDEO_AHB_CLK>, + <&gcc GCC_VENUS_CTL_AXI_CLK>, + <&gcc GCC_VIDEO_THROTTLE_CORE_CLK>, + <&gcc GCC_VIDEO_VCODEC0_SYS_CLK>, + <&gcc GCC_VCODEC0_AXI_CLK>; + clock-names = "core", "iface", "bus", "throttle", + "vcodec0_core", "vcodec0_bus"; + + memory-region = <&pil_video_mem>; + iommus = <&apps_smmu 0x860 0x0>, + <&apps_smmu 0x880 0x0>, + <&apps_smmu 0x861 0x04>, + <&apps_smmu 0x863 0x0>, + <&apps_smmu 0x804 0xE0>; + + interconnects = <&mmnrt_virt MASTER_VIDEO_P0 0 &bimc SLAVE_EBI1 0>, + <&bimc MASTER_APPSS_PROC 0 &config_noc SLAVE_VENUS_CFG 0>; + interconnect-names = "video-mem", "cpu-cfg"; + + venus_opp_table: opp-table { + compatible = "operating-points-v2"; + opp-133000000 { + opp-hz = /bits/ 64 <133000000>; + required-opps = <&rpmpd_opp_low_svs>; + }; + opp-240000000 { + opp-hz = /bits/ 64 <240000000>; + required-opps = <&rpmpd_opp_svs>; + }; + }; + + video-decoder { + compatible = "venus-decoder"; + }; + + video-encoder { + compatible = "venus-encoder"; + }; + }; From patchwork Fri Jun 13 14:04:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez X-Patchwork-Id: 896815 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F40E2D1301 for ; Fri, 13 Jun 2025 14:04:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749823475; cv=none; b=MYfmTrlobdz76amkmEKE42h+mYyL6a6WWovYbXp/oQ2cxiQHtGY65+mxW7zaxAkm3lP++z9DJGlLK/ZPI+sv7kpu50xfuaUgV/hO9g7BQ0VT0Z5O3SZL4eMpvIoojsf2pQdAzCfGmqJPZKIjPWU4h7qGtBUpSz9Wirn2ASFvuO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749823475; c=relaxed/simple; bh=ofSIhURbE8JGA42UH0YBsV2VOIoz7qhQ+CYI90S4iYk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RzUErmX0x4hNEFqYo9toubUtDfQWytCnFBKW8fzqJg59a+2R+BynBjWq0trAI3BttoOxpYN+3wBJDVS0kSwNoULT02QTGJkMooiMNq1tmf6fATG+1bYn5zqAlOhuCKjcRa1hwsEsproOYuaQq1Gi1NxWXx5fS+jSViwyLzWDiuA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=CGgL3PP0; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="CGgL3PP0" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55D9B1mi027238 for ; Fri, 13 Jun 2025 14:04:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=q4UXbwz6Fhd 4XfS0c/exNIes/qKVhYhBXGv2xa/goXo=; b=CGgL3PP0l1IQJyh0jgJogaxez+Z dmEVvBX+L+aSuDB0nw9+R7Uu2kMU9sBKKRle6W+hjDIBe7LCRgtrhOxzbyDWncai iTqXKTMwtNwdsCLXTKRmcRJIhRbeLNbFkQ5BHwn3N/nXFCfR6oQjYi5mvWECxwJn xhrhnNwEa1qBLdpofb1wIjW8NbI8n4SE8sD8uBtaVHuqd90Dq4Bhh90k7ZQs90cB ph0XU4yifZ/gGp4zi0CjVedWdJIgqvg6+VNS7X5FSLnUYo0oahbPRK6LcIn2ForY 7HEAZLX/5uC2Y+zAUEL9U4iY65qTnZXS4IyMAgcKAKSpmEwhsUqHImiqyjg== Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 476jrhjjmy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 13 Jun 2025 14:04:32 +0000 (GMT) Received: by mail-ot1-f69.google.com with SMTP id 46e09a7af769-72ecb622e02so858743a34.0 for ; Fri, 13 Jun 2025 07:04:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749823471; x=1750428271; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q4UXbwz6Fhd4XfS0c/exNIes/qKVhYhBXGv2xa/goXo=; b=qGFCXA9ecBo0270w7jHrnRVS8v3d/kk2hUU99GlyhVUERsOjkstz6SKRGQeXHqr8b8 3TvQPkOsnoC0exHMDbYLIh5/r4HfNWxJGklqV0+Rugovbe9Y2KRZoS8AGdX5DxvPZd6G /Qt770JhCLGjwqJLalbISzqy9GBjPHJWred6KX0n6jzn5hWaOQtz5uUlaT80OZ7Eemd3 zRBY6HpAkWjqWxGBpKEgKdAnSx+8b24XQDl/S5/jl5kQQsY3nQjNPpBehYJmPwfx69AR QXg1PqXQoyy4bgoNXt7zVfj48UoYtBIbO7OxThht8Agpf7iiukVYNMnq4cdn6LknP+Ze pRSg== X-Forwarded-Encrypted: i=1; AJvYcCXWkzSz2psdOK0TvLNtevlvgHILroG8dQ+atUhOvXFGx5K1A1btlx9eKKAST0g/WvUf2lVU/1sm518iFA==@vger.kernel.org X-Gm-Message-State: AOJu0Ywn0b5sXI52685rMNBMp7ddpHmbmlRv/+mNQh4do/93eWAteSvR NEb/lynMVXzAoUVCvOvI4GkyeqHmQ6LEe3ulay3LW/ZDFVYW20gQ//iGxSP+uZSbmIy55ItOM4+ dERqY1548kbQY8CdX7jOPpMzX1hMrBIiTLWh2CPymfngA7uolWd+hbGOBiOLEJqzyZQ== X-Gm-Gg: ASbGncs5THnH8/o8Fek7LBzHQEOKM3aPE37pbZ8NI1cJMR5FinQQP4kxjLE0gbsfABX j/1bOhVgRTLRjU0kDyJHVki8rLFiRDfwx4dSyj0i1X5Av46XJ0YCR6LD1Nu/+jqpJ7PImI5p5pG EH+29TPv72r9qBOpC/fH+6jNjo3FdjfKMrbm4Y7DYLafdSem6x1sLhADWK9xfgvgd2vo6/ZKuQj 2e4YB2GlFc3C0VKbKn+hCUk/RaGhnkm6UvV8ld3Qe2rs/fqhb+ZLQtuOTQ/35dHK82TdudsuDj5 7bRdOmyFJe05lCT3lNKn4gmF2waZHYeyk2apk2q9/vhAI5MeqVzYLebsDPeQuH2TGZHK7zJat4g H X-Received: by 2002:a05:6830:6488:b0:739:fa45:591c with SMTP id 46e09a7af769-73a27117ce9mr2091175a34.13.1749823469875; Fri, 13 Jun 2025 07:04:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6NK7CuldtPlXawMuq8prfqWmCFAxSuPDLMdl9iuUTY5hKhPURrq6fXjXd9zDxFImakDqQqg== X-Received: by 2002:a05:6830:6488:b0:739:fa45:591c with SMTP id 46e09a7af769-73a27117ce9mr2091046a34.13.1749823468657; Fri, 13 Jun 2025 07:04:28 -0700 (PDT) Received: from trex.. (132.red-79-144-190.dynamicip.rima-tde.net. [79.144.190.132]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4532e268de2sm53503615e9.40.2025.06.13.07.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jun 2025 07:04:28 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez@oss.qualcomm.com, quic_vgarodia@quicinc.com, quic_dikshita@quicinc.com, bryan.odonoghue@linaro.org, mchehab@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, stanimir.varbanov@linaro.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] media: venus: vdec: ar50_lite video core support Date: Fri, 13 Jun 2025 16:04:00 +0200 Message-Id: <20250613140402.3619465-4-jorge.ramirez@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250613140402.3619465-1-jorge.ramirez@oss.qualcomm.com> References: <20250613140402.3619465-1-jorge.ramirez@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=EovSrTcA c=1 sm=1 tr=0 ts=684c2ff0 cx=c_pps a=z9lCQkyTxNhZyzAvolXo/A==:117 a=wjE3nLva0YkvARyJ+Gfmxg==:17 a=6IFa9wvqVegA:10 a=EUspDBNiAAAA:8 a=Gsml5EI1S0Azkn3hA_8A:9 a=EyFUmsFV_t8cxB2kMr4A:22 X-Proofpoint-ORIG-GUID: UklqdOCxV7gwlcbCpPJtbXjhk_HCgOc_ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjEzMDEwMyBTYWx0ZWRfX3hgC1nbBd5jG CNCNYyYpoObfLHR2qEPIdaY8NgIzQQKvnTo/4LeIls5bGCAKWOMlf3/2O3rcymc/6NfnUCHPRYa Rimpju4FgXebUjgEN91myFWKLP9fuuCBdcGouegXvAyXBR59HM2xuwQvpBKE1C/GhePHe6SH/Ij A9n+HPsvj5+FAJyY4plVRTBK7LclzWC8U7+KdEaxc2Xn4xsBo1x5F2DNTcOAXlEfEvoUNsupPmd Mqqf2p5xHJ+0F5SNSd8CIzaZ0ce0Tc8+luzjho3FUGAA6zTcwSPq5yoyrxPz9HYvxaMWvn7sWHz 96YJ+eoU6Jw1d9mzRvXWMNK7rKu/blLnnYId31i1PlnaI74Q0FlqcGgYen8l/Q/9zcNY5PR3uZy E4DNeFovgCbMwP2qqerz18xnzOHQUSmd7u7OifYVBhLjCpXcEuLdqvhKlvzG1WRphCNFB7JP X-Proofpoint-GUID: UklqdOCxV7gwlcbCpPJtbXjhk_HCgOc_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-13_01,2025-06-12_02,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 suspectscore=0 priorityscore=1501 mlxlogscore=999 mlxscore=0 clxscore=1015 malwarescore=0 adultscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506130103 The AR50_LITE is a streamlined variant of the AR50 video core, designed for power and cost-efficient platforms. It supports hardware-accelerated decoding of H.264, HEVC, and VP9 formats. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/media/platform/qcom/venus/core.c | 11 ++- drivers/media/platform/qcom/venus/core.h | 5 +- drivers/media/platform/qcom/venus/firmware.c | 8 +- drivers/media/platform/qcom/venus/helpers.c | 81 +++++++++++++++++++ drivers/media/platform/qcom/venus/helpers.h | 2 + .../media/platform/qcom/venus/hfi_helper.h | 10 ++- drivers/media/platform/qcom/venus/hfi_venus.c | 14 ++-- .../media/platform/qcom/venus/pm_helpers.c | 1 + drivers/media/platform/qcom/venus/vdec.c | 15 ++-- 9 files changed, 123 insertions(+), 24 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index d305d74bb152..736ef53d988d 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -254,14 +254,19 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type) static void venus_assign_register_offsets(struct venus_core *core) { - if (IS_IRIS2(core) || IS_IRIS2_1(core)) { - core->vbif_base = core->base + VBIF_BASE; + if (IS_IRIS2(core) || IS_IRIS2_1(core) || IS_AR50_LITE(core)) { core->cpu_base = core->base + CPU_BASE_V6; core->cpu_cs_base = core->base + CPU_CS_BASE_V6; core->cpu_ic_base = core->base + CPU_IC_BASE_V6; core->wrapper_base = core->base + WRAPPER_BASE_V6; core->wrapper_tz_base = core->base + WRAPPER_TZ_BASE_V6; - core->aon_base = core->base + AON_BASE_V6; + if (IS_AR50_LITE(core)) { + core->vbif_base = NULL; + core->aon_base = NULL; + } else { + core->vbif_base = core->base + VBIF_BASE; + core->aon_base = core->base + AON_BASE_V6; + } } else { core->vbif_base = core->base + VBIF_BASE; core->cpu_base = core->base + CPU_BASE; diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index b412e0c5515a..122441f9600a 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -382,6 +382,7 @@ enum venus_inst_modes { * @lock: instance lock * @core: a reference to the core struct * @clk_data: clock data per core ID + * @eosbufs: a lit of EOS buffers * @dpbbufs: a list of decoded picture buffers * @internalbufs: a list of internal bufferes * @registeredbufs: a list of registered capture bufferes @@ -450,6 +451,7 @@ struct venus_inst { struct mutex lock; struct venus_core *core; struct clock_data clk_data; + struct list_head eosbufs; struct list_head dpbbufs; struct list_head internalbufs; struct list_head registeredbufs; @@ -520,7 +522,8 @@ struct venus_inst { #define IS_V1(core) ((core)->res->hfi_version == HFI_VERSION_1XX) #define IS_V3(core) ((core)->res->hfi_version == HFI_VERSION_3XX) #define IS_V4(core) ((core)->res->hfi_version == HFI_VERSION_4XX) -#define IS_V6(core) ((core)->res->hfi_version == HFI_VERSION_6XX) +#define IS_V6(core) (((core)->res->hfi_version == HFI_VERSION_6XX) || \ + ((core)->res->hfi_version == HFI_VERSION_6XX_LITE)) #define IS_AR50(core) ((core)->res->vpu_version == VPU_VERSION_AR50) #define IS_AR50_LITE(core) ((core)->res->vpu_version == VPU_VERSION_AR50_LITE) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 66a18830e66d..f8dcef0426ac 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -30,7 +30,7 @@ static void venus_reset_cpu(struct venus_core *core) u32 fw_size = core->fw.mapped_mem_size; void __iomem *wrapper_base; - if (IS_IRIS2_1(core)) + if (IS_IRIS2_1(core) || IS_AR50_LITE(core)) wrapper_base = core->wrapper_tz_base; else wrapper_base = core->wrapper_base; @@ -42,7 +42,7 @@ static void venus_reset_cpu(struct venus_core *core) writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR); writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR); - if (IS_IRIS2_1(core)) { + if (IS_IRIS2_1(core) || IS_AR50_LITE(core)) { /* Bring XTSS out of reset */ writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET); } else { @@ -68,7 +68,7 @@ int venus_set_hw_state(struct venus_core *core, bool resume) if (resume) { venus_reset_cpu(core); } else { - if (IS_IRIS2_1(core)) + if (IS_IRIS2_1(core) || IS_AR50_LITE(core)) writel(WRAPPER_XTSS_SW_RESET_BIT, core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); else @@ -181,7 +181,7 @@ static int venus_shutdown_no_tz(struct venus_core *core) void __iomem *wrapper_base = core->wrapper_base; void __iomem *wrapper_tz_base = core->wrapper_tz_base; - if (IS_IRIS2_1(core)) { + if (IS_IRIS2_1(core) || IS_AR50_LITE(core)) { /* Assert the reset to XTSS */ reg = readl(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET); reg |= WRAPPER_XTSS_SW_RESET_BIT; diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 8295542e1a7c..ae89369c6a07 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -230,6 +230,80 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst) } EXPORT_SYMBOL_GPL(venus_helper_alloc_dpb_bufs); +static void free_eos_buf(struct venus_inst *inst, struct intbuf *buf) +{ + list_del_init(&buf->list); + dma_free_attrs(inst->core->dev, buf->size, buf->va, buf->da, + buf->attrs); + kfree(buf); +} + +int venus_helper_free_eos_bufs(struct venus_inst *inst) +{ + struct intbuf *buf, *n; + + list_for_each_entry_safe(buf, n, &inst->eosbufs, list) { + free_eos_buf(inst, buf); + } + + if (list_empty(&inst->eosbufs)) + INIT_LIST_HEAD(&inst->eosbufs); + + return 0; + +} +EXPORT_SYMBOL_GPL(venus_helper_free_eos_bufs); + +int venus_helper_alloc_eos_buf(struct venus_inst *inst, + struct hfi_frame_data *data) +{ + struct venus_core *core = inst->core; + struct device *dev = core->dev; + struct intbuf *buf; + int ret = 0; + + memset(data, 0, sizeof(*data)); + + data->buffer_type = HFI_BUFFER_INPUT; + data->flags = HFI_BUFFERFLAG_EOS; + + if (IS_AR50_LITE(inst->core)) { + /* We must send valid sizes and addresses */ + buf = kzalloc(sizeof(*buf), GFP_KERNEL); + if (!buf) { + ret = -ENOMEM; + goto fail; + } + + buf->type = HFI_BUFFER_INPUT; + buf->size = SZ_4K; + buf->attrs = DMA_ATTR_NO_KERNEL_MAPPING; + buf->va = dma_alloc_attrs(dev, buf->size, &buf->da, GFP_KERNEL, + buf->attrs); + if (!buf->va) { + ret = -ENOMEM; + goto fail; + } + + list_add_tail(&buf->list, &inst->eosbufs); + + data->alloc_len = buf->size; + data->device_addr = buf->da; + + } else if (IS_V6(inst->core) && + is_fw_rev_or_older(inst->core, 1, 0, 87)) { + data->device_addr = 0; + } else { + data->device_addr = 0xdeadb000; + } + + return 0; +fail: + kfree(buf); + return ret; +} +EXPORT_SYMBOL_GPL(venus_helper_alloc_eos_buf); + static int intbufs_set_buffer(struct venus_inst *inst, u32 type) { struct venus_core *core = inst->core; @@ -630,6 +704,13 @@ static int platform_get_bufreq(struct venus_inst *inst, u32 buftype, if (!hfi_plat || !hfi_plat->bufreq) return -EINVAL; + /* Firmware buffer requirements for internal buffers only */ + if (IS_AR50_LITE(inst->core)) + if ((buftype != HFI_BUFFER_INPUT) && + (buftype != HFI_BUFFER_OUTPUT) && + (buftype != HFI_BUFFER_OUTPUT2)) + return -EINVAL; + params.version = version; params.num_vpp_pipes = inst->core->res->num_vpp_pipes; diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 358e4f39c9c0..bf55fe3b8747 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -58,6 +58,8 @@ int venus_helper_get_out_fmts(struct venus_inst *inst, u32 fmt, u32 *out_fmt, bool venus_helper_check_format(struct venus_inst *inst, u32 v4l2_pixfmt); int venus_helper_alloc_dpb_bufs(struct venus_inst *inst); int venus_helper_free_dpb_bufs(struct venus_inst *inst); +int venus_helper_alloc_eos_buf(struct venus_inst *inst, struct hfi_frame_data *data); +int venus_helper_free_eos_bufs(struct venus_inst *inst); int venus_helper_intbufs_alloc(struct venus_inst *inst); int venus_helper_intbufs_free(struct venus_inst *inst); int venus_helper_intbufs_realloc(struct venus_inst *inst); diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index f44059f19505..128ddf8e3cd5 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -397,13 +397,16 @@ #define HFI_BUFFER_INTERNAL_PERSIST_1 0x5 #define HFI_BUFFER_INTERNAL_SCRATCH(ver) \ (((ver) == HFI_VERSION_4XX || \ - (ver) == HFI_VERSION_6XX) ? 0x6 : 0x1000001) + (ver) == HFI_VERSION_6XX || (ver) == HFI_VERSION_6XX_LITE) \ + ? 0x6 : 0x1000001) #define HFI_BUFFER_INTERNAL_SCRATCH_1(ver) \ (((ver) == HFI_VERSION_4XX || \ - (ver) == HFI_VERSION_6XX) ? 0x7 : 0x1000005) + (ver) == HFI_VERSION_6XX || (ver) == HFI_VERSION_6XX_LITE) \ + ? 0x7 : 0x1000005) #define HFI_BUFFER_INTERNAL_SCRATCH_2(ver) \ (((ver) == HFI_VERSION_4XX || \ - (ver) == HFI_VERSION_6XX) ? 0x8 : 0x1000006) + (ver) == HFI_VERSION_6XX || (ver) == HFI_VERSION_6XX_LITE) \ + ? 0x8 : 0x1000006) #define HFI_BUFFER_EXTRADATA_INPUT(ver) \ (((ver) == HFI_VERSION_4XX) ? 0xc : 0x1000002) #define HFI_BUFFER_EXTRADATA_OUTPUT(ver) \ @@ -561,6 +564,7 @@ enum hfi_version { HFI_VERSION_3XX, HFI_VERSION_4XX, HFI_VERSION_6XX, + HFI_VERSION_6XX_LITE, }; struct hfi_buffer_info { diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index b5f2ea879950..302776bf8fe6 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -497,7 +497,7 @@ static int venus_boot_core(struct venus_hfi_device *hdev) if (count >= max_tries) ret = -ETIMEDOUT; - if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core) || IS_AR50_LITE(hdev->core)) { writel(0x1, cpu_cs_base + CPU_CS_H2XSOFTINTEN_V6); writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); } @@ -565,6 +565,9 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) u32 mask_val; int ret; + if (IS_AR50_LITE(hdev->core)) + return 0; + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) { writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6); @@ -1134,7 +1137,8 @@ static irqreturn_t venus_isr(struct venus_core *core) wrapper_base = hdev->core->wrapper_base; status = readl(wrapper_base + WRAPPER_INTR_STATUS); - if (IS_IRIS2(core) || IS_IRIS2_1(core)) { + + if (IS_IRIS2(core) || IS_IRIS2_1(core) || IS_AR50_LITE(core)) { if (status & WRAPPER_INTR_STATUS_A2H_MASK || status & WRAPPER_INTR_STATUS_A2HWD_MASK_V6 || status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK) @@ -1146,7 +1150,7 @@ static irqreturn_t venus_isr(struct venus_core *core) hdev->irq_status = status; } writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR); - if (!(IS_IRIS2(core) || IS_IRIS2_1(core))) + if (!(IS_IRIS2(core) || IS_IRIS2_1(core) || IS_AR50_LITE(core))) writel(status, wrapper_base + WRAPPER_INTR_CLEAR); return IRQ_WAKE_THREAD; @@ -1531,7 +1535,7 @@ static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev) void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core) || IS_AR50_LITE(hdev->core)) cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); @@ -1551,7 +1555,7 @@ static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev) void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) + if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core) || IS_AR50_LITE(hdev->core)) cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); else cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 409aa9bd0b5d..5d9dfe3fd043 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -1168,6 +1168,7 @@ const struct venus_pm_ops *venus_pm_get(enum hfi_version version) return &pm_ops_v3; case HFI_VERSION_4XX: case HFI_VERSION_6XX: + case HFI_VERSION_6XX_LITE: return &pm_ops_v4; } diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 99ce5fd41577..87c7901b280e 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -550,7 +550,7 @@ vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd *cmd) { struct venus_inst *inst = to_inst(file); struct vb2_queue *dst_vq; - struct hfi_frame_data fdata = {0}; + struct hfi_frame_data fdata; int ret; ret = v4l2_m2m_ioctl_try_decoder_cmd(file, fh, cmd); @@ -561,18 +561,15 @@ vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd *cmd) if (cmd->cmd == V4L2_DEC_CMD_STOP) { /* - * Implement V4L2_DEC_CMD_STOP by enqueue an empty buffer on + * Implement V4L2_DEC_CMD_STOP by enqueue a buffer on * decoder input to signal EOS. */ if (!(inst->streamon_out && inst->streamon_cap)) goto unlock; - fdata.buffer_type = HFI_BUFFER_INPUT; - fdata.flags |= HFI_BUFFERFLAG_EOS; - if (IS_V6(inst->core) && is_fw_rev_or_older(inst->core, 1, 0, 87)) - fdata.device_addr = 0; - else - fdata.device_addr = 0xdeadb000; + ret = venus_helper_alloc_eos_buf(inst, &fdata); + if (ret) + goto unlock; ret = hfi_session_process_buf(inst, &fdata); @@ -1332,6 +1329,7 @@ static void vdec_session_release(struct venus_inst *inst) hfi_session_abort(inst); venus_helper_free_dpb_bufs(inst); + venus_helper_free_eos_bufs(inst); venus_pm_load_scale(inst); INIT_LIST_HEAD(&inst->registeredbufs); mutex_unlock(&inst->lock); @@ -1682,6 +1680,7 @@ static int vdec_open(struct file *file) if (!inst) return -ENOMEM; + INIT_LIST_HEAD(&inst->eosbufs); INIT_LIST_HEAD(&inst->dpbbufs); INIT_LIST_HEAD(&inst->registeredbufs); INIT_LIST_HEAD(&inst->internalbufs); From patchwork Fri Jun 13 14:04:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez X-Patchwork-Id: 896814 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C57742D9EF8 for ; Fri, 13 Jun 2025 14:04:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749823486; cv=none; b=iWKoM+044v79m3C7XJ1QBOsIgNwy/vKj6dxU6HRykk4OZdVTCVEWIaXiS/f5sCFpSriqBGywAeKh+M8GhJdp7APnLPSaIJFBbDl8KwXEanhed6llpNnpGkjLJxS8rfd3C1DpaylpoI+7+9R9FxyejrHAi3Ef5Q9vQqJ8+bcD41U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749823486; c=relaxed/simple; bh=9LSytQPyTFkBJt9YzIaXb6/U5LogpeOg/rPyGmYojDo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r4V75RrxuEeksnad+nzhKvj4tfu1HHICPBMfUojC3EHizyTLSG5P6sDxD8wWUV1tQLZLD/nY3N5QHxiBBf3TC5N7kOlrNCYlxpTB59bVHtBdjobsT6ZhE02Hx9tcspHT3wVvqNErVeesSDSzseNqWX0kfOWicRNExKICgx5vvjA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ju0aZhiD; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ju0aZhiD" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55DAdPpD030455 for ; Fri, 13 Jun 2025 14:04:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=x740bfZ74Zy o3mZSJA/M7WOOgB+n7paS30h2fBwgGpY=; b=ju0aZhiDyvbvsaZfNBH2azwJZ7A Ubzfwh0xHr8I4xdZkbdQgCs3Dd49F9PUxdY3kmrm4RwakCCTQie6mOS2wTNiJcUh Y+n+66o+zX9YTcIWNOVUbSuDw9psHS3GGPqIql2nkJtdRPQyycVGYQMstD9uclq4 NX4/17rE7LW7f4j1sLW+af6C/IQaS8h1CxzD/dypaHIffQj8eX9TZU+z9wlLb8qv ATYX67Q9aRRZZMFF4kYET+RvYjFtjxupSyTxayA9v6gTDxr+vfJgvDDVONBjv/Q5 zdTmgLd+S3Wxfr97TTO7SCK4W9zQXUd3oWpIbgjC93ENSwKk1/cet77Dwww== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 474d12bkvh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 13 Jun 2025 14:04:43 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-4a6f64eebecso40561001cf.2 for ; Fri, 13 Jun 2025 07:04:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749823482; x=1750428282; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x740bfZ74Zyo3mZSJA/M7WOOgB+n7paS30h2fBwgGpY=; b=Ev1vhq6KDa4YS19fhutsIR6/f4oqvD22Ajmdrm0yjo7oFRUdQ0HFgiEIP/Gg652KA4 BWz9VlkrqULK5DQkwtjiUIEcoDjj7ZFX1FqsoIIYfkHekxM1z4k3t7gKO5dU6Oxzh3UZ l8Q3lzKHb24zkQC2wZ1CLSoScUOJDVFWRd+OPtQ/5lseOB0ilWuTVdW1iFDTmI1KMNZa atWTbiby156LQA7WNqugHJ/dnI9HQArIINUCzCHAyV9vbYAHA6ggko+FNqOKXs/FRecM 2tDXqa2qyetGLcIToKcLVOwsTLAgStaI1p5AD5stIhPaLrj7+ISruMTYCMs38LED+jOM uBMg== X-Forwarded-Encrypted: i=1; AJvYcCWIzPDNpATGnlOtKTviAeaIESlRcOdKV1law6gAMOuqpP9YTNaafzMMDAcARtUHxyyMrsMMnvLOsLBGsA==@vger.kernel.org X-Gm-Message-State: AOJu0YxY23DV+Dpi3btNUw+u3dOePgsMzV+JgP+/kL2VUyGq2p+g8/Y0 3HD4y/FFc7eWO/ivxwpe9Oz9z5gDXAMryJhejN7C0oL/sMqSoaCGBGVf9q7BmHXSrOK0b1NDKrs AOg6kBXqdaX+Vk6bvyaamyIiN5mNSZ2IxLZdDIGjqmGOBcpLR3nykIxOlgSQyoU7o7HOTDk8i9w == X-Gm-Gg: ASbGncuh3yW+JBDXIQZDiSHDBASCWMVQighT8Ej1ivpioiYKBSFx4dIham29ykxwEjU OYvzEibeaIYdakV1diKaTVrHYo4L+rVzh9+UbrIaro09+CyuPgVnsvzalMLnuBYWYFu1Jxz8tpV NDDOqsmS/UaqglPHMyF4jHoUbpUXS4Td5B+a2Evn76MHu3Dti0ajtR8bEGb2nuqzKaWLHwF1HNz +Z0ycqd/6ImEZlZi6T+jUUDE9W4hp4ZW/+/OGpjT6fX0xIqGm5B1tvdTViqjQQaKoMELjih+9vm yYdgRU9In+BgutD+OfzosXedEq3ZLr4ra9n5SUuWPOtdojwov0ZwL46T2olVDe0SU8O0xi6oLFg / X-Received: by 2002:a05:622a:5a19:b0:4a6:ef77:3deb with SMTP id d75a77b69052e-4a72ff2d007mr53105861cf.40.1749823482265; Fri, 13 Jun 2025 07:04:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbevzv6PguuQR1l0g0dgZ34lTnIzgLDs80v2wMOxJ6UnIl+jvAGGIIASkHXLfT1eW72IufsQ== X-Received: by 2002:a05:6122:1809:b0:52f:4776:f6a7 with SMTP id 71dfb90a1353d-5313c860c0bmr2057695e0c.0.1749823470030; Fri, 13 Jun 2025 07:04:30 -0700 (PDT) Received: from trex.. (132.red-79-144-190.dynamicip.rima-tde.net. [79.144.190.132]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4532e268de2sm53503615e9.40.2025.06.13.07.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jun 2025 07:04:29 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez@oss.qualcomm.com, quic_vgarodia@quicinc.com, quic_dikshita@quicinc.com, bryan.odonoghue@linaro.org, mchehab@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, stanimir.varbanov@linaro.org Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] media: venus: hfi_plat_v6_lite: Populate decode capabilities Date: Fri, 13 Jun 2025 16:04:01 +0200 Message-Id: <20250613140402.3619465-5-jorge.ramirez@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250613140402.3619465-1-jorge.ramirez@oss.qualcomm.com> References: <20250613140402.3619465-1-jorge.ramirez@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: czzHUNqFoILB9HGdNXeWXqqTVSLQHWKI X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjEzMDEwMiBTYWx0ZWRfX7RAdiIFHCVex YygoZtatGSFdaAy4XqAhoCYVxiwEI6ATBCGUABfWBpZgAvMp82Z02N+sMKcaJaUn28MndkWzUT2 8t0uW5kHXQySYsps4edYenSqBG/gORP/IIuafkbQbBL7E4iPbfdN/mSBpGQHv2uAl9LMXUBmAFT WiZUcXU4guvT5VKtyutGPjMlChPkyHD45Gz/YyZMdCwS7elOBYyc7jwtSe4AFPcdQkeUVrbphyQ Gm9f5/Nj8rCThTlXVb77oVEvRFP5Wxhqh3cNFv0FRnZTwV+ON9ccHiygVCH8BPg0jMscAkWUVKz BLcW3ntMSkiVGfvcgBIU6h2U6+NahidXtaTAabIg2JuM9+OemJbRoXS74qE1cn4VsVnxFucJGYz r7or+F50r9lmrqDTZ+Eia+1NHMRJfergeIT5yUYMJteZNS7/w4OAhm7rq3a2YPoNT4ulc9T/ X-Authority-Analysis: v=2.4 cv=GYkXnRXL c=1 sm=1 tr=0 ts=684c2ffb cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=wjE3nLva0YkvARyJ+Gfmxg==:17 a=6IFa9wvqVegA:10 a=EUspDBNiAAAA:8 a=hV3zkybWQsGKz9K1FyYA:9 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-ORIG-GUID: czzHUNqFoILB9HGdNXeWXqqTVSLQHWKI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-13_01,2025-06-12_02,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 mlxscore=0 adultscore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506130102 Add hfi platform file with decoding capabilities for hfi v6_lite. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/media/platform/qcom/venus/Makefile | 2 +- .../media/platform/qcom/venus/hfi_platform.c | 2 + .../media/platform/qcom/venus/hfi_platform.h | 1 + .../qcom/venus/hfi_platform_v6_lite.c | 148 ++++++++++++++++++ 4 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 drivers/media/platform/qcom/venus/hfi_platform_v6_lite.c diff --git a/drivers/media/platform/qcom/venus/Makefile b/drivers/media/platform/qcom/venus/Makefile index 91ee6be10292..4a6a942db58b 100644 --- a/drivers/media/platform/qcom/venus/Makefile +++ b/drivers/media/platform/qcom/venus/Makefile @@ -5,7 +5,7 @@ venus-core-objs += core.o helpers.o firmware.o \ hfi_venus.o hfi_msgs.o hfi_cmds.o hfi.o \ hfi_parser.o pm_helpers.o dbgfs.o \ hfi_platform.o hfi_platform_v4.o \ - hfi_platform_v6.o hfi_plat_bufs_v6.o \ + hfi_platform_v6.o hfi_plat_bufs_v6.o hfi_platform_v6_lite.o \ venus-dec-objs += vdec.o vdec_ctrls.o venus-enc-objs += venc.o venc_ctrls.o diff --git a/drivers/media/platform/qcom/venus/hfi_platform.c b/drivers/media/platform/qcom/venus/hfi_platform.c index 643e5aa138f5..f56b8f9946d7 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform.c +++ b/drivers/media/platform/qcom/venus/hfi_platform.c @@ -13,6 +13,8 @@ const struct hfi_platform *hfi_platform_get(enum hfi_version version) return &hfi_plat_v4; case HFI_VERSION_6XX: return &hfi_plat_v6; + case HFI_VERSION_6XX_LITE: + return &hfi_plat_v6_lite; default: break; } diff --git a/drivers/media/platform/qcom/venus/hfi_platform.h b/drivers/media/platform/qcom/venus/hfi_platform.h index ec89a90a8129..6356e4bd0de2 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform.h +++ b/drivers/media/platform/qcom/venus/hfi_platform.h @@ -58,6 +58,7 @@ struct hfi_platform { extern const struct hfi_platform hfi_plat_v4; extern const struct hfi_platform hfi_plat_v6; +extern const struct hfi_platform hfi_plat_v6_lite; const struct hfi_platform *hfi_platform_get(enum hfi_version version); unsigned long hfi_platform_get_codec_vpp_freq(enum hfi_version version, u32 codec, diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v6_lite.c b/drivers/media/platform/qcom/venus/hfi_platform_v6_lite.c new file mode 100644 index 000000000000..41958a3e353b --- /dev/null +++ b/drivers/media/platform/qcom/venus/hfi_platform_v6_lite.c @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2025, The Linux Foundation. All rights reserved. + */ +#include "hfi_platform.h" + +static const struct hfi_plat_caps caps[] = { +{ + .codec = HFI_VIDEO_CODEC_H264, + .domain = VIDC_SESSION_TYPE_DEC, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 1920, 1}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 1080, 1}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 8160, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 60000000, 1 }, + .caps[4] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 244800, 1}, + .caps[5] = {HFI_CAPABILITY_FRAMERATE, 1, 120, 1}, + .caps[6] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, + .num_caps = 7, + .pl[0] = {HFI_H264_PROFILE_BASELINE, HFI_H264_LEVEL_1}, + .pl[1] = {HFI_H264_PROFILE_MAIN, HFI_H264_LEVEL_41}, + .pl[2] = {HFI_H264_PROFILE_HIGH, HFI_H264_LEVEL_5}, + .pl[3] = {HFI_H264_PROFILE_CONSTRAINED_BASE, HFI_H264_LEVEL_41}, + .pl[4] = {HFI_H264_PROFILE_CONSTRAINED_HIGH, HFI_H264_LEVEL_41}, + .num_pl = 5, + .fmts[0] = {HFI_BUFFER_OUTPUT, HFI_COLOR_FORMAT_NV12_UBWC}, + .fmts[1] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12_UBWC}, + .fmts[2] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12}, + .fmts[3] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV21}, + .num_fmts = 4, +}, { + .codec = HFI_VIDEO_CODEC_HEVC, + .domain = VIDC_SESSION_TYPE_DEC, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 1920, 1}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 1080, 1}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 8160, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 60000000, 1 }, + .caps[4] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 244800, 1}, + .caps[5] = {HFI_CAPABILITY_FRAMERATE, 1, 120, 1}, + .caps[6] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, + .num_caps = 7, + .pl[0] = {HFI_HEVC_PROFILE_MAIN, HFI_HEVC_LEVEL_5 | HFI_HEVC_TIER_MAIN}, + .pl[1] = {HFI_HEVC_PROFILE_MAIN10, HFI_HEVC_LEVEL_5 | HFI_HEVC_TIER_MAIN}, + .num_pl = 2, + .fmts[0] = {HFI_BUFFER_OUTPUT, HFI_COLOR_FORMAT_NV12_UBWC}, + .fmts[1] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12_UBWC}, + .fmts[2] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12}, + .fmts[3] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV21}, + .num_fmts = 4, +}, { + .codec = HFI_VIDEO_CODEC_VP9, + .domain = VIDC_SESSION_TYPE_DEC, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 1920, 1}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 1080, 1}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 8160, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 60000000, 1 }, + .caps[4] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 244800, 1}, + .caps[5] = {HFI_CAPABILITY_FRAMERATE, 1, 120, 1}, + .caps[6] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, + .num_caps = 7, + .pl[0] = {HFI_VP9_PROFILE_P0, 200}, + .pl[1] = {HFI_VP9_PROFILE_P2_10B, 200}, + .num_pl = 2, + .fmts[0] = {HFI_BUFFER_OUTPUT, HFI_COLOR_FORMAT_NV12_UBWC}, + .fmts[1] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12_UBWC}, + .fmts[2] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV12}, + .fmts[3] = {HFI_BUFFER_OUTPUT2, HFI_COLOR_FORMAT_NV21}, + .num_fmts = 4, +} }; + +static const struct hfi_plat_caps *get_capabilities(unsigned int *entries) +{ + *entries = ARRAY_SIZE(caps); + return caps; +} + +static void get_codecs(u32 *enc_codecs, u32 *dec_codecs, u32 *count) +{ + *enc_codecs = 0x0; + *dec_codecs = HFI_VIDEO_CODEC_H264 | HFI_VIDEO_CODEC_HEVC | + HFI_VIDEO_CODEC_VP9; + *count = 3; +} + +static const struct hfi_platform_codec_freq_data codec_freq_data[] = { + { V4L2_PIX_FMT_H264, VIDC_SESSION_TYPE_DEC, 440, 0, 440 }, + { V4L2_PIX_FMT_HEVC, VIDC_SESSION_TYPE_DEC, 440, 0, 440 }, + { V4L2_PIX_FMT_VP9, VIDC_SESSION_TYPE_DEC, 440, 0, 440 }, +}; + +static const struct hfi_platform_codec_freq_data * +get_codec_freq_data(u32 session_type, u32 pixfmt) +{ + const struct hfi_platform_codec_freq_data *data = codec_freq_data; + unsigned int i, data_size = ARRAY_SIZE(codec_freq_data); + const struct hfi_platform_codec_freq_data *found = NULL; + + for (i = 0; i < data_size; i++) { + if (data[i].pixfmt == pixfmt && + data[i].session_type == session_type) { + found = &data[i]; + break; + } + } + + return found; +} + +static unsigned long codec_vpp_freq(u32 session_type, u32 codec) +{ + const struct hfi_platform_codec_freq_data *data; + + data = get_codec_freq_data(session_type, codec); + if (data) + return data->vpp_freq; + + return 0; +} + +static unsigned long codec_vsp_freq(u32 session_type, u32 codec) +{ + const struct hfi_platform_codec_freq_data *data; + + data = get_codec_freq_data(session_type, codec); + if (data) + return data->vsp_freq; + + return 0; +} + +static unsigned long codec_lp_freq(u32 session_type, u32 codec) +{ + const struct hfi_platform_codec_freq_data *data; + + data = get_codec_freq_data(session_type, codec); + if (data) + return data->low_power_freq; + + return 0; +} + +const struct hfi_platform hfi_plat_v6_lite = { + .codec_vpp_freq = codec_vpp_freq, + .codec_vsp_freq = codec_vsp_freq, + .codec_lp_freq = codec_lp_freq, + .codecs = get_codecs, + .capabilities = get_capabilities, + .bufreq = hfi_plat_bufreq_v6, +};