[Mesa-dev] [PATCH v2 4/5] i965: perf: add support for raw queries

Lionel Landwerlin lionel.g.landwerlin at intel.com
Wed Apr 18 00:21:59 UTC 2018


On 17/04/18 00:07, Kenneth Graunke wrote:
> On Tuesday, April 3, 2018 7:48:12 AM PDT Lionel Landwerlin wrote:
>> diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c
> These changes look good.
>
>> diff --git a/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c b/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c
>> new file mode 100644
>> index 00000000000..cc315ceb4f8
>> --- /dev/null
>> +++ b/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c
> I'm not going to review any of the MD-API stuff, as it isn't something I
> can check with hardware docs and I don't really care to delve into
> MD-API internals...
>
>> +int
>> +brw_perf_query_get_mdapi_oa_data(struct brw_context *brw,
>> +                                 struct brw_perf_query_object *obj,
>> +                                 size_t data_size,
>> +                                 uint8_t *data)
>> +{
>> +   const struct gen_device_info *devinfo = &brw->screen->devinfo;
>> +
>> +   switch (devinfo->gen) {
>> +   case 7: {
>> +      struct mdapi_gen7_metrics *mdapi_data = (struct mdapi_gen7_metrics *) data;
>> +
>> +      if (data_size < sizeof(*mdapi_data))
>> +         return 0;
>> +
>> +      assert(devinfo->is_haswell || devinfo->is_cherryview);
> I hope not, Cherryview is Gen8. :)  Did you mean is_baytrail?  If so,
> you could actually just do assert(!devinfo->is_ivybridge) if you wanted.

Dammit... I always get those 2 mixed up...

>
>> diff --git a/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.h b/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.h
>> new file mode 100644
>> index 00000000000..e6da3a279e6
>> --- /dev/null
>> +++ b/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.h
>> @@ -0,0 +1,39 @@
>> +/*
>> + * Copyright © 2018 Intel Corporation
>> + *
>> + * Permission is hereby granted, free of charge, to any person obtaining a
>> + * copy of this software and associated documentation files (the "Software"),
>> + * to deal in the Software without restriction, including without limitation
>> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
>> + * and/or sell copies of the Software, and to permit persons to whom the
>> + * Software is furnished to do so, subject to the following conditions:
>> + *
>> + * The above copyright notice and this permission notice (including the next
>> + * paragraph) shall be included in all copies or substantial portions of the
>> + * Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
>> + * IN THE SOFTWARE.
>> + */
>> +
>> +#ifndef BRW_PERFORMANCE_QUERY_MDAPI_H
>> +#define BRW_PERFORMANCE_QUERY_MDAPI_H
>> +
>> +#include <stdint.h>
>> +
>> +struct brw_context;
>> +
>> +int brw_perf_query_get_mdapi_oa_data(struct brw_context *brw,
>> +                                     struct brw_perf_query_object *obj,
>> +                                     size_t data_size,
>> +                                     uint8_t *data);
>> +
>> +void brw_perf_query_register_mdapi_oa_query(struct brw_context *brw);
>> +
>> +
>> +#endif /* BRW_PERFORMANCE_QUERY_MDAPI_H */
> Personally I'd just add these to brw_performance_query.h, not sure it's
> worth adding a whole new header file for 2-3 prototypes... Up to you
> though.
>
> With the cherryview thing fixed,
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

Thanks a lot, done.

>
>> diff --git a/src/mesa/drivers/dri/i965/meson.build b/src/mesa/drivers/dri/i965/meson.build
>> index a73ca7807fe..249c9ddd755 100644
>> --- a/src/mesa/drivers/dri/i965/meson.build
>> +++ b/src/mesa/drivers/dri/i965/meson.build
>> @@ -56,6 +56,8 @@ files_i965 = files(
>>     'brw_pipe_control.c',
>>     'brw_performance_query.h',
>>     'brw_performance_query.c',
>> +  'brw_performance_query_mdapi.h',
>> +  'brw_performance_query_mdapi.c',
>>     'brw_performance_query_metrics.h',
>>     'brw_program.c',
>>     'brw_program.h',
>>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180417/f6d8a6be/attachment-0001.html>


More information about the mesa-dev mailing list