xref: /openbmc/linux/drivers/video/fbdev/core/fbcmap.c (revision 19ab2339)
119757fc8STomi Valkeinen /*
219757fc8STomi Valkeinen  *  linux/drivers/video/fbcmap.c -- Colormap handling for frame buffer devices
319757fc8STomi Valkeinen  *
419757fc8STomi Valkeinen  *	Created 15 Jun 1997 by Geert Uytterhoeven
519757fc8STomi Valkeinen  *
619757fc8STomi Valkeinen  *	2001 - Documented with DocBook
719757fc8STomi Valkeinen  *	- Brad Douglas <brad@neruo.com>
819757fc8STomi Valkeinen  *
919757fc8STomi Valkeinen  *  This file is subject to the terms and conditions of the GNU General Public
1019757fc8STomi Valkeinen  *  License.  See the file COPYING in the main directory of this archive for
1119757fc8STomi Valkeinen  *  more details.
1219757fc8STomi Valkeinen  */
1319757fc8STomi Valkeinen 
1419757fc8STomi Valkeinen #include <linux/string.h>
1519757fc8STomi Valkeinen #include <linux/module.h>
1619757fc8STomi Valkeinen #include <linux/fb.h>
1719757fc8STomi Valkeinen #include <linux/slab.h>
1819757fc8STomi Valkeinen #include <linux/uaccess.h>
1919757fc8STomi Valkeinen 
2019757fc8STomi Valkeinen static u16 red2[] __read_mostly = {
2119757fc8STomi Valkeinen     0x0000, 0xaaaa
2219757fc8STomi Valkeinen };
2319757fc8STomi Valkeinen static u16 green2[] __read_mostly = {
2419757fc8STomi Valkeinen     0x0000, 0xaaaa
2519757fc8STomi Valkeinen };
2619757fc8STomi Valkeinen static u16 blue2[] __read_mostly = {
2719757fc8STomi Valkeinen     0x0000, 0xaaaa
2819757fc8STomi Valkeinen };
2919757fc8STomi Valkeinen 
3019757fc8STomi Valkeinen static u16 red4[] __read_mostly = {
3119757fc8STomi Valkeinen     0x0000, 0xaaaa, 0x5555, 0xffff
3219757fc8STomi Valkeinen };
3319757fc8STomi Valkeinen static u16 green4[] __read_mostly = {
3419757fc8STomi Valkeinen     0x0000, 0xaaaa, 0x5555, 0xffff
3519757fc8STomi Valkeinen };
3619757fc8STomi Valkeinen static u16 blue4[] __read_mostly = {
3719757fc8STomi Valkeinen     0x0000, 0xaaaa, 0x5555, 0xffff
3819757fc8STomi Valkeinen };
3919757fc8STomi Valkeinen 
4019757fc8STomi Valkeinen static u16 red8[] __read_mostly = {
4119757fc8STomi Valkeinen     0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa
4219757fc8STomi Valkeinen };
4319757fc8STomi Valkeinen static u16 green8[] __read_mostly = {
4419757fc8STomi Valkeinen     0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa
4519757fc8STomi Valkeinen };
4619757fc8STomi Valkeinen static u16 blue8[] __read_mostly = {
4719757fc8STomi Valkeinen     0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa
4819757fc8STomi Valkeinen };
4919757fc8STomi Valkeinen 
5019757fc8STomi Valkeinen static u16 red16[] __read_mostly = {
5119757fc8STomi Valkeinen     0x0000, 0x0000, 0x0000, 0x0000, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa,
5219757fc8STomi Valkeinen     0x5555, 0x5555, 0x5555, 0x5555, 0xffff, 0xffff, 0xffff, 0xffff
5319757fc8STomi Valkeinen };
5419757fc8STomi Valkeinen static u16 green16[] __read_mostly = {
5519757fc8STomi Valkeinen     0x0000, 0x0000, 0xaaaa, 0xaaaa, 0x0000, 0x0000, 0x5555, 0xaaaa,
5619757fc8STomi Valkeinen     0x5555, 0x5555, 0xffff, 0xffff, 0x5555, 0x5555, 0xffff, 0xffff
5719757fc8STomi Valkeinen };
5819757fc8STomi Valkeinen static u16 blue16[] __read_mostly = {
5919757fc8STomi Valkeinen     0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa, 0x0000, 0xaaaa,
6019757fc8STomi Valkeinen     0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff, 0x5555, 0xffff
6119757fc8STomi Valkeinen };
6219757fc8STomi Valkeinen 
6319757fc8STomi Valkeinen static const struct fb_cmap default_2_colors = {
6419757fc8STomi Valkeinen     .len=2, .red=red2, .green=green2, .blue=blue2
6519757fc8STomi Valkeinen };
6619757fc8STomi Valkeinen static const struct fb_cmap default_8_colors = {
6719757fc8STomi Valkeinen     .len=8, .red=red8, .green=green8, .blue=blue8
6819757fc8STomi Valkeinen };
6919757fc8STomi Valkeinen static const struct fb_cmap default_4_colors = {
7019757fc8STomi Valkeinen     .len=4, .red=red4, .green=green4, .blue=blue4
7119757fc8STomi Valkeinen };
7219757fc8STomi Valkeinen static const struct fb_cmap default_16_colors = {
7319757fc8STomi Valkeinen     .len=16, .red=red16, .green=green16, .blue=blue16
7419757fc8STomi Valkeinen };
7519757fc8STomi Valkeinen 
7619757fc8STomi Valkeinen 
7719757fc8STomi Valkeinen 
7819757fc8STomi Valkeinen /**
79250fe9a5SMauro Carvalho Chehab  *	fb_alloc_cmap_gfp - allocate a colormap
8019757fc8STomi Valkeinen  *	@cmap: frame buffer colormap structure
8119757fc8STomi Valkeinen  *	@len: length of @cmap
8219757fc8STomi Valkeinen  *	@transp: boolean, 1 if there is transparency, 0 otherwise
8319757fc8STomi Valkeinen  *	@flags: flags for kmalloc memory allocation
8419757fc8STomi Valkeinen  *
8519757fc8STomi Valkeinen  *	Allocates memory for a colormap @cmap.  @len is the
8619757fc8STomi Valkeinen  *	number of entries in the palette.
8719757fc8STomi Valkeinen  *
8819757fc8STomi Valkeinen  *	Returns negative errno on error, or zero on success.
8919757fc8STomi Valkeinen  *
9019757fc8STomi Valkeinen  */
9119757fc8STomi Valkeinen 
fb_alloc_cmap_gfp(struct fb_cmap * cmap,int len,int transp,gfp_t flags)9219757fc8STomi Valkeinen int fb_alloc_cmap_gfp(struct fb_cmap *cmap, int len, int transp, gfp_t flags)
9319757fc8STomi Valkeinen {
9419757fc8STomi Valkeinen 	int size = len * sizeof(u16);
9519757fc8STomi Valkeinen 	int ret = -ENOMEM;
9619757fc8STomi Valkeinen 
978c40292bSJiufei Xue 	flags |= __GFP_NOWARN;
988c40292bSJiufei Xue 
9919757fc8STomi Valkeinen 	if (cmap->len != len) {
10019757fc8STomi Valkeinen 		fb_dealloc_cmap(cmap);
10119757fc8STomi Valkeinen 		if (!len)
10219757fc8STomi Valkeinen 			return 0;
10319757fc8STomi Valkeinen 
104*19ab2339SPhillip Potter 		cmap->red = kzalloc(size, flags);
10519757fc8STomi Valkeinen 		if (!cmap->red)
10619757fc8STomi Valkeinen 			goto fail;
107*19ab2339SPhillip Potter 		cmap->green = kzalloc(size, flags);
10819757fc8STomi Valkeinen 		if (!cmap->green)
10919757fc8STomi Valkeinen 			goto fail;
110*19ab2339SPhillip Potter 		cmap->blue = kzalloc(size, flags);
11119757fc8STomi Valkeinen 		if (!cmap->blue)
11219757fc8STomi Valkeinen 			goto fail;
11319757fc8STomi Valkeinen 		if (transp) {
114*19ab2339SPhillip Potter 			cmap->transp = kzalloc(size, flags);
11519757fc8STomi Valkeinen 			if (!cmap->transp)
11619757fc8STomi Valkeinen 				goto fail;
11719757fc8STomi Valkeinen 		} else {
11819757fc8STomi Valkeinen 			cmap->transp = NULL;
11919757fc8STomi Valkeinen 		}
12019757fc8STomi Valkeinen 	}
12119757fc8STomi Valkeinen 	cmap->start = 0;
12219757fc8STomi Valkeinen 	cmap->len = len;
12319757fc8STomi Valkeinen 	ret = fb_copy_cmap(fb_default_cmap(len), cmap);
12419757fc8STomi Valkeinen 	if (ret)
12519757fc8STomi Valkeinen 		goto fail;
12619757fc8STomi Valkeinen 	return 0;
12719757fc8STomi Valkeinen 
12819757fc8STomi Valkeinen fail:
12919757fc8STomi Valkeinen 	fb_dealloc_cmap(cmap);
13019757fc8STomi Valkeinen 	return ret;
13119757fc8STomi Valkeinen }
13219757fc8STomi Valkeinen 
fb_alloc_cmap(struct fb_cmap * cmap,int len,int transp)13319757fc8STomi Valkeinen int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp)
13419757fc8STomi Valkeinen {
13519757fc8STomi Valkeinen 	return fb_alloc_cmap_gfp(cmap, len, transp, GFP_ATOMIC);
13619757fc8STomi Valkeinen }
13719757fc8STomi Valkeinen 
13819757fc8STomi Valkeinen /**
13919757fc8STomi Valkeinen  *      fb_dealloc_cmap - deallocate a colormap
14019757fc8STomi Valkeinen  *      @cmap: frame buffer colormap structure
14119757fc8STomi Valkeinen  *
14219757fc8STomi Valkeinen  *      Deallocates a colormap that was previously allocated with
14319757fc8STomi Valkeinen  *      fb_alloc_cmap().
14419757fc8STomi Valkeinen  *
14519757fc8STomi Valkeinen  */
14619757fc8STomi Valkeinen 
fb_dealloc_cmap(struct fb_cmap * cmap)14719757fc8STomi Valkeinen void fb_dealloc_cmap(struct fb_cmap *cmap)
14819757fc8STomi Valkeinen {
14919757fc8STomi Valkeinen 	kfree(cmap->red);
15019757fc8STomi Valkeinen 	kfree(cmap->green);
15119757fc8STomi Valkeinen 	kfree(cmap->blue);
15219757fc8STomi Valkeinen 	kfree(cmap->transp);
15319757fc8STomi Valkeinen 
15419757fc8STomi Valkeinen 	cmap->red = cmap->green = cmap->blue = cmap->transp = NULL;
15519757fc8STomi Valkeinen 	cmap->len = 0;
15619757fc8STomi Valkeinen }
15719757fc8STomi Valkeinen 
15819757fc8STomi Valkeinen /**
15919757fc8STomi Valkeinen  *	fb_copy_cmap - copy a colormap
16019757fc8STomi Valkeinen  *	@from: frame buffer colormap structure
16119757fc8STomi Valkeinen  *	@to: frame buffer colormap structure
16219757fc8STomi Valkeinen  *
16319757fc8STomi Valkeinen  *	Copy contents of colormap from @from to @to.
16419757fc8STomi Valkeinen  */
16519757fc8STomi Valkeinen 
fb_copy_cmap(const struct fb_cmap * from,struct fb_cmap * to)16619757fc8STomi Valkeinen int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to)
16719757fc8STomi Valkeinen {
1682dc705a9SKees Cook 	unsigned int tooff = 0, fromoff = 0;
1692dc705a9SKees Cook 	size_t size;
17019757fc8STomi Valkeinen 
17119757fc8STomi Valkeinen 	if (to->start > from->start)
17219757fc8STomi Valkeinen 		fromoff = to->start - from->start;
17319757fc8STomi Valkeinen 	else
17419757fc8STomi Valkeinen 		tooff = from->start - to->start;
1752dc705a9SKees Cook 	if (fromoff >= from->len || tooff >= to->len)
1762dc705a9SKees Cook 		return -EINVAL;
1772dc705a9SKees Cook 
1782dc705a9SKees Cook 	size = min_t(size_t, to->len - tooff, from->len - fromoff);
1792dc705a9SKees Cook 	if (size == 0)
18019757fc8STomi Valkeinen 		return -EINVAL;
18119757fc8STomi Valkeinen 	size *= sizeof(u16);
18219757fc8STomi Valkeinen 
18319757fc8STomi Valkeinen 	memcpy(to->red+tooff, from->red+fromoff, size);
18419757fc8STomi Valkeinen 	memcpy(to->green+tooff, from->green+fromoff, size);
18519757fc8STomi Valkeinen 	memcpy(to->blue+tooff, from->blue+fromoff, size);
18619757fc8STomi Valkeinen 	if (from->transp && to->transp)
18719757fc8STomi Valkeinen 		memcpy(to->transp+tooff, from->transp+fromoff, size);
18819757fc8STomi Valkeinen 	return 0;
18919757fc8STomi Valkeinen }
19019757fc8STomi Valkeinen 
fb_cmap_to_user(const struct fb_cmap * from,struct fb_cmap_user * to)19119757fc8STomi Valkeinen int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to)
19219757fc8STomi Valkeinen {
1932dc705a9SKees Cook 	unsigned int tooff = 0, fromoff = 0;
1942dc705a9SKees Cook 	size_t size;
19519757fc8STomi Valkeinen 
19619757fc8STomi Valkeinen 	if (to->start > from->start)
19719757fc8STomi Valkeinen 		fromoff = to->start - from->start;
19819757fc8STomi Valkeinen 	else
19919757fc8STomi Valkeinen 		tooff = from->start - to->start;
2002dc705a9SKees Cook 	if (fromoff >= from->len || tooff >= to->len)
2012dc705a9SKees Cook 		return -EINVAL;
2022dc705a9SKees Cook 
2032dc705a9SKees Cook 	size = min_t(size_t, to->len - tooff, from->len - fromoff);
2042dc705a9SKees Cook 	if (size == 0)
20519757fc8STomi Valkeinen 		return -EINVAL;
20619757fc8STomi Valkeinen 	size *= sizeof(u16);
20719757fc8STomi Valkeinen 
20819757fc8STomi Valkeinen 	if (copy_to_user(to->red+tooff, from->red+fromoff, size))
20919757fc8STomi Valkeinen 		return -EFAULT;
21019757fc8STomi Valkeinen 	if (copy_to_user(to->green+tooff, from->green+fromoff, size))
21119757fc8STomi Valkeinen 		return -EFAULT;
21219757fc8STomi Valkeinen 	if (copy_to_user(to->blue+tooff, from->blue+fromoff, size))
21319757fc8STomi Valkeinen 		return -EFAULT;
21419757fc8STomi Valkeinen 	if (from->transp && to->transp)
21519757fc8STomi Valkeinen 		if (copy_to_user(to->transp+tooff, from->transp+fromoff, size))
21619757fc8STomi Valkeinen 			return -EFAULT;
21719757fc8STomi Valkeinen 	return 0;
21819757fc8STomi Valkeinen }
21919757fc8STomi Valkeinen 
22019757fc8STomi Valkeinen /**
22119757fc8STomi Valkeinen  *	fb_set_cmap - set the colormap
22219757fc8STomi Valkeinen  *	@cmap: frame buffer colormap structure
22319757fc8STomi Valkeinen  *	@info: frame buffer info structure
22419757fc8STomi Valkeinen  *
22519757fc8STomi Valkeinen  *	Sets the colormap @cmap for a screen of device @info.
22619757fc8STomi Valkeinen  *
22719757fc8STomi Valkeinen  *	Returns negative errno on error, or zero on success.
22819757fc8STomi Valkeinen  *
22919757fc8STomi Valkeinen  */
23019757fc8STomi Valkeinen 
fb_set_cmap(struct fb_cmap * cmap,struct fb_info * info)23119757fc8STomi Valkeinen int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *info)
23219757fc8STomi Valkeinen {
23319757fc8STomi Valkeinen 	int i, start, rc = 0;
23419757fc8STomi Valkeinen 	u16 *red, *green, *blue, *transp;
23519757fc8STomi Valkeinen 	u_int hred, hgreen, hblue, htransp = 0xffff;
23619757fc8STomi Valkeinen 
23719757fc8STomi Valkeinen 	red = cmap->red;
23819757fc8STomi Valkeinen 	green = cmap->green;
23919757fc8STomi Valkeinen 	blue = cmap->blue;
24019757fc8STomi Valkeinen 	transp = cmap->transp;
24119757fc8STomi Valkeinen 	start = cmap->start;
24219757fc8STomi Valkeinen 
24319757fc8STomi Valkeinen 	if (start < 0 || (!info->fbops->fb_setcolreg &&
24419757fc8STomi Valkeinen 			  !info->fbops->fb_setcmap))
24519757fc8STomi Valkeinen 		return -EINVAL;
24619757fc8STomi Valkeinen 	if (info->fbops->fb_setcmap) {
24719757fc8STomi Valkeinen 		rc = info->fbops->fb_setcmap(cmap, info);
24819757fc8STomi Valkeinen 	} else {
24919757fc8STomi Valkeinen 		for (i = 0; i < cmap->len; i++) {
25019757fc8STomi Valkeinen 			hred = *red++;
25119757fc8STomi Valkeinen 			hgreen = *green++;
25219757fc8STomi Valkeinen 			hblue = *blue++;
25319757fc8STomi Valkeinen 			if (transp)
25419757fc8STomi Valkeinen 				htransp = *transp++;
25519757fc8STomi Valkeinen 			if (info->fbops->fb_setcolreg(start++,
25619757fc8STomi Valkeinen 						      hred, hgreen, hblue,
25719757fc8STomi Valkeinen 						      htransp, info))
25819757fc8STomi Valkeinen 				break;
25919757fc8STomi Valkeinen 		}
26019757fc8STomi Valkeinen 	}
26119757fc8STomi Valkeinen 	if (rc == 0)
26219757fc8STomi Valkeinen 		fb_copy_cmap(cmap, &info->cmap);
26319757fc8STomi Valkeinen 
26419757fc8STomi Valkeinen 	return rc;
26519757fc8STomi Valkeinen }
26619757fc8STomi Valkeinen 
fb_set_user_cmap(struct fb_cmap_user * cmap,struct fb_info * info)26719757fc8STomi Valkeinen int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info)
26819757fc8STomi Valkeinen {
26919757fc8STomi Valkeinen 	int rc, size = cmap->len * sizeof(u16);
27019757fc8STomi Valkeinen 	struct fb_cmap umap;
27119757fc8STomi Valkeinen 
27219757fc8STomi Valkeinen 	if (size < 0 || size < cmap->len)
27319757fc8STomi Valkeinen 		return -E2BIG;
27419757fc8STomi Valkeinen 
27519757fc8STomi Valkeinen 	memset(&umap, 0, sizeof(struct fb_cmap));
27619757fc8STomi Valkeinen 	rc = fb_alloc_cmap_gfp(&umap, cmap->len, cmap->transp != NULL,
27719757fc8STomi Valkeinen 				GFP_KERNEL);
27819757fc8STomi Valkeinen 	if (rc)
27919757fc8STomi Valkeinen 		return rc;
28019757fc8STomi Valkeinen 	if (copy_from_user(umap.red, cmap->red, size) ||
28119757fc8STomi Valkeinen 	    copy_from_user(umap.green, cmap->green, size) ||
28219757fc8STomi Valkeinen 	    copy_from_user(umap.blue, cmap->blue, size) ||
28319757fc8STomi Valkeinen 	    (cmap->transp && copy_from_user(umap.transp, cmap->transp, size))) {
28419757fc8STomi Valkeinen 		rc = -EFAULT;
28519757fc8STomi Valkeinen 		goto out;
28619757fc8STomi Valkeinen 	}
28719757fc8STomi Valkeinen 	umap.start = cmap->start;
288cf4a3ae4SDaniel Vetter 	lock_fb_info(info);
28919757fc8STomi Valkeinen 	rc = fb_set_cmap(&umap, info);
29019757fc8STomi Valkeinen 	unlock_fb_info(info);
29119757fc8STomi Valkeinen out:
29219757fc8STomi Valkeinen 	fb_dealloc_cmap(&umap);
29319757fc8STomi Valkeinen 	return rc;
29419757fc8STomi Valkeinen }
29519757fc8STomi Valkeinen 
29619757fc8STomi Valkeinen /**
29719757fc8STomi Valkeinen  *	fb_default_cmap - get default colormap
29819757fc8STomi Valkeinen  *	@len: size of palette for a depth
29919757fc8STomi Valkeinen  *
30019757fc8STomi Valkeinen  *	Gets the default colormap for a specific screen depth.  @len
30119757fc8STomi Valkeinen  *	is the size of the palette for a particular screen depth.
30219757fc8STomi Valkeinen  *
30319757fc8STomi Valkeinen  *	Returns pointer to a frame buffer colormap structure.
30419757fc8STomi Valkeinen  *
30519757fc8STomi Valkeinen  */
30619757fc8STomi Valkeinen 
fb_default_cmap(int len)30719757fc8STomi Valkeinen const struct fb_cmap *fb_default_cmap(int len)
30819757fc8STomi Valkeinen {
30919757fc8STomi Valkeinen     if (len <= 2)
31019757fc8STomi Valkeinen 	return &default_2_colors;
31119757fc8STomi Valkeinen     if (len <= 4)
31219757fc8STomi Valkeinen 	return &default_4_colors;
31319757fc8STomi Valkeinen     if (len <= 8)
31419757fc8STomi Valkeinen 	return &default_8_colors;
31519757fc8STomi Valkeinen     return &default_16_colors;
31619757fc8STomi Valkeinen }
31719757fc8STomi Valkeinen 
31819757fc8STomi Valkeinen 
31919757fc8STomi Valkeinen /**
32019757fc8STomi Valkeinen  *	fb_invert_cmaps - invert all defaults colormaps
32119757fc8STomi Valkeinen  *
32219757fc8STomi Valkeinen  *	Invert all default colormaps.
32319757fc8STomi Valkeinen  *
32419757fc8STomi Valkeinen  */
32519757fc8STomi Valkeinen 
fb_invert_cmaps(void)32619757fc8STomi Valkeinen void fb_invert_cmaps(void)
32719757fc8STomi Valkeinen {
32819757fc8STomi Valkeinen     u_int i;
32919757fc8STomi Valkeinen 
33019757fc8STomi Valkeinen     for (i = 0; i < ARRAY_SIZE(red2); i++) {
33119757fc8STomi Valkeinen 	red2[i] = ~red2[i];
33219757fc8STomi Valkeinen 	green2[i] = ~green2[i];
33319757fc8STomi Valkeinen 	blue2[i] = ~blue2[i];
33419757fc8STomi Valkeinen     }
33519757fc8STomi Valkeinen     for (i = 0; i < ARRAY_SIZE(red4); i++) {
33619757fc8STomi Valkeinen 	red4[i] = ~red4[i];
33719757fc8STomi Valkeinen 	green4[i] = ~green4[i];
33819757fc8STomi Valkeinen 	blue4[i] = ~blue4[i];
33919757fc8STomi Valkeinen     }
34019757fc8STomi Valkeinen     for (i = 0; i < ARRAY_SIZE(red8); i++) {
34119757fc8STomi Valkeinen 	red8[i] = ~red8[i];
34219757fc8STomi Valkeinen 	green8[i] = ~green8[i];
34319757fc8STomi Valkeinen 	blue8[i] = ~blue8[i];
34419757fc8STomi Valkeinen     }
34519757fc8STomi Valkeinen     for (i = 0; i < ARRAY_SIZE(red16); i++) {
34619757fc8STomi Valkeinen 	red16[i] = ~red16[i];
34719757fc8STomi Valkeinen 	green16[i] = ~green16[i];
34819757fc8STomi Valkeinen 	blue16[i] = ~blue16[i];
34919757fc8STomi Valkeinen     }
35019757fc8STomi Valkeinen }
35119757fc8STomi Valkeinen 
35219757fc8STomi Valkeinen 
35319757fc8STomi Valkeinen     /*
35419757fc8STomi Valkeinen      *  Visible symbols for modules
35519757fc8STomi Valkeinen      */
35619757fc8STomi Valkeinen 
35719757fc8STomi Valkeinen EXPORT_SYMBOL(fb_alloc_cmap);
35819757fc8STomi Valkeinen EXPORT_SYMBOL(fb_dealloc_cmap);
35919757fc8STomi Valkeinen EXPORT_SYMBOL(fb_copy_cmap);
36019757fc8STomi Valkeinen EXPORT_SYMBOL(fb_set_cmap);
36119757fc8STomi Valkeinen EXPORT_SYMBOL(fb_default_cmap);
36219757fc8STomi Valkeinen EXPORT_SYMBOL(fb_invert_cmaps);
363