From: Philipp Zabel
Date: Fri, 28 Apr 2017 11:14:20 +0000 (+0200)
Subject: renderonly: use drmIoctl
X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b539335e50b355854202c4b1b42aa4ddbe9289fa;p=mesa.git
renderonly: use drmIoctl
To restart interrupted system calls, use drmIoctl.
Fixes: 848b49b288f ("gallium: add renderonly library")
CC:
Suggested-by: Emil Velikov
Signed-off-by: Philipp Zabel
Reviewed-by: Eric Engestrom
Reviewed-by: Christian Gmeiner
---
diff --git a/src/gallium/auxiliary/renderonly/renderonly.c b/src/gallium/auxiliary/renderonly/renderonly.c
index f377c368e57..2fe10090163 100644
--- a/src/gallium/auxiliary/renderonly/renderonly.c
+++ b/src/gallium/auxiliary/renderonly/renderonly.c
@@ -29,7 +29,6 @@
#include
#include
#include
-#include
#include
#include "state_tracker/drm_driver.h"
@@ -74,7 +73,7 @@ renderonly_scanout_destroy(struct renderonly_scanout *scanout,
pipe_resource_reference(&scanout->prime, NULL);
if (ro->kms_fd != -1) {
destroy_dumb.handle = scanout->handle;
- ioctl(ro->kms_fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_dumb);
+ drmIoctl(ro->kms_fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_dumb);
}
FREE(scanout);
}
@@ -99,7 +98,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc,
return NULL;
/* create dumb buffer at scanout GPU */
- err = ioctl(ro->kms_fd, DRM_IOCTL_MODE_CREATE_DUMB, &create_dumb);
+ err = drmIoctl(ro->kms_fd, DRM_IOCTL_MODE_CREATE_DUMB, &create_dumb);
if (err < 0) {
fprintf(stderr, "DRM_IOCTL_MODE_CREATE_DUMB failed: %s\n",
strerror(errno));
@@ -136,7 +135,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc,
free_dumb:
destroy_dumb.handle = scanout->handle;
- ioctl(ro->kms_fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_dumb);
+ drmIoctl(ro->kms_fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_dumb);
free_scanout:
FREE(scanout);