mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 15:12:13 +02:00
drm/amd/display: Fix low black values by increasing error
[WHY] Regamma resolution for the first few black levels can have problems for calibration. [HOW] HW LUT is divided into N power-of-2 regions each with K segments. For SDR mode we set min point at 2^-10 and increments of 2^-13. It's generally more than 8-bit SDR needs, but some calibration tools and API use 12-bit curves. The fix shifts starting point to 2^-12 and starting increments at 2^-16. Reviewed-by: Krunoslav Kovac <krunoslav.kovac@amd.com> Signed-off-by: Peterson <peterson.guo@amd.com> Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
21b673da51
commit
eda7f2e9bb
|
|
@ -365,23 +365,18 @@ bool cm_helper_translate_curve_to_hw_format(struct dc_context *ctx,
|
|||
region_start = -MAX_LOW_POINT;
|
||||
region_end = NUMBER_REGIONS - MAX_LOW_POINT;
|
||||
} else {
|
||||
/* 11 segments
|
||||
* segment is from 2^-10 to 2^1
|
||||
/* 13 segments
|
||||
* segment is from 2^-12 to 2^0
|
||||
* There are less than 256 points, for optimization
|
||||
*/
|
||||
seg_distr[0] = 3;
|
||||
seg_distr[1] = 4;
|
||||
seg_distr[2] = 4;
|
||||
seg_distr[3] = 4;
|
||||
seg_distr[4] = 4;
|
||||
seg_distr[5] = 4;
|
||||
seg_distr[6] = 4;
|
||||
seg_distr[7] = 4;
|
||||
seg_distr[8] = 4;
|
||||
seg_distr[9] = 4;
|
||||
seg_distr[10] = 1;
|
||||
const uint8_t SEG_COUNT = 12;
|
||||
|
||||
region_start = -10;
|
||||
for (i = 0; i < SEG_COUNT; i++)
|
||||
seg_distr[i] = 4;
|
||||
|
||||
seg_distr[SEG_COUNT] = 1;
|
||||
|
||||
region_start = -SEG_COUNT;
|
||||
region_end = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,23 +140,18 @@ bool cm3_helper_translate_curve_to_hw_format(
|
|||
region_start = -MAX_LOW_POINT;
|
||||
region_end = NUMBER_REGIONS - MAX_LOW_POINT;
|
||||
} else {
|
||||
/* 11 segments
|
||||
* segment is from 2^-10 to 2^0
|
||||
/* 13 segments
|
||||
* segment is from 2^-12 to 2^0
|
||||
* There are less than 256 points, for optimization
|
||||
*/
|
||||
seg_distr[0] = 3;
|
||||
seg_distr[1] = 4;
|
||||
seg_distr[2] = 4;
|
||||
seg_distr[3] = 4;
|
||||
seg_distr[4] = 4;
|
||||
seg_distr[5] = 4;
|
||||
seg_distr[6] = 4;
|
||||
seg_distr[7] = 4;
|
||||
seg_distr[8] = 4;
|
||||
seg_distr[9] = 4;
|
||||
seg_distr[10] = 1;
|
||||
const uint8_t SEG_COUNT = 12;
|
||||
|
||||
region_start = -10;
|
||||
for (i = 0; i < SEG_COUNT; i++)
|
||||
seg_distr[i] = 4;
|
||||
|
||||
seg_distr[SEG_COUNT] = 1;
|
||||
|
||||
region_start = -SEG_COUNT;
|
||||
region_end = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user