[Intel-gfx] [RFC/CI] drm/i915: Sanitize GuC client initialization

Daniele Ceraolo Spurio daniele.ceraolospurio at intel.com
Fri Feb 10 20:03:42 UTC 2017


<snip>
>> +
>>  /*
>>   * Tell the GuC to allocate or deallocate a specific doorbell
>>   */
>>
>> -static int guc_allocate_doorbell(struct intel_guc *guc,
>> -				 struct i915_guc_client *client)
>> +static int __create_doorbell_hw(struct i915_guc_client *client)
>
> I would rather prefer to only change signature of this function into
>
> 	static int guc_allocate_doorbell(struct intel_guc *guc, u32 index)
>
> as a clean wrap around GUC_ACTION_ALLOCATE_DOORBELL. This way we also preserve
> consistency between function name and the guc action name used inside.
>
> Based on the above we can still add
>
> 	static int __create_doorbell_hw(struct i915_guc_client *client)
> 	{
> 		return guc_allocate_doorbell(client->guc, client->ctx_index);
> 	}
>
> Note that location of the ctx_index member may change in the future, and this
> approach will minimize impact of these future changes.
>

+1.
The client is a SW abstraction that we use to track our registrations 
with GuC, but it only works with our current mode of operation. If we 
plumb it too deep into the low-level functions it'll be more difficult 
to do any reworks in the future.

Thanks,
Daniele


More information about the Intel-gfx mailing list