Lines Matching refs:cmap

516 	ret = fb_alloc_cmap(&info->cmap, 256, 0);  in drm_fb_helper_alloc_info()
549 if (info->cmap.len) in drm_fb_helper_release_info()
550 fb_dealloc_cmap(&info->cmap); in drm_fb_helper_release_info()
802 static int setcmap_pseudo_palette(struct fb_cmap *cmap, struct fb_info *info) in setcmap_pseudo_palette() argument
807 if (cmap->start + cmap->len > 16) in setcmap_pseudo_palette()
810 for (i = 0; i < cmap->len; ++i) { in setcmap_pseudo_palette()
811 u16 red = cmap->red[i]; in setcmap_pseudo_palette()
812 u16 green = cmap->green[i]; in setcmap_pseudo_palette()
813 u16 blue = cmap->blue[i]; in setcmap_pseudo_palette()
828 palette[cmap->start + i] = value; in setcmap_pseudo_palette()
834 static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) in setcmap_legacy() argument
850 if (cmap->start + cmap->len > crtc->gamma_size) { in setcmap_legacy()
859 memcpy(r + cmap->start, cmap->red, cmap->len * sizeof(*r)); in setcmap_legacy()
860 memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(*g)); in setcmap_legacy()
861 memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(*b)); in setcmap_legacy()
875 struct fb_cmap *cmap) in setcmap_new_gamma_lut() argument
883 if (!size || cmap->start + cmap->len > size) in setcmap_new_gamma_lut()
891 if (cmap->start || cmap->len != size) { in setcmap_new_gamma_lut()
896 for (i = 0; i < cmap->start; i++) { in setcmap_new_gamma_lut()
901 for (i = cmap->start + cmap->len; i < size; i++) { in setcmap_new_gamma_lut()
908 for (i = 0; i < cmap->len; i++) { in setcmap_new_gamma_lut()
909 lut[cmap->start + i].red = cmap->red[i]; in setcmap_new_gamma_lut()
910 lut[cmap->start + i].green = cmap->green[i]; in setcmap_new_gamma_lut()
911 lut[cmap->start + i].blue = cmap->blue[i]; in setcmap_new_gamma_lut()
917 static int setcmap_atomic(struct fb_cmap *cmap, struct fb_info *info) in setcmap_atomic() argument
945 gamma_lut = setcmap_new_gamma_lut(crtc, cmap); in setcmap_atomic()
982 memcpy(r + cmap->start, cmap->red, cmap->len * sizeof(*r)); in setcmap_atomic()
983 memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(*g)); in setcmap_atomic()
984 memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(*b)); in setcmap_atomic()
1010 int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) in drm_fb_helper_setcmap() argument
1028 ret = setcmap_pseudo_palette(cmap, info); in drm_fb_helper_setcmap()
1030 ret = setcmap_atomic(cmap, info); in drm_fb_helper_setcmap()
1032 ret = setcmap_legacy(cmap, info); in drm_fb_helper_setcmap()