aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/drm/drm_fops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/drm/drm_fops.c b/drivers/char/drm/drm_fops.c
index 898f47dafec0..afe5f07f2e17 100644
--- a/drivers/char/drm/drm_fops.c
+++ b/drivers/char/drm/drm_fops.c
@@ -46,6 +46,7 @@ static int drm_setup(drm_device_t * dev)
46 drm_local_map_t *map; 46 drm_local_map_t *map;
47 int i; 47 int i;
48 int ret; 48 int ret;
49 u32 sareapage;
49 50
50 if (dev->driver->firstopen) { 51 if (dev->driver->firstopen) {
51 ret = dev->driver->firstopen(dev); 52 ret = dev->driver->firstopen(dev);
@@ -56,7 +57,8 @@ static int drm_setup(drm_device_t * dev)
56 dev->magicfree.next = NULL; 57 dev->magicfree.next = NULL;
57 58
58 /* prebuild the SAREA */ 59 /* prebuild the SAREA */
59 i = drm_addmap(dev, 0, SAREA_MAX, _DRM_SHM, _DRM_CONTAINS_LOCK, &map); 60 sareapage = max(SAREA_MAX, PAGE_SIZE);
61 i = drm_addmap(dev, 0, sareapage, _DRM_SHM, _DRM_CONTAINS_LOCK, &map);
60 if (i != 0) 62 if (i != 0)
61 return i; 63 return i;
62 64
@@ -84,7 +86,7 @@ static int drm_setup(drm_device_t * dev)
84 INIT_LIST_HEAD(&dev->ctxlist->head); 86 INIT_LIST_HEAD(&dev->ctxlist->head);
85 87
86 dev->vmalist = NULL; 88 dev->vmalist = NULL;
87 dev->sigdata.lock = dev->lock.hw_lock = NULL; 89 dev->sigdata.lock = NULL;
88 init_waitqueue_head(&dev->lock.lock_queue); 90 init_waitqueue_head(&dev->lock.lock_queue);
89 dev->queue_count = 0; 91 dev->queue_count = 0;
90 dev->queue_reserved = 0; 92 dev->queue_reserved = 0;