aboutsummaryrefslogtreecommitdiffstats
path: root/virtiotest.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-10-15 15:35:51 +0200
committerGerd Hoffmann <kraxel@redhat.com>2018-10-15 15:35:51 +0200
commit3df9f3572bb4e5da99aa2d9fd5c031cdb1653bfd (patch)
treef735d92612d7d8348d848ff3e8a924ea4eae8727 /virtiotest.c
parent234100550533c5e58d9b3ec9bc8d371ca0ecec32 (diff)
downloaddrminfo-3df9f3572bb4e5da99aa2d9fd5c031cdb1653bfd.tar.gz
fix getparam ioctl
Diffstat (limited to 'virtiotest.c')
-rw-r--r--virtiotest.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/virtiotest.c b/virtiotest.c
index 2278433..bf16bc8 100644
--- a/virtiotest.c
+++ b/virtiotest.c
@@ -38,19 +38,19 @@ static struct {
static uint64_t virtio_get_cap(uint64_t cap)
{
- struct drm_virtgpu_getparam param = {
- .param = cap,
- .value = 0,
- };
+ struct drm_virtgpu_getparam args;
+ int value = 0;
int rc;
- rc = drmIoctl(fd, DRM_IOCTL_VIRTGPU_GETPARAM, &param);
+ args.param = cap;
+ args.value = (intptr_t)(&value);
+ rc = drmIoctl(fd, DRM_IOCTL_VIRTGPU_GETPARAM, &args);
if (rc != 0) {
fprintf(stderr, "ioctl DRM_IOCTL_VIRTGPU_GETPARAM(%" PRId64 "): %s\n",
cap, strerror(errno));
exit(1);
}
- return param.value;
+ return value;
}
static void virtio_print_caps(void)