Added type to drm so I810 will work properly

This commit is contained in:
Jeff Hartmann 2000-01-21 07:29:55 +00:00
parent 5cd0a096d8
commit 8b7e3ee88c
8 changed files with 13 additions and 7 deletions

View file

@ -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;
}

View file

@ -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);

View file

@ -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;
}

View file

@ -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 */

View file

@ -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);

View file

@ -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

View file

@ -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 */

View file

@ -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 */