[Intel-gfx] [PATCH v2 13/15] drm/i915: Refactor direct GPU reset from request waiters

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Wed Feb 22 15:07:34 UTC 2017


On 22/02/2017 14:26, Chris Wilson wrote:
> On Wed, Feb 22, 2017 at 02:16:49PM +0000, Tvrtko Ursulin wrote:
>>
>> On 22/02/2017 11:46, Chris Wilson wrote:
>>> Combine the common code for the pair of waiters into a single function.
>>>
>>> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
>>> ---
>>> drivers/gpu/drm/i915/i915_gem_request.c | 21 ++++++++++++---------
>>> 1 file changed, 12 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
>>> index 42250eaf56ec..66d292384e60 100644
>>> --- a/drivers/gpu/drm/i915/i915_gem_request.c
>>> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
>>> @@ -1024,6 +1024,16 @@ bool __i915_spin_request(const struct drm_i915_gem_request *req,
>>> 	return false;
>>> }
>>>
>>> +static bool __i915_reset_request(struct drm_i915_gem_request *request)
>>> +{
>>> +	if (likely(!i915_reset_in_progress(&request->i915->gpu_error)))
>>> +		return false;
>>> +
>>> +	__set_current_state(TASK_RUNNING);
>>> +	i915_reset(request->i915);
>>> +	return true;
>>> +}
>
>> Okay in principle just unclear from the code now what it does. I
>> suggest __i915_check_and_reset_request or
>> __i915_request_check_and_reset so it is obvious the statement not
>> only checks but also does stuff.
>
> __i915_wait_request_check_and_reset ?
>
> Looking at it keeping the i915_wait_request in there to show it's a
> dedicated helper will also be sensible.

Sounds good to me.

Regards,

Tvrtko



More information about the Intel-gfx mailing list