Commit b5e89ed5 authored by Dave Airlie's avatar Dave Airlie Committed by Dave Airlie

drm: lindent the drm directory.

I've been threatening this for a while, so no point hanging around.
This lindents the DRM code which was always really bad in tabbing department.
I've also fixed some misnamed files in comments and removed some trailing
whitespace.
Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent 99a2657a
/** /**
* \file ati_pcigart.h * \file ati_pcigart.c
* ATI PCI GART support * ATI PCI GART support
* *
* \author Gareth Hughes <gareth@valinux.com> * \author Gareth Hughes <gareth@valinux.com>
...@@ -52,87 +52,91 @@ ...@@ -52,87 +52,91 @@
# 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 unsigned long drm_ati_alloc_pcigart_table(void)
{ {
unsigned long address; unsigned long address;
struct page *page; struct page *page;
int i; int i;
DRM_DEBUG( "%s\n", __FUNCTION__ ); DRM_DEBUG("%s\n", __FUNCTION__);
address = __get_free_pages( GFP_KERNEL, ATI_PCIGART_TABLE_ORDER ); address = __get_free_pages(GFP_KERNEL, ATI_PCIGART_TABLE_ORDER);
if ( address == 0UL ) { if (address == 0UL) {
return 0; return 0;
} }
page = virt_to_page( address ); page = virt_to_page(address);
for ( i = 0 ; i < ATI_PCIGART_TABLE_PAGES ; i++, page++ ) { for (i = 0; i < ATI_PCIGART_TABLE_PAGES; i++, page++) {
get_page(page); get_page(page);
SetPageReserved( page ); SetPageReserved(page);
} }
DRM_DEBUG( "%s: returning 0x%08lx\n", __FUNCTION__, address ); DRM_DEBUG("%s: returning 0x%08lx\n", __FUNCTION__, address);
return address; return address;
} }
static void drm_ati_free_pcigart_table( unsigned long address ) static void drm_ati_free_pcigart_table(unsigned long address)
{ {
struct page *page; struct page *page;
int i; int i;
DRM_DEBUG( "%s\n", __FUNCTION__ ); DRM_DEBUG("%s\n", __FUNCTION__);
page = virt_to_page( address ); page = virt_to_page(address);
for ( i = 0 ; i < ATI_PCIGART_TABLE_PAGES ; i++, page++ ) { for (i = 0; i < ATI_PCIGART_TABLE_PAGES; i++, page++) {
__put_page(page); __put_page(page);
ClearPageReserved( page ); ClearPageReserved(page);
} }
free_pages( address, ATI_PCIGART_TABLE_ORDER ); free_pages(address, ATI_PCIGART_TABLE_ORDER);
} }
int drm_ati_pcigart_cleanup(drm_device_t *dev, drm_ati_pcigart_info *gart_info) int drm_ati_pcigart_cleanup(drm_device_t * dev,
drm_ati_pcigart_info * gart_info)
{ {
drm_sg_mem_t *entry = dev->sg; drm_sg_mem_t *entry = dev->sg;
unsigned long pages; unsigned long pages;
int i; int i;
/* we need to support large memory configurations */ /* we need to support large memory configurations */
if ( !entry ) { if (!entry) {
DRM_ERROR( "no scatter/gather memory!\n" ); DRM_ERROR("no scatter/gather memory!\n");
return 0; return 0;
} }
if (gart_info->bus_addr) { if (gart_info->bus_addr) {
if (gart_info->gart_table_location==DRM_ATI_GART_MAIN) { if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
pci_unmap_single(dev->pdev, gart_info->bus_addr, pci_unmap_single(dev->pdev, gart_info->bus_addr,
ATI_PCIGART_TABLE_PAGES * PAGE_SIZE, ATI_PCIGART_TABLE_PAGES * PAGE_SIZE,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
} }
pages = ( entry->pages <= ATI_MAX_PCIGART_PAGES ) pages = (entry->pages <= ATI_MAX_PCIGART_PAGES)
? entry->pages : ATI_MAX_PCIGART_PAGES; ? entry->pages : ATI_MAX_PCIGART_PAGES;
for ( i = 0 ; i < pages ; i++ ) { for (i = 0; i < pages; i++) {
if ( !entry->busaddr[i] ) break; if (!entry->busaddr[i])
break;
pci_unmap_single(dev->pdev, entry->busaddr[i], pci_unmap_single(dev->pdev, entry->busaddr[i],
PAGE_SIZE, PCI_DMA_TODEVICE); PAGE_SIZE, PCI_DMA_TODEVICE);
} }
if (gart_info->gart_table_location==DRM_ATI_GART_MAIN) if (gart_info->gart_table_location == DRM_ATI_GART_MAIN)
gart_info->bus_addr=0; gart_info->bus_addr = 0;
} }
if (gart_info->gart_table_location==DRM_ATI_GART_MAIN && gart_info->addr) { if (gart_info->gart_table_location == DRM_ATI_GART_MAIN
&& gart_info->addr) {
drm_ati_free_pcigart_table(gart_info->addr); drm_ati_free_pcigart_table(gart_info->addr);
gart_info->addr=0; gart_info->addr = 0;
} }
return 1; return 1;
} }
EXPORT_SYMBOL(drm_ati_pcigart_cleanup); EXPORT_SYMBOL(drm_ati_pcigart_cleanup);
int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info) int drm_ati_pcigart_init(drm_device_t * dev, drm_ati_pcigart_info * gart_info)
{ {
drm_sg_mem_t *entry = dev->sg; drm_sg_mem_t *entry = dev->sg;
unsigned long address = 0; unsigned long address = 0;
...@@ -140,58 +144,56 @@ int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info) ...@@ -140,58 +144,56 @@ int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info)
u32 *pci_gart, page_base, bus_address = 0; u32 *pci_gart, page_base, bus_address = 0;
int i, j, ret = 0; int i, j, ret = 0;
if ( !entry ) { if (!entry) {
DRM_ERROR( "no scatter/gather memory!\n" ); DRM_ERROR("no scatter/gather memory!\n");
goto done; goto done;
} }
if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
{
DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n"); DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n");
address = drm_ati_alloc_pcigart_table(); address = drm_ati_alloc_pcigart_table();
if ( !address ) { if (!address) {
DRM_ERROR( "cannot allocate PCI GART page!\n" ); DRM_ERROR("cannot allocate PCI GART page!\n");
goto done; goto done;
} }
if ( !dev->pdev ) { if (!dev->pdev) {
DRM_ERROR( "PCI device unknown!\n" ); DRM_ERROR("PCI device unknown!\n");
goto done; goto done;
} }
bus_address = pci_map_single(dev->pdev, (void *)address, bus_address = pci_map_single(dev->pdev, (void *)address,
ATI_PCIGART_TABLE_PAGES * PAGE_SIZE, ATI_PCIGART_TABLE_PAGES *
PCI_DMA_TODEVICE); PAGE_SIZE, PCI_DMA_TODEVICE);
if (bus_address == 0) { if (bus_address == 0) {
DRM_ERROR( "unable to map PCIGART pages!\n" ); DRM_ERROR("unable to map PCIGART pages!\n");
drm_ati_free_pcigart_table( address ); drm_ati_free_pcigart_table(address);
address = 0; address = 0;
goto done; goto done;
} }
} } else {
else
{
address = gart_info->addr; address = gart_info->addr;
bus_address = gart_info->bus_addr; bus_address = gart_info->bus_addr;
DRM_DEBUG("PCI: Gart Table: VRAM %08X mapped at %08lX\n", bus_address, address); DRM_DEBUG("PCI: Gart Table: VRAM %08X mapped at %08lX\n",
bus_address, address);
} }
pci_gart = (u32 *)address; pci_gart = (u32 *) address;
pages = ( entry->pages <= ATI_MAX_PCIGART_PAGES ) pages = (entry->pages <= ATI_MAX_PCIGART_PAGES)
? entry->pages : ATI_MAX_PCIGART_PAGES; ? entry->pages : ATI_MAX_PCIGART_PAGES;
memset( pci_gart, 0, ATI_MAX_PCIGART_PAGES * sizeof(u32) ); memset(pci_gart, 0, ATI_MAX_PCIGART_PAGES * sizeof(u32));
for ( i = 0 ; i < pages ; i++ ) { for (i = 0; i < pages; i++) {
/* we need to support large memory configurations */ /* we need to support large memory configurations */
entry->busaddr[i] = pci_map_single(dev->pdev, entry->busaddr[i] = pci_map_single(dev->pdev,
page_address( entry->pagelist[i] ), page_address(entry->
PAGE_SIZE, pagelist[i]),
PCI_DMA_TODEVICE); PAGE_SIZE, PCI_DMA_TODEVICE);
if (entry->busaddr[i] == 0) { if (entry->busaddr[i] == 0) {
DRM_ERROR( "unable to map PCIGART pages!\n" ); DRM_ERROR("unable to map PCIGART pages!\n");
drm_ati_pcigart_cleanup(dev, gart_info); drm_ati_pcigart_cleanup(dev, gart_info);
address = 0; address = 0;
bus_address = 0; bus_address = 0;
...@@ -201,9 +203,9 @@ int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info) ...@@ -201,9 +203,9 @@ int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info)
for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) { for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
if (gart_info->is_pcie) if (gart_info->is_pcie)
*pci_gart = (cpu_to_le32(page_base)>>8) | 0xc; *pci_gart = (cpu_to_le32(page_base) >> 8) | 0xc;
else else
*pci_gart++ = cpu_to_le32( page_base ); *pci_gart++ = cpu_to_le32(page_base);
page_base += ATI_PCIGART_PAGE_SIZE; page_base += ATI_PCIGART_PAGE_SIZE;
} }
} }
...@@ -216,9 +218,10 @@ int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info) ...@@ -216,9 +218,10 @@ int drm_ati_pcigart_init(drm_device_t *dev, drm_ati_pcigart_info *gart_info)
mb(); mb();
#endif #endif
done: done:
gart_info->addr = address; gart_info->addr = address;
gart_info->bus_addr = bus_address; gart_info->bus_addr = bus_address;
return ret; return ret;
} }
EXPORT_SYMBOL(drm_ati_pcigart_init); EXPORT_SYMBOL(drm_ati_pcigart_init);
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef _DRM_H_ #ifndef _DRM_H_
#define _DRM_H_ #define _DRM_H_
...@@ -97,13 +96,11 @@ ...@@ -97,13 +96,11 @@
#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) #define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
typedef unsigned int drm_handle_t; typedef unsigned int drm_handle_t;
typedef unsigned int drm_context_t; typedef unsigned int drm_context_t;
typedef unsigned int drm_drawable_t; typedef unsigned int drm_drawable_t;
typedef unsigned int drm_magic_t; typedef unsigned int drm_magic_t;
/** /**
* Cliprect. * Cliprect.
* *
...@@ -120,7 +117,6 @@ typedef struct drm_clip_rect { ...@@ -120,7 +117,6 @@ typedef struct drm_clip_rect {
unsigned short y2; unsigned short y2;
} drm_clip_rect_t; } drm_clip_rect_t;
/** /**
* Texture region, * Texture region,
*/ */
...@@ -144,7 +140,6 @@ typedef struct drm_hw_lock { ...@@ -144,7 +140,6 @@ typedef struct drm_hw_lock {
char padding[60]; /**< Pad to cache line */ char padding[60]; /**< Pad to cache line */
} drm_hw_lock_t; } drm_hw_lock_t;
/** /**
* DRM_IOCTL_VERSION ioctl argument type. * DRM_IOCTL_VERSION ioctl argument type.
* *
...@@ -153,7 +148,7 @@ typedef struct drm_hw_lock { ...@@ -153,7 +148,7 @@ typedef struct drm_hw_lock {
typedef struct drm_version { typedef struct drm_version {
int version_major; /**< Major version */ int version_major; /**< Major version */
int version_minor; /**< Minor version */ int version_minor; /**< Minor version */
int version_patchlevel;/**< Patch level */ int version_patchlevel; /**< Patch level */
size_t name_len; /**< Length of name buffer */ size_t name_len; /**< Length of name buffer */
char __user *name; /**< Name of driver */ char __user *name; /**< Name of driver */
size_t date_len; /**< Length of date buffer */ size_t date_len; /**< Length of date buffer */
...@@ -162,7 +157,6 @@ typedef struct drm_version { ...@@ -162,7 +157,6 @@ typedef struct drm_version {
char __user *desc; /**< User-space buffer to hold desc */ char __user *desc; /**< User-space buffer to hold desc */
} drm_version_t; } drm_version_t;
/** /**
* DRM_IOCTL_GET_UNIQUE ioctl argument type. * DRM_IOCTL_GET_UNIQUE ioctl argument type.
* *
...@@ -173,18 +167,15 @@ typedef struct drm_unique { ...@@ -173,18 +167,15 @@ typedef struct drm_unique {
char __user *unique; /**< Unique name for driver instantiation */ char __user *unique; /**< Unique name for driver instantiation */
} drm_unique_t; } drm_unique_t;
typedef struct drm_list { typedef struct drm_list {
int count; /**< Length of user-space structures */ int count; /**< Length of user-space structures */
drm_version_t __user *version; drm_version_t __user *version;
} drm_list_t; } drm_list_t;
typedef struct drm_block { typedef struct drm_block {
int unused; int unused;
} drm_block_t; } drm_block_t;
/** /**
* DRM_IOCTL_CONTROL ioctl argument type. * DRM_IOCTL_CONTROL ioctl argument type.
* *
...@@ -200,7 +191,6 @@ typedef struct drm_control { ...@@ -200,7 +191,6 @@ typedef struct drm_control {
int irq; int irq;
} drm_control_t; } drm_control_t;
/** /**
* Type of memory to map. * Type of memory to map.
*/ */
...@@ -213,7 +203,6 @@ typedef enum drm_map_type { ...@@ -213,7 +203,6 @@ typedef enum drm_map_type {
_DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
} drm_map_type_t; } drm_map_type_t;
/** /**
* Memory mapping flags. * Memory mapping flags.
*/ */
...@@ -227,13 +216,11 @@ typedef enum drm_map_flags { ...@@ -227,13 +216,11 @@ typedef enum drm_map_flags {
_DRM_REMOVABLE = 0x40 /**< Removable mapping */ _DRM_REMOVABLE = 0x40 /**< Removable mapping */
} drm_map_flags_t; } drm_map_flags_t;
typedef struct drm_ctx_priv_map { typedef struct drm_ctx_priv_map {
unsigned int ctx_id; /**< Context requesting private mapping */ unsigned int ctx_id; /**< Context requesting private mapping */
void *handle; /**< Handle of map */ void *handle; /**< Handle of map */
} drm_ctx_priv_map_t; } drm_ctx_priv_map_t;
/** /**
* DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
* argument type. * argument type.
...@@ -251,7 +238,6 @@ typedef struct drm_map { ...@@ -251,7 +238,6 @@ typedef struct drm_map {
/* Private data */ /* Private data */
} drm_map_t; } drm_map_t;
/** /**
* DRM_IOCTL_GET_CLIENT ioctl argument type. * DRM_IOCTL_GET_CLIENT ioctl argument type.
*/ */
...@@ -264,7 +250,6 @@ typedef struct drm_client { ...@@ -264,7 +250,6 @@ typedef struct drm_client {
unsigned long iocs; /**< Ioctl count */ unsigned long iocs; /**< Ioctl count */
} drm_client_t; } drm_client_t;
typedef enum { typedef enum {
_DRM_STAT_LOCK, _DRM_STAT_LOCK,
_DRM_STAT_OPENS, _DRM_STAT_OPENS,
...@@ -282,11 +267,9 @@ typedef enum { ...@@ -282,11 +267,9 @@ typedef enum {
_DRM_STAT_DMA, /**< DMA */ _DRM_STAT_DMA, /**< DMA */
_DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */
_DRM_STAT_MISSED /**< Missed DMA opportunity */ _DRM_STAT_MISSED /**< Missed DMA opportunity */
/* Add to the *END* of the list */ /* Add to the *END* of the list */
} drm_stat_type_t; } drm_stat_type_t;
/** /**
* DRM_IOCTL_GET_STATS ioctl argument type. * DRM_IOCTL_GET_STATS ioctl argument type.
*/ */
...@@ -298,7 +281,6 @@ typedef struct drm_stats { ...@@ -298,7 +281,6 @@ typedef struct drm_stats {
} data[15]; } data[15];
} drm_stats_t; } drm_stats_t;
/** /**
* Hardware locking flags. * Hardware locking flags.
*/ */
...@@ -314,7 +296,6 @@ typedef enum drm_lock_flags { ...@@ -314,7 +296,6 @@ typedef enum drm_lock_flags {
_DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
} drm_lock_flags_t; } drm_lock_flags_t;
/** /**
* DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
* *
...@@ -325,7 +306,6 @@ typedef struct drm_lock { ...@@ -325,7 +306,6 @@ typedef struct drm_lock {
drm_lock_flags_t flags; drm_lock_flags_t flags;
} drm_lock_t; } drm_lock_t;
/** /**
* DMA flags * DMA flags
* *
...@@ -355,7 +335,6 @@ typedef enum drm_dma_flags { ...@@ -355,7 +335,6 @@ typedef enum drm_dma_flags {
_DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
} drm_dma_flags_t; } drm_dma_flags_t;
/** /**
* DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
* *
...@@ -378,7 +357,6 @@ typedef struct drm_buf_desc { ...@@ -378,7 +357,6 @@ typedef struct drm_buf_desc {
*/ */
} drm_buf_desc_t; } drm_buf_desc_t;
/** /**
* DRM_IOCTL_INFO_BUFS ioctl argument type. * DRM_IOCTL_INFO_BUFS ioctl argument type.
*/ */
...@@ -387,7 +365,6 @@ typedef struct drm_buf_info { ...@@ -387,7 +365,6 @@ typedef struct drm_buf_info {
drm_buf_desc_t __user *list; drm_buf_desc_t __user *list;
} drm_buf_info_t; } drm_buf_info_t;
/** /**
* DRM_IOCTL_FREE_BUFS ioctl argument type. * DRM_IOCTL_FREE_BUFS ioctl argument type.
*/ */
...@@ -396,7 +373,6 @@ typedef struct drm_buf_free { ...@@ -396,7 +373,6 @@ typedef struct drm_buf_free {
int __user *list; int __user *list;
} drm_buf_free_t; } drm_buf_free_t;
/** /**
* Buffer information * Buffer information
* *
...@@ -409,7 +385,6 @@ typedef struct drm_buf_pub { ...@@ -409,7 +385,6 @@ typedef struct drm_buf_pub {
void __user *address; /**< Address of buffer */ void __user *address; /**< Address of buffer */
} drm_buf_pub_t; } drm_buf_pub_t;
/** /**
* DRM_IOCTL_MAP_BUFS ioctl argument type. * DRM_IOCTL_MAP_BUFS ioctl argument type.
*/ */
...@@ -419,7 +394,6 @@ typedef struct drm_buf_map { ...@@ -419,7 +394,6 @@ typedef struct drm_buf_map {
drm_buf_pub_t __user *list; /**< Buffer information */ drm_buf_pub_t __user *list; /**< Buffer information */
} drm_buf_map_t; } drm_buf_map_t;
/** /**
* DRM_IOCTL_DMA ioctl argument type. * DRM_IOCTL_DMA ioctl argument type.
* *
...@@ -440,13 +414,11 @@ typedef struct drm_dma { ...@@ -440,13 +414,11 @@ typedef struct drm_dma {
int granted_count; /**< Number of buffers granted */ int granted_count; /**< Number of buffers granted */
} drm_dma_t; } drm_dma_t;
typedef enum { typedef enum {
_DRM_CONTEXT_PRESERVED = 0x01, _DRM_CONTEXT_PRESERVED = 0x01,
_DRM_CONTEXT_2DONLY = 0x02 _DRM_CONTEXT_2DONLY = 0x02
} drm_ctx_flags_t; } drm_ctx_flags_t;
/** /**
* DRM_IOCTL_ADD_CTX ioctl argument type. * DRM_IOCTL_ADD_CTX ioctl argument type.
* *
...@@ -457,7 +429,6 @@ typedef struct drm_ctx { ...@@ -457,7 +429,6 @@ typedef struct drm_ctx {
drm_ctx_flags_t flags; drm_ctx_flags_t flags;
} drm_ctx_t; } drm_ctx_t;
/** /**
* DRM_IOCTL_RES_CTX ioctl argument type. * DRM_IOCTL_RES_CTX ioctl argument type.
*/ */
...@@ -466,7 +437,6 @@ typedef struct drm_ctx_res { ...@@ -466,7 +437,6 @@ typedef struct drm_ctx_res {
drm_ctx_t __user *contexts; drm_ctx_t __user *contexts;
} drm_ctx_res_t; } drm_ctx_res_t;
/** /**
* DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
*/ */
...@@ -474,7 +444,6 @@ typedef struct drm_draw { ...@@ -474,7 +444,6 @@ typedef struct drm_draw {
drm_drawable_t handle; drm_drawable_t handle;
} drm_draw_t; } drm_draw_t;
/** /**
* DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
*/ */
...@@ -482,7 +451,6 @@ typedef struct drm_auth { ...@@ -482,7 +451,6 @@ typedef struct drm_auth {
drm_magic_t magic; drm_magic_t magic;
} drm_auth_t; } drm_auth_t;
/** /**
* DRM_IOCTL_IRQ_BUSID ioctl argument type. * DRM_IOCTL_IRQ_BUSID ioctl argument type.
* *
...@@ -495,24 +463,20 @@ typedef struct drm_irq_busid { ...@@ -495,24 +463,20 @@ typedef struct drm_irq_busid {
int funcnum; /**< function number */ int funcnum; /**< function number */
} drm_irq_busid_t; } drm_irq_busid_t;
typedef enum { typedef enum {
_DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */
_DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */
_DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */
} drm_vblank_seq_type_t; } drm_vblank_seq_type_t;
#define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL #define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL
struct drm_wait_vblank_request { struct drm_wait_vblank_request {
drm_vblank_seq_type_t type; drm_vblank_seq_type_t type;
unsigned int sequence; unsigned int sequence;
unsigned long signal; unsigned long signal;
}; };
struct drm_wait_vblank_reply { struct drm_wait_vblank_reply {
drm_vblank_seq_type_t type; drm_vblank_seq_type_t type;
unsigned int sequence; unsigned int sequence;
...@@ -520,7 +484,6 @@ struct drm_wait_vblank_reply { ...@@ -520,7 +484,6 @@ struct drm_wait_vblank_reply {
long tval_usec; long tval_usec;
}; };
/** /**
* DRM_IOCTL_WAIT_VBLANK ioctl argument type. * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
* *
...@@ -531,7 +494,6 @@ typedef union drm_wait_vblank { ...@@ -531,7 +494,6 @@ typedef union drm_wait_vblank {
struct drm_wait_vblank_reply reply; struct drm_wait_vblank_reply reply;
} drm_wait_vblank_t; } drm_wait_vblank_t;
/** /**
* DRM_IOCTL_AGP_ENABLE ioctl argument type. * DRM_IOCTL_AGP_ENABLE ioctl argument type.
* *
...@@ -541,7 +503,6 @@ typedef struct drm_agp_mode { ...@@ -541,7 +503,6 @@ typedef struct drm_agp_mode {
unsigned long mode; /**< AGP mode */ unsigned long mode; /**< AGP mode */
} drm_agp_mode_t; } drm_agp_mode_t;
/** /**
* DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
* *
...@@ -554,7 +515,6 @@ typedef struct drm_agp_buffer { ...@@ -554,7 +515,6 @@ typedef struct drm_agp_buffer {
unsigned long physical; /**< Physical used by i810 */ unsigned long physical; /**< Physical used by i810 */
} drm_agp_buffer_t; } drm_agp_buffer_t;
/** /**
* DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
* *
...@@ -565,7 +525,6 @@ typedef struct drm_agp_binding { ...@@ -565,7 +525,6 @@ typedef struct drm_agp_binding {
unsigned long offset; /**< In bytes -- will round to page boundary */ unsigned long offset; /**< In bytes -- will round to page boundary */
} drm_agp_binding_t; } drm_agp_binding_t;
/** /**
* DRM_IOCTL_AGP_INFO ioctl argument type. * DRM_IOCTL_AGP_INFO ioctl argument type.
* *
...@@ -587,7 +546,6 @@ typedef struct drm_agp_info { ...@@ -587,7 +546,6 @@ typedef struct drm_agp_info {
unsigned short id_device; unsigned short id_device;
} drm_agp_info_t; } drm_agp_info_t;
/** /**
* DRM_IOCTL_SG_ALLOC ioctl argument type. * DRM_IOCTL_SG_ALLOC ioctl argument type.
*/ */
...@@ -606,7 +564,6 @@ typedef struct drm_set_version { ...@@ -606,7 +564,6 @@ typedef struct drm_set_version {
int drm_dd_minor; int drm_dd_minor;
} drm_set_version_t; } drm_set_version_t;
#define DRM_IOCTL_BASE 'd' #define DRM_IOCTL_BASE 'd'
#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) #define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr)
#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) #define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type)
......
This diff is collapsed.
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
* Verifies the AGP device has been initialized and acquired and fills in the * Verifies the AGP device has been initialized and acquired and fills in the
* drm_agp_info structure with the information in drm_agp_head::agp_info. * drm_agp_info structure with the information in drm_agp_head::agp_info.
*/ */
int drm_agp_info(drm_device_t *dev, drm_agp_info_t *info) int drm_agp_info(drm_device_t * dev, drm_agp_info_t * info)
{ {
DRM_AGP_KERN *kern; DRM_AGP_KERN *kern;
...@@ -68,6 +68,7 @@ int drm_agp_info(drm_device_t *dev, drm_agp_info_t *info) ...@@ -68,6 +68,7 @@ int drm_agp_info(drm_device_t *dev, drm_agp_info_t *info)
return 0; return 0;
} }
EXPORT_SYMBOL(drm_agp_info); EXPORT_SYMBOL(drm_agp_info);
int drm_agp_info_ioctl(struct inode *inode, struct file *filp, int drm_agp_info_ioctl(struct inode *inode, struct file *filp,
...@@ -96,7 +97,7 @@ int drm_agp_info_ioctl(struct inode *inode, struct file *filp, ...@@ -96,7 +97,7 @@ int drm_agp_info_ioctl(struct inode *inode, struct file *filp,
* Verifies the AGP device hasn't been acquired before and calls * Verifies the AGP device hasn't been acquired before and calls
* \c agp_backend_acquire. * \c agp_backend_acquire.
*/ */
int drm_agp_acquire(drm_device_t *dev) int drm_agp_acquire(drm_device_t * dev)
{ {
if (!dev->agp) if (!dev->agp)
return -ENODEV; return -ENODEV;
...@@ -107,6 +108,7 @@ int drm_agp_acquire(drm_device_t *dev) ...@@ -107,6 +108,7 @@ int drm_agp_acquire(drm_device_t *dev)
dev->agp->acquired = 1; dev->agp->acquired = 1;
return 0; return 0;
} }
EXPORT_SYMBOL(drm_agp_acquire); EXPORT_SYMBOL(drm_agp_acquire);
/** /**
...@@ -126,7 +128,7 @@ int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp, ...@@ -126,7 +128,7 @@ int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp,
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
return drm_agp_acquire( (drm_device_t *) priv->head->dev ); return drm_agp_acquire((drm_device_t *) priv->head->dev);
} }
/** /**
...@@ -137,7 +139,7 @@ int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp, ...@@ -137,7 +139,7 @@ int drm_agp_acquire_ioctl(struct inode *inode, struct file *filp,
* *
* Verifies the AGP device has been acquired and calls \c agp_backend_release. * Verifies the AGP device has been acquired and calls \c agp_backend_release.
*/ */
int drm_agp_release(drm_device_t *dev) int drm_agp_release(drm_device_t * dev)
{ {
if (!dev->agp || !dev->agp->acquired) if (!dev->agp || !dev->agp->acquired)
return -EINVAL; return -EINVAL;
...@@ -145,6 +147,7 @@ int drm_agp_release(drm_device_t *dev) ...@@ -145,6 +147,7 @@ int drm_agp_release(drm_device_t *dev)
dev->agp->acquired = 0; dev->agp->acquired = 0;
return 0; return 0;
} }
EXPORT_SYMBOL(drm_agp_release); EXPORT_SYMBOL(drm_agp_release);
int drm_agp_release_ioctl(struct inode *inode, struct file *filp, int drm_agp_release_ioctl(struct inode *inode, struct file *filp,
...@@ -166,7 +169,7 @@ int drm_agp_release_ioctl(struct inode *inode, struct file *filp, ...@@ -166,7 +169,7 @@ int drm_agp_release_ioctl(struct inode *inode, struct file *filp,
* Verifies the AGP device has been acquired but not enabled, and calls * Verifies the AGP device has been acquired but not enabled, and calls
* \c agp_enable. * \c agp_enable.
*/ */
int drm_agp_enable(drm_device_t *dev, drm_agp_mode_t mode) int drm_agp_enable(drm_device_t * dev, drm_agp_mode_t mode)
{ {
if (!dev->agp || !dev->agp->acquired) if (!dev->agp || !dev->agp->acquired)
return -EINVAL; return -EINVAL;
...@@ -177,6 +180,7 @@ int drm_agp_enable(drm_device_t *dev, drm_agp_mode_t mode) ...@@ -177,6 +180,7 @@ int drm_agp_enable(drm_device_t *dev, drm_agp_mode_t mode)
dev->agp->enabled = 1; dev->agp->enabled = 1;
return 0; return 0;
} }
EXPORT_SYMBOL(drm_agp_enable); EXPORT_SYMBOL(drm_agp_enable);
int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
...@@ -186,7 +190,6 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp, ...@@ -186,7 +190,6 @@ int drm_agp_enable_ioctl(struct inode *inode, struct file *filp,
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
drm_agp_mode_t mode; drm_agp_mode_t mode;
if (copy_from_user(&mode, (drm_agp_mode_t __user *) arg, sizeof(mode))) if (copy_from_user(&mode, (drm_agp_mode_t __user *) arg, sizeof(mode)))
return -EFAULT; return -EFAULT;
...@@ -266,7 +269,7 @@ int drm_agp_alloc(struct inode *inode, struct file *filp, ...@@ -266,7 +269,7 @@ int drm_agp_alloc(struct inode *inode, struct file *filp,
* *
* Walks through drm_agp_head::memory until finding a matching handle. * Walks through drm_agp_head::memory until finding a matching handle.
*/ */
static drm_agp_mem_t *drm_agp_lookup_entry(drm_device_t *dev, static drm_agp_mem_t *drm_agp_lookup_entry(drm_device_t * dev,
unsigned long handle) unsigned long handle)
{ {
drm_agp_mem_t *entry; drm_agp_mem_t *entry;
...@@ -301,7 +304,8 @@ int drm_agp_unbind(struct inode *inode, struct file *filp, ...@@ -301,7 +304,8 @@ int drm_agp_unbind(struct inode *inode, struct file *filp,
if (!dev->agp || !dev->agp->acquired) if (!dev->agp || !dev->agp->acquired)
return -EINVAL; return -EINVAL;
if (copy_from_user(&request, (drm_agp_binding_t __user *)arg, sizeof(request))) if (copy_from_user
(&request, (drm_agp_binding_t __user *) arg, sizeof(request)))
return -EFAULT; return -EFAULT;
if (!(entry = drm_agp_lookup_entry(dev, request.handle))) if (!(entry = drm_agp_lookup_entry(dev, request.handle)))
return -EINVAL; return -EINVAL;
...@@ -338,7 +342,8 @@ int drm_agp_bind(struct inode *inode, struct file *filp, ...@@ -338,7 +342,8 @@ int drm_agp_bind(struct inode *inode, struct file *filp,
if (!dev->agp || !dev->agp->acquired) if (!dev->agp || !dev->agp->acquired)
return -EINVAL; return -EINVAL;
if (copy_from_user(&request, (drm_agp_binding_t __user *)arg, sizeof(request))) if (copy_from_user
(&request, (drm_agp_binding_t __user *) arg, sizeof(request)))
return -EFAULT; return -EFAULT;
if (!(entry = drm_agp_lookup_entry(dev, request.handle))) if (!(entry = drm_agp_lookup_entry(dev, request.handle)))
return -EINVAL; return -EINVAL;
...@@ -377,7 +382,8 @@ int drm_agp_free(struct inode *inode, struct file *filp, ...@@ -377,7 +382,8 @@ int drm_agp_free(struct inode *inode, struct file *filp,
if (!dev->agp || !dev->agp->acquired) if (!dev->agp || !dev->agp->acquired)
return -EINVAL; return -EINVAL;
if (copy_from_user(&request, (drm_agp_buffer_t __user *)arg, sizeof(request))) if (copy_from_user
(&request, (drm_agp_buffer_t __user *) arg, sizeof(request)))
return -EFAULT; return -EFAULT;
if (!(entry = drm_agp_lookup_entry(dev, request.handle))) if (!(entry = drm_agp_lookup_entry(dev, request.handle)))
return -EINVAL; return -EINVAL;
...@@ -403,7 +409,7 @@ int drm_agp_free(struct inode *inode, struct file *filp, ...@@ -403,7 +409,7 @@ int drm_agp_free(struct inode *inode, struct file *filp,
* \return pointer to a drm_agp_head structure. * \return pointer to a drm_agp_head structure.
* *
*/ */
drm_agp_head_t *drm_agp_init(drm_device_t *dev) drm_agp_head_t *drm_agp_init(drm_device_t * dev)
{ {
drm_agp_head_t *head = NULL; drm_agp_head_t *head = NULL;
...@@ -433,13 +439,14 @@ drm_agp_head_t *drm_agp_init(drm_device_t *dev) ...@@ -433,13 +439,14 @@ drm_agp_head_t *drm_agp_init(drm_device_t *dev)
} }
/** Calls agp_allocate_memory() */ /** Calls agp_allocate_memory() */
DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size_t pages, u32 type) DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data * bridge,
size_t pages, u32 type)
{ {
return agp_allocate_memory(bridge, pages, type); return agp_allocate_memory(bridge, pages, type);
} }
/** Calls agp_free_memory() */ /** Calls agp_free_memory() */
int drm_agp_free_memory(DRM_AGP_MEM *handle) int drm_agp_free_memory(DRM_AGP_MEM * handle)
{ {
if (!handle) if (!handle)
return 0; return 0;
...@@ -448,16 +455,17 @@ int drm_agp_free_memory(DRM_AGP_MEM *handle) ...@@ -448,16 +455,17 @@ int drm_agp_free_memory(DRM_AGP_MEM *handle)
} }
/** Calls agp_bind_memory() */ /** Calls agp_bind_memory() */
int drm_agp_bind_memory(DRM_AGP_MEM *handle, off_t start) int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start)
{ {
if (!handle) if (!handle)
return -EINVAL; return -EINVAL;
return agp_bind_memory(handle, start); return agp_bind_memory(handle, start);
} }
EXPORT_SYMBOL(drm_agp_bind_memory); EXPORT_SYMBOL(drm_agp_bind_memory);
/** Calls agp_unbind_memory() */ /** Calls agp_unbind_memory() */
int drm_agp_unbind_memory(DRM_AGP_MEM *handle) int drm_agp_unbind_memory(DRM_AGP_MEM * handle)
{ {
if (!handle) if (!handle)
return -EINVAL; return -EINVAL;
......
/** /**
* \file drm_auth.h * \file drm_auth.c
* IOCTLs for authentication * IOCTLs for authentication
* *
* \author Rickard E. (Rik) Faith <faith@valinux.com> * \author Rickard E. (Rik) Faith <faith@valinux.com>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
*/ */
static int drm_hash_magic(drm_magic_t magic) static int drm_hash_magic(drm_magic_t magic)
{ {
return magic & (DRM_HASH_SIZE-1); return magic & (DRM_HASH_SIZE - 1);
} }
/** /**
...@@ -59,7 +59,7 @@ static int drm_hash_magic(drm_magic_t magic) ...@@ -59,7 +59,7 @@ static int drm_hash_magic(drm_magic_t magic)
* the one with matching magic number, while holding the drm_device::struct_sem * the one with matching magic number, while holding the drm_device::struct_sem
* lock. * lock.
*/ */
static drm_file_t *drm_find_file(drm_device_t *dev, drm_magic_t magic) static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic)
{ {
drm_file_t *retval = NULL; drm_file_t *retval = NULL;
drm_magic_entry_t *pt; drm_magic_entry_t *pt;
...@@ -87,7 +87,8 @@ static drm_file_t *drm_find_file(drm_device_t *dev, drm_magic_t magic) ...@@ -87,7 +87,8 @@ static drm_file_t *drm_find_file(drm_device_t *dev, drm_magic_t magic)
* associated the magic number hash key in drm_device::magiclist, while holding * associated the magic number hash key in drm_device::magiclist, while holding
* the drm_device::struct_sem lock. * the drm_device::struct_sem lock.
*/ */
static int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic) static int drm_add_magic(drm_device_t * dev, drm_file_t * priv,
drm_magic_t magic)
{ {
int hash; int hash;
drm_magic_entry_t *entry; drm_magic_entry_t *entry;
...@@ -96,7 +97,8 @@ static int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic) ...@@ -96,7 +97,8 @@ static int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic)
hash = drm_hash_magic(magic); hash = drm_hash_magic(magic);
entry = drm_alloc(sizeof(*entry), DRM_MEM_MAGIC); entry = drm_alloc(sizeof(*entry), DRM_MEM_MAGIC);
if (!entry) return -ENOMEM; if (!entry)
return -ENOMEM;
memset(entry, 0, sizeof(*entry)); memset(entry, 0, sizeof(*entry));
entry->magic = magic; entry->magic = magic;
entry->priv = priv; entry->priv = priv;
...@@ -124,13 +126,12 @@ static int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic) ...@@ -124,13 +126,12 @@ static int drm_add_magic(drm_device_t *dev, drm_file_t *priv, drm_magic_t magic)
* Searches and unlinks the entry in drm_device::magiclist with the magic * Searches and unlinks the entry in drm_device::magiclist with the magic
* number hash key, while holding the drm_device::struct_sem lock. * number hash key, while holding the drm_device::struct_sem lock.
*/ */
static int drm_remove_magic(drm_device_t *dev, drm_magic_t magic) static int drm_remove_magic(drm_device_t * dev, drm_magic_t magic)
{ {
drm_magic_entry_t *prev = NULL; drm_magic_entry_t *prev = NULL;
drm_magic_entry_t *pt; drm_magic_entry_t *pt;
int hash; int hash;
DRM_DEBUG("%d\n", magic); DRM_DEBUG("%d\n", magic);
hash = drm_hash_magic(magic); hash = drm_hash_magic(magic);
...@@ -185,7 +186,8 @@ int drm_getmagic(struct inode *inode, struct file *filp, ...@@ -185,7 +186,8 @@ int drm_getmagic(struct inode *inode, struct file *filp,
} else { } else {
do { do {
spin_lock(&lock); spin_lock(&lock);
if (!sequence) ++sequence; /* reserve 0 */ if (!sequence)
++sequence; /* reserve 0 */
auth.magic = sequence++; auth.magic = sequence++;
spin_unlock(&lock); spin_unlock(&lock);
} while (drm_find_file(dev, auth.magic)); } while (drm_find_file(dev, auth.magic));
...@@ -194,7 +196,7 @@ int drm_getmagic(struct inode *inode, struct file *filp, ...@@ -194,7 +196,7 @@ int drm_getmagic(struct inode *inode, struct file *filp,
} }
DRM_DEBUG("%u\n", auth.magic); DRM_DEBUG("%u\n", auth.magic);
if (copy_to_user((drm_auth_t __user *)arg, &auth, sizeof(auth))) if (copy_to_user((drm_auth_t __user *) arg, &auth, sizeof(auth)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -218,7 +220,7 @@ int drm_authmagic(struct inode *inode, struct file *filp, ...@@ -218,7 +220,7 @@ int drm_authmagic(struct inode *inode, struct file *filp,
drm_auth_t auth; drm_auth_t auth;
drm_file_t *file; drm_file_t *file;
if (copy_from_user(&auth, (drm_auth_t __user *)arg, sizeof(auth))) if (copy_from_user(&auth, (drm_auth_t __user *) arg, sizeof(auth)))
return -EFAULT; return -EFAULT;
DRM_DEBUG("%u\n", auth.magic); DRM_DEBUG("%u\n", auth.magic);
if ((file = drm_find_file(dev, auth.magic))) { if ((file = drm_find_file(dev, auth.magic))) {
......
This diff is collapsed.
This diff is collapsed.
/** /**
* \file drm_dma.h * \file drm_dma.c
* DMA IOCTL and function support * DMA IOCTL and function support
* *
* \author Rickard E. (Rik) Faith <faith@valinux.com> * \author Rickard E. (Rik) Faith <faith@valinux.com>
...@@ -43,17 +43,17 @@ ...@@ -43,17 +43,17 @@
* *
* Allocate and initialize a drm_device_dma structure. * Allocate and initialize a drm_device_dma structure.
*/ */
int drm_dma_setup( drm_device_t *dev ) int drm_dma_setup(drm_device_t * dev)
{ {
int i; int i;
dev->dma = drm_alloc( sizeof(*dev->dma), DRM_MEM_DRIVER ); dev->dma = drm_alloc(sizeof(*dev->dma), DRM_MEM_DRIVER);
if ( !dev->dma ) if (!dev->dma)
return -ENOMEM; return -ENOMEM;
memset( dev->dma, 0, sizeof(*dev->dma) ); memset(dev->dma, 0, sizeof(*dev->dma));
for ( i = 0 ; i <= DRM_MAX_ORDER ; i++ ) for (i = 0; i <= DRM_MAX_ORDER; i++)
memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0])); memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0]));
return 0; return 0;
...@@ -67,12 +67,13 @@ int drm_dma_setup( drm_device_t *dev ) ...@@ -67,12 +67,13 @@ int drm_dma_setup( drm_device_t *dev )
* Free all pages associated with DMA buffers, the buffers and pages lists, and * Free all pages associated with DMA buffers, the buffers and pages lists, and
* finally the the drm_device::dma structure itself. * finally the the drm_device::dma structure itself.
*/ */
void drm_dma_takedown(drm_device_t *dev) void drm_dma_takedown(drm_device_t * dev)
{ {
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
int i, j; int i, j;
if (!dma) return; if (!dma)
return;
/* Clear dma buffers */ /* Clear dma buffers */
for (i = 0; i <= DRM_MAX_ORDER; i++) { for (i = 0; i <= DRM_MAX_ORDER; i++) {
...@@ -91,28 +92,26 @@ void drm_dma_takedown(drm_device_t *dev) ...@@ -91,28 +92,26 @@ void drm_dma_takedown(drm_device_t *dev)
} }
drm_free(dma->bufs[i].seglist, drm_free(dma->bufs[i].seglist,
dma->bufs[i].seg_count dma->bufs[i].seg_count
* sizeof(*dma->bufs[0].seglist), * sizeof(*dma->bufs[0].seglist), DRM_MEM_SEGS);
DRM_MEM_SEGS);
} }
if (dma->bufs[i].buf_count) { if (dma->bufs[i].buf_count) {
for (j = 0; j < dma->bufs[i].buf_count; j++) { for (j = 0; j < dma->bufs[i].buf_count; j++) {
if (dma->bufs[i].buflist[j].dev_private) { if (dma->bufs[i].buflist[j].dev_private) {
drm_free(dma->bufs[i].buflist[j].dev_private, drm_free(dma->bufs[i].buflist[j].
dma->bufs[i].buflist[j].dev_priv_size, dev_private,
DRM_MEM_BUFS); dma->bufs[i].buflist[j].
dev_priv_size, DRM_MEM_BUFS);
} }
} }
drm_free(dma->bufs[i].buflist, drm_free(dma->bufs[i].buflist,
dma->bufs[i].buf_count * dma->bufs[i].buf_count *
sizeof(*dma->bufs[0].buflist), sizeof(*dma->bufs[0].buflist), DRM_MEM_BUFS);
DRM_MEM_BUFS);
} }
} }
if (dma->buflist) { if (dma->buflist) {
drm_free(dma->buflist, drm_free(dma->buflist,
dma->buf_count * sizeof(*dma->buflist), dma->buf_count * sizeof(*dma->buflist), DRM_MEM_BUFS);
DRM_MEM_BUFS);
} }
if (dma->pagelist) { if (dma->pagelist) {
...@@ -124,7 +123,6 @@ void drm_dma_takedown(drm_device_t *dev) ...@@ -124,7 +123,6 @@ void drm_dma_takedown(drm_device_t *dev)
dev->dma = NULL; dev->dma = NULL;
} }
/** /**
* Free a buffer. * Free a buffer.
* *
...@@ -133,16 +131,18 @@ void drm_dma_takedown(drm_device_t *dev) ...@@ -133,16 +131,18 @@ void drm_dma_takedown(drm_device_t *dev)
* *
* Resets the fields of \p buf. * Resets the fields of \p buf.
*/ */
void drm_free_buffer(drm_device_t *dev, drm_buf_t *buf) void drm_free_buffer(drm_device_t * dev, drm_buf_t * buf)
{ {
if (!buf) return; if (!buf)
return;
buf->waiting = 0; buf->waiting = 0;
buf->pending = 0; buf->pending = 0;
buf->filp = NULL; buf->filp = NULL;
buf->used = 0; buf->used = 0;
if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE) && waitqueue_active(&buf->dma_wait)) { if (drm_core_check_feature(dev, DRIVER_DMA_QUEUE)
&& waitqueue_active(&buf->dma_wait)) {
wake_up_interruptible(&buf->dma_wait); wake_up_interruptible(&buf->dma_wait);
} }
} }
...@@ -154,12 +154,13 @@ void drm_free_buffer(drm_device_t *dev, drm_buf_t *buf) ...@@ -154,12 +154,13 @@ void drm_free_buffer(drm_device_t *dev, drm_buf_t *buf)
* *
* Frees each buffer associated with \p filp not already on the hardware. * Frees each buffer associated with \p filp not already on the hardware.
*/ */
void drm_core_reclaim_buffers(drm_device_t *dev, struct file *filp) void drm_core_reclaim_buffers(drm_device_t * dev, struct file *filp)
{ {
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
int i; int i;
if (!dma) return; if (!dma)
return;
for (i = 0; i < dma->buf_count; i++) { for (i = 0; i < dma->buf_count; i++) {
if (dma->buflist[i]->filp == filp) { if (dma->buflist[i]->filp == filp) {
switch (dma->buflist[i]->list) { switch (dma->buflist[i]->list) {
...@@ -176,5 +177,5 @@ void drm_core_reclaim_buffers(drm_device_t *dev, struct file *filp) ...@@ -176,5 +177,5 @@ void drm_core_reclaim_buffers(drm_device_t *dev, struct file *filp)
} }
} }
} }
EXPORT_SYMBOL(drm_core_reclaim_buffers);
EXPORT_SYMBOL(drm_core_reclaim_buffers);
/** /**
* \file drm_drawable.h * \file drm_drawable.c
* IOCTLs for drawables * IOCTLs for drawables
* *
* \author Rickard E. (Rik) Faith <faith@valinux.com> * \author Rickard E. (Rik) Faith <faith@valinux.com>
...@@ -43,7 +43,7 @@ int drm_adddraw(struct inode *inode, struct file *filp, ...@@ -43,7 +43,7 @@ int drm_adddraw(struct inode *inode, struct file *filp,
draw.handle = 0; /* NOOP */ draw.handle = 0; /* NOOP */
DRM_DEBUG("%d\n", draw.handle); DRM_DEBUG("%d\n", draw.handle);
if (copy_to_user((drm_draw_t __user *)arg, &draw, sizeof(draw))) if (copy_to_user((drm_draw_t __user *) arg, &draw, sizeof(draw)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
......
This diff is collapsed.
This diff is collapsed.
/** /**
* \file drm_init.h * \file drm_init.c
* Setup/Cleanup for DRM * Setup/Cleanup for DRM
* *
* \author Rickard E. (Rik) Faith <faith@valinux.com> * \author Rickard E. (Rik) Faith <faith@valinux.com>
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
int drm_cpu_valid(void) int drm_cpu_valid(void)
{ {
#if defined(__i386__) #if defined(__i386__)
if (boot_cpu_data.x86 == 3) return 0; /* No cmpxchg on a 386 */ if (boot_cpu_data.x86 == 3)
return 0; /* No cmpxchg on a 386 */
#endif #endif
#if defined(__sparc__) && !defined(__sparc_v9__) #if defined(__sparc__) && !defined(__sparc_v9__)
return 0; /* No cmpxchg before v9 sparc. */ return 0; /* No cmpxchg before v9 sparc. */
......
This diff is collapsed.
/** /**
* \file drm_ioctl.h * \file drm_ioctl.c
* IOCTL processing for DRM * IOCTL processing for DRM
* *
* \author Rickard E. (Rik) Faith <faith@valinux.com> * \author Rickard E. (Rik) Faith <faith@valinux.com>
...@@ -91,27 +91,32 @@ int drm_setunique(struct inode *inode, struct file *filp, ...@@ -91,27 +91,32 @@ int drm_setunique(struct inode *inode, struct file *filp,
drm_unique_t u; drm_unique_t u;
int domain, bus, slot, func, ret; int domain, bus, slot, func, ret;
if (dev->unique_len || dev->unique) return -EBUSY; if (dev->unique_len || dev->unique)
return -EBUSY;
if (copy_from_user(&u, (drm_unique_t __user *)arg, sizeof(u))) if (copy_from_user(&u, (drm_unique_t __user *) arg, sizeof(u)))
return -EFAULT; return -EFAULT;
if (!u.unique_len || u.unique_len > 1024) return -EINVAL; if (!u.unique_len || u.unique_len > 1024)
return -EINVAL;
dev->unique_len = u.unique_len; dev->unique_len = u.unique_len;
dev->unique = drm_alloc(u.unique_len + 1, DRM_MEM_DRIVER); dev->unique = drm_alloc(u.unique_len + 1, DRM_MEM_DRIVER);
if(!dev->unique) return -ENOMEM; if (!dev->unique)
return -ENOMEM;
if (copy_from_user(dev->unique, u.unique, dev->unique_len)) if (copy_from_user(dev->unique, u.unique, dev->unique_len))
return -EFAULT; return -EFAULT;
dev->unique[dev->unique_len] = '\0'; dev->unique[dev->unique_len] = '\0';
dev->devname = drm_alloc(strlen(dev->driver->pci_driver.name) + strlen(dev->unique) + 2, dev->devname =
DRM_MEM_DRIVER); drm_alloc(strlen(dev->driver->pci_driver.name) +
strlen(dev->unique) + 2, DRM_MEM_DRIVER);
if (!dev->devname) if (!dev->devname)
return -ENOMEM; return -ENOMEM;
sprintf(dev->devname, "%s@%s", dev->driver->pci_driver.name, dev->unique); sprintf(dev->devname, "%s@%s", dev->driver->pci_driver.name,
dev->unique);
/* Return error if the busid submitted doesn't match the device's actual /* Return error if the busid submitted doesn't match the device's actual
* busid. * busid.
...@@ -124,15 +129,13 @@ int drm_setunique(struct inode *inode, struct file *filp, ...@@ -124,15 +129,13 @@ int drm_setunique(struct inode *inode, struct file *filp,
if ((domain != dev->pci_domain) || if ((domain != dev->pci_domain) ||
(bus != dev->pci_bus) || (bus != dev->pci_bus) ||
(slot != dev->pci_slot) || (slot != dev->pci_slot) || (func != dev->pci_func))
(func != dev->pci_func))
return -EINVAL; return -EINVAL;
return 0; return 0;
} }
static int static int drm_set_busid(drm_device_t * dev)
drm_set_busid(drm_device_t *dev)
{ {
if (dev->unique != NULL) if (dev->unique != NULL)
return EBUSY; return EBUSY;
...@@ -145,17 +148,18 @@ drm_set_busid(drm_device_t *dev) ...@@ -145,17 +148,18 @@ drm_set_busid(drm_device_t *dev)
snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d", snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d",
dev->pci_domain, dev->pci_bus, dev->pci_slot, dev->pci_func); dev->pci_domain, dev->pci_bus, dev->pci_slot, dev->pci_func);
dev->devname = drm_alloc(strlen(dev->driver->pci_driver.name) + dev->unique_len + 2, dev->devname =
DRM_MEM_DRIVER); drm_alloc(strlen(dev->driver->pci_driver.name) + dev->unique_len +
2, DRM_MEM_DRIVER);
if (dev->devname == NULL) if (dev->devname == NULL)
return ENOMEM; return ENOMEM;
sprintf(dev->devname, "%s@%s", dev->driver->pci_driver.name, dev->unique); sprintf(dev->devname, "%s@%s", dev->driver->pci_driver.name,
dev->unique);
return 0; return 0;
} }
/** /**
* Get a mapping information. * Get a mapping information.
* *
...@@ -169,8 +173,8 @@ drm_set_busid(drm_device_t *dev) ...@@ -169,8 +173,8 @@ drm_set_busid(drm_device_t *dev)
* Searches for the mapping with the specified offset and copies its information * Searches for the mapping with the specified offset and copies its information
* into userspace * into userspace
*/ */
int drm_getmap( struct inode *inode, struct file *filp, int drm_getmap(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg ) unsigned int cmd, unsigned long arg)
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
...@@ -193,13 +197,13 @@ int drm_getmap( struct inode *inode, struct file *filp, ...@@ -193,13 +197,13 @@ int drm_getmap( struct inode *inode, struct file *filp,
i = 0; i = 0;
list_for_each(list, &dev->maplist->head) { list_for_each(list, &dev->maplist->head) {
if(i == idx) { if (i == idx) {
r_list = list_entry(list, drm_map_list_t, head); r_list = list_entry(list, drm_map_list_t, head);
break; break;
} }
i++; i++;
} }
if(!r_list || !r_list->map) { if (!r_list || !r_list->map) {
up(&dev->struct_sem); up(&dev->struct_sem);
return -EINVAL; return -EINVAL;
} }
...@@ -208,11 +212,12 @@ int drm_getmap( struct inode *inode, struct file *filp, ...@@ -208,11 +212,12 @@ int drm_getmap( struct inode *inode, struct file *filp,
map.size = r_list->map->size; map.size = r_list->map->size;
map.type = r_list->map->type; map.type = r_list->map->type;
map.flags = r_list->map->flags; map.flags = r_list->map->flags;
map.handle = (void *)(unsigned long) r_list->user_token; map.handle = (void *)(unsigned long)r_list->user_token;
map.mtrr = r_list->map->mtrr; map.mtrr = r_list->map->mtrr;
up(&dev->struct_sem); up(&dev->struct_sem);
if (copy_to_user(argp, &map, sizeof(map))) return -EFAULT; if (copy_to_user(argp, &map, sizeof(map)))
return -EFAULT;
return 0; return 0;
} }
...@@ -229,8 +234,8 @@ int drm_getmap( struct inode *inode, struct file *filp, ...@@ -229,8 +234,8 @@ int drm_getmap( struct inode *inode, struct file *filp,
* Searches for the client with the specified index and copies its information * Searches for the client with the specified index and copies its information
* into userspace * into userspace
*/ */
int drm_getclient( struct inode *inode, struct file *filp, int drm_getclient(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg ) unsigned int cmd, unsigned long arg)
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
...@@ -244,8 +249,7 @@ int drm_getclient( struct inode *inode, struct file *filp, ...@@ -244,8 +249,7 @@ int drm_getclient( struct inode *inode, struct file *filp,
return -EFAULT; return -EFAULT;
idx = client.idx; idx = client.idx;
down(&dev->struct_sem); down(&dev->struct_sem);
for (i = 0, pt = dev->file_first; i < idx && pt; i++, pt = pt->next) for (i = 0, pt = dev->file_first; i < idx && pt; i++, pt = pt->next) ;
;
if (!pt) { if (!pt) {
up(&dev->struct_sem); up(&dev->struct_sem);
...@@ -258,7 +262,7 @@ int drm_getclient( struct inode *inode, struct file *filp, ...@@ -258,7 +262,7 @@ int drm_getclient( struct inode *inode, struct file *filp,
client.iocs = pt->ioctl_count; client.iocs = pt->ioctl_count;
up(&dev->struct_sem); up(&dev->struct_sem);
if (copy_to_user((drm_client_t __user *)arg, &client, sizeof(client))) if (copy_to_user((drm_client_t __user *) arg, &client, sizeof(client)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -273,8 +277,8 @@ int drm_getclient( struct inode *inode, struct file *filp, ...@@ -273,8 +277,8 @@ int drm_getclient( struct inode *inode, struct file *filp,
* *
* \return zero on success or a negative number on failure. * \return zero on success or a negative number on failure.
*/ */
int drm_getstats( struct inode *inode, struct file *filp, int drm_getstats(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg ) unsigned int cmd, unsigned long arg)
{ {
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->head->dev; drm_device_t *dev = priv->head->dev;
...@@ -288,8 +292,7 @@ int drm_getstats( struct inode *inode, struct file *filp, ...@@ -288,8 +292,7 @@ int drm_getstats( struct inode *inode, struct file *filp,
for (i = 0; i < dev->counters; i++) { for (i = 0; i < dev->counters; i++) {
if (dev->types[i] == _DRM_STAT_LOCK) if (dev->types[i] == _DRM_STAT_LOCK)
stats.data[i].value stats.data[i].value
= (dev->lock.hw_lock = (dev->lock.hw_lock ? dev->lock.hw_lock->lock : 0);
? dev->lock.hw_lock->lock : 0);
else else
stats.data[i].value = atomic_read(&dev->counts[i]); stats.data[i].value = atomic_read(&dev->counts[i]);
stats.data[i].type = dev->types[i]; stats.data[i].type = dev->types[i];
...@@ -299,7 +302,7 @@ int drm_getstats( struct inode *inode, struct file *filp, ...@@ -299,7 +302,7 @@ int drm_getstats( struct inode *inode, struct file *filp,
up(&dev->struct_sem); up(&dev->struct_sem);
if (copy_to_user((drm_stats_t __user *)arg, &stats, sizeof(stats))) if (copy_to_user((drm_stats_t __user *) arg, &stats, sizeof(stats)))
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
...@@ -352,7 +355,8 @@ int drm_setversion(DRM_IOCTL_ARGS) ...@@ -352,7 +355,8 @@ int drm_setversion(DRM_IOCTL_ARGS)
if (sv.drm_dd_major != -1) { if (sv.drm_dd_major != -1) {
if (sv.drm_dd_major != version.version_major || if (sv.drm_dd_major != version.version_major ||
sv.drm_dd_minor < 0 || sv.drm_dd_minor > version.version_minor) sv.drm_dd_minor < 0
|| sv.drm_dd_minor > version.version_minor)
return EINVAL; return EINVAL;
if (dev->driver->set_version) if (dev->driver->set_version)
......
This diff is collapsed.
This diff is collapsed.
/** /**
* \file drm_memory.h * \file drm_memory.c
* Memory management wrappers for DRM * Memory management wrappers for DRM
* *
* \author Rickard E. (Rik) Faith <faith@valinux.com> * \author Rickard E. (Rik) Faith <faith@valinux.com>
...@@ -70,7 +70,8 @@ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area) ...@@ -70,7 +70,8 @@ void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area)
{ {
void *pt; void *pt;
if (!(pt = kmalloc(size, GFP_KERNEL))) return NULL; if (!(pt = kmalloc(size, GFP_KERNEL)))
return NULL;
if (oldpt && oldsize) { if (oldpt && oldsize) {
memcpy(pt, oldpt, oldsize); memcpy(pt, oldpt, oldsize);
kfree(oldpt); kfree(oldpt);
...@@ -103,8 +104,7 @@ unsigned long drm_alloc_pages(int order, int area) ...@@ -103,8 +104,7 @@ unsigned long drm_alloc_pages(int order, int area)
/* Reserve */ /* Reserve */
for (addr = address, sz = bytes; for (addr = address, sz = bytes;
sz > 0; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) {
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
SetPageReserved(virt_to_page(addr)); SetPageReserved(virt_to_page(addr));
} }
...@@ -131,42 +131,44 @@ void drm_free_pages(unsigned long address, int order, int area) ...@@ -131,42 +131,44 @@ void drm_free_pages(unsigned long address, int order, int area)
/* Unreserve */ /* Unreserve */
for (addr = address, sz = bytes; for (addr = address, sz = bytes;
sz > 0; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) {
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
ClearPageReserved(virt_to_page(addr)); ClearPageReserved(virt_to_page(addr));
} }
free_pages(address, order); free_pages(address, order);
} }
#if __OS_HAS_AGP #if __OS_HAS_AGP
/** Wrapper around agp_allocate_memory() */ /** Wrapper around agp_allocate_memory() */
DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type) DRM_AGP_MEM *drm_alloc_agp(drm_device_t * dev, int pages, u32 type)
{ {
return drm_agp_allocate_memory(dev->agp->bridge, pages, type); return drm_agp_allocate_memory(dev->agp->bridge, pages, type);
} }
EXPORT_SYMBOL(drm_alloc_agp); EXPORT_SYMBOL(drm_alloc_agp);
/** Wrapper around agp_free_memory() */ /** Wrapper around agp_free_memory() */
int drm_free_agp(DRM_AGP_MEM *handle, int pages) int drm_free_agp(DRM_AGP_MEM * handle, int pages)
{ {
return drm_agp_free_memory(handle) ? 0 : -EINVAL; return drm_agp_free_memory(handle) ? 0 : -EINVAL;
} }
EXPORT_SYMBOL(drm_free_agp); EXPORT_SYMBOL(drm_free_agp);
/** Wrapper around agp_bind_memory() */ /** Wrapper around agp_bind_memory() */
int drm_bind_agp(DRM_AGP_MEM *handle, unsigned int start) int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start)
{ {
return drm_agp_bind_memory(handle, start); return drm_agp_bind_memory(handle, start);
} }
EXPORT_SYMBOL(drm_bind_agp); EXPORT_SYMBOL(drm_bind_agp);
/** Wrapper around agp_unbind_memory() */ /** Wrapper around agp_unbind_memory() */
int drm_unbind_agp(DRM_AGP_MEM *handle) int drm_unbind_agp(DRM_AGP_MEM * handle)
{ {
return drm_agp_unbind_memory(handle); return drm_agp_unbind_memory(handle);
} }
EXPORT_SYMBOL(drm_unbind_agp); EXPORT_SYMBOL(drm_unbind_agp);
#endif /* agp */ #endif /* agp */
#endif /* debug_memory */ #endif /* debug_memory */
This diff is collapsed.
This diff is collapsed.
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
* OS abstraction macros. * OS abstraction macros.
*/ */
#include <linux/interrupt.h> /* For task queue support */ #include <linux/interrupt.h> /* For task queue support */
#include <linux/delay.h> #include <linux/delay.h>
...@@ -55,17 +54,17 @@ struct no_agp_kern { ...@@ -55,17 +54,17 @@ struct no_agp_kern {
#endif #endif
#if !(__OS_HAS_MTRR) #if !(__OS_HAS_MTRR)
static __inline__ int mtrr_add (unsigned long base, unsigned long size, static __inline__ int mtrr_add(unsigned long base, unsigned long size,
unsigned int type, char increment) unsigned int type, char increment)
{ {
return -ENODEV; return -ENODEV;
} }
static __inline__ int mtrr_del (int reg, unsigned long base, static __inline__ int mtrr_del(int reg, unsigned long base, unsigned long size)
unsigned long size)
{ {
return -ENODEV; return -ENODEV;
} }
#define MTRR_TYPE_WRCOMB 1 #define MTRR_TYPE_WRCOMB 1
#endif #endif
...@@ -143,7 +142,5 @@ do { \ ...@@ -143,7 +142,5 @@ do { \
remove_wait_queue(&(queue), &entry); \ remove_wait_queue(&(queue), &entry); \
} while (0) } while (0)
#define DRM_WAKEUP( queue ) wake_up_interruptible( queue ) #define DRM_WAKEUP( queue ) wake_up_interruptible( queue )
#define DRM_INIT_WAITQUEUE( queue ) init_waitqueue_head( queue ) #define DRM_INIT_WAITQUEUE( queue ) init_waitqueue_head( queue )
...@@ -106,6 +106,7 @@ drm_dma_handle_t *drm_pci_alloc(drm_device_t * dev, size_t size, size_t align, ...@@ -106,6 +106,7 @@ drm_dma_handle_t *drm_pci_alloc(drm_device_t * dev, size_t size, size_t align,
return dmah; return dmah;
} }
EXPORT_SYMBOL(drm_pci_alloc); EXPORT_SYMBOL(drm_pci_alloc);
/** /**
...@@ -113,8 +114,7 @@ EXPORT_SYMBOL(drm_pci_alloc); ...@@ -113,8 +114,7 @@ EXPORT_SYMBOL(drm_pci_alloc);
* *
* This function is for internal use in the Linux-specific DRM core code. * This function is for internal use in the Linux-specific DRM core code.
*/ */
void void __drm_pci_free(drm_device_t * dev, drm_dma_handle_t * dmah)
__drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah)
{ {
#ifdef DRM_DEBUG_MEMORY #ifdef DRM_DEBUG_MEMORY
int area = DRM_MEM_DMA; int area = DRM_MEM_DMA;
...@@ -150,12 +150,12 @@ __drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah) ...@@ -150,12 +150,12 @@ __drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah)
/** /**
* \brief Free a PCI consistent memory block * \brief Free a PCI consistent memory block
*/ */
void void drm_pci_free(drm_device_t * dev, drm_dma_handle_t * dmah)
drm_pci_free(drm_device_t *dev, drm_dma_handle_t *dmah)
{ {
__drm_pci_free(dev, dmah); __drm_pci_free(dev, dmah);
kfree(dmah); kfree(dmah);
} }
EXPORT_SYMBOL(drm_pci_free); EXPORT_SYMBOL(drm_pci_free);
/*@}*/ /*@}*/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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