Skip to content

Commit

Permalink
Add trace for vaExportSurfaceHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroYY committed Jul 3, 2023
1 parent 984dfee commit 8b07ee8
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
2 changes: 2 additions & 0 deletions va/va.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,8 @@ vaExportSurfaceHandle(VADisplay dpy, VASurfaceID surface_id,
vaStatus = ctx->vtable->vaExportSurfaceHandle(ctx, surface_id,
mem_type, flags,
descriptor);
VA_TRACE_LOG(va_TraceExportSurfaceHandle, dpy, surface_id, mem_type, flags, descriptor);

VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
Expand Down
55 changes: 55 additions & 0 deletions va/va_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -6316,3 +6316,58 @@ void va_TraceEventBuffers(
}
return;
}

void va_TraceExportSurfaceHandle(
VADisplay dpy
VASurfaceID surfaceId,
uint32_t memType,
uint32_t flags,
void *descriptor)
{
int i;

DPY2TRACE_VIRCTX(dpy);

TRACE_FUNCNAME(idx);

va_TraceMsg(trace_ctx, "\tsurfaceId = 0x%08x\n", surfaceId);
va_TraceMsg(trace_ctx, "\tmemType = %u\n", memType);
va_TraceMsg(trace_ctx, "\tflags = %u\n", flags);

VADRMPRIMESurfaceDescriptor *desc = (VADRMPRIMESurfaceDescriptor *)descriptor;

va_TraceMsg(trace_ctx, "\tfourcc = %u\n", desc->fourcc);
va_TraceMsg(trace_ctx, "\twidth = %u\n", desc->width);
va_TraceMsg(trace_ctx, "\theight = %u\n", desc->height);

va_TraceMsg(trace_ctx, "\tnum_objects = %u\n", desc->num_objects);
for (i = 0; i < desc->num_objects; i++) {
va_TraceMsg(trace_ctx, "\tobject %d, fd = %d\n", desc->objects[i].fd);
va_TraceMsg(trace_ctx, "\tobject %d, size = %u\n", desc->objects[i].size);
va_TraceMsg(trace_ctx, "\tobject %d, modifier = %d\n", desc->objects[i].drm_format_modifier);
}

va_TraceMsg(trace_ctx, "\tnum_objects = %u\n", desc->num_layers);
for (i = 0; i < desc->num_layers; i++) {
va_TraceMsg(trace_ctx, "\tlayer %d, drm_format = %d\n", desc->layers[i].drm_format);
va_TraceMsg(trace_ctx, "\tlayer %d, size = %u\n", desc->layers[i].num_planes);
va_TraceMsg(trace_ctx, "\tlayer %d, object idx = [%d, %d, %d, %d]\n",
desc->layers[i].object_index[0],
desc->layers[i].object_index[1],
desc->layers[i].object_index[2],
desc->layers[i].object_index[3]);
va_TraceMsg(trace_ctx, "\tlayer %d, offset = [%d, %d, %d, %d]\n",
desc->layers[i].offset[0],
desc->layers[i].offset[1],
desc->layers[i].offset[2],
desc->layers[i].offset[3]);
va_TraceMsg(trace_ctx, "\tlayer %d, pitch = [%d, %d, %d, %d]\n",
desc->layers[i].pitch[0],
desc->layers[i].pitch[1],
desc->layers[i].pitch[2],
desc->layers[i].pitch[3]);
}


DPY2TRACE_VIRCTX_EXIT(pva_trace);
}
10 changes: 10 additions & 0 deletions va/va_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,16 @@ void va_TraceEventBuffers(
int num_buffers,
VABufferID *buffers);

/** \brief va_TraceExportSurfaceHandle
* trace exported surface handle. */
DLL_HIDDEN
void va_TraceExportSurfaceHandle(
VADisplay dpy,
VASurfaceID surfaceId,
uint32_t memType,
uint32_t flags,
void *descriptor);

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 8b07ee8

Please sign in to comment.