From patchwork Wed May 17 21:14:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 95573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp72065vqo; Wed, 17 May 2023 14:50:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4g/3ou0AGR0HDHf+RnvA0nCjBIlMrcc30ArgJtmBJaur9f9zpThj10EUCyt2c6DrGIKuhp X-Received: by 2002:a05:6a20:7da7:b0:101:6513:49bd with SMTP id v39-20020a056a207da700b00101651349bdmr38846992pzj.33.1684360207656; Wed, 17 May 2023 14:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684360207; cv=none; d=google.com; s=arc-20160816; b=BHQ3+utcGd1o4Yu51fLmAvA3nckCKvRqX9lyxqDrgXXcs3v9Hjb7Ao6dhC+GxEnQB8 JInFJDWLkAXMltaFXiPt2C9Bqii+Ove92zBmbil0dqigrtPPmaCtPs2v5PUllU3N2vA0 tlSKP9nV5EAYrLUHMTtKoJEwxZMRvLQ/6Ffhatv+XJ/56Y6qVKo0RVX5NkXySCo5swAf UE+LaMHbYzA6ZLjILmBobE6bCLPrNb0AFjwuyXCQ0Z/aoGM8/mfLw1ab3uX+orWo7CrM UJ3zFTgHWHU80E0AIPW8xdHIG7W9+qBRevL1LW0K3aT7yibpc1pF38/XuiBdrDEeU+7n JsvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=WB7o5JzliPqClTUxbFBIzOZ1VAPC2kTl85qPjyuvehw=; b=IyQPTetd1M8bj4saP//6vzcSCYN3LDjwUU7jUCJVALejjv2oCJT/UlkgHLq+POmuju MwQm69mtlwWbhEBOfxkH68xS5V4g8/Hms/sxE4WIzXc4sB7RSfn9k4KWP/AVe0Rylzax 3tSr2Om+eSOo+AaBiXhklFwTA60emWGygWgOyKNXxir6R8vYw7euJ1RTjqL+Y8VfF8ge 3/q+Trbp0gayZ0hkgh/OffDhRO5oaXaamxmc9Uv3T9iZj3+cVsnMOvcRPI+bUGXHGNq/ t+SLakOtcRU2coG+XC7cirLIZRsuK4rgc4OPsMKnWG4xSfVRpOKblOBEwKiwZN0ZC6Rc eWtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dla0xxAg; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a63eb45000000b005308fb9619asi15995518pgk.54.2023.05.17.14.49.32; Wed, 17 May 2023 14:50:07 -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=@linaro.org header.s=google header.b=dla0xxAg; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229827AbjEQVOk (ORCPT + 99 others); Wed, 17 May 2023 17:14:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjEQVOe (ORCPT ); Wed, 17 May 2023 17:14:34 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3216F7A98 for ; Wed, 17 May 2023 14:14:32 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ac836f4447so12947751fa.2 for ; Wed, 17 May 2023 14:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358070; x=1686950070; 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=WB7o5JzliPqClTUxbFBIzOZ1VAPC2kTl85qPjyuvehw=; b=dla0xxAgw14sSQpkBy1XDqebun4ISYqPPRp1iSXhSPWTef6ck6itwp2Y98QnVkReZF GpvDIb4WuYYs7hm67HcHOgnCjKz6JtEsEmNq/QaYbzQ3ycn6vWCFCqSstIKDC6EFU6Tr dwNaL/ODPSlEq7vqgsAU7A6ZHwsqct8PwX2hdab8jmJupW6xJOmVKXTTV4fYI4LCcO6I Dg95G16BYEvbL+/WjGlddz3pqr5vOohpGHjaYrZDjxVhHV8vwdP2zDzBJytkkbSgKtiH iAyYVgBL0cqVwFEEgdKPmUoSGdXwLGzuE1jNwlHOJqQXQsZqTKSXToFuMCieKA3/CJoc Rzeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358070; x=1686950070; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WB7o5JzliPqClTUxbFBIzOZ1VAPC2kTl85qPjyuvehw=; b=H3DOIlldN31UWa4m2vhAz+hxx9xo2aAo1aeGOmvWDuKqM6hKTpV9g9FgiFk4pUWN1g qrakKEkC/Tx81cjrA2rmJG2C+bCI0y+JvxnUSbhGQK2Cyx4XP4XsETeUT2rNFRBOsdBa xo0OHyF6Ro6tJBFljb8gf8UJASP1N9xWd3GNxEz2YjFdQCMYSazZbjI2/yhoB/Uyt8bs zHtSSyhv/tX76p0xrc0w5nxvnXm12kNYkZq8aofFHEeTPN9Nm2x09pnsZK0HqsGmWFlt kEgP0Vjv/8bTjohDr0YShVm23RujPDLZdkED9hmVlUM3piiNFphdu2X9ZfIsr38UjF3G fVmg== X-Gm-Message-State: AC+VfDyUzlWJrgQ6jYmNn5F4MccnGZpIcQ7o+8hdTgubf3+8mvHvlu3D ePBK9pCoTndFVNTRtFXbpezX5A== X-Received: by 2002:a2e:b172:0:b0:2a8:c01a:71b6 with SMTP id a18-20020a2eb172000000b002a8c01a71b6mr9519546ljm.3.1684358070367; Wed, 17 May 2023 14:14:30 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:30 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:16 +0200 Subject: [PATCH v3 03/17] media: venus: Introduce VPU version distinction MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-3-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684358064; l=2053; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=fQWU9RHiaT/ZJ+YZvKDL3yk/Cmmu65hET4UaVHeDybg=; b=MSj/MTkdOBsAAjOd9xHOkLdhXg9K+8D9c9MSPTarCVdqji1cP3OQmoxQKYt78/xr3r/5WoKtn pbacGU+XiN4BUX2kagT66UT3scWB2nnycC4DnBAaGppaU9ABdFkffzw X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766179688934799438?= X-GMAIL-MSGID: =?utf-8?q?1766179688934799438?= The Video Processing Unit hardware version is the differentiator, based on which the video driver should decide which code paths to take. Up until now, we've relied on HFI versions instead, 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. Reviewed-by: Vikash Garodia 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 4f81669986ba..62c310b7dee6 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, + VPU_VERSION_AR50_LITE, + VPU_VERSION_IRIS1, + 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; @@ -481,6 +490,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)