Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282729
b: refs/heads/master
c: 09b4ea4
h: refs/heads/master
i:
  282727: 04eb96f
v: v3
  • Loading branch information
Ilija Hadzic authored and Dave Airlie committed Jan 5, 2012
1 parent a5ea5c9 commit f3f17ec
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53fead966a584cd2130e0c5565726dd56ccf7924
refs/heads/master: 09b4ea47d1041612b101c369969db123ac2c1511
5 changes: 3 additions & 2 deletions trunk/drivers/gpu/drm/drm_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ int drm_getsareactx(struct drm_device *dev, void *data,
return -EINVAL;
}

mutex_unlock(&dev->struct_mutex);

request->handle = NULL;
list_for_each_entry(_entry, &dev->maplist, head) {
if (_entry->map == map) {
Expand All @@ -164,6 +162,9 @@ int drm_getsareactx(struct drm_device *dev, void *data,
break;
}
}

mutex_unlock(&dev->struct_mutex);

if (request->handle == NULL)
return -EINVAL;

Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ static struct drm_ioctl_desc drm_ioctls[] = {
DRM_IOCTL_DEF(DRM_IOCTL_GET_UNIQUE, drm_getunique, 0),
DRM_IOCTL_DEF(DRM_IOCTL_GET_MAGIC, drm_getmagic, 0),
DRM_IOCTL_DEF(DRM_IOCTL_IRQ_BUSID, drm_irq_by_busid, DRM_MASTER|DRM_ROOT_ONLY),
DRM_IOCTL_DEF(DRM_IOCTL_GET_MAP, drm_getmap, 0),
DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT, drm_getclient, 0),
DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS, drm_getstats, 0),
DRM_IOCTL_DEF(DRM_IOCTL_GET_MAP, drm_getmap, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT, drm_getclient, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS, drm_getstats, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_GET_CAP, drm_getcap, DRM_UNLOCKED),
DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, DRM_MASTER),

Expand Down
15 changes: 4 additions & 11 deletions trunk/drivers/gpu/drm/drm_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,11 @@ int drm_getmap(struct drm_device *dev, void *data,
int i;

idx = map->offset;

mutex_lock(&dev->struct_mutex);
if (idx < 0) {
mutex_unlock(&dev->struct_mutex);
if (idx < 0)
return -EINVAL;
}

i = 0;
mutex_lock(&dev->struct_mutex);
list_for_each(list, &dev->maplist) {
if (i == idx) {
r_list = list_entry(list, struct drm_map_list, head);
Expand Down Expand Up @@ -211,9 +208,9 @@ int drm_getclient(struct drm_device *dev, void *data,
int i;

idx = client->idx;
mutex_lock(&dev->struct_mutex);

i = 0;

mutex_lock(&dev->struct_mutex);
list_for_each_entry(pt, &dev->filelist, lhead) {
if (i++ >= idx) {
client->auth = pt->authenticated;
Expand Down Expand Up @@ -249,8 +246,6 @@ int drm_getstats(struct drm_device *dev, void *data,

memset(stats, 0, sizeof(*stats));

mutex_lock(&dev->struct_mutex);

for (i = 0; i < dev->counters; i++) {
if (dev->types[i] == _DRM_STAT_LOCK)
stats->data[i].value =
Expand All @@ -262,8 +257,6 @@ int drm_getstats(struct drm_device *dev, void *data,

stats->count = dev->counters;

mutex_unlock(&dev->struct_mutex);

return 0;
}

Expand Down

0 comments on commit f3f17ec

Please sign in to comment.