diff --git a/va/va.c b/va/va.c index bef10be4c..7fc048a37 100644 --- a/va/va.c +++ b/va/va.c @@ -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; } diff --git a/va/va_trace.c b/va/va_trace.c index b729e6a6e..9f62f8676 100644 --- a/va/va_trace.c +++ b/va/va_trace.c @@ -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); +} \ No newline at end of file diff --git a/va/va_trace.h b/va/va_trace.h index 08bb49ab1..aeb1884a9 100644 --- a/va/va_trace.h +++ b/va/va_trace.h @@ -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