|
@@ -5139,6 +5139,9 @@ EXPORT_SYMBOL(drm_mode_connector_attach_encoder);
|
|
|
int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
|
|
|
int gamma_size)
|
|
|
{
|
|
|
+ uint16_t *r_base, *g_base, *b_base;
|
|
|
+ int i;
|
|
|
+
|
|
|
crtc->gamma_size = gamma_size;
|
|
|
|
|
|
crtc->gamma_store = kcalloc(gamma_size, sizeof(uint16_t) * 3,
|
|
@@ -5148,6 +5151,16 @@ int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
|
|
|
+ r_base = crtc->gamma_store;
|
|
|
+ g_base = r_base + gamma_size;
|
|
|
+ b_base = g_base + gamma_size;
|
|
|
+ for (i = 0; i < gamma_size; i++) {
|
|
|
+ r_base[i] = i << 8;
|
|
|
+ g_base[i] = i << 8;
|
|
|
+ b_base[i] = i << 8;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
EXPORT_SYMBOL(drm_mode_crtc_set_gamma_size);
|