diff options
Diffstat (limited to 'meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0940-drm-amd-dal-Fix-regamma-code-path.patch')
-rw-r--r-- | meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0940-drm-amd-dal-Fix-regamma-code-path.patch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0940-drm-amd-dal-Fix-regamma-code-path.patch b/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0940-drm-amd-dal-Fix-regamma-code-path.patch new file mode 100644 index 00000000..ebea05ab --- /dev/null +++ b/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0940-drm-amd-dal-Fix-regamma-code-path.patch @@ -0,0 +1,121 @@ +From 93ae01b870bfff9f751cef937eaf8f56b7cb99fe Mon Sep 17 00:00:00 2001 +From: Krunoslav Kovac <Krunoslav.Kovac@amd.com> +Date: Wed, 9 Dec 2015 11:19:01 -0500 +Subject: [PATCH 0940/1050] drm/amd/dal: Fix regamma code path + +[Description] Fix the logic in dal3 for enabling regamma, so that regamma can be applied correctly. + +Change-Id: Ifb6a9567af7783d1b65196e63851e0da0c1d6375 +Signed-off-by: Harry Wentland <harry.wentland@amd.com> +Acked-by: Harry Wentland<harry.wentland@amd.com> +--- + drivers/gpu/drm/amd/dal/dc/core/dc_target.c | 6 +- + .../gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c | 64 +++++++++++----------- + 2 files changed, 35 insertions(+), 35 deletions(-) + +diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c +index 6e89050..9ae98c5 100644 +--- a/drivers/gpu/drm/amd/dal/dc/core/dc_target.c ++++ b/drivers/gpu/drm/amd/dal/dc/core/dc_target.c +@@ -142,7 +142,7 @@ static void build_gamma_params( + gamma_param->regamma_adjust_type = GRAPHICS_REGAMMA_ADJUST_SW; + gamma_param->degamma_adjust_type = GRAPHICS_REGAMMA_ADJUST_SW; + +- gamma_param->selected_gamma_lut = GRAPHICS_GAMMA_LUT_LEGACY; ++ gamma_param->selected_gamma_lut = GRAPHICS_GAMMA_LUT_REGAMMA; + + /* TODO support non-legacy gamma */ + gamma_param->disable_adjustments = false; +@@ -151,8 +151,8 @@ static void build_gamma_params( + gamma_param->flag.bits.gamma_update = 1; + + /* Set regamma */ +- gamma_param->regamma.features.bits.GRAPHICS_DEGAMMA_SRGB = 0; +- gamma_param->regamma.features.bits.OVERLAY_DEGAMMA_SRGB = 0; ++ gamma_param->regamma.features.bits.GRAPHICS_DEGAMMA_SRGB = 1; ++ gamma_param->regamma.features.bits.OVERLAY_DEGAMMA_SRGB = 1; + gamma_param->regamma.features.bits.GAMMA_RAMP_ARRAY = 0; + gamma_param->regamma.features.bits.APPLY_DEGAMMA = 0; + +diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c +index 4cba172..cf116f1 100644 +--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c ++++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c +@@ -1027,42 +1027,42 @@ static bool build_regamma_curve( + + uint32_t i; + +- if (!params->regamma.features.bits.GAMMA_RAMP_ARRAY && +- params->regamma.features.bits.APPLY_DEGAMMA) { +- struct gamma_coefficients coeff; ++ struct gamma_coefficients coeff; + +- struct hw_x_point *coord_x = +- opp110->regamma.coordinates_x; ++ struct hw_x_point *coord_x = ++ opp110->regamma.coordinates_x; + +- build_regamma_coefficients( +- ¶ms->regamma, +- params->regamma.features.bits.GRAPHICS_DEGAMMA_SRGB, +- &coeff); +- +- /* Use opp110->regamma.coordinates_x to retrieve +- * coordinates chosen base on given user curve (future task). +- * The x values are exponentially distributed and currently +- * it is hard-coded, the user curve shape is ignored. +- * The future task is to recalculate opp110- +- * regamma.coordinates_x based on input/user curve, +- * translation from 256/1025 to 128 pwl points. +- */ ++ build_regamma_coefficients( ++ ¶ms->regamma, ++ params->regamma.features.bits.GRAPHICS_DEGAMMA_SRGB, ++ &coeff); + +- i = 0; ++ /* Use opp110->regamma.coordinates_x to retrieve ++ * coordinates chosen base on given user curve (future task). ++ * The x values are exponentially distributed and currently ++ * it is hard-coded, the user curve shape is ignored. ++ * The future task is to recalculate opp110- ++ * regamma.coordinates_x based on input/user curve, ++ * translation from 256/1025 to 128 pwl points. ++ */ + +- while (i != opp110->regamma.hw_points_num + 1) { +- rgb->r = translate_from_linear_space_ex( +- coord_x->adjusted_x, &coeff, 0); +- rgb->g = translate_from_linear_space_ex( +- coord_x->adjusted_x, &coeff, 1); +- rgb->b = translate_from_linear_space_ex( +- coord_x->adjusted_x, &coeff, 2); +- +- ++coord_x; +- ++rgb; +- ++i; +- } +- } else { ++ i = 0; ++ ++ while (i != opp110->regamma.hw_points_num + 1) { ++ rgb->r = translate_from_linear_space_ex( ++ coord_x->adjusted_x, &coeff, 0); ++ rgb->g = translate_from_linear_space_ex( ++ coord_x->adjusted_x, &coeff, 1); ++ rgb->b = translate_from_linear_space_ex( ++ coord_x->adjusted_x, &coeff, 2); ++ ++ ++coord_x; ++ ++rgb; ++ ++i; ++ } ++ ++ if (params->regamma.features.bits.GAMMA_RAMP_ARRAY && ++ !params->regamma.features.bits.APPLY_DEGAMMA) { + const uint32_t max_entries = + RGB_256X3X16 + opp110->regamma.extra_points - 1; + +-- +1.9.1 + |