Skip to content

Commit 180349b

Browse files
akhilpo-qcomRob Clark
authored andcommitted
drm/msm/a6xx: Flush LRZ cache before PT switch
As per the recommendation, A7x and newer GPUs should flush the LRZ cache before switching the pagetable. Update a6xx_set_pagetable() to do this. While we are at it, sync both BV and BR before issuing a CP_RESET_CONTEXT_STATE command, to match the downstream sequence. Fixes: af66706 ("drm/msm/a6xx: Add skeleton A7xx support") Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/688995/ Message-ID: <20251118-kaana-gpu-support-v4-2-86eeb8e93fb6@oss.qualcomm.com> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
1 parent 779b68a commit 180349b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static void a6xx_set_pagetable(struct a6xx_gpu *a6xx_gpu,
224224
OUT_RING(ring, submit->seqno - 1);
225225

226226
OUT_PKT7(ring, CP_THREAD_CONTROL, 1);
227-
OUT_RING(ring, CP_SET_THREAD_BOTH);
227+
OUT_RING(ring, CP_THREAD_CONTROL_0_SYNC_THREADS | CP_SET_THREAD_BOTH);
228228

229229
/* Reset state used to synchronize BR and BV */
230230
OUT_PKT7(ring, CP_RESET_CONTEXT_STATE, 1);
@@ -235,7 +235,13 @@ static void a6xx_set_pagetable(struct a6xx_gpu *a6xx_gpu,
235235
CP_RESET_CONTEXT_STATE_0_RESET_GLOBAL_LOCAL_TS);
236236

237237
OUT_PKT7(ring, CP_THREAD_CONTROL, 1);
238-
OUT_RING(ring, CP_SET_THREAD_BR);
238+
OUT_RING(ring, CP_THREAD_CONTROL_0_SYNC_THREADS | CP_SET_THREAD_BOTH);
239+
240+
OUT_PKT7(ring, CP_EVENT_WRITE, 1);
241+
OUT_RING(ring, LRZ_FLUSH);
242+
243+
OUT_PKT7(ring, CP_THREAD_CONTROL, 1);
244+
OUT_RING(ring, CP_THREAD_CONTROL_0_SYNC_THREADS | CP_SET_THREAD_BR);
239245
}
240246

241247
if (!sysprof) {

0 commit comments

Comments
 (0)