Return early for !icl_is_hdr_plane() to reduce indent.

Signed-off-by: Jani Nikula <[email protected]>

---

'git show -w' for easy review
---
 drivers/gpu/drm/i915/display/intel_color.c | 79 +++++++++++-----------
 1 file changed, 40 insertions(+), 39 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_color.c 
b/drivers/gpu/drm/i915/display/intel_color.c
index 429eb6daa7d2..5209a4cdd14d 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -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);
-
-                               intel_de_write_dsb(display, dsb,
-                                                  
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
-                                                  lut_val);
-                       }
-
-                       /* 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);
+       if (!icl_is_hdr_plane(display, plane))
+               return;
+
+       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);
+
+                       intel_de_write_dsb(display, dsb,
+                                          PLANE_POST_CSC_GAMC_DATA_ENH(pipe, 
plane, 0),
+                                          lut_val);
+               }
+
+               /* 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);
                }
 
-               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);
+               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
-- 
2.47.3

Reply via email to