fbmem.c 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319
  1. /*
  2. * linux/drivers/video/fbmem.c
  3. *
  4. * Copyright (C) 1994 Martin Schaller
  5. *
  6. * 2001 - Documented with DocBook
  7. * - Brad Douglas <brad@neruo.com>
  8. *
  9. * This file is subject to the terms and conditions of the GNU General Public
  10. * License. See the file COPYING in the main directory of this archive
  11. * for more details.
  12. */
  13. #include <linux/config.h>
  14. #include <linux/module.h>
  15. #include <linux/types.h>
  16. #include <linux/errno.h>
  17. #include <linux/sched.h>
  18. #include <linux/smp_lock.h>
  19. #include <linux/kernel.h>
  20. #include <linux/major.h>
  21. #include <linux/slab.h>
  22. #include <linux/mm.h>
  23. #include <linux/mman.h>
  24. #include <linux/tty.h>
  25. #include <linux/init.h>
  26. #include <linux/linux_logo.h>
  27. #include <linux/proc_fs.h>
  28. #include <linux/console.h>
  29. #ifdef CONFIG_KMOD
  30. #include <linux/kmod.h>
  31. #endif
  32. #include <linux/devfs_fs_kernel.h>
  33. #include <linux/err.h>
  34. #include <linux/kernel.h>
  35. #include <linux/device.h>
  36. #include <linux/efi.h>
  37. #if defined(__mc68000__) || defined(CONFIG_APUS)
  38. #include <asm/setup.h>
  39. #endif
  40. #include <asm/io.h>
  41. #include <asm/uaccess.h>
  42. #include <asm/page.h>
  43. #include <asm/pgtable.h>
  44. #include <linux/fb.h>
  45. /*
  46. * Frame buffer device initialization and setup routines
  47. */
  48. #define FBPIXMAPSIZE (1024 * 8)
  49. static struct notifier_block *fb_notifier_list;
  50. struct fb_info *registered_fb[FB_MAX];
  51. int num_registered_fb;
  52. /*
  53. * Helpers
  54. */
  55. int fb_get_color_depth(struct fb_var_screeninfo *var)
  56. {
  57. if (var->green.length == var->blue.length &&
  58. var->green.length == var->red.length &&
  59. !var->green.offset && !var->blue.offset &&
  60. !var->red.offset)
  61. return var->green.length;
  62. else
  63. return (var->green.length + var->red.length +
  64. var->blue.length);
  65. }
  66. EXPORT_SYMBOL(fb_get_color_depth);
  67. /*
  68. * Data padding functions.
  69. */
  70. void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height)
  71. {
  72. int i;
  73. for (i = height; i--; ) {
  74. memcpy(dst, src, s_pitch);
  75. src += s_pitch;
  76. dst += d_pitch;
  77. }
  78. }
  79. EXPORT_SYMBOL(fb_pad_aligned_buffer);
  80. void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, u32 height,
  81. u32 shift_high, u32 shift_low, u32 mod)
  82. {
  83. u8 mask = (u8) (0xfff << shift_high), tmp;
  84. int i, j;
  85. for (i = height; i--; ) {
  86. for (j = 0; j < idx; j++) {
  87. tmp = dst[j];
  88. tmp &= mask;
  89. tmp |= *src >> shift_low;
  90. dst[j] = tmp;
  91. tmp = *src << shift_high;
  92. dst[j+1] = tmp;
  93. src++;
  94. }
  95. tmp = dst[idx];
  96. tmp &= mask;
  97. tmp |= *src >> shift_low;
  98. dst[idx] = tmp;
  99. if (shift_high < mod) {
  100. tmp = *src << shift_high;
  101. dst[idx+1] = tmp;
  102. }
  103. src++;
  104. dst += d_pitch;
  105. }
  106. }
  107. EXPORT_SYMBOL(fb_pad_unaligned_buffer);
  108. /*
  109. * we need to lock this section since fb_cursor
  110. * may use fb_imageblit()
  111. */
  112. char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size)
  113. {
  114. u32 align = buf->buf_align - 1, offset;
  115. char *addr = buf->addr;
  116. /* If IO mapped, we need to sync before access, no sharing of
  117. * the pixmap is done
  118. */
  119. if (buf->flags & FB_PIXMAP_IO) {
  120. if (info->fbops->fb_sync && (buf->flags & FB_PIXMAP_SYNC))
  121. info->fbops->fb_sync(info);
  122. return addr;
  123. }
  124. /* See if we fit in the remaining pixmap space */
  125. offset = buf->offset + align;
  126. offset &= ~align;
  127. if (offset + size > buf->size) {
  128. /* We do not fit. In order to be able to re-use the buffer,
  129. * we must ensure no asynchronous DMA'ing or whatever operation
  130. * is in progress, we sync for that.
  131. */
  132. if (info->fbops->fb_sync && (buf->flags & FB_PIXMAP_SYNC))
  133. info->fbops->fb_sync(info);
  134. offset = 0;
  135. }
  136. buf->offset = offset + size;
  137. addr += offset;
  138. return addr;
  139. }
  140. #ifdef CONFIG_LOGO
  141. #include <linux/linux_logo.h>
  142. static inline unsigned safe_shift(unsigned d, int n)
  143. {
  144. return n < 0 ? d >> -n : d << n;
  145. }
  146. static void fb_set_logocmap(struct fb_info *info,
  147. const struct linux_logo *logo)
  148. {
  149. struct fb_cmap palette_cmap;
  150. u16 palette_green[16];
  151. u16 palette_blue[16];
  152. u16 palette_red[16];
  153. int i, j, n;
  154. const unsigned char *clut = logo->clut;
  155. palette_cmap.start = 0;
  156. palette_cmap.len = 16;
  157. palette_cmap.red = palette_red;
  158. palette_cmap.green = palette_green;
  159. palette_cmap.blue = palette_blue;
  160. palette_cmap.transp = NULL;
  161. for (i = 0; i < logo->clutsize; i += n) {
  162. n = logo->clutsize - i;
  163. /* palette_cmap provides space for only 16 colors at once */
  164. if (n > 16)
  165. n = 16;
  166. palette_cmap.start = 32 + i;
  167. palette_cmap.len = n;
  168. for (j = 0; j < n; ++j) {
  169. palette_cmap.red[j] = clut[0] << 8 | clut[0];
  170. palette_cmap.green[j] = clut[1] << 8 | clut[1];
  171. palette_cmap.blue[j] = clut[2] << 8 | clut[2];
  172. clut += 3;
  173. }
  174. fb_set_cmap(&palette_cmap, info);
  175. }
  176. }
  177. static void fb_set_logo_truepalette(struct fb_info *info,
  178. const struct linux_logo *logo,
  179. u32 *palette)
  180. {
  181. unsigned char mask[9] = { 0,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff };
  182. unsigned char redmask, greenmask, bluemask;
  183. int redshift, greenshift, blueshift;
  184. int i;
  185. const unsigned char *clut = logo->clut;
  186. /*
  187. * We have to create a temporary palette since console palette is only
  188. * 16 colors long.
  189. */
  190. /* Bug: Doesn't obey msb_right ... (who needs that?) */
  191. redmask = mask[info->var.red.length < 8 ? info->var.red.length : 8];
  192. greenmask = mask[info->var.green.length < 8 ? info->var.green.length : 8];
  193. bluemask = mask[info->var.blue.length < 8 ? info->var.blue.length : 8];
  194. redshift = info->var.red.offset - (8 - info->var.red.length);
  195. greenshift = info->var.green.offset - (8 - info->var.green.length);
  196. blueshift = info->var.blue.offset - (8 - info->var.blue.length);
  197. for ( i = 0; i < logo->clutsize; i++) {
  198. palette[i+32] = (safe_shift((clut[0] & redmask), redshift) |
  199. safe_shift((clut[1] & greenmask), greenshift) |
  200. safe_shift((clut[2] & bluemask), blueshift));
  201. clut += 3;
  202. }
  203. }
  204. static void fb_set_logo_directpalette(struct fb_info *info,
  205. const struct linux_logo *logo,
  206. u32 *palette)
  207. {
  208. int redshift, greenshift, blueshift;
  209. int i;
  210. redshift = info->var.red.offset;
  211. greenshift = info->var.green.offset;
  212. blueshift = info->var.blue.offset;
  213. for (i = 32; i < logo->clutsize; i++)
  214. palette[i] = i << redshift | i << greenshift | i << blueshift;
  215. }
  216. static void fb_set_logo(struct fb_info *info,
  217. const struct linux_logo *logo, u8 *dst,
  218. int depth)
  219. {
  220. int i, j, k, fg = 1;
  221. const u8 *src = logo->data;
  222. u8 d, xor = (info->fix.visual == FB_VISUAL_MONO01) ? 0xff : 0;
  223. if (fb_get_color_depth(&info->var) == 3)
  224. fg = 7;
  225. switch (depth) {
  226. case 4:
  227. for (i = 0; i < logo->height; i++)
  228. for (j = 0; j < logo->width; src++) {
  229. *dst++ = *src >> 4;
  230. j++;
  231. if (j < logo->width) {
  232. *dst++ = *src & 0x0f;
  233. j++;
  234. }
  235. }
  236. break;
  237. case 1:
  238. for (i = 0; i < logo->height; i++) {
  239. for (j = 0; j < logo->width; src++) {
  240. d = *src ^ xor;
  241. for (k = 7; k >= 0; k--) {
  242. *dst++ = ((d >> k) & 1) ? fg : 0;
  243. j++;
  244. }
  245. }
  246. }
  247. break;
  248. }
  249. }
  250. /*
  251. * Three (3) kinds of logo maps exist. linux_logo_clut224 (>16 colors),
  252. * linux_logo_vga16 (16 colors) and linux_logo_mono (2 colors). Depending on
  253. * the visual format and color depth of the framebuffer, the DAC, the
  254. * pseudo_palette, and the logo data will be adjusted accordingly.
  255. *
  256. * Case 1 - linux_logo_clut224:
  257. * Color exceeds the number of console colors (16), thus we set the hardware DAC
  258. * using fb_set_cmap() appropriately. The "needs_cmapreset" flag will be set.
  259. *
  260. * For visuals that require color info from the pseudo_palette, we also construct
  261. * one for temporary use. The "needs_directpalette" or "needs_truepalette" flags
  262. * will be set.
  263. *
  264. * Case 2 - linux_logo_vga16:
  265. * The number of colors just matches the console colors, thus there is no need
  266. * to set the DAC or the pseudo_palette. However, the bitmap is packed, ie,
  267. * each byte contains color information for two pixels (upper and lower nibble).
  268. * To be consistent with fb_imageblit() usage, we therefore separate the two
  269. * nibbles into separate bytes. The "depth" flag will be set to 4.
  270. *
  271. * Case 3 - linux_logo_mono:
  272. * This is similar with Case 2. Each byte contains information for 8 pixels.
  273. * We isolate each bit and expand each into a byte. The "depth" flag will
  274. * be set to 1.
  275. */
  276. static struct logo_data {
  277. int depth;
  278. int needs_directpalette;
  279. int needs_truepalette;
  280. int needs_cmapreset;
  281. const struct linux_logo *logo;
  282. } fb_logo;
  283. int fb_prepare_logo(struct fb_info *info)
  284. {
  285. int depth = fb_get_color_depth(&info->var);
  286. memset(&fb_logo, 0, sizeof(struct logo_data));
  287. if (info->flags & FBINFO_MISC_TILEBLITTING)
  288. return 0;
  289. if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
  290. depth = info->var.blue.length;
  291. if (info->var.red.length < depth)
  292. depth = info->var.red.length;
  293. if (info->var.green.length < depth)
  294. depth = info->var.green.length;
  295. }
  296. if (depth >= 8) {
  297. switch (info->fix.visual) {
  298. case FB_VISUAL_TRUECOLOR:
  299. fb_logo.needs_truepalette = 1;
  300. break;
  301. case FB_VISUAL_DIRECTCOLOR:
  302. fb_logo.needs_directpalette = 1;
  303. fb_logo.needs_cmapreset = 1;
  304. break;
  305. case FB_VISUAL_PSEUDOCOLOR:
  306. fb_logo.needs_cmapreset = 1;
  307. break;
  308. }
  309. }
  310. /* Return if no suitable logo was found */
  311. fb_logo.logo = fb_find_logo(depth);
  312. if (!fb_logo.logo || fb_logo.logo->height > info->var.yres) {
  313. fb_logo.logo = NULL;
  314. return 0;
  315. }
  316. /* What depth we asked for might be different from what we get */
  317. if (fb_logo.logo->type == LINUX_LOGO_CLUT224)
  318. fb_logo.depth = 8;
  319. else if (fb_logo.logo->type == LINUX_LOGO_VGA16)
  320. fb_logo.depth = 4;
  321. else
  322. fb_logo.depth = 1;
  323. return fb_logo.logo->height;
  324. }
  325. int fb_show_logo(struct fb_info *info)
  326. {
  327. u32 *palette = NULL, *saved_pseudo_palette = NULL;
  328. unsigned char *logo_new = NULL;
  329. struct fb_image image;
  330. int x;
  331. /* Return if the frame buffer is not mapped or suspended */
  332. if (fb_logo.logo == NULL || info->state != FBINFO_STATE_RUNNING)
  333. return 0;
  334. image.depth = 8;
  335. image.data = fb_logo.logo->data;
  336. if (fb_logo.needs_cmapreset)
  337. fb_set_logocmap(info, fb_logo.logo);
  338. if (fb_logo.needs_truepalette ||
  339. fb_logo.needs_directpalette) {
  340. palette = kmalloc(256 * 4, GFP_KERNEL);
  341. if (palette == NULL)
  342. return 0;
  343. if (fb_logo.needs_truepalette)
  344. fb_set_logo_truepalette(info, fb_logo.logo, palette);
  345. else
  346. fb_set_logo_directpalette(info, fb_logo.logo, palette);
  347. saved_pseudo_palette = info->pseudo_palette;
  348. info->pseudo_palette = palette;
  349. }
  350. if (fb_logo.depth <= 4) {
  351. logo_new = kmalloc(fb_logo.logo->width * fb_logo.logo->height,
  352. GFP_KERNEL);
  353. if (logo_new == NULL) {
  354. kfree(palette);
  355. if (saved_pseudo_palette)
  356. info->pseudo_palette = saved_pseudo_palette;
  357. return 0;
  358. }
  359. image.data = logo_new;
  360. fb_set_logo(info, fb_logo.logo, logo_new, fb_logo.depth);
  361. }
  362. image.width = fb_logo.logo->width;
  363. image.height = fb_logo.logo->height;
  364. image.dy = 0;
  365. for (x = 0; x < num_online_cpus() * (fb_logo.logo->width + 8) &&
  366. x <= info->var.xres-fb_logo.logo->width; x += (fb_logo.logo->width + 8)) {
  367. image.dx = x;
  368. info->fbops->fb_imageblit(info, &image);
  369. }
  370. kfree(palette);
  371. if (saved_pseudo_palette != NULL)
  372. info->pseudo_palette = saved_pseudo_palette;
  373. kfree(logo_new);
  374. return fb_logo.logo->height;
  375. }
  376. #else
  377. int fb_prepare_logo(struct fb_info *info) { return 0; }
  378. int fb_show_logo(struct fb_info *info) { return 0; }
  379. #endif /* CONFIG_LOGO */
  380. static int fbmem_read_proc(char *buf, char **start, off_t offset,
  381. int len, int *eof, void *private)
  382. {
  383. struct fb_info **fi;
  384. int clen;
  385. clen = 0;
  386. for (fi = registered_fb; fi < &registered_fb[FB_MAX] && len < 4000; fi++)
  387. if (*fi)
  388. clen += sprintf(buf + clen, "%d %s\n",
  389. (*fi)->node,
  390. (*fi)->fix.id);
  391. *start = buf + offset;
  392. if (clen > offset)
  393. clen -= offset;
  394. else
  395. clen = 0;
  396. return clen < len ? clen : len;
  397. }
  398. static ssize_t
  399. fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
  400. {
  401. unsigned long p = *ppos;
  402. struct inode *inode = file->f_dentry->d_inode;
  403. int fbidx = iminor(inode);
  404. struct fb_info *info = registered_fb[fbidx];
  405. u32 *buffer, *dst;
  406. u32 __iomem *src;
  407. int c, i, cnt = 0, err = 0;
  408. unsigned long total_size;
  409. if (!info || ! info->screen_base)
  410. return -ENODEV;
  411. if (info->state != FBINFO_STATE_RUNNING)
  412. return -EPERM;
  413. if (info->fbops->fb_read)
  414. return info->fbops->fb_read(file, buf, count, ppos);
  415. total_size = info->screen_size;
  416. if (total_size == 0)
  417. total_size = info->fix.smem_len;
  418. if (p >= total_size)
  419. return 0;
  420. if (count >= total_size)
  421. count = total_size;
  422. if (count + p > total_size)
  423. count = total_size - p;
  424. cnt = 0;
  425. buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count,
  426. GFP_KERNEL);
  427. if (!buffer)
  428. return -ENOMEM;
  429. src = (u32 __iomem *) (info->screen_base + p);
  430. if (info->fbops->fb_sync)
  431. info->fbops->fb_sync(info);
  432. while (count) {
  433. c = (count > PAGE_SIZE) ? PAGE_SIZE : count;
  434. dst = buffer;
  435. for (i = c >> 2; i--; )
  436. *dst++ = fb_readl(src++);
  437. if (c & 3) {
  438. u8 *dst8 = (u8 *) dst;
  439. u8 __iomem *src8 = (u8 __iomem *) src;
  440. for (i = c & 3; i--;)
  441. *dst8++ = fb_readb(src8++);
  442. src = (u32 __iomem *) src8;
  443. }
  444. if (copy_to_user(buf, buffer, c)) {
  445. err = -EFAULT;
  446. break;
  447. }
  448. *ppos += c;
  449. buf += c;
  450. cnt += c;
  451. count -= c;
  452. }
  453. kfree(buffer);
  454. return (err) ? err : cnt;
  455. }
  456. static ssize_t
  457. fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
  458. {
  459. unsigned long p = *ppos;
  460. struct inode *inode = file->f_dentry->d_inode;
  461. int fbidx = iminor(inode);
  462. struct fb_info *info = registered_fb[fbidx];
  463. u32 *buffer, *src;
  464. u32 __iomem *dst;
  465. int c, i, cnt = 0, err;
  466. unsigned long total_size;
  467. if (!info || !info->screen_base)
  468. return -ENODEV;
  469. if (info->state != FBINFO_STATE_RUNNING)
  470. return -EPERM;
  471. if (info->fbops->fb_write)
  472. return info->fbops->fb_write(file, buf, count, ppos);
  473. total_size = info->screen_size;
  474. if (total_size == 0)
  475. total_size = info->fix.smem_len;
  476. if (p > total_size)
  477. return -ENOSPC;
  478. if (count >= total_size)
  479. count = total_size;
  480. err = 0;
  481. if (count + p > total_size) {
  482. count = total_size - p;
  483. err = -ENOSPC;
  484. }
  485. cnt = 0;
  486. buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count,
  487. GFP_KERNEL);
  488. if (!buffer)
  489. return -ENOMEM;
  490. dst = (u32 __iomem *) (info->screen_base + p);
  491. if (info->fbops->fb_sync)
  492. info->fbops->fb_sync(info);
  493. while (count) {
  494. c = (count > PAGE_SIZE) ? PAGE_SIZE : count;
  495. src = buffer;
  496. if (copy_from_user(src, buf, c)) {
  497. err = -EFAULT;
  498. break;
  499. }
  500. for (i = c >> 2; i--; )
  501. fb_writel(*src++, dst++);
  502. if (c & 3) {
  503. u8 *src8 = (u8 *) src;
  504. u8 __iomem *dst8 = (u8 __iomem *) dst;
  505. for (i = c & 3; i--; )
  506. fb_writeb(*src8++, dst8++);
  507. dst = (u32 __iomem *) dst8;
  508. }
  509. *ppos += c;
  510. buf += c;
  511. cnt += c;
  512. count -= c;
  513. }
  514. kfree(buffer);
  515. return (err) ? err : cnt;
  516. }
  517. #ifdef CONFIG_KMOD
  518. static void try_to_load(int fb)
  519. {
  520. request_module("fb%d", fb);
  521. }
  522. #endif /* CONFIG_KMOD */
  523. int
  524. fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
  525. {
  526. int xoffset = var->xoffset;
  527. int yoffset = var->yoffset;
  528. int err;
  529. if (xoffset < 0 || yoffset < 0 || !info->fbops->fb_pan_display ||
  530. xoffset + info->var.xres > info->var.xres_virtual ||
  531. yoffset + info->var.yres > info->var.yres_virtual)
  532. return -EINVAL;
  533. if ((err = info->fbops->fb_pan_display(var, info)))
  534. return err;
  535. info->var.xoffset = var->xoffset;
  536. info->var.yoffset = var->yoffset;
  537. if (var->vmode & FB_VMODE_YWRAP)
  538. info->var.vmode |= FB_VMODE_YWRAP;
  539. else
  540. info->var.vmode &= ~FB_VMODE_YWRAP;
  541. return 0;
  542. }
  543. int
  544. fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
  545. {
  546. int err;
  547. if (var->activate & FB_ACTIVATE_INV_MODE) {
  548. struct fb_videomode mode1, mode2;
  549. int ret = 0;
  550. fb_var_to_videomode(&mode1, var);
  551. fb_var_to_videomode(&mode2, &info->var);
  552. /* make sure we don't delete the videomode of current var */
  553. ret = fb_mode_is_equal(&mode1, &mode2);
  554. if (!ret) {
  555. struct fb_event event;
  556. event.info = info;
  557. event.data = &mode1;
  558. ret = notifier_call_chain(&fb_notifier_list,
  559. FB_EVENT_MODE_DELETE, &event);
  560. }
  561. if (!ret)
  562. fb_delete_videomode(&mode1, &info->modelist);
  563. return ret;
  564. }
  565. if ((var->activate & FB_ACTIVATE_FORCE) ||
  566. memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) {
  567. if (!info->fbops->fb_check_var) {
  568. *var = info->var;
  569. return 0;
  570. }
  571. if ((err = info->fbops->fb_check_var(var, info)))
  572. return err;
  573. if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
  574. struct fb_videomode mode;
  575. int err = 0;
  576. info->var = *var;
  577. if (info->fbops->fb_set_par)
  578. info->fbops->fb_set_par(info);
  579. fb_pan_display(info, &info->var);
  580. fb_set_cmap(&info->cmap, info);
  581. fb_var_to_videomode(&mode, &info->var);
  582. if (info->modelist.prev && info->modelist.next &&
  583. !list_empty(&info->modelist))
  584. err = fb_add_videomode(&mode, &info->modelist);
  585. if (!err && info->flags & FBINFO_MISC_USEREVENT) {
  586. struct fb_event event;
  587. info->flags &= ~FBINFO_MISC_USEREVENT;
  588. event.info = info;
  589. notifier_call_chain(&fb_notifier_list,
  590. FB_EVENT_MODE_CHANGE,
  591. &event);
  592. }
  593. }
  594. }
  595. return 0;
  596. }
  597. int
  598. fb_blank(struct fb_info *info, int blank)
  599. {
  600. int ret = -EINVAL;
  601. if (blank > FB_BLANK_POWERDOWN)
  602. blank = FB_BLANK_POWERDOWN;
  603. if (info->fbops->fb_blank)
  604. ret = info->fbops->fb_blank(blank, info);
  605. if (!ret) {
  606. struct fb_event event;
  607. event.info = info;
  608. event.data = &blank;
  609. notifier_call_chain(&fb_notifier_list, FB_EVENT_BLANK, &event);
  610. }
  611. return ret;
  612. }
  613. static int
  614. fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
  615. unsigned long arg)
  616. {
  617. int fbidx = iminor(inode);
  618. struct fb_info *info = registered_fb[fbidx];
  619. struct fb_ops *fb = info->fbops;
  620. struct fb_var_screeninfo var;
  621. struct fb_fix_screeninfo fix;
  622. struct fb_con2fbmap con2fb;
  623. struct fb_cmap_user cmap;
  624. struct fb_event event;
  625. void __user *argp = (void __user *)arg;
  626. int i;
  627. if (!fb)
  628. return -ENODEV;
  629. switch (cmd) {
  630. case FBIOGET_VSCREENINFO:
  631. return copy_to_user(argp, &info->var,
  632. sizeof(var)) ? -EFAULT : 0;
  633. case FBIOPUT_VSCREENINFO:
  634. if (copy_from_user(&var, argp, sizeof(var)))
  635. return -EFAULT;
  636. acquire_console_sem();
  637. info->flags |= FBINFO_MISC_USEREVENT;
  638. i = fb_set_var(info, &var);
  639. info->flags &= ~FBINFO_MISC_USEREVENT;
  640. release_console_sem();
  641. if (i) return i;
  642. if (copy_to_user(argp, &var, sizeof(var)))
  643. return -EFAULT;
  644. return 0;
  645. case FBIOGET_FSCREENINFO:
  646. return copy_to_user(argp, &info->fix,
  647. sizeof(fix)) ? -EFAULT : 0;
  648. case FBIOPUTCMAP:
  649. if (copy_from_user(&cmap, argp, sizeof(cmap)))
  650. return -EFAULT;
  651. return (fb_set_user_cmap(&cmap, info));
  652. case FBIOGETCMAP:
  653. if (copy_from_user(&cmap, argp, sizeof(cmap)))
  654. return -EFAULT;
  655. return fb_cmap_to_user(&info->cmap, &cmap);
  656. case FBIOPAN_DISPLAY:
  657. if (copy_from_user(&var, argp, sizeof(var)))
  658. return -EFAULT;
  659. acquire_console_sem();
  660. i = fb_pan_display(info, &var);
  661. release_console_sem();
  662. if (i)
  663. return i;
  664. if (copy_to_user(argp, &var, sizeof(var)))
  665. return -EFAULT;
  666. return 0;
  667. case FBIO_CURSOR:
  668. return -EINVAL;
  669. case FBIOGET_CON2FBMAP:
  670. if (copy_from_user(&con2fb, argp, sizeof(con2fb)))
  671. return -EFAULT;
  672. if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
  673. return -EINVAL;
  674. con2fb.framebuffer = -1;
  675. event.info = info;
  676. event.data = &con2fb;
  677. notifier_call_chain(&fb_notifier_list,
  678. FB_EVENT_GET_CONSOLE_MAP, &event);
  679. return copy_to_user(argp, &con2fb,
  680. sizeof(con2fb)) ? -EFAULT : 0;
  681. case FBIOPUT_CON2FBMAP:
  682. if (copy_from_user(&con2fb, argp, sizeof(con2fb)))
  683. return - EFAULT;
  684. if (con2fb.console < 0 || con2fb.console > MAX_NR_CONSOLES)
  685. return -EINVAL;
  686. if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX)
  687. return -EINVAL;
  688. #ifdef CONFIG_KMOD
  689. if (!registered_fb[con2fb.framebuffer])
  690. try_to_load(con2fb.framebuffer);
  691. #endif /* CONFIG_KMOD */
  692. if (!registered_fb[con2fb.framebuffer])
  693. return -EINVAL;
  694. event.info = info;
  695. event.data = &con2fb;
  696. return notifier_call_chain(&fb_notifier_list,
  697. FB_EVENT_SET_CONSOLE_MAP,
  698. &event);
  699. case FBIOBLANK:
  700. acquire_console_sem();
  701. info->flags |= FBINFO_MISC_USEREVENT;
  702. i = fb_blank(info, arg);
  703. info->flags &= ~FBINFO_MISC_USEREVENT;
  704. release_console_sem();
  705. return i;
  706. default:
  707. if (fb->fb_ioctl == NULL)
  708. return -EINVAL;
  709. return fb->fb_ioctl(inode, file, cmd, arg, info);
  710. }
  711. }
  712. #ifdef CONFIG_COMPAT
  713. static long
  714. fb_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
  715. {
  716. int fbidx = iminor(file->f_dentry->d_inode);
  717. struct fb_info *info = registered_fb[fbidx];
  718. struct fb_ops *fb = info->fbops;
  719. long ret;
  720. if (fb->fb_compat_ioctl == NULL)
  721. return -ENOIOCTLCMD;
  722. lock_kernel();
  723. ret = fb->fb_compat_ioctl(file, cmd, arg, info);
  724. unlock_kernel();
  725. return ret;
  726. }
  727. #endif
  728. static int
  729. fb_mmap(struct file *file, struct vm_area_struct * vma)
  730. {
  731. int fbidx = iminor(file->f_dentry->d_inode);
  732. struct fb_info *info = registered_fb[fbidx];
  733. struct fb_ops *fb = info->fbops;
  734. unsigned long off;
  735. #if !defined(__sparc__) || defined(__sparc_v9__)
  736. unsigned long start;
  737. u32 len;
  738. #endif
  739. if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
  740. return -EINVAL;
  741. off = vma->vm_pgoff << PAGE_SHIFT;
  742. if (!fb)
  743. return -ENODEV;
  744. if (fb->fb_mmap) {
  745. int res;
  746. lock_kernel();
  747. res = fb->fb_mmap(info, file, vma);
  748. unlock_kernel();
  749. return res;
  750. }
  751. #if defined(__sparc__) && !defined(__sparc_v9__)
  752. /* Should never get here, all fb drivers should have their own
  753. mmap routines */
  754. return -EINVAL;
  755. #else
  756. /* !sparc32... */
  757. lock_kernel();
  758. /* frame buffer memory */
  759. start = info->fix.smem_start;
  760. len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
  761. if (off >= len) {
  762. /* memory mapped io */
  763. off -= len;
  764. if (info->var.accel_flags) {
  765. unlock_kernel();
  766. return -EINVAL;
  767. }
  768. start = info->fix.mmio_start;
  769. len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len);
  770. }
  771. unlock_kernel();
  772. start &= PAGE_MASK;
  773. if ((vma->vm_end - vma->vm_start + off) > len)
  774. return -EINVAL;
  775. off += start;
  776. vma->vm_pgoff = off >> PAGE_SHIFT;
  777. /* This is an IO map - tell maydump to skip this VMA */
  778. vma->vm_flags |= VM_IO | VM_RESERVED;
  779. #if defined(__sparc_v9__)
  780. if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
  781. vma->vm_end - vma->vm_start, vma->vm_page_prot))
  782. return -EAGAIN;
  783. #else
  784. #if defined(__mc68000__)
  785. #if defined(CONFIG_SUN3)
  786. pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE;
  787. #elif defined(CONFIG_MMU)
  788. if (CPU_IS_020_OR_030)
  789. pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030;
  790. if (CPU_IS_040_OR_060) {
  791. pgprot_val(vma->vm_page_prot) &= _CACHEMASK040;
  792. /* Use no-cache mode, serialized */
  793. pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S;
  794. }
  795. #endif
  796. #elif defined(__powerpc__)
  797. vma->vm_page_prot = phys_mem_access_prot(file, off,
  798. vma->vm_end - vma->vm_start,
  799. vma->vm_page_prot);
  800. #elif defined(__alpha__)
  801. /* Caching is off in the I/O space quadrant by design. */
  802. #elif defined(__i386__) || defined(__x86_64__)
  803. if (boot_cpu_data.x86 > 3)
  804. pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
  805. #elif defined(__mips__)
  806. vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
  807. #elif defined(__hppa__)
  808. pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
  809. #elif defined(__arm__) || defined(__sh__) || defined(__m32r__)
  810. vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
  811. #elif defined(__ia64__)
  812. if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start))
  813. vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
  814. else
  815. vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
  816. #else
  817. #warning What do we have to do here??
  818. #endif
  819. if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
  820. vma->vm_end - vma->vm_start, vma->vm_page_prot))
  821. return -EAGAIN;
  822. #endif /* !__sparc_v9__ */
  823. return 0;
  824. #endif /* !sparc32 */
  825. }
  826. static int
  827. fb_open(struct inode *inode, struct file *file)
  828. {
  829. int fbidx = iminor(inode);
  830. struct fb_info *info;
  831. int res = 0;
  832. if (fbidx >= FB_MAX)
  833. return -ENODEV;
  834. #ifdef CONFIG_KMOD
  835. if (!(info = registered_fb[fbidx]))
  836. try_to_load(fbidx);
  837. #endif /* CONFIG_KMOD */
  838. if (!(info = registered_fb[fbidx]))
  839. return -ENODEV;
  840. if (!try_module_get(info->fbops->owner))
  841. return -ENODEV;
  842. if (info->fbops->fb_open) {
  843. res = info->fbops->fb_open(info,1);
  844. if (res)
  845. module_put(info->fbops->owner);
  846. }
  847. return res;
  848. }
  849. static int
  850. fb_release(struct inode *inode, struct file *file)
  851. {
  852. int fbidx = iminor(inode);
  853. struct fb_info *info;
  854. lock_kernel();
  855. info = registered_fb[fbidx];
  856. if (info->fbops->fb_release)
  857. info->fbops->fb_release(info,1);
  858. module_put(info->fbops->owner);
  859. unlock_kernel();
  860. return 0;
  861. }
  862. static struct file_operations fb_fops = {
  863. .owner = THIS_MODULE,
  864. .read = fb_read,
  865. .write = fb_write,
  866. .ioctl = fb_ioctl,
  867. #ifdef CONFIG_COMPAT
  868. .compat_ioctl = fb_compat_ioctl,
  869. #endif
  870. .mmap = fb_mmap,
  871. .open = fb_open,
  872. .release = fb_release,
  873. #ifdef HAVE_ARCH_FB_UNMAPPED_AREA
  874. .get_unmapped_area = get_fb_unmapped_area,
  875. #endif
  876. };
  877. static struct class *fb_class;
  878. /**
  879. * register_framebuffer - registers a frame buffer device
  880. * @fb_info: frame buffer info structure
  881. *
  882. * Registers a frame buffer device @fb_info.
  883. *
  884. * Returns negative errno on error, or zero for success.
  885. *
  886. */
  887. int
  888. register_framebuffer(struct fb_info *fb_info)
  889. {
  890. int i;
  891. struct fb_event event;
  892. if (num_registered_fb == FB_MAX)
  893. return -ENXIO;
  894. num_registered_fb++;
  895. for (i = 0 ; i < FB_MAX; i++)
  896. if (!registered_fb[i])
  897. break;
  898. fb_info->node = i;
  899. fb_info->class_device = class_device_create(fb_class, MKDEV(FB_MAJOR, i),
  900. fb_info->device, "fb%d", i);
  901. if (IS_ERR(fb_info->class_device)) {
  902. /* Not fatal */
  903. printk(KERN_WARNING "Unable to create class_device for framebuffer %d; errno = %ld\n", i, PTR_ERR(fb_info->class_device));
  904. fb_info->class_device = NULL;
  905. } else
  906. fb_init_class_device(fb_info);
  907. if (fb_info->pixmap.addr == NULL) {
  908. fb_info->pixmap.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL);
  909. if (fb_info->pixmap.addr) {
  910. fb_info->pixmap.size = FBPIXMAPSIZE;
  911. fb_info->pixmap.buf_align = 1;
  912. fb_info->pixmap.scan_align = 1;
  913. fb_info->pixmap.access_align = 32;
  914. fb_info->pixmap.flags = FB_PIXMAP_DEFAULT;
  915. }
  916. }
  917. fb_info->pixmap.offset = 0;
  918. if (!fb_info->modelist.prev ||
  919. !fb_info->modelist.next ||
  920. list_empty(&fb_info->modelist)) {
  921. struct fb_videomode mode;
  922. INIT_LIST_HEAD(&fb_info->modelist);
  923. fb_var_to_videomode(&mode, &fb_info->var);
  924. fb_add_videomode(&mode, &fb_info->modelist);
  925. }
  926. registered_fb[i] = fb_info;
  927. devfs_mk_cdev(MKDEV(FB_MAJOR, i),
  928. S_IFCHR | S_IRUGO | S_IWUGO, "fb/%d", i);
  929. event.info = fb_info;
  930. notifier_call_chain(&fb_notifier_list,
  931. FB_EVENT_FB_REGISTERED, &event);
  932. return 0;
  933. }
  934. /**
  935. * unregister_framebuffer - releases a frame buffer device
  936. * @fb_info: frame buffer info structure
  937. *
  938. * Unregisters a frame buffer device @fb_info.
  939. *
  940. * Returns negative errno on error, or zero for success.
  941. *
  942. */
  943. int
  944. unregister_framebuffer(struct fb_info *fb_info)
  945. {
  946. int i;
  947. i = fb_info->node;
  948. if (!registered_fb[i])
  949. return -EINVAL;
  950. devfs_remove("fb/%d", i);
  951. if (fb_info->pixmap.addr && (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
  952. kfree(fb_info->pixmap.addr);
  953. fb_destroy_modelist(&fb_info->modelist);
  954. registered_fb[i]=NULL;
  955. num_registered_fb--;
  956. fb_cleanup_class_device(fb_info);
  957. class_device_destroy(fb_class, MKDEV(FB_MAJOR, i));
  958. return 0;
  959. }
  960. /**
  961. * fb_register_client - register a client notifier
  962. * @nb: notifier block to callback on events
  963. */
  964. int fb_register_client(struct notifier_block *nb)
  965. {
  966. return notifier_chain_register(&fb_notifier_list, nb);
  967. }
  968. /**
  969. * fb_unregister_client - unregister a client notifier
  970. * @nb: notifier block to callback on events
  971. */
  972. int fb_unregister_client(struct notifier_block *nb)
  973. {
  974. return notifier_chain_unregister(&fb_notifier_list, nb);
  975. }
  976. /**
  977. * fb_set_suspend - low level driver signals suspend
  978. * @info: framebuffer affected
  979. * @state: 0 = resuming, !=0 = suspending
  980. *
  981. * This is meant to be used by low level drivers to
  982. * signal suspend/resume to the core & clients.
  983. * It must be called with the console semaphore held
  984. */
  985. void fb_set_suspend(struct fb_info *info, int state)
  986. {
  987. struct fb_event event;
  988. event.info = info;
  989. if (state) {
  990. notifier_call_chain(&fb_notifier_list, FB_EVENT_SUSPEND, &event);
  991. info->state = FBINFO_STATE_SUSPENDED;
  992. } else {
  993. info->state = FBINFO_STATE_RUNNING;
  994. notifier_call_chain(&fb_notifier_list, FB_EVENT_RESUME, &event);
  995. }
  996. }
  997. /**
  998. * fbmem_init - init frame buffer subsystem
  999. *
  1000. * Initialize the frame buffer subsystem.
  1001. *
  1002. * NOTE: This function is _only_ to be called by drivers/char/mem.c.
  1003. *
  1004. */
  1005. static int __init
  1006. fbmem_init(void)
  1007. {
  1008. create_proc_read_entry("fb", 0, NULL, fbmem_read_proc, NULL);
  1009. devfs_mk_dir("fb");
  1010. if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
  1011. printk("unable to get major %d for fb devs\n", FB_MAJOR);
  1012. fb_class = class_create(THIS_MODULE, "graphics");
  1013. if (IS_ERR(fb_class)) {
  1014. printk(KERN_WARNING "Unable to create fb class; errno = %ld\n", PTR_ERR(fb_class));
  1015. fb_class = NULL;
  1016. }
  1017. return 0;
  1018. }
  1019. #ifdef MODULE
  1020. module_init(fbmem_init);
  1021. static void __exit
  1022. fbmem_exit(void)
  1023. {
  1024. class_destroy(fb_class);
  1025. }
  1026. module_exit(fbmem_exit);
  1027. MODULE_LICENSE("GPL");
  1028. MODULE_DESCRIPTION("Framebuffer base");
  1029. #else
  1030. subsys_initcall(fbmem_init);
  1031. #endif
  1032. int fb_new_modelist(struct fb_info *info)
  1033. {
  1034. struct fb_event event;
  1035. struct fb_var_screeninfo var = info->var;
  1036. struct list_head *pos, *n;
  1037. struct fb_modelist *modelist;
  1038. struct fb_videomode *m, mode;
  1039. int err = 1;
  1040. list_for_each_safe(pos, n, &info->modelist) {
  1041. modelist = list_entry(pos, struct fb_modelist, list);
  1042. m = &modelist->mode;
  1043. fb_videomode_to_var(&var, m);
  1044. var.activate = FB_ACTIVATE_TEST;
  1045. err = fb_set_var(info, &var);
  1046. fb_var_to_videomode(&mode, &var);
  1047. if (err || !fb_mode_is_equal(m, &mode)) {
  1048. list_del(pos);
  1049. kfree(pos);
  1050. }
  1051. }
  1052. err = 1;
  1053. if (!list_empty(&info->modelist)) {
  1054. event.info = info;
  1055. err = notifier_call_chain(&fb_notifier_list,
  1056. FB_EVENT_NEW_MODELIST,
  1057. &event);
  1058. }
  1059. return err;
  1060. }
  1061. static char *video_options[FB_MAX];
  1062. static int ofonly;
  1063. extern const char *global_mode_option;
  1064. /**
  1065. * fb_get_options - get kernel boot parameters
  1066. * @name: framebuffer name as it would appear in
  1067. * the boot parameter line
  1068. * (video=<name>:<options>)
  1069. * @option: the option will be stored here
  1070. *
  1071. * NOTE: Needed to maintain backwards compatibility
  1072. */
  1073. int fb_get_options(char *name, char **option)
  1074. {
  1075. char *opt, *options = NULL;
  1076. int opt_len, retval = 0;
  1077. int name_len = strlen(name), i;
  1078. if (name_len && ofonly && strncmp(name, "offb", 4))
  1079. retval = 1;
  1080. if (name_len && !retval) {
  1081. for (i = 0; i < FB_MAX; i++) {
  1082. if (video_options[i] == NULL)
  1083. continue;
  1084. opt_len = strlen(video_options[i]);
  1085. if (!opt_len)
  1086. continue;
  1087. opt = video_options[i];
  1088. if (!strncmp(name, opt, name_len) &&
  1089. opt[name_len] == ':')
  1090. options = opt + name_len + 1;
  1091. }
  1092. }
  1093. if (options && !strncmp(options, "off", 3))
  1094. retval = 1;
  1095. if (option)
  1096. *option = options;
  1097. return retval;
  1098. }
  1099. /**
  1100. * video_setup - process command line options
  1101. * @options: string of options
  1102. *
  1103. * Process command line options for frame buffer subsystem.
  1104. *
  1105. * NOTE: This function is a __setup and __init function.
  1106. * It only stores the options. Drivers have to call
  1107. * fb_get_options() as necessary.
  1108. *
  1109. * Returns zero.
  1110. *
  1111. */
  1112. static int __init video_setup(char *options)
  1113. {
  1114. int i, global = 0;
  1115. if (!options || !*options)
  1116. global = 1;
  1117. if (!global && !strncmp(options, "ofonly", 6)) {
  1118. ofonly = 1;
  1119. global = 1;
  1120. }
  1121. if (!global && !strstr(options, "fb:")) {
  1122. global_mode_option = options;
  1123. global = 1;
  1124. }
  1125. if (!global) {
  1126. for (i = 0; i < FB_MAX; i++) {
  1127. if (video_options[i] == NULL) {
  1128. video_options[i] = options;
  1129. break;
  1130. }
  1131. }
  1132. }
  1133. return 0;
  1134. }
  1135. __setup("video=", video_setup);
  1136. /*
  1137. * Visible symbols for modules
  1138. */
  1139. EXPORT_SYMBOL(register_framebuffer);
  1140. EXPORT_SYMBOL(unregister_framebuffer);
  1141. EXPORT_SYMBOL(num_registered_fb);
  1142. EXPORT_SYMBOL(registered_fb);
  1143. EXPORT_SYMBOL(fb_prepare_logo);
  1144. EXPORT_SYMBOL(fb_show_logo);
  1145. EXPORT_SYMBOL(fb_set_var);
  1146. EXPORT_SYMBOL(fb_blank);
  1147. EXPORT_SYMBOL(fb_pan_display);
  1148. EXPORT_SYMBOL(fb_get_buffer_offset);
  1149. EXPORT_SYMBOL(fb_set_suspend);
  1150. EXPORT_SYMBOL(fb_register_client);
  1151. EXPORT_SYMBOL(fb_unregister_client);
  1152. EXPORT_SYMBOL(fb_get_options);
  1153. EXPORT_SYMBOL(fb_new_modelist);
  1154. MODULE_LICENSE("GPL");