Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1962490rwl; Thu, 30 Mar 2023 04:10:39 -0700 (PDT) X-Google-Smtp-Source: AKy350ai7cOtn7kFdfjPlxrygNfysd/wpZUZgkBQRr11QCvP37j2hF/whtbp/nJQ0dEE7vz/X0Ic X-Received: by 2002:aa7:8817:0:b0:623:5c0f:b24a with SMTP id c23-20020aa78817000000b006235c0fb24amr2152041pfo.2.1680174639265; Thu, 30 Mar 2023 04:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680174639; cv=none; d=google.com; s=arc-20160816; b=yUz/2xI9dOdsrVErh9zzXPp+cBF9/po6OGeWFGvit9/hydcp17QsoiH6YYdfCBugKj +UKdHOcO4jTCiRY1FsdvOHpH/laXwglMozBvF3DPaeGlTjMKagOdRLsG8VMi8KpKS0/4 682d4ZDI6lW0pcoy2Vau//e7WRADMJfDbPAUE4zxfIMO2tPqR5GR/Txi7/awj3FAlIZe oQFN+zYca1KCCoaL2un/un2zafR6vEE+JijLEYDIOM3GztVbDoQlI2YBjNBQz1/hEOsc AJr3n7hfFl2pIJMwNhQp4bLNKh8ntTO0xLuuZXaVM/6YrxMJwFYILzRNcbMtDUbwxZHy asyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=vul7olHZLizn9mFsl0sHisxIJ3GgAM9Zuxm0tboBoGo=; b=AG9Edop639WeJ9UvtxvibLH0KcK4vD13SY0muOTk/adRPtHPw40BnIqAPqg5UIu/Zt cEpj5YOuVul+yUlN3qVWpza0PEPt+1pvsImiF3SXOe3NK+Oz0boKc4wCXWh7a2Vc2eYW n8hY9PeCvpoXfUKwuPVXgsK0P/wxQjgNmphSbwLO8Ll6ADx5tDFd6u1hBPzxm9yPqZMi uppWE6ACmK8CQOjelo3+TRMeNPqH1weJvB4XZjOjKy1MZsiMUWaepPdd3wOu8o7Rj0RZ w4nBlyylHtM0Oou35SwCxZvMU0iIMPxmT3N8Ar6MzQQ6BVVGSqbzeSMHZbA5cs/tQedV WQAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WNZ1qDQJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a056a00194300b00608ab285f1csi32750412pfk.199.2023.03.30.04.10.27; Thu, 30 Mar 2023 04:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WNZ1qDQJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231477AbjC3LDp (ORCPT + 99 others); Thu, 30 Mar 2023 07:03:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231460AbjC3LDn (ORCPT ); Thu, 30 Mar 2023 07:03:43 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 179946A71; Thu, 30 Mar 2023 04:03:38 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32UAs7PV015381; Thu, 30 Mar 2023 11:03:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=vul7olHZLizn9mFsl0sHisxIJ3GgAM9Zuxm0tboBoGo=; b=WNZ1qDQJZRPkz5ySK+JTGPRwNSupM46dkaoWfgRB1FJYrVZtbPS9eGz/8uQA+uRQfVgu 0SnUuTCoirpNqbn+SWWxXWbxEpn19N0Tv8YtWwCNunt1KP9Tmdsb9EWQluV3S2X3riog HNZgS64vyFRaRHGrs07Ba9MfUYJOhNQYp+nz4No7g/narfEk1UbEpgpYbqFkjz0gSZxz M6SLj8pytZuXZ0IEpLVmNw6nD5wKAfprQ4Dt+1IlPPgVx2wxPitbgPuAqHy6wpio5JgO DxZrVwEBoMuhOY74AWLfp6/py/A0vG0nGkKOIb872La+KFjJE5nkOT4rlUgzcP4IaxhP IQ== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pn51ygpg7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Mar 2023 11:03:02 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32UB31VK032743 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 Mar 2023 11:03:01 GMT Received: from [10.216.26.177] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Thu, 30 Mar 2023 04:02:55 -0700 Message-ID: <0e85caec-f6ec-fbd4-1815-8df9769bffcf@quicinc.com> Date: Thu, 30 Mar 2023 16:32:51 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH 02/18] media: venus: Introduce VPU version distinction Content-Language: en-US To: Konrad Dybcio , Dikshita Agarwal , Stanimir Varbanov , Andy Gross , "Bjorn Andersson" , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Dikshita Agarwal , Mansur Alisha Shaik , Jonathan Marek CC: Mauro Carvalho Chehab , Stanimir Varbanov , , , , "Vikash Garodia" References: <20230228-topic-venus-v1-0-58c2c88384e9@linaro.org> <20230228-topic-venus-v1-2-58c2c88384e9@linaro.org> From: Vikash Garodia In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: mX4hA1DBL7Tow3_Bk7jTu7ZtGJXwdTL7 X-Proofpoint-GUID: mX4hA1DBL7Tow3_Bk7jTu7ZtGJXwdTL7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-30_06,2023-03-30_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1011 priorityscore=1501 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303300090 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/2/2023 5:07 PM, Konrad Dybcio wrote: > > On 2.03.2023 08:12, Dikshita Agarwal wrote: >> On 2/28/2023 8:54 PM, Konrad Dybcio wrote: >>> The Video Processing Unit hardware version is the differentiator, >>> based on which we should decide which code paths to take in hw >>> init. Up until now, we've relied on HFI versions, but that was >>> just a happy accident between recent SoCs. Add a field in the >>> res struct and add correlated definitions that will be used to >>> account for the aforementioned differences. >>> >>> Signed-off-by: Konrad Dybcio >>> --- >>>   drivers/media/platform/qcom/venus/core.h | 15 +++++++++++++++ >>>   1 file changed, 15 insertions(+) >>> >>> diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h >>> index 32551c2602a9..4b785205c5b1 100644 >>> --- a/drivers/media/platform/qcom/venus/core.h >>> +++ b/drivers/media/platform/qcom/venus/core.h >>> @@ -48,6 +48,14 @@ struct bw_tbl { >>>       u32 peak_10bit; >>>   }; >>>   +enum vpu_version { >>> +    VPU_VERSION_AR50, /* VPU4 */ >>> +    VPU_VERSION_AR50_LITE, /* VPU4.4 */ >>> +    VPU_VERSION_IRIS1, /* VPU5 */ There was Venus3X, followed by a different generation of video hardware. Driver just extended the versions for next generation incrementally. Existing versions in driver are not the VPU versions, so we can drop them from comments. >>> +    VPU_VERSION_IRIS2, >>> +    VPU_VERSION_IRIS2_1, >>> +}; >>> + >>>   struct venus_resources { >>>       u64 dma_mask; >>>       const struct freq_tbl *freq_tbl; >>> @@ -71,6 +79,7 @@ struct venus_resources { >>>       const char * const resets[VIDC_RESETS_NUM_MAX]; >>>       unsigned int resets_num; >>>       enum hfi_version hfi_version; >>> +    enum vpu_version vpu_version; >>>       u8 num_vpp_pipes; >>>       u32 max_load; >>>       unsigned int vmem_id; >>> @@ -473,6 +482,12 @@ struct venus_inst { >>>   #define IS_V4(core)    ((core)->res->hfi_version == HFI_VERSION_4XX) >>>   #define IS_V6(core)    ((core)->res->hfi_version == HFI_VERSION_6XX) >>>   +#define IS_AR50(core)        ((core)->res->vpu_version == VPU_VERSION_AR50) >>> +#define IS_AR50_LITE(core)    ((core)->res->vpu_version == VPU_VERSION_AR50_LITE) >>> +#define IS_IRIS1(core)        ((core)->res->vpu_version == VPU_VERSION_IRIS1) >>> +#define IS_IRIS2(core)        ((core)->res->vpu_version == VPU_VERSION_IRIS2) >>> +#define IS_IRIS2_1(core)    ((core)->res->vpu_version == VPU_VERSION_IRIS2_1) >>> + >>>   #define ctrl_to_inst(ctrl)    \ >>>       container_of((ctrl)->handler, struct venus_inst, ctrl_handler) >>> >> Adding VPU version check seems a good idea to me. Can we remove HFI Version checks now? > If all implementations using VPU x.y *always* use the > same HFI generation for given x, y, we could. HFIs generally does not change, so we can be sure that they would always use the same HFI. We might add a new interface (HFI) for a feature requirement, but always support the existing ones. > > That said, I think keeping it as-is would be convenient > from the maintainability standpoint if nothing else.. For > example functions that only appear in ancient msm-3.10 > releases can be easily guarded with IS_V1 or what have you > without having to dig up all n VPU revisions. > > Konrad