diff options
author | Keith Packard | 2008-06-13 18:03:22 -0500 |
---|---|---|
committer | Keith Packard | 2008-06-13 18:03:22 -0500 |
commit | 8b9ab108ec1f2ba2b503f713769c4946849b3cb2 (patch) | |
tree | bcbc67e20a31cecce0964d40722ae140bb8aa2ee /libdrm/xf86drm.c | |
parent | 217beb9c8de01417ac6219b54bd25046da6d4c7a (diff) | |
download | external-libgbm-8b9ab108ec1f2ba2b503f713769c4946849b3cb2.tar.gz external-libgbm-8b9ab108ec1f2ba2b503f713769c4946849b3cb2.tar.xz external-libgbm-8b9ab108ec1f2ba2b503f713769c4946849b3cb2.zip |
[libdrm] Restart all ioctls on signal receipt
Receiving a signal should be ignored by the library, so just restart any
ioctl which returns EINTR or EAGAIN.
Diffstat (limited to 'libdrm/xf86drm.c')
-rw-r--r-- | libdrm/xf86drm.c | 172 |
1 files changed, 92 insertions, 80 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 0383b6b8..edb0c90b 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c | |||
@@ -171,6 +171,19 @@ static char *drmStrdup(const char *s) | |||
171 | return retval; | 171 | return retval; |
172 | } | 172 | } |
173 | 173 | ||
174 | /** | ||
175 | * Call ioctl, restarting if it is interupted | ||
176 | */ | ||
177 | static int | ||
178 | drmIoctl(int fd, int request, void *arg) | ||
179 | { | ||
180 | int ret; | ||
181 | |||
182 | do { | ||
183 | ret = ioctl(fd, request, arg); | ||
184 | } while (ret == -1 && (errno == EINTR || errno == EAGAIN)); | ||
185 | return ret; | ||
186 | } | ||
174 | 187 | ||
175 | static unsigned long drmGetKeyFromFd(int fd) | 188 | static unsigned long drmGetKeyFromFd(int fd) |
176 | { | 189 | { |
@@ -668,7 +681,7 @@ drmVersionPtr drmGetVersion(int fd) | |||
668 | version->desc_len = 0; | 681 | version->desc_len = 0; |
669 | version->desc = NULL; | 682 | version->desc = NULL; |
670 | 683 | ||
671 | if (ioctl(fd, DRM_IOCTL_VERSION, version)) { | 684 | if (drmIoctl(fd, DRM_IOCTL_VERSION, version)) { |
672 | drmFreeKernelVersion(version); | 685 | drmFreeKernelVersion(version); |
673 | return NULL; | 686 | return NULL; |
674 | } | 687 | } |
@@ -680,7 +693,7 @@ drmVersionPtr drmGetVersion(int fd) | |||
680 | if (version->desc_len) | 693 | if (version->desc_len) |
681 | version->desc = drmMalloc(version->desc_len + 1); | 694 | version->desc = drmMalloc(version->desc_len + 1); |
682 | 695 | ||
683 | if (ioctl(fd, DRM_IOCTL_VERSION, version)) { | 696 | if (drmIoctl(fd, DRM_IOCTL_VERSION, version)) { |
684 | drmMsg("DRM_IOCTL_VERSION: %s\n", strerror(errno)); | 697 | drmMsg("DRM_IOCTL_VERSION: %s\n", strerror(errno)); |
685 | drmFreeKernelVersion(version); | 698 | drmFreeKernelVersion(version); |
686 | return NULL; | 699 | return NULL; |
@@ -766,10 +779,10 @@ char *drmGetBusid(int fd) | |||
766 | u.unique_len = 0; | 779 | u.unique_len = 0; |
767 | u.unique = NULL; | 780 | u.unique = NULL; |
768 | 781 | ||
769 | if (ioctl(fd, DRM_IOCTL_GET_UNIQUE, &u)) | 782 | if (drmIoctl(fd, DRM_IOCTL_GET_UNIQUE, &u)) |
770 | return NULL; | 783 | return NULL; |
771 | u.unique = drmMalloc(u.unique_len + 1); | 784 | u.unique = drmMalloc(u.unique_len + 1); |
772 | if (ioctl(fd, DRM_IOCTL_GET_UNIQUE, &u)) | 785 | if (drmIoctl(fd, DRM_IOCTL_GET_UNIQUE, &u)) |
773 | return NULL; | 786 | return NULL; |
774 | u.unique[u.unique_len] = '\0'; | 787 | u.unique[u.unique_len] = '\0'; |
775 | 788 | ||
@@ -796,7 +809,7 @@ int drmSetBusid(int fd, const char *busid) | |||
796 | u.unique = (char *)busid; | 809 | u.unique = (char *)busid; |
797 | u.unique_len = strlen(busid); | 810 | u.unique_len = strlen(busid); |
798 | 811 | ||
799 | if (ioctl(fd, DRM_IOCTL_SET_UNIQUE, &u)) { | 812 | if (drmIoctl(fd, DRM_IOCTL_SET_UNIQUE, &u)) { |
800 | return -errno; | 813 | return -errno; |
801 | } | 814 | } |
802 | return 0; | 815 | return 0; |
@@ -807,7 +820,7 @@ int drmGetMagic(int fd, drm_magic_t * magic) | |||
807 | drm_auth_t auth; | 820 | drm_auth_t auth; |
808 | 821 | ||
809 | *magic = 0; | 822 | *magic = 0; |
810 | if (ioctl(fd, DRM_IOCTL_GET_MAGIC, &auth)) | 823 | if (drmIoctl(fd, DRM_IOCTL_GET_MAGIC, &auth)) |
811 | return -errno; | 824 | return -errno; |
812 | *magic = auth.magic; | 825 | *magic = auth.magic; |
813 | return 0; | 826 | return 0; |
@@ -818,7 +831,7 @@ int drmAuthMagic(int fd, drm_magic_t magic) | |||
818 | drm_auth_t auth; | 831 | drm_auth_t auth; |
819 | 832 | ||
820 | auth.magic = magic; | 833 | auth.magic = magic; |
821 | if (ioctl(fd, DRM_IOCTL_AUTH_MAGIC, &auth)) | 834 | if (drmIoctl(fd, DRM_IOCTL_AUTH_MAGIC, &auth)) |
822 | return -errno; | 835 | return -errno; |
823 | return 0; | 836 | return 0; |
824 | } | 837 | } |
@@ -883,7 +896,7 @@ int drmAddMap(int fd, drm_handle_t offset, drmSize size, drmMapType type, | |||
883 | map.handle = 0; | 896 | map.handle = 0; |
884 | map.type = type; | 897 | map.type = type; |
885 | map.flags = flags; | 898 | map.flags = flags; |
886 | if (ioctl(fd, DRM_IOCTL_ADD_MAP, &map)) | 899 | if (drmIoctl(fd, DRM_IOCTL_ADD_MAP, &map)) |
887 | return -errno; | 900 | return -errno; |
888 | if (handle) | 901 | if (handle) |
889 | *handle = (drm_handle_t)map.handle; | 902 | *handle = (drm_handle_t)map.handle; |
@@ -896,7 +909,7 @@ int drmRmMap(int fd, drm_handle_t handle) | |||
896 | 909 | ||
897 | map.handle = (void *)handle; | 910 | map.handle = (void *)handle; |
898 | 911 | ||
899 | if(ioctl(fd, DRM_IOCTL_RM_MAP, &map)) | 912 | if(drmIoctl(fd, DRM_IOCTL_RM_MAP, &map)) |
900 | return -errno; | 913 | return -errno; |
901 | return 0; | 914 | return 0; |
902 | } | 915 | } |
@@ -929,7 +942,7 @@ int drmAddBufs(int fd, int count, int size, drmBufDescFlags flags, | |||
929 | request.flags = flags; | 942 | request.flags = flags; |
930 | request.agp_start = agp_offset; | 943 | request.agp_start = agp_offset; |
931 | 944 | ||
932 | if (ioctl(fd, DRM_IOCTL_ADD_BUFS, &request)) | 945 | if (drmIoctl(fd, DRM_IOCTL_ADD_BUFS, &request)) |
933 | return -errno; | 946 | return -errno; |
934 | return request.count; | 947 | return request.count; |
935 | } | 948 | } |
@@ -942,7 +955,7 @@ int drmMarkBufs(int fd, double low, double high) | |||
942 | info.count = 0; | 955 | info.count = 0; |
943 | info.list = NULL; | 956 | info.list = NULL; |
944 | 957 | ||
945 | if (ioctl(fd, DRM_IOCTL_INFO_BUFS, &info)) | 958 | if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) |
946 | return -EINVAL; | 959 | return -EINVAL; |
947 | 960 | ||
948 | if (!info.count) | 961 | if (!info.count) |
@@ -951,7 +964,7 @@ int drmMarkBufs(int fd, double low, double high) | |||
951 | if (!(info.list = drmMalloc(info.count * sizeof(*info.list)))) | 964 | if (!(info.list = drmMalloc(info.count * sizeof(*info.list)))) |
952 | return -ENOMEM; | 965 | return -ENOMEM; |
953 | 966 | ||
954 | if (ioctl(fd, DRM_IOCTL_INFO_BUFS, &info)) { | 967 | if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) { |
955 | int retval = -errno; | 968 | int retval = -errno; |
956 | drmFree(info.list); | 969 | drmFree(info.list); |
957 | return retval; | 970 | return retval; |
@@ -960,7 +973,7 @@ int drmMarkBufs(int fd, double low, double high) | |||
960 | for (i = 0; i < info.count; i++) { | 973 | for (i = 0; i < info.count; i++) { |
961 | info.list[i].low_mark = low * info.list[i].count; | 974 | info.list[i].low_mark = low * info.list[i].count; |
962 | info.list[i].high_mark = high * info.list[i].count; | 975 | info.list[i].high_mark = high * info.list[i].count; |
963 | if (ioctl(fd, DRM_IOCTL_MARK_BUFS, &info.list[i])) { | 976 | if (drmIoctl(fd, DRM_IOCTL_MARK_BUFS, &info.list[i])) { |
964 | int retval = -errno; | 977 | int retval = -errno; |
965 | drmFree(info.list); | 978 | drmFree(info.list); |
966 | return retval; | 979 | return retval; |
@@ -992,7 +1005,7 @@ int drmFreeBufs(int fd, int count, int *list) | |||
992 | 1005 | ||
993 | request.count = count; | 1006 | request.count = count; |
994 | request.list = list; | 1007 | request.list = list; |
995 | if (ioctl(fd, DRM_IOCTL_FREE_BUFS, &request)) | 1008 | if (drmIoctl(fd, DRM_IOCTL_FREE_BUFS, &request)) |
996 | return -errno; | 1009 | return -errno; |
997 | return 0; | 1010 | return 0; |
998 | } | 1011 | } |
@@ -1081,14 +1094,14 @@ drmBufInfoPtr drmGetBufInfo(int fd) | |||
1081 | info.count = 0; | 1094 | info.count = 0; |
1082 | info.list = NULL; | 1095 | info.list = NULL; |
1083 | 1096 | ||
1084 | if (ioctl(fd, DRM_IOCTL_INFO_BUFS, &info)) | 1097 | if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) |
1085 | return NULL; | 1098 | return NULL; |
1086 | 1099 | ||
1087 | if (info.count) { | 1100 | if (info.count) { |
1088 | if (!(info.list = drmMalloc(info.count * sizeof(*info.list)))) | 1101 | if (!(info.list = drmMalloc(info.count * sizeof(*info.list)))) |
1089 | return NULL; | 1102 | return NULL; |
1090 | 1103 | ||
1091 | if (ioctl(fd, DRM_IOCTL_INFO_BUFS, &info)) { | 1104 | if (drmIoctl(fd, DRM_IOCTL_INFO_BUFS, &info)) { |
1092 | drmFree(info.list); | 1105 | drmFree(info.list); |
1093 | return NULL; | 1106 | return NULL; |
1094 | } | 1107 | } |
@@ -1132,7 +1145,7 @@ drmBufMapPtr drmMapBufs(int fd) | |||
1132 | bufs.count = 0; | 1145 | bufs.count = 0; |
1133 | bufs.list = NULL; | 1146 | bufs.list = NULL; |
1134 | bufs.virtual = NULL; | 1147 | bufs.virtual = NULL; |
1135 | if (ioctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) | 1148 | if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) |
1136 | return NULL; | 1149 | return NULL; |
1137 | 1150 | ||
1138 | if (!bufs.count) | 1151 | if (!bufs.count) |
@@ -1141,7 +1154,7 @@ drmBufMapPtr drmMapBufs(int fd) | |||
1141 | if (!(bufs.list = drmMalloc(bufs.count * sizeof(*bufs.list)))) | 1154 | if (!(bufs.list = drmMalloc(bufs.count * sizeof(*bufs.list)))) |
1142 | return NULL; | 1155 | return NULL; |
1143 | 1156 | ||
1144 | if (ioctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) { | 1157 | if (drmIoctl(fd, DRM_IOCTL_MAP_BUFS, &bufs)) { |
1145 | drmFree(bufs.list); | 1158 | drmFree(bufs.list); |
1146 | return NULL; | 1159 | return NULL; |
1147 | } | 1160 | } |
@@ -1256,7 +1269,7 @@ int drmGetLock(int fd, drm_context_t context, drmLockFlags flags) | |||
1256 | if (flags & DRM_HALT_ALL_QUEUES) lock.flags |= _DRM_HALT_ALL_QUEUES; | 1269 | if (flags & DRM_HALT_ALL_QUEUES) lock.flags |= _DRM_HALT_ALL_QUEUES; |
1257 | if (flags & DRM_HALT_CUR_QUEUES) lock.flags |= _DRM_HALT_CUR_QUEUES; | 1270 | if (flags & DRM_HALT_CUR_QUEUES) lock.flags |= _DRM_HALT_CUR_QUEUES; |
1258 | 1271 | ||
1259 | while (ioctl(fd, DRM_IOCTL_LOCK, &lock)) | 1272 | while (drmIoctl(fd, DRM_IOCTL_LOCK, &lock)) |
1260 | ; | 1273 | ; |
1261 | return 0; | 1274 | return 0; |
1262 | } | 1275 | } |
@@ -1279,7 +1292,7 @@ int drmUnlock(int fd, drm_context_t context) | |||
1279 | 1292 | ||
1280 | lock.context = context; | 1293 | lock.context = context; |
1281 | lock.flags = 0; | 1294 | lock.flags = 0; |
1282 | return ioctl(fd, DRM_IOCTL_UNLOCK, &lock); | 1295 | return drmIoctl(fd, DRM_IOCTL_UNLOCK, &lock); |
1283 | } | 1296 | } |
1284 | 1297 | ||
1285 | drm_context_t *drmGetReservedContextList(int fd, int *count) | 1298 | drm_context_t *drmGetReservedContextList(int fd, int *count) |
@@ -1291,7 +1304,7 @@ drm_context_t *drmGetReservedContextList(int fd, int *count) | |||
1291 | 1304 | ||
1292 | res.count = 0; | 1305 | res.count = 0; |
1293 | res.contexts = NULL; | 1306 | res.contexts = NULL; |
1294 | if (ioctl(fd, DRM_IOCTL_RES_CTX, &res)) | 1307 | if (drmIoctl(fd, DRM_IOCTL_RES_CTX, &res)) |
1295 | return NULL; | 1308 | return NULL; |
1296 | 1309 | ||
1297 | if (!res.count) | 1310 | if (!res.count) |
@@ -1305,7 +1318,7 @@ drm_context_t *drmGetReservedContextList(int fd, int *count) | |||
1305 | } | 1318 | } |
1306 | 1319 | ||
1307 | res.contexts = list; | 1320 | res.contexts = list; |
1308 | if (ioctl(fd, DRM_IOCTL_RES_CTX, &res)) | 1321 | if (drmIoctl(fd, DRM_IOCTL_RES_CTX, &res)) |
1309 | return NULL; | 1322 | return NULL; |
1310 | 1323 | ||
1311 | for (i = 0; i < res.count; i++) | 1324 | for (i = 0; i < res.count; i++) |
@@ -1344,7 +1357,7 @@ int drmCreateContext(int fd, drm_context_t *handle) | |||
1344 | drm_ctx_t ctx; | 1357 | drm_ctx_t ctx; |
1345 | 1358 | ||
1346 | ctx.flags = 0; /* Modified with functions below */ | 1359 | ctx.flags = 0; /* Modified with functions below */ |
1347 | if (ioctl(fd, DRM_IOCTL_ADD_CTX, &ctx)) | 1360 | if (drmIoctl(fd, DRM_IOCTL_ADD_CTX, &ctx)) |
1348 | return -errno; | 1361 | return -errno; |
1349 | *handle = ctx.handle; | 1362 | *handle = ctx.handle; |
1350 | return 0; | 1363 | return 0; |
@@ -1355,7 +1368,7 @@ int drmSwitchToContext(int fd, drm_context_t context) | |||
1355 | drm_ctx_t ctx; | 1368 | drm_ctx_t ctx; |
1356 | 1369 | ||
1357 | ctx.handle = context; | 1370 | ctx.handle = context; |
1358 | if (ioctl(fd, DRM_IOCTL_SWITCH_CTX, &ctx)) | 1371 | if (drmIoctl(fd, DRM_IOCTL_SWITCH_CTX, &ctx)) |
1359 | return -errno; | 1372 | return -errno; |
1360 | return 0; | 1373 | return 0; |
1361 | } | 1374 | } |
@@ -1376,7 +1389,7 @@ int drmSetContextFlags(int fd, drm_context_t context, drm_context_tFlags flags) | |||
1376 | ctx.flags |= _DRM_CONTEXT_PRESERVED; | 1389 | ctx.flags |= _DRM_CONTEXT_PRESERVED; |
1377 | if (flags & DRM_CONTEXT_2DONLY) | 1390 | if (flags & DRM_CONTEXT_2DONLY) |
1378 | ctx.flags |= _DRM_CONTEXT_2DONLY; | 1391 | ctx.flags |= _DRM_CONTEXT_2DONLY; |
1379 | if (ioctl(fd, DRM_IOCTL_MOD_CTX, &ctx)) | 1392 | if (drmIoctl(fd, DRM_IOCTL_MOD_CTX, &ctx)) |
1380 | return -errno; | 1393 | return -errno; |
1381 | return 0; | 1394 | return 0; |
1382 | } | 1395 | } |
@@ -1387,7 +1400,7 @@ int drmGetContextFlags(int fd, drm_context_t context, | |||
1387 | drm_ctx_t ctx; | 1400 | drm_ctx_t ctx; |
1388 | 1401 | ||
1389 | ctx.handle = context; | 1402 | ctx.handle = context; |
1390 | if (ioctl(fd, DRM_IOCTL_GET_CTX, &ctx)) | 1403 | if (drmIoctl(fd, DRM_IOCTL_GET_CTX, &ctx)) |
1391 | return -errno; | 1404 | return -errno; |
1392 | *flags = 0; | 1405 | *flags = 0; |
1393 | if (ctx.flags & _DRM_CONTEXT_PRESERVED) | 1406 | if (ctx.flags & _DRM_CONTEXT_PRESERVED) |
@@ -1418,7 +1431,7 @@ int drmDestroyContext(int fd, drm_context_t handle) | |||
1418 | { | 1431 | { |
1419 | drm_ctx_t ctx; | 1432 | drm_ctx_t ctx; |
1420 | ctx.handle = handle; | 1433 | ctx.handle = handle; |
1421 | if (ioctl(fd, DRM_IOCTL_RM_CTX, &ctx)) | 1434 | if (drmIoctl(fd, DRM_IOCTL_RM_CTX, &ctx)) |
1422 | return -errno; | 1435 | return -errno; |
1423 | return 0; | 1436 | return 0; |
1424 | } | 1437 | } |
@@ -1426,7 +1439,7 @@ int drmDestroyContext(int fd, drm_context_t handle) | |||
1426 | int drmCreateDrawable(int fd, drm_drawable_t *handle) | 1439 | int drmCreateDrawable(int fd, drm_drawable_t *handle) |
1427 | { | 1440 | { |
1428 | drm_draw_t draw; | 1441 | drm_draw_t draw; |
1429 | if (ioctl(fd, DRM_IOCTL_ADD_DRAW, &draw)) | 1442 | if (drmIoctl(fd, DRM_IOCTL_ADD_DRAW, &draw)) |
1430 | return -errno; | 1443 | return -errno; |
1431 | *handle = draw.handle; | 1444 | *handle = draw.handle; |
1432 | return 0; | 1445 | return 0; |
@@ -1436,7 +1449,7 @@ int drmDestroyDrawable(int fd, drm_drawable_t handle) | |||
1436 | { | 1449 | { |
1437 | drm_draw_t draw; | 1450 | drm_draw_t draw; |
1438 | draw.handle = handle; | 1451 | draw.handle = handle; |
1439 | if (ioctl(fd, DRM_IOCTL_RM_DRAW, &draw)) | 1452 | if (drmIoctl(fd, DRM_IOCTL_RM_DRAW, &draw)) |
1440 | return -errno; | 1453 | return -errno; |
1441 | return 0; | 1454 | return 0; |
1442 | } | 1455 | } |
@@ -1452,7 +1465,7 @@ int drmUpdateDrawableInfo(int fd, drm_drawable_t handle, | |||
1452 | update.num = num; | 1465 | update.num = num; |
1453 | update.data = (unsigned long long)(unsigned long)data; | 1466 | update.data = (unsigned long long)(unsigned long)data; |
1454 | 1467 | ||
1455 | if (ioctl(fd, DRM_IOCTL_UPDATE_DRAW, &update)) | 1468 | if (drmIoctl(fd, DRM_IOCTL_UPDATE_DRAW, &update)) |
1456 | return -errno; | 1469 | return -errno; |
1457 | 1470 | ||
1458 | return 0; | 1471 | return 0; |
@@ -1472,7 +1485,7 @@ int drmUpdateDrawableInfo(int fd, drm_drawable_t handle, | |||
1472 | */ | 1485 | */ |
1473 | int drmAgpAcquire(int fd) | 1486 | int drmAgpAcquire(int fd) |
1474 | { | 1487 | { |
1475 | if (ioctl(fd, DRM_IOCTL_AGP_ACQUIRE, NULL)) | 1488 | if (drmIoctl(fd, DRM_IOCTL_AGP_ACQUIRE, NULL)) |
1476 | return -errno; | 1489 | return -errno; |
1477 | return 0; | 1490 | return 0; |
1478 | } | 1491 | } |
@@ -1490,7 +1503,7 @@ int drmAgpAcquire(int fd) | |||
1490 | */ | 1503 | */ |
1491 | int drmAgpRelease(int fd) | 1504 | int drmAgpRelease(int fd) |
1492 | { | 1505 | { |
1493 | if (ioctl(fd, DRM_IOCTL_AGP_RELEASE, NULL)) | 1506 | if (drmIoctl(fd, DRM_IOCTL_AGP_RELEASE, NULL)) |
1494 | return -errno; | 1507 | return -errno; |
1495 | return 0; | 1508 | return 0; |
1496 | } | 1509 | } |
@@ -1513,7 +1526,7 @@ int drmAgpEnable(int fd, unsigned long mode) | |||
1513 | drm_agp_mode_t m; | 1526 | drm_agp_mode_t m; |
1514 | 1527 | ||
1515 | m.mode = mode; | 1528 | m.mode = mode; |
1516 | if (ioctl(fd, DRM_IOCTL_AGP_ENABLE, &m)) | 1529 | if (drmIoctl(fd, DRM_IOCTL_AGP_ENABLE, &m)) |
1517 | return -errno; | 1530 | return -errno; |
1518 | return 0; | 1531 | return 0; |
1519 | } | 1532 | } |
@@ -1544,7 +1557,7 @@ int drmAgpAlloc(int fd, unsigned long size, unsigned long type, | |||
1544 | b.size = size; | 1557 | b.size = size; |
1545 | b.handle = 0; | 1558 | b.handle = 0; |
1546 | b.type = type; | 1559 | b.type = type; |
1547 | if (ioctl(fd, DRM_IOCTL_AGP_ALLOC, &b)) | 1560 | if (drmIoctl(fd, DRM_IOCTL_AGP_ALLOC, &b)) |
1548 | return -errno; | 1561 | return -errno; |
1549 | if (address != 0UL) | 1562 | if (address != 0UL) |
1550 | *address = b.physical; | 1563 | *address = b.physical; |
@@ -1571,7 +1584,7 @@ int drmAgpFree(int fd, drm_handle_t handle) | |||
1571 | 1584 | ||
1572 | b.size = 0; | 1585 | b.size = 0; |
1573 | b.handle = handle; | 1586 | b.handle = handle; |
1574 | if (ioctl(fd, DRM_IOCTL_AGP_FREE, &b)) | 1587 | if (drmIoctl(fd, DRM_IOCTL_AGP_FREE, &b)) |
1575 | return -errno; | 1588 | return -errno; |
1576 | return 0; | 1589 | return 0; |
1577 | } | 1590 | } |
@@ -1596,7 +1609,7 @@ int drmAgpBind(int fd, drm_handle_t handle, unsigned long offset) | |||
1596 | 1609 | ||
1597 | b.handle = handle; | 1610 | b.handle = handle; |
1598 | b.offset = offset; | 1611 | b.offset = offset; |
1599 | if (ioctl(fd, DRM_IOCTL_AGP_BIND, &b)) | 1612 | if (drmIoctl(fd, DRM_IOCTL_AGP_BIND, &b)) |
1600 | return -errno; | 1613 | return -errno; |
1601 | return 0; | 1614 | return 0; |
1602 | } | 1615 | } |
@@ -1620,7 +1633,7 @@ int drmAgpUnbind(int fd, drm_handle_t handle) | |||
1620 | 1633 | ||
1621 | b.handle = handle; | 1634 | b.handle = handle; |
1622 | b.offset = 0; | 1635 | b.offset = 0; |
1623 | if (ioctl(fd, DRM_IOCTL_AGP_UNBIND, &b)) | 1636 | if (drmIoctl(fd, DRM_IOCTL_AGP_UNBIND, &b)) |
1624 | return -errno; | 1637 | return -errno; |
1625 | return 0; | 1638 | return 0; |
1626 | } | 1639 | } |
@@ -1641,7 +1654,7 @@ int drmAgpVersionMajor(int fd) | |||
1641 | { | 1654 | { |
1642 | drm_agp_info_t i; | 1655 | drm_agp_info_t i; |
1643 | 1656 | ||
1644 | if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) | 1657 | if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) |
1645 | return -errno; | 1658 | return -errno; |
1646 | return i.agp_version_major; | 1659 | return i.agp_version_major; |
1647 | } | 1660 | } |
@@ -1662,7 +1675,7 @@ int drmAgpVersionMinor(int fd) | |||
1662 | { | 1675 | { |
1663 | drm_agp_info_t i; | 1676 | drm_agp_info_t i; |
1664 | 1677 | ||
1665 | if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) | 1678 | if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) |
1666 | return -errno; | 1679 | return -errno; |
1667 | return i.agp_version_minor; | 1680 | return i.agp_version_minor; |
1668 | } | 1681 | } |
@@ -1683,7 +1696,7 @@ unsigned long drmAgpGetMode(int fd) | |||
1683 | { | 1696 | { |
1684 | drm_agp_info_t i; | 1697 | drm_agp_info_t i; |
1685 | 1698 | ||
1686 | if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) | 1699 | if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) |
1687 | return 0; | 1700 | return 0; |
1688 | return i.mode; | 1701 | return i.mode; |
1689 | } | 1702 | } |
@@ -1704,7 +1717,7 @@ unsigned long drmAgpBase(int fd) | |||
1704 | { | 1717 | { |
1705 | drm_agp_info_t i; | 1718 | drm_agp_info_t i; |
1706 | 1719 | ||
1707 | if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) | 1720 | if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) |
1708 | return 0; | 1721 | return 0; |
1709 | return i.aperture_base; | 1722 | return i.aperture_base; |
1710 | } | 1723 | } |
@@ -1725,7 +1738,7 @@ unsigned long drmAgpSize(int fd) | |||
1725 | { | 1738 | { |
1726 | drm_agp_info_t i; | 1739 | drm_agp_info_t i; |
1727 | 1740 | ||
1728 | if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) | 1741 | if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) |
1729 | return 0; | 1742 | return 0; |
1730 | return i.aperture_size; | 1743 | return i.aperture_size; |
1731 | } | 1744 | } |
@@ -1746,7 +1759,7 @@ unsigned long drmAgpMemoryUsed(int fd) | |||
1746 | { | 1759 | { |
1747 | drm_agp_info_t i; | 1760 | drm_agp_info_t i; |
1748 | 1761 | ||
1749 | if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) | 1762 | if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) |
1750 | return 0; | 1763 | return 0; |
1751 | return i.memory_used; | 1764 | return i.memory_used; |
1752 | } | 1765 | } |
@@ -1767,7 +1780,7 @@ unsigned long drmAgpMemoryAvail(int fd) | |||
1767 | { | 1780 | { |
1768 | drm_agp_info_t i; | 1781 | drm_agp_info_t i; |
1769 | 1782 | ||
1770 | if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) | 1783 | if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) |
1771 | return 0; | 1784 | return 0; |
1772 | return i.memory_allowed; | 1785 | return i.memory_allowed; |
1773 | } | 1786 | } |
@@ -1788,7 +1801,7 @@ unsigned int drmAgpVendorId(int fd) | |||
1788 | { | 1801 | { |
1789 | drm_agp_info_t i; | 1802 | drm_agp_info_t i; |
1790 | 1803 | ||
1791 | if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) | 1804 | if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) |
1792 | return 0; | 1805 | return 0; |
1793 | return i.id_vendor; | 1806 | return i.id_vendor; |
1794 | } | 1807 | } |
@@ -1809,7 +1822,7 @@ unsigned int drmAgpDeviceId(int fd) | |||
1809 | { | 1822 | { |
1810 | drm_agp_info_t i; | 1823 | drm_agp_info_t i; |
1811 | 1824 | ||
1812 | if (ioctl(fd, DRM_IOCTL_AGP_INFO, &i)) | 1825 | if (drmIoctl(fd, DRM_IOCTL_AGP_INFO, &i)) |
1813 | return 0; | 1826 | return 0; |
1814 | return i.id_device; | 1827 | return i.id_device; |
1815 | } | 1828 | } |
@@ -1821,7 +1834,7 @@ int drmScatterGatherAlloc(int fd, unsigned long size, drm_handle_t *handle) | |||
1821 | *handle = 0; | 1834 | *handle = 0; |
1822 | sg.size = size; | 1835 | sg.size = size; |
1823 | sg.handle = 0; | 1836 | sg.handle = 0; |
1824 | if (ioctl(fd, DRM_IOCTL_SG_ALLOC, &sg)) | 1837 | if (drmIoctl(fd, DRM_IOCTL_SG_ALLOC, &sg)) |
1825 | return -errno; | 1838 | return -errno; |
1826 | *handle = sg.handle; | 1839 | *handle = sg.handle; |
1827 | return 0; | 1840 | return 0; |
@@ -1833,7 +1846,7 @@ int drmScatterGatherFree(int fd, drm_handle_t handle) | |||
1833 | 1846 | ||
1834 | sg.size = 0; | 1847 | sg.size = 0; |
1835 | sg.handle = handle; | 1848 | sg.handle = handle; |
1836 | if (ioctl(fd, DRM_IOCTL_SG_FREE, &sg)) | 1849 | if (drmIoctl(fd, DRM_IOCTL_SG_FREE, &sg)) |
1837 | return -errno; | 1850 | return -errno; |
1838 | return 0; | 1851 | return 0; |
1839 | } | 1852 | } |
@@ -1854,7 +1867,7 @@ int drmWaitVBlank(int fd, drmVBlankPtr vbl) | |||
1854 | int ret; | 1867 | int ret; |
1855 | 1868 | ||
1856 | do { | 1869 | do { |
1857 | ret = ioctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl); | 1870 | ret = drmIoctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl); |
1858 | vbl->request.type &= ~DRM_VBLANK_RELATIVE; | 1871 | vbl->request.type &= ~DRM_VBLANK_RELATIVE; |
1859 | } while (ret && errno == EINTR); | 1872 | } while (ret && errno == EINTR); |
1860 | 1873 | ||
@@ -1904,7 +1917,7 @@ int drmCtlInstHandler(int fd, int irq) | |||
1904 | 1917 | ||
1905 | ctl.func = DRM_INST_HANDLER; | 1918 | ctl.func = DRM_INST_HANDLER; |
1906 | ctl.irq = irq; | 1919 | ctl.irq = irq; |
1907 | if (ioctl(fd, DRM_IOCTL_CONTROL, &ctl)) | 1920 | if (drmIoctl(fd, DRM_IOCTL_CONTROL, &ctl)) |
1908 | return -errno; | 1921 | return -errno; |
1909 | return 0; | 1922 | return 0; |
1910 | } | 1923 | } |
@@ -1927,7 +1940,7 @@ int drmCtlUninstHandler(int fd) | |||
1927 | 1940 | ||
1928 | ctl.func = DRM_UNINST_HANDLER; | 1941 | ctl.func = DRM_UNINST_HANDLER; |
1929 | ctl.irq = 0; | 1942 | ctl.irq = 0; |
1930 | if (ioctl(fd, DRM_IOCTL_CONTROL, &ctl)) | 1943 | if (drmIoctl(fd, DRM_IOCTL_CONTROL, &ctl)) |
1931 | return -errno; | 1944 | return -errno; |
1932 | return 0; | 1945 | return 0; |
1933 | } | 1946 | } |
@@ -1944,7 +1957,7 @@ int drmFinish(int fd, int context, drmLockFlags flags) | |||
1944 | if (flags & DRM_LOCK_FLUSH_ALL) lock.flags |= _DRM_LOCK_FLUSH_ALL; | 1957 | if (flags & DRM_LOCK_FLUSH_ALL) lock.flags |= _DRM_LOCK_FLUSH_ALL; |
1945 | if (flags & DRM_HALT_ALL_QUEUES) lock.flags |= _DRM_HALT_ALL_QUEUES; | 1958 | if (flags & DRM_HALT_ALL_QUEUES) lock.flags |= _DRM_HALT_ALL_QUEUES; |
1946 | if (flags & DRM_HALT_CUR_QUEUES) lock.flags |= _DRM_HALT_CUR_QUEUES; | 1959 | if (flags & DRM_HALT_CUR_QUEUES) lock.flags |= _DRM_HALT_CUR_QUEUES; |
1947 | if (ioctl(fd, DRM_IOCTL_FINISH, &lock)) | 1960 | if (drmIoctl(fd, DRM_IOCTL_FINISH, &lock)) |
1948 | return -errno; | 1961 | return -errno; |
1949 | return 0; | 1962 | return 0; |
1950 | } | 1963 | } |
@@ -1970,7 +1983,7 @@ int drmGetInterruptFromBusID(int fd, int busnum, int devnum, int funcnum) | |||
1970 | p.busnum = busnum; | 1983 | p.busnum = busnum; |
1971 | p.devnum = devnum; | 1984 | p.devnum = devnum; |
1972 | p.funcnum = funcnum; | 1985 | p.funcnum = funcnum; |
1973 | if (ioctl(fd, DRM_IOCTL_IRQ_BUSID, &p)) | 1986 | if (drmIoctl(fd, DRM_IOCTL_IRQ_BUSID, &p)) |
1974 | return -errno; | 1987 | return -errno; |
1975 | return p.irq; | 1988 | return p.irq; |
1976 | } | 1989 | } |
@@ -2012,7 +2025,7 @@ int drmAddContextPrivateMapping(int fd, drm_context_t ctx_id, | |||
2012 | map.ctx_id = ctx_id; | 2025 | map.ctx_id = ctx_id; |
2013 | map.handle = (void *)handle; | 2026 | map.handle = (void *)handle; |
2014 | 2027 | ||
2015 | if (ioctl(fd, DRM_IOCTL_SET_SAREA_CTX, &map)) | 2028 | if (drmIoctl(fd, DRM_IOCTL_SET_SAREA_CTX, &map)) |
2016 | return -errno; | 2029 | return -errno; |
2017 | return 0; | 2030 | return 0; |
2018 | } | 2031 | } |
@@ -2024,7 +2037,7 @@ int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, | |||
2024 | 2037 | ||
2025 | map.ctx_id = ctx_id; | 2038 | map.ctx_id = ctx_id; |
2026 | 2039 | ||
2027 | if (ioctl(fd, DRM_IOCTL_GET_SAREA_CTX, &map)) | 2040 | if (drmIoctl(fd, DRM_IOCTL_GET_SAREA_CTX, &map)) |
2028 | return -errno; | 2041 | return -errno; |
2029 | if (handle) | 2042 | if (handle) |
2030 | *handle = (drm_handle_t)map.handle; | 2043 | *handle = (drm_handle_t)map.handle; |
@@ -2039,7 +2052,7 @@ int drmGetMap(int fd, int idx, drm_handle_t *offset, drmSize *size, | |||
2039 | drm_map_t map; | 2052 | drm_map_t map; |
2040 | 2053 | ||
2041 | map.offset = idx; | 2054 | map.offset = idx; |
2042 | if (ioctl(fd, DRM_IOCTL_GET_MAP, &map)) | 2055 | if (drmIoctl(fd, DRM_IOCTL_GET_MAP, &map)) |
2043 | return -errno; | 2056 | return -errno; |
2044 | *offset = map.offset; | 2057 | *offset = map.offset; |
2045 | *size = map.size; | 2058 | *size = map.size; |
@@ -2056,7 +2069,7 @@ int drmGetClient(int fd, int idx, int *auth, int *pid, int *uid, | |||
2056 | drm_client_t client; | 2069 | drm_client_t client; |
2057 | 2070 | ||
2058 | client.idx = idx; | 2071 | client.idx = idx; |
2059 | if (ioctl(fd, DRM_IOCTL_GET_CLIENT, &client)) | 2072 | if (drmIoctl(fd, DRM_IOCTL_GET_CLIENT, &client)) |
2060 | return -errno; | 2073 | return -errno; |
2061 | *auth = client.auth; | 2074 | *auth = client.auth; |
2062 | *pid = client.pid; | 2075 | *pid = client.pid; |
@@ -2071,7 +2084,7 @@ int drmGetStats(int fd, drmStatsT *stats) | |||
2071 | drm_stats_t s; | 2084 | drm_stats_t s; |
2072 | int i; | 2085 | int i; |
2073 | 2086 | ||
2074 | if (ioctl(fd, DRM_IOCTL_GET_STATS, &s)) | 2087 | if (drmIoctl(fd, DRM_IOCTL_GET_STATS, &s)) |
2075 | return -errno; | 2088 | return -errno; |
2076 | 2089 | ||
2077 | stats->count = 0; | 2090 | stats->count = 0; |
@@ -2213,7 +2226,7 @@ int drmSetInterfaceVersion(int fd, drmSetVersion *version) | |||
2213 | sv.drm_dd_major = version->drm_dd_major; | 2226 | sv.drm_dd_major = version->drm_dd_major; |
2214 | sv.drm_dd_minor = version->drm_dd_minor; | 2227 | sv.drm_dd_minor = version->drm_dd_minor; |
2215 | 2228 | ||
2216 | if (ioctl(fd, DRM_IOCTL_SET_VERSION, &sv)) { | 2229 | if (drmIoctl(fd, DRM_IOCTL_SET_VERSION, &sv)) { |
2217 | retcode = -errno; | 2230 | retcode = -errno; |
2218 | } | 2231 | } |
2219 | 2232 | ||
@@ -2244,7 +2257,7 @@ int drmCommandNone(int fd, unsigned long drmCommandIndex) | |||
2244 | 2257 | ||
2245 | request = DRM_IO( DRM_COMMAND_BASE + drmCommandIndex); | 2258 | request = DRM_IO( DRM_COMMAND_BASE + drmCommandIndex); |
2246 | 2259 | ||
2247 | if (ioctl(fd, request, data)) { | 2260 | if (drmIoctl(fd, request, data)) { |
2248 | return -errno; | 2261 | return -errno; |
2249 | } | 2262 | } |
2250 | return 0; | 2263 | return 0; |
@@ -2273,7 +2286,7 @@ int drmCommandRead(int fd, unsigned long drmCommandIndex, void *data, | |||
2273 | request = DRM_IOC( DRM_IOC_READ, DRM_IOCTL_BASE, | 2286 | request = DRM_IOC( DRM_IOC_READ, DRM_IOCTL_BASE, |
2274 | DRM_COMMAND_BASE + drmCommandIndex, size); | 2287 | DRM_COMMAND_BASE + drmCommandIndex, size); |
2275 | 2288 | ||
2276 | if (ioctl(fd, request, data)) { | 2289 | if (drmIoctl(fd, request, data)) { |
2277 | return -errno; | 2290 | return -errno; |
2278 | } | 2291 | } |
2279 | return 0; | 2292 | return 0; |
@@ -2302,7 +2315,7 @@ int drmCommandWrite(int fd, unsigned long drmCommandIndex, void *data, | |||
2302 | request = DRM_IOC( DRM_IOC_WRITE, DRM_IOCTL_BASE, | 2315 | request = DRM_IOC( DRM_IOC_WRITE, DRM_IOCTL_BASE, |
2303 | DRM_COMMAND_BASE + drmCommandIndex, size); | 2316 | DRM_COMMAND_BASE + drmCommandIndex, size); |
2304 | 2317 | ||
2305 | if (ioctl(fd, request, data)) { | 2318 | if (drmIoctl(fd, request, data)) { |
2306 | return -errno; | 2319 | return -errno; |
2307 | } | 2320 | } |
2308 | return 0; | 2321 | return 0; |
@@ -2331,9 +2344,8 @@ int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, void *data, | |||
2331 | request = DRM_IOC( DRM_IOC_READ|DRM_IOC_WRITE, DRM_IOCTL_BASE, | 2344 | request = DRM_IOC( DRM_IOC_READ|DRM_IOC_WRITE, DRM_IOCTL_BASE, |
2332 | DRM_COMMAND_BASE + drmCommandIndex, size); | 2345 | DRM_COMMAND_BASE + drmCommandIndex, size); |
2333 | 2346 | ||
2334 | if (ioctl(fd, request, data)) { | 2347 | if (drmIoctl(fd, request, data)) |
2335 | return -errno; | 2348 | return -errno; |
2336 | } | ||
2337 | return 0; | 2349 | return 0; |
2338 | } | 2350 | } |
2339 | 2351 | ||
@@ -2355,7 +2367,7 @@ int drmFenceCreate(int fd, unsigned flags, int fence_class, unsigned type, | |||
2355 | arg.type = type; | 2367 | arg.type = type; |
2356 | arg.fence_class = fence_class; | 2368 | arg.fence_class = fence_class; |
2357 | 2369 | ||
2358 | if (ioctl(fd, DRM_IOCTL_FENCE_CREATE, &arg)) | 2370 | if (drmIoctl(fd, DRM_IOCTL_FENCE_CREATE, &arg)) |
2359 | return -errno; | 2371 | return -errno; |
2360 | fence->handle = arg.handle; | 2372 | fence->handle = arg.handle; |
2361 | fence->fence_class = arg.fence_class; | 2373 | fence->fence_class = arg.fence_class; |
@@ -2379,7 +2391,7 @@ int drmFenceBuffers(int fd, unsigned flags, uint32_t fence_class, drmFence *fenc | |||
2379 | arg.flags = flags; | 2391 | arg.flags = flags; |
2380 | arg.fence_class = fence_class; | 2392 | arg.fence_class = fence_class; |
2381 | 2393 | ||
2382 | if (ioctl(fd, DRM_IOCTL_FENCE_BUFFERS, &arg)) | 2394 | if (drmIoctl(fd, DRM_IOCTL_FENCE_BUFFERS, &arg)) |
2383 | return -errno; | 2395 | return -errno; |
2384 | fence->handle = arg.handle; | 2396 | fence->handle = arg.handle; |
2385 | fence->fence_class = arg.fence_class; | 2397 | fence->fence_class = arg.fence_class; |
@@ -2397,7 +2409,7 @@ int drmFenceReference(int fd, unsigned handle, drmFence *fence) | |||
2397 | memset(&arg, 0, sizeof(arg)); | 2409 | memset(&arg, 0, sizeof(arg)); |
2398 | arg.handle = handle; | 2410 | arg.handle = handle; |
2399 | 2411 | ||
2400 | if (ioctl(fd, DRM_IOCTL_FENCE_REFERENCE, &arg)) | 2412 | if (drmIoctl(fd, DRM_IOCTL_FENCE_REFERENCE, &arg)) |
2401 | return -errno; | 2413 | return -errno; |
2402 | fence->handle = arg.handle; | 2414 | fence->handle = arg.handle; |
2403 | fence->fence_class = arg.fence_class; | 2415 | fence->fence_class = arg.fence_class; |
@@ -2414,7 +2426,7 @@ int drmFenceUnreference(int fd, const drmFence *fence) | |||
2414 | memset(&arg, 0, sizeof(arg)); | 2426 | memset(&arg, 0, sizeof(arg)); |
2415 | arg.handle = fence->handle; | 2427 | arg.handle = fence->handle; |
2416 | 2428 | ||
2417 | if (ioctl(fd, DRM_IOCTL_FENCE_UNREFERENCE, &arg)) | 2429 | if (drmIoctl(fd, DRM_IOCTL_FENCE_UNREFERENCE, &arg)) |
2418 | return -errno; | 2430 | return -errno; |
2419 | return 0; | 2431 | return 0; |
2420 | } | 2432 | } |
@@ -2427,7 +2439,7 @@ int drmFenceFlush(int fd, drmFence *fence, unsigned flush_type) | |||
2427 | arg.handle = fence->handle; | 2439 | arg.handle = fence->handle; |
2428 | arg.type = flush_type; | 2440 | arg.type = flush_type; |
2429 | 2441 | ||
2430 | if (ioctl(fd, DRM_IOCTL_FENCE_FLUSH, &arg)) | 2442 | if (drmIoctl(fd, DRM_IOCTL_FENCE_FLUSH, &arg)) |
2431 | return -errno; | 2443 | return -errno; |
2432 | fence->fence_class = arg.fence_class; | 2444 | fence->fence_class = arg.fence_class; |
2433 | fence->type = arg.type; | 2445 | fence->type = arg.type; |
@@ -2442,7 +2454,7 @@ int drmFenceUpdate(int fd, drmFence *fence) | |||
2442 | memset(&arg, 0, sizeof(arg)); | 2454 | memset(&arg, 0, sizeof(arg)); |
2443 | arg.handle = fence->handle; | 2455 | arg.handle = fence->handle; |
2444 | 2456 | ||
2445 | if (ioctl(fd, DRM_IOCTL_FENCE_SIGNALED, &arg)) | 2457 | if (drmIoctl(fd, DRM_IOCTL_FENCE_SIGNALED, &arg)) |
2446 | return -errno; | 2458 | return -errno; |
2447 | fence->fence_class = arg.fence_class; | 2459 | fence->fence_class = arg.fence_class; |
2448 | fence->type = arg.type; | 2460 | fence->type = arg.type; |
@@ -2482,7 +2494,7 @@ int drmFenceEmit(int fd, unsigned flags, drmFence *fence, unsigned emit_type) | |||
2482 | arg.handle = fence->handle; | 2494 | arg.handle = fence->handle; |
2483 | arg.type = emit_type; | 2495 | arg.type = emit_type; |
2484 | 2496 | ||
2485 | if (ioctl(fd, DRM_IOCTL_FENCE_EMIT, &arg)) | 2497 | if (drmIoctl(fd, DRM_IOCTL_FENCE_EMIT, &arg)) |
2486 | return -errno; | 2498 | return -errno; |
2487 | fence->fence_class = arg.fence_class; | 2499 | fence->fence_class = arg.fence_class; |
2488 | fence->type = arg.type; | 2500 | fence->type = arg.type; |
@@ -2520,7 +2532,7 @@ drmIoctlTimeout(int fd, unsigned long request, void *argp) | |||
2520 | int ret; | 2532 | int ret; |
2521 | 2533 | ||
2522 | do { | 2534 | do { |
2523 | ret = ioctl(fd, request, argp); | 2535 | ret = drmIoctl(fd, request, argp); |
2524 | if (ret != 0 && errno == EAGAIN) { | 2536 | if (ret != 0 && errno == EAGAIN) { |
2525 | if (!haveThen) { | 2537 | if (!haveThen) { |
2526 | gettimeofday(&then, NULL); | 2538 | gettimeofday(&then, NULL); |
@@ -2630,7 +2642,7 @@ int drmBOReference(int fd, unsigned handle, drmBO *buf) | |||
2630 | memset(&arg, 0, sizeof(arg)); | 2642 | memset(&arg, 0, sizeof(arg)); |
2631 | req->handle = handle; | 2643 | req->handle = handle; |
2632 | 2644 | ||
2633 | if (ioctl(fd, DRM_IOCTL_BO_REFERENCE, &arg)) | 2645 | if (drmIoctl(fd, DRM_IOCTL_BO_REFERENCE, &arg)) |
2634 | return -errno; | 2646 | return -errno; |
2635 | 2647 | ||
2636 | drmBOCopyReply(rep, buf); | 2648 | drmBOCopyReply(rep, buf); |
@@ -2654,7 +2666,7 @@ int drmBOUnreference(int fd, drmBO *buf) | |||
2654 | memset(&arg, 0, sizeof(arg)); | 2666 | memset(&arg, 0, sizeof(arg)); |
2655 | arg.handle = buf->handle; | 2667 | arg.handle = buf->handle; |
2656 | 2668 | ||
2657 | if (ioctl(fd, DRM_IOCTL_BO_UNREFERENCE, &arg)) | 2669 | if (drmIoctl(fd, DRM_IOCTL_BO_UNREFERENCE, &arg)) |
2658 | return -errno; | 2670 | return -errno; |
2659 | 2671 | ||
2660 | buf->handle = 0; | 2672 | buf->handle = 0; |
@@ -2724,7 +2736,7 @@ int drmBOUnmap(int fd, drmBO *buf) | |||
2724 | memset(&arg, 0, sizeof(arg)); | 2736 | memset(&arg, 0, sizeof(arg)); |
2725 | arg.handle = buf->handle; | 2737 | arg.handle = buf->handle; |
2726 | 2738 | ||
2727 | if (ioctl(fd, DRM_IOCTL_BO_UNMAP, &arg)) { | 2739 | if (drmIoctl(fd, DRM_IOCTL_BO_UNMAP, &arg)) { |
2728 | return -errno; | 2740 | return -errno; |
2729 | } | 2741 | } |
2730 | buf->mapCount--; | 2742 | buf->mapCount--; |
@@ -2770,7 +2782,7 @@ int drmBOInfo(int fd, drmBO *buf) | |||
2770 | memset(&arg, 0, sizeof(arg)); | 2782 | memset(&arg, 0, sizeof(arg)); |
2771 | req->handle = buf->handle; | 2783 | req->handle = buf->handle; |
2772 | 2784 | ||
2773 | ret = ioctl(fd, DRM_IOCTL_BO_INFO, &arg); | 2785 | ret = drmIoctl(fd, DRM_IOCTL_BO_INFO, &arg); |
2774 | if (ret) | 2786 | if (ret) |
2775 | return -errno; | 2787 | return -errno; |
2776 | 2788 | ||
@@ -2825,7 +2837,7 @@ int drmMMInit(int fd, unsigned long pOffset, unsigned long pSize, | |||
2825 | arg.p_size = pSize; | 2837 | arg.p_size = pSize; |
2826 | arg.mem_type = memType; | 2838 | arg.mem_type = memType; |
2827 | 2839 | ||
2828 | if (ioctl(fd, DRM_IOCTL_MM_INIT, &arg)) | 2840 | if (drmIoctl(fd, DRM_IOCTL_MM_INIT, &arg)) |
2829 | return -errno; | 2841 | return -errno; |
2830 | return 0; | 2842 | return 0; |
2831 | } | 2843 | } |
@@ -2837,7 +2849,7 @@ int drmMMTakedown(int fd, unsigned memType) | |||
2837 | memset(&arg, 0, sizeof(arg)); | 2849 | memset(&arg, 0, sizeof(arg)); |
2838 | arg.mem_type = memType; | 2850 | arg.mem_type = memType; |
2839 | 2851 | ||
2840 | if (ioctl(fd, DRM_IOCTL_MM_TAKEDOWN, &arg)) | 2852 | if (drmIoctl(fd, DRM_IOCTL_MM_TAKEDOWN, &arg)) |
2841 | return -errno; | 2853 | return -errno; |
2842 | return 0; | 2854 | return 0; |
2843 | } | 2855 | } |
@@ -2879,7 +2891,7 @@ int drmMMInfo(int fd, unsigned memType, uint64_t *size) | |||
2879 | 2891 | ||
2880 | arg.mem_type = memType; | 2892 | arg.mem_type = memType; |
2881 | 2893 | ||
2882 | if (ioctl(fd, DRM_IOCTL_MM_INFO, &arg)) | 2894 | if (drmIoctl(fd, DRM_IOCTL_MM_INFO, &arg)) |
2883 | return -errno; | 2895 | return -errno; |
2884 | 2896 | ||
2885 | *size = arg.p_size; | 2897 | *size = arg.p_size; |
@@ -2894,7 +2906,7 @@ int drmBOVersion(int fd, unsigned int *major, | |||
2894 | int ret; | 2906 | int ret; |
2895 | 2907 | ||
2896 | memset(&arg, 0, sizeof(arg)); | 2908 | memset(&arg, 0, sizeof(arg)); |
2897 | ret = ioctl(fd, DRM_IOCTL_BO_VERSION, &arg); | 2909 | ret = drmIoctl(fd, DRM_IOCTL_BO_VERSION, &arg); |
2898 | if (ret) | 2910 | if (ret) |
2899 | return -errno; | 2911 | return -errno; |
2900 | 2912 | ||