summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-04-06 10:56:38 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-04-06 10:56:38 +0000
commit417fce9f842e38a4da5b2b5924e087c4a6313eec (patch)
tree66a773f7fc9143e14f7cd46e086f06c6ca4b361b /sys/dev/pci/drm
parent744b7213f17c4e01bb79a5474d7948023d381327 (diff)
add/use some more errno remapping
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/drmP.h6
-rw-r--r--sys/dev/pci/drm/i915/i915_gem.c6
-rw-r--r--sys/dev/pci/drm/i915/intel_dp.c14
-rw-r--r--sys/dev/pci/drm/i915/intel_opregion.c4
-rw-r--r--sys/dev/pci/drm/radeon/atombios_dp.c12
5 files changed, 23 insertions, 19 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h
index fff2e33bf92..58bc89ad1a4 100644
--- a/sys/dev/pci/drm/drmP.h
+++ b/sys/dev/pci/drm/drmP.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: drmP.h,v 1.183 2015/04/06 09:23:19 jsg Exp $ */
+/* $OpenBSD: drmP.h,v 1.184 2015/04/06 10:56:37 jsg Exp $ */
/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
* Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
*/
@@ -136,6 +136,10 @@ typedef uint32_t __be32;
#define DIV_ROUND_CLOSEST(x, y) (((x) + ((y) / 2)) / (y))
#define ERESTARTSYS EINTR
+#define ETIME ETIMEDOUT
+#define EREMOTEIO EIO
+#define EPROTO EIO
+#define ENOTSUPP ENOTSUP
#define unlikely(x) __builtin_expect(!!(x), 0)
#define likely(x) __builtin_expect(!!(x), 1)
diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c
index 617820915fe..89478a3a8d0 100644
--- a/sys/dev/pci/drm/i915/i915_gem.c
+++ b/sys/dev/pci/drm/i915/i915_gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_gem.c,v 1.86 2015/04/05 11:53:53 kettenis Exp $ */
+/* $OpenBSD: i915_gem.c,v 1.87 2015/04/06 10:56:37 jsg Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -1161,7 +1161,7 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
case 0: /* Timeout */
if (timeout)
timeout->tv_sec = timeout->tv_nsec = 0;
- return -ETIMEDOUT;
+ return -ETIME;
default: /* Completed */
WARN_ON(end < 0); /* We're not aware of other errors */
return 0;
@@ -2543,7 +2543,7 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
* on this IOCTL with a 0 timeout (like busy ioctl)
*/
if (!args->timeout_ns) {
- ret = -ETIMEDOUT;
+ ret = -ETIME;
goto out;
}
diff --git a/sys/dev/pci/drm/i915/intel_dp.c b/sys/dev/pci/drm/i915/intel_dp.c
index a152d04827b..745c026ef7c 100644
--- a/sys/dev/pci/drm/i915/intel_dp.c
+++ b/sys/dev/pci/drm/i915/intel_dp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_dp.c,v 1.22 2015/02/10 03:39:41 jsg Exp $ */
+/* $OpenBSD: intel_dp.c,v 1.23 2015/04/06 10:56:37 jsg Exp $ */
/*
* Copyright © 2008 Intel Corporation
*
@@ -549,7 +549,7 @@ intel_dp_aux_native_read(struct intel_dp *intel_dp,
ret = intel_dp_aux_ch(intel_dp, msg, msg_bytes,
reply, reply_bytes);
if (ret == 0)
- return -EIO;
+ return -EPROTO;
if (ret < 0)
return ret;
ack = reply[0];
@@ -631,7 +631,7 @@ intel_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
break;
case AUX_NATIVE_REPLY_NACK:
DRM_DEBUG_KMS("aux_ch native nack\n");
- return -EIO;
+ return -EREMOTEIO;
case AUX_NATIVE_REPLY_DEFER:
/*
* For now, just give more slack to branch devices. We
@@ -649,7 +649,7 @@ intel_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
default:
DRM_ERROR("aux_ch invalid native reply 0x%02x\n",
reply[0]);
- return -EIO;
+ return -EREMOTEIO;
}
switch (reply[0] & AUX_I2C_REPLY_MASK) {
@@ -660,19 +660,19 @@ intel_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
return reply_bytes - 1;
case AUX_I2C_REPLY_NACK:
DRM_DEBUG_KMS("aux_i2c nack\n");
- return -EIO;
+ return -EREMOTEIO;
case AUX_I2C_REPLY_DEFER:
DRM_DEBUG_KMS("aux_i2c defer\n");
udelay(100);
break;
default:
DRM_ERROR("aux_i2c invalid reply 0x%02x\n", reply[0]);
- return -EIO;
+ return -EREMOTEIO;
}
}
DRM_ERROR("too many retries, giving up\n");
- return -EIO;
+ return -EREMOTEIO;
}
static int
diff --git a/sys/dev/pci/drm/i915/intel_opregion.c b/sys/dev/pci/drm/i915/intel_opregion.c
index 4953c013f37..2b58d8a8f69 100644
--- a/sys/dev/pci/drm/i915/intel_opregion.c
+++ b/sys/dev/pci/drm/i915/intel_opregion.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_opregion.c,v 1.5 2014/03/24 17:06:49 kettenis Exp $ */
+/* $OpenBSD: intel_opregion.c,v 1.6 2015/04/06 10:56:37 jsg Exp $ */
/*
* Copyright 2008 Intel Corporation <hong.liu@intel.com>
* Copyright 2008 Red Hat <mjg@redhat.com>
@@ -495,7 +495,7 @@ int intel_opregion_setup(struct drm_device *dev)
DRM_DEBUG_DRIVER("graphic opregion physical addr: 0x%x\n", asls);
if (asls == 0) {
DRM_DEBUG_DRIVER("ACPI OpRegion not supported!\n");
- return -ENOTSUP;
+ return -ENOTSUPP;
}
if (bus_space_map(dev_priv->bst, asls, OPREGION_SIZE,
diff --git a/sys/dev/pci/drm/radeon/atombios_dp.c b/sys/dev/pci/drm/radeon/atombios_dp.c
index 409d740752c..914273da807 100644
--- a/sys/dev/pci/drm/radeon/atombios_dp.c
+++ b/sys/dev/pci/drm/radeon/atombios_dp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atombios_dp.c,v 1.4 2014/08/08 16:38:23 jsg Exp $ */
+/* $OpenBSD: atombios_dp.c,v 1.5 2015/04/06 10:56:37 jsg Exp $ */
/*
* Copyright 2007-8 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -293,14 +293,14 @@ int radeon_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
break;
case AUX_NATIVE_REPLY_NACK:
DRM_DEBUG_KMS("aux_ch native nack\n");
- return -EIO;
+ return -EREMOTEIO;
case AUX_NATIVE_REPLY_DEFER:
DRM_DEBUG_KMS("aux_ch native defer\n");
udelay(400);
continue;
default:
DRM_ERROR("aux_ch invalid native reply 0x%02x\n", ack);
- return -EIO;
+ return -EREMOTEIO;
}
switch (ack & AUX_I2C_REPLY_MASK) {
@@ -310,19 +310,19 @@ int radeon_dp_i2c_aux_ch(struct i2c_controller *adapter, int mode,
return ret;
case AUX_I2C_REPLY_NACK:
DRM_DEBUG_KMS("aux_i2c nack\n");
- return -EIO;
+ return -EREMOTEIO;
case AUX_I2C_REPLY_DEFER:
DRM_DEBUG_KMS("aux_i2c defer\n");
udelay(400);
break;
default:
DRM_ERROR("aux_i2c invalid reply 0x%02x\n", ack);
- return -EIO;
+ return -EREMOTEIO;
}
}
DRM_DEBUG_KMS("aux i2c too many retries, giving up\n");
- return -EIO;
+ return -EREMOTEIO;
}
/***** general DP utility functions *****/