[Intel-gfx] [PATCH 1/7] drm/i915: Convert requests to use struct fence

John Harrison John.C.Harrison at Intel.com
Mon Jan 11 11:03:39 PST 2016

On 08/01/2016 21:59, Chris Wilson wrote:
> On Fri, Jan 08, 2016 at 06:47:22PM +0000, John.C.Harrison at Intel.com wrote:
>> From: John Harrison <John.C.Harrison at Intel.com>
>> There is a construct in the linux kernel called 'struct fence' that is
>> intended to keep track of work that is executed on hardware. I.e. it
>> solves the basic problem that the drivers 'struct
>> drm_i915_gem_request' is trying to address. The request structure does
>> quite a lot more than simply track the execution progress so is very
>> definitely still required. However, the basic completion status side
>> could be updated to use the ready made fence implementation and gain
>> all the advantages that provides.
>> This patch makes the first step of integrating a struct fence into the
>> request. It replaces the explicit reference count with that of the
>> fence. It also replaces the 'is completed' test with the fence's
>> equivalent. Currently, that simply chains on to the original request
>> implementation. A future patch will improve this.
> But this forces everyone to do the heavyweight polling until the request
> is completed?
Not sure what you mean by heavy weight polling. And as described, this 
is only an intermediate step.

> The seqno is already CPU cacheable and with the exception
> of interrupt polling, the question of whether a fence is complete can be
> determined by just inspecting that value. Only one place (the
> interrupt/signalling path) should ever be concerned about the
> complication of how we emit the breadcrumb and interrupt from the ring.
There is still only one piece of code that needs to worry about the 
internal details. This is change is simply moving that around to make it 
easier to be interrupt driven later on (which is required for the 

> -Chris

More information about the Intel-gfx mailing list