diff options
Diffstat (limited to 'drivers/char/drm/i830_dma.c')
-rw-r--r-- | drivers/char/drm/i830_dma.c | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c index dc94f1914425..4fea32aed6d2 100644 --- a/drivers/char/drm/i830_dma.c +++ b/drivers/char/drm/i830_dma.c | |||
@@ -116,7 +116,6 @@ static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) | |||
116 | 116 | ||
117 | static struct file_operations i830_buffer_fops = { | 117 | static struct file_operations i830_buffer_fops = { |
118 | .open = drm_open, | 118 | .open = drm_open, |
119 | .flush = drm_flush, | ||
120 | .release = drm_release, | 119 | .release = drm_release, |
121 | .ioctl = drm_ioctl, | 120 | .ioctl = drm_ioctl, |
122 | .mmap = i830_mmap_buffers, | 121 | .mmap = i830_mmap_buffers, |
@@ -1517,12 +1516,24 @@ static int i830_setparam(struct inode *inode, struct file *filp, | |||
1517 | return 0; | 1516 | return 0; |
1518 | } | 1517 | } |
1519 | 1518 | ||
1520 | void i830_driver_pretakedown(drm_device_t * dev) | 1519 | int i830_driver_load(drm_device_t *dev, unsigned long flags) |
1520 | { | ||
1521 | /* i830 has 4 more counters */ | ||
1522 | dev->counters += 4; | ||
1523 | dev->types[6] = _DRM_STAT_IRQ; | ||
1524 | dev->types[7] = _DRM_STAT_PRIMARY; | ||
1525 | dev->types[8] = _DRM_STAT_SECONDARY; | ||
1526 | dev->types[9] = _DRM_STAT_DMA; | ||
1527 | |||
1528 | return 0; | ||
1529 | } | ||
1530 | |||
1531 | void i830_driver_lastclose(drm_device_t * dev) | ||
1521 | { | 1532 | { |
1522 | i830_dma_cleanup(dev); | 1533 | i830_dma_cleanup(dev); |
1523 | } | 1534 | } |
1524 | 1535 | ||
1525 | void i830_driver_prerelease(drm_device_t * dev, DRMFILE filp) | 1536 | void i830_driver_preclose(drm_device_t * dev, DRMFILE filp) |
1526 | { | 1537 | { |
1527 | if (dev->dev_private) { | 1538 | if (dev->dev_private) { |
1528 | drm_i830_private_t *dev_priv = dev->dev_private; | 1539 | drm_i830_private_t *dev_priv = dev->dev_private; |
@@ -1532,7 +1543,7 @@ void i830_driver_prerelease(drm_device_t * dev, DRMFILE filp) | |||
1532 | } | 1543 | } |
1533 | } | 1544 | } |
1534 | 1545 | ||
1535 | void i830_driver_release(drm_device_t * dev, struct file *filp) | 1546 | void i830_driver_reclaim_buffers_locked(drm_device_t * dev, struct file *filp) |
1536 | { | 1547 | { |
1537 | i830_reclaim_buffers(dev, filp); | 1548 | i830_reclaim_buffers(dev, filp); |
1538 | } | 1549 | } |
@@ -1544,20 +1555,20 @@ int i830_driver_dma_quiescent(drm_device_t * dev) | |||
1544 | } | 1555 | } |
1545 | 1556 | ||
1546 | drm_ioctl_desc_t i830_ioctls[] = { | 1557 | drm_ioctl_desc_t i830_ioctls[] = { |
1547 | [DRM_IOCTL_NR(DRM_I830_INIT)] = {i830_dma_init, 1, 1}, | 1558 | [DRM_IOCTL_NR(DRM_I830_INIT)] = {i830_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY}, |
1548 | [DRM_IOCTL_NR(DRM_I830_VERTEX)] = {i830_dma_vertex, 1, 0}, | 1559 | [DRM_IOCTL_NR(DRM_I830_VERTEX)] = {i830_dma_vertex, DRM_AUTH}, |
1549 | [DRM_IOCTL_NR(DRM_I830_CLEAR)] = {i830_clear_bufs, 1, 0}, | 1560 | [DRM_IOCTL_NR(DRM_I830_CLEAR)] = {i830_clear_bufs, DRM_AUTH}, |
1550 | [DRM_IOCTL_NR(DRM_I830_FLUSH)] = {i830_flush_ioctl, 1, 0}, | 1561 | [DRM_IOCTL_NR(DRM_I830_FLUSH)] = {i830_flush_ioctl, DRM_AUTH}, |
1551 | [DRM_IOCTL_NR(DRM_I830_GETAGE)] = {i830_getage, 1, 0}, | 1562 | [DRM_IOCTL_NR(DRM_I830_GETAGE)] = {i830_getage, DRM_AUTH}, |
1552 | [DRM_IOCTL_NR(DRM_I830_GETBUF)] = {i830_getbuf, 1, 0}, | 1563 | [DRM_IOCTL_NR(DRM_I830_GETBUF)] = {i830_getbuf, DRM_AUTH}, |
1553 | [DRM_IOCTL_NR(DRM_I830_SWAP)] = {i830_swap_bufs, 1, 0}, | 1564 | [DRM_IOCTL_NR(DRM_I830_SWAP)] = {i830_swap_bufs, DRM_AUTH}, |
1554 | [DRM_IOCTL_NR(DRM_I830_COPY)] = {i830_copybuf, 1, 0}, | 1565 | [DRM_IOCTL_NR(DRM_I830_COPY)] = {i830_copybuf, DRM_AUTH}, |
1555 | [DRM_IOCTL_NR(DRM_I830_DOCOPY)] = {i830_docopy, 1, 0}, | 1566 | [DRM_IOCTL_NR(DRM_I830_DOCOPY)] = {i830_docopy, DRM_AUTH}, |
1556 | [DRM_IOCTL_NR(DRM_I830_FLIP)] = {i830_flip_bufs, 1, 0}, | 1567 | [DRM_IOCTL_NR(DRM_I830_FLIP)] = {i830_flip_bufs, DRM_AUTH}, |
1557 | [DRM_IOCTL_NR(DRM_I830_IRQ_EMIT)] = {i830_irq_emit, 1, 0}, | 1568 | [DRM_IOCTL_NR(DRM_I830_IRQ_EMIT)] = {i830_irq_emit, DRM_AUTH}, |
1558 | [DRM_IOCTL_NR(DRM_I830_IRQ_WAIT)] = {i830_irq_wait, 1, 0}, | 1569 | [DRM_IOCTL_NR(DRM_I830_IRQ_WAIT)] = {i830_irq_wait, DRM_AUTH}, |
1559 | [DRM_IOCTL_NR(DRM_I830_GETPARAM)] = {i830_getparam, 1, 0}, | 1570 | [DRM_IOCTL_NR(DRM_I830_GETPARAM)] = {i830_getparam, DRM_AUTH}, |
1560 | [DRM_IOCTL_NR(DRM_I830_SETPARAM)] = {i830_setparam, 1, 0} | 1571 | [DRM_IOCTL_NR(DRM_I830_SETPARAM)] = {i830_setparam, DRM_AUTH} |
1561 | }; | 1572 | }; |
1562 | 1573 | ||
1563 | int i830_max_ioctl = DRM_ARRAY_SIZE(i830_ioctls); | 1574 | int i830_max_ioctl = DRM_ARRAY_SIZE(i830_ioctls); |