summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2007-05-18 13:48:56 +0100
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2007-05-18 13:48:56 +0100
commit315cf14af814da60285adb95238181de430c6f68 (patch)
tree0474fc6591ffb1d4c76c3feb1f34df9ab6286eac /linux-core
parent95945bbf226610ba4f41381fd0436722082397ec (diff)
parentea98d7e79657469545b865a353784d79fc8cff9d (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Conflicts: shared-core/i915_dma.c
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/Makefile1
-rw-r--r--linux-core/drmP.h4
-rw-r--r--linux-core/drm_bo.c3
-rw-r--r--linux-core/drm_drv.c42
-rw-r--r--linux-core/drm_fence.c26
-rw-r--r--linux-core/drm_memory.c2
-rw-r--r--linux-core/drm_objects.h9
-rw-r--r--linux-core/drm_os_linux.h18
-rw-r--r--linux-core/drm_vm.c5
9 files changed, 68 insertions, 42 deletions
diff --git a/linux-core/Makefile b/linux-core/Makefile
index af29bd6a..1758777c 100644
--- a/linux-core/Makefile
+++ b/linux-core/Makefile
@@ -283,6 +283,7 @@ CONFIG_DRM_SAVAGE := n
CONFIG_DRM_VIA := n
CONFIG_DRM_MACH64 := n
CONFIG_DRM_NV := n
+CONFIG_DRM_NOUVEAU := n
# Enable module builds for the modules requested/supported.
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 380570bc..4e36dab1 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -1139,6 +1139,10 @@ extern drm_head_t **drm_heads;
extern struct drm_sysfs_class *drm_class;
extern struct proc_dir_entry *drm_proc_root;
+extern drm_local_map_t *drm_getsarea(struct drm_device *dev);
+extern int drm_wait_on(drm_device_t *dev, wait_queue_head_t *queue,
+ int timeout, int (*fn)(drm_device_t *dev, void *priv),
+ void *priv);
/* Proc support (drm_proc.h) */
extern int drm_proc_init(drm_device_t * dev,
int minor,
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 27016d8c..50f62dce 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -2309,6 +2309,9 @@ void drm_bo_unmap_virtual(drm_buffer_object_t * bo)
loff_t offset = ((loff_t) bo->map_list.hash.key) << PAGE_SHIFT;
loff_t holelen = ((loff_t) bo->mem.num_pages) << PAGE_SHIFT;
+ if (!dev->dev_mapping)
+ return;
+
unmap_mapping_range(dev->dev_mapping, offset, holelen, 1);
}
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index dc52f302..76fb90c9 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -632,3 +632,45 @@ err_i1:
return retcode;
}
EXPORT_SYMBOL(drm_ioctl);
+
+int drm_wait_on(drm_device_t *dev, wait_queue_head_t *queue, int timeout,
+ int (*fn)(drm_device_t *dev, void *priv), void *priv)
+{
+ DECLARE_WAITQUEUE(entry, current);
+ unsigned long end = jiffies + (timeout);
+ int ret = 0;
+ add_wait_queue(queue, &entry);
+
+ for (;;) {
+ __set_current_state(TASK_INTERRUPTIBLE);
+ if ((*fn)(dev, priv))
+ break;
+ if (time_after_eq(jiffies, end)) {
+ ret = -EBUSY;
+ break;
+ }
+ schedule_timeout((HZ/100 > 1) ? HZ/100 : 1);
+ if (signal_pending(current)) {
+ ret = -EINTR;
+ break;
+ }
+ }
+ __set_current_state(TASK_RUNNING);
+ remove_wait_queue(queue, &entry);
+ return ret;
+}
+EXPORT_SYMBOL(drm_wait_on);
+
+drm_local_map_t *drm_getsarea(struct drm_device *dev)
+{
+ drm_map_list_t *entry;
+
+ list_for_each_entry(entry, &dev->maplist->head, head) {
+ if (entry->map && entry->map->type == _DRM_SHM &&
+ (entry->map->flags & _DRM_CONTAINS_LOCK)) {
+ return entry->map;
+ }
+ }
+ return NULL;
+}
+EXPORT_SYMBOL(drm_getsarea);
diff --git a/linux-core/drm_fence.c b/linux-core/drm_fence.c
index 088c50d6..ce161dc3 100644
--- a/linux-core/drm_fence.c
+++ b/linux-core/drm_fence.c
@@ -1,8 +1,8 @@
/**************************************************************************
- *
+ *
* Copyright (c) 2006-2007 Tungsten Graphics, Inc., Cedar Park, TX., USA
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,17 +10,17 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
@@ -49,8 +49,6 @@ void drm_fence_handler(drm_device_t * dev, uint32_t class,
int is_exe = (type & DRM_FENCE_TYPE_EXE);
int ge_last_exe;
-
-
diff = (sequence - fc->exe_flush_sequence) & driver->sequence_mask;
if (fc->pending_exe_flush && is_exe && diff < driver->wrap_diff)
@@ -59,13 +57,13 @@ void drm_fence_handler(drm_device_t * dev, uint32_t class,
diff = (sequence - fc->last_exe_flush) & driver->sequence_mask;
ge_last_exe = diff < driver->wrap_diff;
- if (ge_last_exe)
+ if (ge_last_exe)
fc->pending_flush &= ~type;
if (is_exe && ge_last_exe) {
fc->last_exe_flush = sequence;
}
-
+
if (list_empty(&fc->ring))
return;
@@ -107,9 +105,8 @@ void drm_fence_handler(drm_device_t * dev, uint32_t class,
fence->base.hash.key);
list_del_init(&fence->ring);
}
-
}
-
+
if (wake) {
DRM_WAKEUP(&fc->fence_queue);
}
@@ -266,7 +263,7 @@ void drm_fence_flush_old(drm_device_t * dev, uint32_t class, uint32_t sequence)
fc->exe_flush_sequence = sequence - (driver->flush_diff / 2);
}
write_unlock_irqrestore(&fm->lock, flags);
-
+
mutex_lock(&dev->struct_mutex);
read_lock_irqsave(&fm->lock, flags);
@@ -413,7 +410,7 @@ int drm_fence_object_emit(drm_device_t * dev, drm_fence_object_t * fence,
fence->signaled = 0x00;
fence->sequence = sequence;
fence->native_type = native_type;
- if (list_empty(&fc->ring))
+ if (list_empty(&fc->ring))
fc->last_exe_flush = sequence - 1;
list_add_tail(&fence->ring, &fc->ring);
write_unlock_irqrestore(&fm->lock, flags);
@@ -498,7 +495,6 @@ void drm_fence_manager_init(drm_device_t * dev)
drm_fence_driver_t *fed = dev->driver->fence_driver;
int i;
-
rwlock_init(&fm->lock);
write_lock(&fm->lock);
fm->initialized = 0;
diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c
index 86c869f1..759e1f15 100644
--- a/linux-core/drm_memory.c
+++ b/linux-core/drm_memory.c
@@ -47,7 +47,7 @@ static struct {
static inline size_t drm_size_align(size_t size) {
- register size_t tmpSize = 4;
+ size_t tmpSize = 4;
if (size > PAGE_SIZE)
return PAGE_ALIGN(size);
diff --git a/linux-core/drm_objects.h b/linux-core/drm_objects.h
index 0c7f2e32..b6754453 100644
--- a/linux-core/drm_objects.h
+++ b/linux-core/drm_objects.h
@@ -29,8 +29,7 @@
*/
#ifndef _DRM_OBJECTS_H
-#define _DRM_OJBECTS_H
-#define DRM_HAS_TTM
+#define _DRM_OBJECTS_H
struct drm_device;
@@ -248,9 +247,9 @@ typedef struct drm_ttm_backend_func {
typedef struct drm_ttm_backend {
- uint32_t flags;
- int mem_type;
- drm_ttm_backend_func_t *func;
+ uint32_t flags;
+ int mem_type;
+ drm_ttm_backend_func_t *func;
} drm_ttm_backend_t;
typedef struct drm_ttm {
diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h
index 816959e8..2ea105c5 100644
--- a/linux-core/drm_os_linux.h
+++ b/linux-core/drm_os_linux.h
@@ -119,24 +119,6 @@ static __inline__ int mtrr_del(int reg, unsigned long base, unsigned long size)
#define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) _priv = _filp->private_data
-/**
- * Get the pointer to the SAREA.
- *
- * Searches the SAREA on the mapping lists and points drm_device::sarea to it.
- */
-#define DRM_GETSAREA() \
-do { \
- drm_map_list_t *entry; \
- list_for_each_entry( entry, &dev->maplist->head, head ) { \
- if ( entry->map && \
- entry->map->type == _DRM_SHM && \
- (entry->map->flags & _DRM_CONTAINS_LOCK) ) { \
- dev_priv->sarea = entry->map; \
- break; \
- } \
- } \
-} while (0)
-
#define DRM_HZ HZ
#define DRM_WAIT_ON( ret, queue, timeout, condition ) \
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index 1f905fba..b8871539 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -516,8 +516,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
return -EINVAL;
}
- if (!capable(CAP_SYS_ADMIN) &&
- (dma->flags & _DRM_DMA_USE_PCI_RO)) {
+ if (!capable(CAP_SYS_ADMIN) && (dma->flags & _DRM_DMA_USE_PCI_RO)) {
vma->vm_flags &= ~(VM_WRITE | VM_MAYWRITE);
#if defined(__i386__) || defined(__x86_64__)
pgprot_val(vma->vm_page_prot) &= ~_PAGE_RW;
@@ -739,7 +738,7 @@ static unsigned long drm_bo_vm_nopfn(struct vm_area_struct *vma,
unsigned long bus_base;
unsigned long bus_offset;
unsigned long bus_size;
- int ret = NOPFN_REFAULT;
+ unsigned long ret = NOPFN_REFAULT;
if (address > vma->vm_end)
return NOPFN_SIGBUS;