From mboxrd@z Thu Jan 1 00:00:00 1970 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 EE705372B3B for ; Fri, 13 Mar 2026 11:11:14 +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=1773400276; cv=none; b=KItu+tIGMerROzZ9NmzDSwiRcUJjZ6PkeSQKFqPIPLo8kcouOZ54UKiFUOfT9lHCW87GmWFTqj7WT8DW0xyGw8D+HzHgi76vuCDe7c0ldlsK7+mrQPXvt6iJybvlCX3BBCs/93agqIAeoqsLHEkJUVarfLQx7ZFxW32zy0mdIwE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773400276; c=relaxed/simple; bh=YnwcHaVVk5a1ldfbtd3/N6J9vOu78e330RV80djtycY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aHswwZonFpJ7u2L4vRQ9exwMnAdUzTQDPaE07cC5iXw6FB0efaIMxVhtz5lJPhDBSt8JtAoOHpVnhRBWrlGZzkzd1ZYXwg8KIictnZr6Q/YYgHbzOOjYMTutxI3KKCZ0db3Y0csCFCvsSHMCz9kFlHFELVEHTotAg61JGlQLDy0= 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=Uw4CtOdA; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=eXLbkrTh; 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="Uw4CtOdA"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="eXLbkrTh" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62D5taei4140706 for ; Fri, 13 Mar 2026 11:11: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= mLpV9IJ4BvaUl89u79yOHs2lX87W2UzHV2lsQNonTkw=; b=Uw4CtOdASLAou5P2 vaAVu3m713BqFV82V49u9VUn3bgD218tb102Qwg2oQxybIdxbdFoV1+5pgETWvty P96qt0Lc8ilV0p846xhyiDKs2f4Xlh0vdMut0HMBttYsFnoeCGpODqPeuLp4jKol OLvU/7GsrTvWOWa6I/UZZbofIgCTUqjXYdc3sv6dMFoFp1JrvIJju4muA4fLpc4n YUCiZcBNnf/6AJ4R0VJ63Ck+q49Zno81IR0mFQbL+Qvr8WTKMfEpCrTZ72tirq7g j3zwNRVwHfnMZLPAgkCTsWUVHdwLa/LXKohHhqfmhVo6Ie5o0BfmfKU5TSbxMLDA Y84QhQ== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cvbn29aq7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 13 Mar 2026 11:11:14 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2ae4f27033cso22033455ad.3 for ; Fri, 13 Mar 2026 04:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773400274; x=1774005074; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mLpV9IJ4BvaUl89u79yOHs2lX87W2UzHV2lsQNonTkw=; b=eXLbkrThLeXXYS/1QkjZoZ7c0fGDq60f2nzmdd0GVeX5CfhGa9zUtTvE6laQfrVez6 Y2kfHuuI3mxEvR2x0blEwOWsmjSVQA8g2SyLgQ2sVfykTCf4e6DLiQDvDktg7jnmOetB VkwscaubRHRw/29LHR9tK392gIy0TtVgkBvM3RRMNEFuxoelmSFHW5pJxLHFBapAOQyh +QBxihPN2XQniASnvIjs2wmTRnCrtGJl+O0iB32K1awPiYP1HPR8QYezhXHlZaReBXkw JSZzI2ldgQ0ddljWxPyveOvvayEjqVWnaZ0oi8Nc8bmY7aEQjU+n/uq9/dxUSpQcame/ h8rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773400274; x=1774005074; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mLpV9IJ4BvaUl89u79yOHs2lX87W2UzHV2lsQNonTkw=; b=dXrtieubkG7GcxDfrmg68AEA26uZR4YtdS6uo8mFUtbaxM5V+ZuXKPqUgTUZhFGHxc TAA8o4FhYT+Iw1r2PuVdyJfe/Jehk+bD7lWr9myRlZFmS06obWTDDOpiKSFblPMqsWM0 BgubkKRXXzzj74Zznw6SbS73NwvIDncNotAueEEmrR9JLm0eLmr4aAgHWuWGLSLVZtkg hOffW4UStQii4JEmULZ+8f7nZI46c9Yp8i/AXhPAaFjats2nZWG2KuuJSsHFAHLrQTdz KIxRh33/kcYnEBM8MD5cNSu0C7hkrMcFTETla2HRBlvBKbkDZW11RWVv9XwFO2FUD3BI mbBg== X-Forwarded-Encrypted: i=1; AJvYcCVLc6XxY7rG45xNYPAbZY77kQKsw1eHquFJfYxC8iPpvYsBub1ORX3iYFjIBvAA5NqyiZP0JiBYV4/unag=@vger.kernel.org X-Gm-Message-State: AOJu0YwgQEmdseFZ/pLz27aU39JeLJdYVddFdRUOLVQB2PZ0VywjEY1A CKYEExqPoCCtEKyAP/N8P/kFoHJMNfcTUagLDE2b/k3YKdtsZFkHGlRccu2JxfU0X00q98DgAtk sBHke/KZE6+V3KUUEmpQNL5obEcLD5/Q8AV81IrDnkQPho+La4Ua2VHe8Ms4ZziKFKH8= X-Gm-Gg: ATEYQzzb0fOAhg1hhhrl/O8gNi8oEnAQm4w3FPK/Bc6vsTg1rLNlp8PFmENSiwWSCD3 tZghASnPPHkOCAKnJ6P6eODZ2L95Ds5kXnjZrYnR88FGlXtAzWguAabSvNQARMpXG8mpb5/4ZB8 uJKQ28BaSUPr1S8he2XTJvtGCC20FU/kOybkHUeY7Tm2pophgCvNd7Heary0qMfwZwxfC0TkVTa yxrfDclO/FG+wctOABmWGlXxQl8Z13RjspnZgoT8XGlGMEXWRVOLza5A+w96EkOnpCb4gOhhevU bTuUa9AZVkTBrQbw8NK+hXCSFTlR8qZO8sU8AAoLrehcjLDURhlmJT5Cw67fYIbhSE1GRdlSG++ +JK5neAfA88UCuxKcv7Q9bkfIVvAeIycmTC3KE4VyZ1X8kMopWZrj X-Received: by 2002:a17:903:2c06:b0:2ae:b807:da61 with SMTP id d9443c01a7336-2aecaaf6429mr25201025ad.35.1773400273502; Fri, 13 Mar 2026 04:11:13 -0700 (PDT) X-Received: by 2002:a17:903:2c06:b0:2ae:b807:da61 with SMTP id d9443c01a7336-2aecaaf6429mr25200655ad.35.1773400272978; Fri, 13 Mar 2026 04:11:12 -0700 (PDT) Received: from [10.0.0.3] ([106.222.229.52]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aece56cde9sm23677475ad.15.2026.03.13.04.11.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Mar 2026 04:11:12 -0700 (PDT) Message-ID: <61ae9967-e848-5f8d-c154-5022caf0799e@oss.qualcomm.com> Date: Fri, 13 Mar 2026 16:41:07 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 3/3] media: iris: Add support for Gen2 firmware detection and loading on SC7280 Content-Language: en-US To: Dmitry Baryshkov Cc: Vikash Garodia , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Vishnu Reddy , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260227-iris_sc7280_gen2_support-v2-0-7e5b13d26542@oss.qualcomm.com> <20260227-iris_sc7280_gen2_support-v2-3-7e5b13d26542@oss.qualcomm.com> From: Dikshita Agarwal In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: EMQbpNXGrzFVO5cI8zgalf_pmQSXMKe4 X-Proofpoint-GUID: EMQbpNXGrzFVO5cI8zgalf_pmQSXMKe4 X-Authority-Analysis: v=2.4 cv=ZKfaWH7b c=1 sm=1 tr=0 ts=69b3f0d2 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=ndT/fs+coltRyMHftQWjTw==:17 a=vAhLNi6rj8_hoSnI:21 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=HD2aLihsQs9dRDbn5AQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzEzMDA4NyBTYWx0ZWRfX+CKfP/GbpYn9 thW0djD+hOFSO1gCcTNDklxF5eVgx/z6zHIlzjm+tntBFnQmlDOs5FAGymPNczx/doVanh9463m Iphig6dGbbqQ3pTA5QAPitEY/xCiYPi3KNUzPsuwuxfgd+n/QwKT1LlSf4lKb7uQTn8n2H9kuEc n5QFrMkzpouRbCcBGK/q0z5LPWTwZWbGGUmOO/Ggq4rTQKXAFlGnkZ1dBAi5/jPGwTUvNu5BsJ4 eUIfGS9Rng6QS8suQCxBRCkb+KLLUKB2MTmUAuGCx/LEjzjUi+tUrqhkoo/fZfoXn6Go1qYa9rF YuFx5Cq/Nr0Ty6EL2JElM8UXzVpjoAYDLcbEqkRpPM7yO1ELdaLhAxZMYSd7saO8iv+t2XgKXun FeE8RYon0H/wrHaYExGkMsEQNRWvy6ZsvME+4Dh8/0CntkXRliC29cau9BoAlxK7bVJwE7vlZE+ Wc5lWDtsdKT/GVICDdg== 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-13_02,2026-03-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 spamscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603130087 On 3/5/2026 10:27 AM, Dmitry Baryshkov wrote: > On Mon, Mar 02, 2026 at 02:56:16PM +0530, Dikshita Agarwal wrote: >> >> >> On 2/27/2026 5:48 PM, Dmitry Baryshkov wrote: >>> On Fri, Feb 27, 2026 at 12:21:03PM +0530, Dikshita Agarwal wrote: >>>> SC7280 supports both Gen1 and Gen2 HFI firmware. To support both >>>> dynamically, update the firmware loading mechanism to prioritize >>>> Gen2 availability and detect the loaded firmware version at runtime. >>>> >>>> The firmware loading logic is updated with the following priority: >>>> 1. Device Tree (`firmware-name`): If specified, load unconditionally. >>>> 2. Gen2 Autodetect (SC7280 only): If no DT property exists, attempt to >>>> load the specific Gen2 firmware image (`vpu20_p1_gen2_s6.mbn`). >>>> 3. Default Fallback: If Gen2 loading fails or is not applicable, use >>>> the default firmware name defined in the default platform data. >>>> >>>> Additionally, introduce `iris_update_platform_data` to inspect the >>>> loaded firmware memory before authentication. This function scans for >>>> `QC_IMAGE_VERSION_STRING`. If the version string starts with "vfw" or >>>> matches "video-firmware.N.M" (where N >= 2), it identifies the >>>> firmware as Gen2. >>>> >>>> If Gen2 firmware is detected on SC7280, the driver switches the >>>> internal platform data pointer to the Gen2 configuration. >>>> >>>> Signed-off-by: Dikshita Agarwal >>>> --- >>>> drivers/media/platform/qcom/iris/iris_firmware.c | 70 +++++++++++++++++- >>>> .../platform/qcom/iris/iris_platform_common.h | 1 + >>>> .../media/platform/qcom/iris/iris_platform_gen1.c | 4 +- >>>> .../media/platform/qcom/iris/iris_platform_gen2.c | 83 ++++++++++++++++++++++ >>>> .../platform/qcom/iris/iris_platform_sc7280.h | 15 ++++ >>>> drivers/media/platform/qcom/iris/iris_probe.c | 3 - >>>> drivers/media/platform/qcom/iris/iris_vidc.c | 3 + >>>> 7 files changed, 171 insertions(+), 8 deletions(-) >>>> >>>> diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen1.c b/drivers/media/platform/qcom/iris/iris_platform_gen1.c >>>> index df8e6bf9430ed2a070e092edae9ef998d092cb5e..6dbdd0833dcdc7dfac6d7b35f99837c883e188e7 100644 >>>> --- a/drivers/media/platform/qcom/iris/iris_platform_gen1.c >>>> +++ b/drivers/media/platform/qcom/iris/iris_platform_gen1.c >>>> @@ -414,8 +414,8 @@ const struct iris_platform_data sc7280_data = { >>>> .dma_mask = 0xe0000000 - 1, >>>> .fwname = "qcom/vpu/vpu20_p1.mbn", >>>> .pas_id = IRIS_PAS_ID, >>>> - .inst_iris_fmts = platform_fmts_sm8250_dec, >>>> - .inst_iris_fmts_size = ARRAY_SIZE(platform_fmts_sm8250_dec), >>>> + .inst_iris_fmts = platform_fmts_sc7280_dec, >>>> + .inst_iris_fmts_size = ARRAY_SIZE(platform_fmts_sc7280_dec), >>> >>> Why? >>> >> >> SC7280 Gen2 platform data relies heavily on SM8550 data structures. >> However, unlike SM8550, SC7280 does not support AV1. To address this, I am >> defining a dedicated platform_fmts_sc7280_dec array that correctly lists >> the supported codecs (H264, HEVC, VP9) excluding AV1 and using for both >> gen1 and gen2 platform data for SC7280. > > Why can't we continue using SM8250 data? Also please see the series I > posted few days ago, it might simplify this piece for you. > >> >>>> .inst_caps = &platform_inst_cap_sm8250, >>>> .inst_fw_caps_dec = inst_fw_cap_sm8250_dec, >>>> .inst_fw_caps_dec_size = ARRAY_SIZE(inst_fw_cap_sm8250_dec), >>>> diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c >>>> index 5da90d47f9c6eab4a7e6b17841fdc0e599397bf7..5f3be22a003fe5d80b683b43a1b2386497785fb1 100644 >>>> --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c >>>> +++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c >>>> @@ -15,6 +15,7 @@ >>>> #include "iris_platform_qcs8300.h" >>>> #include "iris_platform_sm8650.h" >>>> #include "iris_platform_sm8750.h" >>>> +#include "iris_platform_sc7280.h" >>> >>> Don't you end up with two copies of 7280 data in the object files? >>> >> >> You are right, there is a duplication. >> The header is needed majorly for above reason to exclude AV1, I can have >> only platform_fmts_sc7280_dec defined in gen1 file and extern and use in >> gen2 file, that will deviate from the design we are currently following for >> platform specific caps though. > > Then the design needs to be changed. I've posted a proposal. > >> >>>> >>>> #define VIDEO_ARCH_LX 1 >>>> #define BITRATE_MAX 245000000 > >>>> @@ -257,8 +256,6 @@ static int iris_probe(struct platform_device *pdev) >>>> if (ret) >>>> return ret; >>>> >>>> - iris_session_init_caps(core); >>>> - >>> >>> Why? >> >> Movin iris_session_init_caps to iris_open because platform data this >> capabilities may change after firmware loading, which happens after probe. >> Initializing caps in probe would result in stale Gen1 capabilities if the >> driver later switches to Gen2. > > Is there a window where devices already exist, but the params are not > yet initialized? The device nodes exist after probe, but session caps are only consumed through ioctls on an open fd, so there’s no user-visible window where caps can be queried before open(). Thanks, Dikshita > >