[Mesa-dev] [PATCH 1/4] gallium: add async flag to pipe_debug_callback

Edward O'Callaghan funfunctor at folklore1984.net
Thu Jul 7 07:56:32 UTC 2016



On 07/07/2016 05:54 PM, Nicolai Hähnle wrote:
> On 07.07.2016 09:53, Edward O'Callaghan wrote:
>>
>>
>> On 07/07/2016 05:39 PM, Nicolai Hähnle wrote:
>>> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>>>
>>> ---
>>>   src/gallium/include/pipe/p_state.h               | 6 ++++++
>>>   src/gallium/state_trackers/clover/core/queue.cpp | 5 ++++-
>>>   src/mesa/state_tracker/st_debug.c                | 5 ++++-
>>>   3 files changed, 14 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/gallium/include/pipe/p_state.h
>>> b/src/gallium/include/pipe/p_state.h
>>> index f4bee38..f7bf402 100644
>>> --- a/src/gallium/include/pipe/p_state.h
>>> +++ b/src/gallium/include/pipe/p_state.h
>>> @@ -809,6 +809,12 @@ struct pipe_compute_state
>>>   struct pipe_debug_callback
>>>   {
>>>      /**
>>> +    * When set to \c true, the callback may be called asynchronously
>>> from a
>>> +    * driver-created thread.
>>> +    */
>>> +   bool async;
>>> +
>>> +   /**
>>>       * Callback for the driver to report debug/performance/etc
>>> information back
>>>       * to the state tracker.
>>>       *
>>> diff --git a/src/gallium/state_trackers/clover/core/queue.cpp
>>> b/src/gallium/state_trackers/clover/core/queue.cpp
>>> index 24d71f1..00afdb6 100644
>>> --- a/src/gallium/state_trackers/clover/core/queue.cpp
>>> +++ b/src/gallium/state_trackers/clover/core/queue.cpp
>>> @@ -50,7 +50,10 @@ command_queue::command_queue(clover::context &ctx,
>>> clover::device &dev,
>>>         throw error(CL_INVALID_DEVICE);
>>>
>>>      if (ctx.notify) {
>>> -      struct pipe_debug_callback cb = { &debug_notify_callback, this };
>>> +      struct pipe_debug_callback cb;
>>> +      memset(&cb, 0, sizeof(db));
>> sizeof(cb) ?
> 
> Clearly, may compile setup is missing clover. Thanks!
> 
> Nicolai

With that fix, this series is:

Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>

Kind Regards,
Edward.

> 
>>
>>> +      cb.debug_message = &debug_notify_callback;
>>> +      cb.data = this;
>>>         if (pipe->set_debug_callback)
>>>            pipe->set_debug_callback(pipe, &cb);
>>>      }
>>> diff --git a/src/mesa/state_tracker/st_debug.c
>>> b/src/mesa/state_tracker/st_debug.c
>>> index eaf2549..214e223 100644
>>> --- a/src/mesa/state_tracker/st_debug.c
>>> +++ b/src/mesa/state_tracker/st_debug.c
>>> @@ -172,7 +172,10 @@ st_enable_debug_output(struct st_context *st,
>>> boolean enable)
>>>         return;
>>>
>>>      if (enable) {
>>> -      struct pipe_debug_callback cb = { st_debug_message, st };
>>> +      struct pipe_debug_callback cb;
>>> +      memset(&cb, 0, sizeof(cb));
>>> +      cb.debug_message = st_debug_message;
>>> +      cb.data = st;
>>>         pipe->set_debug_callback(pipe, &cb);
>>>      } else {
>>>         pipe->set_debug_callback(pipe, NULL);
>>>
>>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160707/ab92a859/attachment.sig>


More information about the mesa-dev mailing list