Commit 31c66e85 authored by Philipp Zabel's avatar Philipp Zabel Committed by Andres Gomez

renderonly: use drmIoctl

To restart interrupted system calls, use drmIoctl.

Fixes: 848b49b2 ("gallium: add renderonly library")
CC: <mesa-stable@lists.freedesktop.org>
Suggested-by: Emil Velikov's avatarEmil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Philipp Zabel's avatarPhilipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Christian Gmeiner's avatarChristian Gmeiner <christian.gmeiner@gmail.com>
(cherry picked from commit b539335e)
parent 9eba1e92
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <sys/ioctl.h>
#include <xf86drm.h> #include <xf86drm.h>
#include "state_tracker/drm_driver.h" #include "state_tracker/drm_driver.h"
...@@ -74,7 +73,7 @@ renderonly_scanout_destroy(struct renderonly_scanout *scanout, ...@@ -74,7 +73,7 @@ renderonly_scanout_destroy(struct renderonly_scanout *scanout,
pipe_resource_reference(&scanout->prime, NULL); pipe_resource_reference(&scanout->prime, NULL);
if (ro->kms_fd != -1) { if (ro->kms_fd != -1) {
destroy_dumb.handle = scanout->handle; 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);
} }
...@@ -99,7 +98,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc, ...@@ -99,7 +98,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc,
return NULL; return NULL;
/* create dumb buffer at scanout GPU */ /* 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) { if (err < 0) {
fprintf(stderr, "DRM_IOCTL_MODE_CREATE_DUMB failed: %s\n", fprintf(stderr, "DRM_IOCTL_MODE_CREATE_DUMB failed: %s\n",
strerror(errno)); strerror(errno));
...@@ -136,7 +135,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc, ...@@ -136,7 +135,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc,
free_dumb: free_dumb:
destroy_dumb.handle = scanout->handle; 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:
FREE(scanout); FREE(scanout);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment