Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68786
b: refs/heads/master
c: 20caafa
h: refs/heads/master
v: v3
  • Loading branch information
Eric Anholt authored and Dave Airlie committed Oct 15, 2007
1 parent 10f74df commit 0f790ca
Show file tree
Hide file tree
Showing 52 changed files with 866 additions and 826 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: 37ca506adc395a028cd12760eca419dd0dc14b5c
refs/heads/master: 20caafa6ecb2487d9b223aa33e7cc704f912a758
1 change: 1 addition & 0 deletions trunk/arch/powerpc/platforms/ps3/system-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ static void ps3_system_bus_shutdown(struct device *_dev)
static int ps3_system_bus_uevent(struct device *_dev, struct kobj_uevent_env *env)
{
struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
int i = 0, length = 0;

if (add_uevent_var(env, "MODALIAS=ps3:%d", dev->match_id))
return -ENOMEM;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/char/drm/drm_drawable.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS)

if (update.num && !rects) {
DRM_ERROR("Failed to allocate cliprect memory\n");
err = DRM_ERR(ENOMEM);
err = -ENOMEM;
goto error;
}

Expand All @@ -140,7 +140,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS)
update.num *
sizeof(*rects))) {
DRM_ERROR("Failed to copy cliprects from userspace\n");
err = DRM_ERR(EFAULT);
err = -EFAULT;
goto error;
}

Expand All @@ -161,7 +161,7 @@ int drm_update_drawable_info(DRM_IOCTL_ARGS)
break;
default:
DRM_ERROR("Invalid update type %d\n", update.type);
return DRM_ERR(EINVAL);
return -EINVAL;
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/drm/drm_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int drm_setunique(struct inode *inode, struct file *filp,
*/
ret = sscanf(dev->unique, "PCI:%d:%d:%d", &bus, &slot, &func);
if (ret != 3)
return DRM_ERR(EINVAL);
return -EINVAL;
domain = bus >> 8;
bus &= 0xff;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/drm/drm_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ int drm_lock(struct inode *inode, struct file *filp,
if (dev->driver->dma_quiescent && (lock.flags & _DRM_LOCK_QUIESCENT)) {
if (dev->driver->dma_quiescent(dev)) {
DRM_DEBUG("%d waiting for DMA quiescent\n", lock.context);
return DRM_ERR(EBUSY);
return -EBUSY;
}
}

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/char/drm/drm_os_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define DRMFILE struct file *
/** Ioctl arguments */
#define DRM_IOCTL_ARGS struct inode *inode, struct file *filp, unsigned int cmd, unsigned long data
#define DRM_ERR(d) -(d)
/** Current process ID */
#define DRM_CURRENTPID current->pid
#define DRM_SUSER(p) capable(CAP_SYS_ADMIN)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/drm/i810_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static int i810_dma_initialize(struct drm_device * dev,
i810_dma_cleanup(dev);
DRM_ERROR("can not ioremap virtual address for"
" ring buffer\n");
return DRM_ERR(ENOMEM);
return -ENOMEM;
}

dev_priv->ring.virtual_start = dev_priv->ring.map.handle;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/drm/i830_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static int i830_dma_initialize(struct drm_device * dev,
i830_dma_cleanup(dev);
DRM_ERROR("can not ioremap virtual address for"
" ring buffer\n");
return DRM_ERR(ENOMEM);
return -ENOMEM;
}

dev_priv->ring.virtual_start = dev_priv->ring.map.handle;
Expand Down
58 changes: 29 additions & 29 deletions trunk/drivers/char/drm/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int i915_wait_ring(struct drm_device * dev, int n, const char *caller)
last_head = ring->head;
}

return DRM_ERR(EBUSY);
return -EBUSY;
}

void i915_kernel_lost_context(struct drm_device * dev)
Expand Down Expand Up @@ -137,15 +137,15 @@ static int i915_initialize(struct drm_device * dev,
DRM_ERROR("can not find sarea!\n");
dev->dev_private = (void *)dev_priv;
i915_dma_cleanup(dev);
return DRM_ERR(EINVAL);
return -EINVAL;
}

