PageRenderTime 119ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 1ms

/drivers/video/msm/msm_fb.c

https://bitbucket.org/abioy/linux
C | 637 lines | 520 code | 84 blank | 33 comment | 89 complexity | dc07e48aee453799cac3a8383881b4e4 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, GPL-2.0, LGPL-2.0, AGPL-1.0
  1. /* drivers/video/msm/msm_fb.c
  2. *
  3. * Core MSM framebuffer driver.
  4. *
  5. * Copyright (C) 2007 Google Incorporated
  6. *
  7. * This software is licensed under the terms of the GNU General Public
  8. * License version 2, as published by the Free Software Foundation, and
  9. * may be copied, distributed, and modified under those terms.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #include <linux/platform_device.h>
  17. #include <linux/module.h>
  18. #include <linux/fb.h>
  19. #include <linux/slab.h>
  20. #include <linux/delay.h>
  21. #include <linux/freezer.h>
  22. #include <linux/wait.h>
  23. #include <linux/msm_mdp.h>
  24. #include <linux/io.h>
  25. #include <linux/uaccess.h>
  26. #include <mach/msm_fb.h>
  27. #include <mach/board.h>
  28. #include <linux/workqueue.h>
  29. #include <linux/clk.h>
  30. #include <linux/debugfs.h>
  31. #include <linux/dma-mapping.h>
  32. #define PRINT_FPS 0
  33. #define PRINT_BLIT_TIME 0
  34. #define SLEEPING 0x4
  35. #define UPDATING 0x3
  36. #define FULL_UPDATE_DONE 0x2
  37. #define WAKING 0x1
  38. #define AWAKE 0x0
  39. #define NONE 0
  40. #define SUSPEND_RESUME 0x1
  41. #define FPS 0x2
  42. #define BLIT_TIME 0x4
  43. #define SHOW_UPDATES 0x8
  44. #define DLOG(mask, fmt, args...) \
  45. do { \
  46. if (msmfb_debug_mask & mask) \
  47. printk(KERN_INFO "msmfb: "fmt, ##args); \
  48. } while (0)
  49. static int msmfb_debug_mask;
  50. module_param_named(msmfb_debug_mask, msmfb_debug_mask, int,
  51. S_IRUGO | S_IWUSR | S_IWGRP);
  52. struct mdp_device *mdp;
  53. struct msmfb_info {
  54. struct fb_info *fb;
  55. struct msm_panel_data *panel;
  56. int xres;
  57. int yres;
  58. unsigned output_format;
  59. unsigned yoffset;
  60. unsigned frame_requested;
  61. unsigned frame_done;
  62. int sleeping;
  63. unsigned update_frame;
  64. struct {
  65. int left;
  66. int top;
  67. int eright; /* exclusive */
  68. int ebottom; /* exclusive */
  69. } update_info;
  70. char *black;
  71. spinlock_t update_lock;
  72. struct mutex panel_init_lock;
  73. wait_queue_head_t frame_wq;
  74. struct workqueue_struct *resume_workqueue;
  75. struct work_struct resume_work;
  76. struct msmfb_callback dma_callback;
  77. struct msmfb_callback vsync_callback;
  78. struct hrtimer fake_vsync;
  79. ktime_t vsync_request_time;
  80. };
  81. static int msmfb_open(struct fb_info *info, int user)
  82. {
  83. return 0;
  84. }
  85. static int msmfb_release(struct fb_info *info, int user)
  86. {
  87. return 0;
  88. }
  89. /* Called from dma interrupt handler, must not sleep */
  90. static void msmfb_handle_dma_interrupt(struct msmfb_callback *callback)
  91. {
  92. unsigned long irq_flags;
  93. struct msmfb_info *msmfb = container_of(callback, struct msmfb_info,
  94. dma_callback);
  95. spin_lock_irqsave(&msmfb->update_lock, irq_flags);
  96. msmfb->frame_done = msmfb->frame_requested;
  97. if (msmfb->sleeping == UPDATING &&
  98. msmfb->frame_done == msmfb->update_frame) {
  99. DLOG(SUSPEND_RESUME, "full update completed\n");
  100. queue_work(msmfb->resume_workqueue, &msmfb->resume_work);
  101. }
  102. spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
  103. wake_up(&msmfb->frame_wq);
  104. }
  105. static int msmfb_start_dma(struct msmfb_info *msmfb)
  106. {
  107. uint32_t x, y, w, h;
  108. unsigned addr;
  109. unsigned long irq_flags;
  110. uint32_t yoffset;
  111. s64 time_since_request;
  112. struct msm_panel_data *panel = msmfb->panel;
  113. spin_lock_irqsave(&msmfb->update_lock, irq_flags);
  114. time_since_request = ktime_to_ns(ktime_sub(ktime_get(),
  115. msmfb->vsync_request_time));
  116. if (time_since_request > 20 * NSEC_PER_MSEC) {
  117. uint32_t us;
  118. us = do_div(time_since_request, NSEC_PER_MSEC) / NSEC_PER_USEC;
  119. printk(KERN_WARNING "msmfb_start_dma %lld.%03u ms after vsync "
  120. "request\n", time_since_request, us);
  121. }
  122. if (msmfb->frame_done == msmfb->frame_requested) {
  123. spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
  124. return -1;
  125. }
  126. if (msmfb->sleeping == SLEEPING) {
  127. DLOG(SUSPEND_RESUME, "tried to start dma while asleep\n");
  128. spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
  129. return -1;
  130. }
  131. x = msmfb->update_info.left;
  132. y = msmfb->update_info.top;
  133. w = msmfb->update_info.eright - x;
  134. h = msmfb->update_info.ebottom - y;
  135. yoffset = msmfb->yoffset;
  136. msmfb->update_info.left = msmfb->xres + 1;
  137. msmfb->update_info.top = msmfb->yres + 1;
  138. msmfb->update_info.eright = 0;
  139. msmfb->update_info.ebottom = 0;
  140. if (unlikely(w > msmfb->xres || h > msmfb->yres ||
  141. w == 0 || h == 0)) {
  142. printk(KERN_INFO "invalid update: %d %d %d "
  143. "%d\n", x, y, w, h);
  144. msmfb->frame_done = msmfb->frame_requested;
  145. goto error;
  146. }
  147. spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
  148. addr = ((msmfb->xres * (yoffset + y) + x) * 2);
  149. mdp->dma(mdp, addr + msmfb->fb->fix.smem_start,
  150. msmfb->xres * 2, w, h, x, y, &msmfb->dma_callback,
  151. panel->interface_type);
  152. return 0;
  153. error:
  154. spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
  155. /* some clients need to clear their vsync interrupt */
  156. if (panel->clear_vsync)
  157. panel->clear_vsync(panel);
  158. wake_up(&msmfb->frame_wq);
  159. return 0;
  160. }
  161. /* Called from esync interrupt handler, must not sleep */
  162. static void msmfb_handle_vsync_interrupt(struct msmfb_callback *callback)
  163. {
  164. struct msmfb_info *msmfb = container_of(callback, struct msmfb_info,
  165. vsync_callback);
  166. msmfb_start_dma(msmfb);
  167. }
  168. static enum hrtimer_restart msmfb_fake_vsync(struct hrtimer *timer)
  169. {
  170. struct msmfb_info *msmfb = container_of(timer, struct msmfb_info,
  171. fake_vsync);
  172. msmfb_start_dma(msmfb);
  173. return HRTIMER_NORESTART;
  174. }
  175. static void msmfb_pan_update(struct fb_info *info, uint32_t left, uint32_t top,
  176. uint32_t eright, uint32_t ebottom,
  177. uint32_t yoffset, int pan_display)
  178. {
  179. struct msmfb_info *msmfb = info->par;
  180. struct msm_panel_data *panel = msmfb->panel;
  181. unsigned long irq_flags;
  182. int sleeping;
  183. int retry = 1;
  184. DLOG(SHOW_UPDATES, "update %d %d %d %d %d %d\n",
  185. left, top, eright, ebottom, yoffset, pan_display);
  186. restart:
  187. spin_lock_irqsave(&msmfb->update_lock, irq_flags);
  188. /* if we are sleeping, on a pan_display wait 10ms (to throttle back
  189. * drawing otherwise return */
  190. if (msmfb->sleeping == SLEEPING) {
  191. DLOG(SUSPEND_RESUME, "drawing while asleep\n");
  192. spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
  193. if (pan_display)
  194. wait_event_interruptible_timeout(msmfb->frame_wq,
  195. msmfb->sleeping != SLEEPING, HZ/10);
  196. return;
  197. }
  198. sleeping = msmfb->sleeping;
  199. /* on a full update, if the last frame has not completed, wait for it */
  200. if (pan_display && (msmfb->frame_requested != msmfb->frame_done ||
  201. sleeping == UPDATING)) {
  202. int ret;
  203. spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
  204. ret = wait_event_interruptible_timeout(msmfb->frame_wq,
  205. msmfb->frame_done == msmfb->frame_requested &&
  206. msmfb->sleeping != UPDATING, 5 * HZ);
  207. if (ret <= 0 && (msmfb->frame_requested != msmfb->frame_done ||
  208. msmfb->sleeping == UPDATING)) {
  209. if (retry && panel->request_vsync &&
  210. (sleeping == AWAKE)) {
  211. panel->request_vsync(panel,
  212. &msmfb->vsync_callback);
  213. retry = 0;
  214. printk(KERN_WARNING "msmfb_pan_display timeout "
  215. "rerequest vsync\n");
  216. } else {
  217. printk(KERN_WARNING "msmfb_pan_display timeout "
  218. "waiting for frame start, %d %d\n",
  219. msmfb->frame_requested,
  220. msmfb->frame_done);
  221. return;
  222. }
  223. }
  224. goto restart;
  225. }
  226. msmfb->frame_requested++;
  227. /* if necessary, update the y offset, if this is the
  228. * first full update on resume, set the sleeping state */
  229. if (pan_display) {
  230. msmfb->yoffset = yoffset;
  231. if (left == 0 && top == 0 && eright == info->var.xres &&
  232. ebottom == info->var.yres) {
  233. if (sleeping == WAKING) {
  234. msmfb->update_frame = msmfb->frame_requested;
  235. DLOG(SUSPEND_RESUME, "full update starting\n");
  236. msmfb->sleeping = UPDATING;
  237. }
  238. }
  239. }
  240. /* set the update request */
  241. if (left < msmfb->update_info.left)
  242. msmfb->update_info.left = left;
  243. if (top < msmfb->update_info.top)
  244. msmfb->update_info.top = top;
  245. if (eright > msmfb->update_info.eright)
  246. msmfb->update_info.eright = eright;
  247. if (ebottom > msmfb->update_info.ebottom)
  248. msmfb->update_info.ebottom = ebottom;
  249. DLOG(SHOW_UPDATES, "update queued %d %d %d %d %d\n",
  250. msmfb->update_info.left, msmfb->update_info.top,
  251. msmfb->update_info.eright, msmfb->update_info.ebottom,
  252. msmfb->yoffset);
  253. spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
  254. /* if the panel is all the way on wait for vsync, otherwise sleep
  255. * for 16 ms (long enough for the dma to panel) and then begin dma */
  256. msmfb->vsync_request_time = ktime_get();
  257. if (panel->request_vsync && (sleeping == AWAKE)) {
  258. panel->request_vsync(panel, &msmfb->vsync_callback);
  259. } else {
  260. if (!hrtimer_active(&msmfb->fake_vsync)) {
  261. hrtimer_start(&msmfb->fake_vsync,
  262. ktime_set(0, NSEC_PER_SEC/60),
  263. HRTIMER_MODE_REL);
  264. }
  265. }
  266. }
  267. static void msmfb_update(struct fb_info *info, uint32_t left, uint32_t top,
  268. uint32_t eright, uint32_t ebottom)
  269. {
  270. msmfb_pan_update(info, left, top, eright, ebottom, 0, 0);
  271. }
  272. static void power_on_panel(struct work_struct *work)
  273. {
  274. struct msmfb_info *msmfb =
  275. container_of(work, struct msmfb_info, resume_work);
  276. struct msm_panel_data *panel = msmfb->panel;
  277. unsigned long irq_flags;
  278. mutex_lock(&msmfb->panel_init_lock);
  279. DLOG(SUSPEND_RESUME, "turning on panel\n");
  280. if (msmfb->sleeping == UPDATING) {
  281. if (panel->unblank(panel)) {
  282. printk(KERN_INFO "msmfb: panel unblank failed,"
  283. "not starting drawing\n");
  284. goto error;
  285. }
  286. spin_lock_irqsave(&msmfb->update_lock, irq_flags);
  287. msmfb->sleeping = AWAKE;
  288. wake_up(&msmfb->frame_wq);
  289. spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
  290. }
  291. error:
  292. mutex_unlock(&msmfb->panel_init_lock);
  293. }
  294. static int msmfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
  295. {
  296. if ((var->xres != info->var.xres) ||
  297. (var->yres != info->var.yres) ||
  298. (var->xres_virtual != info->var.xres_virtual) ||
  299. (var->yres_virtual != info->var.yres_virtual) ||
  300. (var->xoffset != info->var.xoffset) ||
  301. (var->bits_per_pixel != info->var.bits_per_pixel) ||
  302. (var->grayscale != info->var.grayscale))
  303. return -EINVAL;
  304. return 0;
  305. }
  306. int msmfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
  307. {
  308. struct msmfb_info *msmfb = info->par;
  309. struct msm_panel_data *panel = msmfb->panel;
  310. /* "UPDT" */
  311. if ((panel->caps & MSMFB_CAP_PARTIAL_UPDATES) &&
  312. (var->reserved[0] == 0x54445055)) {
  313. msmfb_pan_update(info, var->reserved[1] & 0xffff,
  314. var->reserved[1] >> 16,
  315. var->reserved[2] & 0xffff,
  316. var->reserved[2] >> 16, var->yoffset, 1);
  317. } else {
  318. msmfb_pan_update(info, 0, 0, info->var.xres, info->var.yres,
  319. var->yoffset, 1);
  320. }
  321. return 0;
  322. }
  323. static void msmfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
  324. {
  325. cfb_fillrect(p, rect);
  326. msmfb_update(p, rect->dx, rect->dy, rect->dx + rect->width,
  327. rect->dy + rect->height);
  328. }
  329. static void msmfb_copyarea(struct fb_info *p, const struct fb_copyarea *area)
  330. {
  331. cfb_copyarea(p, area);
  332. msmfb_update(p, area->dx, area->dy, area->dx + area->width,
  333. area->dy + area->height);
  334. }
  335. static void msmfb_imageblit(struct fb_info *p, const struct fb_image *image)
  336. {
  337. cfb_imageblit(p, image);
  338. msmfb_update(p, image->dx, image->dy, image->dx + image->width,
  339. image->dy + image->height);
  340. }
  341. static int msmfb_blit(struct fb_info *info,
  342. void __user *p)
  343. {
  344. struct mdp_blit_req req;
  345. struct mdp_blit_req_list req_list;
  346. int i;
  347. int ret;
  348. if (copy_from_user(&req_list, p, sizeof(req_list)))
  349. return -EFAULT;
  350. for (i = 0; i < req_list.count; i++) {
  351. struct mdp_blit_req_list *list =
  352. (struct mdp_blit_req_list *)p;
  353. if (copy_from_user(&req, &list->req[i], sizeof(req)))
  354. return -EFAULT;
  355. ret = mdp->blit(mdp, info, &req);
  356. if (ret)
  357. return ret;
  358. }
  359. return 0;
  360. }
  361. DEFINE_MUTEX(mdp_ppp_lock);
  362. static int msmfb_ioctl(struct fb_info *p, unsigned int cmd, unsigned long arg)
  363. {
  364. void __user *argp = (void __user *)arg;
  365. int ret;
  366. switch (cmd) {
  367. case MSMFB_GRP_DISP:
  368. mdp->set_grp_disp(mdp, arg);
  369. break;
  370. case MSMFB_BLIT:
  371. ret = msmfb_blit(p, argp);
  372. if (ret)
  373. return ret;
  374. break;
  375. default:
  376. printk(KERN_INFO "msmfb unknown ioctl: %d\n", cmd);
  377. return -EINVAL;
  378. }
  379. return 0;
  380. }
  381. static struct fb_ops msmfb_ops = {
  382. .owner = THIS_MODULE,
  383. .fb_open = msmfb_open,
  384. .fb_release = msmfb_release,
  385. .fb_check_var = msmfb_check_var,
  386. .fb_pan_display = msmfb_pan_display,
  387. .fb_fillrect = msmfb_fillrect,
  388. .fb_copyarea = msmfb_copyarea,
  389. .fb_imageblit = msmfb_imageblit,
  390. .fb_ioctl = msmfb_ioctl,
  391. };
  392. static unsigned PP[16];
  393. #define BITS_PER_PIXEL 16
  394. static void setup_fb_info(struct msmfb_info *msmfb)
  395. {
  396. struct fb_info *fb_info = msmfb->fb;
  397. int r;
  398. /* finish setting up the fb_info struct */
  399. strncpy(fb_info->fix.id, "msmfb", 16);
  400. fb_info->fix.ypanstep = 1;
  401. fb_info->fbops = &msmfb_ops;
  402. fb_info->flags = FBINFO_DEFAULT;
  403. fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
  404. fb_info->fix.visual = FB_VISUAL_TRUECOLOR;
  405. fb_info->fix.line_length = msmfb->xres * 2;
  406. fb_info->var.xres = msmfb->xres;
  407. fb_info->var.yres = msmfb->yres;
  408. fb_info->var.width = msmfb->panel->fb_data->width;
  409. fb_info->var.height = msmfb->panel->fb_data->height;
  410. fb_info->var.xres_virtual = msmfb->xres;
  411. fb_info->var.yres_virtual = msmfb->yres * 2;
  412. fb_info->var.bits_per_pixel = BITS_PER_PIXEL;
  413. fb_info->var.accel_flags = 0;
  414. fb_info->var.yoffset = 0;
  415. if (msmfb->panel->caps & MSMFB_CAP_PARTIAL_UPDATES) {
  416. fb_info->var.reserved[0] = 0x54445055;
  417. fb_info->var.reserved[1] = 0;
  418. fb_info->var.reserved[2] = (uint16_t)msmfb->xres |
  419. ((uint32_t)msmfb->yres << 16);
  420. }
  421. fb_info->var.red.offset = 11;
  422. fb_info->var.red.length = 5;
  423. fb_info->var.red.msb_right = 0;
  424. fb_info->var.green.offset = 5;
  425. fb_info->var.green.length = 6;
  426. fb_info->var.green.msb_right = 0;
  427. fb_info->var.blue.offset = 0;
  428. fb_info->var.blue.length = 5;
  429. fb_info->var.blue.msb_right = 0;
  430. r = fb_alloc_cmap(&fb_info->cmap, 16, 0);
  431. fb_info->pseudo_palette = PP;
  432. PP[0] = 0;
  433. for (r = 1; r < 16; r++)
  434. PP[r] = 0xffffffff;
  435. }
  436. static int setup_fbmem(struct msmfb_info *msmfb, struct platform_device *pdev)
  437. {
  438. struct fb_info *fb = msmfb->fb;
  439. struct resource *resource;
  440. unsigned long size = msmfb->xres * msmfb->yres *
  441. (BITS_PER_PIXEL >> 3) * 2;
  442. unsigned char *fbram;
  443. /* board file might have attached a resource describing an fb */
  444. resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  445. if (!resource)
  446. return -EINVAL;
  447. /* check the resource is large enough to fit the fb */
  448. if (resource->end - resource->start < size) {
  449. printk(KERN_ERR "allocated resource is too small for "
  450. "fb\n");
  451. return -ENOMEM;
  452. }
  453. fb->fix.smem_start = resource->start;
  454. fb->fix.smem_len = resource->end - resource->start;
  455. fbram = ioremap(resource->start,
  456. resource->end - resource->start);
  457. if (fbram == 0) {
  458. printk(KERN_ERR "msmfb: cannot allocate fbram!\n");
  459. return -ENOMEM;
  460. }
  461. fb->screen_base = fbram;
  462. return 0;
  463. }
  464. static int msmfb_probe(struct platform_device *pdev)
  465. {
  466. struct fb_info *fb;
  467. struct msmfb_info *msmfb;
  468. struct msm_panel_data *panel = pdev->dev.platform_data;
  469. int ret;
  470. if (!panel) {
  471. pr_err("msmfb_probe: no platform data\n");
  472. return -EINVAL;
  473. }
  474. if (!panel->fb_data) {
  475. pr_err("msmfb_probe: no fb_data\n");
  476. return -EINVAL;
  477. }
  478. fb = framebuffer_alloc(sizeof(struct msmfb_info), &pdev->dev);
  479. if (!fb)
  480. return -ENOMEM;
  481. msmfb = fb->par;
  482. msmfb->fb = fb;
  483. msmfb->panel = panel;
  484. msmfb->xres = panel->fb_data->xres;
  485. msmfb->yres = panel->fb_data->yres;
  486. ret = setup_fbmem(msmfb, pdev);
  487. if (ret)
  488. goto error_setup_fbmem;
  489. setup_fb_info(msmfb);
  490. spin_lock_init(&msmfb->update_lock);
  491. mutex_init(&msmfb->panel_init_lock);
  492. init_waitqueue_head(&msmfb->frame_wq);
  493. msmfb->resume_workqueue = create_workqueue("panel_on");
  494. if (msmfb->resume_workqueue == NULL) {
  495. printk(KERN_ERR "failed to create panel_on workqueue\n");
  496. ret = -ENOMEM;
  497. goto error_create_workqueue;
  498. }
  499. INIT_WORK(&msmfb->resume_work, power_on_panel);
  500. msmfb->black = kzalloc(msmfb->fb->var.bits_per_pixel*msmfb->xres,
  501. GFP_KERNEL);
  502. printk(KERN_INFO "msmfb_probe() installing %d x %d panel\n",
  503. msmfb->xres, msmfb->yres);
  504. msmfb->dma_callback.func = msmfb_handle_dma_interrupt;
  505. msmfb->vsync_callback.func = msmfb_handle_vsync_interrupt;
  506. hrtimer_init(&msmfb->fake_vsync, CLOCK_MONOTONIC,
  507. HRTIMER_MODE_REL);
  508. msmfb->fake_vsync.function = msmfb_fake_vsync;
  509. ret = register_framebuffer(fb);
  510. if (ret)
  511. goto error_register_framebuffer;
  512. msmfb->sleeping = WAKING;
  513. return 0;
  514. error_register_framebuffer:
  515. destroy_workqueue(msmfb->resume_workqueue);
  516. error_create_workqueue:
  517. iounmap(fb->screen_base);
  518. error_setup_fbmem:
  519. framebuffer_release(msmfb->fb);
  520. return ret;
  521. }
  522. static struct platform_driver msm_panel_driver = {
  523. /* need to write remove */
  524. .probe = msmfb_probe,
  525. .driver = {.name = "msm_panel"},
  526. };
  527. static int msmfb_add_mdp_device(struct device *dev,
  528. struct class_interface *class_intf)
  529. {
  530. /* might need locking if mulitple mdp devices */
  531. if (mdp)
  532. return 0;
  533. mdp = container_of(dev, struct mdp_device, dev);
  534. return platform_driver_register(&msm_panel_driver);
  535. }
  536. static void msmfb_remove_mdp_device(struct device *dev,
  537. struct class_interface *class_intf)
  538. {
  539. /* might need locking if mulitple mdp devices */
  540. if (dev != &mdp->dev)
  541. return;
  542. platform_driver_unregister(&msm_panel_driver);
  543. mdp = NULL;
  544. }
  545. static struct class_interface msm_fb_interface = {
  546. .add_dev = &msmfb_add_mdp_device,
  547. .remove_dev = &msmfb_remove_mdp_device,
  548. };
  549. static int __init msmfb_init(void)
  550. {
  551. return register_mdp_client(&msm_fb_interface);
  552. }
  553. module_init(msmfb_init);