<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 11/01/18 11:12, Tvrtko Ursulin
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:a620fdc4-19ae-a53c-03ed-e5400b797a25@linux.intel.com">
<blockquote type="cite" style="color: #000000;">*/
<br>
+ eu_en = ~I915_READ(GEN8_EU_DISABLE0);
<br>
+ for (ss = 0; ss < sseu->max_subslices; ss++)
<br>
+ sseu->eu_mask[ss] = (eu_en >> (8 * ss))
& eu_mask;
<br>
+ /* Slice1 */
<br>
+ sseu->eu_mask[sseu->max_subslices] = (eu_en
>> 24) & eu_mask;
<br>
+ eu_en = ~I915_READ(GEN8_EU_DISABLE1);
<br>
+ sseu->eu_mask[sseu->max_subslices + 1] = eu_en
& eu_mask;
<br>
</blockquote>
<br>
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:
<br>
<br>
_eu_mask(sseu, slice, subslice) = mask;
<br>
<br>
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 ?
</blockquote>
Oops, I misread that part.<br>
I thought you wanted a helper for accessing the registers.<br>
I'll add a helper for what you would like.<br>
</body>
</html>