Skip to content

Commit 922f9de

Browse files
en4bzzackr
authored andcommitted
drm/vmwgfx: Set a unique ID for each submitted command buffer
These IDs are logged by the Hypervisor when debug logging is enabled. Having the IDs in the log makes it much easier to see when command buffers start and finish. They can also be used by logging/tracing in the Guest to help correlate between Guest and Hypervisor logs. Signed-off-by: Ian Forbes <ian.forbes@broadcom.com> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patch.msgid.link/20260109155139.3259493-1-ian.forbes@broadcom.com
1 parent 211ecfa commit 922f9de

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ struct vmw_cmdbuf_context {
105105
* @handle: DMA address handle for the command buffer space if @using_mob is
106106
* false. Immutable.
107107
* @size: The size of the command buffer space. Immutable.
108+
* @id: Monotonically increasing ID of the last cmdbuf submitted.
108109
* @num_contexts: Number of contexts actually enabled.
109110
*/
110111
struct vmw_cmdbuf_man {
@@ -132,6 +133,7 @@ struct vmw_cmdbuf_man {
132133
bool has_pool;
133134
dma_addr_t handle;
134135
size_t size;
136+
u64 id;
135137
u32 num_contexts;
136138
};
137139

@@ -303,6 +305,8 @@ static int vmw_cmdbuf_header_submit(struct vmw_cmdbuf_header *header)
303305
struct vmw_cmdbuf_man *man = header->man;
304306
u32 val;
305307

308+
header->cb_header->id = man->id++;
309+
306310
val = upper_32_bits(header->handle);
307311
vmw_write(man->dev_priv, SVGA_REG_COMMAND_HIGH, val);
308312

0 commit comments

Comments
 (0)