summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2007-11-22 17:17:06 +1100
committerDave Airlie <airlied@redhat.com>2007-11-22 17:17:06 +1100
commita20587e3950f849deb1e723a0b4455a19f7b3fb8 (patch)
treede0a9d0b6558f3b359acf7985ddf4b8e7e83ee24 /linux-core
parent8fd8bf599b42b6caa062afabdfce7385d59a7695 (diff)
parent5dc5c36e624e5393b5427a159ad34e5fc358cc9f (diff)
Merge branch 'origin' into modesetting-101
Conflicts: linux-core/drmP.h shared-core/i915_dma.c shared-core/i915_drm.h shared-core/radeon_drv.h
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/ati_pcigart.c14
-rw-r--r--linux-core/drmP.h66
-rw-r--r--linux-core/drm_agpsupport.c6
-rw-r--r--linux-core/drm_auth.c4
-rw-r--r--linux-core/drm_bufs.c26
-rw-r--r--linux-core/drm_dma.c6
-rw-r--r--linux-core/drm_drv.c4
-rw-r--r--linux-core/drm_fops.c19
-rw-r--r--linux-core/drm_hashtab.c21
-rw-r--r--linux-core/drm_irq.c4
-rw-r--r--linux-core/drm_memory.c6
-rw-r--r--linux-core/drm_memory.h1
-rw-r--r--linux-core/drm_pci.c4
-rw-r--r--linux-core/drm_proc.c8
-rw-r--r--linux-core/drm_regman.c7
-rw-r--r--linux-core/drm_sman.c3
-rw-r--r--linux-core/drm_stub.c8
-rw-r--r--linux-core/drm_ttm.c5
-rw-r--r--linux-core/drm_vm.c8
-rw-r--r--linux-core/i810_dma.c2
-rw-r--r--linux-core/i915_ioc32.c10
-rw-r--r--linux-core/mga_drv.c4
-rw-r--r--linux-core/nouveau_buffer.c47
-rw-r--r--linux-core/radeon_ioc32.c16
-rw-r--r--linux-core/sis_mm.c7
-rw-r--r--linux-core/via_dmablit.c8
-rw-r--r--linux-core/xgi_drv.h2
27 files changed, 178 insertions, 138 deletions
diff --git a/linux-core/ati_pcigart.c b/linux-core/ati_pcigart.c
index 1c876fc0..5fafbb93 100644
--- a/linux-core/ati_pcigart.c
+++ b/linux-core/ati_pcigart.c
@@ -35,7 +35,7 @@
# define ATI_PCIGART_PAGE_SIZE 4096 /**< PCI GART page size */
-static __inline__ void insert_page_into_table(struct ati_pcigart_info *info, u32 page_base, u32 *pci_gart)
+static __inline__ void insert_page_into_table(struct drm_ati_pcigart_info *info, u32 page_base, u32 *pci_gart)
{
switch(info->gart_reg_if) {
case DRM_ATI_GART_IGP:
@@ -51,7 +51,7 @@ static __inline__ void insert_page_into_table(struct ati_pcigart_info *info, u32
}
}
-static __inline__ u32 get_page_base_from_table(struct ati_pcigart_info *info, u32 *pci_gart)
+static __inline__ u32 get_page_base_from_table(struct drm_ati_pcigart_info *info, u32 *pci_gart)
{
u32 retval;
switch(info->gart_reg_if) {
@@ -120,7 +120,7 @@ static void drm_ati_free_pcigart_table(void *address, int order)
free_pages((unsigned long)address, order);
}
-int drm_ati_pcigart_cleanup(struct drm_device *dev, struct ati_pcigart_info *gart_info)
+int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info)
{
struct drm_sg_mem *entry = dev->sg;
unsigned long pages;
@@ -171,7 +171,7 @@ int drm_ati_pcigart_cleanup(struct drm_device *dev, struct ati_pcigart_info *gar
}
EXPORT_SYMBOL(drm_ati_pcigart_cleanup);
-int drm_ati_pcigart_init(struct drm_device *dev, struct ati_pcigart_info *gart_info)
+int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info)
{
struct drm_sg_mem *entry = dev->sg;
void *address = NULL;
@@ -293,7 +293,7 @@ static int ati_pcigart_bind_ttm(struct drm_ttm_backend *backend,
container_of(backend, ati_pcigart_ttm_backend_t, backend);
off_t j;
int i;
- struct ati_pcigart_info *info = atipci_be->gart_info;
+ struct drm_ati_pcigart_info *info = atipci_be->gart_info;
u32 *pci_gart;
u32 page_base;
unsigned long offset = bo_mem->mm_node->start;
@@ -333,7 +333,7 @@ static int ati_pcigart_unbind_ttm(struct drm_ttm_backend *backend)
{
ati_pcigart_ttm_backend_t *atipci_be =
container_of(backend, ati_pcigart_ttm_backend_t, backend);
- struct ati_pcigart_info *info = atipci_be->gart_info;
+ struct drm_ati_pcigart_info *info = atipci_be->gart_info;
unsigned long offset = atipci_be->offset;
int i;
off_t j;
@@ -392,7 +392,7 @@ static struct drm_ttm_backend_func ati_pcigart_ttm_backend =
.destroy = ati_pcigart_destroy_ttm,
};
-struct drm_ttm_backend *ati_pcigart_init_ttm(struct drm_device *dev, struct ati_pcigart_info *info, void (*gart_flush_fn)(struct drm_device *dev))
+struct drm_ttm_backend *ati_pcigart_init_ttm(struct drm_device *dev, struct drm_ati_pcigart_info *info, void (*gart_flush_fn)(struct drm_device *dev))
{
ati_pcigart_ttm_backend_t *atipci_be;
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 208b48f4..afdf6798 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -85,6 +85,7 @@
#include "drm_hashtab.h"
#include "drm_internal.h"
+struct drm_device;
struct drm_file;
/* If you want the memory alloc debug functionality, change define below */
@@ -162,6 +163,12 @@ struct drm_file;
#define DRM_OBJECT_HASH_ORDER 12
#define DRM_FILE_PAGE_OFFSET_START ((0xFFFFFFFFUL >> PAGE_SHIFT) + 1)
#define DRM_FILE_PAGE_OFFSET_SIZE ((0xFFFFFFFFUL >> PAGE_SHIFT) * 16)
+/*
+ * This should be small enough to allow the use of kmalloc for hash tables
+ * instead of vmalloc.
+ */
+
+#define DRM_FILE_HASH_ORDER 8
#define DRM_MM_INIT_MAX_PAGES 256
/*@}*/
@@ -204,7 +211,7 @@ struct drm_file;
#if DRM_DEBUG_CODE
#define DRM_DEBUG(fmt, arg...) \
do { \
- if ( drm_debug ) \
+ if ( drm_debug ) \
printk(KERN_DEBUG \
"[" DRM_NAME ":%s] " fmt , \
__FUNCTION__ , ##arg); \
@@ -278,9 +285,6 @@ do { \
return -EFAULT; \
}
-struct drm_device;
-struct drm_file;
-
/**
* Ioctl function type.
*
@@ -396,14 +400,9 @@ struct drm_buf_entry {
struct drm_freelist freelist;
};
-/*
- * This should be small enough to allow the use of kmalloc for hash tables
- * instead of vmalloc.
- */
-#define DRM_FILE_HASH_ORDER 8
enum drm_ref_type {
- _DRM_REF_USE=0,
+ _DRM_REF_USE = 0,
_DRM_REF_TYPE1,
_DRM_NO_REF_TYPES
};
@@ -508,14 +507,14 @@ struct drm_agp_mem {
/**
* AGP data.
*
- * \sa drm_agp_init)() and drm_device::agp.
+ * \sa drm_agp_init() and drm_device::agp.
*/
struct drm_agp_head {
DRM_AGP_KERN agp_info; /**< AGP device information */
struct list_head memory;
unsigned long mode; /**< AGP mode */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,11)
- struct agp_bridge_data *bridge;
+ struct agp_bridge_data *bridge;
#endif
int enabled; /**< whether the AGP bus as been enabled */
int acquired; /**< whether the AGP device has been acquired */
@@ -599,7 +598,7 @@ struct drm_vbl_sig {
#define DRM_ATI_GART_PCIE 2
#define DRM_ATI_GART_IGP 3
-struct ati_pcigart_info {
+struct drm_ati_pcigart_info {
int gart_table_location;
int gart_reg_if;
void *addr;
@@ -629,14 +628,14 @@ struct drm_driver {
int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
void (*dma_ready) (struct drm_device *);
int (*dma_quiescent) (struct drm_device *);
- int (*context_ctor) (struct drm_device * dev, int context);
- int (*context_dtor) (struct drm_device * dev, int context);
- int (*kernel_context_switch) (struct drm_device * dev, int old,
+ int (*context_ctor) (struct drm_device *dev, int context);
+ int (*context_dtor) (struct drm_device *dev, int context);
+ int (*kernel_context_switch) (struct drm_device *dev, int old,
int new);
- void (*kernel_context_switch_unlock) (struct drm_device * dev);
- int (*vblank_wait) (struct drm_device * dev, unsigned int *sequence);
- int (*vblank_wait2) (struct drm_device * dev, unsigned int *sequence);
- int (*dri_library_name) (struct drm_device * dev, char * buf);
+ void (*kernel_context_switch_unlock) (struct drm_device *dev);
+ int (*vblank_wait) (struct drm_device *dev, unsigned int *sequence);
+ int (*vblank_wait2) (struct drm_device *dev, unsigned int *sequence);
+ int (*dri_library_name) (struct drm_device *dev, char * buf);
/**
* Called by \c drm_device_is_agp. Typically used to determine if a
@@ -649,22 +648,23 @@ struct drm_driver {
* card is absolutely \b not AGP (return of 0), absolutely \b is AGP
* (return of 1), or may or may not be AGP (return of 2).
*/
- int (*device_is_agp) (struct drm_device * dev);
+ int (*device_is_agp) (struct drm_device *dev);
/* these have to be filled in */
irqreturn_t(*irq_handler) (DRM_IRQ_ARGS);
- void (*irq_preinstall) (struct drm_device * dev);
- void (*irq_postinstall) (struct drm_device * dev);
- void (*irq_uninstall) (struct drm_device * dev);
+ void (*irq_preinstall) (struct drm_device *dev);
+ void (*irq_postinstall) (struct drm_device *dev);
+ void (*irq_uninstall) (struct drm_device *dev);
void (*reclaim_buffers) (struct drm_device *dev,
struct drm_file *file_priv);
void (*reclaim_buffers_locked) (struct drm_device *dev,
struct drm_file *file_priv);
void (*reclaim_buffers_idlelocked) (struct drm_device *dev,
struct drm_file *file_priv);
- unsigned long (*get_map_ofs) (struct drm_map * map);
- unsigned long (*get_reg_ofs) (struct drm_device * dev);
- void (*set_version) (struct drm_device * dev, struct drm_set_version * sv);
+ unsigned long (*get_map_ofs) (struct drm_map *map);
+ unsigned long (*get_reg_ofs) (struct drm_device *dev);
+ void (*set_version) (struct drm_device *dev,
+ struct drm_set_version *sv);
/* FB routines, if present */
int (*fb_probe)(struct drm_device *dev, struct drm_crtc *crtc);
@@ -857,7 +857,7 @@ typedef struct ati_pcigart_ttm_backend {
struct drm_ttm_backend backend;
int populated;
void (*gart_flush_fn)(struct drm_device *dev);
- struct ati_pcigart_info *gart_info;
+ struct drm_ati_pcigart_info *gart_info;
unsigned long offset;
struct page **pages;
int num_pages;
@@ -1179,9 +1179,9 @@ extern int drm_sg_free(struct drm_device *dev, void *data,
struct drm_file *file_priv);
/* ATI PCIGART support (ati_pcigart.h) */
-extern int drm_ati_pcigart_init(struct drm_device *dev, struct ati_pcigart_info *gart_info);
-extern int drm_ati_pcigart_cleanup(struct drm_device *dev, struct ati_pcigart_info *gart_info);
-extern struct drm_ttm_backend *ati_pcigart_init_ttm(struct drm_device *dev, struct ati_pcigart_info *info, void (*gart_flush_fn)(struct drm_device *dev));
+extern int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info);
+extern int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info);
+extern struct drm_ttm_backend *ati_pcigart_init_ttm(struct drm_device *dev, struct drm_ati_pcigart_info *info, void (*gart_flush_fn)(struct drm_device *dev));
extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size,
size_t align, dma_addr_t maxaddr);
@@ -1192,7 +1192,7 @@ extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah);
struct drm_sysfs_class;
extern struct class *drm_sysfs_create(struct module *owner, char *name);
extern void drm_sysfs_destroy(void);
-extern int drm_sysfs_device_add(struct drm_device *dev, struct drm_head * head);
+extern int drm_sysfs_device_add(struct drm_device *dev, struct drm_head *head);
extern void drm_sysfs_device_remove(struct drm_device *dev);
/*
@@ -1232,7 +1232,7 @@ static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev,
static __inline__ int drm_device_is_agp(struct drm_device *dev)
{
if ( dev->driver->device_is_agp != NULL ) {
- int err = (*dev->driver->device_is_agp)( dev );
+ int err = (*dev->driver->device_is_agp)(dev);
if (err != 2) {
return err;
diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c
index 438899e8..cb665009 100644
--- a/linux-core/drm_agpsupport.c
+++ b/linux-core/drm_agpsupport.c
@@ -48,7 +48,7 @@
* Verifies the AGP device has been initialized and acquired and fills in the
* drm_agp_info structure with the information in drm_agp_head::agp_info.
*/
-int drm_agp_info(struct drm_device * dev, struct drm_agp_info *info)
+int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info)
{
DRM_AGP_KERN *kern;
@@ -130,7 +130,7 @@ EXPORT_SYMBOL(drm_agp_acquire);
int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
- return drm_agp_acquire( (struct drm_device *) file_priv->head->dev );
+ return drm_agp_acquire((struct drm_device *) file_priv->head->dev);
}
/**
@@ -426,7 +426,7 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
if (!(head->bridge = agp_backend_acquire(dev->pdev))) {
drm_free(head, sizeof(*head), DRM_MEM_AGPLISTS);
return NULL;
- }
+ }
agp_copy_info(head->bridge, &head->agp_info);
agp_backend_release(head->bridge);
} else {
diff --git a/linux-core/drm_auth.c b/linux-core/drm_auth.c
index e35e8b6d..c904a91d 100644
--- a/linux-core/drm_auth.c
+++ b/linux-core/drm_auth.c
@@ -83,7 +83,7 @@ static int drm_add_magic(struct drm_device * dev, struct drm_file * priv,
return -ENOMEM;
memset(entry, 0, sizeof(*entry));
entry->priv = priv;
- entry->hash_item.key = (unsigned long) magic;
+ entry->hash_item.key = (unsigned long)magic;
mutex_lock(&dev->struct_mutex);
drm_ht_insert_item(&dev->magiclist, &entry->hash_item);
list_add_tail(&entry->head, &dev->magicfree);
@@ -109,7 +109,7 @@ static int drm_remove_magic(struct drm_device * dev, drm_magic_t magic)
DRM_DEBUG("%d\n", magic);
mutex_lock(&dev->struct_mutex);
- if (drm_ht_find_item(&dev->magiclist, (unsigned long) magic, &hash)) {
+ if (drm_ht_find_item(&dev->magiclist, (unsigned long)magic, &hash)) {
mutex_unlock(&dev->struct_mutex);
return -EINVAL;
}
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index f80020bf..bfd3dd3d 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -173,12 +173,17 @@ static int drm_addmap_core(struct drm_device *dev, unsigned int offset,
if (drm_core_has_MTRR(dev)) {
if (map->type == _DRM_FRAME_BUFFER ||
(map->flags & _DRM_WRITE_COMBINING)) {
- map->mtrr = mtrr_add(map->offset, map->size,
- MTRR_TYPE_WRCOMB, 1);
+ map->mtrr = mtrr_add(map->offset, map->size,
+ MTRR_TYPE_WRCOMB, 1);
}
}
- if (map->type == _DRM_REGISTERS)
+ if (map->type == _DRM_REGISTERS) {
map->handle = ioremap(map->offset, map->size);
+ if (!map->handle) {
+ drm_free(map, sizeof(*map), DRM_MEM_MAPS);
+ return -ENOMEM;
+ }
+ }
break;
case _DRM_SHM:
list = drm_find_matching_map(dev, map);
@@ -387,9 +392,9 @@ int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map)
}
}
- if (!found) {
+ if (!found)
return -EINVAL;
- }
+
/* List has wrapped around to the head pointer, or it's empty and we
* didn't find anything.
*/
@@ -495,7 +500,8 @@ int drm_rmmap_ioctl(struct drm_device *dev, void *data,
*
* Frees any pages and buffers associated with the given entry.
*/
-static void drm_cleanup_buf_error(struct drm_device *dev, struct drm_buf_entry * entry)
+static void drm_cleanup_buf_error(struct drm_device *dev,
+ struct drm_buf_entry *entry)
{
int i;
@@ -530,7 +536,7 @@ static void drm_cleanup_buf_error(struct drm_device *dev, struct drm_buf_entry *
#if __OS_HAS_AGP
/**
- * Add AGP buffers for DMA transfers
+ * Add AGP buffers for DMA transfers.
*
* \param dev struct drm_device to which the buffers are to be added.
* \param request pointer to a struct drm_buf_desc describing the request.
@@ -540,7 +546,7 @@ static void drm_cleanup_buf_error(struct drm_device *dev, struct drm_buf_entry *
* reallocates the buffer list of the same size order to accommodate the new
* buffers.
*/
-int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc * request)
+int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc *request)
{
struct drm_device_dma *dma = dev->dma;
struct drm_buf_entry *entry;
@@ -710,7 +716,7 @@ int drm_addbufs_agp(struct drm_device *dev, struct drm_buf_desc * request)
EXPORT_SYMBOL(drm_addbufs_agp);
#endif /* __OS_HAS_AGP */
-int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request)
+int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc *request)
{
struct drm_device_dma *dma = dev->dma;
int count;
@@ -936,7 +942,7 @@ int drm_addbufs_pci(struct drm_device *dev, struct drm_buf_desc * request)
}
EXPORT_SYMBOL(drm_addbufs_pci);
-static int drm_addbufs_sg(struct drm_device *dev, struct drm_buf_desc * request)
+static int drm_addbufs_sg(struct drm_device *dev, struct drm_buf_desc *request)
{
struct drm_device_dma *dma = dev->dma;
struct drm_buf_entry *entry;
diff --git a/linux-core/drm_dma.c b/linux-core/drm_dma.c
index c4c4c694..f7bff0ac 100644
--- a/linux-core/drm_dma.c
+++ b/linux-core/drm_dma.c
@@ -43,7 +43,7 @@
*
* Allocate and initialize a drm_device_dma structure.
*/
-int drm_dma_setup(struct drm_device * dev)
+int drm_dma_setup(struct drm_device *dev)
{
int i;
@@ -67,7 +67,7 @@ int drm_dma_setup(struct drm_device * dev)
* Free all pages associated with DMA buffers, the buffers and pages lists, and
* finally the drm_device::dma structure itself.
*/
-void drm_dma_takedown(struct drm_device * dev)
+void drm_dma_takedown(struct drm_device *dev)
{
struct drm_device_dma *dma = dev->dma;
int i, j;
@@ -129,7 +129,7 @@ void drm_dma_takedown(struct drm_device * dev)
*
* Resets the fields of \p buf.
*/
-void drm_free_buffer(struct drm_device * dev, struct drm_buf * buf)
+void drm_free_buffer(struct drm_device *dev, struct drm_buf *buf)
{
if (!buf)
return;
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 99eba979..8cd7afb1 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -189,8 +189,8 @@ int drm_lastclose(struct drm_device * dev)
if (dev->unique) {
drm_free(dev->unique, strlen(dev->unique) + 1, DRM_MEM_DRIVER);
- dev->unique=NULL;
- dev->unique_len=0;
+ dev->unique = NULL;
+ dev->unique_len = 0;
}
if (dev->irq_enabled)
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index a5277b7b..cc09fc14 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -152,7 +152,7 @@ int drm_open(struct inode *inode, struct file *filp)
spin_unlock(&dev->count_lock);
}
- out:
+out:
mutex_lock(&dev->struct_mutex);
BUG_ON((dev->dev_mapping != NULL) &&
(dev->dev_mapping != inode->i_mapping));
@@ -236,7 +236,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
int minor = iminor(inode);
struct drm_file *priv;
int ret;
- int i,j;
+ int i, j;
if (filp->f_flags & O_EXCL)
return -EBUSY; /* No exclusive opens */
@@ -265,14 +265,15 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
INIT_LIST_HEAD(&priv->refd_objects);
INIT_LIST_HEAD(&priv->fbs);
- for (i=0; i<_DRM_NO_REF_TYPES; ++i) {
- ret = drm_ht_create(&priv->refd_object_hash[i], DRM_FILE_HASH_ORDER);
+ for (i = 0; i < _DRM_NO_REF_TYPES; ++i) {
+ ret = drm_ht_create(&priv->refd_object_hash[i],
+ DRM_FILE_HASH_ORDER);
if (ret)
break;
}
if (ret) {
- for(j = 0; j < i; ++j)
+ for (j = 0; j < i; ++j)
drm_ht_remove(&priv->refd_object_hash[j]);
goto out_free;
}
@@ -341,8 +342,9 @@ static void drm_object_release(struct file *filp)
/*
* Free leftover ref objects created by me. Note that we cannot use
- * list_for_each() here, as the struct_mutex may be temporarily released
- * by the remove_() functions, and thus the lists may be altered.
+ * list_for_each() here, as the struct_mutex may be temporarily
+ * released by the remove_() functions, and thus the lists may be
+ * altered.
* Also, a drm_remove_ref_object() will not remove it
* from the list unless its refcount is 1.
*/
@@ -354,9 +356,8 @@ static void drm_object_release(struct file *filp)
head = &priv->refd_objects;
}
- for(i = 0; i < _DRM_NO_REF_TYPES; ++i) {
+ for (i = 0; i < _DRM_NO_REF_TYPES; ++i)
drm_ht_remove(&priv->refd_object_hash[i]);
- }
}
/**
diff --git a/linux-core/drm_hashtab.c b/linux-core/drm_hashtab.c
index dacc83be..f5a4f849 100644
--- a/linux-core/drm_hashtab.c
+++ b/linux-core/drm_hashtab.c
@@ -36,7 +36,7 @@
#include "drm_hashtab.h"
#include <linux/hash.h>
-int drm_ht_create(struct drm_open_hash * ht, unsigned int order)
+int drm_ht_create(struct drm_open_hash *ht, unsigned int order)
{
unsigned int i;
@@ -63,7 +63,7 @@ int drm_ht_create(struct drm_open_hash * ht, unsigned int order)
return 0;
}
-void drm_ht_verbose_list(struct drm_open_hash * ht, unsigned long key)
+void drm_ht_verbose_list(struct drm_open_hash *ht, unsigned long key)
{
struct drm_hash_item *entry;
struct hlist_head *h_list;
@@ -80,7 +80,7 @@ void drm_ht_verbose_list(struct drm_open_hash * ht, unsigned long key)
}
}
-static struct hlist_node *drm_ht_find_key(struct drm_open_hash * ht,
+static struct hlist_node *drm_ht_find_key(struct drm_open_hash *ht,
unsigned long key)
{
struct drm_hash_item *entry;
@@ -100,7 +100,7 @@ static struct hlist_node *drm_ht_find_key(struct drm_open_hash * ht,
return NULL;
}
-int drm_ht_insert_item(struct drm_open_hash * ht, struct drm_hash_item * item)
+int drm_ht_insert_item(struct drm_open_hash *ht, struct drm_hash_item *item)
{
struct drm_hash_item *entry;
struct hlist_head *h_list;
@@ -131,7 +131,8 @@ int drm_ht_insert_item(struct drm_open_hash * ht, struct drm_hash_item * item)
* Just insert an item and return any "bits" bit key that hasn't been
* used before.
*/
-int drm_ht_just_insert_please(struct drm_open_hash * ht, struct drm_hash_item * item,
+int drm_ht_just_insert_please(struct drm_open_hash *ht,
+ struct drm_hash_item *item,
unsigned long seed, int bits, int shift,
unsigned long add)
{
@@ -155,8 +156,8 @@ int drm_ht_just_insert_please(struct drm_open_hash * ht, struct drm_hash_item *
return 0;
}
-int drm_ht_find_item(struct drm_open_hash * ht, unsigned long key,
- struct drm_hash_item ** item)
+int drm_ht_find_item(struct drm_open_hash *ht, unsigned long key,
+ struct drm_hash_item **item)
{
struct hlist_node *list;
@@ -168,7 +169,7 @@ int drm_ht_find_item(struct drm_open_hash * ht, unsigned long key,
return 0;
}
-int drm_ht_remove_key(struct drm_open_hash * ht, unsigned long key)
+int drm_ht_remove_key(struct drm_open_hash *ht, unsigned long key)
{
struct hlist_node *list;
@@ -181,14 +182,14 @@ int drm_ht_remove_key(struct drm_open_hash * ht, unsigned long key)
return -EINVAL;
}
-int drm_ht_remove_item(struct drm_open_hash * ht, struct drm_hash_item * item)
+int drm_ht_remove_item(struct drm_open_hash *ht, struct drm_hash_item *item)
{
hlist_del_init(&item->head);
ht->fill--;
return 0;
}
-void drm_ht_remove(struct drm_open_hash * ht)
+void drm_ht_remove(struct drm_open_hash *ht)
{
if (ht->table) {
if (ht->use_vmalloc)
diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c
index 25166b6f..314c2329 100644
--- a/linux-core/drm_irq.c
+++ b/linux-core/drm_irq.c
@@ -396,7 +396,7 @@ EXPORT_SYMBOL(drm_vbl_send_signals);
*/
static void drm_locked_tasklet_func(unsigned long data)
{
- struct drm_device *dev = (struct drm_device*)data;
+ struct drm_device *dev = (struct drm_device *)data;
unsigned long irqflags;
spin_lock_irqsave(&dev->tasklet_lock, irqflags);
@@ -433,7 +433,7 @@ static void drm_locked_tasklet_func(unsigned long data)
* context, it must not make any assumptions about this. Also, the HW lock will
* be held with the kernel context or any client context.
*/
-void drm_locked_tasklet(struct drm_device *dev, void (*func)(struct drm_device*))
+void drm_locked_tasklet(struct drm_device *dev, void (*func)(struct drm_device *))
{
unsigned long irqflags;
static DECLARE_TASKLET(drm_tasklet, drm_locked_tasklet_func, 0);
diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c
index f68a3a3e..402a680f 100644
--- a/linux-core/drm_memory.c
+++ b/linux-core/drm_memory.c
@@ -45,13 +45,13 @@ static struct {
.lock = SPIN_LOCK_UNLOCKED
};
-static inline size_t drm_size_align(size_t size) {
-
+static inline size_t drm_size_align(size_t size)
+{
size_t tmpSize = 4;
if (size > PAGE_SIZE)
return PAGE_ALIGN(size);
- while(tmpSize < size)
+ while (tmpSize < size)
tmpSize <<= 1;
return (size_t) tmpSize;
diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h
index 5590c491..63e425b5 100644
--- a/linux-core/drm_memory.h
+++ b/linux-core/drm_memory.h
@@ -42,7 +42,6 @@
* drm_memory.h.
*/
-/* Need the 4-argument version of vmap(). */
#if __OS_HAS_AGP
#include <linux/vmalloc.h>
diff --git a/linux-core/drm_pci.c b/linux-core/drm_pci.c
index a608eed3..7569286c 100644
--- a/linux-core/drm_pci.c
+++ b/linux-core/drm_pci.c
@@ -123,7 +123,7 @@ EXPORT_SYMBOL(drm_pci_alloc);
*
* This function is for internal use in the Linux-specific DRM core code.
*/
-void __drm_pci_free(struct drm_device * dev, drm_dma_handle_t *dmah)
+void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah)
{
unsigned long addr;
size_t sz;
@@ -167,7 +167,7 @@ void __drm_pci_free(struct drm_device * dev, drm_dma_handle_t *dmah)
/**
* \brief Free a PCI consistent memory block
*/
-void drm_pci_free(struct drm_device * dev, drm_dma_handle_t *dmah)
+void drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah)
{
__drm_pci_free(dev, dmah);
kfree(dmah);
diff --git a/linux-core/drm_proc.c b/linux-core/drm_proc.c
index 08bf99d6..3012c5b0 100644
--- a/linux-core/drm_proc.c
+++ b/linux-core/drm_proc.c
@@ -239,10 +239,10 @@ static int drm__vm_info(char *buf, char **start, off_t offset, int request,
else
type = types[map->type];
DRM_PROC_PRINT("%4d 0x%08lx 0x%08lx %4.4s 0x%02x 0x%08lx ",
- i,
- map->offset,
- map->size, type, map->flags,
- (unsigned long) r_list->user_token);
+ i,
+ map->offset,
+ map->size, type, map->flags,
+ (unsigned long) r_list->user_token);
if (map->mtrr < 0) {
DRM_PROC_PRINT("none\n");
diff --git a/linux-core/drm_regman.c b/linux-core/drm_regman.c
index f49a25cb..aa117323 100644
--- a/linux-core/drm_regman.c
+++ b/linux-core/drm_regman.c
@@ -109,11 +109,10 @@ int drm_regs_alloc(struct drm_reg_manager *manager,
*/
return -EBUSY;
- out:
+out:
*reg = entry;
return 0;
}
-
EXPORT_SYMBOL(drm_regs_alloc);
void drm_regs_fence(struct drm_reg_manager *manager,
@@ -156,7 +155,6 @@ void drm_regs_fence(struct drm_reg_manager *manager,
}
}
}
-
EXPORT_SYMBOL(drm_regs_fence);
void drm_regs_free(struct drm_reg_manager *manager)
@@ -180,7 +178,6 @@ void drm_regs_free(struct drm_reg_manager *manager)
manager->reg_destroy(entry);
}
}
-
EXPORT_SYMBOL(drm_regs_free);
void drm_regs_add(struct drm_reg_manager *manager, struct drm_reg *reg)
@@ -188,7 +185,6 @@ void drm_regs_add(struct drm_reg_manager *manager, struct drm_reg *reg)
reg->fence = NULL;
list_add_tail(&reg->head, &manager->free);
}
-
EXPORT_SYMBOL(drm_regs_add);
void drm_regs_init(struct drm_reg_manager *manager,
@@ -201,5 +197,4 @@ void drm_regs_init(struct drm_reg_manager *manager,
manager->reg_reusable = reg_reusable;
manager->reg_destroy = reg_destroy;
}
-
EXPORT_SYMBOL(drm_regs_init);
diff --git a/linux-core/drm_sman.c b/linux-core/drm_sman.c
index 118e82ae..8421a939 100644
--- a/linux-core/drm_sman.c
+++ b/linux-core/drm_sman.c
@@ -264,7 +264,8 @@ int drm_sman_free_key(struct drm_sman *sman, unsigned int key)
if (drm_ht_find_item(&sman->user_hash_tab, key, &hash_item))
return -EINVAL;
- memblock_item = drm_hash_entry(hash_item, struct drm_memblock_item, user_hash);
+ memblock_item = drm_hash_entry(hash_item, struct drm_memblock_item,
+ user_hash);
drm_sman_free(memblock_item);
return 0;
}
diff --git a/linux-core/drm_stub.c b/linux-core/drm_stub.c
index eb4ba8e9..cc759d5c 100644
--- a/linux-core/drm_stub.c
+++ b/linux-core/drm_stub.c
@@ -55,8 +55,8 @@ struct class *drm_class;
struct proc_dir_entry *drm_proc_root;
static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,
- const struct pci_device_id *ent,
- struct drm_driver *driver)
+ const struct pci_device_id *ent,
+ struct drm_driver *driver)
{
int retcode;
@@ -218,7 +218,7 @@ err_g1:
* Try and register, if we fail to register, backout previous work.
*/
int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
- struct drm_driver *driver)
+ struct drm_driver *driver)
{
struct drm_device *dev;
int ret;
@@ -318,7 +318,7 @@ int drm_put_head(struct drm_head * head)
drm_proc_cleanup(minor, drm_proc_root, head->dev_root);
drm_sysfs_device_remove(head->dev);
- *head = (struct drm_head){.dev = NULL};
+ *head = (struct drm_head) {.dev = NULL};
drm_heads[minor] = NULL;
return 0;
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index 777dd2ca..3540571f 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -239,9 +239,6 @@ struct page *drm_ttm_get_page(struct drm_ttm *ttm, int index)
}
EXPORT_SYMBOL(drm_ttm_get_page);
-
-
-
int drm_ttm_set_user(struct drm_ttm *ttm,
struct task_struct *tsk,
int write,
@@ -278,8 +275,6 @@ int drm_ttm_set_user(struct drm_ttm *ttm,
return 0;
}
-
-
int drm_ttm_populate(struct drm_ttm *ttm)
{
struct page *page;
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index 42e1f27a..f2681cc9 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -263,7 +263,7 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
dmah.size = map->size;
__drm_pci_free(dev, &dmah);
break;
- case _DRM_TTM:
+ case _DRM_TTM:
BUG_ON(1);
break;
}
@@ -632,9 +632,9 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
#endif
if (io_remap_pfn_range(vma, vma->vm_start,
- (map->offset + offset) >> PAGE_SHIFT,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot))
+ (map->offset + offset) >> PAGE_SHIFT,
+ vma->vm_end - vma->vm_start,
+ vma->vm_page_prot))
return -EAGAIN;
DRM_DEBUG(" Type = %d; start = 0x%lx, end = 0x%lx,"
" offset = 0x%lx\n",
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c
index 949355aa..c085fbc9 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/i810_dma.c
@@ -1271,7 +1271,7 @@ int i810_driver_dma_quiescent(struct drm_device * dev)
}
struct drm_ioctl_desc i810_ioctls[] = {
- DRM_IOCTL_DEF(DRM_I810_INIT, i810_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
+ DRM_IOCTL_DEF(DRM_I810_INIT, i810_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
DRM_IOCTL_DEF(DRM_I810_VERTEX, i810_dma_vertex, DRM_AUTH),
DRM_IOCTL_DEF(DRM_I810_CLEAR, i810_clear_bufs, DRM_AUTH),
DRM_IOCTL_DEF(DRM_I810_FLUSH, i810_flush_ioctl, DRM_AUTH),
diff --git a/linux-core/i915_ioc32.c b/linux-core/i915_ioc32.c
index 7e733d33..11dee035 100644
--- a/linux-core/i915_ioc32.c
+++ b/linux-core/i915_ioc32.c
@@ -45,7 +45,7 @@ typedef struct _drm_i915_batchbuffer32 {
} drm_i915_batchbuffer32_t;
static int compat_i915_batchbuffer(struct file *file, unsigned int cmd,
- unsigned long arg)
+ unsigned long arg)
{
drm_i915_batchbuffer32_t batchbuffer32;
drm_i915_batchbuffer_t __user *batchbuffer;
@@ -81,7 +81,7 @@ typedef struct _drm_i915_cmdbuffer32 {
} drm_i915_cmdbuffer32_t;
static int compat_i915_cmdbuffer(struct file *file, unsigned int cmd,
- unsigned long arg)
+ unsigned long arg)
{
drm_i915_cmdbuffer32_t cmdbuffer32;
drm_i915_cmdbuffer_t __user *cmdbuffer;
@@ -111,7 +111,7 @@ typedef struct drm_i915_irq_emit32 {
} drm_i915_irq_emit32_t;
static int compat_i915_irq_emit(struct file *file, unsigned int cmd,
- unsigned long arg)
+ unsigned long arg)
{
drm_i915_irq_emit32_t req32;
drm_i915_irq_emit_t __user *request;
@@ -134,7 +134,7 @@ typedef struct drm_i915_getparam32 {
} drm_i915_getparam32_t;
static int compat_i915_getparam(struct file *file, unsigned int cmd,
- unsigned long arg)
+ unsigned long arg)
{
drm_i915_getparam32_t req32;
drm_i915_getparam_t __user *request;
@@ -161,7 +161,7 @@ typedef struct drm_i915_mem_alloc32 {
} drm_i915_mem_alloc32_t;
static int compat_i915_alloc(struct file *file, unsigned int cmd,
- unsigned long arg)
+ unsigned long arg)
{
drm_i915_mem_alloc32_t req32;
drm_i915_mem_alloc_t __user *request;
diff --git a/linux-core/mga_drv.c b/linux-core/mga_drv.c
index e3d26a08..bab90aa5 100644
--- a/linux-core/mga_drv.c
+++ b/linux-core/mga_drv.c
@@ -142,8 +142,8 @@ static int mga_driver_device_is_agp(struct drm_device * dev)
*/
if ((pdev->device == 0x0525) && pdev->bus->self
- && (pdev->bus->self->vendor == 0x3388)
- && (pdev->bus->self->device == 0x0021) ) {
+ && (pdev->bus->self->vendor == 0x3388)
+ && (pdev->bus->self->device == 0x0021)) {
return 0;
}
diff --git a/linux-core/nouveau_buffer.c b/linux-core/nouveau_buffer.c
index c40dff6b..9b252a05 100644
--- a/linux-core/nouveau_buffer.c
+++ b/linux-core/nouveau_buffer.c
@@ -143,12 +143,13 @@ nouveau_bo_evict_mask(struct drm_buffer_object *bo)
return 0;
}
+
/* GPU-assisted copy using NV_MEMORY_TO_MEMORY_FORMAT, can access
* DRM_BO_MEM_{VRAM,PRIV0,TT} directly.
*/
static int
nouveau_bo_move_m2mf(struct drm_buffer_object *bo, int evict, int no_wait,
- struct drm_bo_mem_reg *new_mem)
+ struct drm_bo_mem_reg *new_mem)
{
struct drm_device *dev = bo->dev;
struct drm_nouveau_private *dev_priv = dev->dev_private;
@@ -195,6 +196,46 @@ nouveau_bo_move_m2mf(struct drm_buffer_object *bo, int evict, int no_wait,
DRM_FENCE_TYPE_EXE, 0, new_mem);
}
+/* Flip pages into the GART and move if we can. */
+static int
+nouveau_bo_move_gart(struct drm_buffer_object *bo, int evict, int no_wait,
+ struct drm_bo_mem_reg *new_mem)
+{
+ struct drm_device *dev = bo->dev;
+ struct drm_bo_mem_reg tmp_mem;
+ int ret;
+
+ tmp_mem = *new_mem;
+ tmp_mem.mm_node = NULL;
+ tmp_mem.mask = DRM_BO_FLAG_MEM_TT |
+ DRM_BO_FLAG_CACHED | DRM_BO_FLAG_FORCE_CACHING;
+
+ ret = drm_bo_mem_space(bo, &tmp_mem, no_wait);
+
+ if (ret)
+ return ret;
+
+ ret = drm_bind_ttm(bo->ttm, &tmp_mem);
+ if (ret)
+ goto out_cleanup;
+
+ ret = nouveau_bo_move_m2mf(bo, 1, no_wait, &tmp_mem);
+ if (ret)
+ goto out_cleanup;
+
+ ret = drm_bo_move_ttm(bo, evict, no_wait, new_mem);
+
+out_cleanup:
+ if (tmp_mem.mm_node) {
+ mutex_lock(&dev->struct_mutex);
+ if (tmp_mem.mm_node != bo->pinned_node)
+ drm_mm_put_block(tmp_mem.mm_node);
+ tmp_mem.mm_node = NULL;
+ mutex_unlock(&dev->struct_mutex);
+ }
+ return ret;
+}
+
static int
nouveau_bo_move(struct drm_buffer_object *bo, int evict, int no_wait,
struct drm_bo_mem_reg *new_mem)
@@ -205,14 +246,14 @@ nouveau_bo_move(struct drm_buffer_object *bo, int evict, int no_wait,
if (old_mem->mem_type == DRM_BO_MEM_LOCAL)
return drm_bo_move_memcpy(bo, evict, no_wait, new_mem);
#if 0
- if (!nouveau_bo_move_flipd(bo, evict, no_wait, new_mem))
+ if (!nouveau_bo_move_to_gart(bo, evict, no_wait, new_mem))
#endif
return drm_bo_move_memcpy(bo, evict, no_wait, new_mem);
}
else
if (old_mem->mem_type == DRM_BO_MEM_LOCAL) {
#if 0
- if (nouveau_bo_move_flips(bo, evict, no_wait, new_mem))
+ if (nouveau_bo_move_to_gart(bo, evict, no_wait, new_mem))
#endif
return drm_bo_move_memcpy(bo, evict, no_wait, new_mem);
}
diff --git a/linux-core/radeon_ioc32.c b/linux-core/radeon_ioc32.c
index bc8aa35a..a842c743 100644
--- a/linux-core/radeon_ioc32.c
+++ b/linux-core/radeon_ioc32.c
@@ -136,7 +136,7 @@ typedef struct drm_radeon_stipple32 {
static int compat_radeon_cp_stipple(struct file *file, unsigned int cmd,
unsigned long arg)
{
- drm_radeon_stipple32_t __user *argp = (void __user *) arg;
+ drm_radeon_stipple32_t __user *argp = (void __user *)arg;
drm_radeon_stipple_t __user *request;
u32 mask;
@@ -176,7 +176,7 @@ static int compat_radeon_cp_texture(struct file *file, unsigned int cmd,
drm_radeon_tex_image32_t img32;
drm_radeon_tex_image_t __user *image;
- if (copy_from_user(&req32, (void __user *) arg, sizeof(req32)))
+ if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
return -EFAULT;
if (req32.image == 0)
return -EINVAL;
@@ -223,7 +223,7 @@ static int compat_radeon_cp_vertex2(struct file *file, unsigned int cmd,
drm_radeon_vertex2_32_t req32;
drm_radeon_vertex2_t __user *request;
- if (copy_from_user(&req32, (void __user *) arg, sizeof(req32)))
+ if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
return -EFAULT;
request = compat_alloc_user_space(sizeof(*request));
@@ -255,7 +255,7 @@ static int compat_radeon_cp_cmdbuf(struct file *file, unsigned int cmd,
drm_radeon_cmd_buffer32_t req32;
drm_radeon_cmd_buffer_t __user *request;
- if (copy_from_user(&req32, (void __user *) arg, sizeof(req32)))
+ if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
return -EFAULT;
request = compat_alloc_user_space(sizeof(*request));
@@ -283,7 +283,7 @@ static int compat_radeon_cp_getparam(struct file *file, unsigned int cmd,
drm_radeon_getparam32_t req32;
drm_radeon_getparam_t __user *request;
- if (copy_from_user(&req32, (void __user *) arg, sizeof(req32)))
+ if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
return -EFAULT;
request = compat_alloc_user_space(sizeof(*request));
@@ -310,7 +310,7 @@ static int compat_radeon_mem_alloc(struct file *file, unsigned int cmd,
drm_radeon_mem_alloc32_t req32;
drm_radeon_mem_alloc_t __user *request;
- if (copy_from_user(&req32, (void __user *) arg, sizeof(req32)))
+ if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
return -EFAULT;
request = compat_alloc_user_space(sizeof(*request));
@@ -336,7 +336,7 @@ static int compat_radeon_irq_emit(struct file *file, unsigned int cmd,
drm_radeon_irq_emit32_t req32;
drm_radeon_irq_emit_t __user *request;
- if (copy_from_user(&req32, (void __user *) arg, sizeof(req32)))
+ if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
return -EFAULT;
request = compat_alloc_user_space(sizeof(*request));
@@ -362,7 +362,7 @@ static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd,
drm_radeon_setparam32_t req32;
drm_radeon_setparam_t __user *request;
- if (copy_from_user(&req32, (void __user *) arg, sizeof(req32)))
+ if (copy_from_user(&req32, (void __user *)arg, sizeof(req32)))
return -EFAULT;
request = compat_alloc_user_space(sizeof(*request));
diff --git a/linux-core/sis_mm.c b/linux-core/sis_mm.c
index 2225ec80..5110d6e5 100644
--- a/linux-core/sis_mm.c
+++ b/linux-core/sis_mm.c
@@ -74,7 +74,7 @@ static void sis_sman_mm_destroy(void *private)
;
}
-unsigned long sis_sman_mm_offset(void *private, void *ref)
+static unsigned long sis_sman_mm_offset(void *private, void *ref)
{
return ~((unsigned long)ref);
}
@@ -119,7 +119,7 @@ static int sis_fb_init(struct drm_device *dev, void *data, struct drm_file *file
return 0;
}
-static int sis_drm_alloc(struct drm_device * dev, struct drm_file *file_priv,
+static int sis_drm_alloc(struct drm_device *dev, struct drm_file *file_priv,
void *data, int pool)
{
drm_sis_private_t *dev_priv = dev->dev_private;
@@ -231,8 +231,7 @@ static drm_local_map_t *sis_reg_init(struct drm_device *dev)
return NULL;
}
-int
-sis_idle(struct drm_device *dev)
+int sis_idle(struct drm_device *dev)
{
drm_sis_private_t *dev_priv = dev->dev_private;
uint32_t idle_reg;
diff --git a/linux-core/via_dmablit.c b/linux-core/via_dmablit.c
index e285ca7b..a6a21782 100644
--- a/linux-core/via_dmablit.c
+++ b/linux-core/via_dmablit.c
@@ -239,8 +239,10 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg, drm_via_dmablit_t *xfer)
return -ENOMEM;
memset(vsg->pages, 0, sizeof(struct page *) * vsg->num_pages);
down_read(&current->mm->mmap_sem);
- ret = get_user_pages(current, current->mm, (unsigned long) xfer->mem_addr,
- vsg->num_pages, (vsg->direction == DMA_FROM_DEVICE),
+ ret = get_user_pages(current, current->mm,
+ (unsigned long)xfer->mem_addr,
+ vsg->num_pages,
+ (vsg->direction == DMA_FROM_DEVICE),
0, vsg->pages, NULL);
up_read(&current->mm->mmap_sem);
@@ -509,7 +511,7 @@ via_dmablit_workqueue(struct work_struct *work)
#else
drm_via_blitq_t *blitq = container_of(work, drm_via_blitq_t, wq);
#endif
- struct drm_device *dev = blitq->dev;
+ struct drm_device *dev = blitq->dev;
unsigned long irqsave;
drm_via_sg_info_t *cur_sg;
int cur_released;
diff --git a/linux-core/xgi_drv.h b/linux-core/xgi_drv.h
index d9a94f5f..9408073e 100644
--- a/linux-core/xgi_drv.h
+++ b/linux-core/xgi_drv.h
@@ -64,7 +64,7 @@ struct xgi_info {
struct drm_map *fb_map;
/* look up table parameters */
- struct ati_pcigart_info gart_info;
+ struct drm_ati_pcigart_info gart_info;
unsigned int lutPageSize;
struct drm_sman sman;