mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/msm/a6xx: Fix missing ARRAY_SIZE() check
@ 2022-03-04 20:24 Rob Clark
  2022-03-04 21:47 ` Dmitry Baryshkov
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Clark @ 2022-03-04 20:24 UTC (permalink / raw)
  To: dri-devel
  Cc: freedreno, linux-arm-msm, Rob Clark, Rob Clark, Sean Paul,
	Abhinav Kumar, David Airlie, Daniel Vetter, Akhil P Oommen,
	Dmitry Baryshkov, Jonathan Marek, Jordan Crouse, open list

From: Rob Clark <robdclark@chromium.org>

Fixes: f6d62d091cfd ("drm/msm/a6xx: add support for Adreno 660 GPU")
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 02b47977b5c3..6406d8c3411a 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -687,6 +687,7 @@ static void a6xx_set_cp_protect(struct msm_gpu *gpu)
 
 	BUILD_BUG_ON(ARRAY_SIZE(a6xx_protect) > 32);
 	BUILD_BUG_ON(ARRAY_SIZE(a650_protect) > 48);
+	BUILD_BUG_ON(ARRAY_SIZE(a660_protect) > 48);
 
 	if (adreno_is_a650(adreno_gpu)) {
 		regs = a650_protect;
-- 
2.35.1


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH] drm/msm/a6xx: Fix missing ARRAY_SIZE() check
@ 2022-03-05 17:34 Rob Clark
  2022-03-07 15:03 ` Akhil P Oommen
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Clark @ 2022-03-05 17:34 UTC (permalink / raw)
  To: dri-devel
  Cc: freedreno, linux-arm-msm, Rob Clark, Dmitry Baryshkov, Rob Clark,
	Sean Paul, Abhinav Kumar, David Airlie, Daniel Vetter,
	Akhil P Oommen, Jonathan Marek, Jordan Crouse, open list

From: Rob Clark <robdclark@chromium.org>

Fixes: f6d62d091cfd ("drm/msm/a6xx: add support for Adreno 660 GPU")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index 02b47977b5c3..83c31b2ad865 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -683,19 +683,23 @@ static void a6xx_set_cp_protect(struct msm_gpu *gpu)
 {
 	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
 	const u32 *regs = a6xx_protect;
-	unsigned i, count = ARRAY_SIZE(a6xx_protect), count_max = 32;
-
-	BUILD_BUG_ON(ARRAY_SIZE(a6xx_protect) > 32);
-	BUILD_BUG_ON(ARRAY_SIZE(a650_protect) > 48);
+	unsigned i, count, count_max;
 
 	if (adreno_is_a650(adreno_gpu)) {
 		regs = a650_protect;
 		count = ARRAY_SIZE(a650_protect);
 		count_max = 48;
+		BUILD_BUG_ON(ARRAY_SIZE(a650_protect) > 48);
 	} else if (adreno_is_a660_family(adreno_gpu)) {
 		regs = a660_protect;
 		count = ARRAY_SIZE(a660_protect);
 		count_max = 48;
+		BUILD_BUG_ON(ARRAY_SIZE(a660_protect) > 48);
+	} else {
+		regs = a6xx_protect;
+		count = ARRAY_SIZE(a6xx_protect);
+		count_max = 32;
+		BUILD_BUG_ON(ARRAY_SIZE(a6xx_protect) > 32);
 	}
 
 	/*
-- 
2.35.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-07 15:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-04 20:24 [PATCH] drm/msm/a6xx: Fix missing ARRAY_SIZE() check Rob Clark
2022-03-04 21:47 ` Dmitry Baryshkov
2022-03-04 21:58   ` Rob Clark
2022-03-05 10:37     ` Dmitry Baryshkov
2022-03-05 17:34 Rob Clark
2022-03-07 15:03 ` Akhil P Oommen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®