mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 10:00:03 -04:00
drm/i915/color: deduplicate loops in xelpd_program_plane_post_csc_lut()
Now that the pre_csc_lut and non-pre_csc_lut paths look similar, deduplicate the loops and just determine the value based on pre_csc_lut vs. not. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/4b3f55002a1c5b7067ccd6688d802fc284410e03.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -4017,28 +4017,22 @@ xelpd_program_plane_post_csc_lut(struct intel_dsb *dsb,
|
||||
/* TODO: Add macro */
|
||||
intel_de_write_dsb(display, dsb, PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH(pipe, plane, 0),
|
||||
PLANE_PAL_PREC_AUTO_INCREMENT);
|
||||
if (post_csc_lut) {
|
||||
for (i = 0; i < lut_size + 3; i++) {
|
||||
|
||||
for (i = 0; i < lut_size + 3; i++) {
|
||||
if (post_csc_lut) {
|
||||
if (i < lut_size)
|
||||
lut_val = drm_color_lut32_extract(post_csc_lut[i].green, 24);
|
||||
/* else clamp to the last LUT value to prevent step discontinuity */
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
} else {
|
||||
/*TODO: Add for segment 0 */
|
||||
for (i = 0; i < lut_size + 3; i++) {
|
||||
} else {
|
||||
if (i < lut_size)
|
||||
lut_val = (i * ((1 << 24) - 1)) / (lut_size - 1);
|
||||
else
|
||||
lut_val = 1 << 24;
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
|
||||
intel_de_write_dsb(display, dsb, PLANE_POST_CSC_GAMC_INDEX_ENH(pipe, plane, 0), 0);
|
||||
|
||||
Reference in New Issue
Block a user