summaryrefslogtreecommitdiff
path: root/lib/libdrm/tests
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-03-20 10:20:10 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-03-20 10:20:10 +0000
commit49160d9f623dab3623d3a2886e969fa1bb9e371a (patch)
tree4fc19a231f0892d1ccd309aabeb07ed849af7cec /lib/libdrm/tests
parentb8de4ba87f903c1a2d8992a7113256835046fdae (diff)
Import libdrm 2.4.67
Diffstat (limited to 'lib/libdrm/tests')
-rw-r--r--lib/libdrm/tests/kms/kms-steal-crtc.c7
-rw-r--r--lib/libdrm/tests/kms/kms-universal-planes.c8
-rw-r--r--lib/libdrm/tests/kms/libkms-test-crtc.c4
-rw-r--r--lib/libdrm/tests/kms/libkms-test-device.c13
-rw-r--r--lib/libdrm/tests/kms/libkms-test-framebuffer.c4
-rw-r--r--lib/libdrm/tests/kms/libkms-test-plane.c8
-rw-r--r--lib/libdrm/tests/kms/libkms-test-screen.c8
7 files changed, 36 insertions, 16 deletions
diff --git a/lib/libdrm/tests/kms/kms-steal-crtc.c b/lib/libdrm/tests/kms/kms-steal-crtc.c
index 4d884c079..497772e23 100644
--- a/lib/libdrm/tests/kms/kms-steal-crtc.c
+++ b/lib/libdrm/tests/kms/kms-steal-crtc.c
@@ -21,14 +21,17 @@
* IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
-#include <stdint.h>
#include <string.h>
#include <unistd.h>
-#if HAVE_SYS_SELECT_H
+#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
diff --git a/lib/libdrm/tests/kms/kms-universal-planes.c b/lib/libdrm/tests/kms/kms-universal-planes.c
index 1d7938802..d8e5fc48f 100644
--- a/lib/libdrm/tests/kms/kms-universal-planes.c
+++ b/lib/libdrm/tests/kms/kms-universal-planes.c
@@ -21,6 +21,10 @@
* IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <fcntl.h>
#include <getopt.h>
#include <stdbool.h>
@@ -28,7 +32,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
-#if HAVE_SYS_SELECT_H
+#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
@@ -208,9 +212,9 @@ int main(int argc, char *argv[])
printf("Planes: %u\n", device->num_planes);
for (i = 0; i < device->num_planes; i++) {
+ struct kms_plane *plane = device->planes[i];
const char *type = NULL;
- plane = device->planes[i];
switch (plane->type) {
case DRM_PLANE_TYPE_OVERLAY:
type = "overlay";
diff --git a/lib/libdrm/tests/kms/libkms-test-crtc.c b/lib/libdrm/tests/kms/libkms-test-crtc.c
index 2c28face0..3adb49039 100644
--- a/lib/libdrm/tests/kms/libkms-test-crtc.c
+++ b/lib/libdrm/tests/kms/libkms-test-crtc.c
@@ -21,6 +21,10 @@
* IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "libkms-test.h"
struct kms_crtc *kms_crtc_create(struct kms_device *device, uint32_t id)
diff --git a/lib/libdrm/tests/kms/libkms-test-device.c b/lib/libdrm/tests/kms/libkms-test-device.c
index d3bb11ce1..53c7349b8 100644
--- a/lib/libdrm/tests/kms/libkms-test-device.c
+++ b/lib/libdrm/tests/kms/libkms-test-device.c
@@ -21,6 +21,10 @@
* IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -63,7 +67,7 @@ static void kms_device_probe_screens(struct kms_device *device)
device->screens = calloc(res->count_connectors, sizeof(screen));
if (!device->screens)
- goto err_free_resources;
+ return;
for (i = 0; i < res->count_connectors; i++) {
unsigned int *count;
@@ -93,7 +97,6 @@ static void kms_device_probe_screens(struct kms_device *device)
device->num_screens++;
}
-err_free_resources:
drmModeFreeResources(res);
}
@@ -109,7 +112,7 @@ static void kms_device_probe_crtcs(struct kms_device *device)
device->crtcs = calloc(res->count_crtcs, sizeof(crtc));
if (!device->crtcs)
- goto err_free_resources;
+ return;
for (i = 0; i < res->count_crtcs; i++) {
crtc = kms_crtc_create(device, res->crtcs[i]);
@@ -120,7 +123,6 @@ static void kms_device_probe_crtcs(struct kms_device *device)
device->num_crtcs++;
}
-err_free_resources:
drmModeFreeResources(res);
}
@@ -136,7 +138,7 @@ static void kms_device_probe_planes(struct kms_device *device)
device->planes = calloc(res->count_planes, sizeof(plane));
if (!device->planes)
- goto err_free_resources;
+ return;
for (i = 0; i < res->count_planes; i++) {
plane = kms_plane_create(device, res->planes[i]);
@@ -147,7 +149,6 @@ static void kms_device_probe_planes(struct kms_device *device)
device->num_planes++;
}
-err_free_resources:
drmModeFreePlaneResources(res);
}
diff --git a/lib/libdrm/tests/kms/libkms-test-framebuffer.c b/lib/libdrm/tests/kms/libkms-test-framebuffer.c
index 9bb2d95b6..c9e5ad3c2 100644
--- a/lib/libdrm/tests/kms/libkms-test-framebuffer.c
+++ b/lib/libdrm/tests/kms/libkms-test-framebuffer.c
@@ -21,6 +21,10 @@
* IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <errno.h>
#include <string.h>
diff --git a/lib/libdrm/tests/kms/libkms-test-plane.c b/lib/libdrm/tests/kms/libkms-test-plane.c
index 4cb27378a..8eb78af1d 100644
--- a/lib/libdrm/tests/kms/libkms-test-plane.c
+++ b/lib/libdrm/tests/kms/libkms-test-plane.c
@@ -21,6 +21,10 @@
* IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <errno.h>
#include <string.h>
@@ -55,10 +59,8 @@ static int kms_plane_probe(struct kms_plane *plane)
}
plane->formats = calloc(p->count_formats, sizeof(uint32_t));
- if (!plane->formats) {
- drmModeFreePlane(p);
+ if (!plane->formats)
return -ENOMEM;
- }
for (i = 0; i < p->count_formats; i++)
plane->formats[i] = p->formats[i];
diff --git a/lib/libdrm/tests/kms/libkms-test-screen.c b/lib/libdrm/tests/kms/libkms-test-screen.c
index d00ae5477..336902228 100644
--- a/lib/libdrm/tests/kms/libkms-test-screen.c
+++ b/lib/libdrm/tests/kms/libkms-test-screen.c
@@ -21,6 +21,10 @@
* IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <errno.h>
#include <string.h>
@@ -42,9 +46,7 @@ static void kms_screen_probe(struct kms_screen *screen)
else
screen->connected = false;
- if (con->modes)
- memcpy(&screen->mode, &con->modes[0], sizeof(drmModeModeInfo));
-
+ memcpy(&screen->mode, &con->modes[0], sizeof(drmModeModeInfo));
screen->width = screen->mode.hdisplay;
screen->height = screen->mode.vdisplay;