dev_priv->mmio_map = drm_core_findmap(dev, init->mmio_offset);
if (!dev_priv->mmio_map) {
dev->dev_private = (void *)dev_priv;
i915_dma_cleanup(dev);
DRM_ERROR("can not find mmio map!\n");
return DRM_ERR(EINVAL);
return -EINVAL;
}

dev_priv->sarea_priv = (drm_i915_sarea_t *)
Expand All @@ -169,7 +169,7 @@ static int i915_initialize(struct drm_device * dev,
i915_dma_cleanup(dev);
DRM_ERROR("can not ioremap virtual address for"
" ring buffer\n");
return DRM_ERR(ENOMEM);
return -ENOMEM;
}

dev_priv->ring.virtual_start = dev_priv->ring.map.handle;
Expand Down Expand Up @@ -200,7 +200,7 @@ static int i915_initialize(struct drm_device * dev,
dev->dev_private = (void *)dev_priv;
i915_dma_cleanup(dev);
DRM_ERROR("Can not allocate hardware status page\n");
return DRM_ERR(ENOMEM);
return -ENOMEM;
}
dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr;
dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr;
Expand All @@ -221,24 +221,24 @@ static int i915_dma_resume(struct drm_device * dev)

if (!dev_priv->sarea) {
DRM_ERROR("can not find sarea!\n");
return DRM_ERR(EINVAL);
return -EINVAL;
}

if (!dev_priv->mmio_map) {
DRM_ERROR("can not find mmio map!\n");
return DRM_ERR(EINVAL);
return -EINVAL;
}

if (dev_priv->ring.map.handle == NULL) {
DRM_ERROR("can not ioremap virtual address for"
" ring buffer\n");
return DRM_ERR(ENOMEM);
return -ENOMEM;
}

/* Program Hardware Status Page */
if (!dev_priv->hw_status_page) {
DRM_ERROR("Can not find hardware status page\n");
return DRM_ERR(EINVAL);
return -EINVAL;
}
DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);

Expand Down Expand Up @@ -266,7 +266,7 @@ static int i915_dma_init(DRM_IOCTL_ARGS)
dev_priv = drm_alloc(sizeof(drm_i915_private_t),
DRM_MEM_DRIVER);
if (dev_priv == NULL)
return DRM_ERR(ENOMEM);
return -ENOMEM;
retcode = i915_initialize(dev, dev_priv, &init);
break;
case I915_CLEANUP_DMA:
Expand All @@ -276,7 +276,7 @@ static int i915_dma_init(DRM_IOCTL_ARGS)
retcode = i915_dma_resume(dev);
break;
default:
retcode = DRM_ERR(EINVAL);
retcode = -EINVAL;
break;
}

