Re: [PATCH v3] drm/i915: Warn on if set frontbuffer return value is not NULL on release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2023-09-28 at 11:56 +0300, Jani Nikula wrote:
> On Thu, 28 Sep 2023, Jouni Högander <jouni.hogander@xxxxxxxxx> wrote:
> > i915_gem_object_set_frontbuffer returns set frontbuffer pointer. 
> > When we
> > are releasing frontbuffer we are clearing the pointer from the
> > object. Warn
> > on if return value is not null.
> > 
> > v3: Check i915_gem_object_set_frontbuffer return value separately
> > v2: Instead of ignoring do drm_WARN_ON
> > 
> > Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
> > Cc: Jani Nikula <jani.nikula@xxxxxxxxx>
> > 
> > Signed-off-by: Jouni Högander <jouni.hogander@xxxxxxxxx>
> 
> Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx>

Thank you for the review. this is now merged.

BR,

Jouni Högander

> > ---
> >  drivers/gpu/drm/i915/display/intel_frontbuffer.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > index d5540c739404..412a19a888a2 100644
> > --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > @@ -251,7 +251,7 @@ static void frontbuffer_retire(struct
> > i915_active *ref)
> >  static void frontbuffer_release(struct kref *ref)
> >         __releases(&intel_bo_to_i915(front->obj)-
> > >display.fb_tracking.lock)
> >  {
> > -       struct intel_frontbuffer *front =
> > +       struct intel_frontbuffer *ret, *front =
> >                 container_of(ref, typeof(*front), ref);
> >         struct drm_i915_gem_object *obj = front->obj;
> >  
> > @@ -259,7 +259,8 @@ static void frontbuffer_release(struct kref
> > *ref)
> >  
> >         i915_ggtt_clear_scanout(obj);
> >  
> > -       i915_gem_object_set_frontbuffer(obj, NULL);
> > +       ret = i915_gem_object_set_frontbuffer(obj, NULL);
> > +       drm_WARN_ON(&intel_bo_to_i915(obj)->drm, ret);
> >         spin_unlock(&intel_bo_to_i915(obj)-
> > >display.fb_tracking.lock);
> >  
> >         i915_active_fini(&front->write);
> 





[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux