diff options
Diffstat (limited to 'drivers/char/drm/i810_dma.c')
-rw-r--r-- | drivers/char/drm/i810_dma.c | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c index dba502373da1..cc1b89086876 100644 --- a/drivers/char/drm/i810_dma.c +++ b/drivers/char/drm/i810_dma.c | |||
@@ -114,7 +114,6 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) | |||
114 | 114 | ||
115 | static struct file_operations i810_buffer_fops = { | 115 | static struct file_operations i810_buffer_fops = { |
116 | .open = drm_open, | 116 | .open = drm_open, |
117 | .flush = drm_flush, | ||
118 | .release = drm_release, | 117 | .release = drm_release, |
119 | .ioctl = drm_ioctl, | 118 | .ioctl = drm_ioctl, |
120 | .mmap = i810_mmap_buffers, | 119 | .mmap = i810_mmap_buffers, |
@@ -1319,12 +1318,24 @@ static int i810_flip_bufs(struct inode *inode, struct file *filp, | |||
1319 | return 0; | 1318 | return 0; |
1320 | } | 1319 | } |
1321 | 1320 | ||
1322 | void i810_driver_pretakedown(drm_device_t * dev) | 1321 | int i810_driver_load(drm_device_t *dev, unsigned long flags) |
1322 | { | ||
1323 | /* i810 has 4 more counters */ | ||
1324 | dev->counters += 4; | ||
1325 | dev->types[6] = _DRM_STAT_IRQ; | ||
1326 | dev->types[7] = _DRM_STAT_PRIMARY; | ||
1327 | dev->types[8] = _DRM_STAT_SECONDARY; | ||
1328 | dev->types[9] = _DRM_STAT_DMA; | ||
1329 | |||
1330 | return 0; | ||
1331 | } | ||
1332 | |||
1333 | void i810_driver_lastclose(drm_device_t * dev) | ||
1323 | { | 1334 | { |
1324 | i810_dma_cleanup(dev); | 1335 | i810_dma_cleanup(dev); |
1325 | } | 1336 | } |
1326 | 1337 | ||
1327 | void i810_driver_prerelease(drm_device_t * dev, DRMFILE filp) | 1338 | void i810_driver_preclose(drm_device_t * dev, DRMFILE filp) |
1328 | { | 1339 | { |
1329 | if (dev->dev_private) { | 1340 | if (dev->dev_private) { |
1330 | drm_i810_private_t *dev_priv = dev->dev_private; | 1341 | drm_i810_private_t *dev_priv = dev->dev_private; |
@@ -1334,7 +1345,7 @@ void i810_driver_prerelease(drm_device_t * dev, DRMFILE filp) | |||
1334 | } | 1345 | } |
1335 | } | 1346 | } |
1336 | 1347 | ||
1337 | void i810_driver_release(drm_device_t * dev, struct file *filp) | 1348 | void i810_driver_reclaim_buffers_locked(drm_device_t * dev, struct file *filp) |
1338 | { | 1349 | { |
1339 | i810_reclaim_buffers(dev, filp); | 1350 | i810_reclaim_buffers(dev, filp); |
1340 | } | 1351 | } |
@@ -1346,21 +1357,21 @@ int i810_driver_dma_quiescent(drm_device_t * dev) | |||
1346 | } | 1357 | } |
1347 | 1358 | ||
1348 | drm_ioctl_desc_t i810_ioctls[] = { | 1359 | drm_ioctl_desc_t i810_ioctls[] = { |
1349 | [DRM_IOCTL_NR(DRM_I810_INIT)] = {i810_dma_init, 1, 1}, | 1360 | [DRM_IOCTL_NR(DRM_I810_INIT)] = {i810_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY}, |
1350 | [DRM_IOCTL_NR(DRM_I810_VERTEX)] = {i810_dma_vertex, 1, 0}, | 1361 | [DRM_IOCTL_NR(DRM_I810_VERTEX)] = {i810_dma_vertex, DRM_AUTH}, |
1351 | [DRM_IOCTL_NR(DRM_I810_CLEAR)] = {i810_clear_bufs, 1, 0}, | 1362 | [DRM_IOCTL_NR(DRM_I810_CLEAR)] = {i810_clear_bufs, DRM_AUTH}, |
1352 | [DRM_IOCTL_NR(DRM_I810_FLUSH)] = {i810_flush_ioctl, 1, 0}, | 1363 | [DRM_IOCTL_NR(DRM_I810_FLUSH)] = {i810_flush_ioctl, DRM_AUTH}, |
1353 | [DRM_IOCTL_NR(DRM_I810_GETAGE)] = {i810_getage, 1, 0}, | 1364 | [DRM_IOCTL_NR(DRM_I810_GETAGE)] = {i810_getage, DRM_AUTH}, |
1354 | [DRM_IOCTL_NR(DRM_I810_GETBUF)] = {i810_getbuf, 1, 0}, | 1365 | [DRM_IOCTL_NR(DRM_I810_GETBUF)] = {i810_getbuf, DRM_AUTH}, |
1355 | [DRM_IOCTL_NR(DRM_I810_SWAP)] = {i810_swap_bufs, 1, 0}, | 1366 | [DRM_IOCTL_NR(DRM_I810_SWAP)] = {i810_swap_bufs, DRM_AUTH}, |
1356 | [DRM_IOCTL_NR(DRM_I810_COPY)] = {i810_copybuf, 1, 0}, | 1367 | [DRM_IOCTL_NR(DRM_I810_COPY)] = {i810_copybuf, DRM_AUTH}, |
1357 | [DRM_IOCTL_NR(DRM_I810_DOCOPY)] = {i810_docopy, 1, 0}, | 1368 | [DRM_IOCTL_NR(DRM_I810_DOCOPY)] = {i810_docopy, DRM_AUTH}, |
1358 | [DRM_IOCTL_NR(DRM_I810_OV0INFO)] = {i810_ov0_info, 1, 0}, | 1369 | [DRM_IOCTL_NR(DRM_I810_OV0INFO)] = {i810_ov0_info, DRM_AUTH}, |
1359 | [DRM_IOCTL_NR(DRM_I810_FSTATUS)] = {i810_fstatus, 1, 0}, | 1370 | [DRM_IOCTL_NR(DRM_I810_FSTATUS)] = {i810_fstatus, DRM_AUTH}, |
1360 | [DRM_IOCTL_NR(DRM_I810_OV0FLIP)] = {i810_ov0_flip, 1, 0}, | 1371 | [DRM_IOCTL_NR(DRM_I810_OV0FLIP)] = {i810_ov0_flip, DRM_AUTH}, |
1361 | [DRM_IOCTL_NR(DRM_I810_MC)] = {i810_dma_mc, 1, 1}, | 1372 | [DRM_IOCTL_NR(DRM_I810_MC)] = {i810_dma_mc, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY}, |
1362 | [DRM_IOCTL_NR(DRM_I810_RSTATUS)] = {i810_rstatus, 1, 0}, | 1373 | [DRM_IOCTL_NR(DRM_I810_RSTATUS)] = {i810_rstatus, DRM_AUTH}, |
1363 | [DRM_IOCTL_NR(DRM_I810_FLIP)] = {i810_flip_bufs, 1, 0} | 1374 | [DRM_IOCTL_NR(DRM_I810_FLIP)] = {i810_flip_bufs, DRM_AUTH} |
1364 | }; | 1375 | }; |
1365 | 1376 | ||
1366 | int i810_max_ioctl = DRM_ARRAY_SIZE(i810_ioctls); | 1377 | int i810_max_ioctl = DRM_ARRAY_SIZE(i810_ioctls); |