diff options
Diffstat (limited to 'drivers/char/drm/i915_irq.c')
-rw-r--r-- | drivers/char/drm/i915_irq.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c index bb8e9e9c8201..470e7aa81558 100644 --- a/drivers/char/drm/i915_irq.c +++ b/drivers/char/drm/i915_irq.c | |||
@@ -311,7 +311,7 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr) | |||
311 | DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ, | 311 | DRM_WAIT_ON(ret, dev_priv->irq_queue, 3 * DRM_HZ, |
312 | READ_BREADCRUMB(dev_priv) >= irq_nr); | 312 | READ_BREADCRUMB(dev_priv) >= irq_nr); |
313 | 313 | ||
314 | if (ret == DRM_ERR(EBUSY)) { | 314 | if (ret == -EBUSY) { |
315 | DRM_ERROR("%s: EBUSY -- rec: %d emitted: %d\n", | 315 | DRM_ERROR("%s: EBUSY -- rec: %d emitted: %d\n", |
316 | __FUNCTION__, | 316 | __FUNCTION__, |
317 | READ_BREADCRUMB(dev_priv), (int)dev_priv->counter); | 317 | READ_BREADCRUMB(dev_priv), (int)dev_priv->counter); |
@@ -330,7 +330,7 @@ static int i915_driver_vblank_do_wait(struct drm_device *dev, unsigned int *sequ | |||
330 | 330 | ||
331 | if (!dev_priv) { | 331 | if (!dev_priv) { |
332 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); | 332 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); |
333 | return DRM_ERR(EINVAL); | 333 | return -EINVAL; |
334 | } | 334 | } |
335 | 335 | ||
336 | DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ, | 336 | DRM_WAIT_ON(ret, dev->vbl_queue, 3 * DRM_HZ, |
@@ -366,7 +366,7 @@ int i915_irq_emit(DRM_IOCTL_ARGS) | |||
366 | 366 | ||
367 | if (!dev_priv) { | 367 | if (!dev_priv) { |
368 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); | 368 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); |
369 | return DRM_ERR(EINVAL); | 369 | return -EINVAL; |
370 | } | 370 | } |
371 | 371 | ||
372 | DRM_COPY_FROM_USER_IOCTL(emit, (drm_i915_irq_emit_t __user *) data, | 372 | DRM_COPY_FROM_USER_IOCTL(emit, (drm_i915_irq_emit_t __user *) data, |
@@ -376,7 +376,7 @@ int i915_irq_emit(DRM_IOCTL_ARGS) | |||
376 | 376 | ||
377 | if (DRM_COPY_TO_USER(emit.irq_seq, &result, sizeof(int))) { | 377 | if (DRM_COPY_TO_USER(emit.irq_seq, &result, sizeof(int))) { |
378 | DRM_ERROR("copy_to_user\n"); | 378 | DRM_ERROR("copy_to_user\n"); |
379 | return DRM_ERR(EFAULT); | 379 | return -EFAULT; |
380 | } | 380 | } |
381 | 381 | ||
382 | return 0; | 382 | return 0; |
@@ -392,7 +392,7 @@ int i915_irq_wait(DRM_IOCTL_ARGS) | |||
392 | 392 | ||
393 | if (!dev_priv) { | 393 | if (!dev_priv) { |
394 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); | 394 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); |
395 | return DRM_ERR(EINVAL); | 395 | return -EINVAL; |
396 | } | 396 | } |
397 | 397 | ||
398 | DRM_COPY_FROM_USER_IOCTL(irqwait, (drm_i915_irq_wait_t __user *) data, | 398 | DRM_COPY_FROM_USER_IOCTL(irqwait, (drm_i915_irq_wait_t __user *) data, |
@@ -425,7 +425,7 @@ int i915_vblank_pipe_set(DRM_IOCTL_ARGS) | |||
425 | 425 | ||
426 | if (!dev_priv) { | 426 | if (!dev_priv) { |
427 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); | 427 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); |
428 | return DRM_ERR(EINVAL); | 428 | return -EINVAL; |
429 | } | 429 | } |
430 | 430 | ||
431 | DRM_COPY_FROM_USER_IOCTL(pipe, (drm_i915_vblank_pipe_t __user *) data, | 431 | DRM_COPY_FROM_USER_IOCTL(pipe, (drm_i915_vblank_pipe_t __user *) data, |
@@ -434,7 +434,7 @@ int i915_vblank_pipe_set(DRM_IOCTL_ARGS) | |||
434 | if (pipe.pipe & ~(DRM_I915_VBLANK_PIPE_A|DRM_I915_VBLANK_PIPE_B)) { | 434 | if (pipe.pipe & ~(DRM_I915_VBLANK_PIPE_A|DRM_I915_VBLANK_PIPE_B)) { |
435 | DRM_ERROR("%s called with invalid pipe 0x%x\n", | 435 | DRM_ERROR("%s called with invalid pipe 0x%x\n", |
436 | __FUNCTION__, pipe.pipe); | 436 | __FUNCTION__, pipe.pipe); |
437 | return DRM_ERR(EINVAL); | 437 | return -EINVAL; |
438 | } | 438 | } |
439 | 439 | ||
440 | dev_priv->vblank_pipe = pipe.pipe; | 440 | dev_priv->vblank_pipe = pipe.pipe; |
@@ -453,7 +453,7 @@ int i915_vblank_pipe_get(DRM_IOCTL_ARGS) | |||
453 | 453 | ||
454 | if (!dev_priv) { | 454 | if (!dev_priv) { |
455 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); | 455 | DRM_ERROR("%s called with no initialization\n", __FUNCTION__); |
456 | return DRM_ERR(EINVAL); | 456 | return -EINVAL; |
457 | } | 457 | } |
458 | 458 | ||
459 | flag = I915_READ(I915REG_INT_ENABLE_R); | 459 | flag = I915_READ(I915REG_INT_ENABLE_R); |
@@ -482,12 +482,12 @@ int i915_vblank_swap(DRM_IOCTL_ARGS) | |||
482 | 482 | ||
483 | if (!dev_priv) { | 483 | if (!dev_priv) { |
484 | DRM_ERROR("%s called with no initialization\n", __func__); | 484 | DRM_ERROR("%s called with no initialization\n", __func__); |
485 | return DRM_ERR(EINVAL); | 485 | return -EINVAL; |
486 | } | 486 | } |
487 | 487 | ||
488 | if (dev_priv->sarea_priv->rotation) { | 488 | if (dev_priv->sarea_priv->rotation) { |
489 | DRM_DEBUG("Rotation not supported\n"); | 489 | DRM_DEBUG("Rotation not supported\n"); |
490 | return DRM_ERR(EINVAL); | 490 | return -EINVAL; |
491 | } | 491 | } |
492 | 492 | ||
493 | DRM_COPY_FROM_USER_IOCTL(swap, (drm_i915_vblank_swap_t __user *) data, | 493 | DRM_COPY_FROM_USER_IOCTL(swap, (drm_i915_vblank_swap_t __user *) data, |
@@ -496,7 +496,7 @@ int i915_vblank_swap(DRM_IOCTL_ARGS) | |||
496 | if (swap.seqtype & ~(_DRM_VBLANK_RELATIVE | _DRM_VBLANK_ABSOLUTE | | 496 | if (swap.seqtype & ~(_DRM_VBLANK_RELATIVE | _DRM_VBLANK_ABSOLUTE | |
497 | _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS)) { | 497 | _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS)) { |
498 | DRM_ERROR("Invalid sequence type 0x%x\n", swap.seqtype); | 498 | DRM_ERROR("Invalid sequence type 0x%x\n", swap.seqtype); |
499 | return DRM_ERR(EINVAL); | 499 | return -EINVAL; |
500 | } | 500 | } |
501 | 501 | ||
502 | pipe = (swap.seqtype & _DRM_VBLANK_SECONDARY) ? 1 : 0; | 502 | pipe = (swap.seqtype & _DRM_VBLANK_SECONDARY) ? 1 : 0; |
@@ -505,7 +505,7 @@ int i915_vblank_swap(DRM_IOCTL_ARGS) | |||
505 | 505 | ||
506 | if (!(dev_priv->vblank_pipe & (1 << pipe))) { | 506 | if (!(dev_priv->vblank_pipe & (1 << pipe))) { |
507 | DRM_ERROR("Invalid pipe %d\n", pipe); | 507 | DRM_ERROR("Invalid pipe %d\n", pipe); |
508 | return DRM_ERR(EINVAL); | 508 | return -EINVAL; |
509 | } | 509 | } |
510 | 510 | ||
511 | spin_lock_irqsave(&dev->drw_lock, irqflags); | 511 | spin_lock_irqsave(&dev->drw_lock, irqflags); |
@@ -513,7 +513,7 @@ int i915_vblank_swap(DRM_IOCTL_ARGS) | |||
513 | if (!drm_get_drawable_info(dev, swap.drawable)) { | 513 | if (!drm_get_drawable_info(dev, swap.drawable)) { |
514 | spin_unlock_irqrestore(&dev->drw_lock, irqflags); | 514 | spin_unlock_irqrestore(&dev->drw_lock, irqflags); |
515 | DRM_DEBUG("Invalid drawable ID %d\n", swap.drawable); | 515 | DRM_DEBUG("Invalid drawable ID %d\n", swap.drawable); |
516 | return DRM_ERR(EINVAL); | 516 | return -EINVAL; |
517 | } | 517 | } |
518 | 518 | ||
519 | spin_unlock_irqrestore(&dev->drw_lock, irqflags); | 519 | spin_unlock_irqrestore(&dev->drw_lock, irqflags); |
@@ -528,7 +528,7 @@ int i915_vblank_swap(DRM_IOCTL_ARGS) | |||
528 | swap.sequence = curseq + 1; | 528 | swap.sequence = curseq + 1; |
529 | } else { | 529 | } else { |
530 | DRM_DEBUG("Missed target sequence\n"); | 530 | DRM_DEBUG("Missed target sequence\n"); |
531 | return DRM_ERR(EINVAL); | 531 | return -EINVAL; |
532 | } | 532 | } |
533 | } | 533 | } |
534 | 534 | ||
@@ -550,14 +550,14 @@ int i915_vblank_swap(DRM_IOCTL_ARGS) | |||
550 | 550 | ||
551 | if (dev_priv->swaps_pending >= 100) { | 551 | if (dev_priv->swaps_pending >= 100) { |
552 | DRM_DEBUG("Too many swaps queued\n"); | 552 | DRM_DEBUG("Too many swaps queued\n"); |
553 | return DRM_ERR(EBUSY); | 553 | return -EBUSY; |
554 | } | 554 | } |
555 | 555 | ||
556 | vbl_swap = drm_calloc(1, sizeof(vbl_swap), DRM_MEM_DRIVER); | 556 | vbl_swap = drm_calloc(1, sizeof(vbl_swap), DRM_MEM_DRIVER); |
557 | 557 | ||
558 | if (!vbl_swap) { | 558 | if (!vbl_swap) { |
559 | DRM_ERROR("Failed to allocate memory to queue swap\n"); | 559 | DRM_ERROR("Failed to allocate memory to queue swap\n"); |
560 | return DRM_ERR(ENOMEM); | 560 | return -ENOMEM; |
561 | } | 561 | } |
562 | 562 | ||
563 | DRM_DEBUG("\n"); | 563 | DRM_DEBUG("\n"); |