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

drm/etnaviv: move exec_state to submit object

We'll need this in some places where only the submit is available. Also
this is a first step at slimming down the cmdbuf object.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

+10 -11
+5 -5
drivers/gpu/drm/etnaviv/etnaviv_buffer.c
··· 297 297 } 298 298 299 299 /* Append a command buffer to the ring buffer. */ 300 - void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, 301 - struct etnaviv_cmdbuf *cmdbuf) 300 + void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state, 301 + unsigned int event, struct etnaviv_cmdbuf *cmdbuf) 302 302 { 303 303 struct etnaviv_cmdbuf *buffer = gpu->buffer; 304 304 unsigned int waitlink_offset = buffer->user_size - 16; 305 305 u32 return_target, return_dwords; 306 306 u32 link_target, link_dwords; 307 - bool switch_context = gpu->exec_state != cmdbuf->exec_state; 307 + bool switch_context = gpu->exec_state != exec_state; 308 308 309 309 lockdep_assert_held(&gpu->lock); 310 310 ··· 363 363 } 364 364 365 365 if (switch_context) { 366 - etnaviv_cmd_select_pipe(gpu, buffer, cmdbuf->exec_state); 367 - gpu->exec_state = cmdbuf->exec_state; 366 + etnaviv_cmd_select_pipe(gpu, buffer, exec_state); 367 + gpu->exec_state = exec_state; 368 368 } 369 369 370 370 /* And the link to the submitted buffer */
-2
drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
··· 35 35 u32 user_size; 36 36 /* fence after which this buffer is to be disposed */ 37 37 struct dma_fence *fence; 38 - /* target exec state */ 39 - u32 exec_state; 40 38 /* per GPU in-flight list */ 41 39 struct list_head node; 42 40 /* BOs attached to this command buffer */
+2 -2
drivers/gpu/drm/etnaviv/etnaviv_drv.h
··· 87 87 u16 etnaviv_buffer_config_mmuv2(struct etnaviv_gpu *gpu, u32 mtlb_addr, u32 safe_addr); 88 88 void etnaviv_buffer_end(struct etnaviv_gpu *gpu); 89 89 void etnaviv_sync_point_queue(struct etnaviv_gpu *gpu, unsigned int event); 90 - void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, 91 - struct etnaviv_cmdbuf *cmdbuf); 90 + void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, u32 exec_state, 91 + unsigned int event, struct etnaviv_cmdbuf *cmdbuf); 92 92 void etnaviv_validate_init(void); 93 93 bool etnaviv_cmd_validate_one(struct etnaviv_gpu *gpu, 94 94 u32 *stream, unsigned int size,
+1
drivers/gpu/drm/etnaviv/etnaviv_gem.h
··· 103 103 struct kref refcount; 104 104 struct etnaviv_gpu *gpu; 105 105 struct dma_fence *out_fence, *in_fence; 106 + u32 exec_state; 106 107 u32 flags; 107 108 unsigned int nr_pmrs; 108 109 struct etnaviv_perfmon_request *pmrs;
+1 -1
drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
··· 440 440 goto err_submit_cmds; 441 441 } 442 442 443 - cmdbuf->exec_state = args->exec_state; 444 443 cmdbuf->ctx = file->driver_priv; 445 444 446 445 ret = copy_from_user(bos, u64_to_user_ptr(args->bos), ··· 486 487 goto err_submit_ww_acquire; 487 488 } 488 489 490 + submit->exec_state = args->exec_state; 489 491 submit->flags = args->flags; 490 492 491 493 ret = submit_lookup_objects(submit, file, bos, args->nr_bos);
+1 -1
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
··· 1423 1423 etnaviv_sync_point_queue(gpu, event[1]); 1424 1424 } 1425 1425 1426 - etnaviv_buffer_queue(gpu, event[0], cmdbuf); 1426 + etnaviv_buffer_queue(gpu, submit->exec_state, event[0], cmdbuf); 1427 1427 1428 1428 if (submit->nr_pmrs) { 1429 1429 gpu->event[event[2]].sync_point = &sync_point_perfmon_sample_post;