Expand Down Expand Up @@ -366,25 +366,25 @@ static int i915_emit_cmds(struct drm_device * dev, int __user * buffer, int dwor
RING_LOCALS;

if ((dwords+1) * sizeof(int) >= dev_priv->ring.Size - 8)
return DRM_ERR(EINVAL);
return -EINVAL;

BEGIN_LP_RING((dwords+1)&~1);

for (i = 0; i < dwords;) {
int cmd, sz;

if (DRM_COPY_FROM_USER_UNCHECKED(&cmd, &buffer[i], sizeof(cmd)))
return DRM_ERR(EINVAL);
return -EINVAL;

if ((sz = validate_cmd(cmd)) == 0 || i + sz > dwords)
return DRM_ERR(EINVAL);
return -EINVAL;

OUT_RING(cmd);

while (++i, --sz) {
if (DRM_COPY_FROM_USER_UNCHECKED(&cmd, &buffer[i],
sizeof(cmd))) {
return DRM_ERR(EINVAL);
return -EINVAL;
}
OUT_RING(cmd);
}
Expand All @@ -407,13 +407,13 @@ static int i915_emit_box(struct drm_device * dev,
RING_LOCALS;

if (DRM_COPY_FROM_USER_UNCHECKED(&box, &boxes[i], sizeof(box))) {
return DRM_ERR(EFAULT);
return -EFAULT;
}

if (box.y2 <= box.y1 || box.x2 <= box.x1 || box.y2 <= 0 || box.x2 <= 0) {
DRM_ERROR("Bad box %d,%d..%d,%d\n",
box.x1, box.y1, box.x2, box.y2);
return DRM_ERR(EINVAL);
return -EINVAL;
}

if (IS_I965G(dev)) {
Expand Down Expand Up @@ -467,7 +467,7 @@ static int i915_dispatch_cmdbuffer(struct drm_device * dev,

if (cmd->sz & 0x3) {
DRM_ERROR("alignment");
return DRM_ERR(EINVAL);
return -EINVAL;
}

i915_kernel_lost_context(dev);
Expand Down Expand Up @@ -502,7 +502,7 @@ static int i915_dispatch_batchbuffer(struct drm_device * dev,

if ((batch->start | batch->used) & 0x7) {
DRM_ERROR("alignment");
return DRM_ERR(EINVAL);
return -EINVAL;
}

i915_kernel_lost_context(dev);
Expand Down Expand Up @@ -619,7 +619,7 @@ static int i915_batchbuffer(DRM_IOCTL_ARGS)

if (!dev_priv->allow_batchbuffer) {
DRM_ERROR("Batchbuffer ioctl disabled\n");
return DRM_ERR(EINVAL);
return -EINVAL;
}

DRM_COPY_FROM_USER_IOCTL(batch, (drm_i915_batchbuffer_t __user *) data,
Expand All @@ -633,7 +633,7 @@ static int i915_batchbuffer(DRM_IOCTL_ARGS)
if (batch.num_cliprects && DRM_VERIFYAREA_READ(batch.cliprects,
batch.num_cliprects *
sizeof(struct drm_clip_rect)))
return DRM_ERR(EFAULT);
return -EFAULT;

ret = i915_dispatch_batchbuffer(dev, &batch);

Expand Down Expand Up @@ -664,7 +664,7 @@ static int i915_cmdbuffer(DRM_IOCTL_ARGS)
cmdbuf.num_cliprects *
sizeof(struct drm_clip_rect))) {
DRM_ERROR("Fault accessing cliprects\n");
return DRM_ERR(EFAULT);
return -EFAULT;
}

ret = i915_dispatch_cmdbuffer(dev, &cmdbuf);
Expand Down Expand Up @@ -697,7 +697,7 @@ static int i915_getparam(DRM_IOCTL_ARGS)

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
return -EINVAL;
}

DRM_COPY_FROM_USER_IOCTL(param, (drm_i915_getparam_t __user *) data,
Expand All @@ -715,12 +715,12 @@ static int i915_getparam(DRM_IOCTL_ARGS)
break;
default:
DRM_ERROR("Unknown parameter %d\n", param.param);
return DRM_ERR(EINVAL);
return -EINVAL;
}

if (DRM_COPY_TO_USER(param.value, &value, sizeof(int))) {
DRM_ERROR("DRM_COPY_TO_USER failed\n");
return DRM_ERR(EFAULT);
return -EFAULT;
}

return 0;
Expand All @@ -734,7 +734,7 @@ static int i915_setparam(DRM_IOCTL_ARGS)

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
return -EINVAL;
}

DRM_COPY_FROM_USER_IOCTL(param, (drm_i915_setparam_t __user *) data,
Expand All @@ -753,7 +753,7 @@ static int i915_setparam(DRM_IOCTL_ARGS)
break;
default:
DRM_ERROR("unknown parameter %d\n", param.param);
return DRM_ERR(EINVAL);
return -EINVAL;
}

return 0;
Expand All @@ -767,7 +767,7 @@ static int i915_set_status_page(DRM_IOCTL_ARGS)

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
return -EINVAL;
}
DRM_COPY_FROM_USER_IOCTL(hws, (drm_i915_hws_addr_t __user *) data,
sizeof(hws));
Expand All @@ -788,7 +788,7 @@ static int i915_set_status_page(DRM_IOCTL_ARGS)
dev_priv->status_gfx_addr = 0;
DRM_ERROR("can not ioremap virtual address for"
" G33 hw status page\n");
return DRM_ERR(ENOMEM);
return -ENOMEM;
}
dev_priv->hw_status_page = dev_priv->hws_map.handle;

Expand Down
Loading

0 comments on commit 0f790ca

Please sign in to comment.