aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
diff options
context:
space:
mode:
authorHarry Wentland <harry.wentland@amd.com>2017-09-27 10:53:50 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-28 16:46:15 -0400
commit2004f45ef83f07f43f5da6ede780b08068c7583d (patch)
tree011ac2087c8a8c9272a4c4c5eaacd69d44c2319a /drivers/gpu/drm/amd/display/dc/core/dc_surface.c
parentdrm/amd: DC pull request review (diff)
downloadlinux-dev-2004f45ef83f07f43f5da6ede780b08068c7583d.tar.xz
linux-dev-2004f45ef83f07f43f5da6ede780b08068c7583d.zip
drm/amd/display: Use kernel alloc/free
Abstractions are frowned upon. cocci script: virtual context virtual patch virtual org virtual report @@ expression ptr; @@ - dm_alloc(ptr) + kzalloc(ptr, GFP_KERNEL) @@ expression ptr, size; @@ - dm_realloc(ptr, size) + krealloc(ptr, size, GFP_KERNEL) @@ expression ptr; @@ - dm_free(ptr) + kfree(ptr) v2: use GFP_KERNEL, not GFP_ATOMIC. add cocci script Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc_surface.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_surface.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
index e96f63eed070..511ada94530e 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
@@ -68,7 +68,8 @@ struct dc_plane_state *dc_create_plane_state(struct dc *dc)
{
struct dc *core_dc = dc;
- struct dc_plane_state *plane_state = dm_alloc(sizeof(*plane_state));
+ struct dc_plane_state *plane_state = kzalloc(sizeof(*plane_state),
+ GFP_KERNEL);
if (NULL == plane_state)
goto alloc_fail;
@@ -81,7 +82,7 @@ struct dc_plane_state *dc_create_plane_state(struct dc *dc)
return plane_state;
construct_fail:
- dm_free(plane_state);
+ kfree(plane_state);
alloc_fail:
return NULL;
@@ -133,7 +134,7 @@ void dc_plane_state_release(struct dc_plane_state *plane_state)
if (atomic_read(&plane_state->ref_count) == 0) {
destruct(plane_state);
- dm_free(plane_state);
+ kfree(plane_state);
}
}
@@ -149,14 +150,14 @@ void dc_gamma_release(struct dc_gamma **gamma)
atomic_dec(&(*gamma)->ref_count);
if (atomic_read(&(*gamma)->ref_count) == 0)
- dm_free((*gamma));
+ kfree((*gamma));
*gamma = NULL;
}
struct dc_gamma *dc_create_gamma()
{
- struct dc_gamma *gamma = dm_alloc(sizeof(*gamma));
+ struct dc_gamma *gamma = kzalloc(sizeof(*gamma), GFP_KERNEL);
if (gamma == NULL)
goto alloc_fail;
@@ -181,12 +182,12 @@ void dc_transfer_func_release(struct dc_transfer_func *tf)
atomic_dec(&tf->ref_count);
if (atomic_read(&tf->ref_count) == 0)
- dm_free(tf);
+ kfree(tf);
}
struct dc_transfer_func *dc_create_transfer_func()
{
- struct dc_transfer_func *tf = dm_alloc(sizeof(*tf));
+ struct dc_transfer_func *tf = kzalloc(sizeof(*tf), GFP_KERNEL);
if (tf == NULL)
goto alloc_fail;