Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/a6xx: Update ROQ size in coredump

Since RoQ size differs between generations, calculate dynamically the
RoQ size while capturing coredump.

Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/515610/
Link: https://lore.kernel.org/r/20221221203925.v2.4.I07f22966395eb045f6b312710f53890d5d7e69d4@changeid
Signed-off-by: Rob Clark <robdclark@chromium.org>

authored by

Akhil P Oommen and committed by
Rob Clark
3cba4a2c 1e05bba5

+20 -8
+10 -1
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c
··· 942 942 dumper); 943 943 } 944 944 945 + static u32 a6xx_get_cp_roq_size(struct msm_gpu *gpu) 946 + { 947 + /* The value at [16:31] is in 4dword units. Convert it to dwords */ 948 + return gpu_read(gpu, REG_A6XX_CP_ROQ_THRESHOLDS_2) >> 14; 949 + } 950 + 945 951 /* Read a block of data from an indexed register pair */ 946 952 static void a6xx_get_indexed_regs(struct msm_gpu *gpu, 947 953 struct a6xx_gpu_state *a6xx_state, 948 - const struct a6xx_indexed_registers *indexed, 954 + struct a6xx_indexed_registers *indexed, 949 955 struct a6xx_gpu_state_obj *obj) 950 956 { 951 957 int i; 952 958 953 959 obj->handle = (const void *) indexed; 960 + if (indexed->count_fn) 961 + indexed->count = indexed->count_fn(gpu); 962 + 954 963 obj->data = state_kcalloc(a6xx_state, indexed->count, sizeof(u32)); 955 964 if (!obj->data) 956 965 return;
+10 -7
drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h
··· 383 383 REGS(a6xx_gmu_gx_registers, 0, 0), 384 384 }; 385 385 386 - static const struct a6xx_indexed_registers { 386 + static u32 a6xx_get_cp_roq_size(struct msm_gpu *gpu); 387 + 388 + static struct a6xx_indexed_registers { 387 389 const char *name; 388 390 u32 addr; 389 391 u32 data; 390 392 u32 count; 393 + u32 (*count_fn)(struct msm_gpu *gpu); 391 394 } a6xx_indexed_reglist[] = { 392 395 { "CP_SQE_STAT", REG_A6XX_CP_SQE_STAT_ADDR, 393 - REG_A6XX_CP_SQE_STAT_DATA, 0x33 }, 396 + REG_A6XX_CP_SQE_STAT_DATA, 0x33, NULL }, 394 397 { "CP_DRAW_STATE", REG_A6XX_CP_DRAW_STATE_ADDR, 395 - REG_A6XX_CP_DRAW_STATE_DATA, 0x100 }, 398 + REG_A6XX_CP_DRAW_STATE_DATA, 0x100, NULL }, 396 399 { "CP_UCODE_DBG_DATA", REG_A6XX_CP_SQE_UCODE_DBG_ADDR, 397 - REG_A6XX_CP_SQE_UCODE_DBG_DATA, 0x6000 }, 400 + REG_A6XX_CP_SQE_UCODE_DBG_DATA, 0x8000, NULL }, 398 401 { "CP_ROQ", REG_A6XX_CP_ROQ_DBG_ADDR, 399 - REG_A6XX_CP_ROQ_DBG_DATA, 0x400 }, 402 + REG_A6XX_CP_ROQ_DBG_DATA, 0, a6xx_get_cp_roq_size}, 400 403 }; 401 404 402 - static const struct a6xx_indexed_registers a6xx_cp_mempool_indexed = { 405 + static struct a6xx_indexed_registers a6xx_cp_mempool_indexed = { 403 406 "CP_MEMPOOL", REG_A6XX_CP_MEM_POOL_DBG_ADDR, 404 - REG_A6XX_CP_MEM_POOL_DBG_DATA, 0x2060, 407 + REG_A6XX_CP_MEM_POOL_DBG_DATA, 0x2060, NULL, 405 408 }; 406 409 407 410 #define DEBUGBUS(_id, _count) { .id = _id, .name = #_id, .count = _count }