Lines Matching full:lut
35 /* For 10 bit LUT layout, R/G/B are in the same register */
40 /* For 12 bit LUT layout, R/G are in LUT, B is in LUT1 */
90 static bool mtk_gamma_lut_is_descending(struct drm_color_lut *lut, u32 lut_size) in mtk_gamma_lut_is_descending() argument
95 first = lut[0].red + lut[0].green + lut[0].blue; in mtk_gamma_lut_is_descending()
96 last = lut[last_entry].red + lut[last_entry].green + lut[last_entry].blue; in mtk_gamma_lut_is_descending()
103 * always support (by HW) both 12-bits and 10-bits LUT but, on those, we
107 * - SoC HW support 9/10-bits LUT only
109 * - 10-bits LUT supported
110 * - 9-bits LUT not supported
111 * - SoC HW support both 10/12bits LUT
113 * - 12-bits LUT supported
114 * - 10-its LUT not supported
124 struct drm_color_lut *lut; in mtk_gamma_set() local
127 /* If there's no gamma lut there's nothing to do here. */ in mtk_gamma_set()
132 lut = (struct drm_color_lut *)state->gamma_lut->data; in mtk_gamma_set()
139 /* Switch gamma bank and set data mode before writing LUT */ in mtk_gamma_set()
150 hwlut.red = drm_color_lut_extract(lut[n].red, lut_bits); in mtk_gamma_set()
151 hwlut.green = drm_color_lut_extract(lut[n].green, lut_bits); in mtk_gamma_set()
152 hwlut.blue = drm_color_lut_extract(lut[n].blue, lut_bits); in mtk_gamma_set()
165 diff.red = lut[n].red - lut[n - 1].red; in mtk_gamma_set()
168 diff.green = lut[n].green - lut[n - 1].green; in mtk_gamma_set()
171 diff.blue = lut[n].blue - lut[n - 1].blue; in mtk_gamma_set()
193 /* Descending or Rising LUT */ in mtk_gamma_set()
194 if (mtk_gamma_lut_is_descending(lut, gamma->data->lut_size - 1)) in mtk_gamma_set()