From nobody Mon Apr 6 10:42:17 2026 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 46B15327BF8 for ; Fri, 20 Mar 2026 01:55:26 +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=1773971736; cv=none; b=L8TObhoAQ7WBbhFQ0bY2L0FhMt9RpAI60TzrSNMqHVPODxSsQzrQWrEm+EMS7NWWJgILVdGA/MG/8SbgRMH3j5R56vaU+7ZcN+bsoqDXFTVpqqAUhs/NLzFeVcJ/eiNsOTIKK175kxAzeHvaH7PAt4+D9S5sbKJERJgCU96ssBk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773971736; c=relaxed/simple; bh=PmWzLXueV4vhYJKrg5q2ChUx9fZ6poNF1eOU/h21iBs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TkOId1lfQHBzTcykOtzz5jDsx/WN3tbsgcQ6GxSaIjtjztBRh+AVKqfr99ZnQzy92thuGr6QArIVvd2Lx52V47n/dXK9/NSKQcPvwARY9NyahVF8aSIMqMPzQEnUTKsNDunf2rjMgdTNhSn+eRD+r2XuM5E6ufOza2wo2QnivFc= 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=J2zuoZsL; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=SB+oMoBW; 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="J2zuoZsL"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="SB+oMoBW" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62JKGOHf2773150 for ; Fri, 20 Mar 2026 01:55:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= M6RGSd6I/1zcWa38bTZ0CP+Armd0rXJMRwbAjpiU8DI=; b=J2zuoZsL1fAl1IjT Sb7gMFbX1wA9ORNnqCYKcgRVbvCnxb/J6xDMguF7pmB8ntXWiOyCSJ/bLfnvw3KZ KdEdQ4gxj+CrVYzr+k91myBV3xm2MQ9Li3eodpMEssXFuRWeyt7Ke0wkcscu6fqf zjR6yjQwNSef7HjwJOc3cZdIw3cWQkjD28ZCXDfwQ9Re67t3uYhN79Ooy4MtEN8D zmrFrlt18DPesjAg0rywhVVpmi7pKwnDEtL3Da46KeLS0dYM66c7Li4HSJff8ALZ 6/zLLQb2WVqtQv+1cP9rQrI1Y8gSk+bzPXKMYgv7yllcTXOHCWbsU52pcmTeBb++ a/1RIA== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d0r1grq3u-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 20 Mar 2026 01:55:24 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-5090e08dcfcso111872651cf.0 for ; Thu, 19 Mar 2026 18:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773971724; x=1774576524; darn=vger.kernel.org; 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=M6RGSd6I/1zcWa38bTZ0CP+Armd0rXJMRwbAjpiU8DI=; b=SB+oMoBWaIIForUdblRSoVyj98n0iAVoDsoPep3vU4pYO8JPlCHJWYQsV02YkLGsbu lQp4B0FEabb2eQSkQRiWVhefcIQimeyHAT4CoB9diob2SK/EkBiMdBLXMf2pGlAPDi6A QvVvpbdX6JPJSBxanOe3HM+Mb/FWAN3G8TVRueqUwgmffgLXY5AQ6GLJylXnSYFLy5oM l5bUZhs+HY24jjIQinr78dTE10xg0JvgPP3+eKsAwhJ4FUFg5dFdonoIVIlMt2/GdpJF DPl/qey4PaBLXDDBzKhAgYz0IXYB8VwLqQ/m0tPs9hwgTL/t5dVHJQOwpfUWhIhmWh48 ijVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773971724; x=1774576524; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=M6RGSd6I/1zcWa38bTZ0CP+Armd0rXJMRwbAjpiU8DI=; b=kgClXRbW25GShENdYHkeA+ynZsWL8nMulv8Rq5WcLnDAAEDtoF+sXGbKC/PtwFQB3O fRo2ffKuZRGyEbaMPlw5S/TEe7xc/dQ4O47s7furF5OEdLddxrDjnkHZjaH542beswmD oqAgCI8VYdzWqD2Pnurs6LAow0LXUYYfieNuJhwnW1x7SBZojFcpKTmIuuBwIvP5YPPp beTf2nuS3BPq7FshkX3Si+MxRsrdJLIn3lUrvNn9pdLSDDW1/5RbJ22pcgNI71OCXd58 e1D0/Na/TkGPpYR0OePUa4rJhEl7FaAlwA0wTMwbdCAmHejBJHXYbeN1SvRkCamPx4hP 5vsg== X-Forwarded-Encrypted: i=1; AJvYcCW6Jrbtpv2uMy8ovXdF40J4MIptFPsN2TCZkdS4UZgOD/MeU+xRjbl8iZj1yOqE59XzZZo5oxaqBkxWdZQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwMbl1U6PObqhCa/jRvneVm9wJLKKfARuGrvIDa0BgWjY+HUSw5 DXvs6+tp7WIzF+lExtKpeZfGo2zrr28ll+b4dP0iaYlPhMmB0RWRTZPeWb0Rq064YGqPfHu3yfE oKViQoMFoUmkJGl2hOw5bXgy91tHAsXvLevwE4hPyeQSRuEyGSAUB4EfkaCw5IUFWMjs= X-Gm-Gg: ATEYQzx/I8swwgSN0pcDHGhFYDTPFq4bOWSPEbOiXv7Eq5o7lmGOSNP2RJhrRfxPvFt oRRy/70dNBW+Gx+AotjBNrGsyVN++rYBkP3ooXDE5Yo61alVSDr2Vuymcrkq257IzoHsrF5or9q MdyiqARvXjjKNpTXJSXPFct2l4FMLmq7HFISTJ4XhZdynO16zoTEdiIPMMMHudB02/uaTU6Ht3Z olDnT5DemLdxkm7nT0xil6mNS91i7p+emcptugKwd5i1R1cat3R+VqGEJmcGnuczznmA52zOT/a Ef7VR0wBdh0fzBIeZ0I8V2LuCiUhyX95mC5Vm3OAa6iP1+Mx1E0vEg8bUnaCZ/C1dDUF98loQ+m m/tMV4ywNj7uF+ieMKlfbuwSQ/EJXHqM4gGtxls0WlipYnlE71Gp22+hLZPOdIXPVQFm9i4IGWL B8b1eeEEw0GgvXRBcOEIhWhLy2IubHEhu5gE4= X-Received: by 2002:ac8:5fcd:0:b0:509:34b8:a367 with SMTP id d75a77b69052e-50b3747ac9amr20168911cf.30.1773971723881; Thu, 19 Mar 2026 18:55:23 -0700 (PDT) X-Received: by 2002:ac8:5fcd:0:b0:509:34b8:a367 with SMTP id d75a77b69052e-50b3747ac9amr20168651cf.30.1773971723290; Thu, 19 Mar 2026 18:55:23 -0700 (PDT) Received: from umbar.lan (2001-14ba-a073-af00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a073:af00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a285305eefsm232344e87.70.2026.03.19.18.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2026 18:55:20 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 20 Mar 2026 03:54:49 +0200 Subject: [PATCH v9 09/11] media: qcom: iris: split platform data from firmware data Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260320-iris-platform-data-v9-9-3939967f4752@oss.qualcomm.com> References: <20260320-iris-platform-data-v9-0-3939967f4752@oss.qualcomm.com> In-Reply-To: <20260320-iris-platform-data-v9-0-3939967f4752@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=31752; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=PmWzLXueV4vhYJKrg5q2ChUx9fZ6poNF1eOU/h21iBs=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBpvKjmfYEtT4MgKz9VFEFmk0UJG1MW6jC+7vfBc CNYZMMMtK+JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCabyo5gAKCRCLPIo+Aiko 1UXkB/9QHIuVQyVzH4/WY6LP2OFShGzlMW1x0S9YRxAZ2iAiBj0R5gwWr5aCvm2xL+cV9W5wE97 Fmu5GTrRgNCv5iON/1t5kY6bqWhjFMb3Jqeg+J+WD9FxAvDTKrY4S2hUfi/x0x7kr1+Iv5MHUvG GPJhix8PSeAsBnux8qeTToxGRJ3RRo3MaS6wEDVDnEwWAlYWYa6oeBwxptn/YP2cf+ThKuVFq2P O4YV6+nNKiTfqpecnv/HbmThdiPlYZUgwrsMGpyLXGvmM/QBciy+ZRopeOvlgH5N0usVKMXkmE+ hFdtnrLZ1biZ/iI4Tx5PNstPIvvUpGmh1NJvJUdhDAj8jl6i X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzIwMDAxMyBTYWx0ZWRfX9YEg3J9wtrNx 4LVLbCNpMuoCR/nnhUY09lzm0muEwKMJzCkXWBuePHTWukcAcY7knUnVbFjCIi8pm9G7WoAqivF ruoMYhyWg/HeGhCeofxQ7vYKCcbFEc475Tta9V8wEQ/1P4tCYJfk7ZeOJufpnGrX2gCE+R/Il9v +H4KHLxeI8YmRNqRtZQSPdmEunZ2uvUvKkTm0gvJqKIvKlX+nD/hCgGwMIWT8+MxAAsz+iquCjf RRj1ZZXPmpW4bh9q5sCTbABlBQHaJpfdimrkAUNXH2TLsivWK/4TQQJIFdRwQqXM7xhoMRmiy1S 3+LtFgHGivpQjP+HcIdtZGq7jUPQrrgUAQwoIs38wNEZZto5Tj4QdFMOvKJhy0qDHhBA1EqzSO4 WK6iIJ7YKRynh8HdmJtmD+AcUfUwKshlmH/mzV+6a5SMMsOlQqpXZNwFKxD6Ot252zWvewOsRLC jlvcz0Lf2jeuEsyW9hA== X-Proofpoint-GUID: MlryYsG0p2WDznztL2p0lxaYIK6A-pd2 X-Proofpoint-ORIG-GUID: MlryYsG0p2WDznztL2p0lxaYIK6A-pd2 X-Authority-Analysis: v=2.4 cv=Y/D1cxeN c=1 sm=1 tr=0 ts=69bca90d cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=UeMVAvltljHvvOQHH34A:9 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-19_04,2026-03-19_05,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 phishscore=0 bulkscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603200013 Finalize the logical separation of the software and hardware interface descriptions by moving hardware properties to the files specific to the particular VPU version. Signed-off-by: Dmitry Baryshkov --- drivers/media/platform/qcom/iris/Makefile | 6 +- .../iris/{iris_platform_gen1.c =3D> iris_hfi_gen1.c} | 134 ------------- .../iris/{iris_platform_gen2.c =3D> iris_hfi_gen2.c} | 214 ---------------= ------ .../platform/qcom/iris/iris_platform_common.h | 3 + .../platform/qcom/iris/iris_platform_sm8250.h | 29 +++ .../platform/qcom/iris/iris_platform_sm8550.h | 31 +++ .../media/platform/qcom/iris/iris_platform_vpu2.c | 124 ++++++++++++ .../media/platform/qcom/iris/iris_platform_vpu3x.c | 204 +++++++++++++++++= +++ 8 files changed, 395 insertions(+), 350 deletions(-) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/plat= form/qcom/iris/Makefile index 2fde45f81727..48e415cbc439 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -4,14 +4,16 @@ qcom-iris-objs +=3D iris_buffer.o \ iris_ctrls.o \ iris_firmware.o \ iris_hfi_common.o \ + iris_hfi_gen1.o \ iris_hfi_gen1_command.o \ iris_hfi_gen1_response.o \ + iris_hfi_gen2.o \ iris_hfi_gen2_command.o \ iris_hfi_gen2_packet.o \ iris_hfi_gen2_response.o \ iris_hfi_queue.o \ - iris_platform_gen1.o \ - iris_platform_gen2.o \ + iris_platform_vpu2.o \ + iris_platform_vpu3x.o \ iris_power.o \ iris_probe.o \ iris_resources.o \ diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen1.c b/driver= s/media/platform/qcom/iris/iris_hfi_gen1.c similarity index 67% rename from drivers/media/platform/qcom/iris/iris_platform_gen1.c rename to drivers/media/platform/qcom/iris/iris_hfi_gen1.c index 8875f90d487e..60f51a1ba941 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen1.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1.c @@ -3,38 +3,16 @@ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights res= erved. */ =20 -#include "iris_core.h" #include "iris_ctrls.h" #include "iris_platform_common.h" -#include "iris_resources.h" #include "iris_hfi_gen1.h" #include "iris_hfi_gen1_defines.h" #include "iris_vpu_buffer.h" -#include "iris_vpu_common.h" -#include "iris_instance.h" - -#include "iris_platform_sc7280.h" =20 #define BITRATE_MIN 32000 #define BITRATE_MAX 160000000 -#define BITRATE_PEAK_DEFAULT (BITRATE_DEFAULT * 2) #define BITRATE_STEP 100 =20 -static struct iris_fmt platform_fmts_sm8250_dec[] =3D { - [IRIS_FMT_H264] =3D { - .pixfmt =3D V4L2_PIX_FMT_H264, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, - [IRIS_FMT_HEVC] =3D { - .pixfmt =3D V4L2_PIX_FMT_HEVC, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, - [IRIS_FMT_VP9] =3D { - .pixfmt =3D V4L2_PIX_FMT_VP9, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, -}; - static struct platform_inst_fw_cap inst_fw_cap_sm8250_dec[] =3D { { .cap_id =3D PIPE, @@ -248,56 +226,6 @@ static const struct platform_inst_fw_cap inst_fw_cap_s= m8250_enc[] =3D { }, }; =20 -static struct platform_inst_caps platform_inst_cap_sm8250 =3D { - .min_frame_width =3D 128, - .max_frame_width =3D 8192, - .min_frame_height =3D 128, - .max_frame_height =3D 8192, - .max_mbpf =3D 138240, - .mb_cycles_vsp =3D 25, - .mb_cycles_vpp =3D 200, - .max_frame_rate =3D MAXIMUM_FPS, - .max_operating_rate =3D MAXIMUM_FPS, -}; - -static const struct icc_info sm8250_icc_table[] =3D { - { "cpu-cfg", 1000, 1000 }, - { "video-mem", 1000, 15000000 }, -}; - -static const char * const sm8250_clk_reset_table[] =3D { "bus", "core" }; - -static const struct bw_info sm8250_bw_table_dec[] =3D { - { ((4096 * 2160) / 256) * 60, 2403000 }, - { ((4096 * 2160) / 256) * 30, 1224000 }, - { ((1920 * 1080) / 256) * 60, 812000 }, - { ((1920 * 1080) / 256) * 30, 416000 }, -}; - -static const char * const sm8250_pmdomain_table[] =3D { "venus", "vcodec0"= }; - -static const char * const sm8250_opp_pd_table[] =3D { "mx", "mmcx" }; - -static const struct platform_clk_data sm8250_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, -}; - -static const char * const sm8250_opp_clk_table[] =3D { - "vcodec0_core", - NULL, -}; - -static const struct tz_cp_config tz_cp_config_sm8250[] =3D { - { - .cp_start =3D 0, - .cp_size =3D 0x25800000, - .cp_nonpixel_start =3D 0x01000000, - .cp_nonpixel_size =3D 0x24800000, - }, -}; - static const u32 sm8250_vdec_input_config_param_default[] =3D { HFI_PROPERTY_CONFIG_VIDEOCORES_USAGE, HFI_PROPERTY_PARAM_UNCOMPRESSED_FORMAT_SELECT, @@ -356,65 +284,3 @@ const struct iris_firmware_data iris_hfi_gen1_data =3D= { .enc_ip_int_buf_tbl =3D sm8250_enc_ip_int_buf_tbl, .enc_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8250_enc_ip_int_buf_tbl), }; - -const struct iris_platform_data sm8250_data =3D { - .firmware_data =3D &iris_hfi_gen1_data, - .get_vpu_buffer_size =3D iris_vpu_buf_size, - .vpu_ops =3D &iris_vpu2_ops, - .icc_tbl =3D sm8250_icc_table, - .icc_tbl_size =3D ARRAY_SIZE(sm8250_icc_table), - .clk_rst_tbl =3D sm8250_clk_reset_table, - .clk_rst_tbl_size =3D ARRAY_SIZE(sm8250_clk_reset_table), - .bw_tbl_dec =3D sm8250_bw_table_dec, - .bw_tbl_dec_size =3D ARRAY_SIZE(sm8250_bw_table_dec), - .pmdomain_tbl =3D sm8250_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8250_pmdomain_table), - .opp_pd_tbl =3D sm8250_opp_pd_table, - .opp_pd_tbl_size =3D ARRAY_SIZE(sm8250_opp_pd_table), - .clk_tbl =3D sm8250_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8250_clk_table), - .opp_clk_tbl =3D sm8250_opp_clk_table, - /* Upper bound of DMA address range */ - .dma_mask =3D 0xe0000000 - 1, - .fwname =3D "qcom/vpu-1.0/venus.mbn", - .inst_iris_fmts =3D platform_fmts_sm8250_dec, - .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8250_dec), - .inst_caps =3D &platform_inst_cap_sm8250, - .tz_cp_config_data =3D tz_cp_config_sm8250, - .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_sm8250), - .num_vpp_pipe =3D 4, - .max_session_count =3D 16, - .max_core_mbpf =3D NUM_MBS_8K, - .max_core_mbps =3D ((7680 * 4320) / 256) * 60, -}; - -const struct iris_platform_data sc7280_data =3D { - .firmware_data =3D &iris_hfi_gen1_data, - .get_vpu_buffer_size =3D iris_vpu_buf_size, - .vpu_ops =3D &iris_vpu2_ops, - .icc_tbl =3D sm8250_icc_table, - .icc_tbl_size =3D ARRAY_SIZE(sm8250_icc_table), - .bw_tbl_dec =3D sc7280_bw_table_dec, - .bw_tbl_dec_size =3D ARRAY_SIZE(sc7280_bw_table_dec), - .pmdomain_tbl =3D sm8250_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8250_pmdomain_table), - .opp_pd_tbl =3D sc7280_opp_pd_table, - .opp_pd_tbl_size =3D ARRAY_SIZE(sc7280_opp_pd_table), - .clk_tbl =3D sc7280_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sc7280_clk_table), - .opp_clk_tbl =3D sc7280_opp_clk_table, - /* Upper bound of DMA address range */ - .dma_mask =3D 0xe0000000 - 1, - .fwname =3D "qcom/vpu/vpu20_p1.mbn", - .inst_iris_fmts =3D platform_fmts_sm8250_dec, - .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8250_dec), - .inst_caps =3D &platform_inst_cap_sm8250, - .tz_cp_config_data =3D tz_cp_config_sm8250, - .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_sm8250), - .num_vpp_pipe =3D 1, - .no_aon =3D true, - .max_session_count =3D 16, - .max_core_mbpf =3D 4096 * 2176 / 256 * 2 + 1920 * 1088 / 256, - /* max spec for SC7280 is 4096x2176@60fps */ - .max_core_mbps =3D 4096 * 2176 / 256 * 60, -}; diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/driver= s/media/platform/qcom/iris/iris_hfi_gen2.c similarity index 77% rename from drivers/media/platform/qcom/iris/iris_platform_gen2.c rename to drivers/media/platform/qcom/iris/iris_hfi_gen2.c index 05fbab276100..ce8490d64854 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2.c @@ -4,40 +4,15 @@ * Copyright (c) 2025 Linaro Ltd */ =20 -#include "iris_core.h" #include "iris_ctrls.h" #include "iris_hfi_gen2.h" #include "iris_hfi_gen2_defines.h" #include "iris_platform_common.h" #include "iris_vpu_buffer.h" -#include "iris_vpu_common.h" - -#include "iris_platform_qcs8300.h" -#include "iris_platform_sm8650.h" -#include "iris_platform_sm8750.h" =20 #define VIDEO_ARCH_LX 1 #define BITRATE_MAX 245000000 =20 -static struct iris_fmt platform_fmts_sm8550_dec[] =3D { - [IRIS_FMT_H264] =3D { - .pixfmt =3D V4L2_PIX_FMT_H264, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, - [IRIS_FMT_HEVC] =3D { - .pixfmt =3D V4L2_PIX_FMT_HEVC, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, - [IRIS_FMT_VP9] =3D { - .pixfmt =3D V4L2_PIX_FMT_VP9, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, - [IRIS_FMT_AV1] =3D { - .pixfmt =3D V4L2_PIX_FMT_AV1, - .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, - }, -}; - static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] =3D { { .cap_id =3D PROFILE_H264, @@ -742,58 +717,6 @@ static const struct platform_inst_fw_cap inst_fw_cap_s= m8550_enc[] =3D { }, }; =20 -static struct platform_inst_caps platform_inst_cap_sm8550 =3D { - .min_frame_width =3D 96, - .max_frame_width =3D 8192, - .min_frame_height =3D 96, - .max_frame_height =3D 8192, - .max_mbpf =3D (8192 * 4352) / 256, - .mb_cycles_vpp =3D 200, - .mb_cycles_fw =3D 489583, - .mb_cycles_fw_vpp =3D 66234, - .num_comv =3D 0, - .max_frame_rate =3D MAXIMUM_FPS, - .max_operating_rate =3D MAXIMUM_FPS, -}; - -static const struct icc_info sm8550_icc_table[] =3D { - { "cpu-cfg", 1000, 1000 }, - { "video-mem", 1000, 15000000 }, -}; - -static const char * const sm8550_clk_reset_table[] =3D { "bus" }; - -static const struct bw_info sm8550_bw_table_dec[] =3D { - { ((4096 * 2160) / 256) * 60, 1608000 }, - { ((4096 * 2160) / 256) * 30, 826000 }, - { ((1920 * 1080) / 256) * 60, 567000 }, - { ((1920 * 1080) / 256) * 30, 294000 }, -}; - -static const char * const sm8550_pmdomain_table[] =3D { "venus", "vcodec0"= }; - -static const char * const sm8550_opp_pd_table[] =3D { "mxc", "mmcx" }; - -static const struct platform_clk_data sm8550_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, -}; - -static const char * const sm8550_opp_clk_table[] =3D { - "vcodec0_core", - NULL, -}; - -static const struct tz_cp_config tz_cp_config_sm8550[] =3D { - { - .cp_start =3D 0, - .cp_size =3D 0x25800000, - .cp_nonpixel_start =3D 0x01000000, - .cp_nonpixel_size =3D 0x24800000, - }, -}; - static const u32 sm8550_vdec_input_config_params_default[] =3D { HFI_PROP_BITSTREAM_RESOLUTION, HFI_PROP_CROP_OFFSETS, @@ -971,140 +894,3 @@ const struct iris_firmware_data iris_hfi_gen2_data = =3D { .enc_op_int_buf_tbl =3D sm8550_enc_op_int_buf_tbl, .enc_op_int_buf_tbl_size =3D ARRAY_SIZE(sm8550_enc_op_int_buf_tbl), }; - -const struct iris_platform_data sm8550_data =3D { - .firmware_data =3D &iris_hfi_gen2_data, - .get_vpu_buffer_size =3D iris_vpu_buf_size, - .vpu_ops =3D &iris_vpu3_ops, - .icc_tbl =3D sm8550_icc_table, - .icc_tbl_size =3D ARRAY_SIZE(sm8550_icc_table), - .clk_rst_tbl =3D sm8550_clk_reset_table, - .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), - .bw_tbl_dec =3D sm8550_bw_table_dec, - .bw_tbl_dec_size =3D ARRAY_SIZE(sm8550_bw_table_dec), - .pmdomain_tbl =3D sm8550_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8550_pmdomain_table), - .opp_pd_tbl =3D sm8550_opp_pd_table, - .opp_pd_tbl_size =3D ARRAY_SIZE(sm8550_opp_pd_table), - .clk_tbl =3D sm8550_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), - .opp_clk_tbl =3D sm8550_opp_clk_table, - /* Upper bound of DMA address range */ - .dma_mask =3D 0xe0000000 - 1, - .fwname =3D "qcom/vpu/vpu30_p4.mbn", - .inst_iris_fmts =3D platform_fmts_sm8550_dec, - .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8550_dec), - .inst_caps =3D &platform_inst_cap_sm8550, - .tz_cp_config_data =3D tz_cp_config_sm8550, - .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_sm8550), - .num_vpp_pipe =3D 4, - .max_session_count =3D 16, - .max_core_mbpf =3D NUM_MBS_8K * 2, - .max_core_mbps =3D ((7680 * 4320) / 256) * 60, -}; - -/* - * Shares most of SM8550 data except: - * - vpu_ops to iris_vpu33_ops - * - clk_rst_tbl to sm8650_clk_reset_table - * - controller_rst_tbl to sm8650_controller_reset_table - * - fwname to "qcom/vpu/vpu33_p4.mbn" - */ -const struct iris_platform_data sm8650_data =3D { - .firmware_data =3D &iris_hfi_gen2_data, - .get_vpu_buffer_size =3D iris_vpu33_buf_size, - .vpu_ops =3D &iris_vpu33_ops, - .icc_tbl =3D sm8550_icc_table, - .icc_tbl_size =3D ARRAY_SIZE(sm8550_icc_table), - .clk_rst_tbl =3D sm8650_clk_reset_table, - .clk_rst_tbl_size =3D ARRAY_SIZE(sm8650_clk_reset_table), - .controller_rst_tbl =3D sm8650_controller_reset_table, - .controller_rst_tbl_size =3D ARRAY_SIZE(sm8650_controller_reset_table), - .bw_tbl_dec =3D sm8550_bw_table_dec, - .bw_tbl_dec_size =3D ARRAY_SIZE(sm8550_bw_table_dec), - .pmdomain_tbl =3D sm8550_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8550_pmdomain_table), - .opp_pd_tbl =3D sm8550_opp_pd_table, - .opp_pd_tbl_size =3D ARRAY_SIZE(sm8550_opp_pd_table), - .clk_tbl =3D sm8550_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), - .opp_clk_tbl =3D sm8550_opp_clk_table, - /* Upper bound of DMA address range */ - .dma_mask =3D 0xe0000000 - 1, - .fwname =3D "qcom/vpu/vpu33_p4.mbn", - .inst_iris_fmts =3D platform_fmts_sm8550_dec, - .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8550_dec), - .inst_caps =3D &platform_inst_cap_sm8550, - .tz_cp_config_data =3D tz_cp_config_sm8550, - .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_sm8550), - .num_vpp_pipe =3D 4, - .max_session_count =3D 16, - .max_core_mbpf =3D NUM_MBS_8K * 2, - .max_core_mbps =3D ((7680 * 4320) / 256) * 60, -}; - -const struct iris_platform_data sm8750_data =3D { - .firmware_data =3D &iris_hfi_gen2_data, - .get_vpu_buffer_size =3D iris_vpu33_buf_size, - .vpu_ops =3D &iris_vpu35_ops, - .icc_tbl =3D sm8550_icc_table, - .icc_tbl_size =3D ARRAY_SIZE(sm8550_icc_table), - .clk_rst_tbl =3D sm8750_clk_reset_table, - .clk_rst_tbl_size =3D ARRAY_SIZE(sm8750_clk_reset_table), - .bw_tbl_dec =3D sm8550_bw_table_dec, - .bw_tbl_dec_size =3D ARRAY_SIZE(sm8550_bw_table_dec), - .pmdomain_tbl =3D sm8550_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8550_pmdomain_table), - .opp_pd_tbl =3D sm8550_opp_pd_table, - .opp_pd_tbl_size =3D ARRAY_SIZE(sm8550_opp_pd_table), - .clk_tbl =3D sm8750_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8750_clk_table), - .opp_clk_tbl =3D sm8550_opp_clk_table, - /* Upper bound of DMA address range */ - .dma_mask =3D 0xe0000000 - 1, - .fwname =3D "qcom/vpu/vpu35_p4.mbn", - .inst_iris_fmts =3D platform_fmts_sm8550_dec, - .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8550_dec), - .inst_caps =3D &platform_inst_cap_sm8550, - .tz_cp_config_data =3D tz_cp_config_sm8550, - .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_sm8550), - .num_vpp_pipe =3D 4, - .max_session_count =3D 16, - .max_core_mbpf =3D NUM_MBS_8K * 2, - .max_core_mbps =3D ((7680 * 4320) / 256) * 60, -}; - -/* - * Shares most of SM8550 data except: - * - inst_caps to platform_inst_cap_qcs8300 - */ -const struct iris_platform_data qcs8300_data =3D { - .firmware_data =3D &iris_hfi_gen2_data, - .get_vpu_buffer_size =3D iris_vpu_buf_size, - .vpu_ops =3D &iris_vpu3_ops, - .icc_tbl =3D sm8550_icc_table, - .icc_tbl_size =3D ARRAY_SIZE(sm8550_icc_table), - .clk_rst_tbl =3D sm8550_clk_reset_table, - .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), - .bw_tbl_dec =3D sm8550_bw_table_dec, - .bw_tbl_dec_size =3D ARRAY_SIZE(sm8550_bw_table_dec), - .pmdomain_tbl =3D sm8550_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8550_pmdomain_table), - .opp_pd_tbl =3D sm8550_opp_pd_table, - .opp_pd_tbl_size =3D ARRAY_SIZE(sm8550_opp_pd_table), - .clk_tbl =3D sm8550_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), - .opp_clk_tbl =3D sm8550_opp_clk_table, - /* Upper bound of DMA address range */ - .dma_mask =3D 0xe0000000 - 1, - .fwname =3D "qcom/vpu/vpu30_p4_s6.mbn", - .inst_iris_fmts =3D platform_fmts_sm8550_dec, - .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8550_dec), - .inst_caps =3D &platform_inst_cap_qcs8300, - .tz_cp_config_data =3D tz_cp_config_sm8550, - .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_sm8550), - .num_vpp_pipe =3D 2, - .max_session_count =3D 16, - .max_core_mbpf =3D ((4096 * 2176) / 256) * 4, - .max_core_mbps =3D (((3840 * 2176) / 256) * 120), -}; diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 5af6d9f49f01..6dfead673393 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -40,6 +40,9 @@ enum pipe_type { PIPE_4 =3D 4, }; =20 +extern const struct iris_firmware_data iris_hfi_gen1_data; +extern const struct iris_firmware_data iris_hfi_gen2_data; + extern const struct iris_platform_data qcs8300_data; extern const struct iris_platform_data sc7280_data; extern const struct iris_platform_data sm8250_data; diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8250.h b/driv= ers/media/platform/qcom/iris/iris_platform_sm8250.h new file mode 100644 index 000000000000..50306043eb8e --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8250.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#ifndef __IRIS_PLATFORM_SM8250_H__ +#define __IRIS_PLATFORM_SM8250_H__ + +static const struct bw_info sm8250_bw_table_dec[] =3D { + { ((4096 * 2160) / 256) * 60, 2403000 }, + { ((4096 * 2160) / 256) * 30, 1224000 }, + { ((1920 * 1080) / 256) * 60, 812000 }, + { ((1920 * 1080) / 256) * 30, 416000 }, +}; + +static const char * const sm8250_opp_pd_table[] =3D { "mx", "mmcx" }; + +static const struct platform_clk_data sm8250_clk_table[] =3D { + {IRIS_AXI_CLK, "iface" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_HW_CLK, "vcodec0_core" }, +}; + +static const char * const sm8250_opp_clk_table[] =3D { + "vcodec0_core", + NULL, +}; + +#endif diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8550.h b/driv= ers/media/platform/qcom/iris/iris_platform_sm8550.h new file mode 100644 index 000000000000..a9d9709c2e35 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8550.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#ifndef __IRIS_PLATFORM_SM8550_H__ +#define __IRIS_PLATFORM_SM8550_H__ + +static const char * const sm8550_clk_reset_table[] =3D { "bus" }; + +static const struct platform_clk_data sm8550_clk_table[] =3D { + {IRIS_AXI_CLK, "iface" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_HW_CLK, "vcodec0_core" }, +}; + +static struct platform_inst_caps platform_inst_cap_sm8550 =3D { + .min_frame_width =3D 96, + .max_frame_width =3D 8192, + .min_frame_height =3D 96, + .max_frame_height =3D 8192, + .max_mbpf =3D (8192 * 4352) / 256, + .mb_cycles_vpp =3D 200, + .mb_cycles_fw =3D 489583, + .mb_cycles_fw_vpp =3D 66234, + .num_comv =3D 0, + .max_frame_rate =3D MAXIMUM_FPS, + .max_operating_rate =3D MAXIMUM_FPS, +}; + +#endif diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu2.c b/driver= s/media/platform/qcom/iris/iris_platform_vpu2.c new file mode 100644 index 000000000000..ab2a19aa9c36 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu2.c @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include "iris_core.h" +#include "iris_ctrls.h" +#include "iris_platform_common.h" +#include "iris_resources.h" +#include "iris_hfi_gen1.h" +#include "iris_hfi_gen1_defines.h" +#include "iris_vpu_buffer.h" +#include "iris_vpu_common.h" +#include "iris_instance.h" + +#include "iris_platform_sc7280.h" +#include "iris_platform_sm8250.h" + +static struct iris_fmt iris_fmts_vpu2_dec[] =3D { + [IRIS_FMT_H264] =3D { + .pixfmt =3D V4L2_PIX_FMT_H264, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_HEVC] =3D { + .pixfmt =3D V4L2_PIX_FMT_HEVC, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_VP9] =3D { + .pixfmt =3D V4L2_PIX_FMT_VP9, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, +}; + +static struct platform_inst_caps platform_inst_cap_vpu2 =3D { + .min_frame_width =3D 128, + .max_frame_width =3D 8192, + .min_frame_height =3D 128, + .max_frame_height =3D 8192, + .max_mbpf =3D 138240, + .mb_cycles_vsp =3D 25, + .mb_cycles_vpp =3D 200, + .max_frame_rate =3D MAXIMUM_FPS, + .max_operating_rate =3D MAXIMUM_FPS, +}; + +static const struct icc_info iris_icc_info_vpu2[] =3D { + { "cpu-cfg", 1000, 1000 }, + { "video-mem", 1000, 15000000 }, +}; + +static const char * const iris_clk_reset_table_vpu2[] =3D { "bus", "core" = }; + +static const char * const iris_pmdomain_table_vpu2[] =3D { "venus", "vcode= c0" }; + +static const struct tz_cp_config tz_cp_config_vpu2[] =3D { + { + .cp_start =3D 0, + .cp_size =3D 0x25800000, + .cp_nonpixel_start =3D 0x01000000, + .cp_nonpixel_size =3D 0x24800000, + }, +}; + +const struct iris_platform_data sc7280_data =3D { + .firmware_data =3D &iris_hfi_gen1_data, + .get_vpu_buffer_size =3D iris_vpu_buf_size, + .vpu_ops =3D &iris_vpu2_ops, + .icc_tbl =3D iris_icc_info_vpu2, + .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu2), + .bw_tbl_dec =3D sc7280_bw_table_dec, + .bw_tbl_dec_size =3D ARRAY_SIZE(sc7280_bw_table_dec), + .pmdomain_tbl =3D iris_pmdomain_table_vpu2, + .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu2), + .opp_pd_tbl =3D sc7280_opp_pd_table, + .opp_pd_tbl_size =3D ARRAY_SIZE(sc7280_opp_pd_table), + .clk_tbl =3D sc7280_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(sc7280_clk_table), + .opp_clk_tbl =3D sc7280_opp_clk_table, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xe0000000 - 1, + .fwname =3D "qcom/vpu/vpu20_p1.mbn", + .inst_iris_fmts =3D iris_fmts_vpu2_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(iris_fmts_vpu2_dec), + .inst_caps =3D &platform_inst_cap_vpu2, + .tz_cp_config_data =3D tz_cp_config_vpu2, + .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_vpu2), + .num_vpp_pipe =3D 1, + .no_aon =3D true, + .max_session_count =3D 16, + .max_core_mbpf =3D 4096 * 2176 / 256 * 2 + 1920 * 1088 / 256, + /* max spec for SC7280 is 4096x2176@60fps */ + .max_core_mbps =3D 4096 * 2176 / 256 * 60, +}; + +const struct iris_platform_data sm8250_data =3D { + .firmware_data =3D &iris_hfi_gen1_data, + .get_vpu_buffer_size =3D iris_vpu_buf_size, + .vpu_ops =3D &iris_vpu2_ops, + .icc_tbl =3D iris_icc_info_vpu2, + .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu2), + .clk_rst_tbl =3D iris_clk_reset_table_vpu2, + .clk_rst_tbl_size =3D ARRAY_SIZE(iris_clk_reset_table_vpu2), + .bw_tbl_dec =3D sm8250_bw_table_dec, + .bw_tbl_dec_size =3D ARRAY_SIZE(sm8250_bw_table_dec), + .pmdomain_tbl =3D iris_pmdomain_table_vpu2, + .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu2), + .opp_pd_tbl =3D sm8250_opp_pd_table, + .opp_pd_tbl_size =3D ARRAY_SIZE(sm8250_opp_pd_table), + .clk_tbl =3D sm8250_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(sm8250_clk_table), + .opp_clk_tbl =3D sm8250_opp_clk_table, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xe0000000 - 1, + .fwname =3D "qcom/vpu-1.0/venus.mbn", + .inst_iris_fmts =3D iris_fmts_vpu2_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(iris_fmts_vpu2_dec), + .inst_caps =3D &platform_inst_cap_vpu2, + .tz_cp_config_data =3D tz_cp_config_vpu2, + .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_vpu2), + .num_vpp_pipe =3D 4, + .max_session_count =3D 16, + .max_core_mbpf =3D NUM_MBS_8K, + .max_core_mbps =3D ((7680 * 4320) / 256) * 60, +}; diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c b/drive= rs/media/platform/qcom/iris/iris_platform_vpu3x.c new file mode 100644 index 000000000000..c2496aa0f851 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c @@ -0,0 +1,204 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2025 Linaro Ltd + */ + +#include "iris_core.h" +#include "iris_ctrls.h" +#include "iris_hfi_gen2.h" +#include "iris_hfi_gen2_defines.h" +#include "iris_platform_common.h" +#include "iris_vpu_buffer.h" +#include "iris_vpu_common.h" + +#include "iris_platform_qcs8300.h" +#include "iris_platform_sm8550.h" +#include "iris_platform_sm8650.h" +#include "iris_platform_sm8750.h" + +static struct iris_fmt iris_fmts_vpu3x_dec[] =3D { + [IRIS_FMT_H264] =3D { + .pixfmt =3D V4L2_PIX_FMT_H264, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_HEVC] =3D { + .pixfmt =3D V4L2_PIX_FMT_HEVC, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_VP9] =3D { + .pixfmt =3D V4L2_PIX_FMT_VP9, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, + [IRIS_FMT_AV1] =3D { + .pixfmt =3D V4L2_PIX_FMT_AV1, + .type =3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + }, +}; + +static const struct icc_info iris_icc_info_vpu3x[] =3D { + { "cpu-cfg", 1000, 1000 }, + { "video-mem", 1000, 15000000 }, +}; + +static const struct bw_info iris_bw_table_dec_vpu3x[] =3D { + { ((4096 * 2160) / 256) * 60, 1608000 }, + { ((4096 * 2160) / 256) * 30, 826000 }, + { ((1920 * 1080) / 256) * 60, 567000 }, + { ((1920 * 1080) / 256) * 30, 294000 }, +}; + +static const char * const iris_pmdomain_table_vpu3x[] =3D { "venus", "vcod= ec0" }; + +static const char * const iris_opp_pd_table_vpu3x[] =3D { "mxc", "mmcx" }; + +static const char * const iris_opp_clk_table_vpu3x[] =3D { + "vcodec0_core", + NULL, +}; + +static const struct tz_cp_config tz_cp_config_vpu3[] =3D { + { + .cp_start =3D 0, + .cp_size =3D 0x25800000, + .cp_nonpixel_start =3D 0x01000000, + .cp_nonpixel_size =3D 0x24800000, + }, +}; + +/* + * Shares most of SM8550 data except: + * - inst_caps to platform_inst_cap_qcs8300 + */ +const struct iris_platform_data qcs8300_data =3D { + .firmware_data =3D &iris_hfi_gen2_data, + .get_vpu_buffer_size =3D iris_vpu_buf_size, + .vpu_ops =3D &iris_vpu3_ops, + .icc_tbl =3D iris_icc_info_vpu3x, + .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu3x), + .clk_rst_tbl =3D sm8550_clk_reset_table, + .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), + .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, + .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), + .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, + .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, + .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), + .clk_tbl =3D sm8550_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), + .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xe0000000 - 1, + .fwname =3D "qcom/vpu/vpu30_p4_s6.mbn", + .inst_iris_fmts =3D iris_fmts_vpu3x_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(iris_fmts_vpu3x_dec), + .inst_caps =3D &platform_inst_cap_qcs8300, + .tz_cp_config_data =3D tz_cp_config_vpu3, + .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_vpu3), + .num_vpp_pipe =3D 2, + .max_session_count =3D 16, + .max_core_mbpf =3D ((4096 * 2176) / 256) * 4, + .max_core_mbps =3D (((3840 * 2176) / 256) * 120), +}; + +const struct iris_platform_data sm8550_data =3D { + .firmware_data =3D &iris_hfi_gen2_data, + .get_vpu_buffer_size =3D iris_vpu_buf_size, + .vpu_ops =3D &iris_vpu3_ops, + .icc_tbl =3D iris_icc_info_vpu3x, + .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu3x), + .clk_rst_tbl =3D sm8550_clk_reset_table, + .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), + .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, + .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), + .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, + .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, + .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), + .clk_tbl =3D sm8550_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), + .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xe0000000 - 1, + .fwname =3D "qcom/vpu/vpu30_p4.mbn", + .inst_iris_fmts =3D iris_fmts_vpu3x_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(iris_fmts_vpu3x_dec), + .inst_caps =3D &platform_inst_cap_sm8550, + .tz_cp_config_data =3D tz_cp_config_vpu3, + .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_vpu3), + .num_vpp_pipe =3D 4, + .max_session_count =3D 16, + .max_core_mbpf =3D NUM_MBS_8K * 2, + .max_core_mbps =3D ((7680 * 4320) / 256) * 60, +}; + +/* + * Shares most of SM8550 data except: + * - vpu_ops to iris_vpu33_ops + * - clk_rst_tbl to sm8650_clk_reset_table + * - controller_rst_tbl to sm8650_controller_reset_table + * - fwname to "qcom/vpu/vpu33_p4.mbn" + */ +const struct iris_platform_data sm8650_data =3D { + .firmware_data =3D &iris_hfi_gen2_data, + .get_vpu_buffer_size =3D iris_vpu33_buf_size, + .vpu_ops =3D &iris_vpu33_ops, + .icc_tbl =3D iris_icc_info_vpu3x, + .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu3x), + .clk_rst_tbl =3D sm8650_clk_reset_table, + .clk_rst_tbl_size =3D ARRAY_SIZE(sm8650_clk_reset_table), + .controller_rst_tbl =3D sm8650_controller_reset_table, + .controller_rst_tbl_size =3D ARRAY_SIZE(sm8650_controller_reset_table), + .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, + .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), + .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, + .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, + .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), + .clk_tbl =3D sm8550_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), + .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xe0000000 - 1, + .fwname =3D "qcom/vpu/vpu33_p4.mbn", + .inst_iris_fmts =3D iris_fmts_vpu3x_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(iris_fmts_vpu3x_dec), + .inst_caps =3D &platform_inst_cap_sm8550, + .tz_cp_config_data =3D tz_cp_config_vpu3, + .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_vpu3), + .num_vpp_pipe =3D 4, + .max_session_count =3D 16, + .max_core_mbpf =3D NUM_MBS_8K * 2, + .max_core_mbps =3D ((7680 * 4320) / 256) * 60, +}; + +const struct iris_platform_data sm8750_data =3D { + .firmware_data =3D &iris_hfi_gen2_data, + .get_vpu_buffer_size =3D iris_vpu33_buf_size, + .vpu_ops =3D &iris_vpu35_ops, + .icc_tbl =3D iris_icc_info_vpu3x, + .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu3x), + .clk_rst_tbl =3D sm8750_clk_reset_table, + .clk_rst_tbl_size =3D ARRAY_SIZE(sm8750_clk_reset_table), + .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, + .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), + .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, + .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, + .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), + .clk_tbl =3D sm8750_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(sm8750_clk_table), + .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xe0000000 - 1, + .fwname =3D "qcom/vpu/vpu35_p4.mbn", + .inst_iris_fmts =3D iris_fmts_vpu3x_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(iris_fmts_vpu3x_dec), + .inst_caps =3D &platform_inst_cap_sm8550, + .tz_cp_config_data =3D tz_cp_config_vpu3, + .tz_cp_config_data_size =3D ARRAY_SIZE(tz_cp_config_vpu3), + .num_vpp_pipe =3D 4, + .max_session_count =3D 16, + .max_core_mbpf =3D NUM_MBS_8K * 2, + .max_core_mbps =3D ((7680 * 4320) / 256) * 60, +}; --=20 2.47.3