diff mbox

[v2,3/5] drm/msm: Reuse dma_fence_release.

Message ID 20170412191202.22740-4-eric@anholt.net (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Eric Anholt April 12, 2017, 7:12 p.m. UTC
If we follow the typical pattern of the base class being the first
member, we can use the default dma_fence_free function.

Signed-off-by: Eric Anholt <eric@anholt.net>
Cc: Rob Clark <robdclark@gmail.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
---
 drivers/gpu/drm/msm/msm_fence.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Rob Clark May 2, 2017, 10:20 a.m. UTC | #1
On Wed, Apr 12, 2017 at 3:12 PM, Eric Anholt <eric@anholt.net> wrote:
> If we follow the typical pattern of the base class being the first
> member, we can use the default dma_fence_free function.
>
> Signed-off-by: Eric Anholt <eric@anholt.net>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: linux-arm-msm@vger.kernel.org
> Cc: freedreno@lists.freedesktop.org

Reviewed-by: Rob Clark <robdclark@gmail.com>

(go ahead and push via drm-misc with the rest of the series, if you
haven't already)


> ---
>  drivers/gpu/drm/msm/msm_fence.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_fence.c b/drivers/gpu/drm/msm/msm_fence.c
> index 3f299c537b77..a2f89bac9c16 100644
> --- a/drivers/gpu/drm/msm/msm_fence.c
> +++ b/drivers/gpu/drm/msm/msm_fence.c
> @@ -99,8 +99,8 @@ void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence)
>  }
>
>  struct msm_fence {
> -       struct msm_fence_context *fctx;
>         struct dma_fence base;
> +       struct msm_fence_context *fctx;
>  };
>
>  static inline struct msm_fence *to_msm_fence(struct dma_fence *fence)
> @@ -130,19 +130,13 @@ static bool msm_fence_signaled(struct dma_fence *fence)
>         return fence_completed(f->fctx, f->base.seqno);
>  }
>
> -static void msm_fence_release(struct dma_fence *fence)
> -{
> -       struct msm_fence *f = to_msm_fence(fence);
> -       kfree_rcu(f, base.rcu);
> -}
> -
>  static const struct dma_fence_ops msm_fence_ops = {
>         .get_driver_name = msm_fence_get_driver_name,
>         .get_timeline_name = msm_fence_get_timeline_name,
>         .enable_signaling = msm_fence_enable_signaling,
>         .signaled = msm_fence_signaled,
>         .wait = dma_fence_default_wait,
> -       .release = msm_fence_release,
> +       .release = dma_fence_free,
>  };
>
>  struct dma_fence *
> --
> 2.11.0
>
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpu/drm/msm/msm_fence.c b/drivers/gpu/drm/msm/msm_fence.c
index 3f299c537b77..a2f89bac9c16 100644
--- a/drivers/gpu/drm/msm/msm_fence.c
+++ b/drivers/gpu/drm/msm/msm_fence.c
@@ -99,8 +99,8 @@  void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence)
 }
 
 struct msm_fence {
-	struct msm_fence_context *fctx;
 	struct dma_fence base;
+	struct msm_fence_context *fctx;
 };
 
 static inline struct msm_fence *to_msm_fence(struct dma_fence *fence)
@@ -130,19 +130,13 @@  static bool msm_fence_signaled(struct dma_fence *fence)
 	return fence_completed(f->fctx, f->base.seqno);
 }
 
-static void msm_fence_release(struct dma_fence *fence)
-{
-	struct msm_fence *f = to_msm_fence(fence);
-	kfree_rcu(f, base.rcu);
-}
-
 static const struct dma_fence_ops msm_fence_ops = {
 	.get_driver_name = msm_fence_get_driver_name,
 	.get_timeline_name = msm_fence_get_timeline_name,
 	.enable_signaling = msm_fence_enable_signaling,
 	.signaled = msm_fence_signaled,
 	.wait = dma_fence_default_wait,
-	.release = msm_fence_release,
+	.release = dma_fence_free,
 };
 
 struct dma_fence *