aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
diff options
context:
space:
mode:
authorLeo (Sunpeng) Li <sunpeng.li@amd.com>2017-07-10 14:04:21 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 18:08:49 -0400
commit7b0c470fcb44b7dbe63db5b5fb52b6123ebe335f (patch)
treec1e943eec6913086e10dddd3b239518aa212d3f0 /drivers/gpu/drm/amd/display/dc/core/dc_surface.c
parentdrm/amd/display: Attach surface to dm_plane_state. (diff)
downloadlinux-dev-7b0c470fcb44b7dbe63db5b5fb52b6123ebe335f.tar.xz
linux-dev-7b0c470fcb44b7dbe63db5b5fb52b6123ebe335f.zip
drm/amd/display: Flattening to dc_transfer_func
Flattening dc transfer functions in the following manner: transfer_func > core_transfer_func > dc_transfer_func References to deleted structs are updated as needed. Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-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.c19
1 files changed, 4 insertions, 15 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 aa6ac9596235..d44ddfb85748 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
@@ -45,18 +45,11 @@ struct gamma {
int ref_count;
};
-struct transfer_func {
- struct core_transfer_func protected;
- int ref_count;
-};
-
#define DC_SURFACE_TO_SURFACE(dc_surface) container_of(dc_surface, struct surface, protected.public)
#define CORE_SURFACE_TO_SURFACE(core_surface) container_of(core_surface, struct surface, protected)
#define DC_GAMMA_TO_GAMMA(dc_gamma) \
container_of(dc_gamma, struct gamma, protected.public)
-#define DC_TRANSFER_FUNC_TO_TRANSFER_FUNC(dc_tf) \
- container_of(dc_tf, struct transfer_func, protected.public)
#define CORE_GAMMA_TO_GAMMA(core_gamma) \
container_of(core_gamma, struct gamma, protected)
@@ -208,18 +201,14 @@ alloc_fail:
return NULL;
}
-void dc_transfer_func_retain(const struct dc_transfer_func *dc_tf)
+void dc_transfer_func_retain(struct dc_transfer_func *tf)
{
- struct transfer_func *tf = DC_TRANSFER_FUNC_TO_TRANSFER_FUNC(dc_tf);
-
ASSERT(tf->ref_count > 0);
++tf->ref_count;
}
-void dc_transfer_func_release(const struct dc_transfer_func *dc_tf)
+void dc_transfer_func_release(struct dc_transfer_func *tf)
{
- struct transfer_func *tf = DC_TRANSFER_FUNC_TO_TRANSFER_FUNC(dc_tf);
-
ASSERT(tf->ref_count > 0);
--tf->ref_count;
@@ -229,14 +218,14 @@ void dc_transfer_func_release(const struct dc_transfer_func *dc_tf)
struct dc_transfer_func *dc_create_transfer_func()
{
- struct transfer_func *tf = dm_alloc(sizeof(*tf));
+ struct dc_transfer_func *tf = dm_alloc(sizeof(*tf));
if (tf == NULL)
goto alloc_fail;
++tf->ref_count;
- return &tf->protected.public;
+ return tf;
alloc_fail:
return NULL;