[Intel-gfx] [PATCH 04/14] drm/i915: Data driven register to forcewake domains lookup
Mika Kuoppala
mika.kuoppala at linux.intel.com
Wed Oct 26 09:24:45 UTC 2016
Joonas Lahtinen <joonas.lahtinen at linux.intel.com> writes:
> On pe, 2016-09-30 at 18:48 +0100, Tvrtko Ursulin wrote:
>>
>> +find_fw_domain(u32 offset, const struct intel_forcewake_range *ranges,
>> + unsigned int num_ranges)
>
> Gotta remind that generally "fw" is associated with firmware.
> "forcewake" might be appropriate word in function names too.
>
My reasoning originally was that these are static inside
intel_uncore.c thus the context is clear that these are not
about firmware.
Exposed ones have 'forcewake' in their name to avoid the
confusion.
-Mika
>> +{
>> + unsigned int i;
>> + struct intel_forcewake_range *entry =
>> + (struct intel_forcewake_range *)ranges;
>> +
>> + for (i = 0; i < num_ranges; i++, entry++) {
>> + if (offset >= entry->start && offset <= entry->end)
>> + return entry->domains;
>> + }
>> +
>> + return -1;
>> +}
>>
>
> This could be a binary search, too, with some sorting.
>
> Already as is;
>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
>
> Regards, Joonas
> --
> Joonas Lahtinen
> Open Source Technology Center
> Intel Corporation
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
More information about the Intel-gfx
mailing list