Commit fcd2f4bf authored by Amy Zhang's avatar Amy Zhang Committed by Alex Deucher

drm/amd/display: Output Transfer Function Regamma Refactor

- Create translation function to translate logical format to hw format
- Refactor to use transfer function in dc instead of input gamma
Signed-off-by: default avatarAmy Zhang <Amy.Zhang@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Reviewed-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 457b74cb
...@@ -246,6 +246,15 @@ struct fixed31_32 dal_fixed31_32_add( ...@@ -246,6 +246,15 @@ struct fixed31_32 dal_fixed31_32_add(
return res; return res;
} }
struct fixed31_32 dal_fixed31_32_add_int(
struct fixed31_32 arg1,
int32_t arg2)
{
return dal_fixed31_32_add(
arg1,
dal_fixed31_32_from_int(arg2));
}
struct fixed31_32 dal_fixed31_32_sub_int( struct fixed31_32 dal_fixed31_32_sub_int(
struct fixed31_32 arg1, struct fixed31_32 arg1,
int32_t arg2) int32_t arg2)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# It calculates Bandwidth and Watermarks values for HW programming # It calculates Bandwidth and Watermarks values for HW programming
# #
BW_CALCS = bandwidth_calcs.o bw_fixed.o gamma_calcs.o BW_CALCS = bandwidth_calcs.o bw_fixed.o
AMD_DAL_BW_CALCS = $(addprefix $(AMDDALPATH)/dc/calcs/,$(BW_CALCS)) AMD_DAL_BW_CALCS = $(addprefix $(AMDDALPATH)/dc/calcs/,$(BW_CALCS))
......
This diff is collapsed.
...@@ -1519,23 +1519,23 @@ void dc_update_surfaces_for_stream(struct dc *dc, struct dc_surface_update *upda ...@@ -1519,23 +1519,23 @@ void dc_update_surfaces_for_stream(struct dc *dc, struct dc_surface_update *upda
if (dc->debug.disable_color_module) if (dc->debug.disable_color_module)
continue; /* skip below color updates */ continue; /* skip below color updates */
if (updates[i].hdr_static_metadata) {
resource_build_info_frame(pipe_ctx);
core_dc->hwss.update_info_frame(pipe_ctx);
}
if (is_new_pipe_surface[j] || if (is_new_pipe_surface[j] ||
updates[i].in_transfer_func) updates[i].in_transfer_func)
core_dc->hwss.set_input_transfer_func( core_dc->hwss.set_input_transfer_func(
pipe_ctx, pipe_ctx->surface); pipe_ctx, pipe_ctx->surface);
if (is_new_pipe_surface[j] || if (is_new_pipe_surface[j] ||
updates[i].gamma ||
updates[i].out_transfer_func) updates[i].out_transfer_func)
core_dc->hwss.set_output_transfer_func( core_dc->hwss.set_output_transfer_func(
pipe_ctx, pipe_ctx,
pipe_ctx->surface, pipe_ctx->surface,
pipe_ctx->stream); pipe_ctx->stream);
if (updates[i].hdr_static_metadata) {
resource_build_info_frame(pipe_ctx);
core_dc->hwss.update_info_frame(pipe_ctx);
}
} }
if (apply_ctx) { if (apply_ctx) {
core_dc->hwss.apply_ctx_for_surface(core_dc, surface, context); core_dc->hwss.apply_ctx_for_surface(core_dc, surface, context);
......
...@@ -213,11 +213,14 @@ enum dc_transfer_func_type { ...@@ -213,11 +213,14 @@ enum dc_transfer_func_type {
}; };
struct dc_transfer_func_distributed_points { struct dc_transfer_func_distributed_points {
uint16_t red[TRANSFER_FUNC_POINTS]; struct fixed31_32 red[TRANSFER_FUNC_POINTS];
uint16_t green[TRANSFER_FUNC_POINTS]; struct fixed31_32 green[TRANSFER_FUNC_POINTS];
uint16_t blue[TRANSFER_FUNC_POINTS]; struct fixed31_32 blue[TRANSFER_FUNC_POINTS];
uint16_t end_exponent; uint16_t end_exponent;
uint16_t x_point_at_y1; uint16_t x_point_at_y1_red;
uint16_t x_point_at_y1_green;
uint16_t x_point_at_y1_blue;
}; };
enum dc_transfer_func_predefined { enum dc_transfer_func_predefined {
......
/*
* gamma_calcs.h
*
* Created on: Feb 9, 2016
* Author: yonsun
*/
#ifndef DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_GAMMA_CALCS_H_
#define DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_GAMMA_CALCS_H_
#include "opp.h"
#include "core_types.h"
#include "dc.h"
bool calculate_regamma_params(struct pwl_params *params,
const struct core_gamma *ramp,
const struct core_surface *surface,
const struct core_stream *stream);
#endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_GAMMA_CALCS_H_ */
...@@ -138,9 +138,7 @@ struct custom_float_value { ...@@ -138,9 +138,7 @@ struct custom_float_value {
struct hw_x_point { struct hw_x_point {
uint32_t custom_float_x; uint32_t custom_float_x;
uint32_t custom_float_x_adjusted;
struct fixed31_32 x; struct fixed31_32 x;
struct fixed31_32 adjusted_x;
struct fixed31_32 regamma_y_red; struct fixed31_32 regamma_y_red;
struct fixed31_32 regamma_y_green; struct fixed31_32 regamma_y_green;
struct fixed31_32 regamma_y_blue; struct fixed31_32 regamma_y_blue;
......
...@@ -190,6 +190,14 @@ struct fixed31_32 dal_fixed31_32_add( ...@@ -190,6 +190,14 @@ struct fixed31_32 dal_fixed31_32_add(
struct fixed31_32 arg1, struct fixed31_32 arg1,
struct fixed31_32 arg2); struct fixed31_32 arg2);
/*
* @brief
* result = arg1 + arg2
*/
struct fixed31_32 dal_fixed31_32_add_int(
struct fixed31_32 arg1,
int32_t arg2);
/* /*
* @brief * @brief
* result = arg1 - arg2 * result = arg1 - arg2
......
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