Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 60447
b: refs/heads/master
c: cdd55a2
h: refs/heads/master
i:
  60445: 830e0bf
  60443: c8f4a0b
  60439: 300357c
  60431: eab3fc0
  60415: c418ddf
v: v3
  • Loading branch information
Dave Airlie committed Jul 11, 2007
1 parent a475fd2 commit dec37df
Show file tree
Hide file tree
Showing 17 changed files with 82 additions and 81 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fc2fdf4c9437576f38e97c2f5b700ec77038984
refs/heads/master: cdd55a294c13f8bf05b2f4fee4c96934d5ebd2e4
32 changes: 16 additions & 16 deletions trunk/drivers/char/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,17 @@ struct drm_buf {
};

/** bufs is one longer than it has to be */
typedef struct drm_waitlist {
struct drm_waitlist {
int count; /**< Number of possible buffers */
struct drm_buf **bufs; /**< List of pointers to buffers */
struct drm_buf **rp; /**< Read pointer */
struct drm_buf **wp; /**< Write pointer */
struct drm_buf **end; /**< End pointer */
spinlock_t read_lock;
spinlock_t write_lock;
} drm_waitlist_t;
};

typedef struct drm_freelist {
struct drm_freelist {
int initialized; /**< Freelist in use */
atomic_t count; /**< Number of free buffers */
struct drm_buf *next; /**< End pointer */
Expand All @@ -339,7 +339,7 @@ typedef struct drm_freelist {
int high_mark; /**< High water mark */
atomic_t wfh; /**< If waiting for high mark */
spinlock_t lock;
} drm_freelist_t;
};

typedef struct drm_dma_handle {
dma_addr_t busaddr;
Expand All @@ -350,16 +350,16 @@ typedef struct drm_dma_handle {
/**
* Buffer entry. There is one of this for each buffer size order.
*/
typedef struct drm_buf_entry {
struct drm_buf_entry {
int buf_size; /**< size */
int buf_count; /**< number of buffers */
struct drm_buf *buflist; /**< buffer list */
int seg_count;
int page_order;
drm_dma_handle_t **seglist;
struct drm_dma_handle **seglist;

drm_freelist_t freelist;
} drm_buf_entry_t;
struct drm_freelist freelist;
};

/** File private data */
struct drm_file {
Expand All @@ -378,7 +378,7 @@ struct drm_file {
};

/** Wait queue */
typedef struct drm_queue {
struct drm_queue {
atomic_t use_count; /**< Outstanding uses (+1) */
atomic_t finalization; /**< Finalization in progress */
atomic_t block_count; /**< Count of processes waiting */
Expand All @@ -392,9 +392,9 @@ typedef struct drm_queue {
atomic_t total_locks; /**< Total locks statistics */
#endif
enum drm_ctx_flags flags; /**< Context preserving and 2D-only */
drm_waitlist_t waitlist; /**< Pending buffers */
struct drm_waitlist waitlist; /**< Pending buffers */
wait_queue_head_t flush_queue; /**< Processes waiting until flush */
} drm_queue_t;
};

/**
* Lock data.
Expand All @@ -413,9 +413,9 @@ typedef struct drm_lock_data {
/**
* DMA data.
*/
typedef struct drm_device_dma {
struct drm_device_dma {

drm_buf_entry_t bufs[DRM_MAX_ORDER + 1]; /**< buffers, grouped by their size order */
struct drm_buf_entry bufs[DRM_MAX_ORDER + 1]; /**< buffers, grouped by their size order */
int buf_count; /**< total number of buffers */
struct drm_buf **buflist; /**< Vector of pointers into drm_device_dma::bufs */
int seg_count;
Expand All @@ -429,7 +429,7 @@ typedef struct drm_device_dma {
_DRM_DMA_USE_PCI_RO = 0x08
} flags;

} drm_device_dma_t;
};

/**
* AGP memory entry. Stored as a doubly linked list.
Expand Down Expand Up @@ -688,8 +688,8 @@ struct drm_device {
int queue_count; /**< Number of active DMA queues */
int queue_reserved; /**< Number of reserved DMA queues */
int queue_slots; /**< Actual length of queuelist */
drm_queue_t **queuelist; /**< Vector of pointers to DMA queues */
drm_device_dma_t *dma; /**< Optional pointer for DMA support */
struct drm_queue **queuelist; /**< Vector of pointers to DMA queues */
struct drm_device_dma *dma; /**< Optional pointer for DMA support */
/*@} */

/** \name Context support */
Expand Down
33 changes: 17 additions & 16 deletions trunk/drivers/char/drm/drm_bufs.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,8 @@ int drm_rmmap_ioctl(struct inode *inode, struct file *filp,
*
* Frees any pages and buffers associated with the given entry.
*/
static void drm_cleanup_buf_error(struct drm_device * dev, drm_buf_entry_t * entry)
static void drm_cleanup_buf_error(struct drm_device * dev,
struct drm_buf_entry * entry)
{
int i;

Expand Down Expand Up @@ -551,8 +552,8 @@ static void drm_cleanup_buf_error(struct drm_device * dev, drm_buf_entry_t * ent
*/
int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
{
drm_device_dma_t *dma = dev->dma;
drm_buf_entry_t *entry;
struct drm_device_dma *dma = dev->dma;
struct drm_buf_entry *entry;
drm_agp_mem_t *agp_entry;
struct drm_buf *buf;
unsigned long offset;
Expand Down Expand Up @@ -721,13 +722,13 @@ EXPORT_SYMBOL(drm_addbufs_agp);

int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int count;
int order;
int size;
int total;
int page_order;
drm_buf_entry_t *entry;
struct drm_buf_entry *entry;
drm_dma_handle_t *dmah;
struct drm_buf *buf;
int alignment;
Expand Down Expand Up @@ -947,8 +948,8 @@ EXPORT_SYMBOL(drm_addbufs_pci);

static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request)
{
drm_device_dma_t *dma = dev->dma;
drm_buf_entry_t *entry;
struct drm_device_dma *dma = dev->dma;
struct drm_buf_entry *entry;
struct drm_buf *buf;
unsigned long offset;
unsigned long agp_offset;
Expand Down Expand Up @@ -1109,8 +1110,8 @@ static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request

static int drm_addbufs_fb(struct drm_device * dev, struct drm_buf_desc * request)
{
drm_device_dma_t *dma = dev->dma;
drm_buf_entry_t *entry;
struct drm_device_dma *dma = dev->dma;
struct drm_buf_entry *entry;
struct drm_buf *buf;
unsigned long offset;
unsigned long agp_offset;
Expand Down Expand Up @@ -1339,7 +1340,7 @@ int drm_infobufs(struct inode *inode, struct file *filp,
{
struct drm_file *priv = filp->private_data;
struct drm_device *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
struct drm_buf_info request;
struct drm_buf_info __user *argp = (void __user *)arg;
int i;
Expand Down Expand Up @@ -1374,8 +1375,8 @@ int drm_infobufs(struct inode *inode, struct file *filp,
if (dma->bufs[i].buf_count) {
struct drm_buf_desc __user *to =
&request.list[count];
drm_buf_entry_t *from = &dma->bufs[i];
drm_freelist_t *list = &dma->bufs[i].freelist;
struct drm_buf_entry *from = &dma->bufs[i];
struct drm_freelist *list = &dma->bufs[i].freelist;
if (copy_to_user(&to->count,
&from->buf_count,
sizeof(from->buf_count)) ||
Expand Down Expand Up @@ -1427,10 +1428,10 @@ int drm_markbufs(struct inode *inode, struct file *filp,
{
struct drm_file *priv = filp->private_data;
struct drm_device *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
struct drm_buf_desc request;
int order;
drm_buf_entry_t *entry;
struct drm_buf_entry *entry;

if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
return -EINVAL;
Expand Down Expand Up @@ -1477,7 +1478,7 @@ int drm_freebufs(struct inode *inode, struct file *filp,
{
struct drm_file *priv = filp->private_data;
struct drm_device *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
struct drm_buf_free request;
int i;
int idx;
Expand Down Expand Up @@ -1533,7 +1534,7 @@ int drm_mapbufs(struct inode *inode, struct file *filp,
{
struct drm_file *priv = filp->private_data;
struct drm_device *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
struct drm_buf_map __user *argp = (void __user *)arg;
int retcode = 0;
const int zero = 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/char/drm/drm_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int drm_dma_setup(struct drm_device *dev)
*/
void drm_dma_takedown(struct drm_device *dev)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int i, j;

if (!dma)
Expand Down Expand Up @@ -154,7 +154,7 @@ void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf)
*/
void drm_core_reclaim_buffers(struct drm_device *dev, struct file *filp)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int i;

if (!dma)
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/char/drm/drm_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static int drm__queues_info(char *buf, char **start, off_t offset,
struct drm_device *dev = (struct drm_device *) data;
int len = 0;
int i;
drm_queue_t *q;
struct drm_queue *q;

if (offset > DRM_PROC_LIMIT) {
*eof = 1;
Expand Down Expand Up @@ -359,7 +359,7 @@ static int drm__bufs_info(char *buf, char **start, off_t offset, int request,
{
struct drm_device *dev = (struct drm_device *) data;
int len = 0;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int i;

if (!dma || offset > DRM_PROC_LIMIT) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/char/drm/drm_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static __inline__ struct page *drm_do_vm_dma_nopage(struct vm_area_struct *vma,
{
struct drm_file *priv = vma->vm_file->private_data;
struct drm_device *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
unsigned long offset;
unsigned long page_nr;
struct page *page;
Expand Down Expand Up @@ -474,7 +474,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
{
struct drm_file *priv = filp->private_data;
struct drm_device *dev;
drm_device_dma_t *dma;
struct drm_device_dma *dma;
unsigned long length = vma->vm_end - vma->vm_start;

dev = priv->head->dev;
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/char/drm/i810_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

static struct drm_buf *i810_freelist_get(struct drm_device * dev)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int i;
int used;

Expand Down Expand Up @@ -204,7 +204,7 @@ static int i810_dma_get_buffer(struct drm_device * dev, drm_i810_dma_t * d,

static int i810_dma_cleanup(struct drm_device * dev)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;

/* Make sure interrupts are disabled here because the uninstall ioctl
* may not have been called from userspace and after dev_private
Expand Down Expand Up @@ -290,7 +290,7 @@ static void i810_kernel_lost_context(struct drm_device * dev)

static int i810_freelist_init(struct drm_device * dev, drm_i810_private_t * dev_priv)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int my_idx = 24;
u32 *hw_status = (u32 *) (dev_priv->hw_status_page + my_idx);
int i;
Expand Down Expand Up @@ -936,7 +936,7 @@ static void i810_dma_quiescent(struct drm_device * dev)
static int i810_flush_queue(struct drm_device * dev)
{
drm_i810_private_t *dev_priv = dev->dev_private;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int i, ret = 0;
RING_LOCALS;

Expand Down Expand Up @@ -970,7 +970,7 @@ static int i810_flush_queue(struct drm_device * dev)
/* Must be called with the lock held */
static void i810_reclaim_buffers(struct drm_device * dev, struct file *filp)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int i;

if (!dma)
Expand Down Expand Up @@ -1015,7 +1015,7 @@ static int i810_dma_vertex(struct inode *inode, struct file *filp,
{
struct drm_file *priv = filp->private_data;
struct drm_device *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
drm_i810_private_t *dev_priv = (drm_i810_private_t *) dev->dev_private;
u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
Expand Down Expand Up @@ -1207,7 +1207,7 @@ static int i810_dma_mc(struct inode *inode, struct file *filp,
{
struct drm_file *priv = filp->private_data;
struct drm_device *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
drm_i810_private_t *dev_priv = (drm_i810_private_t *) dev->dev_private;
u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/char/drm/i830_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

static struct drm_buf *i830_freelist_get(struct drm_device * dev)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int i;
int used;

Expand Down Expand Up @@ -208,7 +208,7 @@ static int i830_dma_get_buffer(struct drm_device * dev, drm_i830_dma_t * d,

static int i830_dma_cleanup(struct drm_device * dev)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;

/* Make sure interrupts are disabled here because the uninstall ioctl
* may not have been called from userspace and after dev_private
Expand Down Expand Up @@ -298,7 +298,7 @@ static void i830_kernel_lost_context(struct drm_device * dev)

static int i830_freelist_init(struct drm_device * dev, drm_i830_private_t * dev_priv)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int my_idx = 36;
u32 *hw_status = (u32 *) (dev_priv->hw_status_page + my_idx);
int i;
Expand Down Expand Up @@ -1218,7 +1218,7 @@ static void i830_dma_quiescent(struct drm_device * dev)
static int i830_flush_queue(struct drm_device * dev)
{
drm_i830_private_t *dev_priv = dev->dev_private;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int i, ret = 0;
RING_LOCALS;

Expand Down Expand Up @@ -1250,7 +1250,7 @@ static int i830_flush_queue(struct drm_device * dev)
/* Must be called with the lock held */
static void i830_reclaim_buffers(struct drm_device * dev, struct file *filp)
{
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
int i;

if (!dma)
Expand Down Expand Up @@ -1295,7 +1295,7 @@ static int i830_dma_vertex(struct inode *inode, struct file *filp,
{
struct drm_file *priv = filp->private_data;
struct drm_device *dev = priv->head->dev;
drm_device_dma_t *dma = dev->dma;
struct drm_device_dma *dma = dev->dma;
drm_i830_private_t *dev_priv = (drm_i830_private_t *) dev->dev_private;
u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
Expand Down
Loading

0 comments on commit dec37df

Please sign in to comment.