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: clean up variables in xelpd_program_plane_post_csc_lut()
Use plain int for counting. Initialize lut_size at declaration. Remove extra u32 v and just use lut_val. Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/5b4ee3400084d8ccec77b81c8cbbd294394fcbc9.1780499355.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -4020,7 +4020,8 @@ xelpd_program_plane_post_csc_lut(struct intel_dsb *dsb,
|
||||
enum pipe pipe = to_intel_plane(state->plane)->pipe;
|
||||
enum plane_id plane = to_intel_plane(state->plane)->id;
|
||||
const struct drm_color_lut32 *post_csc_lut = plane_state->hw.gamma_lut->data;
|
||||
u32 i, lut_size, lut_val;
|
||||
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),
|
||||
@@ -4029,7 +4030,6 @@ xelpd_program_plane_post_csc_lut(struct intel_dsb *dsb,
|
||||
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) {
|
||||
lut_size = 32;
|
||||
for (i = 0; i < lut_size; i++) {
|
||||
lut_val = drm_color_lut32_extract(post_csc_lut[i].green, 24);
|
||||
|
||||
@@ -4046,12 +4046,12 @@ xelpd_program_plane_post_csc_lut(struct intel_dsb *dsb,
|
||||
} while (i++ < 34);
|
||||
} else {
|
||||
/*TODO: Add for segment 0 */
|
||||
lut_size = 32;
|
||||
for (i = 0; i < lut_size; i++) {
|
||||
u32 v = (i * ((1 << 24) - 1)) / (lut_size - 1);
|
||||
lut_val = (i * ((1 << 24) - 1)) / (lut_size - 1);
|
||||
|
||||
intel_de_write_dsb(display, dsb,
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0), v);
|
||||
PLANE_POST_CSC_GAMC_DATA_ENH(pipe, plane, 0),
|
||||
lut_val);
|
||||
}
|
||||
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user