Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Author: Park Ju Hyung <qkrwngud825@gmail.com>
- Date: Thu Jul 11 03:08:01 2019 +0900
- TMP
- Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
- diff --git a/drivers/gpu/drm/msm/sde/sde_fence.c b/drivers/gpu/drm/msm/sde/sde_fence.c
- index 8ffbb98a03fc6..9c9d0b653dd9e 100644
- --- a/drivers/gpu/drm/msm/sde/sde_fence.c
- +++ b/drivers/gpu/drm/msm/sde/sde_fence.c
- @@ -18,6 +18,8 @@
- #define TIMELINE_VAL_LENGTH 128
- +static struct kmem_cache *kmem_fence_pool;
- +
- void *sde_sync_get(uint64_t fd)
- {
- /* force signed compare, fdget accepts an int argument */
- @@ -140,7 +142,7 @@ static void sde_fence_release(struct fence *fence)
- if (fence) {
- f = to_sde_fence(fence);
- - kfree(f);
- + kmem_cache_free(kmem_fence_pool, f);
- }
- }
- @@ -193,7 +195,7 @@ static int _sde_fence_create_fd(void *fence_ctx, uint32_t val)
- goto exit;
- }
- - sde_fence = kzalloc(sizeof(*sde_fence), GFP_KERNEL);
- + sde_fence = kmem_cache_zalloc(kmem_fence_pool, GFP_KERNEL);
- if (!sde_fence)
- return -ENOMEM;
- @@ -241,6 +243,9 @@ int sde_fence_init(struct sde_fence_context *ctx,
- SDE_ERROR("invalid argument(s)\n");
- return -EINVAL;
- }
- +
- + kmem_fence_pool = KMEM_CACHE(sde_fence, SLAB_HWCACHE_ALIGN | SLAB_PANIC);
- +
- memset(ctx, 0, sizeof(*ctx));
- strlcpy(ctx->name, name, ARRAY_SIZE(ctx->name));
- @@ -263,6 +268,8 @@ void sde_fence_deinit(struct sde_fence_context *ctx)
- }
- kref_put(&ctx->kref, sde_fence_destroy);
- +
- + kmem_cache_destroy(kmem_fence_pool);
- }
- void sde_fence_prepare(struct sde_fence_context *ctx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement