Advertisement
arter97

Untitled

Jul 11th, 2019
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.54 KB | None | 0 0
  1. Author: Park Ju Hyung <qkrwngud825@gmail.com>
  2. Date:   Thu Jul 11 03:08:01 2019 +0900
  3.  
  4.     TMP
  5.    
  6.     Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
  7.  
  8. diff --git a/drivers/gpu/drm/msm/sde/sde_fence.c b/drivers/gpu/drm/msm/sde/sde_fence.c
  9. index 8ffbb98a03fc6..9c9d0b653dd9e 100644
  10. --- a/drivers/gpu/drm/msm/sde/sde_fence.c
  11. +++ b/drivers/gpu/drm/msm/sde/sde_fence.c
  12. @@ -18,6 +18,8 @@
  13.  
  14.  #define TIMELINE_VAL_LENGTH        128
  15.  
  16. +static struct kmem_cache *kmem_fence_pool;
  17. +
  18.  void *sde_sync_get(uint64_t fd)
  19.  {
  20.     /* force signed compare, fdget accepts an int argument */
  21. @@ -140,7 +142,7 @@ static void sde_fence_release(struct fence *fence)
  22.  
  23.     if (fence) {
  24.         f = to_sde_fence(fence);
  25. -       kfree(f);
  26. +       kmem_cache_free(kmem_fence_pool, f);
  27.     }
  28.  }
  29.  
  30. @@ -193,7 +195,7 @@ static int _sde_fence_create_fd(void *fence_ctx, uint32_t val)
  31.         goto exit;
  32.     }
  33.  
  34. -   sde_fence = kzalloc(sizeof(*sde_fence), GFP_KERNEL);
  35. +   sde_fence = kmem_cache_zalloc(kmem_fence_pool, GFP_KERNEL);
  36.     if (!sde_fence)
  37.         return -ENOMEM;
  38.  
  39. @@ -241,6 +243,9 @@ int sde_fence_init(struct sde_fence_context *ctx,
  40.         SDE_ERROR("invalid argument(s)\n");
  41.         return -EINVAL;
  42.     }
  43. +
  44. +   kmem_fence_pool = KMEM_CACHE(sde_fence, SLAB_HWCACHE_ALIGN | SLAB_PANIC);
  45. +
  46.     memset(ctx, 0, sizeof(*ctx));
  47.  
  48.     strlcpy(ctx->name, name, ARRAY_SIZE(ctx->name));
  49. @@ -263,6 +268,8 @@ void sde_fence_deinit(struct sde_fence_context *ctx)
  50.     }
  51.  
  52.     kref_put(&ctx->kref, sde_fence_destroy);
  53. +
  54. +   kmem_cache_destroy(kmem_fence_pool);
  55.  }
  56.  
  57.  void sde_fence_prepare(struct sde_fence_context *ctx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement