Commit 9792e7b5 authored by Ville Syrjälä's avatar Ville Syrjälä

s/gem_mmap/gem_mmap__gtt/

Get rid of the gem_mmap() alias of gem_mmap__gtt(). I don't see any
point in having it.
Signed-off-by: Ville Syrjälä's avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent bfea74a9
......@@ -359,7 +359,7 @@ static int prepare_primary_surface(int fd, int prim_width, int prim_height,
if (tiled)
gem_set_tiling(fd, *prim_handle, I915_TILING_X, *prim_stride);
prim_fb_ptr = gem_mmap(fd, *prim_handle, *prim_size, PROT_READ | PROT_WRITE);
prim_fb_ptr = gem_mmap__gtt(fd, *prim_handle, *prim_size, PROT_READ | PROT_WRITE);
if (prim_fb_ptr != NULL) {
// Write primary surface with gray background
......@@ -454,7 +454,7 @@ static int prepare_sprite_surfaces(int fd, int sprite_width, int sprite_height,
gem_set_tiling(fd, sprite_handles[i], I915_TILING_X, *sprite_stride);
// Get pointer to the surface
sprite_fb_ptr = gem_mmap(fd,
sprite_fb_ptr = gem_mmap__gtt(fd,
sprite_handles[i], *sprite_size,
PROT_READ | PROT_WRITE);
......
......@@ -775,7 +775,7 @@ static void destroy_cairo_surface__gtt(void *arg)
static void create_cairo_surface__gtt(int fd, struct igt_fb *fb)
{
fb->cairo_surface =
cairo_image_surface_create_for_data(gem_mmap(fd, fb->gem_handle, fb->size, PROT_READ | PROT_WRITE),
cairo_image_surface_create_for_data(gem_mmap__gtt(fd, fb->gem_handle, fb->size, PROT_READ | PROT_WRITE),
drm_format_to_cairo(fb->drm_format),
fb->width, fb->height, fb->stride);
......
......@@ -76,22 +76,6 @@ void *gem_mmap__wc(int fd, uint32_t handle, uint64_t offset, uint64_t size, unsi
*/
#define gem_require_mmap_wc(fd) igt_require(gem_mmap__has_wc(fd))
/**
* gem_mmap:
* @fd: open i915 drm file descriptor
* @handle: gem buffer object handle
* @size: size of the gem buffer
* @prot: memory protection bits as used by mmap()
*
* This functions wraps up procedure to establish a memory mapping through the
* GTT.
*
* This is a simple convenience alias to gem_mmap__gtt()
*
* Returns: A pointer to the created memory mapping.
*/
#define gem_mmap(fd, handle, size, prot) gem_mmap__gtt(fd, handle, size, prot)
int gem_madvise(int fd, uint32_t handle, int state);
uint32_t gem_context_create(int fd);
......
......@@ -56,19 +56,19 @@ test_fence_restore(int fd, bool tiled2untiled, bool hibernate)
handle_tiled = gem_create(fd, OBJECT_SIZE);
/* Access the buffer objects in the order we want to have the laid out. */
ptr1 = gem_mmap(fd, handle1, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr1 = gem_mmap__gtt(fd, handle1, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr1 != MAP_FAILED);
for (i = 0; i < OBJECT_SIZE/sizeof(uint32_t); i++)
ptr1[i] = i;
ptr_tiled = gem_mmap(fd, handle_tiled, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr_tiled = gem_mmap__gtt(fd, handle_tiled, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr_tiled != MAP_FAILED);
if (tiled2untiled)
gem_set_tiling(fd, handle_tiled, I915_TILING_X, 2048);
for (i = 0; i < OBJECT_SIZE/sizeof(uint32_t); i++)
ptr_tiled[i] = i;
ptr2 = gem_mmap(fd, handle2, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr2 = gem_mmap__gtt(fd, handle2, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr2 != MAP_FAILED);
for (i = 0; i < OBJECT_SIZE/sizeof(uint32_t); i++)
ptr2[i] = i;
......
......@@ -200,7 +200,7 @@ static void run(int object_size)
handle_relocs = gem_create(fd, 4096);
gem_write(fd, handle_relocs, 0, reloc, sizeof(reloc));
gtt_relocs = gem_mmap(fd, handle_relocs, 4096,
gtt_relocs = gem_mmap__gtt(fd, handle_relocs, 4096,
PROT_READ | PROT_WRITE);
igt_assert(gtt_relocs);
......
......@@ -74,7 +74,7 @@ bo_create (int fd, int tiling)
gem_set_tiling(fd, handle, tiling, 1024);
ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr);
gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
......
......@@ -68,7 +68,7 @@ static void performance(void)
for (n = 0; n < count; n++) {
handle[n] = gem_create(fd, OBJECT_SIZE);
ptr[n] = gem_mmap(fd, handle[n], OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr[n] = gem_mmap__gtt(fd, handle[n], OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr[n]);
}
......@@ -176,7 +176,7 @@ static void thread_performance(unsigned mask)
for (n = 0; n < count; n++) {
handle[n] = gem_create(fd, OBJECT_SIZE);
ptr[n] = gem_mmap(fd, handle[n], OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr[n] = gem_mmap__gtt(fd, handle[n], OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr[n]);
if (mask & READ) {
......@@ -257,7 +257,7 @@ static void *no_contention(void *closure)
int n;
for (n = 0; n < t->loops; n++) {
uint32_t *ptr = gem_mmap(t->fd, t->handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
uint32_t *ptr = gem_mmap__gtt(t->fd, t->handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr);
memset(ptr + (rand() % 256) * 4096 / 4, 0, 4096);
munmap(ptr, OBJECT_SIZE);
......
......@@ -59,7 +59,7 @@ create_bo(int fd)
handle = gem_create(fd, OBJ_SIZE);
/* Fill the BO with dwords starting at start_val */
data = gem_mmap(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE);
data = gem_mmap__gtt(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE);
for (i = 0; i < OBJ_SIZE/4; i++)
data[i] = i;
munmap(data, OBJ_SIZE);
......@@ -82,7 +82,7 @@ igt_simple_main
handle = gem_create(fd, OBJ_SIZE);
/* touch one page */
ptr = gem_mmap(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, OBJ_SIZE, PROT_READ | PROT_WRITE);
*ptr = 0xdeadbeef;
munmap(ptr, OBJ_SIZE);
......
......@@ -140,10 +140,10 @@ static void run(data_t *data, int child)
* set-to-gtt-domain within the fault handler.
*/
if (write) {
ptr = gem_mmap(data->fd, handle, size, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(data->fd, handle, size, PROT_READ | PROT_WRITE);
ptr[rand() % (size / 4)] = canary;
} else
ptr = gem_mmap(data->fd, handle, size, PROT_READ);
ptr = gem_mmap__gtt(data->fd, handle, size, PROT_READ);
x = ptr[rand() % (size / 4)];
munmap(ptr, size);
......
......@@ -174,7 +174,7 @@ int main(int argc, char **argv)
/* prefault into gtt */
{
uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE);
uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
volatile uint32_t *ptr = base;
int x = 0;
......@@ -189,7 +189,7 @@ int main(int argc, char **argv)
/* mmap read */
gettimeofday(&start, NULL);
for (loop = 0; loop < 1000; loop++) {
uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE);
uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
volatile uint32_t *ptr = base;
int x = 0;
......@@ -229,7 +229,7 @@ int main(int argc, char **argv)
/* mmap write */
gettimeofday(&start, NULL);
for (loop = 0; loop < 1000; loop++) {
uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE);
uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
volatile uint32_t *ptr = base;
for (i = 0; i < size/sizeof(*ptr); i++)
......@@ -261,7 +261,7 @@ int main(int argc, char **argv)
/* mmap clear */
gettimeofday(&start, NULL);
for (loop = 0; loop < 1000; loop++) {
uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE);
uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
memset(base, 0, size);
munmap(base, size);
}
......@@ -283,7 +283,7 @@ int main(int argc, char **argv)
}
gettimeofday(&start, NULL);{
uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE);
uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
for (loop = 0; loop < 1000; loop++)
memset(base, 0, size);
munmap(base, size);
......@@ -305,7 +305,7 @@ int main(int argc, char **argv)
/* mmap read */
gettimeofday(&start, NULL);
for (loop = 0; loop < 1000; loop++) {
uint32_t *base = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE);
uint32_t *base = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
volatile uint32_t *ptr = base;
int x = 0;
......
......@@ -63,7 +63,7 @@ dontneed_before_mmap(void)
handle = gem_create(fd, OBJECT_SIZE);
gem_madvise(fd, handle, I915_MADV_DONTNEED);
ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr == NULL);
igt_assert(errno == EFAULT);
close(fd);
......@@ -77,7 +77,7 @@ dontneed_after_mmap(void)
char *ptr;
handle = gem_create(fd, OBJECT_SIZE);
ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr != NULL);
gem_madvise(fd, handle, I915_MADV_DONTNEED);
close(fd);
......
......@@ -56,7 +56,7 @@ mmap_bo(int fd, uint32_t handle)
{
void *ptr;
ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr != MAP_FAILED);
return ptr;
......@@ -179,7 +179,7 @@ test_read_write(int fd, enum test_read_write order)
handle = gem_create(fd, OBJECT_SIZE);
ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr != MAP_FAILED);
if (order == READ_BEFORE_WRITE) {
......@@ -203,10 +203,10 @@ test_read_write2(int fd, enum test_read_write order)
handle = gem_create(fd, OBJECT_SIZE);
r = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ);
r = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ);
igt_assert(r != MAP_FAILED);
w = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
w = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(w != MAP_FAILED);
if (order == READ_BEFORE_WRITE) {
......@@ -440,7 +440,7 @@ test_write_cpu_read_gtt(int fd)
handle = gem_create(fd, OBJECT_SIZE);
dst = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ);
dst = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ);
igt_assert(dst != (uint32_t *)MAP_FAILED);
src = gem_mmap__cpu(fd, handle, 0, OBJECT_SIZE, PROT_WRITE);
......
......@@ -60,7 +60,7 @@ create_and_map_bo(int fd)
handle = gem_create(fd, OBJECT_SIZE);
ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr);
/* touch it to force it into the gtt */
......
......@@ -225,7 +225,7 @@ static void do_test(int fd, bool faulting_reloc)
relocs_bo_handle[i] = gem_create(fd, 4096);
gem_write(fd, relocs_bo_handle[i], 0, reloc, sizeof(reloc));
gtt_relocs_ptr[i] = gem_mmap(fd, relocs_bo_handle[i], 4096,
gtt_relocs_ptr[i] = gem_mmap__gtt(fd, relocs_bo_handle[i], 4096,
PROT_READ | PROT_WRITE);
igt_assert(gtt_relocs_ptr[i]);
......
......@@ -85,7 +85,7 @@ static void source_offset_tests(int devid, bool reloc_gtt)
execbuf.buffer_count = 2;
if (reloc_gtt) {
dst_gtt = gem_mmap(fd, handle, 8192, PROT_READ | PROT_WRITE);
dst_gtt = gem_mmap__gtt(fd, handle, 8192, PROT_READ | PROT_WRITE);
igt_assert(dst_gtt != MAP_FAILED);
gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
memset(dst_gtt, 0, 8192);
......
......@@ -162,7 +162,7 @@ static void reloc_and_emit(int fd, drm_intel_bo *target_bo, bool faulting_reloc)
handle_relocs = gem_create(fd, 4096);
gem_write(fd, handle_relocs, 0, reloc, sizeof(reloc));
gtt_relocs = gem_mmap(fd, handle_relocs, 4096,
gtt_relocs = gem_mmap__gtt(fd, handle_relocs, 4096,
PROT_READ | PROT_WRITE);
igt_assert(gtt_relocs);
......
......@@ -66,7 +66,7 @@ igt_simple_main
tile_height = 8;
handle = gem_create(fd, OBJECT_SIZE);
ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr);
/* gtt coherency is done with set_domain in libdrm, don't break that */
......
......@@ -62,7 +62,7 @@ igt_simple_main
data[i] = i;
handle = gem_create(fd, OBJECT_SIZE);
ptr = gem_mmap(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr);
gem_set_tiling(fd, handle, I915_TILING_X, TEST_STRIDE);
......
......@@ -72,7 +72,7 @@ create_bo(int fd)
gem_set_tiling(fd, handle, I915_TILING_X, WIDTH * sizeof(uint32_t));
/* Fill the BO with dwords starting at start_val */
data = gem_mmap(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
data = gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
for (i = 0; i < WIDTH*HEIGHT; i++)
data[i] = i;
munmap(data, sizeof(linear));
......
......@@ -79,7 +79,7 @@ create_bo_and_fill(int fd)
gem_set_tiling(fd, handle, current_tiling_mode, WIDTH * sizeof(uint32_t));
/* Fill the BO with dwords starting at start_val */
data = gem_mmap(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
data = gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
for (i = 0; i < WIDTH*HEIGHT; i++)
data[i] = i;
munmap(data, sizeof(linear));
......@@ -122,7 +122,7 @@ igt_simple_main
gem_write(fd, handle_target, 0, linear, sizeof(linear));
/* Check the target bo's contents. */
data = gem_mmap(fd, handle_target, sizeof(linear), PROT_READ | PROT_WRITE);
data = gem_mmap__gtt(fd, handle_target, sizeof(linear), PROT_READ | PROT_WRITE);
for (j = 0; j < WIDTH*HEIGHT; j++)
igt_assert_f(data[j] == j,
"mismatch at %i: %i\n",
......
......@@ -78,7 +78,7 @@ create_bo(int fd)
handle = gem_create(fd, LINEAR_DWORDS);
gem_set_tiling(fd, handle, current_tiling_mode, WIDTH * sizeof(uint32_t));
data = gem_mmap(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
data = gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
if (data == NULL) {
gem_close(fd, handle);
return 0;
......@@ -94,7 +94,7 @@ fill_bo(int fd, uint32_t handle)
uint32_t *data;
int i;
data = gem_mmap(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
data = gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE);
igt_assert(data);
gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
......@@ -109,7 +109,7 @@ check_bo(int fd, uint32_t handle)
uint32_t *data;
int j;
data = gem_mmap(fd, handle, LINEAR_DWORDS, PROT_READ);
data = gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ);
gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0);
j = rand() % (WIDTH * HEIGHT);
igt_assert_f(data[j] == j, "mismatch at %i: %i\n", j, data[j]);
......
......@@ -97,7 +97,7 @@ igt_simple_main
handle = gem_create(fd, size);
ptr = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, size, PROT_READ | PROT_WRITE);
igt_assert(ptr);
test_invalid_tiling(fd, handle, 0);
......
......@@ -688,7 +688,7 @@ static void *umap(int fd, uint32_t handle)
void *ptr;
if (gem_has_llc(fd)) {
ptr = gem_mmap(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
ptr = gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
} else {
uint32_t tmp = gem_create(fd, sizeof(linear));
copy(fd, tmp, handle, 0);
......
......@@ -426,7 +426,7 @@ create_bo(int fd, uint32_t val, int tiling)
gem_set_tiling(fd, handle, tiling, WIDTH*4);
/* Fill the BO with dwords starting at val */
v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
igt_assert(v);
for (i = 0; i < WIDTH*HEIGHT; i++)
v[i] = val++;
......@@ -441,7 +441,7 @@ check_bo(int fd, uint32_t handle, uint32_t val)
uint32_t *v;
int i;
v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
igt_assert(v);
for (i = 0; i < WIDTH*HEIGHT; i++) {
igt_assert_f(v[i] == val,
......
......@@ -314,7 +314,7 @@ create_bo(int fd, uint32_t val, int tiling)
gem_set_tiling(fd, handle, tiling, WIDTH*4);
/* Fill the BO with dwords starting at val */
v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
igt_assert(v);
for (i = 0; i < WIDTH*HEIGHT; i++)
v[i] = val++;
......@@ -329,7 +329,7 @@ check_bo(int fd, uint32_t handle, uint32_t val)
uint32_t *v;
int i;
v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
igt_assert(v);
for (i = 0; i < WIDTH*HEIGHT; i++) {
igt_assert_f(v[i] == val,
......
......@@ -301,7 +301,7 @@ create_bo(int fd, uint32_t val)
gem_set_tiling(fd, handle, I915_TILING_X, WIDTH*4);
/* Fill the BO with dwords starting at val */
v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
igt_assert(v);
for (i = 0; i < WIDTH*HEIGHT; i++)
v[i] = val++;
......@@ -316,7 +316,7 @@ check_bo(int fd, uint32_t handle, uint32_t val)
uint32_t *v;
int i;
v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
igt_assert(v);
for (i = 0; i < WIDTH*HEIGHT; i++) {
igt_assert_f(v[i] == val,
......
......@@ -301,7 +301,7 @@ create_bo(int fd, uint32_t val)
gem_set_tiling(fd, handle, I915_TILING_Y, WIDTH*4);
/* Fill the BO with dwords starting at val */
v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ | PROT_WRITE);
igt_assert(v);
for (i = 0; i < WIDTH*HEIGHT; i++)
v[i] = val++;
......@@ -316,7 +316,7 @@ check_bo(int fd, uint32_t handle, uint32_t val)
uint32_t *v;
int i;
v = gem_mmap(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
v = gem_mmap__gtt(fd, handle, WIDTH*HEIGHT*4, PROT_READ);
igt_assert(v);
for (i = 0; i < WIDTH*HEIGHT; i++) {
igt_assert_f(v[i] == val,
......
......@@ -190,7 +190,7 @@ igt_simple_main
gem_execbuf(t[0].fd, &execbuf);
gem_sync(t[0].fd, exec[1].handle);
p = gem_mmap(t[0].fd, exec[0].handle, 4096, PROT_READ);
p = gem_mmap__gtt(t[0].fd, exec[0].handle, 4096, PROT_READ);
igt_info("[%d]={ %08x %08x }\n", i, p[0], p[1]);
igt_assert(p[0] & 2);
......
......@@ -60,8 +60,8 @@ check_bo(int fd1, uint32_t handle1, int fd2, uint32_t handle2)
char *ptr1, *ptr2;
int i;
ptr1 = gem_mmap(fd1, handle1, BO_SIZE, PROT_READ | PROT_WRITE);
ptr2 = gem_mmap(fd2, handle2, BO_SIZE, PROT_READ | PROT_WRITE);
ptr1 = gem_mmap__gtt(fd1, handle1, BO_SIZE, PROT_READ | PROT_WRITE);
ptr2 = gem_mmap__gtt(fd2, handle2, BO_SIZE, PROT_READ | PROT_WRITE);
igt_assert(ptr1);
......
......@@ -221,7 +221,7 @@ paint_color_key(struct igt_fb *fb_info)
int i, j;
uint32_t *fb_ptr;
fb_ptr = gem_mmap(drm_fd, fb_info->gem_handle,
fb_ptr = gem_mmap__gtt(drm_fd, fb_info->gem_handle,
fb_info->size, PROT_READ | PROT_WRITE);
igt_assert(fb_ptr);
......
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