nouveau_fbcon.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. /*
  2. * Copyright © 2007 David Airlie
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. * DEALINGS IN THE SOFTWARE.
  22. *
  23. * Authors:
  24. * David Airlie
  25. */
  26. #include <linux/module.h>
  27. #include <linux/kernel.h>
  28. #include <linux/errno.h>
  29. #include <linux/string.h>
  30. #include <linux/mm.h>
  31. #include <linux/tty.h>
  32. #include <linux/sysrq.h>
  33. #include <linux/delay.h>
  34. #include <linux/fb.h>
  35. #include <linux/init.h>
  36. #include <linux/screen_info.h>
  37. #include <linux/vga_switcheroo.h>
  38. #include <linux/console.h>
  39. #include <drm/drmP.h>
  40. #include <drm/drm_crtc.h>
  41. #include <drm/drm_crtc_helper.h>
  42. #include <drm/drm_fb_helper.h>
  43. #include "nouveau_drm.h"
  44. #include "nouveau_gem.h"
  45. #include "nouveau_bo.h"
  46. #include "nouveau_fbcon.h"
  47. #include "nouveau_chan.h"
  48. #include "nouveau_crtc.h"
  49. MODULE_PARM_DESC(nofbaccel, "Disable fbcon acceleration");
  50. int nouveau_nofbaccel = 0;
  51. module_param_named(nofbaccel, nouveau_nofbaccel, int, 0400);
  52. static void
  53. nouveau_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
  54. {
  55. struct nouveau_fbdev *fbcon = info->par;
  56. struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
  57. struct nvif_device *device = &drm->device;
  58. int ret;
  59. if (info->state != FBINFO_STATE_RUNNING)
  60. return;
  61. ret = -ENODEV;
  62. if (!in_interrupt() && !(info->flags & FBINFO_HWACCEL_DISABLED) &&
  63. mutex_trylock(&drm->client.mutex)) {
  64. if (device->info.family < NV_DEVICE_INFO_V0_TESLA)
  65. ret = nv04_fbcon_fillrect(info, rect);
  66. else
  67. if (device->info.family < NV_DEVICE_INFO_V0_FERMI)
  68. ret = nv50_fbcon_fillrect(info, rect);
  69. else
  70. ret = nvc0_fbcon_fillrect(info, rect);
  71. mutex_unlock(&drm->client.mutex);
  72. }
  73. if (ret == 0)
  74. return;
  75. if (ret != -ENODEV)
  76. nouveau_fbcon_gpu_lockup(info);
  77. cfb_fillrect(info, rect);
  78. }
  79. static void
  80. nouveau_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *image)
  81. {
  82. struct nouveau_fbdev *fbcon = info->par;
  83. struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
  84. struct nvif_device *device = &drm->device;
  85. int ret;
  86. if (info->state != FBINFO_STATE_RUNNING)
  87. return;
  88. ret = -ENODEV;
  89. if (!in_interrupt() && !(info->flags & FBINFO_HWACCEL_DISABLED) &&
  90. mutex_trylock(&drm->client.mutex)) {
  91. if (device->info.family < NV_DEVICE_INFO_V0_TESLA)
  92. ret = nv04_fbcon_copyarea(info, image);
  93. else
  94. if (device->info.family < NV_DEVICE_INFO_V0_FERMI)
  95. ret = nv50_fbcon_copyarea(info, image);
  96. else
  97. ret = nvc0_fbcon_copyarea(info, image);
  98. mutex_unlock(&drm->client.mutex);
  99. }
  100. if (ret == 0)
  101. return;
  102. if (ret != -ENODEV)
  103. nouveau_fbcon_gpu_lockup(info);
  104. cfb_copyarea(info, image);
  105. }
  106. static void
  107. nouveau_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
  108. {
  109. struct nouveau_fbdev *fbcon = info->par;
  110. struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
  111. struct nvif_device *device = &drm->device;
  112. int ret;
  113. if (info->state != FBINFO_STATE_RUNNING)
  114. return;
  115. ret = -ENODEV;
  116. if (!in_interrupt() && !(info->flags & FBINFO_HWACCEL_DISABLED) &&
  117. mutex_trylock(&drm->client.mutex)) {
  118. if (device->info.family < NV_DEVICE_INFO_V0_TESLA)
  119. ret = nv04_fbcon_imageblit(info, image);
  120. else
  121. if (device->info.family < NV_DEVICE_INFO_V0_FERMI)
  122. ret = nv50_fbcon_imageblit(info, image);
  123. else
  124. ret = nvc0_fbcon_imageblit(info, image);
  125. mutex_unlock(&drm->client.mutex);
  126. }
  127. if (ret == 0)
  128. return;
  129. if (ret != -ENODEV)
  130. nouveau_fbcon_gpu_lockup(info);
  131. cfb_imageblit(info, image);
  132. }
  133. static int
  134. nouveau_fbcon_sync(struct fb_info *info)
  135. {
  136. struct nouveau_fbdev *fbcon = info->par;
  137. struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
  138. struct nouveau_channel *chan = drm->channel;
  139. int ret;
  140. if (!chan || !chan->accel_done || in_interrupt() ||
  141. info->state != FBINFO_STATE_RUNNING ||
  142. info->flags & FBINFO_HWACCEL_DISABLED)
  143. return 0;
  144. if (!mutex_trylock(&drm->client.mutex))
  145. return 0;
  146. ret = nouveau_channel_idle(chan);
  147. mutex_unlock(&drm->client.mutex);
  148. if (ret) {
  149. nouveau_fbcon_gpu_lockup(info);
  150. return 0;
  151. }
  152. chan->accel_done = false;
  153. return 0;
  154. }
  155. static struct fb_ops nouveau_fbcon_ops = {
  156. .owner = THIS_MODULE,
  157. .fb_check_var = drm_fb_helper_check_var,
  158. .fb_set_par = drm_fb_helper_set_par,
  159. .fb_fillrect = nouveau_fbcon_fillrect,
  160. .fb_copyarea = nouveau_fbcon_copyarea,
  161. .fb_imageblit = nouveau_fbcon_imageblit,
  162. .fb_sync = nouveau_fbcon_sync,
  163. .fb_pan_display = drm_fb_helper_pan_display,
  164. .fb_blank = drm_fb_helper_blank,
  165. .fb_setcmap = drm_fb_helper_setcmap,
  166. .fb_debug_enter = drm_fb_helper_debug_enter,
  167. .fb_debug_leave = drm_fb_helper_debug_leave,
  168. };
  169. static struct fb_ops nouveau_fbcon_sw_ops = {
  170. .owner = THIS_MODULE,
  171. .fb_check_var = drm_fb_helper_check_var,
  172. .fb_set_par = drm_fb_helper_set_par,
  173. .fb_fillrect = cfb_fillrect,
  174. .fb_copyarea = cfb_copyarea,
  175. .fb_imageblit = cfb_imageblit,
  176. .fb_pan_display = drm_fb_helper_pan_display,
  177. .fb_blank = drm_fb_helper_blank,
  178. .fb_setcmap = drm_fb_helper_setcmap,
  179. .fb_debug_enter = drm_fb_helper_debug_enter,
  180. .fb_debug_leave = drm_fb_helper_debug_leave,
  181. };
  182. void
  183. nouveau_fbcon_accel_save_disable(struct drm_device *dev)
  184. {
  185. struct nouveau_drm *drm = nouveau_drm(dev);
  186. if (drm->fbcon) {
  187. drm->fbcon->saved_flags = drm->fbcon->helper.fbdev->flags;
  188. drm->fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
  189. }
  190. }
  191. void
  192. nouveau_fbcon_accel_restore(struct drm_device *dev)
  193. {
  194. struct nouveau_drm *drm = nouveau_drm(dev);
  195. if (drm->fbcon) {
  196. drm->fbcon->helper.fbdev->flags = drm->fbcon->saved_flags;
  197. }
  198. }
  199. static void
  200. nouveau_fbcon_accel_fini(struct drm_device *dev)
  201. {
  202. struct nouveau_drm *drm = nouveau_drm(dev);
  203. struct nouveau_fbdev *fbcon = drm->fbcon;
  204. if (fbcon && drm->channel) {
  205. console_lock();
  206. fbcon->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED;
  207. console_unlock();
  208. nouveau_channel_idle(drm->channel);
  209. nvif_object_fini(&fbcon->twod);
  210. nvif_object_fini(&fbcon->blit);
  211. nvif_object_fini(&fbcon->gdi);
  212. nvif_object_fini(&fbcon->patt);
  213. nvif_object_fini(&fbcon->rop);
  214. nvif_object_fini(&fbcon->clip);
  215. nvif_object_fini(&fbcon->surf2d);
  216. }
  217. }
  218. static void
  219. nouveau_fbcon_accel_init(struct drm_device *dev)
  220. {
  221. struct nouveau_drm *drm = nouveau_drm(dev);
  222. struct nouveau_fbdev *fbcon = drm->fbcon;
  223. struct fb_info *info = fbcon->helper.fbdev;
  224. int ret;
  225. if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA)
  226. ret = nv04_fbcon_accel_init(info);
  227. else
  228. if (drm->device.info.family < NV_DEVICE_INFO_V0_FERMI)
  229. ret = nv50_fbcon_accel_init(info);
  230. else
  231. ret = nvc0_fbcon_accel_init(info);
  232. if (ret == 0)
  233. info->fbops = &nouveau_fbcon_ops;
  234. }
  235. static void nouveau_fbcon_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
  236. u16 blue, int regno)
  237. {
  238. struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
  239. nv_crtc->lut.r[regno] = red;
  240. nv_crtc->lut.g[regno] = green;
  241. nv_crtc->lut.b[regno] = blue;
  242. }
  243. static void nouveau_fbcon_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
  244. u16 *blue, int regno)
  245. {
  246. struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
  247. *red = nv_crtc->lut.r[regno];
  248. *green = nv_crtc->lut.g[regno];
  249. *blue = nv_crtc->lut.b[regno];
  250. }
  251. static void
  252. nouveau_fbcon_zfill(struct drm_device *dev, struct nouveau_fbdev *fbcon)
  253. {
  254. struct fb_info *info = fbcon->helper.fbdev;
  255. struct fb_fillrect rect;
  256. /* Clear the entire fbcon. The drm will program every connector
  257. * with it's preferred mode. If the sizes differ, one display will
  258. * quite likely have garbage around the console.
  259. */
  260. rect.dx = rect.dy = 0;
  261. rect.width = info->var.xres_virtual;
  262. rect.height = info->var.yres_virtual;
  263. rect.color = 0;
  264. rect.rop = ROP_COPY;
  265. info->fbops->fb_fillrect(info, &rect);
  266. }
  267. static int
  268. nouveau_fbcon_create(struct drm_fb_helper *helper,
  269. struct drm_fb_helper_surface_size *sizes)
  270. {
  271. struct nouveau_fbdev *fbcon =
  272. container_of(helper, struct nouveau_fbdev, helper);
  273. struct drm_device *dev = fbcon->dev;
  274. struct nouveau_drm *drm = nouveau_drm(dev);
  275. struct nvif_device *device = &drm->device;
  276. struct fb_info *info;
  277. struct drm_framebuffer *fb;
  278. struct nouveau_framebuffer *nouveau_fb;
  279. struct nouveau_channel *chan;
  280. struct nouveau_bo *nvbo;
  281. struct drm_mode_fb_cmd2 mode_cmd;
  282. struct pci_dev *pdev = dev->pdev;
  283. int size, ret;
  284. mode_cmd.width = sizes->surface_width;
  285. mode_cmd.height = sizes->surface_height;
  286. mode_cmd.pitches[0] = mode_cmd.width * (sizes->surface_bpp >> 3);
  287. mode_cmd.pitches[0] = roundup(mode_cmd.pitches[0], 256);
  288. mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
  289. sizes->surface_depth);
  290. size = mode_cmd.pitches[0] * mode_cmd.height;
  291. size = roundup(size, PAGE_SIZE);
  292. ret = nouveau_gem_new(dev, size, 0, NOUVEAU_GEM_DOMAIN_VRAM,
  293. 0, 0x0000, &nvbo);
  294. if (ret) {
  295. NV_ERROR(drm, "failed to allocate framebuffer\n");
  296. goto out;
  297. }
  298. ret = nouveau_bo_pin(nvbo, TTM_PL_FLAG_VRAM, false);
  299. if (ret) {
  300. NV_ERROR(drm, "failed to pin fb: %d\n", ret);
  301. goto out_unref;
  302. }
  303. ret = nouveau_bo_map(nvbo);
  304. if (ret) {
  305. NV_ERROR(drm, "failed to map fb: %d\n", ret);
  306. goto out_unpin;
  307. }
  308. chan = nouveau_nofbaccel ? NULL : drm->channel;
  309. if (chan && device->info.family >= NV_DEVICE_INFO_V0_TESLA) {
  310. ret = nouveau_bo_vma_add(nvbo, drm->client.vm,
  311. &fbcon->nouveau_fb.vma);
  312. if (ret) {
  313. NV_ERROR(drm, "failed to map fb into chan: %d\n", ret);
  314. chan = NULL;
  315. }
  316. }
  317. mutex_lock(&dev->struct_mutex);
  318. info = framebuffer_alloc(0, &pdev->dev);
  319. if (!info) {
  320. ret = -ENOMEM;
  321. goto out_unlock;
  322. }
  323. ret = fb_alloc_cmap(&info->cmap, 256, 0);
  324. if (ret) {
  325. ret = -ENOMEM;
  326. framebuffer_release(info);
  327. goto out_unlock;
  328. }
  329. info->par = fbcon;
  330. nouveau_framebuffer_init(dev, &fbcon->nouveau_fb, &mode_cmd, nvbo);
  331. nouveau_fb = &fbcon->nouveau_fb;
  332. fb = &nouveau_fb->base;
  333. /* setup helper */
  334. fbcon->helper.fb = fb;
  335. fbcon->helper.fbdev = info;
  336. strcpy(info->fix.id, "nouveaufb");
  337. if (!chan)
  338. info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_DISABLED;
  339. else
  340. info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA |
  341. FBINFO_HWACCEL_FILLRECT |
  342. FBINFO_HWACCEL_IMAGEBLIT;
  343. info->flags |= FBINFO_CAN_FORCE_OUTPUT;
  344. info->fbops = &nouveau_fbcon_sw_ops;
  345. info->fix.smem_start = nvbo->bo.mem.bus.base +
  346. nvbo->bo.mem.bus.offset;
  347. info->fix.smem_len = size;
  348. info->screen_base = nvbo_kmap_obj_iovirtual(nouveau_fb->nvbo);
  349. info->screen_size = size;
  350. drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
  351. drm_fb_helper_fill_var(info, &fbcon->helper, sizes->fb_width, sizes->fb_height);
  352. /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */
  353. mutex_unlock(&dev->struct_mutex);
  354. if (chan)
  355. nouveau_fbcon_accel_init(dev);
  356. nouveau_fbcon_zfill(dev, fbcon);
  357. /* To allow resizeing without swapping buffers */
  358. NV_INFO(drm, "allocated %dx%d fb: 0x%lx, bo %p\n",
  359. nouveau_fb->base.width, nouveau_fb->base.height,
  360. nvbo->bo.offset, nvbo);
  361. vga_switcheroo_client_fb_set(dev->pdev, info);
  362. return 0;
  363. out_unlock:
  364. mutex_unlock(&dev->struct_mutex);
  365. if (chan)
  366. nouveau_bo_vma_del(nvbo, &fbcon->nouveau_fb.vma);
  367. nouveau_bo_unmap(nvbo);
  368. out_unpin:
  369. nouveau_bo_unpin(nvbo);
  370. out_unref:
  371. nouveau_bo_ref(NULL, &nvbo);
  372. out:
  373. return ret;
  374. }
  375. void
  376. nouveau_fbcon_output_poll_changed(struct drm_device *dev)
  377. {
  378. struct nouveau_drm *drm = nouveau_drm(dev);
  379. if (drm->fbcon)
  380. drm_fb_helper_hotplug_event(&drm->fbcon->helper);
  381. }
  382. static int
  383. nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *fbcon)
  384. {
  385. struct nouveau_framebuffer *nouveau_fb = &fbcon->nouveau_fb;
  386. struct fb_info *info;
  387. if (fbcon->helper.fbdev) {
  388. info = fbcon->helper.fbdev;
  389. unregister_framebuffer(info);
  390. if (info->cmap.len)
  391. fb_dealloc_cmap(&info->cmap);
  392. framebuffer_release(info);
  393. }
  394. if (nouveau_fb->nvbo) {
  395. nouveau_bo_unmap(nouveau_fb->nvbo);
  396. nouveau_bo_vma_del(nouveau_fb->nvbo, &nouveau_fb->vma);
  397. nouveau_bo_unpin(nouveau_fb->nvbo);
  398. drm_gem_object_unreference_unlocked(&nouveau_fb->nvbo->gem);
  399. nouveau_fb->nvbo = NULL;
  400. }
  401. drm_fb_helper_fini(&fbcon->helper);
  402. drm_framebuffer_unregister_private(&nouveau_fb->base);
  403. drm_framebuffer_cleanup(&nouveau_fb->base);
  404. return 0;
  405. }
  406. void nouveau_fbcon_gpu_lockup(struct fb_info *info)
  407. {
  408. struct nouveau_fbdev *fbcon = info->par;
  409. struct nouveau_drm *drm = nouveau_drm(fbcon->dev);
  410. NV_ERROR(drm, "GPU lockup - switching to software fbcon\n");
  411. info->flags |= FBINFO_HWACCEL_DISABLED;
  412. }
  413. static const struct drm_fb_helper_funcs nouveau_fbcon_helper_funcs = {
  414. .gamma_set = nouveau_fbcon_gamma_set,
  415. .gamma_get = nouveau_fbcon_gamma_get,
  416. .fb_probe = nouveau_fbcon_create,
  417. };
  418. static void
  419. nouveau_fbcon_set_suspend_work(struct work_struct *work)
  420. {
  421. struct nouveau_fbdev *fbcon = container_of(work, typeof(*fbcon), work);
  422. console_lock();
  423. nouveau_fbcon_accel_restore(fbcon->dev);
  424. nouveau_fbcon_zfill(fbcon->dev, fbcon);
  425. fb_set_suspend(fbcon->helper.fbdev, FBINFO_STATE_RUNNING);
  426. console_unlock();
  427. }
  428. void
  429. nouveau_fbcon_set_suspend(struct drm_device *dev, int state)
  430. {
  431. struct nouveau_drm *drm = nouveau_drm(dev);
  432. if (drm->fbcon) {
  433. if (state == FBINFO_STATE_RUNNING) {
  434. schedule_work(&drm->fbcon->work);
  435. return;
  436. }
  437. flush_work(&drm->fbcon->work);
  438. console_lock();
  439. fb_set_suspend(drm->fbcon->helper.fbdev, state);
  440. nouveau_fbcon_accel_save_disable(dev);
  441. console_unlock();
  442. }
  443. }
  444. int
  445. nouveau_fbcon_init(struct drm_device *dev)
  446. {
  447. struct nouveau_drm *drm = nouveau_drm(dev);
  448. struct nouveau_fbdev *fbcon;
  449. int preferred_bpp;
  450. int ret;
  451. if (!dev->mode_config.num_crtc ||
  452. (dev->pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
  453. return 0;
  454. fbcon = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL);
  455. if (!fbcon)
  456. return -ENOMEM;
  457. INIT_WORK(&fbcon->work, nouveau_fbcon_set_suspend_work);
  458. fbcon->dev = dev;
  459. drm->fbcon = fbcon;
  460. drm_fb_helper_prepare(dev, &fbcon->helper, &nouveau_fbcon_helper_funcs);
  461. ret = drm_fb_helper_init(dev, &fbcon->helper,
  462. dev->mode_config.num_crtc, 4);
  463. if (ret) {
  464. kfree(fbcon);
  465. return ret;
  466. }
  467. drm_fb_helper_single_add_all_connectors(&fbcon->helper);
  468. if (drm->device.info.ram_size <= 32 * 1024 * 1024)
  469. preferred_bpp = 8;
  470. else
  471. if (drm->device.info.ram_size <= 64 * 1024 * 1024)
  472. preferred_bpp = 16;
  473. else
  474. preferred_bpp = 32;
  475. /* disable all the possible outputs/crtcs before entering KMS mode */
  476. drm_helper_disable_unused_functions(dev);
  477. drm_fb_helper_initial_config(&fbcon->helper, preferred_bpp);
  478. return 0;
  479. }
  480. void
  481. nouveau_fbcon_fini(struct drm_device *dev)
  482. {
  483. struct nouveau_drm *drm = nouveau_drm(dev);
  484. if (!drm->fbcon)
  485. return;
  486. nouveau_fbcon_accel_fini(dev);
  487. nouveau_fbcon_destroy(dev, drm->fbcon);
  488. kfree(drm->fbcon);
  489. drm->fbcon = NULL;
  490. }