[Mesa-dev] [PATCH] nvc0: add MP performance counters for SM35 (GK110:GM107)
Samuel Pitoiset
samuel.pitoiset at gmail.com
Tue Feb 16 21:07:34 UTC 2016
On 02/16/2016 10:04 PM, Ilia Mirkin wrote:
> On Tue, Feb 16, 2016 at 3:59 PM, Samuel Pitoiset
> <samuel.pitoiset at gmail.com> wrote:
>> static inline const struct nvc0_hw_sm_query_cfg **
>> nvc0_hw_sm_get_queries(struct nvc0_screen *screen)
>> {
>> + const struct nvc0_hw_sm_query_cfg **queries = NULL;
>> struct nouveau_device *dev = screen->base.device;
>>
>> - if (dev->chipset == 0xc0 || dev->chipset == 0xc8)
>> - return sm20_hw_sm_queries;
>> - return sm21_hw_sm_queries;
>> + switch (dev->chipset & ~0xf) {
>> + case 0xc0:
>> + case 0xd0:
>> + if (dev->chipset == 0xc0 || dev->chipset == 0xc8)
>> + queries = sm20_hw_sm_queries;
>> + else
>> + queries = sm21_hw_sm_queries;
>> + break;
>> + case 0xe0:
>> + queries = sm30_hw_sm_queries;
>> + break;
>> + case 0xf0:
>> + case 0x100:
>> + queries = sm35_hw_sm_queries;
>> + break;
>> + default:
>> + break;
>> + }
>> + return queries;
>> }
>
> This might be wider to do based on 3d class. For example GK20A (aka
> 0xea chipset) uses SM35.
Yeah, maybe this could improve readability.
Anyway, when all performance counters will be upstream, I think it would
be good to refactor the code (or try to).
>
More information about the mesa-dev
mailing list