mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-08 06:58:25 +02:00
drm: more cleanups
This commit is contained in:
parent
e9fa8fe734
commit
dc338921f9
5 changed files with 24 additions and 20 deletions
|
|
@ -522,7 +522,7 @@ static int drm_agp_populate(struct drm_ttm_backend *backend,
|
|||
mem = drm_agp_allocate_memory(agp_be->bridge, num_pages, AGP_USER_MEMORY);
|
||||
#endif
|
||||
if (!mem) {
|
||||
drm_free_memctl(num_pages * sizeof(void *));
|
||||
drm_free_memctl(num_pages *sizeof(void *));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -652,7 +652,7 @@ struct drm_ttm_backend *drm_agp_init_ttm(struct drm_device *dev)
|
|||
EXPORT_SYMBOL(drm_agp_init_ttm);
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
|
||||
void drm_agp_flush_chipset(struct drm_device *dev)
|
||||
void drm_agp_chipset_flush(struct drm_device *dev)
|
||||
{
|
||||
agp_flush_chipset(dev->agp->bridge);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,12 +98,14 @@ int drm_setunique(struct drm_device *dev, void *data,
|
|||
|
||||
dev->unique[dev->unique_len] = '\0';
|
||||
|
||||
dev->devname = drm_alloc(strlen(dev->driver->pci_driver.name) + strlen(dev->unique) + 2,
|
||||
DRM_MEM_DRIVER);
|
||||
dev->devname =
|
||||
drm_alloc(strlen(dev->driver->pci_driver.name) +
|
||||
strlen(dev->unique) + 2, DRM_MEM_DRIVER);
|
||||
if (!dev->devname)
|
||||
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
|
||||
* busid.
|
||||
|
|
@ -142,12 +144,14 @@ static int drm_set_busid(struct drm_device * dev)
|
|||
if (len > dev->unique_len)
|
||||
DRM_ERROR("buffer overflow");
|
||||
|
||||
dev->devname = drm_alloc(strlen(dev->driver->pci_driver.name) + dev->unique_len + 2,
|
||||
DRM_MEM_DRIVER);
|
||||
dev->devname =
|
||||
drm_alloc(strlen(dev->driver->pci_driver.name) + dev->unique_len +
|
||||
2, DRM_MEM_DRIVER);
|
||||
if (dev->devname == NULL)
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ void i915_flush_ttm(struct drm_ttm *ttm)
|
|||
return;
|
||||
|
||||
DRM_MEMORYBARRIER();
|
||||
for (i = ttm->num_pages-1; i >= 0; i--)
|
||||
for (i = ttm->num_pages - 1; i >= 0; i--)
|
||||
drm_cache_flush_page(drm_ttm_get_page(ttm, i));
|
||||
DRM_MEMORYBARRIER();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,9 +165,8 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init)
|
|||
* private backbuffer/depthbuffer usage.
|
||||
*/
|
||||
dev_priv->use_mi_batchbuffer_start = 0;
|
||||
if (IS_I965G(dev))
|
||||
if (IS_I965G(dev)) /* 965 doesn't support older method */
|
||||
dev_priv->use_mi_batchbuffer_start = 1;
|
||||
|
||||
|
||||
/* Allow hardware batchbuffers unless told otherwise.
|
||||
*/
|
||||
|
|
@ -339,7 +338,7 @@ static int validate_cmd(int cmd)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int i915_emit_cmds(struct drm_device * dev, int __user * buffer,
|
||||
static int i915_emit_cmds(struct drm_device *dev, int __user *buffer,
|
||||
int dwords)
|
||||
{
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
|
|
@ -495,7 +494,7 @@ static int i915_dispatch_cmdbuffer(struct drm_device * dev,
|
|||
return ret;
|
||||
}
|
||||
|
||||
i915_emit_breadcrumb( dev );
|
||||
i915_emit_breadcrumb(dev);
|
||||
#ifdef I915_HAVE_FENCE
|
||||
drm_fence_flush_old(dev, 0, dev_priv->counter);
|
||||
#endif
|
||||
|
|
@ -549,7 +548,7 @@ static int i915_dispatch_batchbuffer(struct drm_device * dev,
|
|||
}
|
||||
}
|
||||
|
||||
i915_emit_breadcrumb( dev );
|
||||
i915_emit_breadcrumb(dev);
|
||||
#ifdef I915_HAVE_FENCE
|
||||
drm_fence_flush_old(dev, 0, dev_priv->counter);
|
||||
#endif
|
||||
|
|
@ -630,7 +629,7 @@ void i915_dispatch_flip(struct drm_device * dev, int planes, int sync)
|
|||
#endif
|
||||
}
|
||||
|
||||
static int i915_quiescent(struct drm_device * dev)
|
||||
static int i915_quiescent(struct drm_device *dev)
|
||||
{
|
||||
drm_i915_private_t *dev_priv = dev->dev_private;
|
||||
|
||||
|
|
@ -1035,10 +1034,10 @@ static int i915_execbuffer(struct drm_device *dev, void *data,
|
|||
|
||||
buffers = drm_calloc(num_buffers, sizeof(struct drm_buffer_object *), DRM_MEM_DRIVER);
|
||||
if (!buffers) {
|
||||
drm_bo_read_unlock(&dev->bm.bm_lock);
|
||||
drm_bo_read_unlock(&dev->bm.bm_lock);
|
||||
mutex_unlock(&dev_priv->cmdbuf_mutex);
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
/* validate buffer list + fixup relocations */
|
||||
ret = i915_validate_buffer_list(file_priv, 0, exec_buf->ops_list,
|
||||
|
|
@ -1247,9 +1246,9 @@ static int i915_mmio(struct drm_device *dev, void *data,
|
|||
case I915_MMIO_WRITE:
|
||||
if (!(e->flag & I915_MMIO_MAY_WRITE))
|
||||
return -EINVAL;
|
||||
if(DRM_COPY_FROM_USER(buf, mmio->data, e->size)) {
|
||||
if (DRM_COPY_FROM_USER(buf, mmio->data, e->size)) {
|
||||
DRM_ERROR("DRM_COPY_TO_USER failed\n");
|
||||
return -EFAULT;
|
||||
return -EFAULT;
|
||||
}
|
||||
for (i = 0; i < e->size / 4; i++)
|
||||
I915_WRITE(e->offset + i * 4, buf[i]);
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ typedef struct _drm_i915_sarea {
|
|||
#define DRM_IOCTL_I915_SET_VBLANK_PIPE DRM_IOW( DRM_COMMAND_BASE + DRM_I915_SET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
|
||||
#define DRM_IOCTL_I915_GET_VBLANK_PIPE DRM_IOR( DRM_COMMAND_BASE + DRM_I915_GET_VBLANK_PIPE, drm_i915_vblank_pipe_t)
|
||||
#define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t)
|
||||
#define DRM_IOCTL_I915_MMIO DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_MMIO, drm_i915_mmio)
|
||||
#define DRM_IOCTL_I915_EXECBUFFER DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_EXECBUFFER, struct drm_i915_execbuffer)
|
||||
|
||||
/* Asynchronous page flipping:
|
||||
|
|
@ -274,7 +275,7 @@ typedef struct drm_i915_mem_init_heap {
|
|||
* rotate):
|
||||
*/
|
||||
typedef struct drm_i915_mem_destroy_heap {
|
||||
int region;
|
||||
int region;
|
||||
} drm_i915_mem_destroy_heap_t;
|
||||
|
||||
/* Allow X server to configure which pipes to monitor for vblank signals
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue