mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
drm/i915/color: reduce indent in xelpd_program_plane_post_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/cb60ebb0c5fe67331425ba51280cea4ba111c577.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
bb2ab17e45
commit
242c6a5c9b
|
|
@ -4024,48 +4024,49 @@ xelpd_program_plane_post_csc_lut(struct intel_dsb *dsb,
|
|||
int i, lut_size = 32;
|
||||
u32 lut_val;
|
||||
|
||||
if (icl_is_hdr_plane(display, plane)) {
|
||||
intel_de_write_dsb(display, dsb, PLANE_POST_CSC_GAMC_INDEX_ENH(pipe, plane, 0),
|
||||
PLANE_PAL_PREC_AUTO_INCREMENT);
|
||||
/* 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; i++) {
|
||||
lut_val = drm_color_lut32_extract(post_csc_lut[i].green, 24);
|
||||
if (!icl_is_hdr_plane(display, plane))
|
||||
return;
|
||||
|
||||
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),
|
||||
PLANE_PAL_PREC_AUTO_INCREMENT);
|
||||
/* 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; i++) {
|
||||
lut_val = drm_color_lut32_extract(post_csc_lut[i].green, 24);
|
||||
|
||||
/* Segment 2 - clamp to the last LUT value to prevent step discontinuity */
|
||||
do {
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
} while (i++ < 34);
|
||||
} else {
|
||||
/*TODO: Add for segment 0 */
|
||||
for (i = 0; i < lut_size; i++) {
|
||||
lut_val = (i * ((1 << 24) - 1)) / (lut_size - 1);
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
|
||||
do {
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
1 << 24);
|
||||
} while (i++ < 34);
|
||||
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);
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH(pipe, plane, 0), 0);
|
||||
/* Segment 2 - clamp to the last LUT value to prevent step discontinuity */
|
||||
do {
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
} while (i++ < 34);
|
||||
} else {
|
||||
/*TODO: Add for segment 0 */
|
||||
for (i = 0; i < lut_size; i++) {
|
||||
lut_val = (i * ((1 << 24) - 1)) / (lut_size - 1);
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
|
||||
do {
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
1 << 24);
|
||||
} while (i++ < 34);
|
||||
}
|
||||
|
||||
intel_de_write_dsb(display, dsb, PLANE_POST_CSC_GAMC_INDEX_ENH(pipe, plane, 0), 0);
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_SEG0_INDEX_ENH(pipe, plane, 0), 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user