diff options
author | Lewis Huang <Lewis.Huang@amd.com> | 2020-05-20 18:03:05 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-07-01 01:59:21 -0400 |
commit | 8ae5b155928c9183c2f37b5c4eec21037d958699 (patch) | |
tree | e21a8f90abbe43f0a536c8f70734237489b527ce /drivers/gpu/drm/amd/display/modules/color/color_gamma.h | |
parent | drm/amd/display: Improve DisplayPort monitor interop (diff) | |
download | wireguard-linux-8ae5b155928c9183c2f37b5c4eec21037d958699.tar.xz wireguard-linux-8ae5b155928c9183c2f37b5c4eec21037d958699.zip |
drm/amd/display: change global buffer to local buffer
[Why]
Multi-adapter calculate regamma table at the same time.
Two thread used the same global variable cause race
condition.
[How]
Change global buffer to local buffer
Signed-off-by: Lewis Huang <Lewis.Huang@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/color/color_gamma.h')
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/color/color_gamma.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.h b/drivers/gpu/drm/amd/display/modules/color/color_gamma.h index 7f56226ba77a..37ffbef6602b 100644 --- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.h +++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.h @@ -26,6 +26,8 @@ #ifndef COLOR_MOD_COLOR_GAMMA_H_ #define COLOR_MOD_COLOR_GAMMA_H_ +#include "color_table.h" + struct dc_transfer_func; struct dc_gamma; struct dc_transfer_func_distributed_points; @@ -83,6 +85,12 @@ struct freesync_hdr_tf_params { unsigned int skip_tm; // skip tm }; +struct calculate_buffer { + int buffer_index; + struct fixed31_32 buffer[NUM_PTS_IN_REGION]; + struct fixed31_32 gamma_of_2; +}; + struct translate_from_linear_space_args { struct fixed31_32 arg; struct fixed31_32 a0; @@ -90,6 +98,7 @@ struct translate_from_linear_space_args { struct fixed31_32 a2; struct fixed31_32 a3; struct fixed31_32 gamma; + struct calculate_buffer *cal_buffer; }; void setup_x_points_distribution(void); @@ -99,7 +108,8 @@ void precompute_de_pq(void); bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf, const struct dc_gamma *ramp, bool mapUserRamp, bool canRomBeUsed, - const struct freesync_hdr_tf_params *fs_params); + const struct freesync_hdr_tf_params *fs_params, + struct calculate_buffer *cal_buffer); bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps, struct dc_transfer_func *output_tf, @@ -109,10 +119,12 @@ bool mod_color_calculate_degamma_curve(enum dc_transfer_func_predefined trans, struct dc_transfer_func_distributed_points *points); bool calculate_user_regamma_coeff(struct dc_transfer_func *output_tf, - const struct regamma_lut *regamma); + const struct regamma_lut *regamma, + struct calculate_buffer *cal_buffer); bool calculate_user_regamma_ramp(struct dc_transfer_func *output_tf, - const struct regamma_lut *regamma); + const struct regamma_lut *regamma, + struct calculate_buffer *cal_buffer); #endif /* COLOR_MOD_COLOR_GAMMA_H_ */ |