drm_fops.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  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 "drmP.h"
  36. #include <linux/poll.h>
  37. #include <linux/slab.h>
  38. /* from BKL pushdown: note that nothing else serializes idr_find() */
  39. DEFINE_MUTEX(drm_global_mutex);
  40. EXPORT_SYMBOL(drm_global_mutex);
  41. static int drm_open_helper(struct inode *inode, struct file *filp,
  42. struct drm_device * dev);
  43. static int drm_setup(struct drm_device * dev)
  44. {
  45. int i;
  46. int ret;
  47. if (dev->driver->firstopen) {
  48. ret = dev->driver->firstopen(dev);
  49. if (ret != 0)
  50. return ret;
  51. }
  52. atomic_set(&dev->ioctl_count, 0);
  53. atomic_set(&dev->vma_count, 0);
  54. if (drm_core_check_feature(dev, DRIVER_HAVE_DMA) &&
  55. !drm_core_check_feature(dev, DRIVER_MODESET)) {
  56. dev->buf_use = 0;
  57. atomic_set(&dev->buf_alloc, 0);
  58. i = drm_dma_setup(dev);
  59. if (i < 0)
  60. return i;
  61. }
  62. for (i = 0; i < ARRAY_SIZE(dev->counts); i++)
  63. atomic_set(&dev->counts[i], 0);
  64. dev->sigdata.lock = NULL;
  65. dev->queue_count = 0;
  66. dev->queue_reserved = 0;
  67. dev->queue_slots = 0;
  68. dev->queuelist = NULL;
  69. dev->context_flag = 0;
  70. dev->interrupt_flag = 0;
  71. dev->dma_flag = 0;
  72. dev->last_context = 0;
  73. dev->last_switch = 0;
  74. dev->last_checked = 0;
  75. init_waitqueue_head(&dev->context_wait);
  76. dev->if_version = 0;
  77. dev->ctx_start = 0;
  78. dev->lck_start = 0;
  79. dev->buf_async = NULL;
  80. init_waitqueue_head(&dev->buf_readers);
  81. init_waitqueue_head(&dev->buf_writers);
  82. DRM_DEBUG("\n");
  83. /*
  84. * The kernel's context could be created here, but is now created
  85. * in drm_dma_enqueue. This is more resource-efficient for
  86. * hardware that does not do DMA, but may mean that
  87. * drm_select_queue fails between the time the interrupt is
  88. * initialized and the time the queues are initialized.
  89. */
  90. return 0;
  91. }
  92. /**
  93. * Open file.
  94. *
  95. * \param inode device inode
  96. * \param filp file pointer.
  97. * \return zero on success or a negative number on failure.
  98. *
  99. * Searches the DRM device with the same minor number, calls open_helper(), and
  100. * increments the device open count. If the open count was previous at zero,
  101. * i.e., it's the first that the device is open, then calls setup().
  102. */
  103. int drm_open(struct inode *inode, struct file *filp)
  104. {
  105. struct drm_device *dev = NULL;
  106. int minor_id = iminor(inode);
  107. struct drm_minor *minor;
  108. int retcode = 0;
  109. minor = idr_find(&drm_minors_idr, minor_id);
  110. if (!minor)
  111. return -ENODEV;
  112. if (!(dev = minor->dev))
  113. return -ENODEV;
  114. retcode = drm_open_helper(inode, filp, dev);
  115. if (!retcode) {
  116. atomic_inc(&dev->counts[_DRM_STAT_OPENS]);
  117. if (!dev->open_count++)
  118. retcode = drm_setup(dev);
  119. }
  120. if (!retcode) {
  121. mutex_lock(&dev->struct_mutex);
  122. if (minor->type == DRM_MINOR_LEGACY) {
  123. if (dev->dev_mapping == NULL)
  124. dev->dev_mapping = inode->i_mapping;
  125. else if (dev->dev_mapping != inode->i_mapping)
  126. retcode = -ENODEV;
  127. }
  128. mutex_unlock(&dev->struct_mutex);
  129. }
  130. return retcode;
  131. }
  132. EXPORT_SYMBOL(drm_open);
  133. /**
  134. * File \c open operation.
  135. *
  136. * \param inode device inode.
  137. * \param filp file pointer.
  138. *
  139. * Puts the dev->fops corresponding to the device minor number into
  140. * \p filp, call the \c open method, and restore the file operations.
  141. */
  142. int drm_stub_open(struct inode *inode, struct file *filp)
  143. {
  144. struct drm_device *dev = NULL;
  145. struct drm_minor *minor;
  146. int minor_id = iminor(inode);
  147. int err = -ENODEV;
  148. const struct file_operations *old_fops;
  149. DRM_DEBUG("\n");
  150. mutex_lock(&drm_global_mutex);
  151. minor = idr_find(&drm_minors_idr, minor_id);
  152. if (!minor)
  153. goto out;
  154. if (!(dev = minor->dev))
  155. goto out;
  156. old_fops = filp->f_op;
  157. filp->f_op = fops_get(&dev->driver->fops);
  158. if (filp->f_op == NULL) {
  159. filp->f_op = old_fops;
  160. goto out;
  161. }
  162. if (filp->f_op->open && (err = filp->f_op->open(inode, filp))) {
  163. fops_put(filp->f_op);
  164. filp->f_op = fops_get(old_fops);
  165. }
  166. fops_put(old_fops);
  167. out:
  168. mutex_unlock(&drm_global_mutex);
  169. return err;
  170. }
  171. /**
  172. * Check whether DRI will run on this CPU.
  173. *
  174. * \return non-zero if the DRI will run on this CPU, or zero otherwise.
  175. */
  176. static int drm_cpu_valid(void)
  177. {
  178. #if defined(__i386__)
  179. if (boot_cpu_data.x86 == 3)
  180. return 0; /* No cmpxchg on a 386 */
  181. #endif
  182. #if defined(__sparc__) && !defined(__sparc_v9__)
  183. return 0; /* No cmpxchg before v9 sparc. */
  184. #endif
  185. return 1;
  186. }
  187. /**
  188. * Called whenever a process opens /dev/drm.
  189. *
  190. * \param inode device inode.
  191. * \param filp file pointer.
  192. * \param dev device.
  193. * \return zero on success or a negative number on failure.
  194. *
  195. * Creates and initializes a drm_file structure for the file private data in \p
  196. * filp and add it into the double linked list in \p dev.
  197. */
  198. static int drm_open_helper(struct inode *inode, struct file *filp,
  199. struct drm_device * dev)
  200. {
  201. int minor_id = iminor(inode);
  202. struct drm_file *priv;
  203. int ret;
  204. if (filp->f_flags & O_EXCL)
  205. return -EBUSY; /* No exclusive opens */
  206. if (!drm_cpu_valid())
  207. return -EINVAL;
  208. if (dev->switch_power_state != DRM_SWITCH_POWER_ON)
  209. return -EINVAL;
  210. DRM_DEBUG("pid = %d, minor = %d\n", task_pid_nr(current), minor_id);
  211. priv = kzalloc(sizeof(*priv), GFP_KERNEL);
  212. if (!priv)
  213. return -ENOMEM;
  214. filp->private_data = priv;
  215. priv->filp = filp;
  216. priv->uid = current_euid();
  217. priv->pid = task_pid_nr(current);
  218. priv->minor = idr_find(&drm_minors_idr, minor_id);
  219. priv->ioctl_count = 0;
  220. /* for compatibility root is always authenticated */
  221. priv->authenticated = capable(CAP_SYS_ADMIN);
  222. priv->lock_count = 0;
  223. INIT_LIST_HEAD(&priv->lhead);
  224. INIT_LIST_HEAD(&priv->fbs);
  225. INIT_LIST_HEAD(&priv->event_list);
  226. init_waitqueue_head(&priv->event_wait);
  227. priv->event_space = 4096; /* set aside 4k for event buffer */
  228. if (dev->driver->driver_features & DRIVER_GEM)
  229. drm_gem_open(dev, priv);
  230. if (dev->driver->open) {
  231. ret = dev->driver->open(dev, priv);
  232. if (ret < 0)
  233. goto out_free;
  234. }
  235. /* if there is no current master make this fd it */
  236. mutex_lock(&dev->struct_mutex);
  237. if (!priv->minor->master) {
  238. /* create a new master */
  239. priv->minor->master = drm_master_create(priv->minor);
  240. if (!priv->minor->master) {
  241. mutex_unlock(&dev->struct_mutex);
  242. ret = -ENOMEM;
  243. goto out_free;
  244. }
  245. priv->is_master = 1;
  246. /* take another reference for the copy in the local file priv */
  247. priv->master = drm_master_get(priv->minor->master);
  248. priv->authenticated = 1;
  249. mutex_unlock(&dev->struct_mutex);
  250. if (dev->driver->master_create) {
  251. ret = dev->driver->master_create(dev, priv->master);
  252. if (ret) {
  253. mutex_lock(&dev->struct_mutex);
  254. /* drop both references if this fails */
  255. drm_master_put(&priv->minor->master);
  256. drm_master_put(&priv->master);
  257. mutex_unlock(&dev->struct_mutex);
  258. goto out_free;
  259. }
  260. }
  261. mutex_lock(&dev->struct_mutex);
  262. if (dev->driver->master_set) {
  263. ret = dev->driver->master_set(dev, priv, true);
  264. if (ret) {
  265. /* drop both references if this fails */
  266. drm_master_put(&priv->minor->master);
  267. drm_master_put(&priv->master);
  268. mutex_unlock(&dev->struct_mutex);
  269. goto out_free;
  270. }
  271. }
  272. mutex_unlock(&dev->struct_mutex);
  273. } else {
  274. /* get a reference to the master */
  275. priv->master = drm_master_get(priv->minor->master);
  276. mutex_unlock(&dev->struct_mutex);
  277. }
  278. mutex_lock(&dev->struct_mutex);
  279. list_add(&priv->lhead, &dev->filelist);
  280. mutex_unlock(&dev->struct_mutex);
  281. #ifdef __alpha__
  282. /*
  283. * Default the hose
  284. */
  285. if (!dev->hose) {
  286. struct pci_dev *pci_dev;
  287. pci_dev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, NULL);
  288. if (pci_dev) {
  289. dev->hose = pci_dev->sysdata;
  290. pci_dev_put(pci_dev);
  291. }
  292. if (!dev->hose) {
  293. struct pci_bus *b = pci_bus_b(pci_root_buses.next);
  294. if (b)
  295. dev->hose = b->sysdata;
  296. }
  297. }
  298. #endif
  299. return 0;
  300. out_free:
  301. kfree(priv);
  302. filp->private_data = NULL;
  303. return ret;
  304. }
  305. /** No-op. */
  306. int drm_fasync(int fd, struct file *filp, int on)
  307. {
  308. struct drm_file *priv = filp->private_data;
  309. struct drm_device *dev = priv->minor->dev;
  310. DRM_DEBUG("fd = %d, device = 0x%lx\n", fd,
  311. (long)old_encode_dev(priv->minor->device));
  312. return fasync_helper(fd, filp, on, &dev->buf_async);
  313. }
  314. EXPORT_SYMBOL(drm_fasync);
  315. /*
  316. * Reclaim locked buffers; note that this may be a bad idea if the current
  317. * context doesn't have the hw lock...
  318. */
  319. static void drm_reclaim_locked_buffers(struct drm_device *dev, struct file *f)
  320. {
  321. struct drm_file *file_priv = f->private_data;
  322. if (drm_i_have_hw_lock(dev, file_priv)) {
  323. dev->driver->reclaim_buffers_locked(dev, file_priv);
  324. } else {
  325. unsigned long _end = jiffies + 3 * DRM_HZ;
  326. int locked = 0;
  327. drm_idlelock_take(&file_priv->master->lock);
  328. /*
  329. * Wait for a while.
  330. */
  331. do {
  332. spin_lock_bh(&file_priv->master->lock.spinlock);
  333. locked = file_priv->master->lock.idle_has_lock;
  334. spin_unlock_bh(&file_priv->master->lock.spinlock);
  335. if (locked)
  336. break;
  337. schedule();
  338. } while (!time_after_eq(jiffies, _end));
  339. if (!locked) {
  340. DRM_ERROR("reclaim_buffers_locked() deadlock. Please rework this\n"
  341. "\tdriver to use reclaim_buffers_idlelocked() instead.\n"
  342. "\tI will go on reclaiming the buffers anyway.\n");
  343. }
  344. dev->driver->reclaim_buffers_locked(dev, file_priv);
  345. drm_idlelock_release(&file_priv->master->lock);
  346. }
  347. }
  348. static void drm_master_release(struct drm_device *dev, struct file *filp)
  349. {
  350. struct drm_file *file_priv = filp->private_data;
  351. if (dev->driver->reclaim_buffers_locked &&
  352. file_priv->master->lock.hw_lock)
  353. drm_reclaim_locked_buffers(dev, filp);
  354. if (dev->driver->reclaim_buffers_idlelocked &&
  355. file_priv->master->lock.hw_lock) {
  356. drm_idlelock_take(&file_priv->master->lock);
  357. dev->driver->reclaim_buffers_idlelocked(dev, file_priv);
  358. drm_idlelock_release(&file_priv->master->lock);
  359. }
  360. if (drm_i_have_hw_lock(dev, file_priv)) {
  361. DRM_DEBUG("File %p released, freeing lock for context %d\n",
  362. filp, _DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock));
  363. drm_lock_free(&file_priv->master->lock,
  364. _DRM_LOCKING_CONTEXT(file_priv->master->lock.hw_lock->lock));
  365. }
  366. if (drm_core_check_feature(dev, DRIVER_HAVE_DMA) &&
  367. !dev->driver->reclaim_buffers_locked) {
  368. dev->driver->reclaim_buffers(dev, file_priv);
  369. }
  370. }
  371. static void drm_events_release(struct drm_file *file_priv)
  372. {
  373. struct drm_device *dev = file_priv->minor->dev;
  374. struct drm_pending_event *e, *et;
  375. struct drm_pending_vblank_event *v, *vt;
  376. unsigned long flags;
  377. spin_lock_irqsave(&dev->event_lock, flags);
  378. /* Remove pending flips */
  379. list_for_each_entry_safe(v, vt, &dev->vblank_event_list, base.link)
  380. if (v->base.file_priv == file_priv) {
  381. list_del(&v->base.link);
  382. drm_vblank_put(dev, v->pipe);
  383. v->base.destroy(&v->base);
  384. }
  385. /* Remove unconsumed events */
  386. list_for_each_entry_safe(e, et, &file_priv->event_list, link)
  387. e->destroy(e);
  388. spin_unlock_irqrestore(&dev->event_lock, flags);
  389. }
  390. /**
  391. * Release file.
  392. *
  393. * \param inode device inode
  394. * \param file_priv DRM file private.
  395. * \return zero on success or a negative number on failure.
  396. *
  397. * If the hardware lock is held then free it, and take it again for the kernel
  398. * context since it's necessary to reclaim buffers. Unlink the file private
  399. * data from its list and free it. Decreases the open count and if it reaches
  400. * zero calls drm_lastclose().
  401. */
  402. int drm_release(struct inode *inode, struct file *filp)
  403. {
  404. struct drm_file *file_priv = filp->private_data;
  405. struct drm_device *dev = file_priv->minor->dev;
  406. int retcode = 0;
  407. mutex_lock(&drm_global_mutex);
  408. DRM_DEBUG("open_count = %d\n", dev->open_count);
  409. if (dev->driver->preclose)
  410. dev->driver->preclose(dev, file_priv);
  411. /* ========================================================
  412. * Begin inline drm_release
  413. */
  414. DRM_DEBUG("pid = %d, device = 0x%lx, open_count = %d\n",
  415. task_pid_nr(current),
  416. (long)old_encode_dev(file_priv->minor->device),
  417. dev->open_count);
  418. /* Release any auth tokens that might point to this file_priv,
  419. (do that under the drm_global_mutex) */
  420. if (file_priv->magic)
  421. (void) drm_remove_magic(file_priv->master, file_priv->magic);
  422. /* if the master has gone away we can't do anything with the lock */
  423. if (file_priv->minor->master)
  424. drm_master_release(dev, filp);
  425. drm_events_release(file_priv);
  426. if (dev->driver->driver_features & DRIVER_GEM)
  427. drm_gem_release(dev, file_priv);
  428. if (dev->driver->driver_features & DRIVER_MODESET)
  429. drm_fb_release(file_priv);
  430. mutex_lock(&dev->ctxlist_mutex);
  431. if (!list_empty(&dev->ctxlist)) {
  432. struct drm_ctx_list *pos, *n;
  433. list_for_each_entry_safe(pos, n, &dev->ctxlist, head) {
  434. if (pos->tag == file_priv &&
  435. pos->handle != DRM_KERNEL_CONTEXT) {
  436. if (dev->driver->context_dtor)
  437. dev->driver->context_dtor(dev,
  438. pos->handle);
  439. drm_ctxbitmap_free(dev, pos->handle);
  440. list_del(&pos->head);
  441. kfree(pos);
  442. --dev->ctx_count;
  443. }
  444. }
  445. }
  446. mutex_unlock(&dev->ctxlist_mutex);
  447. mutex_lock(&dev->struct_mutex);
  448. if (file_priv->is_master) {
  449. struct drm_master *master = file_priv->master;
  450. struct drm_file *temp;
  451. list_for_each_entry(temp, &dev->filelist, lhead) {
  452. if ((temp->master == file_priv->master) &&
  453. (temp != file_priv))
  454. temp->authenticated = 0;
  455. }
  456. /**
  457. * Since the master is disappearing, so is the
  458. * possibility to lock.
  459. */
  460. if (master->lock.hw_lock) {
  461. if (dev->sigdata.lock == master->lock.hw_lock)
  462. dev->sigdata.lock = NULL;
  463. master->lock.hw_lock = NULL;
  464. master->lock.file_priv = NULL;
  465. wake_up_interruptible_all(&master->lock.lock_queue);
  466. }
  467. if (file_priv->minor->master == file_priv->master) {
  468. /* drop the reference held my the minor */
  469. if (dev->driver->master_drop)
  470. dev->driver->master_drop(dev, file_priv, true);
  471. drm_master_put(&file_priv->minor->master);
  472. }
  473. }
  474. /* drop the reference held my the file priv */
  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. kfree(file_priv);
  482. /* ========================================================
  483. * End inline drm_release
  484. */
  485. atomic_inc(&dev->counts[_DRM_STAT_CLOSES]);
  486. if (!--dev->open_count) {
  487. if (atomic_read(&dev->ioctl_count)) {
  488. DRM_ERROR("Device busy: %d\n",
  489. atomic_read(&dev->ioctl_count));
  490. retcode = -EBUSY;
  491. } else
  492. retcode = drm_lastclose(dev);
  493. }
  494. mutex_unlock(&drm_global_mutex);
  495. return retcode;
  496. }
  497. EXPORT_SYMBOL(drm_release);
  498. static bool
  499. drm_dequeue_event(struct drm_file *file_priv,
  500. size_t total, size_t max, struct drm_pending_event **out)
  501. {
  502. struct drm_device *dev = file_priv->minor->dev;
  503. struct drm_pending_event *e;
  504. unsigned long flags;
  505. bool ret = false;
  506. spin_lock_irqsave(&dev->event_lock, flags);
  507. *out = NULL;
  508. if (list_empty(&file_priv->event_list))
  509. goto out;
  510. e = list_first_entry(&file_priv->event_list,
  511. struct drm_pending_event, link);
  512. if (e->event->length + total > max)
  513. goto out;
  514. file_priv->event_space += e->event->length;
  515. list_del(&e->link);
  516. *out = e;
  517. ret = true;
  518. out:
  519. spin_unlock_irqrestore(&dev->event_lock, flags);
  520. return ret;
  521. }
  522. ssize_t drm_read(struct file *filp, char __user *buffer,
  523. size_t count, loff_t *offset)
  524. {
  525. struct drm_file *file_priv = filp->private_data;
  526. struct drm_pending_event *e;
  527. size_t total;
  528. ssize_t ret;
  529. ret = wait_event_interruptible(file_priv->event_wait,
  530. !list_empty(&file_priv->event_list));
  531. if (ret < 0)
  532. return ret;
  533. total = 0;
  534. while (drm_dequeue_event(file_priv, total, count, &e)) {
  535. if (copy_to_user(buffer + total,
  536. e->event, e->event->length)) {
  537. total = -EFAULT;
  538. break;
  539. }
  540. total += e->event->length;
  541. e->destroy(e);
  542. }
  543. return total;
  544. }
  545. EXPORT_SYMBOL(drm_read);
  546. unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait)
  547. {
  548. struct drm_file *file_priv = filp->private_data;
  549. unsigned int mask = 0;
  550. poll_wait(filp, &file_priv->event_wait, wait);
  551. if (!list_empty(&file_priv->event_list))
  552. mask |= POLLIN | POLLRDNORM;
  553. return mask;
  554. }
  555. EXPORT_SYMBOL(drm_poll);