DA: loads of whitespace .. some from Linus, some from me
parent
428cbe0b91
commit
a073ff7dc7
|
@ -62,7 +62,7 @@ static inline void i810_print_status_page(drm_device_t *dev)
|
||||||
{
|
{
|
||||||
drm_device_dma_t *dma = dev->dma;
|
drm_device_dma_t *dma = dev->dma;
|
||||||
drm_i810_private_t *dev_priv = dev->dev_private;
|
drm_i810_private_t *dev_priv = dev->dev_private;
|
||||||
u32 *temp = (u32 *)dev_priv->hw_status_page;
|
u32 *temp = dev_priv->hw_status_page;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
|
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
|
||||||
|
@ -161,7 +161,8 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
|
||||||
struct file_operations *old_fops;
|
struct file_operations *old_fops;
|
||||||
int retcode = 0;
|
int retcode = 0;
|
||||||
|
|
||||||
if(buf_priv->currently_mapped == I810_BUF_MAPPED) return -EINVAL;
|
if (buf_priv->currently_mapped == I810_BUF_MAPPED)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
down_write( ¤t->mm->mmap_sem );
|
down_write( ¤t->mm->mmap_sem );
|
||||||
old_fops = filp->f_op;
|
old_fops = filp->f_op;
|
||||||
|
@ -503,9 +504,8 @@ int i810_dma_init(struct inode *inode, struct file *filp,
|
||||||
int retcode = 0;
|
int retcode = 0;
|
||||||
|
|
||||||
/* Get only the init func */
|
/* Get only the init func */
|
||||||
if (copy_from_user(&init, (void *)arg, sizeof(drm_i810_init_func_t))) {
|
if (copy_from_user(&init, (void *)arg, sizeof(drm_i810_init_func_t)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
|
||||||
|
|
||||||
switch(init.func) {
|
switch(init.func) {
|
||||||
case I810_INIT_DMA:
|
case I810_INIT_DMA:
|
||||||
|
@ -515,14 +515,16 @@ int i810_dma_init(struct inode *inode, struct file *filp,
|
||||||
* It will someday go away.
|
* It will someday go away.
|
||||||
*/
|
*/
|
||||||
retcode = i810_dma_init_compat(&init, arg);
|
retcode = i810_dma_init_compat(&init, arg);
|
||||||
if(retcode) {
|
if (retcode)
|
||||||
return retcode;
|
return retcode;
|
||||||
}
|
|
||||||
dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
|
dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
|
||||||
DRM_MEM_DRIVER);
|
DRM_MEM_DRIVER);
|
||||||
if(dev_priv == NULL) return -ENOMEM;
|
if (dev_priv == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
retcode = i810_dma_initialize(dev, dev_priv, &init);
|
retcode = i810_dma_initialize(dev, dev_priv, &init);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case I810_INIT_DMA_1_4:
|
case I810_INIT_DMA_1_4:
|
||||||
DRM_INFO("Using v1.4 init.\n");
|
DRM_INFO("Using v1.4 init.\n");
|
||||||
|
@ -532,9 +534,11 @@ int i810_dma_init(struct inode *inode, struct file *filp,
|
||||||
}
|
}
|
||||||
dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
|
dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
|
||||||
DRM_MEM_DRIVER);
|
DRM_MEM_DRIVER);
|
||||||
if(dev_priv == NULL) return -ENOMEM;
|
if (dev_priv == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
retcode = i810_dma_initialize(dev, dev_priv, &init);
|
retcode = i810_dma_initialize(dev, dev_priv, &init);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case I810_CLEANUP_DMA:
|
case I810_CLEANUP_DMA:
|
||||||
DRM_INFO("DMA Cleanup\n");
|
DRM_INFO("DMA Cleanup\n");
|
||||||
retcode = i810_dma_cleanup(dev);
|
retcode = i810_dma_cleanup(dev);
|
||||||
|
@ -1052,7 +1056,7 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
|
||||||
drm_device_t *dev = priv->dev;
|
drm_device_t *dev = priv->dev;
|
||||||
drm_device_dma_t *dma = dev->dma;
|
drm_device_dma_t *dma = dev->dma;
|
||||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
u32 *hw_status = dev_priv->hw_status_page;
|
||||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||||
dev_priv->sarea_priv;
|
dev_priv->sarea_priv;
|
||||||
drm_i810_vertex_t vertex;
|
drm_i810_vertex_t vertex;
|
||||||
|
@ -1068,7 +1072,8 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
|
||||||
DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n",
|
DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n",
|
||||||
vertex.idx, vertex.used, vertex.discard);
|
vertex.idx, vertex.used, vertex.discard);
|
||||||
|
|
||||||
if(vertex.idx < 0 || vertex.idx > dma->buf_count) return -EINVAL;
|
if (vertex.idx < 0 || vertex.idx > dma->buf_count)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
i810_dma_dispatch_vertex( dev,
|
i810_dma_dispatch_vertex( dev,
|
||||||
dma->buflist[ vertex.idx ],
|
dma->buflist[ vertex.idx ],
|
||||||
|
@ -1133,7 +1138,7 @@ int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
drm_file_t *priv = filp->private_data;
|
drm_file_t *priv = filp->private_data;
|
||||||
drm_device_t *dev = priv->dev;
|
drm_device_t *dev = priv->dev;
|
||||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
u32 *hw_status = dev_priv->hw_status_page;
|
||||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||||
dev_priv->sarea_priv;
|
dev_priv->sarea_priv;
|
||||||
|
|
||||||
|
@ -1149,7 +1154,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
int retcode = 0;
|
int retcode = 0;
|
||||||
drm_i810_dma_t d;
|
drm_i810_dma_t d;
|
||||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
u32 *hw_status = dev_priv->hw_status_page;
|
||||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||||
dev_priv->sarea_priv;
|
dev_priv->sarea_priv;
|
||||||
|
|
||||||
|
@ -1261,7 +1266,7 @@ int i810_dma_mc(struct inode *inode, struct file *filp,
|
||||||
drm_device_t *dev = priv->dev;
|
drm_device_t *dev = priv->dev;
|
||||||
drm_device_dma_t *dma = dev->dma;
|
drm_device_dma_t *dma = dev->dma;
|
||||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
u32 *hw_status = dev_priv->hw_status_page;
|
||||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||||
dev_priv->sarea_priv;
|
dev_priv->sarea_priv;
|
||||||
drm_i810_mc_t mc;
|
drm_i810_mc_t mc;
|
||||||
|
|
|
@ -62,7 +62,7 @@ static inline void i810_print_status_page(drm_device_t *dev)
|
||||||
{
|
{
|
||||||
drm_device_dma_t *dma = dev->dma;
|
drm_device_dma_t *dma = dev->dma;
|
||||||
drm_i810_private_t *dev_priv = dev->dev_private;
|
drm_i810_private_t *dev_priv = dev->dev_private;
|
||||||
u32 *temp = (u32 *)dev_priv->hw_status_page;
|
u32 *temp = dev_priv->hw_status_page;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
|
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
|
||||||
|
@ -161,7 +161,8 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
|
||||||
struct file_operations *old_fops;
|
struct file_operations *old_fops;
|
||||||
int retcode = 0;
|
int retcode = 0;
|
||||||
|
|
||||||
if(buf_priv->currently_mapped == I810_BUF_MAPPED) return -EINVAL;
|
if (buf_priv->currently_mapped == I810_BUF_MAPPED)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
down_write( ¤t->mm->mmap_sem );
|
down_write( ¤t->mm->mmap_sem );
|
||||||
old_fops = filp->f_op;
|
old_fops = filp->f_op;
|
||||||
|
@ -503,9 +504,8 @@ int i810_dma_init(struct inode *inode, struct file *filp,
|
||||||
int retcode = 0;
|
int retcode = 0;
|
||||||
|
|
||||||
/* Get only the init func */
|
/* Get only the init func */
|
||||||
if (copy_from_user(&init, (void *)arg, sizeof(drm_i810_init_func_t))) {
|
if (copy_from_user(&init, (void *)arg, sizeof(drm_i810_init_func_t)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
|
||||||
|
|
||||||
switch(init.func) {
|
switch(init.func) {
|
||||||
case I810_INIT_DMA:
|
case I810_INIT_DMA:
|
||||||
|
@ -515,14 +515,16 @@ int i810_dma_init(struct inode *inode, struct file *filp,
|
||||||
* It will someday go away.
|
* It will someday go away.
|
||||||
*/
|
*/
|
||||||
retcode = i810_dma_init_compat(&init, arg);
|
retcode = i810_dma_init_compat(&init, arg);
|
||||||
if(retcode) {
|
if (retcode)
|
||||||
return retcode;
|
return retcode;
|
||||||
}
|
|
||||||
dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
|
dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
|
||||||
DRM_MEM_DRIVER);
|
DRM_MEM_DRIVER);
|
||||||
if(dev_priv == NULL) return -ENOMEM;
|
if (dev_priv == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
retcode = i810_dma_initialize(dev, dev_priv, &init);
|
retcode = i810_dma_initialize(dev, dev_priv, &init);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
case I810_INIT_DMA_1_4:
|
case I810_INIT_DMA_1_4:
|
||||||
DRM_INFO("Using v1.4 init.\n");
|
DRM_INFO("Using v1.4 init.\n");
|
||||||
|
@ -532,9 +534,11 @@ int i810_dma_init(struct inode *inode, struct file *filp,
|
||||||
}
|
}
|
||||||
dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
|
dev_priv = DRM(alloc)(sizeof(drm_i810_private_t),
|
||||||
DRM_MEM_DRIVER);
|
DRM_MEM_DRIVER);
|
||||||
if(dev_priv == NULL) return -ENOMEM;
|
if (dev_priv == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
retcode = i810_dma_initialize(dev, dev_priv, &init);
|
retcode = i810_dma_initialize(dev, dev_priv, &init);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case I810_CLEANUP_DMA:
|
case I810_CLEANUP_DMA:
|
||||||
DRM_INFO("DMA Cleanup\n");
|
DRM_INFO("DMA Cleanup\n");
|
||||||
retcode = i810_dma_cleanup(dev);
|
retcode = i810_dma_cleanup(dev);
|
||||||
|
@ -1052,7 +1056,7 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
|
||||||
drm_device_t *dev = priv->dev;
|
drm_device_t *dev = priv->dev;
|
||||||
drm_device_dma_t *dma = dev->dma;
|
drm_device_dma_t *dma = dev->dma;
|
||||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
u32 *hw_status = dev_priv->hw_status_page;
|
||||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||||
dev_priv->sarea_priv;
|
dev_priv->sarea_priv;
|
||||||
drm_i810_vertex_t vertex;
|
drm_i810_vertex_t vertex;
|
||||||
|
@ -1068,7 +1072,8 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
|
||||||
DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n",
|
DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n",
|
||||||
vertex.idx, vertex.used, vertex.discard);
|
vertex.idx, vertex.used, vertex.discard);
|
||||||
|
|
||||||
if(vertex.idx < 0 || vertex.idx > dma->buf_count) return -EINVAL;
|
if (vertex.idx < 0 || vertex.idx > dma->buf_count)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
i810_dma_dispatch_vertex( dev,
|
i810_dma_dispatch_vertex( dev,
|
||||||
dma->buflist[ vertex.idx ],
|
dma->buflist[ vertex.idx ],
|
||||||
|
@ -1133,7 +1138,7 @@ int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
drm_file_t *priv = filp->private_data;
|
drm_file_t *priv = filp->private_data;
|
||||||
drm_device_t *dev = priv->dev;
|
drm_device_t *dev = priv->dev;
|
||||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
u32 *hw_status = dev_priv->hw_status_page;
|
||||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||||
dev_priv->sarea_priv;
|
dev_priv->sarea_priv;
|
||||||
|
|
||||||
|
@ -1149,7 +1154,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
int retcode = 0;
|
int retcode = 0;
|
||||||
drm_i810_dma_t d;
|
drm_i810_dma_t d;
|
||||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
u32 *hw_status = dev_priv->hw_status_page;
|
||||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||||
dev_priv->sarea_priv;
|
dev_priv->sarea_priv;
|
||||||
|
|
||||||
|
@ -1261,7 +1266,7 @@ int i810_dma_mc(struct inode *inode, struct file *filp,
|
||||||
drm_device_t *dev = priv->dev;
|
drm_device_t *dev = priv->dev;
|
||||||
drm_device_dma_t *dma = dev->dma;
|
drm_device_dma_t *dma = dev->dma;
|
||||||
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
|
||||||
u32 *hw_status = (u32 *)dev_priv->hw_status_page;
|
u32 *hw_status = dev_priv->hw_status_page;
|
||||||
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
|
||||||
dev_priv->sarea_priv;
|
dev_priv->sarea_priv;
|
||||||
drm_i810_mc_t mc;
|
drm_i810_mc_t mc;
|
||||||
|
|
Loading…
Reference in New Issue