summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
diff options
context:
space:
mode:
authorHarry Wentland <harry.wentland@amd.com>2017-07-24 15:20:50 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 18:15:37 -0400
commit0b0aab86d51ee63d521f0d96ff4dfe1d6252f9b2 (patch)
tree7e15dd1766f0cfb284334839a66c0c96ef847317 /drivers/gpu/drm/amd/display/dc/core/dc_surface.c
parentb73a22d3257f9ec237c46be12d74b58d5a925d8c (diff)
drm/amd/display: Roll gamma struct into core_gamma
Signed-off-by: Harry Wentland <harry.wentland@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.c21
1 files changed, 4 insertions, 17 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 9a21ea71f4b3..a8b9515fd367 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
@@ -32,19 +32,6 @@
#include "transform.h"
/*******************************************************************************
- * Private structures
- ******************************************************************************/
-struct gamma {
- struct core_gamma protected;
- int ref_count;
-};
-
-#define DC_GAMMA_TO_GAMMA(dc_gamma) \
- container_of(dc_gamma, struct gamma, protected.public)
-#define CORE_GAMMA_TO_GAMMA(core_gamma) \
- container_of(core_gamma, struct gamma, protected)
-
-/*******************************************************************************
* Private functions
******************************************************************************/
static bool construct(struct dc_context *ctx, struct dc_surface *surface)
@@ -152,7 +139,7 @@ void dc_surface_release(struct dc_surface *surface)
void dc_gamma_retain(const struct dc_gamma *dc_gamma)
{
- struct gamma *gamma = DC_GAMMA_TO_GAMMA(dc_gamma);
+ struct core_gamma *gamma = DC_GAMMA_TO_CORE(dc_gamma);
ASSERT(gamma->ref_count > 0);
++gamma->ref_count;
@@ -160,7 +147,7 @@ void dc_gamma_retain(const struct dc_gamma *dc_gamma)
void dc_gamma_release(const struct dc_gamma **dc_gamma)
{
- struct gamma *gamma = DC_GAMMA_TO_GAMMA(*dc_gamma);
+ struct core_gamma *gamma = DC_GAMMA_TO_CORE(*dc_gamma);
ASSERT(gamma->ref_count > 0);
--gamma->ref_count;
@@ -173,14 +160,14 @@ void dc_gamma_release(const struct dc_gamma **dc_gamma)
struct dc_gamma *dc_create_gamma()
{
- struct gamma *gamma = dm_alloc(sizeof(*gamma));
+ struct core_gamma *gamma = dm_alloc(sizeof(*gamma));
if (gamma == NULL)
goto alloc_fail;
++gamma->ref_count;
- return &gamma->protected.public;
+ return &gamma->public;
alloc_fail:
return NULL;