Skip to content

Commit b08d26d

Browse files
lumagrobclark
authored andcommitted
drm/msm/a7xx: actually use a7xx state registers
Make a6xx_get_registers() use a7xx registers instead of a6xx ones if the detected Adreno is from the A7xx family. Fixes: e997ae5 ("drm/msm/a6xx: Mostly implement A7xx gpu_state") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/562233/ Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 69c5bcf commit b08d26d

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,12 +882,13 @@ static void a6xx_snapshot_gmu_hfi_history(struct msm_gpu *gpu,
882882
}
883883
}
884884

885+
#define A6XX_REGLIST_SIZE 1
885886
#define A6XX_GBIF_REGLIST_SIZE 1
886887
static void a6xx_get_registers(struct msm_gpu *gpu,
887888
struct a6xx_gpu_state *a6xx_state,
888889
struct a6xx_crashdumper *dumper)
889890
{
890-
int i, count = ARRAY_SIZE(a6xx_ahb_reglist) +
891+
int i, count = A6XX_REGLIST_SIZE +
891892
ARRAY_SIZE(a6xx_reglist) +
892893
ARRAY_SIZE(a6xx_hlsq_reglist) + A6XX_GBIF_REGLIST_SIZE;
893894
int index = 0;
@@ -901,12 +902,20 @@ static void a6xx_get_registers(struct msm_gpu *gpu,
901902

902903
a6xx_state->nr_registers = count;
903904

904-
for (i = 0; i < ARRAY_SIZE(a6xx_ahb_reglist); i++)
905+
if (adreno_is_a7xx(adreno_gpu))
905906
a6xx_get_ahb_gpu_registers(gpu,
906-
a6xx_state, &a6xx_ahb_reglist[i],
907+
a6xx_state, &a7xx_ahb_reglist,
908+
&a6xx_state->registers[index++]);
909+
else
910+
a6xx_get_ahb_gpu_registers(gpu,
911+
a6xx_state, &a6xx_ahb_reglist,
907912
&a6xx_state->registers[index++]);
908913

909-
if (a6xx_has_gbif(adreno_gpu))
914+
if (adreno_is_a7xx(adreno_gpu))
915+
a6xx_get_ahb_gpu_registers(gpu,
916+
a6xx_state, &a7xx_gbif_reglist,
917+
&a6xx_state->registers[index++]);
918+
else if (a6xx_has_gbif(adreno_gpu))
910919
a6xx_get_ahb_gpu_registers(gpu,
911920
a6xx_state, &a6xx_gbif_reglist,
912921
&a6xx_state->registers[index++]);

drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,8 @@ static const u32 a6xx_gbif_registers[] = {
328328
0x3C00, 0X3C0B, 0X3C40, 0X3C47, 0X3CC0, 0X3CD1, 0xE3A, 0xE3A,
329329
};
330330

331-
static const struct a6xx_registers a6xx_ahb_reglist[] = {
332-
REGS(a6xx_ahb_registers, 0, 0),
333-
};
331+
static const struct a6xx_registers a6xx_ahb_reglist =
332+
REGS(a6xx_ahb_registers, 0, 0);
334333

335334
static const struct a6xx_registers a6xx_vbif_reglist =
336335
REGS(a6xx_vbif_registers, 0, 0);
@@ -353,9 +352,8 @@ static const u32 a7xx_gbif_registers[] = {
353352
0x3cc0, 0x3cd1,
354353
};
355354

356-
static const struct a6xx_registers a7xx_ahb_reglist[] = {
357-
REGS(a7xx_ahb_registers, 0, 0),
358-
};
355+
static const struct a6xx_registers a7xx_ahb_reglist=
356+
REGS(a7xx_ahb_registers, 0, 0);
359357

360358
static const struct a6xx_registers a7xx_gbif_reglist =
361359
REGS(a7xx_gbif_registers, 0, 0);

0 commit comments

Comments
 (0)