diff mbox series

[1/2] drm/i915/display: Move releasing gem object away from fb tracking

Message ID 20231012072158.4115795-2-jouni.hogander@intel.com (mailing list archive)
State New, archived
Headers show
Series Frontbuffer tracking preparing for Xe | expand

Commit Message

Jouni Högander Oct. 12, 2023, 7:21 a.m. UTC
As a preparation for Xe we want to remove all i915_gem_object details away
from frontbuffer tacking code. Due to this move releasing gem object
reference to i915_gem_object_set_frontbuffer.

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

Comments

Juha-Pekka Heikkila Oct. 20, 2023, 1:26 p.m. UTC | #1
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

On 12.10.2023 10.21, Jouni Högander wrote:
> As a preparation for Xe we want to remove all i915_gem_object details away
> from frontbuffer tacking code. Due to this move releasing gem object
> reference to i915_gem_object_set_frontbuffer.
> 
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_frontbuffer.c       | 2 --
>   drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h | 1 +
>   2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> index ec46716b2f49..2ea37c0414a9 100644
> --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> @@ -265,8 +265,6 @@ static void frontbuffer_release(struct kref *ref)
>   	spin_unlock(&intel_bo_to_i915(obj)->display.fb_tracking.lock);
>   
>   	i915_active_fini(&front->write);
> -
> -	i915_gem_object_put(obj);
>   	kfree_rcu(front, rcu);
>   }
>   
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
> index e5e870b6f186..9fbf14867a2a 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
> @@ -89,6 +89,7 @@ i915_gem_object_set_frontbuffer(struct drm_i915_gem_object *obj,
>   
>   	if (!front) {
>   		RCU_INIT_POINTER(obj->frontbuffer, NULL);
> +		drm_gem_object_put(intel_bo_to_drm_bo(obj));
>   	} else if (rcu_access_pointer(obj->frontbuffer)) {
>   		cur = rcu_dereference_protected(obj->frontbuffer, true);
>   		kref_get(&cur->ref);
Jouni Högander Oct. 23, 2023, 6:10 a.m. UTC | #2
On Fri, 2023-10-20 at 16:26 +0300, Juha-Pekka Heikkila wrote:
> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

Thank you JP for checking my patches. These are now merged.

BR,

Jouni Högander
> 
> On 12.10.2023 10.21, Jouni Högander wrote:
> > As a preparation for Xe we want to remove all i915_gem_object
> > details away
> > from frontbuffer tacking code. Due to this move releasing gem
> > object
> > reference to i915_gem_object_set_frontbuffer.
> > 
> > Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> > ---
> >   drivers/gpu/drm/i915/display/intel_frontbuffer.c       | 2 --
> >   drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h | 1 +
> >   2 files changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > index ec46716b2f49..2ea37c0414a9 100644
> > --- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > +++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
> > @@ -265,8 +265,6 @@ static void frontbuffer_release(struct kref
> > *ref)
> >         spin_unlock(&intel_bo_to_i915(obj)-
> > >display.fb_tracking.lock);
> >   
> >         i915_active_fini(&front->write);
> > -
> > -       i915_gem_object_put(obj);
> >         kfree_rcu(front, rcu);
> >   }
> >   
> > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
> > b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
> > index e5e870b6f186..9fbf14867a2a 100644
> > --- a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
> > +++ b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
> > @@ -89,6 +89,7 @@ i915_gem_object_set_frontbuffer(struct
> > drm_i915_gem_object *obj,
> >   
> >         if (!front) {
> >                 RCU_INIT_POINTER(obj->frontbuffer, NULL);
> > +               drm_gem_object_put(intel_bo_to_drm_bo(obj));
> >         } else if (rcu_access_pointer(obj->frontbuffer)) {
> >                 cur = rcu_dereference_protected(obj->frontbuffer,
> > true);
> >                 kref_get(&cur->ref);
>
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 ec46716b2f49..2ea37c0414a9 100644
--- a/drivers/gpu/drm/i915/display/intel_frontbuffer.c
+++ b/drivers/gpu/drm/i915/display/intel_frontbuffer.c
@@ -265,8 +265,6 @@  static void frontbuffer_release(struct kref *ref)
 	spin_unlock(&intel_bo_to_i915(obj)->display.fb_tracking.lock);
 
 	i915_active_fini(&front->write);
-
-	i915_gem_object_put(obj);
 	kfree_rcu(front, rcu);
 }
 
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
index e5e870b6f186..9fbf14867a2a 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object_frontbuffer.h
@@ -89,6 +89,7 @@  i915_gem_object_set_frontbuffer(struct drm_i915_gem_object *obj,
 
 	if (!front) {
 		RCU_INIT_POINTER(obj->frontbuffer, NULL);
+		drm_gem_object_put(intel_bo_to_drm_bo(obj));
 	} else if (rcu_access_pointer(obj->frontbuffer)) {
 		cur = rcu_dereference_protected(obj->frontbuffer, true);
 		kref_get(&cur->ref);