mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 12:13:51 -04:00
drm/i915/color: deduplicate loops in xelpd_program_plane_pre_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/b943121a358dab0b04c9766baba8295f12ae53fc.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -3977,27 +3977,21 @@ xelpd_program_plane_pre_csc_lut(struct intel_dsb *dsb,
|
||||
PLANE_PRE_CSC_GAMC_INDEX_ENH(pipe, plane, 0),
|
||||
PLANE_PAL_PREC_AUTO_INCREMENT);
|
||||
|
||||
if (pre_csc_lut) {
|
||||
for (i = 0; i < lut_size + 3; i++) {
|
||||
for (i = 0; i < lut_size + 3; i++) {
|
||||
if (pre_csc_lut) {
|
||||
if (i < lut_size)
|
||||
lut_val = drm_color_lut32_extract(pre_csc_lut[i].green, 24);
|
||||
/* else duplicate last lut_val */
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
} else {
|
||||
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_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
|
||||
intel_de_write_dsb(display, dsb, PLANE_PRE_CSC_GAMC_INDEX_ENH(pipe, plane, 0), 0);
|
||||
|
||||
Reference in New Issue
Block a user