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)
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;
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;
struct dc_transfer_func_distributed_points tf_pts;
enum dc_transfer_func_type type;
enum dc_transfer_func_predefined tf;
+ struct dc_context *ctx;
+ int ref_count;
};
struct dc_surface {
struct dc_hdr_static_metadata hdr_static_ctx;
const struct dc_gamma *gamma_correction;
- const struct dc_transfer_func *in_transfer_func;
+ struct dc_transfer_func *in_transfer_func;
enum dc_color_space color_space;
enum surface_pixel_format format;
void dc_gamma_release(const struct dc_gamma **dc_gamma);
struct dc_gamma *dc_create_gamma(void);
-void dc_transfer_func_retain(const struct dc_transfer_func *dc_tf);
-void dc_transfer_func_release(const struct dc_transfer_func *dc_tf);
+void dc_transfer_func_retain(struct dc_transfer_func *dc_tf);
+void dc_transfer_func_release(struct dc_transfer_func *dc_tf);
struct dc_transfer_func *dc_create_transfer_func(void);
/*
struct freesync_context freesync_ctx;
- const struct dc_transfer_func *out_transfer_func;
+ struct dc_transfer_func *out_transfer_func;
struct colorspace_transform gamut_remap_matrix;
struct csc_transform csc_color_matrix;
const struct core_surface *surface)
{
struct input_pixel_processor *ipp = pipe_ctx->ipp;
- const struct core_transfer_func *tf = NULL;
+ const struct dc_transfer_func *tf = NULL;
struct ipp_prescale_params prescale_params = { 0 };
bool result = true;
return false;
if (surface->public.in_transfer_func)
- tf = DC_TRANSFER_FUNC_TO_CORE(surface->public.in_transfer_func);
+ tf = surface->public.in_transfer_func;
build_prescale_params(&prescale_params, surface);
ipp->funcs->ipp_program_prescale(ipp, &prescale_params);
/* Default case if no input transfer function specified */
ipp->funcs->ipp_set_degamma(ipp,
IPP_DEGAMMA_MODE_HW_sRGB);
- } else if (tf->public.type == TF_TYPE_PREDEFINED) {
- switch (tf->public.tf) {
+ } else if (tf->type == TF_TYPE_PREDEFINED) {
+ switch (tf->tf) {
case TRANSFER_FUNCTION_SRGB:
ipp->funcs->ipp_set_degamma(ipp,
IPP_DEGAMMA_MODE_HW_sRGB);
result = false;
break;
}
- } else if (tf->public.type == TF_TYPE_BYPASS) {
+ } else if (tf->type == TF_TYPE_BYPASS) {
ipp->funcs->ipp_set_degamma(ipp, IPP_DEGAMMA_MODE_BYPASS);
} else {
/*TF_TYPE_DISTRIBUTED_POINTS - Not supported in DCE 11*/
struct pipe_ctx *pipe_ctx, const struct core_surface *surface)
{
struct input_pixel_processor *ipp = pipe_ctx->ipp;
- const struct core_transfer_func *tf = NULL;
+ const struct dc_transfer_func *tf = NULL;
bool result = true;
if (ipp == NULL)
return false;
if (surface->public.in_transfer_func)
- tf = DC_TRANSFER_FUNC_TO_CORE(surface->public.in_transfer_func);
+ tf = surface->public.in_transfer_func;
if (surface->public.gamma_correction && dce_use_lut(surface))
ipp->funcs->ipp_program_input_lut(ipp,
if (tf == NULL)
ipp->funcs->ipp_set_degamma(ipp, IPP_DEGAMMA_MODE_BYPASS);
- else if (tf->public.type == TF_TYPE_PREDEFINED) {
- switch (tf->public.tf) {
+ else if (tf->type == TF_TYPE_PREDEFINED) {
+ switch (tf->tf) {
case TRANSFER_FUNCTION_SRGB:
ipp->funcs->ipp_set_degamma(ipp,
IPP_DEGAMMA_MODE_HW_sRGB);
result = false;
break;
}
- } else if (tf->public.type == TF_TYPE_BYPASS) {
+ } else if (tf->type == TF_TYPE_BYPASS) {
ipp->funcs->ipp_set_degamma(ipp, IPP_DEGAMMA_MODE_BYPASS);
} else {
/*TF_TYPE_DISTRIBUTED_POINTS*/
#define DC_GAMMA_TO_CORE(dc_gamma) \
container_of(dc_gamma, struct core_gamma, public)
-#define DC_TRANSFER_FUNC_TO_CORE(dc_transfer_func) \
- container_of(dc_transfer_func, struct core_transfer_func, public)
-
struct core_surface {
struct dc_surface public;
struct dc_surface_status status;
struct dc_context *ctx;
};
-struct core_transfer_func {
- struct dc_transfer_func public;
- struct dc_context *ctx;
-};
-
void enable_surface_flip_reporting(struct dc_surface *dc_surface,
uint32_t controller_id);