Skip to content

Commit b5e02e1

Browse files
committed
drm/msm/adreno: un-open-code some packets
Small cleanup, lets not open-code bits/bitfields that are properly defined in the rnndb xml (and therefore have builders in the generated headers) Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jordan Crouse <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent c28c82e commit b5e02e1

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
186186
* timestamp is written to the memory and then triggers the interrupt
187187
*/
188188
OUT_PKT7(ring, CP_EVENT_WRITE, 4);
189-
OUT_RING(ring, CACHE_FLUSH_TS | (1 << 31));
189+
OUT_RING(ring, CP_EVENT_WRITE_0_EVENT(CACHE_FLUSH_TS) |
190+
CP_EVENT_WRITE_0_IRQ);
190191
OUT_RING(ring, lower_32_bits(rbmemptr(ring, fence)));
191192
OUT_RING(ring, upper_32_bits(rbmemptr(ring, fence)));
192193
OUT_RING(ring, submit->seqno);
@@ -730,7 +731,7 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
730731
*/
731732
if (adreno_is_a530(adreno_gpu)) {
732733
OUT_PKT7(gpu->rb[0], CP_EVENT_WRITE, 1);
733-
OUT_RING(gpu->rb[0], 0x0F);
734+
OUT_RING(gpu->rb[0], CP_EVENT_WRITE_0_EVENT(STAT_EVENT));
734735

735736
gpu->funcs->flush(gpu, gpu->rb[0]);
736737
if (!a5xx_idle(gpu, gpu->rb[0]))

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ static void get_stats_counter(struct msm_ringbuffer *ring, u32 counter,
7474
u64 iova)
7575
{
7676
OUT_PKT7(ring, CP_REG_TO_MEM, 3);
77-
OUT_RING(ring, counter | (1 << 30) | (2 << 18));
77+
OUT_RING(ring, CP_REG_TO_MEM_0_REG(counter) |
78+
CP_REG_TO_MEM_0_CNT(2) |
79+
CP_REG_TO_MEM_0_64B);
7880
OUT_RING(ring, lower_32_bits(iova));
7981
OUT_RING(ring, upper_32_bits(iova));
8082
}
@@ -102,10 +104,10 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
102104

103105
/* Invalidate CCU depth and color */
104106
OUT_PKT7(ring, CP_EVENT_WRITE, 1);
105-
OUT_RING(ring, PC_CCU_INVALIDATE_DEPTH);
107+
OUT_RING(ring, CP_EVENT_WRITE_0_EVENT(PC_CCU_INVALIDATE_DEPTH));
106108

107109
OUT_PKT7(ring, CP_EVENT_WRITE, 1);
108-
OUT_RING(ring, PC_CCU_INVALIDATE_COLOR);
110+
OUT_RING(ring, CP_EVENT_WRITE_0_EVENT(PC_CCU_INVALIDATE_COLOR));
109111

110112
/* Submit the commands */
111113
for (i = 0; i < submit->nr_cmds; i++) {
@@ -139,7 +141,8 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
139141
* timestamp is written to the memory and then triggers the interrupt
140142
*/
141143
OUT_PKT7(ring, CP_EVENT_WRITE, 4);
142-
OUT_RING(ring, CACHE_FLUSH_TS | (1 << 31));
144+
OUT_RING(ring, CP_EVENT_WRITE_0_EVENT(CACHE_FLUSH_TS) |
145+
CP_EVENT_WRITE_0_IRQ);
143146
OUT_RING(ring, lower_32_bits(rbmemptr(ring, fence)));
144147
OUT_RING(ring, upper_32_bits(rbmemptr(ring, fence)));
145148
OUT_RING(ring, submit->seqno);

0 commit comments

Comments
 (0)