diff options
Diffstat (limited to 'drivers/char/drm/r128_state.c')
-rw-r--r-- | drivers/char/drm/r128_state.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/char/drm/r128_state.c b/drivers/char/drm/r128_state.c index f0e2571e94a9..029f63b59a7d 100644 --- a/drivers/char/drm/r128_state.c +++ b/drivers/char/drm/r128_state.c | |||
@@ -776,8 +776,9 @@ static void r128_cce_dispatch_indices(struct drm_device * dev, | |||
776 | sarea_priv->nbox = 0; | 776 | sarea_priv->nbox = 0; |
777 | } | 777 | } |
778 | 778 | ||
779 | static int r128_cce_dispatch_blit(DRMFILE filp, | 779 | static int r128_cce_dispatch_blit(struct drm_device * dev, |
780 | struct drm_device * dev, drm_r128_blit_t * blit) | 780 | struct drm_file *file_priv, |
781 | drm_r128_blit_t * blit) | ||
781 | { | 782 | { |
782 | drm_r128_private_t *dev_priv = dev->dev_private; | 783 | drm_r128_private_t *dev_priv = dev->dev_private; |
783 | struct drm_device_dma *dma = dev->dma; | 784 | struct drm_device_dma *dma = dev->dma; |
@@ -829,9 +830,9 @@ static int r128_cce_dispatch_blit(DRMFILE filp, | |||
829 | buf = dma->buflist[blit->idx]; | 830 | buf = dma->buflist[blit->idx]; |
830 | buf_priv = buf->dev_private; | 831 | buf_priv = buf->dev_private; |
831 | 832 | ||
832 | if (buf->filp != filp) { | 833 | if (buf->file_priv != file_priv) { |
833 | DRM_ERROR("process %d using buffer owned by %p\n", | 834 | DRM_ERROR("process %d using buffer owned by %p\n", |
834 | DRM_CURRENTPID, buf->filp); | 835 | DRM_CURRENTPID, buf->file_priv); |
835 | return -EINVAL; | 836 | return -EINVAL; |
836 | } | 837 | } |
837 | if (buf->pending) { | 838 | if (buf->pending) { |
@@ -1249,7 +1250,7 @@ static int r128_cce_clear(DRM_IOCTL_ARGS) | |||
1249 | drm_r128_clear_t clear; | 1250 | drm_r128_clear_t clear; |
1250 | DRM_DEBUG("\n"); | 1251 | DRM_DEBUG("\n"); |
1251 | 1252 | ||
1252 | LOCK_TEST_WITH_RETURN(dev, filp); | 1253 | LOCK_TEST_WITH_RETURN(dev, file_priv); |
1253 | 1254 | ||
1254 | DRM_COPY_FROM_USER_IOCTL(clear, (drm_r128_clear_t __user *) data, | 1255 | DRM_COPY_FROM_USER_IOCTL(clear, (drm_r128_clear_t __user *) data, |
1255 | sizeof(clear)); | 1256 | sizeof(clear)); |
@@ -1315,7 +1316,7 @@ static int r128_cce_flip(DRM_IOCTL_ARGS) | |||
1315 | drm_r128_private_t *dev_priv = dev->dev_private; | 1316 | drm_r128_private_t *dev_priv = dev->dev_private; |
1316 | DRM_DEBUG("%s\n", __FUNCTION__); | 1317 | DRM_DEBUG("%s\n", __FUNCTION__); |
1317 | 1318 | ||
1318 | LOCK_TEST_WITH_RETURN(dev, filp); | 1319 | LOCK_TEST_WITH_RETURN(dev, file_priv); |
1319 | 1320 | ||
1320 | RING_SPACE_TEST_WITH_RETURN(dev_priv); | 1321 | RING_SPACE_TEST_WITH_RETURN(dev_priv); |
1321 | 1322 | ||
@@ -1335,7 +1336,7 @@ static int r128_cce_swap(DRM_IOCTL_ARGS) | |||
1335 | drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; | 1336 | drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; |
1336 | DRM_DEBUG("%s\n", __FUNCTION__); | 1337 | DRM_DEBUG("%s\n", __FUNCTION__); |
1337 | 1338 | ||
1338 | LOCK_TEST_WITH_RETURN(dev, filp); | 1339 | LOCK_TEST_WITH_RETURN(dev, file_priv); |
1339 | 1340 | ||
1340 | RING_SPACE_TEST_WITH_RETURN(dev_priv); | 1341 | RING_SPACE_TEST_WITH_RETURN(dev_priv); |
1341 | 1342 | ||
@@ -1359,7 +1360,7 @@ static int r128_cce_vertex(DRM_IOCTL_ARGS) | |||
1359 | drm_r128_buf_priv_t *buf_priv; | 1360 | drm_r128_buf_priv_t *buf_priv; |
1360 | drm_r128_vertex_t vertex; | 1361 | drm_r128_vertex_t vertex; |
1361 | 1362 | ||
1362 | LOCK_TEST_WITH_RETURN(dev, filp); | 1363 | LOCK_TEST_WITH_RETURN(dev, file_priv); |
1363 | 1364 | ||
1364 | if (!dev_priv) { | 1365 | if (!dev_priv) { |
1365 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); | 1366 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); |
@@ -1389,9 +1390,9 @@ static int r128_cce_vertex(DRM_IOCTL_ARGS) | |||
1389 | buf = dma->buflist[vertex.idx]; | 1390 | buf = dma->buflist[vertex.idx]; |
1390 | buf_priv = buf->dev_private; | 1391 | buf_priv = buf->dev_private; |
1391 | 1392 | ||
1392 | if (buf->filp != filp) { | 1393 | if (buf->file_priv != file_priv) { |
1393 | DRM_ERROR("process %d using buffer owned by %p\n", | 1394 | DRM_ERROR("process %d using buffer owned by %p\n", |
1394 | DRM_CURRENTPID, buf->filp); | 1395 | DRM_CURRENTPID, buf->file_priv); |
1395 | return -EINVAL; | 1396 | return -EINVAL; |
1396 | } | 1397 | } |
1397 | if (buf->pending) { | 1398 | if (buf->pending) { |
@@ -1419,7 +1420,7 @@ static int r128_cce_indices(DRM_IOCTL_ARGS) | |||
1419 | drm_r128_indices_t elts; | 1420 | drm_r128_indices_t elts; |
1420 | int count; | 1421 | int count; |
1421 | 1422 | ||
1422 | LOCK_TEST_WITH_RETURN(dev, filp); | 1423 | LOCK_TEST_WITH_RETURN(dev, file_priv); |
1423 | 1424 | ||
1424 | if (!dev_priv) { | 1425 | if (!dev_priv) { |
1425 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); | 1426 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); |
@@ -1448,9 +1449,9 @@ static int r128_cce_indices(DRM_IOCTL_ARGS) | |||
1448 | buf = dma->buflist[elts.idx]; | 1449 | buf = dma->buflist[elts.idx]; |
1449 | buf_priv = buf->dev_private; | 1450 | buf_priv = buf->dev_private; |
1450 | 1451 | ||
1451 | if (buf->filp != filp) { | 1452 | if (buf->file_priv != file_priv) { |
1452 | DRM_ERROR("process %d using buffer owned by %p\n", | 1453 | DRM_ERROR("process %d using buffer owned by %p\n", |
1453 | DRM_CURRENTPID, buf->filp); | 1454 | DRM_CURRENTPID, buf->file_priv); |
1454 | return -EINVAL; | 1455 | return -EINVAL; |
1455 | } | 1456 | } |
1456 | if (buf->pending) { | 1457 | if (buf->pending) { |
@@ -1488,7 +1489,7 @@ static int r128_cce_blit(DRM_IOCTL_ARGS) | |||
1488 | drm_r128_blit_t blit; | 1489 | drm_r128_blit_t blit; |
1489 | int ret; | 1490 | int ret; |
1490 | 1491 | ||
1491 | LOCK_TEST_WITH_RETURN(dev, filp); | 1492 | LOCK_TEST_WITH_RETURN(dev, file_priv); |
1492 | 1493 | ||
1493 | DRM_COPY_FROM_USER_IOCTL(blit, (drm_r128_blit_t __user *) data, | 1494 | DRM_COPY_FROM_USER_IOCTL(blit, (drm_r128_blit_t __user *) data, |
1494 | sizeof(blit)); | 1495 | sizeof(blit)); |
@@ -1504,7 +1505,7 @@ static int r128_cce_blit(DRM_IOCTL_ARGS) | |||
1504 | RING_SPACE_TEST_WITH_RETURN(dev_priv); | 1505 | RING_SPACE_TEST_WITH_RETURN(dev_priv); |
1505 | VB_AGE_TEST_WITH_RETURN(dev_priv); | 1506 | VB_AGE_TEST_WITH_RETURN(dev_priv); |
1506 | 1507 | ||
1507 | ret = r128_cce_dispatch_blit(filp, dev, &blit); | 1508 | ret = r128_cce_dispatch_blit(dev, file_priv, &blit); |
1508 | 1509 | ||
1509 | COMMIT_RING(); | 1510 | COMMIT_RING(); |
1510 | return ret; | 1511 | return ret; |
@@ -1517,7 +1518,7 @@ static int r128_cce_depth(DRM_IOCTL_ARGS) | |||
1517 | drm_r128_depth_t depth; | 1518 | drm_r128_depth_t depth; |
1518 | int ret; | 1519 | int ret; |
1519 | 1520 | ||
1520 | LOCK_TEST_WITH_RETURN(dev, filp); | 1521 | LOCK_TEST_WITH_RETURN(dev, file_priv); |
1521 | 1522 | ||
1522 | DRM_COPY_FROM_USER_IOCTL(depth, (drm_r128_depth_t __user *) data, | 1523 | DRM_COPY_FROM_USER_IOCTL(depth, (drm_r128_depth_t __user *) data, |
1523 | sizeof(depth)); | 1524 | sizeof(depth)); |
@@ -1551,7 +1552,7 @@ static int r128_cce_stipple(DRM_IOCTL_ARGS) | |||
1551 | drm_r128_stipple_t stipple; | 1552 | drm_r128_stipple_t stipple; |
1552 | u32 mask[32]; | 1553 | u32 mask[32]; |
1553 | 1554 | ||
1554 | LOCK_TEST_WITH_RETURN(dev, filp); | 1555 | LOCK_TEST_WITH_RETURN(dev, file_priv); |
1555 | 1556 | ||
1556 | DRM_COPY_FROM_USER_IOCTL(stipple, (drm_r128_stipple_t __user *) data, | 1557 | DRM_COPY_FROM_USER_IOCTL(stipple, (drm_r128_stipple_t __user *) data, |
1557 | sizeof(stipple)); | 1558 | sizeof(stipple)); |
@@ -1579,7 +1580,7 @@ static int r128_cce_indirect(DRM_IOCTL_ARGS) | |||
1579 | RING_LOCALS; | 1580 | RING_LOCALS; |
1580 | #endif | 1581 | #endif |
1581 | 1582 | ||
1582 | LOCK_TEST_WITH_RETURN(dev, filp); | 1583 | LOCK_TEST_WITH_RETURN(dev, file_priv); |
1583 | 1584 | ||
1584 | if (!dev_priv) { | 1585 | if (!dev_priv) { |
1585 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); | 1586 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); |
@@ -1601,9 +1602,9 @@ static int r128_cce_indirect(DRM_IOCTL_ARGS) | |||
1601 | buf = dma->buflist[indirect.idx]; | 1602 | buf = dma->buflist[indirect.idx]; |
1602 | buf_priv = buf->dev_private; | 1603 | buf_priv = buf->dev_private; |
1603 | 1604 | ||
1604 | if (buf->filp != filp) { | 1605 | if (buf->file_priv != file_priv) { |
1605 | DRM_ERROR("process %d using buffer owned by %p\n", | 1606 | DRM_ERROR("process %d using buffer owned by %p\n", |
1606 | DRM_CURRENTPID, buf->filp); | 1607 | DRM_CURRENTPID, buf->file_priv); |
1607 | return -EINVAL; | 1608 | return -EINVAL; |
1608 | } | 1609 | } |
1609 | if (buf->pending) { | 1610 | if (buf->pending) { |
@@ -1675,7 +1676,7 @@ static int r128_getparam(DRM_IOCTL_ARGS) | |||
1675 | return 0; | 1676 | return 0; |
1676 | } | 1677 | } |
1677 | 1678 | ||
1678 | void r128_driver_preclose(struct drm_device * dev, DRMFILE filp) | 1679 | void r128_driver_preclose(struct drm_device * dev, struct drm_file *file_priv) |
1679 | { | 1680 | { |
1680 | if (dev->dev_private) { | 1681 | if (dev->dev_private) { |
1681 | drm_r128_private_t *dev_priv = dev->dev_private; | 1682 | drm_r128_private_t *dev_priv = dev->dev_private; |