Lines Matching refs:cmap

92 int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags)  in fb_alloc_cmap_gfp()  argument
99 if (cmap->len != len) { in fb_alloc_cmap_gfp()
100 fb_dealloc_cmap(cmap); in fb_alloc_cmap_gfp()
104 cmap->red = kzalloc(size, flags); in fb_alloc_cmap_gfp()
105 if (!cmap->red) in fb_alloc_cmap_gfp()
107 cmap->green = kzalloc(size, flags); in fb_alloc_cmap_gfp()
108 if (!cmap->green) in fb_alloc_cmap_gfp()
110 cmap->blue = kzalloc(size, flags); in fb_alloc_cmap_gfp()
111 if (!cmap->blue) in fb_alloc_cmap_gfp()
114 cmap->transp = kzalloc(size, flags); in fb_alloc_cmap_gfp()
115 if (!cmap->transp) in fb_alloc_cmap_gfp()
118 cmap->transp = NULL; in fb_alloc_cmap_gfp()
121 cmap->start = 0; in fb_alloc_cmap_gfp()
122 cmap->len = len; in fb_alloc_cmap_gfp()
123 ret = fb_copy_cmap(fb_default_cmap(len), cmap); in fb_alloc_cmap_gfp()
129 fb_dealloc_cmap(cmap); in fb_alloc_cmap_gfp()
133 int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp) in fb_alloc_cmap() argument
135 return fb_alloc_cmap_gfp(cmap, len, transp, GFP_ATOMIC); in fb_alloc_cmap()
147 void fb_dealloc_cmap(struct fb_cmap *cmap) in fb_dealloc_cmap() argument
149 kfree(cmap->red); in fb_dealloc_cmap()
150 kfree(cmap->green); in fb_dealloc_cmap()
151 kfree(cmap->blue); in fb_dealloc_cmap()
152 kfree(cmap->transp); in fb_dealloc_cmap()
154 cmap->red = cmap->green = cmap->blue = cmap->transp = NULL; in fb_dealloc_cmap()
155 cmap->len = 0; in fb_dealloc_cmap()
231 int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *info) in fb_set_cmap() argument
237 red = cmap->red; in fb_set_cmap()
238 green = cmap->green; in fb_set_cmap()
239 blue = cmap->blue; in fb_set_cmap()
240 transp = cmap->transp; in fb_set_cmap()
241 start = cmap->start; in fb_set_cmap()
247 rc = info->fbops->fb_setcmap(cmap, info); in fb_set_cmap()
249 for (i = 0; i < cmap->len; i++) { in fb_set_cmap()
262 fb_copy_cmap(cmap, &info->cmap); in fb_set_cmap()
267 int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info) in fb_set_user_cmap() argument
269 int rc, size = cmap->len * sizeof(u16); in fb_set_user_cmap()
272 if (size < 0 || size < cmap->len) in fb_set_user_cmap()
276 rc = fb_alloc_cmap_gfp(&umap, cmap->len, cmap->transp != NULL, in fb_set_user_cmap()
280 if (copy_from_user(umap.red, cmap->red, size) || in fb_set_user_cmap()
281 copy_from_user(umap.green, cmap->green, size) || in fb_set_user_cmap()
282 copy_from_user(umap.blue, cmap->blue, size) || in fb_set_user_cmap()
283 (cmap->transp && copy_from_user(umap.transp, cmap->transp, size))) { in fb_set_user_cmap()
287 umap.start = cmap->start; in fb_set_user_cmap()