drm_fops.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. /**
  2. * \file drm_fops.c
  3. * File operations for DRM
  4. *
  5. * \author Rickard E. (Rik) Faith <faith@valinux.com>
  6. * \author Daryll Strauss <daryll@valinux.com>
  7. * \author Gareth Hughes <gareth@valinux.com>
  8. */
  9. /*
  10. * Created: Mon Jan 4 08:58:31 1999 by faith@valinux.com
  11. *
  12. * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
  13. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  14. * All Rights Reserved.
  15. *
  16. * Permission is hereby granted, free of charge, to any person obtaining a
  17. * copy of this software and associated documentation files (the "Software"),
  18. * to deal in the Software without restriction, including without limitation
  19. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  20. * and/or sell copies of the Software, and to permit persons to whom the
  21. * Software is furnished to do so, subject to the following conditions:
  22. *
  23. * The above copyright notice and this permission notice (including the next
  24. * paragraph) shall be included in all copies or substantial portions of the
  25. * Software.
  26. *
  27. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  28. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  29. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  30. * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  31. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  32. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  33. * OTHER DEALINGS IN THE SOFTWARE.
  34. */
  35. #include <drm/drmP.h>
  36. #include <linux/poll.h>
  37. #include <linux/slab.h>
  38. #include <linux/module.h>
  39. /* from BKL pushdown: note that nothing else serializes idr_find() */
  40. DEFINE_MUTEX(drm_global_mutex);
  41. EXPORT_SYMBOL(drm_global_mutex);
  42. static int drm_open_helper(struct inode *inode, struct file *filp,
  43. struct drm_device * dev);
  44. static int drm_setup(struct drm_device * dev)
  45. {
  46. int ret;
  47. if (dev->driver->firstopen &&
  48. !drm_core_check_feature(dev, DRIVER_MODESET)) {
  49. ret = dev->driver->firstopen(dev);
  50. if (ret != 0)
  51. return ret;
  52. }
  53. ret = drm_legacy_dma_setup(dev);
  54. if (ret < 0)
  55. return ret;
  56. DRM_DEBUG("\n");
  57. return 0;
  58. }
  59. /**
  60. * Open file.
  61. *
  62. * \param inode device inode
  63. * \param filp file pointer.
  64. * \return zero on success or a negative number on failure.
  65. *
  66. * Searches the DRM device with the same minor number, calls open_helper(), and
  67. * increments the device open count. If the open count was previous at zero,
  68. * i.e., it's the first that the device is open, then calls setup().
  69. */
  70. int drm_open(struct inode *inode, struct file *filp)
  71. {
  72. struct drm_device *dev = NULL;
  73. int minor_id = iminor(inode);
  74. struct drm_minor *minor;
  75. int retcode = 0;
  76. int need_setup = 0;
  77. struct address_space *old_mapping;
  78. struct address_space *old_imapping;
  79. minor = idr_find(&drm_minors_idr, minor_id);
  80. if (!minor)
  81. return -ENODEV;
  82. if (!(dev = minor->dev))
  83. return -ENODEV;
  84. if (drm_device_is_unplugged(dev))
  85. return -ENODEV;
  86. if (!dev->open_count++)
  87. need_setup = 1;
  88. mutex_lock(&dev->struct_mutex);
  89. old_imapping = inode->i_mapping;
  90. old_mapping = dev->dev_mapping;
  91. if (old_mapping == NULL)
  92. dev->dev_mapping = &inode->i_data;
  93. /* ihold ensures nobody can remove inode with our i_data */
  94. ihold(container_of(dev->dev_mapping, struct inode, i_data));
  95. inode->i_mapping = dev->dev_mapping;
  96. filp->f_mapping = dev->dev_mapping;
  97. mutex_unlock(&dev->struct_mutex);
  98. retcode = drm_open_helper(inode, filp, dev);
  99. if (retcode)
  100. goto err_undo;
  101. if (need_setup) {
  102. retcode = drm_setup(dev);
  103. if (retcode)
  104. goto err_undo;
  105. }
  106. return 0;
  107. err_undo:
  108. mutex_lock(&dev->struct_mutex);
  109. filp->f_mapping = old_imapping;
  110. inode->i_mapping = old_imapping;
  111. iput(container_of(dev->dev_mapping, struct inode, i_data));
  112. dev->dev_mapping = old_mapping;
  113. mutex_unlock(&dev->struct_mutex);
  114. dev->open_count--;
  115. return retcode;
  116. }
  117. EXPORT_SYMBOL(drm_open);
  118. /**
  119. * File \c open operation.
  120. *
  121. * \param inode device inode.
  122. * \param filp file pointer.
  123. *
  124. * Puts the dev->fops corresponding to the device minor number into
  125. * \p filp, call the \c open method, and restore the file operations.
  126. */
  127. int drm_stub_open(struct inode *inode, struct file *filp)
  128. {
  129. struct drm_device *dev = NULL;
  130. struct drm_minor *minor;
  131. int minor_id = iminor(inode);
  132. int err = -ENODEV;
  133. const struct file_operations *old_fops;
  134. DRM_DEBUG("\n");
  135. mutex_lock(&drm_global_mutex);
  136. minor = idr_find(&drm_minors_idr, minor_id);
  137. if (!minor)
  138. goto out;
  139. if (!(dev = minor->dev))
  140. goto out;
  141. if (drm_device_is_unplugged(dev))
  142. goto out;
  143. old_fops = filp->f_op;
  144. filp->f_op = fops_get(dev->driver->fops);
  145. if (filp->f_op == NULL) {
  146. filp->f_op = old_fops;
  147. goto out;
  148. }
  149. if (filp->f_op->open && (err = filp->f_op->open(inode, filp))) {
  150. fops_put(filp->f_op);
  151. filp->f_op = fops_get(old_fops);
  152. }
  153. fops_put(old_fops);
  154. out:
  155. mutex_unlock(&drm_global_mutex);
  156. return err;
  157. }
  158. /**
  159. * Check whether DRI will run on this CPU.
  160. *
  161. * \return non-zero if the DRI will run on this CPU, or zero otherwise.
  162. */
  163. static int drm_cpu_valid(void)
  164. {
  165. #if defined(__i386__)
  166. if (boot_cpu_data.x86 == 3)
  167. return 0; /* No cmpxchg on a 386 */
  168. #endif
  169. #if defined(__sparc__) && !defined(__sparc_v9__)
  170. return 0; /* No cmpxchg before v9 sparc. */
  171. #endif
  172. return 1;
  173. }
  174. /**
  175. * Called whenever a process opens /dev/drm.
  176. *
  177. * \param inode device inode.
  178. * \param filp file pointer.
  179. * \param dev device.
  180. * \return zero on success or a negative number on failure.
  181. *
  182. * Creates and initializes a drm_file structure for the file private data in \p
  183. * filp and add it into the double linked list in \p dev.
  184. */
  185. static int drm_open_helper(struct inode *inode, struct file *filp,
  186. struct drm_device * dev)
  187. {
  188. int minor_id = iminor(inode);
  189. struct drm_file *priv;
  190. int ret;
  191. if (filp->f_flags & O_EXCL)
  192. return -EBUSY; /* No exclusive opens */
  193. if (!drm_cpu_valid())
  194. return -EINVAL;
  195. if (dev->switch_power_state != DRM_SWITCH_POWER_ON && dev->switch_power_state != DRM_SWITCH_POWER_DYNAMIC_OFF)
  196. return -EINVAL;
  197. DRM_DEBUG("pid = %d, minor = %d\n", task_pid_nr(current), minor_id);
  198. priv = kzalloc(sizeof(*priv), GFP_KERNEL);
  199. if (!priv)
  200. return -ENOMEM;
  201. filp->private_data = priv;
  202. priv->filp = filp;
  203. priv->uid = current_euid();
  204. priv->pid = get_pid(task_pid(current));
  205. priv->minor = idr_find(&drm_minors_idr, minor_id);
  206. if (!priv->minor) {
  207. ret = -ENODEV;
  208. goto out_put_pid;
  209. }
  210. priv->ioctl_count = 0;
  211. /* for compatibility root is always authenticated */
  212. priv->authenticated = capable(CAP_SYS_ADMIN);
  213. priv->lock_count = 0;
  214. INIT_LIST_HEAD(&priv->lhead);
  215. INIT_LIST_HEAD(&priv->fbs);
  216. mutex_init(&priv->fbs_lock);
  217. INIT_LIST_HEAD(&priv->event_list);
  218. init_waitqueue_head(&priv->event_wait);
  219. priv->event_space = 4096; /* set aside 4k for event buffer */
  220. if (dev->driver->driver_features & DRIVER_GEM)
  221. drm_gem_open(dev, priv);
  222. if (drm_core_check_feature(dev, DRIVER_PRIME))
  223. drm_prime_init_file_private(&priv->prime);
  224. if (dev->driver->open) {
  225. ret = dev->driver->open(dev, priv);
  226. if (ret < 0)
  227. goto out_prime_destroy;
  228. }
  229. /* if there is no current master make this fd it, but do not create
  230. * any master object for render clients */
  231. mutex_lock(&dev->struct_mutex);
  232. if (!priv->minor->master && !drm_is_render_client(priv)) {
  233. /* create a new master */
  234. priv->minor->master = drm_master_create(priv->minor);
  235. if (!priv->minor->master) {
  236. mutex_unlock(&dev->struct_mutex);
  237. ret = -ENOMEM;
  238. goto out_close;
  239. }
  240. priv->is_master = 1;
  241. /* take another reference for the copy in the local file priv */
  242. priv->master = drm_master_get(priv->minor->master);
  243. priv->authenticated = 1;
  244. mutex_unlock(&dev->struct_mutex);
  245. if (dev->driver->master_create) {
  246. ret = dev->driver->master_create(dev, priv->master);
  247. if (ret) {
  248. mutex_lock(&dev->struct_mutex);
  249. /* drop both references if this fails */
  250. drm_master_put(&priv->minor->master);
  251. drm_master_put(&priv->master);
  252. mutex_unlock(&dev->struct_mutex);
  253. goto out_close;
  254. }
  255. }
  256. mutex_lock(&dev->struct_mutex);
  257. if (dev->driver->master_set) {
  258. ret = dev->driver->master_set(dev, priv, true);
  259. if (ret) {
  260. /* drop both references if this fails */
  261. drm_master_put(&priv->minor->master);
  262. drm_master_put(&priv->master);
  263. mutex_unlock(&dev->struct_mutex);
  264. goto out_close;
  265. }
  266. }
  267. } else if (!drm_is_render_client(priv)) {
  268. /* get a reference to the master */
  269. priv->master = drm_master_get(priv->minor->master);
  270. }
  271. mutex_unlock(&dev->struct_mutex);
  272. mutex_lock(&dev->struct_mutex);
  273. list_add(&priv->lhead, &dev->filelist);
  274. mutex_unlock(&dev->struct_mutex);
  275. #ifdef __alpha__
  276. /*
  277. * Default the hose
  278. */
  279. if (!dev->hose) {
  280. struct pci_dev *pci_dev;
  281. pci_dev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, NULL);
  282. if (pci_dev) {
  283. dev->hose = pci_dev->sysdata;
  284. pci_dev_put(pci_dev);
  285. }
  286. if (!dev->hose) {
  287. struct pci_bus *b = pci_bus_b(pci_root_buses.next);
  288. if (b)
  289. dev->hose = b->sysdata;
  290. }
  291. }
  292. #endif
  293. return 0;
  294. out_close:
  295. if (dev->driver->postclose)
  296. dev->driver->postclose(dev, priv);
  297. out_prime_destroy:
  298. if (drm_core_check_feature(dev, DRIVER_PRIME))
  299. drm_prime_destroy_file_private(&priv->prime);
  300. if (dev->driver->driver_features & DRIVER_GEM)
  301. drm_gem_release(dev, priv);
  302. out_put_pid:
  303. put_pid(priv->pid);
  304. kfree(priv);
  305. filp->private_data = NULL;
  306. return ret;
  307. }
  308. static void drm_master_release(struct drm_device *dev, struct file *filp)
  309. {
  310. struct drm_file *file_priv = filp->private_data;
  311. if (drm_i_have_hw_lock(dev, file_priv)) {
  312. DRM_DEBUG("File %p released, freeing lock for context %d\n",
  313. filp, _DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock));
  314. drm_lock_free(&file_priv->master->lock,
  315. _DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock));
  316. }
  317. }
  318. static void drm_events_release(struct drm_file *file_priv)
  319. {
  320. struct drm_device *dev = file_priv->minor->dev;
  321. struct drm_pending_event *e, *et;
  322. struct drm_pending_vblank_event *v, *vt;
  323. unsigned long flags;
  324. spin_lock_irqsave(&dev->event_lock, flags);
  325. /* Remove pending flips */
  326. list_for_each_entry_safe(v, vt, &dev->vblank_event_list, base.link)
  327. if (v->base.file_priv == file_priv) {
  328. list_del(&v->base.link);
  329. drm_vblank_put(dev, v->pipe);
  330. v->base.destroy(&v->base);
  331. }
  332. /* Remove unconsumed events */
  333. list_for_each_entry_safe(e, et, &file_priv->event_list, link)
  334. e->destroy(e);
  335. spin_unlock_irqrestore(&dev->event_lock, flags);
  336. }
  337. /**
  338. * drm_legacy_dev_reinit
  339. *
  340. * Reinitializes a legacy/ums drm device in it's lastclose function.
  341. */
  342. static void drm_legacy_dev_reinit(struct drm_device *dev)
  343. {
  344. if (drm_core_check_feature(dev, DRIVER_MODESET))
  345. return;
  346. atomic_set(&dev->ioctl_count, 0);
  347. atomic_set(&dev->vma_count, 0);
  348. dev->sigdata.lock = NULL;
  349. dev->context_flag = 0;
  350. dev->last_context = 0;
  351. dev->if_version = 0;
  352. }
  353. /**
  354. * Take down the DRM device.
  355. *
  356. * \param dev DRM device structure.
  357. *
  358. * Frees every resource in \p dev.
  359. *
  360. * \sa drm_device
  361. */
  362. int drm_lastclose(struct drm_device * dev)
  363. {
  364. struct drm_vma_entry *vma, *vma_temp;
  365. DRM_DEBUG("\n");
  366. if (dev->driver->lastclose)
  367. dev->driver->lastclose(dev);
  368. DRM_DEBUG("driver lastclose completed\n");
  369. if (dev->irq_enabled && !drm_core_check_feature(dev, DRIVER_MODESET))
  370. drm_irq_uninstall(dev);
  371. mutex_lock(&dev->struct_mutex);
  372. drm_agp_clear(dev);
  373. drm_legacy_sg_cleanup(dev);
  374. /* Clear vma list (only built for debugging) */
  375. list_for_each_entry_safe(vma, vma_temp, &dev->vmalist, head) {
  376. list_del(&vma->head);
  377. kfree(vma);
  378. }
  379. drm_legacy_dma_takedown(dev);
  380. dev->dev_mapping = NULL;
  381. mutex_unlock(&dev->struct_mutex);
  382. drm_legacy_dev_reinit(dev);
  383. DRM_DEBUG("lastclose completed\n");
  384. return 0;
  385. }
  386. /**
  387. * Release file.
  388. *
  389. * \param inode device inode
  390. * \param file_priv DRM file private.
  391. * \return zero on success or a negative number on failure.
  392. *
  393. * If the hardware lock is held then free it, and take it again for the kernel
  394. * context since it's necessary to reclaim buffers. Unlink the file private
  395. * data from its list and free it. Decreases the open count and if it reaches
  396. * zero calls drm_lastclose().
  397. */
  398. int drm_release(struct inode *inode, struct file *filp)
  399. {
  400. struct drm_file *file_priv = filp->private_data;
  401. struct drm_device *dev = file_priv->minor->dev;
  402. int retcode = 0;
  403. mutex_lock(&drm_global_mutex);
  404. DRM_DEBUG("open_count = %d\n", dev->open_count);
  405. if (dev->driver->preclose)
  406. dev->driver->preclose(dev, file_priv);
  407. /* ========================================================
  408. * Begin inline drm_release
  409. */
  410. DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n",
  411. task_pid_nr(current),
  412. (long)old_encode_dev(file_priv->minor->device),
  413. dev->open_count);
  414. /* Release any auth tokens that might point to this file_priv,
  415. (do that under the drm_global_mutex) */
  416. if (file_priv->magic)
  417. (void) drm_remove_magic(file_priv->master, file_priv->magic);
  418. /* if the master has gone away we can't do anything with the lock */
  419. if (file_priv->minor->master)
  420. drm_master_release(dev, filp);
  421. if (drm_core_check_feature(dev, DRIVER_HAVE_DMA))
  422. drm_core_reclaim_buffers(dev, file_priv);
  423. drm_events_release(file_priv);
  424. if (dev->driver->driver_features & DRIVER_MODESET)
  425. drm_fb_release(file_priv);
  426. if (dev->driver->driver_features & DRIVER_GEM)
  427. drm_gem_release(dev, file_priv);
  428. mutex_lock(&dev->ctxlist_mutex);
  429. if (!list_empty(&dev->ctxlist)) {
  430. struct drm_ctx_list *pos, *n;
  431. list_for_each_entry_safe(pos, n, &dev->ctxlist, head) {
  432. if (pos->tag == file_priv &&
  433. pos->handle != DRM_KERNEL_CONTEXT) {
  434. if (dev->driver->context_dtor)
  435. dev->driver->context_dtor(dev,
  436. pos->handle);
  437. drm_ctxbitmap_free(dev, pos->handle);
  438. list_del(&pos->head);
  439. kfree(pos);
  440. }
  441. }
  442. }
  443. mutex_unlock(&dev->ctxlist_mutex);
  444. mutex_lock(&dev->struct_mutex);
  445. if (file_priv->is_master) {
  446. struct drm_master *master = file_priv->master;
  447. struct drm_file *temp;
  448. list_for_each_entry(temp, &dev->filelist, lhead) {
  449. if ((temp->master == file_priv->master) &&
  450. (temp != file_priv))
  451. temp->authenticated = 0;
  452. }
  453. /**
  454. * Since the master is disappearing, so is the
  455. * possibility to lock.
  456. */
  457. if (master->lock.hw_lock) {
  458. if (dev->sigdata.lock == master->lock.hw_lock)
  459. dev->sigdata.lock = NULL;
  460. master->lock.hw_lock = NULL;
  461. master->lock.file_priv = NULL;
  462. wake_up_interruptible_all(&master->lock.lock_queue);
  463. }
  464. if (file_priv->minor->master == file_priv->master) {
  465. /* drop the reference held my the minor */
  466. if (dev->driver->master_drop)
  467. dev->driver->master_drop(dev, file_priv, true);
  468. drm_master_put(&file_priv->minor->master);
  469. }
  470. }
  471. BUG_ON(dev->dev_mapping == NULL);
  472. iput(container_of(dev->dev_mapping, struct inode, i_data));
  473. /* drop the reference held my the file priv */
  474. if (file_priv->master)
  475. drm_master_put(&file_priv->master);
  476. file_priv->is_master = 0;
  477. list_del(&file_priv->lhead);
  478. mutex_unlock(&dev->struct_mutex);
  479. if (dev->driver->postclose)
  480. dev->driver->postclose(dev, file_priv);
  481. if (drm_core_check_feature(dev, DRIVER_PRIME))
  482. drm_prime_destroy_file_private(&file_priv->prime);
  483. put_pid(file_priv->pid);
  484. kfree(file_priv);
  485. /* ========================================================
  486. * End inline drm_release
  487. */
  488. if (!--dev->open_count) {
  489. if (atomic_read(&dev->ioctl_count)) {
  490. DRM_ERROR("Device busy: %d\n",
  491. atomic_read(&dev->ioctl_count));
  492. retcode = -EBUSY;
  493. } else
  494. retcode = drm_lastclose(dev);
  495. if (drm_device_is_unplugged(dev))
  496. drm_put_dev(dev);
  497. }
  498. mutex_unlock(&drm_global_mutex);
  499. return retcode;
  500. }
  501. EXPORT_SYMBOL(drm_release);
  502. static bool
  503. drm_dequeue_event(struct drm_file *file_priv,
  504. size_t total, size_t max, struct drm_pending_event **out)
  505. {
  506. struct drm_device *dev = file_priv->minor->dev;
  507. struct drm_pending_event *e;
  508. unsigned long flags;
  509. bool ret = false;
  510. spin_lock_irqsave(&dev->event_lock, flags);
  511. *out = NULL;
  512. if (list_empty(&file_priv->event_list))
  513. goto out;
  514. e = list_first_entry(&file_priv->event_list,
  515. struct drm_pending_event, link);
  516. if (e->event->length + total > max)
  517. goto out;
  518. file_priv->event_space += e->event->length;
  519. list_del(&e->link);
  520. *out = e;
  521. ret = true;
  522. out:
  523. spin_unlock_irqrestore(&dev->event_lock, flags);
  524. return ret;
  525. }
  526. ssize_t drm_read(struct file *filp, char __user *buffer,
  527. size_t count, loff_t *offset)
  528. {
  529. struct drm_file *file_priv = filp->private_data;
  530. struct drm_pending_event *e;
  531. size_t total;
  532. ssize_t ret;
  533. ret = wait_event_interruptible(file_priv->event_wait,
  534. !list_empty(&file_priv->event_list));
  535. if (ret < 0)
  536. return ret;
  537. total = 0;
  538. while (drm_dequeue_event(file_priv, total, count, &e)) {
  539. if (copy_to_user(buffer + total,
  540. e->event, e->event->length)) {
  541. total = -EFAULT;
  542. break;
  543. }
  544. total += e->event->length;
  545. e->destroy(e);
  546. }
  547. return total;
  548. }
  549. EXPORT_SYMBOL(drm_read);
  550. unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait)
  551. {
  552. struct drm_file *file_priv = filp->private_data;
  553. unsigned int mask = 0;
  554. poll_wait(filp, &file_priv->event_wait, wait);
  555. if (!list_empty(&file_priv->event_list))
  556. mask |= POLLIN | POLLRDNORM;
  557. return mask;
  558. }
  559. EXPORT_SYMBOL(drm_poll);