summaryrefslogtreecommitdiff
path: root/libdrm/xf86drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdrm/xf86drm.c')
-rw-r--r--libdrm/xf86drm.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 1fd3a697..64765339 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -2356,49 +2356,6 @@ int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, void *data,
return 0;
}
-
-#define DRM_IOCTL_TIMEOUT_USEC 3000000UL
-
-static unsigned long
-drmTimeDiff(struct timeval *now, struct timeval *then)
-{
- uint64_t val;
-
- val = now->tv_sec - then->tv_sec;
- val *= 1000000LL;
- val += now->tv_usec;
- val -= then->tv_usec;
-
- return (unsigned long) val;
-}
-
-static int
-drmIoctlTimeout(int fd, unsigned long request, void *argp)
-{
- int haveThen = 0;
- struct timeval then, now;
- int ret;
-
- do {
- ret = drmIoctl(fd, request, argp);
- if (ret != 0 && errno == EAGAIN) {
- if (!haveThen) {
- gettimeofday(&then, NULL);
- haveThen = 1;
- }
- gettimeofday(&now, NULL);
- }
- } while (ret != 0 && errno == EAGAIN &&
- drmTimeDiff(&now, &then) < DRM_IOCTL_TIMEOUT_USEC);
-
- if (ret != 0)
- return ((errno == EAGAIN) ? -EBUSY : -errno);
-
- return 0;
-}
-
-
-
#define DRM_MAX_FDS 16
static struct {
char *BusID;