diff mbox series

drm/i915: Ignore set frontbuffer return value on release

Message ID 20230927102707.3935596-1-jouni.hogander@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Ignore set frontbuffer return value on release | expand

Commit Message

Hogander, Jouni Sept. 27, 2023, 10:27 a.m. UTC
i915_gem_object_set_frontbuffer returns set frontbuffer pointer.
When we are releasing frontbuffer we are clearing the pointer from
the object and the value can be ignored.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 drivers/gpu/drm/i915/display/intel_frontbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rodrigo Vivi Sept. 27, 2023, 2:09 p.m. UTC | #1
On Wed, Sep 27, 2023 at 01:27:07PM +0300, Jouni Högander wrote:
> i915_gem_object_set_frontbuffer returns set frontbuffer pointer.
> When we are releasing frontbuffer we are clearing the pointer from
> the object and the value can be ignored.
> 
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_frontbuffer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> index d5540c739404..8ef0538813da 100644
> --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> @@ -259,7 +259,7 @@ static void frontbuffer_release(struct kref *ref)
>  
>  	i915_ggtt_clear_scanout(obj);
>  
> -	i915_gem_object_set_frontbuffer(obj, NULL);
> +	(void)i915_gem_object_set_frontbuffer(obj, NULL);

should we create a dedicated function for cleaning up task only?
or maybe should we at least print some drm_err or drm_warn if return
is not what we expect?

>  	spin_unlock(&intel_bo_to_i915(obj)->display.fb_tracking.lock);
>  
>  	i915_active_fini(&front->write);
> -- 
> 2.34.1
>
Hogander, Jouni Sept. 28, 2023, 6:53 a.m. UTC | #2
On Wed, 2023-09-27 at 10:09 -0400, Rodrigo Vivi wrote:
> On Wed, Sep 27, 2023 at 01:27:07PM +0300, Jouni Högander wrote:
> > i915_gem_object_set_frontbuffer returns set frontbuffer pointer.
> > When we are releasing frontbuffer we are clearing the pointer from
> > the object and the value can be ignored.
> > 
> > Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_frontbuffer.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > index d5540c739404..8ef0538813da 100644
> > --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > @@ -259,7 +259,7 @@ static void frontbuffer_release(struct kref
> > *ref)
> >  
> >         i915_ggtt_clear_scanout(obj);
> >  
> > -       i915_gem_object_set_frontbuffer(obj, NULL);
> > +       (void)i915_gem_object_set_frontbuffer(obj, NULL);
> 
> should we create a dedicated function for cleaning up task only?
> or maybe should we at least print some drm_err or drm_warn if return
> is not what we expect?

Thank you Rodrigo for checking my patch. Just sent a new version
addressing your comment. Please check.

BR,

Jouni Högander

> 
> >         spin_unlock(&intel_bo_to_i915(obj)-
> > >display.fb_tracking.lock);
> >  
> >         i915_active_fini(&front->write);
> > -- 
> > 2.34.1
> >
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
index d5540c739404..8ef0538813da 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -259,7 +259,7 @@  static void frontbuffer_release(struct kref *ref)
 
 	i915_ggtt_clear_scanout(obj);
 
-	i915_gem_object_set_frontbuffer(obj, NULL);
+	(void)i915_gem_object_set_frontbuffer(obj, NULL);
 	spin_unlock(&intel_bo_to_i915(obj)->display.fb_tracking.lock);
 
 	i915_active_fini(&front->write);