num_trash_bos = gem_mappable_aperture_size() / (1024*1024);
trash_bos = malloc(num_trash_bos * sizeof(drm_intel_bo *));
- assert(trash_bos);
+ igt_assert(trash_bos);
for (i = 0; i < num_trash_bos; i++)
trash_bos[i] = drm_intel_bo_alloc(bufmgr, "trash bo", 1024*1024, 4096);
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <assert.h>
#include <errno.h>
#include <stdbool.h>
#include <setjmp.h>
#include <libgen.h>
#endif
#include <stdio.h>
+#include <assert.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
va_start(ap, fmt);
ret = vasprintf(&text, fmt, ap);
- assert(ret >= 0);
+ igt_assert(ret >= 0);
va_end(ap);
cairo_text_extents(cr, text, &extents);
paint_marker(cr, 0, height);
paint_marker(cr, width, height);
- assert(!cairo_status(cr));
+ igt_assert(!cairo_status(cr));
}
void kmstest_paint_image(cairo_t *cr, const char *filename,
double scale_x, scale_y;
image = cairo_image_surface_create_from_png(filename);
- assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
+ igt_assert(cairo_surface_status(image) == CAIRO_STATUS_SUCCESS);
img_width = cairo_image_surface_get_width(image);
img_height = cairo_image_surface_get_height(image);
#ifndef INTEL_BATCHBUFFER_H
#define INTEL_BATCHBUFFER_H
-#include <assert.h>
#include <stdint.h>
#include "intel_bufmgr.h"
+#include "igt_core.h"
#define BATCH_SZ 4096
#define BATCH_RESERVED 16
static inline void
intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, uint32_t dword)
{
- assert(intel_batchbuffer_space(batch) >= 4);
+ igt_assert(intel_batchbuffer_space(batch) >= 4);
*(uint32_t *) (batch->ptr) = dword;
batch->ptr += 4;
}
intel_batchbuffer_require_space(struct intel_batchbuffer *batch,
unsigned int sz)
{
- assert(sz < BATCH_SZ - BATCH_RESERVED);
+ igt_assert(sz < BATCH_SZ - BATCH_RESERVED);
if (intel_batchbuffer_space(batch) < sz)
intel_batchbuffer_flush(batch);
}
* scope.
*/
#define OUT_RELOC_FENCED(buf, read_domains, write_domain, delta) do { \
- assert((delta) >= 0); \
+ igt_assert((delta) >= 0); \
intel_batchbuffer_emit_reloc(batch, buf, delta, \
read_domains, write_domain, 1); \
} while (0)
* scope.
*/
#define OUT_RELOC(buf, read_domains, write_domain, delta) do { \
- assert((delta) >= 0); \
+ igt_assert((delta) >= 0); \
intel_batchbuffer_emit_reloc(batch, buf, delta, \
read_domains, write_domain, 0); \
} while (0)
return;
#endif
default:
- assert(0);
+ igt_assert(0);
return;
}
}
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <errno.h>
snprintf(tmp, sizeof(tmp) - 1,
"while true; do find %s/%i/ -type f | xargs cat > /dev/null 2>&1; done",
dfs_base, drm_get_card());
- assert(execl("/bin/sh", "sh", "-c", tmp, (char *) NULL) != -1);
+ igt_assert(execl("/bin/sh", "sh", "-c", tmp, (char *) NULL) != -1);
}
sleep(1);
snprintf(tmp, sizeof(tmp) - 1,
"while true; do find %s%i*/ -type f | xargs cat > /dev/null 2>&1; done",
dfs_base, drm_get_card());
- assert(execl("/bin/sh", "sh", "-c", tmp, (char *) NULL) != -1);
+ igt_assert(execl("/bin/sh", "sh", "-c", tmp, (char *) NULL) != -1);
}
sleep(1);
*/
#include <pthread.h>
-#include <assert.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <errno.h>
unsigned int dwords = OBJECT_SIZE >> 2;
const char *tile_str[] = { "none", "x", "y" };
- assert (t->tiling >= 0 && t->tiling <= I915_TILING_Y);
- assert (t->num_surfaces > 0);
+ igt_assert(t->tiling >= 0 && t->tiling <= I915_TILING_Y);
+ igt_assert(t->num_surfaces > 0);
s = calloc(sizeof(*s), t->num_surfaces);
igt_assert(s);
t.num_surfaces = surfaces_per_thread;
num_fences = gem_available_fences(t.fd);
- assert (num_fences > 0);
+ igt_assert(num_fences > 0);
num_threads = threads_per_fence * num_fences;
if (threads_per_fence) {
threads = calloc(sizeof(*threads), num_threads);
- assert (threads != NULL);
+ igt_assert(threads != NULL);
for (n = 0; n < num_threads; n++)
pthread_create (&threads[n], NULL, f, &t);
igt_skip_on_simulation();
igt_subtest("bo-write-verify-none")
- assert (run_test(0, bo_write_verify, I915_TILING_NONE, 80) == 0);
+ igt_assert(run_test(0, bo_write_verify, I915_TILING_NONE, 80) == 0);
igt_subtest("bo-write-verify-x")
- assert (run_test(0, bo_write_verify, I915_TILING_X, 80) == 0);
+ igt_assert(run_test(0, bo_write_verify, I915_TILING_X, 80) == 0);
igt_subtest("bo-write-verify-y")
- assert (run_test(0, bo_write_verify, I915_TILING_Y, 80) == 0);
+ igt_assert(run_test(0, bo_write_verify, I915_TILING_Y, 80) == 0);
igt_subtest("bo-write-verify-threaded-none")
- assert (run_test(5, bo_write_verify, I915_TILING_NONE, 2) == 0);
+ igt_assert(run_test(5, bo_write_verify, I915_TILING_NONE, 2) == 0);
igt_subtest("bo-write-verify-threaded-x") {
- assert (run_test(2, bo_write_verify, I915_TILING_X, 2) == 0);
- assert (run_test(5, bo_write_verify, I915_TILING_X, 2) == 0);
- assert (run_test(10, bo_write_verify, I915_TILING_X, 2) == 0);
- assert (run_test(20, bo_write_verify, I915_TILING_X, 2) == 0);
+ igt_assert(run_test(2, bo_write_verify, I915_TILING_X, 2) == 0);
+ igt_assert(run_test(5, bo_write_verify, I915_TILING_X, 2) == 0);
+ igt_assert(run_test(10, bo_write_verify, I915_TILING_X, 2) == 0);
+ igt_assert(run_test(20, bo_write_verify, I915_TILING_X, 2) == 0);
}
igt_subtest("bo-write-verify-threaded-y") {
- assert (run_test(2, bo_write_verify, I915_TILING_Y, 2) == 0);
- assert (run_test(5, bo_write_verify, I915_TILING_Y, 2) == 0);
- assert (run_test(10, bo_write_verify, I915_TILING_Y, 2) == 0);
- assert (run_test(20, bo_write_verify, I915_TILING_Y, 2) == 0);
+ igt_assert(run_test(2, bo_write_verify, I915_TILING_Y, 2) == 0);
+ igt_assert(run_test(5, bo_write_verify, I915_TILING_Y, 2) == 0);
+ igt_assert(run_test(10, bo_write_verify, I915_TILING_Y, 2) == 0);
+ igt_assert(run_test(20, bo_write_verify, I915_TILING_Y, 2) == 0);
}
igt_subtest("bo-copy")
#include <stdbool.h>
#include <unistd.h>
-#include <assert.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <errno.h>
#include <stdbool.h>
#include <unistd.h>
#include <cairo.h>
-#include <assert.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <errno.h>
#include "config.h"
#endif
-#include <assert.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <errno.h>
* The goal is to simply ensure the basics work.
*/
-#include <assert.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <errno.h>
cmd_address_offset = j * 4;
buf[j++] = target_bo->offset;
}
- assert(j > 0);
+ igt_assert(j > 0);
buf[j++] = 0x42000000 + val;
igt_assert(drm_intel_bo_references(cmd_bo, target_bo) == 0);
* In short: designed for maximum evilness.
*/
-#include <assert.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <errno.h>
#include <stdio.h>
#include <time.h>
-#include <assert.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <fcntl.h>
#include <inttypes.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/types.h>
+#include <assert.h>
#include "drmtest.h"
#include "igt_core.h"
#include "config.h"
#endif
-#include <assert.h>
#include <cairo.h>
#include <errno.h>
#include <stdint.h>
fb_id = kmstest_create_fb(drm_fd, crtc->mode.hdisplay,
crtc->mode.vdisplay, bpp, depth,
enable_tiling, fb_info);
- assert(fb_id > 0);
+ igt_assert(fb_id > 0);
}
static void get_mode_for_crtc(struct crtc_config *crtc,
for (i = 0; i < resources->count_encoders; i++)
if (resources->encoders[i] == encoder->encoder_id)
return i;
- assert(0);
+ igt_assert(0);
}
static void get_crtc_config_str(struct crtc_config *crtc, char *buf,
crtc->cconfs = malloc(sizeof(*crtc->cconfs) *
crtc->connector_count);
- assert(crtc->cconfs);
+ igt_assert(crtc->cconfs);
encoder_mask = 0;
for (j = 0; j < crtc->connector_count; j++) {
igt_assert(connector->count_encoders == 1);
encoder = drmModeGetEncoder(drm_fd,
connector->encoders[0]);
- assert(encoder);
+ igt_assert(encoder);
config_valid &= !!(encoder->possible_crtcs &
(1 << crtc->crtc_idx));
int i;
ids = malloc(sizeof(*ids) * crtc->connector_count);
- assert(ids);
+ igt_assert(ids);
for (i = 0; i < crtc->connector_count; i++)
ids[i] = crtc->cconfs[i].connector->connector_id;
drmModeModeInfo mode;
connector = drmModeGetConnector(drm_fd, connector_id);
- assert(connector);
+ igt_assert(connector);
cconf->connector = connector;
cconf->connected = connector->connection == DRM_MODE_CONNECTED;
int connector_id;
connector_idx = connector_idxs[i];
- assert(connector_idx < resources->count_connectors);
+ igt_assert(connector_idx < resources->count_connectors);
connector_id = resources->connectors[connector_idx];
if (get_one_connector(resources, connector_id, &cconfs[i]) < 0)
int v;
if (!k) {
- assert(set->count < ARRAY_SIZE(set->items));
+ igt_assert(set->count < ARRAY_SIZE(set->items));
set->items[set->count++] = *comb;
return;
}
{
struct combination comb;
- assert(k <= ARRAY_SIZE(set->items[0].elems));
+ igt_assert(k <= ARRAY_SIZE(set->items[0].elems));
set->count = 0;
iterate_combinations(n, k, allow_repetitions, 0, 0, &comb, set);
}
int j;
cconfs = malloc(sizeof(*cconfs) * connector_count);
- assert(cconfs);
+ igt_assert(cconfs);
connector_idxs = &connector_combs.items[i].elems[0];
ret = get_connectors(tconf->resources, connector_idxs,
filter_test_id = atoi(optarg);
break;
default:
- assert(0);
+ igt_assert(0);
}
return 0;
igt_set_vt_graphics_mode();
drm_resources = drmModeGetResources(drm_fd);
- assert(drm_resources);
+ igt_assert(drm_resources);
}
for (i = 0; i < ARRAY_SIZE(tests); i++) {
#define LOAD_HELPER_BO_SIZE (16*1024*1024)
static void load_helper_set_load(enum load load)
{
- assert(lh.igt_proc.running);
+ igt_assert(lh.igt_proc.running);
if (lh.load == load)
return;
break;
}
default:
- assert(0);
+ igt_assert(0);
}
}
case DRM_MODE_FLAG_3D_FRAME_PACKING:
return "FP";
default:
- assert(0);
+ igt_assert(0);
}
}
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
+#include <assert.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>