mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 08:15:07 -04:00
drm/i915/color: reduce indent in xelpd_program_plane_pre_csc_lut()
Return early for !icl_is_hdr_plane() to reduce indent. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/ba09d28e1dfb74ecd7c06c3554df485dbcca9a8a.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -3970,45 +3970,46 @@ xelpd_program_plane_pre_csc_lut(struct intel_dsb *dsb,
|
||||
int i, lut_size = 128;
|
||||
u32 lut_val;
|
||||
|
||||
if (icl_is_hdr_plane(display, plane)) {
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_INDEX_ENH(pipe, plane, 0),
|
||||
PLANE_PAL_PREC_AUTO_INCREMENT);
|
||||
if (!icl_is_hdr_plane(display, plane))
|
||||
return;
|
||||
|
||||
if (pre_csc_lut) {
|
||||
for (i = 0; i < lut_size; i++) {
|
||||
lut_val = drm_color_lut32_extract(pre_csc_lut[i].green, 24);
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_INDEX_ENH(pipe, plane, 0),
|
||||
PLANE_PAL_PREC_AUTO_INCREMENT);
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
if (pre_csc_lut) {
|
||||
for (i = 0; i < lut_size; i++) {
|
||||
lut_val = drm_color_lut32_extract(pre_csc_lut[i].green, 24);
|
||||
|
||||
/* Program the max register to clamp values > 1.0. */
|
||||
/* TODO: Restrict to 0x7ffffff */
|
||||
do {
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
} while (i++ < 130);
|
||||
} else {
|
||||
for (i = 0; i < lut_size; i++) {
|
||||
lut_val = (i * ((1 << 24) - 1)) / (lut_size - 1);
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
|
||||
do {
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
1 << 24);
|
||||
} while (i++ < 130);
|
||||
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);
|
||||
/* Program the max register to clamp values > 1.0. */
|
||||
/* TODO: Restrict to 0x7ffffff */
|
||||
do {
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
} while (i++ < 130);
|
||||
} else {
|
||||
for (i = 0; i < lut_size; i++) {
|
||||
lut_val = (i * ((1 << 24) - 1)) / (lut_size - 1);
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
|
||||
do {
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_PRE_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
1 << 24);
|
||||
} while (i++ < 130);
|
||||
}
|
||||
|
||||
intel_de_write_dsb(display, dsb, PLANE_PRE_CSC_GAMC_INDEX_ENH(pipe, plane, 0), 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user