Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796408715; b=H/AZuBVJdgHzxBWkMhjx5es1cCH/vdABmS+2hlG/j80P69IC5/J7pCD4Reu4bXS7JFfm uUMtJXPQBWvynQqbbJW6MTdvNzSsU1Nv/W0J/cOdUoFYKSCY0dLyD1y9mBpuMYlfImOUC ZFFOU5V7vU0/cciHkvgkY7VxWGQpDkPDSDniBqgRCv/zpwuVRFk2qxSPddsrCWi4ziFCa xWFjrLMOeKYieZvfs69twG9Q3kGa6+N7FG7V7W18Ca5s3EGabZUDxpImi3r3XO4JREAat kFTwcBwEDCjIVKJi6GyykJiV0eW3VTeAv8eJ6tFJyMqbKj8KQYGAVIODrNdHzO7/kOg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796408715; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg: X-Received:X-Received:Received:From:Date:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:References: In-Reply-To:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Authority-Analysis:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Spam-Info: X-Proofpoint-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=U2sRhBh0cV0v3PQ/2L048fvYg5cXTzZdnMC1LOXjOuM=; b=ht9IkoEdFfoljByuAlzNbXKSZK5fYTS9EcOVP/skgZ3+IUtbxv4iJcvBn4d1VnlWd7s0 IwVdBa4cKMhbX+cbcv3Bb3UuFFKOPjyFqqjVys1B4LbfwJfWwjyiw7LmsouxzfkeXH1JQ xVgtJXE8my6E4ecqlVhNJaNU8O+e4L7uwwlqOSwIHaBMDuFxFKkNalm3gxZQHNoUMg4XG 18hltrfBYL2JBTMg8ArY/ivoP8YnZtoKqH1GLeTUipy3flHlU9eDAe4JhQ+OwiZnqp8px LnDQAjMlmRN+nP9yq7+ICEG+E1ouyy6JumSRwCDv4PQc5fmeKmW9hjnKAXElFuCxA2Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=aYM3qj++; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=VgMbkAZa; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F019606A33A for ; Fri, 4 Dec 2026 18:25:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3F019606A33A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=aYM3qj++; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=VgMbkAZa 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 6B4I6egL3346726 for ; Fri, 4 Dec 2026 18:25:14 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= U2sRhBh0cV0v3PQ/2L048fvYg5cXTzZdnMC1LOXjOuM=; b=aYM3qj++8kRuoDGW uZkzL99Ta7nMynvAputwyJ00tuRm4I7iqdwuezw/NVzci9FO+8E9hP9h8qbR2yzf vBWMfyGHCP+7ubUlFZgbF+Xl8EkE2/EoyLyLjXn9wvrqw0/Ztbh+R8hMoO8FJjeN B1qbHwGbAZdeKhYrS92PmqNNumWC9sjZonKBCGNs+vv9Wlz+0SzRUj1v9rzDJDjk Zj51OHpQaXwTAnSR5vBOJ9uhCAoF3iG+URUSGzkGO4q2mH0N+bbbv2F5yuQdH1Mb xBqT+uMSWHfCAUGCKwMe3UraR7I7dfhEaMmiQSzoEBVjKVdAfvSHytpkuyXqeW/y Ofmg8Q== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jbq7xtfx7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 04 Dec 2026 18:25:14 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-94a75bc3ba8so185202485a.0 for ; Fri, 04 Dec 2026 10:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796408713; x=1797013513; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=U2sRhBh0cV0v3PQ/2L048fvYg5cXTzZdnMC1LOXjOuM=; b=VgMbkAZaGFFkKjZNyk1yqF/rSe/4xnbhgFUEacWRhKpAt50owUCavjQ/LA113GR1Zv nL1bODHWk5+Frr0+aJ/M4HM0/5jdrAjLre4N8rjqXopzKKBVQy5jb4nuoB8e5W0QnZGI eW0YswqgfjyAui2fB9HlnM8UWR8+TlnDhoSYXBlaq6areQsnPZAd8fxnXhh7MSyI6xM7 bZ+jNq9MPY/aOLgenTb7iH7sdosX1jIQAeWWRJKAq5mFZtUt/ci+YwUN3rpBLa4NaJfu uX7c8JQx+5Ysh2BnxeVPhCmYpR3IcUWCc4/lixPm+hIZoAP/ZqRa8gMHan/G6USra4QK Dt4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796408713; x=1797013513; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=U2sRhBh0cV0v3PQ/2L048fvYg5cXTzZdnMC1LOXjOuM=; b=WA3Q7ulCCszbXqerfDWqCSmPw/eAFkHDRiCzfiAZoh1S3xOAN+w0mBM4sJ3a8AwoOC IV8xS5AIBIz0kCi29xZXktmzYrOq9YU427MEotIdF7ZuGMExo52YClKoQbjl9yCPofgD PmYbDDiq10VoeoZ6iHVjjr8qtaHd3bC50DGobKmjDIdH1RbeZ9vht/GrQJlJwEN0L/K6 6+E017ETewjZ1PO8e1eUgkvYocEPCNKNQa6XVf17hbIWdkYMYOAc8jQqYEBZTQ2pZpKO cKGQni2mqh5hX/e5KH1YntId06su9RYDtKFvj6YCFVA53GIjWxGRNOPdHLI4hNLyxUQo oyIw== X-Gm-Message-State: APuU4Z9jnTu2+I2PY15RJl25U/NujlI1H6UC0AvTn2chh1O3Kt4GLxA5 50MSuUxbzoqYQKst1uCZiRiq5dDtf3HuimiAdFRa94QN8cBzmrC8fTBYqYZGer/xCj1FPzPfdLb RXeUCLDjBShiU5N2+uq3tdOOPs6BR7+fUVcnvpbfDI66DUSrug+4ivghTcKhpmw7vVssgP1JyiQ == X-Gm-Gg: AZFdTZdFNiJLN6OqvtmntZ13obF0t8wym0NKLfMpRQT2M3dRbCQKG2rWyzMR5IAy3xr hE1yuWeRCyYCsRJwAAY5EwAG2cgqQ2Xbwpxl9x4N1WKdyv2KaoT+XZNUO9RjwbcD+W+RzMi9ZbG 6JTdLojEy9x6Xf/FEAl2QMRw4csxnjEKSb5TkygCGBKtf36b3u6tNhCRZzI/dWolfcaw5sCzpby V/o+SI/Y2SS1tZDI0SiN79uE4TpPBWGsLPo0NUJ1In6y1u+1uKqizX+TAexm61HfJvgFwa4C2F/ twCwLhj8zvIR485DUbgUIbq0bLtuXosq29b/BL4R6gwfNxAwj1vqYliuoz1BcxbBMtH0zKskAFb rnM26q3Y+VwJOwdMika/nhfR5iDuQcjyoYup5DQYwj54UhjnVgHirR66lLdqzcUPuizDoneslWA rZen+X662Rjz2zzg6jGTMlH+qPjTl7YdKZjmil96w/EvOSmWMVgO/N2h24V8burQ== X-Received: by 2002:a05:620a:480b:b0:949:ba11:9612 with SMTP id af79cd13be357-94a82df42dcmr476462585a.69.1796408713242; Fri, 04 Dec 2026 10:25:13 -0800 (PST) X-Received: by 2002:a05:620a:480b:b0:949:ba11:9612 with SMTP id af79cd13be357-94a82df42dcmr476455585a.69.1796408712663; Fri, 04 Dec 2026 10:25:12 -0800 (PST) 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 38308e7fff4ca-3b0037ac7fasm9647221fa.25.2026.12.04.10.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 10:25:11 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 04 Dec 2026 20:24:47 +0200 Subject: [PATCH v2 06/13] media: iris: move the decode format list into the firmware data X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261204-iris-vp8-v2-6-462f9b48d246@oss.qualcomm.com> References: <20261204-iris-vp8-v2-0-462f9b48d246@oss.qualcomm.com> In-Reply-To: <20261204-iris-vp8-v2-0-462f9b48d246@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=13853; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=o/N7jgHL8fSyGS6ydjnmn6JwVV//Ll27Ez/OZFJDACU=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBrEwV0S+elZhAf/Y9q75B+Jl7fXz1hvO+r4aEKZ HDAdeTlqEeJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCaxMFdAAKCRCLPIo+Aiko 1fQZB/0VAQ/fIoTDCQ4HexFxJPJUcaf/oOa6h0C1u5DfdubAiW5ekoHG/LqmBqpAOGvXgQbkeCO 1GV21Wl6geOQJpqW5x4atMTQigupkQxOHWG6MwKowtGH5NY/7s2Tw3J62ed2w/TF0NzsMCJ1nJ/ 6e7mKiUuLs/Md59C4N/ds84nUOoOZxeKJb4LxO9sZMkkfjXj1ul1AmF304sp2fr2OAuhdvGk5Jl J1lZgwmUAg0wcHl+NKouBoIexlNGU2aOop2vX2XveM4zGGFxR7RJ0nRgACmp9awc3wWhMEAazi4 Mv0REUS3MLGHyVJLBcNeD6U2S2IPelOC9D3GJttTflc5fxzP X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Authority-Analysis: v=2.4 cv=Jv1kP84C c=1 sm=1 tr=0 ts=6b13058a cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=qfAvZnUovwnm1iIMXMEA:9 a=QEXdDO2ut3YA:10 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-ORIG-GUID: zJK1IXoAeUH0NYTU_HmkfVRE6bgzGxaV X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA0MDA3MyBTYWx0ZWRfXzfpKKDGO6jFi qGyS/EV5T+il9eHxYVTFAzdQJiHczqnnuMAyn0nvttJpIZaTwcjSwpPcawReIYKGGNvDx35Hhmr CxieA6M7/0W/RaO7YWFLr5LzPugFQB6+D4B0tEaMbY9vAjqAcGgSDRpPuLa7XPaEbYtmxBF5II9 x5t0XDpI6jpDmYkTdJI7+Ip9goTV9E6VHbfldF4DSn9XYZuHp1SF45V062nGS3DaCBIbUpJL0/2 91cVJ2LNtN8jmzFfU5xARHRC8ezfXRuz1ygdANdAvXBoobVTs4hksJFMYemytLdUX5MFQ3DPLnB iQ+iCRQubU8teVQXS68rx1cLcQwS9WVyT0iJY0pQ3RuNSxclZTWyVvuT+e+dHJvUdSccYCmtVlz rl+unJnattP2LCLTFKcN73bmn/kPJbETWSN58IyyhqOPr9RfwphH7mJk7JyoQGBoEmwxqjQAz4z 2ovOCEg6zB0R2Vxm5uw== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjA0MDA3MyBTYWx0ZWRfX4IC/qvQK6n43 +71PXViH2tjhJjcfX1QxbR7Vdf0zYW+PLzWT2rI4Hx4IvpLdIp8lb/EotOOg4t1XcRrMJcaBjnd 1Yq+bQF/W53hk/HkYF77/w0TV1oFAsY= X-Proofpoint-GUID: zJK1IXoAeUH0NYTU_HmkfVRE6bgzGxaV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-04_04,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 spamscore=0 impostorscore=0 adultscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612040073 The set of supported coded formats depends on the firmware generation: a single SoC can boot either Gen1 or Gen2 firmware, and some codecs are only supported by one generation. The decode format list was however kept per-SoC in iris_platform_data::inst_iris_fmts, which is too coarse to express this - a per-SoC list cannot describe the two different format sets the same SoC exposes depending on which firmware it booted. Move the decode format list into struct iris_firmware_data, which is already selected per firmware generation, and drop the per-SoC inst_iris_fmts field. Each firmware data instance now carries the exact set of decode formats its generation supports, so the formats advertised to userspace always match the running firmware. No functional change: every SoC advertises the same decode formats as before. Signed-off-by: Dmitry Baryshkov --- drivers/media/platform/qcom/iris/iris_hfi_gen1.c | 12 +++++++++++ drivers/media/platform/qcom/iris/iris_hfi_gen2.c | 24 ++++++++++++++++++++++ .../platform/qcom/iris/iris_platform_common.h | 12 +++++++++-- .../media/platform/qcom/iris/iris_platform_vpu2.c | 12 ----------- .../media/platform/qcom/iris/iris_platform_vpu3x.c | 17 --------------- .../platform/qcom/iris/iris_platform_vpu_ar50lt.c | 8 -------- drivers/media/platform/qcom/iris/iris_vdec.c | 8 ++++---- 7 files changed, 50 insertions(+), 43 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1.c index c377ae1f84db..4b38af68625e 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1.c @@ -421,6 +421,12 @@ static const u32 sm8250_enc_ip_int_buf_tbl[] = { BUF_SCRATCH_2, }; +static const u32 iris_hfi_gen1_dec_fmts[] = { + V4L2_PIX_FMT_H264, + V4L2_PIX_FMT_HEVC, + V4L2_PIX_FMT_VP9, +}; + const struct iris_firmware_data iris_hfi_gen1_data = { .init_hfi_ops = &iris_hfi_gen1_sys_ops_init, @@ -429,6 +435,9 @@ const struct iris_firmware_data iris_hfi_gen1_data = { .inst_fw_caps_enc = inst_fw_cap_sm8250_enc, .inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_sm8250_enc), + .dec_fmts = iris_hfi_gen1_dec_fmts, + .dec_fmts_size = ARRAY_SIZE(iris_hfi_gen1_dec_fmts), + .dec_input_config_params_default = sm8250_vdec_input_config_param_default, .dec_input_config_params_default_size = @@ -833,6 +842,9 @@ const struct iris_firmware_data iris_hfi_gen1_ar50lt_data = { .inst_fw_caps_enc = inst_fw_cap_gen1_ar50lt_enc, .inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_gen1_ar50lt_enc), + .dec_fmts = iris_hfi_gen1_dec_fmts, + .dec_fmts_size = ARRAY_SIZE(iris_hfi_gen1_dec_fmts), + .dec_input_config_params_default = sm8250_vdec_input_config_param_default, .dec_input_config_params_default_size = diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2.c index 79fb74af6ea6..539e5352763d 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2.c @@ -2113,6 +2113,19 @@ static const u32 sm8550_enc_op_int_buf_tbl[] = { BUF_SCRATCH_2, }; +static const u32 iris_hfi_gen2_dec_fmts[] = { + V4L2_PIX_FMT_H264, + V4L2_PIX_FMT_HEVC, + V4L2_PIX_FMT_VP9, + V4L2_PIX_FMT_AV1, +}; + +static const u32 iris_hfi_gen2_vpu2_dec_fmts[] = { + V4L2_PIX_FMT_H264, + V4L2_PIX_FMT_HEVC, + V4L2_PIX_FMT_VP9, +}; + const struct iris_firmware_data iris_hfi_gen2_data = { .init_hfi_ops = iris_hfi_gen2_sys_ops_init, @@ -2123,6 +2136,9 @@ const struct iris_firmware_data iris_hfi_gen2_data = { .inst_fw_caps_enc = inst_fw_cap_sm8550_enc, .inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_sm8550_enc), + .dec_fmts = iris_hfi_gen2_dec_fmts, + .dec_fmts_size = ARRAY_SIZE(iris_hfi_gen2_dec_fmts), + .dec_input_config_params_default = sm8550_vdec_input_config_params_default, .dec_input_config_params_default_size = @@ -2189,6 +2205,9 @@ const struct iris_firmware_data iris_hfi_milos_data = { .inst_fw_caps_enc = inst_fw_cap_milos_enc, .inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_milos_enc), + .dec_fmts = iris_hfi_gen2_vpu2_dec_fmts, + .dec_fmts_size = ARRAY_SIZE(iris_hfi_gen2_vpu2_dec_fmts), + .dec_input_config_params_default = sm8550_vdec_input_config_params_default, .dec_input_config_params_default_size = @@ -2253,6 +2272,9 @@ const struct iris_firmware_data iris_hfi_gen2_vpu2_data = { .inst_fw_caps_enc = inst_fw_cap_sm8550_enc, .inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_sm8550_enc), + .dec_fmts = iris_hfi_gen2_vpu2_dec_fmts, + .dec_fmts_size = ARRAY_SIZE(iris_hfi_gen2_vpu2_dec_fmts), + .dec_input_config_params_default = sm8550_vdec_input_config_params_default, .dec_input_config_params_default_size = @@ -3141,6 +3163,8 @@ const struct iris_firmware_data iris_hfi_gen2_ar50lt_data = { .inst_fw_caps_dec_size = ARRAY_SIZE(inst_fw_cap_gen2_ar50lt_dec), .inst_fw_caps_enc = inst_fw_cap_gen2_ar50lt_enc, .inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_gen2_ar50lt_enc), + .dec_fmts = iris_hfi_gen2_vpu2_dec_fmts, + .dec_fmts_size = ARRAY_SIZE(iris_hfi_gen2_vpu2_dec_fmts), .dec_input_config_params_default = sm8550_vdec_input_config_params_default, .dec_input_config_params_default_size = diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h index 6318dbaab7e8..30cfa3d793b2 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -278,6 +278,16 @@ struct iris_firmware_data { const struct platform_inst_fw_cap *inst_fw_caps_enc; u32 inst_fw_caps_enc_size; + /* + * List of coded formats supported by this firmware generation, used to + * advertise decode (bitstream) formats to userspace. This lives in the + * firmware data because a single SoC can boot either firmware + * generation, and some codecs (e.g. VP8, MPEG2, AV1) are only supported + * by one generation. + */ + const u32 *dec_fmts; + unsigned int dec_fmts_size; + const u32 *dec_input_config_params_default; unsigned int dec_input_config_params_default_size; const u32 *dec_input_config_params_hevc; @@ -340,8 +350,6 @@ struct iris_platform_data { const char * const *controller_rst_tbl; unsigned int controller_rst_tbl_size; u64 dma_mask; - const u32 *inst_iris_fmts; - u32 inst_iris_fmts_size; struct platform_inst_caps *inst_caps; const struct platform_inst_slice_caps *slice_caps; const struct tz_cp_config *tz_cp_config_data; diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu2.c b/drivers/media/platform/qcom/iris/iris_platform_vpu2.c index 923898067540..5b3518935aba 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_vpu2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu2.c @@ -43,12 +43,6 @@ static const struct iris_firmware_desc iris_vpu20_p4_gen1_desc = { .fwname = "qcom/vpu/vpu20_p4.mbn", }; -static const u32 iris_fmts_vpu2_dec[] = { - V4L2_PIX_FMT_H264, - V4L2_PIX_FMT_HEVC, - V4L2_PIX_FMT_VP9, -}; - static struct platform_inst_caps platform_inst_cap_vpu2 = { .min_frame_width = 128, .max_frame_width = 8192, @@ -96,8 +90,6 @@ const struct iris_platform_data milos_data = { .clk_rst_tbl = iris_clk_reset_table_vpu2, .clk_rst_tbl_size = ARRAY_SIZE(iris_clk_reset_table_vpu2), .dma_mask = 0xe0000000 - 1, - .inst_iris_fmts = iris_fmts_vpu2_dec, - .inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_vpu2_dec), .inst_caps = &platform_inst_cap_milos, .tz_cp_config_data = tz_cp_config_vpu2, .tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_vpu2), @@ -124,8 +116,6 @@ const struct iris_platform_data sc7280_data = { .opp_clk_tbl = sc7280_opp_clk_table, /* Upper bound of DMA address range */ .dma_mask = 0xe0000000 - 1, - .inst_iris_fmts = iris_fmts_vpu2_dec, - .inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_vpu2_dec), .inst_caps = &platform_inst_cap_vpu2, .slice_caps = &iris_vpu2_vpu3x_slice_caps, .tz_cp_config_data = tz_cp_config_vpu2, @@ -158,8 +148,6 @@ const struct iris_platform_data sm8250_data = { .opp_clk_tbl = sm8250_opp_clk_table, /* Upper bound of DMA address range */ .dma_mask = 0xe0000000 - 1, - .inst_iris_fmts = iris_fmts_vpu2_dec, - .inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_vpu2_dec), .inst_caps = &platform_inst_cap_vpu2, .tz_cp_config_data = tz_cp_config_vpu2, .tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_vpu2), diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c b/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c index e963cb116313..b3d66bd5a937 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c @@ -50,13 +50,6 @@ static const struct iris_firmware_desc iris_vpu35_p4_gen2_desc = { .fwname = "qcom/vpu/vpu35_p4.mbn", }; -static const u32 iris_fmts_vpu3x_dec[] = { - V4L2_PIX_FMT_H264, - V4L2_PIX_FMT_HEVC, - V4L2_PIX_FMT_VP9, - V4L2_PIX_FMT_AV1, -}; - static const struct icc_info iris_icc_info_vpu3x[] = { { "cpu-cfg", 1000, 1000 }, { "video-mem", 1000, 15000000 }, @@ -109,8 +102,6 @@ const struct iris_platform_data qcs8300_data = { .opp_clk_tbl = iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask = 0xe0000000 - 1, - .inst_iris_fmts = iris_fmts_vpu3x_dec, - .inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_vpu3x_dec), .inst_caps = &platform_inst_cap_qcs8300, .slice_caps = &iris_vpu2_vpu3x_slice_caps, .tz_cp_config_data = tz_cp_config_vpu3, @@ -141,8 +132,6 @@ const struct iris_platform_data sm8550_data = { .opp_clk_tbl = iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask = 0xe0000000 - 1, - .inst_iris_fmts = iris_fmts_vpu3x_dec, - .inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_vpu3x_dec), .inst_caps = &platform_inst_cap_sm8550, .slice_caps = &iris_vpu2_vpu3x_slice_caps, .tz_cp_config_data = tz_cp_config_vpu3, @@ -181,8 +170,6 @@ const struct iris_platform_data sm8650_data = { .opp_clk_tbl = iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask = 0xe0000000 - 1, - .inst_iris_fmts = iris_fmts_vpu3x_dec, - .inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_vpu3x_dec), .inst_caps = &platform_inst_cap_sm8550, .slice_caps = &iris_vpu2_vpu3x_slice_caps, .tz_cp_config_data = tz_cp_config_vpu3, @@ -213,8 +200,6 @@ const struct iris_platform_data sm8750_data = { .opp_clk_tbl = iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask = 0xe0000000 - 1, - .inst_iris_fmts = iris_fmts_vpu3x_dec, - .inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_vpu3x_dec), .inst_caps = &platform_inst_cap_sm8550, .slice_caps = &iris_vpu2_vpu3x_slice_caps, .tz_cp_config_data = tz_cp_config_vpu3, @@ -251,8 +236,6 @@ const struct iris_platform_data x1p42100_data = { .opp_clk_tbl = x1p42100_opp_clk_table, /* Upper bound of DMA address range */ .dma_mask = 0xe0000000 - 1, - .inst_iris_fmts = iris_fmts_vpu3x_dec, - .inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_vpu3x_dec), .inst_caps = &platform_inst_cap_sm8550, .slice_caps = &iris_vpu2_vpu3x_slice_caps, .tz_cp_config_data = tz_cp_config_vpu3, diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu_ar50lt.c b/drivers/media/platform/qcom/iris/iris_platform_vpu_ar50lt.c index 43460b82ae77..59b5460dd3b9 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_vpu_ar50lt.c +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu_ar50lt.c @@ -25,12 +25,6 @@ static const struct iris_firmware_desc iris_vpu_ar50lt_p1_gen2_s6_desc = { .fwname = "qcom/vpu/ar50lt_p1_gen2_s6.mbn", }; -static const u32 iris_fmts_ar50lt_dec[] = { - V4L2_PIX_FMT_H264, - V4L2_PIX_FMT_HEVC, - V4L2_PIX_FMT_VP9, -}; - static const struct bw_info iris_bw_table_dec_ar50lt[] = { { ((1920 * 1080) / 256) * 60, 1564000, }, { ((1920 * 1080) / 256) * 30, 791000, }, @@ -100,8 +94,6 @@ const struct iris_platform_data qcm2290_data = { .opp_clk_tbl = iris_opp_clk_table_ar50lt, /* Upper bound of DMA address range */ .dma_mask = 0xe0000000 - 1, - .inst_iris_fmts = iris_fmts_ar50lt_dec, - .inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_ar50lt_dec), .inst_caps = &platform_inst_cap_ar50lt, .slice_caps = &iris_ar50lt_slice_caps, .tz_cp_config_data = tz_cp_config_ar50lt, diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c index 0dd33ff447bb..737ccad68314 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -83,8 +83,8 @@ static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type) switch (type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - fmt = inst->core->iris_platform_data->inst_iris_fmts; - size = inst->core->iris_platform_data->inst_iris_fmts_size; + fmt = inst->core->iris_firmware_data->dec_fmts; + size = inst->core->iris_firmware_data->dec_fmts_size; break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: if (ubwc->ubwc_enc_version) { @@ -118,8 +118,8 @@ static u32 find_format_by_index(struct iris_inst *inst, u32 index, u32 type) switch (type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - fmt = inst->core->iris_platform_data->inst_iris_fmts; - size = inst->core->iris_platform_data->inst_iris_fmts_size; + fmt = inst->core->iris_firmware_data->dec_fmts; + size = inst->core->iris_firmware_data->dec_fmts_size; break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: if (ubwc->ubwc_enc_version) { -- 2.47.3