[Intel-gfx] [PATCH 1/6] drm/i915: store all subslice masks

Lionel Landwerlin lionel.g.landwerlin at intel.com
Thu Jan 11 16:00:08 UTC 2018


On 11/01/18 11:12, Tvrtko Ursulin wrote:
>> */
>> +    eu_en = ~I915_READ(GEN8_EU_DISABLE0);
>> +    for (ss = 0; ss < sseu->max_subslices; ss++)
>> +        sseu->eu_mask[ss]     = (eu_en >> (8 * ss)) & eu_mask;
>> +    /* Slice1 */
>> +    sseu->eu_mask[sseu->max_subslices]         = (eu_en >> 24) & 
>> eu_mask;
>> +    eu_en = ~I915_READ(GEN8_EU_DISABLE1);
>> +    sseu->eu_mask[sseu->max_subslices + 1]     = eu_en & eu_mask;
>
> I suggest a helper to index into sse->eu_mask, like 
> sseu->eu_mask[_eu_mask_idx(slice, subslice)] or something, so it is 
> more readable what is happening here. Or even:
>
>  _eu_mask(sseu, slice, subslice) = mask;
>
> Doable? I am not 100% I picked up exactly on the layout of the eu_mask 
> array.. each element is one subslice? Consecutive for slice0, 
> subslice0..N, slice1... sliceN ? 
Oops, I misread that part.
I thought you wanted a helper for accessing the registers.
I'll add a helper for what you would like.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20180111/592fd3b0/attachment.html>


More information about the Intel-gfx mailing list