Commit 982d0968 authored by Dave Airlie's avatar Dave Airlie

drm: make pcigart functions inline

with these unstatic uninline the kernel wouldn't build with both configured.
Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent 032a14ed
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
# define ATI_MAX_PCIGART_PAGES 8192 /**< 32 MB aperture, 4K pages */ # define ATI_MAX_PCIGART_PAGES 8192 /**< 32 MB aperture, 4K pages */
# define ATI_PCIGART_PAGE_SIZE 4096 /**< PCI GART page size */ # define ATI_PCIGART_PAGE_SIZE 4096 /**< PCI GART page size */
static unsigned long drm_ati_alloc_pcigart_table( void ) static inline unsigned long drm_ati_alloc_pcigart_table( void )
{ {
unsigned long address; unsigned long address;
struct page *page; struct page *page;
...@@ -75,7 +75,7 @@ static unsigned long drm_ati_alloc_pcigart_table( void ) ...@@ -75,7 +75,7 @@ static unsigned long drm_ati_alloc_pcigart_table( void )
return address; return address;
} }
static void drm_ati_free_pcigart_table( unsigned long address ) static inline void drm_ati_free_pcigart_table( unsigned long address )
{ {
struct page *page; struct page *page;
int i; int i;
...@@ -91,7 +91,43 @@ static void drm_ati_free_pcigart_table( unsigned long address ) ...@@ -91,7 +91,43 @@ static void drm_ati_free_pcigart_table( unsigned long address )
free_pages( address, ATI_PCIGART_TABLE_ORDER ); free_pages( address, ATI_PCIGART_TABLE_ORDER );
} }
int drm_ati_pcigart_init( drm_device_t *dev, static inline int drm_ati_pcigart_cleanup( drm_device_t *dev,
unsigned long addr,
dma_addr_t bus_addr)
{
drm_sg_mem_t *entry = dev->sg;
unsigned long pages;
int i;
/* we need to support large memory configurations */
if ( !entry ) {
DRM_ERROR( "no scatter/gather memory!\n" );
return 0;
}
if ( bus_addr ) {
pci_unmap_single(dev->pdev, bus_addr,
ATI_PCIGART_TABLE_PAGES * PAGE_SIZE,
PCI_DMA_TODEVICE);
pages = ( entry->pages <= ATI_MAX_PCIGART_PAGES )
? entry->pages : ATI_MAX_PCIGART_PAGES;
for ( i = 0 ; i < pages ; i++ ) {
if ( !entry->busaddr[i] ) break;
pci_unmap_single(dev->pdev, entry->busaddr[i],
PAGE_SIZE, PCI_DMA_TODEVICE);
}
}
if ( addr ) {
drm_ati_free_pcigart_table( addr );
}
return 1;
}
static inline int drm_ati_pcigart_init( drm_device_t *dev,
unsigned long *addr, unsigned long *addr,
dma_addr_t *bus_addr) dma_addr_t *bus_addr)
{ {
...@@ -169,38 +205,3 @@ int drm_ati_pcigart_init( drm_device_t *dev, ...@@ -169,38 +205,3 @@ int drm_ati_pcigart_init( drm_device_t *dev,
return ret; return ret;
} }
int drm_ati_pcigart_cleanup( drm_device_t *dev,
unsigned long addr,
dma_addr_t bus_addr)
{
drm_sg_mem_t *entry = dev->sg;
unsigned long pages;
int i;
/* we need to support large memory configurations */
if ( !entry ) {
DRM_ERROR( "no scatter/gather memory!\n" );
return 0;
}
if ( bus_addr ) {
pci_unmap_single(dev->pdev, bus_addr,
ATI_PCIGART_TABLE_PAGES * PAGE_SIZE,
PCI_DMA_TODEVICE);
pages = ( entry->pages <= ATI_MAX_PCIGART_PAGES )
? entry->pages : ATI_MAX_PCIGART_PAGES;
for ( i = 0 ; i < pages ; i++ ) {
if ( !entry->busaddr[i] ) break;
pci_unmap_single(dev->pdev, entry->busaddr[i],
PAGE_SIZE, PCI_DMA_TODEVICE);
}
}
if ( addr ) {
drm_ati_free_pcigart_table( addr );
}
return 1;
}
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "drm.h" #include "drm.h"
#include "r128_drm.h" #include "r128_drm.h"
#include "r128_drv.h" #include "r128_drv.h"
#include "ati_pcigart.h"
#define R128_FIFO_DEBUG 0 #define R128_FIFO_DEBUG 0
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "drm.h" #include "drm.h"
#include "radeon_drm.h" #include "radeon_drm.h"
#include "radeon_drv.h" #include "radeon_drv.h"
#include "ati_pcigart.h"
#define RADEON_FIFO_DEBUG 0 #define RADEON_FIFO_DEBUG 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment