linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Schulz <john.schulz1@protonmail.com>
To: dmitry.baryshkov@linaro.org
Cc: john.schulz1@protonmail.com, linux-arm-msm@vger.kernel.org
Subject: [PATCH] drivers/gpu: Switching Adreno x1-85 device check to family check.
Date: Tue, 24 Sep 2024 15:55:38 +0000	[thread overview]
Message-ID: <20240924155442.74210-2-john.schulz1@protonmail.com> (raw)
In-Reply-To: <20240924155442.74210-1-john.schulz1@protonmail.com>

Switches the is_x185 check to is_x1xx_family to accommodate more devices.
Note that I got the X1-45 GPU ID from Windows which may not be correct.

Signed-off-by: John Schulz <john.schulz1@protonmail.com>
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c   |  3 ++-
 drivers/gpu/drm/msm/adreno/adreno_gpu.h | 12 +++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 06cab2c6fd66..f04aeacae3c2 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -2,6 +2,7 @@
 /* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. */
 
 
+#include "adreno_gpu.h"
 #include "msm_gem.h"
 #include "msm_mmu.h"
 #include "msm_gpu_trace.h"
@@ -1026,7 +1027,7 @@ static int hw_init(struct msm_gpu *gpu)
 	gpu_write(gpu, REG_A6XX_UCHE_CLIENT_PF, BIT(7) | 0x1);
 
 	/* Set weights for bicubic filtering */
-	if (adreno_is_a650_family(adreno_gpu) || adreno_is_x185(adreno_gpu)) {
+	if (adreno_is_a650_family(adreno_gpu) || adreno_is_x1xx_family(adreno_gpu)) {
 		gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_0, 0);
 		gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_1,
 			0x3fe05ff4);
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
index 58d7e7915c57..ec36fc915433 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h
@@ -526,9 +526,15 @@ static inline int adreno_is_a750(struct adreno_gpu *gpu)
 	return gpu->info->chip_ids[0] == 0x43051401;
 }
 
-static inline int adreno_is_x185(struct adreno_gpu *gpu)
-{
-	return gpu->info->chip_ids[0] == 0x43050c01;
+static inline int adreno_is_x1xx_family(struct adreno_gpu *gpu)
+{
+	switch (gpu->info->chip_ids[0]) {
+	case 0x1fc31043; // X1-45
+	case 0x43050c01; // X1-85
+		return 1;
+	default:
+		return 0;
+	}
 }
 
 static inline int adreno_is_a740_family(struct adreno_gpu *gpu)
-- 
2.46.1



  reply	other threads:[~2024-09-24 15:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-21 20:42 [PATCH] drivers/gpu: Switching Adreno x1-85 device check to family check John Schulz
2024-09-22 14:39 ` Dmitry Baryshkov
2024-09-24 15:54   ` (No Subject) John Schulz
2024-09-24 15:55     ` John Schulz [this message]
2024-09-24 19:51       ` [PATCH] drivers/gpu: Switching Adreno x1-85 device check to family check Dmitry Baryshkov
2024-09-24 16:34     ` (No Subject) Rob Clark
2024-09-24 20:02     ` Dmitry Baryshkov
2024-09-24 13:54 ` [PATCH] drivers/gpu: Switching Adreno x1-85 device check to family check Bjorn Andersson
2024-09-24 16:30   ` Rob Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240924155442.74210-2-john.schulz1@protonmail.com \
    --to=john.schulz1@protonmail.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).