Commit 0b0aab86 authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher

drm/amd/display: Roll gamma struct into core_gamma

Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b73a22d3
......@@ -31,19 +31,6 @@
#include "core_dc.h"
#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
******************************************************************************/
......@@ -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;
......
......@@ -46,6 +46,9 @@ struct core_stream;
struct core_gamma {
struct dc_gamma public;
struct dc_context *ctx;
/* private to dc_surface.c */
int ref_count;
};
void enable_surface_flip_reporting(struct dc_surface *dc_surface,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment