mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-25 02:30:12 +01:00
AGPGART working for r128 on FreeBSD.
This commit is contained in:
parent
86bef24923
commit
4e59a5bb85
10 changed files with 18 additions and 28 deletions
|
|
@ -46,17 +46,17 @@ static unsigned long DRM(ati_alloc_pcigart_table)( void )
|
|||
{
|
||||
unsigned long address;
|
||||
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
DRM_DEBUG( "\n" );
|
||||
|
||||
address = (unsigned long) malloc( (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM), M_WAITOK );
|
||||
|
||||
DRM_DEBUG( "%s: returning 0x%08lx\n", __FUNCTION__, address );
|
||||
DRM_DEBUG( "returning 0x%08lx\n", address );
|
||||
return address;
|
||||
}
|
||||
|
||||
static void DRM(ati_free_pcigart_table)( unsigned long address )
|
||||
{
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
DRM_DEBUG( "\n" );
|
||||
|
||||
free( (void *)address, DRM(M_DRM));
|
||||
}
|
||||
|
|
@ -81,11 +81,6 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
|
|||
goto done;
|
||||
}
|
||||
|
||||
if ( !dev->pdev ) {
|
||||
DRM_ERROR( "PCI device unknown!\n" );
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* FIXME non-vtophys==bustophys-arches */
|
||||
bus_address = vtophys( pci_gart );
|
||||
/*pci_map_single(dev->pdev, (void *)address,
|
||||
|
|
@ -105,7 +100,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
|
|||
|
||||
for ( i = 0 ; i < pages ; i++ ) {
|
||||
/* we need to support large memory configurations */
|
||||
/* FIXME non-vtophys==bustophys-arches */
entry->busaddr[i] = vtophys( entry->handle + (i*PAGE_SIZE) );
|
||||
/* FIXME non-vtophys==vtobus-arches */
entry->busaddr[i] = vtophys( entry->handle + (i*PAGE_SIZE) );
|
||||
if (entry->busaddr[i] == 0) {
|
||||
DRM_ERROR( "unable to map PCIGART pages!\n" );
|
||||
DRM(ati_pcigart_cleanup)( dev, (unsigned long)pci_gart, bus_address );
|
||||
|
|
@ -123,7 +118,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
|
|||
|
||||
ret = 1;
|
||||
|
||||
DRM_OS_READMEMORYBARRIER;
|
||||
DRM_OS_READMEMORYBARRIER();
|
||||
|
||||
done:
|
||||
*addr = (unsigned long)pci_gart;
|
||||
|
|
|
|||
|
|
@ -493,7 +493,6 @@ struct drm_device {
|
|||
#if __REALLY_HAVE_AGP
|
||||
drm_agp_head_t *agp;
|
||||
#endif
|
||||
struct pci_dev *pdev;
|
||||
drm_sg_mem_t *sg; /* Scatter gather memory */
|
||||
atomic_t *ctx_bitmap;
|
||||
void *dev_private;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@
|
|||
#define __REALLY_HAVE_AGP __HAVE_AGP
|
||||
#endif
|
||||
|
||||
#define __REALLY_HAVE_MTRR 1
|
||||
#define __REALLY_HAVE_SG 0
|
||||
#define __REALLY_HAVE_MTRR (__HAVE_MTRR)
|
||||
#define __REALLY_HAVE_SG (__HAVE_SG)
|
||||
|
||||
#if __REALLY_HAVE_AGP
|
||||
#include <pci/agpvar.h>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ int DRM(sg_alloc)( DRM_OS_IOCTL )
|
|||
|
||||
bzero( entry, sizeof(*entry) );
|
||||
|
||||
pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE;
|
||||
pages = round_page(request.size) / PAGE_SIZE;
|
||||
DRM_DEBUG( "sg size=%ld pages=%ld\n", request.size, pages );
|
||||
|
||||
entry->pages = pages;
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ paddr_t DRM(mmap)(dev_t kdev, off_t offset, int prot)
|
|||
case _DRM_REGISTERS:
|
||||
case _DRM_AGP:
|
||||
return atop(offset);
|
||||
case _DRM_SCATTER_GATHER:
|
||||
case _DRM_SHM:
|
||||
return atop(vtophys(offset));
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -46,17 +46,17 @@ static unsigned long DRM(ati_alloc_pcigart_table)( void )
|
|||
{
|
||||
unsigned long address;
|
||||
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
DRM_DEBUG( "\n" );
|
||||
|
||||
address = (unsigned long) malloc( (1 << ATI_PCIGART_TABLE_ORDER) * PAGE_SIZE, DRM(M_DRM), M_WAITOK );
|
||||
|
||||
DRM_DEBUG( "%s: returning 0x%08lx\n", __FUNCTION__, address );
|
||||
DRM_DEBUG( "returning 0x%08lx\n", address );
|
||||
return address;
|
||||
}
|
||||
|
||||
static void DRM(ati_free_pcigart_table)( unsigned long address )
|
||||
{
|
||||
DRM_DEBUG( "%s\n", __FUNCTION__ );
|
||||
DRM_DEBUG( "\n" );
|
||||
|
||||
free( (void *)address, DRM(M_DRM));
|
||||
}
|
||||
|
|
@ -81,11 +81,6 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
|
|||
goto done;
|
||||
}
|
||||
|
||||
if ( !dev->pdev ) {
|
||||
DRM_ERROR( "PCI device unknown!\n" );
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* FIXME non-vtophys==bustophys-arches */
|
||||
bus_address = vtophys( pci_gart );
|
||||
/*pci_map_single(dev->pdev, (void *)address,
|
||||
|
|
@ -105,7 +100,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
|
|||
|
||||
for ( i = 0 ; i < pages ; i++ ) {
|
||||
/* we need to support large memory configurations */
|
||||
/* FIXME non-vtophys==bustophys-arches */
entry->busaddr[i] = vtophys( entry->handle + (i*PAGE_SIZE) );
|
||||
/* FIXME non-vtophys==vtobus-arches */
entry->busaddr[i] = vtophys( entry->handle + (i*PAGE_SIZE) );
|
||||
if (entry->busaddr[i] == 0) {
|
||||
DRM_ERROR( "unable to map PCIGART pages!\n" );
|
||||
DRM(ati_pcigart_cleanup)( dev, (unsigned long)pci_gart, bus_address );
|
||||
|
|
@ -123,7 +118,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
|
|||
|
||||
ret = 1;
|
||||
|
||||
DRM_OS_READMEMORYBARRIER;
|
||||
DRM_OS_READMEMORYBARRIER();
|
||||
|
||||
done:
|
||||
*addr = (unsigned long)pci_gart;
|
||||
|
|
|
|||
|
|
@ -493,7 +493,6 @@ struct drm_device {
|
|||
#if __REALLY_HAVE_AGP
|
||||
drm_agp_head_t *agp;
|
||||
#endif
|
||||
struct pci_dev *pdev;
|
||||
drm_sg_mem_t *sg; /* Scatter gather memory */
|
||||
atomic_t *ctx_bitmap;
|
||||
void *dev_private;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@
|
|||
#define __REALLY_HAVE_AGP __HAVE_AGP
|
||||
#endif
|
||||
|
||||
#define __REALLY_HAVE_MTRR 1
|
||||
#define __REALLY_HAVE_SG 0
|
||||
#define __REALLY_HAVE_MTRR (__HAVE_MTRR)
|
||||
#define __REALLY_HAVE_SG (__HAVE_SG)
|
||||
|
||||
#if __REALLY_HAVE_AGP
|
||||
#include <pci/agpvar.h>
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ int DRM(sg_alloc)( DRM_OS_IOCTL )
|
|||
|
||||
bzero( entry, sizeof(*entry) );
|
||||
|
||||
pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE;
|
||||
pages = round_page(request.size) / PAGE_SIZE;
|
||||
DRM_DEBUG( "sg size=%ld pages=%ld\n", request.size, pages );
|
||||
|
||||
entry->pages = pages;
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ paddr_t DRM(mmap)(dev_t kdev, off_t offset, int prot)
|
|||
case _DRM_REGISTERS:
|
||||
case _DRM_AGP:
|
||||
return atop(offset);
|
||||
case _DRM_SCATTER_GATHER:
|
||||
case _DRM_SHM:
|
||||
return atop(vtophys(offset));
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue