summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Hartmann <jhartmann@valinux.com>2000-01-21 07:29:55 +0000
committerJeff Hartmann <jhartmann@valinux.com>2000-01-21 07:29:55 +0000
commit8b7e3ee88c41b342421903fb0012f228b303c2d3 (patch)
tree4154dbee0bbe0beb9636887f85a824177a2f3615
parent5cd0a096d810d3561b0d52b76e6e21835efef364 (diff)
Added type to drm so I810 will work properly
-rw-r--r--libdrm/xf86drm.c3
-rw-r--r--linux-core/drmP.h2
-rw-r--r--linux/agpsupport.c6
-rw-r--r--linux/drm.h1
-rw-r--r--linux/drmP.h2
-rw-r--r--linux/memory.c4
-rw-r--r--shared-core/drm.h1
-rw-r--r--shared/drm.h1
8 files changed, 13 insertions, 7 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 9ce98410..0195ecfb 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -766,12 +766,13 @@ int drmAgpEnable(int fd, unsigned long mode)
return 0;
}
-unsigned long drmAgpAlloc(int fd, unsigned long size)
+unsigned long drmAgpAlloc(int fd, unsigned long size, unsigned long type)
{
drm_agp_buffer_t b;
b.size = size;
b.handle = 0;
+ b.type = type;
if (ioctl(fd, DRM_IOCTL_AGP_ALLOC, &b)) return 0;
return b.handle;
}
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index d0a36459..042de764 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -594,7 +594,7 @@ extern void *drm_ioremap(unsigned long offset, unsigned long size);
extern void drm_ioremapfree(void *pt, unsigned long size);
#ifdef DRM_AGP
-extern agp_memory *drm_alloc_agp(int pages);
+extern agp_memory *drm_alloc_agp(int pages, u32 type);
extern int drm_free_agp(agp_memory *handle, int pages);
extern int drm_bind_agp(agp_memory *handle, unsigned int start);
extern int drm_unbind_agp(agp_memory *handle);
diff --git a/linux/agpsupport.c b/linux/agpsupport.c
index 0e25c615..e49911ab 100644
--- a/linux/agpsupport.c
+++ b/linux/agpsupport.c
@@ -153,7 +153,7 @@ int drm_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
drm_agp_mem_t *entry;
agp_memory *memory;
unsigned long pages;
-
+ u32 type;
if (!dev->agp->acquired) return -EINVAL;
copy_from_user_ret(&request, (drm_agp_buffer_t *)arg, sizeof(request),
-EFAULT);
@@ -161,7 +161,9 @@ int drm_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
return -ENOMEM;
pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE;
- if (!(memory = drm_alloc_agp(pages))) {
+ type = (u32) request.type;
+
+ if (!(memory = drm_alloc_agp(pages, type))) {
drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
return -ENOMEM;
}
diff --git a/linux/drm.h b/linux/drm.h
index a26cacbb..17fe54fc 100644
--- a/linux/drm.h
+++ b/linux/drm.h
@@ -256,6 +256,7 @@ typedef struct drm_agp_mode {
typedef struct drm_agp_buffer {
unsigned long size; /* In bytes -- will round to page boundary */
unsigned long handle; /* Used for BIND/UNBIND ioctls */
+ unsigned long type; /* Type of memory to allocate */
} drm_agp_buffer_t;
/* For drm_agp_bind */
diff --git a/linux/drmP.h b/linux/drmP.h
index d0a36459..042de764 100644
--- a/linux/drmP.h
+++ b/linux/drmP.h
@@ -594,7 +594,7 @@ extern void *drm_ioremap(unsigned long offset, unsigned long size);
extern void drm_ioremapfree(void *pt, unsigned long size);
#ifdef DRM_AGP
-extern agp_memory *drm_alloc_agp(int pages);
+extern agp_memory *drm_alloc_agp(int pages, u32 type);
extern int drm_free_agp(agp_memory *handle, int pages);
extern int drm_bind_agp(agp_memory *handle, unsigned int start);
extern int drm_unbind_agp(agp_memory *handle);
diff --git a/linux/memory.c b/linux/memory.c
index e9ac8b52..a12b988e 100644
--- a/linux/memory.c
+++ b/linux/memory.c
@@ -331,7 +331,7 @@ void drm_ioremapfree(void *pt, unsigned long size)
}
#ifdef DRM_AGP
-agp_memory *drm_alloc_agp(int pages)
+agp_memory *drm_alloc_agp(int pages, u32 type)
{
agp_memory *handle;
@@ -342,7 +342,7 @@ agp_memory *drm_alloc_agp(int pages)
if (drm_agp.allocate_memory) {
if ((handle = (*drm_agp.allocate_memory)(pages,
- AGP_NORMAL_MEMORY))) {
+ type))) {
spin_lock(&drm_mem_lock);
++drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count;
drm_mem_stats[DRM_MEM_TOTALAGP].bytes_allocated
diff --git a/shared-core/drm.h b/shared-core/drm.h
index a26cacbb..17fe54fc 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -256,6 +256,7 @@ typedef struct drm_agp_mode {
typedef struct drm_agp_buffer {
unsigned long size; /* In bytes -- will round to page boundary */
unsigned long handle; /* Used for BIND/UNBIND ioctls */
+ unsigned long type; /* Type of memory to allocate */
} drm_agp_buffer_t;
/* For drm_agp_bind */
diff --git a/shared/drm.h b/shared/drm.h
index a26cacbb..17fe54fc 100644
--- a/shared/drm.h
+++ b/shared/drm.h
@@ -256,6 +256,7 @@ typedef struct drm_agp_mode {
typedef struct drm_agp_buffer {
unsigned long size; /* In bytes -- will round to page boundary */
unsigned long handle; /* Used for BIND/UNBIND ioctls */
+ unsigned long type; /* Type of memory to allocate */
} drm_agp_buffer_t;
/* For drm_agp_bind */