[Mesa-dev] [PATCH 2/2] svga: use the debug callback to report issues to the state tracker

Brian Paul brianp at vmware.com
Sat Dec 5 11:11:41 PST 2015


On 12/04/2015 07:38 PM, Ilia Mirkin wrote:
> On Fri, Dec 4, 2015 at 7:52 PM, Brian Paul <brianp at vmware.com> wrote:
>> Use the new debug callback hook to report conformance, performance
>> and fallbacks to the state tracker.  The state tracker, in turn can
>> report this issues to the user via the GL_ARB_debug_output extension.
>>
>> More issues can be reported in the future; this is just a start.
>>
>> v2: remove conditionals around pipe_debug_message() calls since the
>> check is now done in the macro itself.
>> ---
>>   src/gallium/drivers/svga/svga_context.h          |  3 +++
>>   src/gallium/drivers/svga/svga_draw_arrays.c      |  5 +++++
>>   src/gallium/drivers/svga/svga_pipe_blend.c       |  9 +++++++++
>>   src/gallium/drivers/svga/svga_pipe_misc.c        | 17 +++++++++++++++++
>>   src/gallium/drivers/svga/svga_pipe_rasterizer.c  |  5 +++++
>>   src/gallium/drivers/svga/svga_state_need_swtnl.c | 23 +++++++++++++++++++++++
>>   6 files changed, 62 insertions(+)
>>
>> diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
>> index 6a4f9d8..c4284cc 100644
>> --- a/src/gallium/drivers/svga/svga_context.h
>> +++ b/src/gallium/drivers/svga/svga_context.h
>> @@ -392,6 +392,9 @@ struct svga_context
>>
>>         boolean no_line_width;
>>         boolean force_hw_line_stipple;
>> +
>> +      /** To report perf/conformance/etc issues to the state tracker */
>> +      struct pipe_debug_callback callback;
>>      } debug;
>>
>>      struct {
>> diff --git a/src/gallium/drivers/svga/svga_draw_arrays.c b/src/gallium/drivers/svga/svga_draw_arrays.c
>> index acb2e95..b02adeb 100644
>> --- a/src/gallium/drivers/svga/svga_draw_arrays.c
>> +++ b/src/gallium/drivers/svga/svga_draw_arrays.c
>> @@ -26,6 +26,7 @@
>>   #include "svga_cmd.h"
>>
>>   #include "util/u_inlines.h"
>> +#include "util/u_prim.h"
>>   #include "indices/u_indices.h"
>>
>>   #include "svga_hw_reg.h"
>> @@ -277,6 +278,10 @@ svga_hwtnl_draw_arrays(struct svga_hwtnl *hwtnl,
>>         if (ret != PIPE_OK)
>>            goto done;
>>
>> +      pipe_debug_message(&svga->debug.callback, PERF_INFO,
>> +                         "generating temporary index buffer for drawing %s",
>> +                         u_prim_name(prim));
>> +
>>         ret = svga_hwtnl_simple_draw_range_elements(hwtnl,
>>                                                     gen_buf,
>>                                                     gen_size,
>> diff --git a/src/gallium/drivers/svga/svga_pipe_blend.c b/src/gallium/drivers/svga/svga_pipe_blend.c
>> index 0c9d612..b485703 100644
>> --- a/src/gallium/drivers/svga/svga_pipe_blend.c
>> +++ b/src/gallium/drivers/svga/svga_pipe_blend.c
>> @@ -243,6 +243,15 @@ svga_create_blend_state(struct pipe_context *pipe,
>>            blend->rt[i].srcblend_alpha = blend->rt[i].srcblend;
>>            blend->rt[i].dstblend_alpha = blend->rt[i].dstblend;
>>            blend->rt[i].blendeq_alpha = blend->rt[i].blendeq;
>> +
>> +         if (templ->logicop_func == PIPE_LOGICOP_XOR) {
>> +            pipe_debug_message(&svga->debug.callback, CONFORMANCE,
>> +                               "XOR logicop mode has limited support%s", "");
>> +         }
>> +         else if (templ->logicop_func != PIPE_LOGICOP_COPY) {
>> +            pipe_debug_message(&svga->debug.callback, CONFORMANCE,
>> +                               "general logicops are not supported%s", "");
>
> These %s's should no longer be necessary after my ##__VA_ARGS__ fix right?

Right.  I'll post a v3, and post a v2 of the pipe_debug_message() patch 
which restores the null check.

-Brian




More information about the mesa-dev mailing list