-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add trace for vaExportSurfaceHandle #724
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6316,3 +6316,53 @@ 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 = 0x%08x\n", memType); | ||
va_TraceMsg(trace_ctx, "\tflags = 0x%08x\n", flags); | ||
|
||
if (memType != VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2) { | ||
return; | ||
} | ||
|
||
VADRMPRIMESurfaceDescriptor *desc = (VADRMPRIMESurfaceDescriptor *)descriptor; | ||
|
||
if (!desc) { | ||
return; | ||
} | ||
|
||
va_TraceMsg(trace_ctx, "\tfourcc = %u\n", desc->fourcc); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will crash if descriptor is NULL. Parent function ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in last version, see line 6343 above. |
||
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", i, desc->objects[i].fd); | ||
va_TraceMsg(trace_ctx, "\tobject %d, size = %u\n", i, desc->objects[i].size); | ||
va_TraceMsg(trace_ctx, "\tobject %d, modifier = 0x%llx\n", i, 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", i, desc->layers[i].drm_format); | ||
va_TraceMsg(trace_ctx, "\tlayer %d, size = %u\n", i, desc->layers[i].num_planes); | ||
va_TraceMsg(trace_ctx, "\tlayer %d, object idx = [%d, %d, %d, %d]\n", i, 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", i, 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", i, 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); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted at
libva/va/va.h
Lines 4054 to 4055 in 984dfee
You can't assume it's
VADRMPRIMESurfaceDescriptor
without checkingmemType
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in last version, see line 6337 above.