History

drm/msm/a6xx: Add a flag to allow preemption to submitqueue_create

Some userspace changes are necessary so add a flag for userspace to advertise support for preemption when creating the submitqueue. When this flag is not set preemption will not be allowed in the middle of the submitted IBs therefore mantaining compatibility with older userspace. The flag is rejected if preemption is not supported on the target, this allows userspace to know whether preemption is supported.

Antonino Maniscalco committed 2 years ago

Commit 7788d321 parent 35d36dc3 files · +15 −5Browse files

Unified · Split

3 files
  1. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +8 −4
  2. drivers/gpu/drm/msm/msm_submitqueue.c +3 −0
  3. include/uapi/drm/msm_drm.h +4 −1
drivers/gpu/drm/msm/adreno/a6xx_gpu.c+8−4
@@ -352,8 +352,10 @@ static void a7xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) · 351 unmodified lines
352 OUT_PKT7(ring, CP_SET_MARKER, 1);352 OUT_PKT7(ring, CP_SET_MARKER, 1);
353 OUT_RING(ring, 0x101); /* IFPC disable */353 OUT_RING(ring, 0x101); /* IFPC disable */
354 354
355 OUT_PKT7(ring, CP_SET_MARKER, 1);355 if (submit->queue->flags & MSM_SUBMITQUEUE_ALLOW_PREEMPT) {
356 OUT_RING(ring, 0x00d); /* IB1LIST start */356 OUT_PKT7(ring, CP_SET_MARKER, 1);
357 OUT_RING(ring, 0x00d); /* IB1LIST start */
358 }
357 359
358 /* Submit the commands */360 /* Submit the commands */
359 for (i = 0; i < submit->nr_cmds; i++) {361 for (i = 0; i < submit->nr_cmds; i++) {
@@ -384,8 +386,10 @@ static void a7xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) · 24 unmodified lines
384 update_shadow_rptr(gpu, ring);386 update_shadow_rptr(gpu, ring);
385 }387 }
386 388
387 OUT_PKT7(ring, CP_SET_MARKER, 1);389 if (submit->queue->flags & MSM_SUBMITQUEUE_ALLOW_PREEMPT) {
388 OUT_RING(ring, 0x00e); /* IB1LIST end */390 OUT_PKT7(ring, CP_SET_MARKER, 1);
391 OUT_RING(ring, 0x00e); /* IB1LIST end */
392 }
389 393
390 get_stats_counter(ring, REG_A7XX_RBBM_PERFCTR_CP(0),394 get_stats_counter(ring, REG_A7XX_RBBM_PERFCTR_CP(0),
391 rbmemptr_stats(ring, index, cpcycles_end));395 rbmemptr_stats(ring, index, cpcycles_end));
drivers/gpu/drm/msm/msm_submitqueue.c+3−0
@@ -170,6 +170,9 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx, · 169 unmodified lines
170 if (!priv->gpu)170 if (!priv->gpu)
171 return -ENODEV;171 return -ENODEV;
172 172
173 if (flags & MSM_SUBMITQUEUE_ALLOW_PREEMPT && priv->gpu->nr_rings == 1)
174 return -EINVAL;
175
173 ret = msm_gpu_convert_priority(priv->gpu, prio, &ring_nr, &sched_prio);176 ret = msm_gpu_convert_priority(priv->gpu, prio, &ring_nr, &sched_prio);
174 if (ret)177 if (ret)
175 return ret;178 return ret;
include/uapi/drm/msm_drm.h+4−1
@@ -347,7 +347,10 @@ struct drm_msm_gem_madvise { · 346 unmodified lines
347 * backwards compatibility as a "default" submitqueue347 * backwards compatibility as a "default" submitqueue
348 */348 */
349 349
350#define MSM_SUBMITQUEUE_FLAGS (0)350#define MSM_SUBMITQUEUE_ALLOW_PREEMPT 0x00000001
351#define MSM_SUBMITQUEUE_FLAGS ( \
352 MSM_SUBMITQUEUE_ALLOW_PREEMPT | \
353 0)
351 354
352/*355/*
353 * The submitqueue priority should be between 0 and MSM_PARAM_PRIORITIES-1,356 * The submitqueue priority should be between 0 and MSM_PARAM_PRIORITIES-1,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t