On Tue, Aug 09, 2016 at 06:53:16PM +0300, Mika Kuoppala wrote: > Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes: > > > request->batch_obj is only set by execbuffer for the convenience of > > debugging hangs. By moving that operation to the callsite, we can > > simplify all other callers and future patches. We also move the > > complications of reference handling of the request->batch_obj next to > > where the active tracking is set up for the request. > > > > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > > --- > > drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++++++++- > > drivers/gpu/drm/i915/i915_gem_request.c | 12 +----------- > > drivers/gpu/drm/i915/i915_gem_request.h | 8 +++----- > > 3 files changed, 13 insertions(+), 17 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c > > index c494b79ded20..c8d13fea4b25 100644 > > --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c > > +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c > > @@ -1702,6 +1702,14 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, > > goto err_batch_unpin; > > } > > > > + /* Whilst this request exists, batch_obj will be on the > > + * active_list, and so will hold the active reference. Only when this > > + * request is retired will the the batch_obj be moved onto the > > + * inactive_list and lose its active reference. Hence we do not need > > + * to explicitly hold another reference here. > > + */ > > The comment here might or might not need revisiting. I can't say yet. That's still true. Active objects have a reference that prevents them from being freed whilst in use by the GPU - currently managed by i915_gem_object_retire__read() iirc. -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx