summaryrefslogtreecommitdiff
path: root/linux-core/drm_ioctl.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-09-21 17:05:21 -0700
committerEric Anholt <eric@anholt.net>2007-09-21 17:12:19 -0700
commit24e33627c5dfb92324a9faf1c7d366e7f33e622a (patch)
treead03240f73433518b42eeabd4fad14e8ee34184e /linux-core/drm_ioctl.c
parent7587e9682c1b70930c015915d588b42ccd00c7c4 (diff)
parente7bfeb3031374653f7e55d67cc1b5c823849359f (diff)
Merge branch 'bo-set-pin'
This branch replaces the NO_MOVE/NO_EVICT flags to buffer validation with a separate privileged ioctl to pin buffers like NO_EVICT meant before. The functionality that was supposed to be covered by NO_MOVE may be reintroduced later, possibly in a different way, after the superioctl branch is merged.
Diffstat (limited to 'linux-core/drm_ioctl.c')
-rw-r--r--linux-core/drm_ioctl.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/linux-core/drm_ioctl.c b/linux-core/drm_ioctl.c
index f3f757da..9d52fd8a 100644
--- a/linux-core/drm_ioctl.c
+++ b/linux-core/drm_ioctl.c
@@ -229,26 +229,23 @@ int drm_getclient(struct drm_device *dev, void *data,
idx = client->idx;
mutex_lock(&dev->struct_mutex);
-
- if (list_empty(&dev->filelist)) {
- mutex_unlock(&dev->struct_mutex);
- return -EINVAL;
- }
i = 0;
list_for_each_entry(pt, &dev->filelist, lhead) {
- if (i++ >= idx)
- break;
+ if (i++ >= idx) {
+ client->auth = pt->authenticated;
+ client->pid = pt->pid;
+ client->uid = pt->uid;
+ client->magic = pt->magic;
+ client->iocs = pt->ioctl_count;
+ mutex_unlock(&dev->struct_mutex);
+
+ return 0;
+ }
}
-
- client->auth = pt->authenticated;
- client->pid = pt->pid;
- client->uid = pt->uid;
- client->magic = pt->magic;
- client->iocs = pt->ioctl_count;
mutex_unlock(&dev->struct_mutex);
- return 0;
+ return -EINVAL;
}
/**