aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/dristat.c3
-rw-r--r--tests/drmtest.c4
-rw-r--r--tests/modeprint/modeprint.c8
-rw-r--r--tests/modetest/modetest.c38
-rw-r--r--xf86drmSL.c3
5 files changed, 26 insertions, 30 deletions
diff --git a/tests/dristat.c b/tests/dristat.c
index 48c3b51b..900a3e6e 100644
--- a/tests/dristat.c
+++ b/tests/dristat.c
@@ -108,7 +108,8 @@ static void getvm(int fd)
108 flagname[6] = '\0'; 108 flagname[6] = '\0';
109 109
110 printf(" %4d 0x%08lx 0x%08lx %3.3s %6.6s 0x%08lx ", 110 printf(" %4d 0x%08lx 0x%08lx %3.3s %6.6s 0x%08lx ",
111 i, offset, (unsigned long)size, typename, flagname, handle); 111 i, (unsigned long)offset, (unsigned long)size,
112 typename, flagname, (unsigned long)handle);
112 if (mtrr < 0) printf("none\n"); 113 if (mtrr < 0) printf("none\n");
113 else printf("%4d\n", mtrr); 114 else printf("%4d\n", mtrr);
114 } 115 }
diff --git a/tests/drmtest.c b/tests/drmtest.c
index 15e5c4ae..685a6527 100644
--- a/tests/drmtest.c
+++ b/tests/drmtest.c
@@ -25,9 +25,11 @@
25 * 25 *
26 */ 26 */
27 27
28#include <string.h>
28#include <fcntl.h> 29#include <fcntl.h>
29#include <fnmatch.h> 30#include <fnmatch.h>
30#include <sys/stat.h> 31#include <sys/stat.h>
32#include <sys/ioctl.h>
31#include "drmtest.h" 33#include "drmtest.h"
32 34
33#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE 35#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE
@@ -60,7 +62,7 @@ int drm_open_matching(const char *pci_glob, int flags)
60 struct udev_device *device, *parent; 62 struct udev_device *device, *parent;
61 struct udev_list_entry *entry; 63 struct udev_list_entry *entry;
62 const char *pci_id, *path; 64 const char *pci_id, *path;
63 int i, fd; 65 int fd;
64 66
65 udev = udev_new(); 67 udev = udev_new();
66 if (udev == NULL) { 68 if (udev == NULL) {
diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c
index 595d4447..89719147 100644
--- a/tests/modeprint/modeprint.c
+++ b/tests/modeprint/modeprint.c
@@ -89,7 +89,7 @@ int printMode(struct drm_mode_modeinfo *mode)
89 89
90int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t value) 90int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t value)
91{ 91{
92 const unsigned char *name = NULL; 92 const char *name = NULL;
93 int j; 93 int j;
94 94
95 printf("Property: %s\n", props->name); 95 printf("Property: %s\n", props->name);
@@ -101,7 +101,7 @@ int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t
101 if (props->count_values) { 101 if (props->count_values) {
102 printf("\tvalues :"); 102 printf("\tvalues :");
103 for (j = 0; j < props->count_values; j++) 103 for (j = 0; j < props->count_values; j++)
104 printf(" %lld", props->values[j]); 104 printf(" %llu", props->values[j]);
105 printf("\n"); 105 printf("\n");
106 } 106 }
107 107
@@ -116,7 +116,7 @@ int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t
116 printf("blob is %d length, %08X\n", blob->length, *(uint32_t *)blob->data); 116 printf("blob is %d length, %08X\n", blob->length, *(uint32_t *)blob->data);
117 drmModeFreePropertyBlob(blob); 117 drmModeFreePropertyBlob(blob);
118 } else { 118 } else {
119 printf("error getting blob %lld\n", value); 119 printf("error getting blob %llu\n", value);
120 } 120 }
121 121
122 } else { 122 } else {
@@ -169,7 +169,7 @@ int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, uin
169 169
170 if (modes) { 170 if (modes) {
171 for (i = 0; i < connector->count_modes; i++) { 171 for (i = 0; i < connector->count_modes; i++) {
172 mode = &connector->modes[i]; 172 mode = (struct drm_mode_modeinfo *)&connector->modes[i];
173 printMode(mode); 173 printMode(mode);
174 } 174 }
175 } 175 }
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 34d40ca9..26405f49 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -47,6 +47,7 @@
47#include <string.h> 47#include <string.h>
48#include <errno.h> 48#include <errno.h>
49#include <sys/poll.h> 49#include <sys/poll.h>
50#include <sys/time.h>
50 51
51#include "xf86drm.h" 52#include "xf86drm.h"
52#include "xf86drmMode.h" 53#include "xf86drmMode.h"
@@ -255,9 +256,10 @@ void dump_framebuffers(void)
255 resources->fbs[i], strerror(errno)); 256 resources->fbs[i], strerror(errno));
256 continue; 257 continue;
257 } 258 }
258 printf("%d\t(%dx%d)\t%d\n", 259 printf("%u\t(%ux%u)\t%u\n",
259 fb->fb_id, 260 fb->fb_id,
260 fb->width, fb->height); 261 fb->width, fb->height,
262 fb->pitch);
261 263
262 drmModeFreeFB(fb); 264 drmModeFreeFB(fb);
263 } 265 }
@@ -272,7 +274,7 @@ void dump_framebuffers(void)
272 * can bind it with a free crtc. 274 * can bind it with a free crtc.
273 */ 275 */
274struct connector { 276struct connector {
275 int id; 277 uint32_t id;
276 char mode_str[64]; 278 char mode_str[64];
277 drmModeModeInfo *mode; 279 drmModeModeInfo *mode;
278 drmModeEncoder *encoder; 280 drmModeEncoder *encoder;
@@ -287,7 +289,7 @@ static void
287connector_find_mode(struct connector *c) 289connector_find_mode(struct connector *c)
288{ 290{
289 drmModeConnector *connector; 291 drmModeConnector *connector;
290 int i, j, size, ret, width, height; 292 int i, j;
291 293
292 /* First, find the connector & mode */ 294 /* First, find the connector & mode */
293 c->mode = NULL; 295 c->mode = NULL;
@@ -358,7 +360,7 @@ create_test_buffer(drm_intel_bufmgr *bufmgr,
358{ 360{
359 drm_intel_bo *bo; 361 drm_intel_bo *bo;
360 unsigned int *fb_ptr; 362 unsigned int *fb_ptr;
361 int size, ret, i, stride; 363 int size, i, stride;
362 div_t d; 364 div_t d;
363 cairo_surface_t *surface; 365 cairo_surface_t *surface;
364 cairo_t *cr; 366 cairo_t *cr;
@@ -472,9 +474,7 @@ create_grey_buffer(drm_intel_bufmgr *bufmgr,
472 int width, int height, int *stride_out, drm_intel_bo **bo_out) 474 int width, int height, int *stride_out, drm_intel_bo **bo_out)
473{ 475{
474 drm_intel_bo *bo; 476 drm_intel_bo *bo;
475 unsigned int *fb_ptr; 477 int size, ret, stride;
476 int size, ret, i, stride;
477 div_t d;
478 478
479 /* Mode size at 32 bpp */ 479 /* Mode size at 32 bpp */
480 stride = width * 4; 480 stride = width * 4;
@@ -509,7 +509,6 @@ page_flip_handler(int fd, unsigned int frame,
509{ 509{
510 struct connector *c; 510 struct connector *c;
511 unsigned int new_fb_id; 511 unsigned int new_fb_id;
512 int len, ms;
513 struct timeval end; 512 struct timeval end;
514 double t; 513 double t;
515 514
@@ -536,13 +535,10 @@ page_flip_handler(int fd, unsigned int frame,
536static void 535static void
537set_mode(struct connector *c, int count, int page_flip) 536set_mode(struct connector *c, int count, int page_flip)
538{ 537{
539 drmModeConnector *connector;
540 drmModeEncoder *encoder = NULL;
541 struct drm_mode_modeinfo *mode = NULL;
542 drm_intel_bufmgr *bufmgr; 538 drm_intel_bufmgr *bufmgr;
543 drm_intel_bo *bo, *other_bo; 539 drm_intel_bo *bo, *other_bo;
544 unsigned int fb_id, other_fb_id; 540 unsigned int fb_id, other_fb_id;
545 int i, j, ret, width, height, x, stride; 541 int i, ret, width, height, x, stride;
546 drmEventContext evctx; 542 drmEventContext evctx;
547 543
548 width = 0; 544 width = 0;
@@ -611,9 +607,9 @@ set_mode(struct connector *c, int count, int page_flip)
611 DRM_MODE_PAGE_FLIP_EVENT, &c[i]); 607 DRM_MODE_PAGE_FLIP_EVENT, &c[i]);
612 gettimeofday(&c[i].start, NULL); 608 gettimeofday(&c[i].start, NULL);
613 c[i].swap_count = 0; 609 c[i].swap_count = 0;
614 c[i].fb_id[0] = fb_id; 610 c[i].fb_id[0] = fb_id;
615 c[i].fb_id[1] = other_fb_id; 611 c[i].fb_id[1] = other_fb_id;
616 c[i].current_fb_id = fb_id; 612 c[i].current_fb_id = fb_id;
617 } 613 }
618 614
619 memset(&evctx, 0, sizeof evctx); 615 memset(&evctx, 0, sizeof evctx);
@@ -676,7 +672,7 @@ static int page_flipping_supported(int fd)
676 return 0; 672 return 0;
677 } 673 }
678 674
679 return gp.value; 675 return *gp.value;
680} 676}
681 677
682int main(int argc, char **argv) 678int main(int argc, char **argv)
@@ -685,8 +681,8 @@ int main(int argc, char **argv)
685 int encoders = 0, connectors = 0, crtcs = 0, framebuffers = 0; 681 int encoders = 0, connectors = 0, crtcs = 0, framebuffers = 0;
686 int test_vsync = 0; 682 int test_vsync = 0;
687 char *modules[] = { "i915", "radeon" }; 683 char *modules[] = { "i915", "radeon" };
688 char *modeset = NULL, *mode, *connector; 684 char *modeset = NULL;
689 int i, connector_id, count = 0; 685 int i, count = 0;
690 struct connector con_args[2]; 686 struct connector con_args[2];
691 687
692 opterr = 0; 688 opterr = 0;
@@ -715,11 +711,11 @@ int main(int argc, char **argv)
715 con_args[count].crtc = -1; 711 con_args[count].crtc = -1;
716 if (sscanf(optarg, "%d:%64s", 712 if (sscanf(optarg, "%d:%64s",
717 &con_args[count].id, 713 &con_args[count].id,
718 &con_args[count].mode_str) != 2 && 714 con_args[count].mode_str) != 2 &&
719 sscanf(optarg, "%d@%d:%64s", 715 sscanf(optarg, "%d@%d:%64s",
720 &con_args[count].id, 716 &con_args[count].id,
721 &con_args[count].crtc, 717 &con_args[count].crtc,
722 &con_args[count].mode_str) != 3) 718 con_args[count].mode_str) != 3)
723 usage(argv[0]); 719 usage(argv[0]);
724 count++; 720 count++;
725 break; 721 break;
diff --git a/xf86drmSL.c b/xf86drmSL.c
index 58aefac7..acddb541 100644
--- a/xf86drmSL.c
+++ b/xf86drmSL.c
@@ -265,11 +265,8 @@ int drmSLLookupNeighbors(void *l, unsigned long key,
265{ 265{
266 SkipListPtr list = (SkipListPtr)l; 266 SkipListPtr list = (SkipListPtr)l;
267 SLEntryPtr update[SL_MAX_LEVEL + 1]; 267 SLEntryPtr update[SL_MAX_LEVEL + 1];
268 SLEntryPtr entry;
269 int retcode = 0; 268 int retcode = 0;
270 269
271 entry = SLLocate(list, key, update);
272
273 *prev_key = *next_key = key; 270 *prev_key = *next_key = key;
274 *prev_value = *next_value = NULL; 271 *prev_value = *next_value = NULL;
275 272