Lines Matching refs:cmap
526 ret = fb_alloc_cmap(&info->cmap, 256, 0); in drm_fb_helper_alloc_info()
579 if (info->cmap.len) in drm_fb_helper_fini()
580 fb_dealloc_cmap(&info->cmap); in drm_fb_helper_fini()
1131 static int setcmap_pseudo_palette(struct fb_cmap *cmap, struct fb_info *info) in setcmap_pseudo_palette() argument
1136 if (cmap->start + cmap->len > 16) in setcmap_pseudo_palette()
1139 for (i = 0; i < cmap->len; ++i) { in setcmap_pseudo_palette()
1140 u16 red = cmap->red[i]; in setcmap_pseudo_palette()
1141 u16 green = cmap->green[i]; in setcmap_pseudo_palette()
1142 u16 blue = cmap->blue[i]; in setcmap_pseudo_palette()
1157 palette[cmap->start + i] = value; in setcmap_pseudo_palette()
1163 static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) in setcmap_legacy() argument
1179 if (cmap->start + cmap->len > crtc->gamma_size) { in setcmap_legacy()
1188 memcpy(r + cmap->start, cmap->red, cmap->len * sizeof(*r)); in setcmap_legacy()
1189 memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(*g)); in setcmap_legacy()
1190 memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(*b)); in setcmap_legacy()
1204 struct fb_cmap *cmap) in setcmap_new_gamma_lut() argument
1212 if (!size || cmap->start + cmap->len > size) in setcmap_new_gamma_lut()
1220 if (cmap->start || cmap->len != size) { in setcmap_new_gamma_lut()
1225 for (i = 0; i < cmap->start; i++) { in setcmap_new_gamma_lut()
1230 for (i = cmap->start + cmap->len; i < size; i++) { in setcmap_new_gamma_lut()
1237 for (i = 0; i < cmap->len; i++) { in setcmap_new_gamma_lut()
1238 lut[cmap->start + i].red = cmap->red[i]; in setcmap_new_gamma_lut()
1239 lut[cmap->start + i].green = cmap->green[i]; in setcmap_new_gamma_lut()
1240 lut[cmap->start + i].blue = cmap->blue[i]; in setcmap_new_gamma_lut()
1246 static int setcmap_atomic(struct fb_cmap *cmap, struct fb_info *info) in setcmap_atomic() argument
1274 gamma_lut = setcmap_new_gamma_lut(crtc, cmap); in setcmap_atomic()
1311 memcpy(r + cmap->start, cmap->red, cmap->len * sizeof(*r)); in setcmap_atomic()
1312 memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(*g)); in setcmap_atomic()
1313 memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(*b)); in setcmap_atomic()
1339 int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) in drm_fb_helper_setcmap() argument
1357 ret = setcmap_pseudo_palette(cmap, info); in drm_fb_helper_setcmap()
1359 ret = setcmap_atomic(cmap, info); in drm_fb_helper_setcmap()
1361 ret = setcmap_legacy(cmap, info); in drm_fb_helper_setcmap()