Commit 33b1be99 authored by Russell King's avatar Russell King Committed by Lucas Stach

drm: etnaviv: clean up GPU command submission

Clean up the GPU command submission path to prepare for the next change.
This makes the next change easier to read and understand.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
parent 90747b95
...@@ -224,7 +224,8 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, ...@@ -224,7 +224,8 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
{ {
struct etnaviv_cmdbuf *buffer = gpu->buffer; struct etnaviv_cmdbuf *buffer = gpu->buffer;
unsigned int waitlink_offset = buffer->user_size - 16; unsigned int waitlink_offset = buffer->user_size - 16;
u32 back, link_target, link_size, reserve_size, extra_size = 0; u32 back, reserve_size, extra_size = 0;
u32 link_target, link_dwords;
if (drm_debug & DRM_UT_DRIVER) if (drm_debug & DRM_UT_DRIVER)
etnaviv_buffer_dump(gpu, buffer, 0, 0x50); etnaviv_buffer_dump(gpu, buffer, 0, 0x50);
...@@ -251,7 +252,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, ...@@ -251,7 +252,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
/* save offset back into main buffer */ /* save offset back into main buffer */
back = buffer->user_size + reserve_size - 6 * 4; back = buffer->user_size + reserve_size - 6 * 4;
link_size = 6; link_dwords = 6;
/* Skip over any extra instructions */ /* Skip over any extra instructions */
link_target += extra_size * sizeof(u32); link_target += extra_size * sizeof(u32);
...@@ -261,10 +262,10 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, ...@@ -261,10 +262,10 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
link_target, gpu_va(gpu, cmdbuf), cmdbuf->vaddr); link_target, gpu_va(gpu, cmdbuf), cmdbuf->vaddr);
/* jump back from cmd to main buffer */ /* jump back from cmd to main buffer */
CMD_LINK(cmdbuf, link_size, link_target); CMD_LINK(cmdbuf, link_dwords, link_target);
link_target = gpu_va(gpu, cmdbuf); link_target = gpu_va(gpu, cmdbuf);
link_size = cmdbuf->size / 8; link_dwords = cmdbuf->size / 8;
if (drm_debug & DRM_UT_DRIVER) { if (drm_debug & DRM_UT_DRIVER) {
print_hex_dump(KERN_INFO, "cmd ", DUMP_PREFIX_OFFSET, 16, 4, print_hex_dump(KERN_INFO, "cmd ", DUMP_PREFIX_OFFSET, 16, 4,
...@@ -297,12 +298,12 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, ...@@ -297,12 +298,12 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
gpu->switch_context = false; gpu->switch_context = false;
} }
/* And the link to the first buffer */ /* And the link to the submitted buffer */
CMD_LINK(buffer, link_size, link_target); CMD_LINK(buffer, link_dwords, link_target);
/* Update the link target to point to above instructions */ /* Update the link target to point to above instructions */
link_target = new_target; link_target = new_target;
link_size = extra_size; link_dwords = extra_size;
} }
/* trigger event */ /* trigger event */
...@@ -315,7 +316,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event, ...@@ -315,7 +316,7 @@ void etnaviv_buffer_queue(struct etnaviv_gpu *gpu, unsigned int event,
etnaviv_buffer_replace_wait(buffer, waitlink_offset, etnaviv_buffer_replace_wait(buffer, waitlink_offset,
VIV_FE_LINK_HEADER_OP_LINK | VIV_FE_LINK_HEADER_OP_LINK |
VIV_FE_LINK_HEADER_PREFETCH(link_size), VIV_FE_LINK_HEADER_PREFETCH(link_dwords),
link_target); link_target);
if (drm_debug & DRM_UT_DRIVER) if (drm_debug & DRM_UT_DRIVER)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment