Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp721840pxm; Fri, 25 Feb 2022 18:18:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlYdd98XPOW73UiwmfdLoMNr/h9UQ4uAitUxvnAuLvbWE+v0yYzd+f6RcnG8MX9iK1MpRL X-Received: by 2002:a63:27c7:0:b0:372:c656:20b2 with SMTP id n190-20020a6327c7000000b00372c65620b2mr8560138pgn.545.1645841930667; Fri, 25 Feb 2022 18:18:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645841930; cv=none; d=google.com; s=arc-20160816; b=gxXTgj3fX1L2Vqd+abwb9JigcoQ0R6sGOKALxmPDhzvGT2ZIhKO2HnP7ZOCZ14W4vj QTUZIEl85lLCFVYfJU5mAui3pZILwvtxqd+tSvtomnmXHrnRN8/J2++TJSn0dp1/aI71 qg8Ab+oQ3MOVT3OFzh2eYhMbwGPHoCQRjSWK0BgkKl5nfx4fWlMswb2EPrVOXp4m+eds /1pn9fTFBI18/Pv16eoDwaft5lx1mlt3bnENor03Hj1lWpVZn1vOVy5kVvxXtXRvF1Z6 Qamyr3HTL87vC0t5mdO81LWNzf5rpG5k2wP5WC53wqU/SMSjIHtxeIM1XIqf5HdSYLXC f6Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=XlQOgqUg+qM4j70seDDgBCK3GOdeY/KDt3HMzK3r7eU=; b=Oo9/0VtQ3PRtV1SAECBocihRhRz0d3hceiRYGZ08CmBiX+dnFiQDlzhnmlfP8UY5Z3 g7sOntPSb8vTNzOnyf/f0YL/r3M2LQbP98csrGZlXrxbk/5wDtttq970/kpgh1lawjJR oRH+yQCjL0yBKPnyfhtZjBjIrMvArfNnsYW0k85GWEshCtmsWYX08lMFDXBtCPdAtxaN 9Q34LSlDAtbNBUkWKEF8y8HHGmVvQRTUtFbGVZr0w5uM2pXJJEJl9yYbccMs61a/FcVH Fj6Iy7pkuBDsLT2badZN2a9Rga5qdyLsgeuFLhbGPMYHn3wwjlKNS6kjge+LdiUEHVD5 A6pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=HE+qn7QC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id az2-20020a170902a58200b0014d682a17e5si3024422plb.415.2022.02.25.18.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:18:50 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=HE+qn7QC; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 133BE2C6C62; Fri, 25 Feb 2022 17:51:25 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232599AbiBYTYN (ORCPT + 99 others); Fri, 25 Feb 2022 14:24:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231931AbiBYTYM (ORCPT ); Fri, 25 Feb 2022 14:24:12 -0500 Received: from so254-9.mailgun.net (so254-9.mailgun.net [198.61.254.9]) by lindbergh.monkeyblade.net (Postfix) with UTF8SMTPS id CBBCB1D8316 for ; Fri, 25 Feb 2022 11:23:39 -0800 (PST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1645817019; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=XlQOgqUg+qM4j70seDDgBCK3GOdeY/KDt3HMzK3r7eU=; b=HE+qn7QCQADUHlTZ4tcjOR4RT8bMbETHd6+IEiSbRtXpSOmbQe/YmmQB3WwlQJ+9OOXzBVrH MQE7GDWVozCkf17m0ZU0FbbdehxRurcxtOioCH9iuPFru6OQnVWt1grfjGbWGcOOGRfvB/5v ccWf3NvMr74Kkc4bEL0HsKFJAHE= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 62192c576f8d3f1389bd1e86 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 25 Feb 2022 19:21:59 GMT Sender: quic_akhilpo=quicinc.com@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 784F0C43616; Fri, 25 Feb 2022 19:21:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Received: from hyd-lnxbld559.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akhilpo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2FC54C43618; Fri, 25 Feb 2022 19:21:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 2FC54C43618 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=quicinc.com From: Akhil P Oommen To: freedreno , dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS , Dmitry Baryshkov , Bjorn Andersson Cc: Abhinav Kumar , AngeloGioacchino Del Regno , =?UTF-8?q?Christian=20K=C3=B6nig?= , Daniel Vetter , David Airlie , Jonathan Marek , Jordan Crouse , Sean Paul , Stephen Boyd , Vladimir Lypak , Yangtao Li , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] drm/msm/adreno: Generate name from chipid for 7c3 Date: Sat, 26 Feb 2022 00:51:29 +0530 Message-Id: <20220226005021.v2.2.I9436e0e300f76b2e6c34136a0b902e8cfd73e0d6@changeid> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1645816893-22815-1-git-send-email-quic_akhilpo@quicinc.com> References: <1645816893-22815-1-git-send-email-quic_akhilpo@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use a gpu name which is sprintf'ed from the chipid for 7c3 gpu instead of hardcoding one. This helps to avoid code churn in case of a gpu rename. Signed-off-by: Akhil P Oommen --- Changes in v2: - use devm_kasprintf() to generate gpu name (Rob) drivers/gpu/drm/msm/adreno/adreno_device.c | 1 - drivers/gpu/drm/msm/adreno/adreno_gpu.c | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index fb26193..89cfd84 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -318,7 +318,6 @@ static const struct adreno_info gpulist[] = { .hwcg = a660_hwcg, }, { .rev = ADRENO_REV(6, 3, 5, ANY_ID), - .name = "Adreno 7c Gen 3", .fw = { [ADRENO_FW_SQE] = "a660_sqe.fw", [ADRENO_FW_GMU] = "a660_gmu.bin", diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index f33cfa4..d9d0c13 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -929,12 +929,23 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, struct adreno_platform_config *config = dev->platform_data; struct msm_gpu_config adreno_gpu_config = { 0 }; struct msm_gpu *gpu = &adreno_gpu->base; + struct adreno_rev *rev = &config->rev; + const char *gpu_name; adreno_gpu->funcs = funcs; adreno_gpu->info = adreno_info(config->rev); adreno_gpu->gmem = adreno_gpu->info->gmem; adreno_gpu->revn = adreno_gpu->info->revn; - adreno_gpu->rev = config->rev; + adreno_gpu->rev = *rev; + + gpu_name = adreno_gpu->info->name; + if (!gpu_name) { + gpu_name = devm_kasprintf(dev, GFP_KERNEL, "%d.%d.%d.%d", + rev->core, rev->major, rev->minor, + rev->patchid); + if (!gpu_name) + return -ENOMEM; + } adreno_gpu_config.ioname = "kgsl_3d0_reg_memory"; @@ -948,7 +959,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, pm_runtime_enable(dev); return msm_gpu_init(drm, pdev, &adreno_gpu->base, &funcs->base, - adreno_gpu->info->name, &adreno_gpu_config); + gpu_name, &adreno_gpu_config); } void adreno_gpu_cleanup(struct adreno_gpu *adreno_gpu) -- 2.7.4