fix up drm_alloc_agp to take a dev arg and not pass crappy agpgart around
parent
0569fe7a52
commit
71df0eed34
|
@ -786,11 +786,7 @@ extern void *drm_calloc(size_t nmemb, size_t size, int area);
|
||||||
extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
|
extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area);
|
||||||
extern unsigned long drm_alloc_pages(int order, int area);
|
extern unsigned long drm_alloc_pages(int order, int area);
|
||||||
extern void drm_free_pages(unsigned long address, int order, int area);
|
extern void drm_free_pages(unsigned long address, int order, int area);
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
|
extern DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type);
|
||||||
extern DRM_AGP_MEM *drm_alloc_agp(int pages, u32 type);
|
|
||||||
#else
|
|
||||||
extern DRM_AGP_MEM *drm_alloc_agp(struct agp_bridge_data *bridge, int pages, u32 type);
|
|
||||||
#endif
|
|
||||||
extern int drm_free_agp(DRM_AGP_MEM * handle, int pages);
|
extern int drm_free_agp(DRM_AGP_MEM * handle, int pages);
|
||||||
extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
|
extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
|
||||||
extern int drm_unbind_agp(DRM_AGP_MEM * handle);
|
extern int drm_unbind_agp(DRM_AGP_MEM * handle);
|
||||||
|
|
|
@ -251,17 +251,10 @@ int drm_agp_alloc(struct inode *inode, struct file *filp,
|
||||||
|
|
||||||
pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE;
|
pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE;
|
||||||
type = (u32) request.type;
|
type = (u32) request.type;
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
|
if (!(memory = drm_alloc_agp(dev, pages, type))) {
|
||||||
if (!(memory = drm_alloc_agp(pages, type))) {
|
|
||||||
drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
|
drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (!(memory = drm_alloc_agp(dev->agp->bridge, pages, type))) {
|
|
||||||
drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS);
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
entry->handle = (unsigned long)memory->key + 1;
|
entry->handle = (unsigned long)memory->key + 1;
|
||||||
entry->memory = memory;
|
entry->memory = memory;
|
||||||
|
|
|
@ -152,14 +152,14 @@ void drm_free_pages(unsigned long address, int order, int area)
|
||||||
#if __OS_HAS_AGP
|
#if __OS_HAS_AGP
|
||||||
/** Wrapper around agp_allocate_memory() */
|
/** Wrapper around agp_allocate_memory() */
|
||||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
|
||||||
DRM_AGP_MEM *drm_alloc_agp(int pages, u32 type)
|
DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type)
|
||||||
{
|
{
|
||||||
return drm_agp_allocate_memory(pages, type);
|
return drm_agp_allocate_memory(pages, type);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
DRM_AGP_MEM *drm_alloc_agp(struct agp_bridge_data *bridge, int pages, u32 type)
|
DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type)
|
||||||
{
|
{
|
||||||
return drm_agp_allocate_memory(bridge, pages, type);
|
return drm_agp_allocate_memory(dev->agp->bridge, pages, type);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
EXPORT_SYMBOL(drm_alloc_agp);
|
EXPORT_SYMBOL(drm_alloc_agp);
|
||||||
|
|
|
@ -365,7 +365,7 @@ EXPORT_SYMBOL(drm_ioremapfree);
|
||||||
|
|
||||||
#if __OS_HAS_AGP
|
#if __OS_HAS_AGP
|
||||||
|
|
||||||
DRM_AGP_MEM *drm_alloc_agp(int pages, u32 type)
|
DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type)
|
||||||
{
|
{
|
||||||
DRM_AGP_MEM *handle;
|
DRM_AGP_MEM *handle;
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) {
|
||||||
|
|
||||||
#if __OS_HAS_AGP
|
#if __OS_HAS_AGP
|
||||||
|
|
||||||
DRM_AGP_MEM *drm_alloc_agp (int pages, u32 type) {
|
DRM_AGP_MEM *drm_alloc_agp (drm_device_t *dev, int pages, u32 type) {
|
||||||
DRM_AGP_MEM *handle;
|
DRM_AGP_MEM *handle;
|
||||||
|
|
||||||
if (!pages) {
|
if (!pages) {
|
||||||
|
|
|
@ -475,7 +475,7 @@ static int mga_do_agp_dma_bootstrap(drm_device_t * dev,
|
||||||
|
|
||||||
/* Allocate and bind AGP memory. */
|
/* Allocate and bind AGP memory. */
|
||||||
dev_priv->agp_pages = agp_size / PAGE_SIZE;
|
dev_priv->agp_pages = agp_size / PAGE_SIZE;
|
||||||
dev_priv->agp_mem = drm_alloc_agp( dev_priv->agp_pages, 0 );
|
dev_priv->agp_mem = drm_alloc_agp( dev, dev_priv->agp_pages, 0 );
|
||||||
if (dev_priv->agp_mem == NULL) {
|
if (dev_priv->agp_mem == NULL) {
|
||||||
dev_priv->agp_pages = 0;
|
dev_priv->agp_pages = 0;
|
||||||
DRM_ERROR("Unable to allocate %uMB AGP memory\n",
|
DRM_ERROR("Unable to allocate %uMB AGP memory\n",
|
||||||
|
|
Loading…
Reference in New Issue