fbmem.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320
  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. unregister_chrdev(FB_MAJOR, "fb");
  1026. }
  1027. module_exit(fbmem_exit);
  1028. MODULE_LICENSE("GPL");
  1029. MODULE_DESCRIPTION("Framebuffer base");
  1030. #else
  1031. subsys_initcall(fbmem_init);
  1032. #endif
  1033. int fb_new_modelist(struct fb_info *info)
  1034. {
  1035. struct fb_event event;
  1036. struct fb_var_screeninfo var = info->var;
  1037. struct list_head *pos, *n;
  1038. struct fb_modelist *modelist;
  1039. struct fb_videomode *m, mode;
  1040. int err = 1;
  1041. list_for_each_safe(pos, n, &info->modelist) {
  1042. modelist = list_entry(pos, struct fb_modelist, list);
  1043. m = &modelist->mode;
  1044. fb_videomode_to_var(&var, m);
  1045. var.activate = FB_ACTIVATE_TEST;
  1046. err = fb_set_var(info, &var);
  1047. fb_var_to_videomode(&mode, &var);
  1048. if (err || !fb_mode_is_equal(m, &mode)) {
  1049. list_del(pos);
  1050. kfree(pos);
  1051. }
  1052. }
  1053. err = 1;
  1054. if (!list_empty(&info->modelist)) {
  1055. event.info = info;
  1056. err = notifier_call_chain(&fb_notifier_list,
  1057. FB_EVENT_NEW_MODELIST,
  1058. &event);
  1059. }
  1060. return err;
  1061. }
  1062. static char *video_options[FB_MAX];
  1063. static int ofonly;
  1064. extern const char *global_mode_option;
  1065. /**
  1066. * fb_get_options - get kernel boot parameters
  1067. * @name: framebuffer name as it would appear in
  1068. * the boot parameter line
  1069. * (video=<name>:<options>)
  1070. * @option: the option will be stored here
  1071. *
  1072. * NOTE: Needed to maintain backwards compatibility
  1073. */
  1074. int fb_get_options(char *name, char **option)
  1075. {
  1076. char *opt, *options = NULL;
  1077. int opt_len, retval = 0;
  1078. int name_len = strlen(name), i;
  1079. if (name_len && ofonly && strncmp(name, "offb", 4))
  1080. retval = 1;
  1081. if (name_len && !retval) {
  1082. for (i = 0; i < FB_MAX; i++) {
  1083. if (video_options[i] == NULL)
  1084. continue;
  1085. opt_len = strlen(video_options[i]);
  1086. if (!opt_len)
  1087. continue;
  1088. opt = video_options[i];
  1089. if (!strncmp(name, opt, name_len) &&
  1090. opt[name_len] == ':')
  1091. options = opt + name_len + 1;
  1092. }
  1093. }
  1094. if (options && !strncmp(options, "off", 3))
  1095. retval = 1;
  1096. if (option)
  1097. *option = options;
  1098. return retval;
  1099. }
  1100. /**
  1101. * video_setup - process command line options
  1102. * @options: string of options
  1103. *
  1104. * Process command line options for frame buffer subsystem.
  1105. *
  1106. * NOTE: This function is a __setup and __init function.
  1107. * It only stores the options. Drivers have to call
  1108. * fb_get_options() as necessary.
  1109. *
  1110. * Returns zero.
  1111. *
  1112. */
  1113. static int __init video_setup(char *options)
  1114. {
  1115. int i, global = 0;
  1116. if (!options || !*options)
  1117. global = 1;
  1118. if (!global && !strncmp(options, "ofonly", 6)) {
  1119. ofonly = 1;
  1120. global = 1;
  1121. }
  1122. if (!global && !strstr(options, "fb:")) {
  1123. global_mode_option = options;
  1124. global = 1;
  1125. }
  1126. if (!global) {
  1127. for (i = 0; i < FB_MAX; i++) {
  1128. if (video_options[i] == NULL) {
  1129. video_options[i] = options;
  1130. break;
  1131. }
  1132. }
  1133. }
  1134. return 0;
  1135. }
  1136. __setup("video=", video_setup);
  1137. /*
  1138. * Visible symbols for modules
  1139. */
  1140. EXPORT_SYMBOL(register_framebuffer);
  1141. EXPORT_SYMBOL(unregister_framebuffer);
  1142. EXPORT_SYMBOL(num_registered_fb);
  1143. EXPORT_SYMBOL(registered_fb);
  1144. EXPORT_SYMBOL(fb_prepare_logo);
  1145. EXPORT_SYMBOL(fb_show_logo);
  1146. EXPORT_SYMBOL(fb_set_var);
  1147. EXPORT_SYMBOL(fb_blank);
  1148. EXPORT_SYMBOL(fb_pan_display);
  1149. EXPORT_SYMBOL(fb_get_buffer_offset);
  1150. EXPORT_SYMBOL(fb_set_suspend);
  1151. EXPORT_SYMBOL(fb_register_client);
  1152. EXPORT_SYMBOL(fb_unregister_client);
  1153. EXPORT_SYMBOL(fb_get_options);
  1154. EXPORT_SYMBOL(fb_new_modelist);
  1155. MODULE_LICENSE("GPL");