[Mesa-dev] [PATCH 0/3] GREMEDY_string_marker support
Ian Romanick
idr at freedesktop.org
Mon Aug 17 11:30:40 PDT 2015
On 08/17/2015 11:06 AM, Rob Clark wrote:
> On Mon, Aug 17, 2015 at 1:12 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> On 08/10/2015 09:15 AM, Rob Clark wrote:
>>> From: Rob Clark <robclark at freedesktop.org>
>>>
>>> Punch it through mesa and gallium, plus implementation in freedreno to
>>> serve as an example. Radeon should be able to do a similar thing with
>>> no-op packets. Not sure about other drivers.
>>
>> The idea behind this extension (and the way the only other
>> implementation of it works) is that the debug tool itself exposes it to
>> the application without the driver knowing. This allows the developer
>> to set breakpoints on certain messages, etc.
>>
>> Given that usage model, there may be applications that will start
>> calling glStringMarkerGREMEDY as soon as the extension string is there.
>> After all, you'll on see that in the debugger, so who cares about
>> performance there, right? :( I think it would be better to not enable
>> the extension by default. Maybe require a driconf option or debug
>> context or something.
>>
>>> Plan to use this extension from apitrace, to emit call and frame #'s
>>> for draw commands, so I can find the corresponding draw from cmdstream
>>> dump (ie. to debug lockups, incorrect rendering, etc).
>>
>> Clever. :)
>>
>> I think the other way to do this would be to insert a fence with an
>> object label.
>>
>> GLsync fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
>>
>> glObjectPtrLabel(fence, 0, "call ### frame ###");
>
>
> José Fonseca mentioned on apitrace list, when I submitted
> corresponding apitrace patch, KHR_debug.. which already has
> GL_DEBUG_TYPE_MARKER which seems to be intended for this sort of
> usage.
>
> So I was kinda thinking to respin these patches to add calls to
> Driver.EmitStringMarker() in case of GL_DEBUG_TYPE_MARKER. (Although
> I was a bit unsure if that should be *in addition to* or *instead of*
> the normal codepaths for glDebugMessageInsert())
I completely missed that when I spent 3 seconds skimming KHR_debug. :)
I think it would have to be in addition to. I don't know if there are
any conformance tests for this part of KHR_debug, but I could imagine a
test generating a bunch of messages via glDebugMessageInsert and
checking that they show up through the callback. If an application
doesn't want to see those messages, it can use glDebugMessageControl to
filter them:
glDebugMessageControl(GL_DONT_CARE,
GL_DEBUG_TYPE_MARKER,
GL_DONT_CARE,
0, // count
NULL, // message IDs
GL_FALSE);
Or... apitrace could do that to specifically filter the messages that it
will generate.
In any case, I like José's suggestion.
> BR,
> -R
>
>
>>> Rob Clark (3):
>>> mesa: add GREMEDY_string_marker
>>> gallium: add GREMEDY_string_marker
>>> freedreno: implement emit_string_marker
>>>
>>> src/gallium/docs/source/screen.rst | 1 +
>>> src/gallium/drivers/freedreno/freedreno_context.c | 27 +++++++++++++++++++++++
>>> src/gallium/drivers/freedreno/freedreno_screen.c | 1 +
>>> src/gallium/drivers/i915/i915_screen.c | 1 +
>>> src/gallium/drivers/ilo/ilo_screen.c | 1 +
>>> src/gallium/drivers/llvmpipe/lp_screen.c | 1 +
>>> src/gallium/drivers/nouveau/nv30/nv30_screen.c | 1 +
>>> src/gallium/drivers/nouveau/nv50/nv50_screen.c | 1 +
>>> src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 1 +
>>> src/gallium/drivers/r300/r300_screen.c | 1 +
>>> src/gallium/drivers/r600/r600_pipe.c | 1 +
>>> src/gallium/drivers/radeonsi/si_pipe.c | 1 +
>>> src/gallium/drivers/softpipe/sp_screen.c | 1 +
>>> src/gallium/drivers/svga/svga_screen.c | 1 +
>>> src/gallium/drivers/vc4/vc4_screen.c | 3 ++-
>>> src/gallium/include/pipe/p_context.h | 7 ++++++
>>> src/gallium/include/pipe/p_defines.h | 1 +
>>> src/mapi/glapi/gen/GREMEDY_string_marker.xml | 18 +++++++++++++++
>>> src/mapi/glapi/gen/Makefile.am | 1 +
>>> src/mapi/glapi/gen/gl_API.xml | 2 ++
>>> src/mesa/main/dd.h | 6 +++++
>>> src/mesa/main/debug.c | 14 ++++++++++++
>>> src/mesa/main/debug.h | 3 +++
>>> src/mesa/main/extensions.c | 1 +
>>> src/mesa/main/mtypes.h | 1 +
>>> src/mesa/state_tracker/st_context.c | 9 ++++++++
>>> src/mesa/state_tracker/st_extensions.c | 1 +
>>> 27 files changed, 106 insertions(+), 1 deletion(-)
>>> create mode 100644 src/mapi/glapi/gen/GREMEDY_string_marker.xml
>>
>
More information about the mesa-dev
mailing list