114,6 → 114,9 |
uint16_t *r_base, *g_base, *b_base; |
int i; |
|
if (helper->funcs->gamma_get == NULL) |
return; |
|
r_base = crtc->gamma_store; |
g_base = r_base + crtc->gamma_size; |
b_base = g_base + crtc->gamma_size; |
337,6 → 340,14 |
return 0; |
} |
|
/* |
* The driver really shouldn't advertise pseudo/directcolor |
* visuals if it can't deal with the palette. |
*/ |
if (WARN_ON(!fb_helper->funcs->gamma_set || |
!fb_helper->funcs->gamma_get)) |
return -EINVAL; |
|
pindex = regno; |
|
if (fb->bits_per_pixel == 16) { |
380,6 → 391,7 |
int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) |
{ |
struct drm_fb_helper *fb_helper = info->par; |
struct drm_device *dev = fb_helper->dev; |
struct drm_crtc_helper_funcs *crtc_funcs; |
u16 *red, *green, *blue, *transp; |
struct drm_crtc *crtc; |
386,6 → 398,12 |
int i, j, rc = 0; |
int start; |
|
drm_modeset_lock_all(dev); |
if (!drm_fb_helper_is_bound(fb_helper)) { |
drm_modeset_unlock_all(dev); |
return -EBUSY; |
} |
|
for (i = 0; i < fb_helper->crtc_count; i++) { |
crtc = fb_helper->crtc_info[i].mode_set.crtc; |
crtc_funcs = crtc->helper_private; |
408,10 → 426,13 |
|
rc = setcolreg(crtc, hred, hgreen, hblue, start++, info); |
if (rc) |
return rc; |
goto out; |
} |
if (crtc_funcs->load_lut) |
crtc_funcs->load_lut(crtc); |
} |
out: |
drm_modeset_unlock_all(dev); |
return rc; |
} |
EXPORT_SYMBOL(drm_fb_helper_setcmap); |