Lines Matching full:object
50 struct drm_i915_gem_exec_object2 object; in test_invalid() local
53 execbuf.buffers_ptr = to_user_pointer(&object); in test_invalid()
56 memset(&object, 0, sizeof(object)); in test_invalid()
57 object.handle = gem_create(fd, 2*4096); in test_invalid()
58 object.flags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS | EXEC_OBJECT_PINNED; in test_invalid()
59 gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); in test_invalid()
62 object.offset = 4096; in test_invalid()
63 object.alignment = 64*1024; in test_invalid()
65 object.alignment = 0; in test_invalid()
68 object.offset = -4096ULL; in test_invalid()
72 object.offset = gem_aperture_size(fd) - 4096; in test_invalid()
73 object.offset = gen8_canonical_addr(object.offset); in test_invalid()
78 object.offset = 1ull << GEN8_HIGH_ADDRESS_BIT; in test_invalid()
81 object.offset = gen8_canonical_addr(object.offset); in test_invalid()
87 object.flags = EXEC_OBJECT_PINNED; in test_invalid()
88 object.offset = 1ull<<32; in test_invalid()
91 object.offset = gen8_canonical_addr(object.offset); in test_invalid()
92 object.flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS; in test_invalid()
102 struct drm_i915_gem_exec_object2 object; in test_softpin() local
110 execbuf.buffers_ptr = to_user_pointer(&object); in test_softpin()
113 memset(&object, 0, sizeof(object)); in test_softpin()
114 object.handle = gem_create(fd, 2*size); in test_softpin()
115 gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); in test_softpin()
119 gem_close(fd, object.handle); in test_softpin()
123 object.offset); in test_softpin()
125 object.handle = gem_create(fd, size); in test_softpin()
126 gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); in test_softpin()
127 object.flags |= EXEC_OBJECT_PINNED; in test_softpin()
129 end = object.offset + size; in test_softpin()
130 for (offset = object.offset; offset <= end; offset += 4096) { in test_softpin()
131 object.offset = offset; in test_softpin()
133 igt_assert_eq_u64(object.offset, offset); in test_softpin()
136 last_handle = object.handle; in test_softpin()
145 struct drm_i915_gem_exec_object2 object[2]; in test_overlap() local
152 memset(object, 0, sizeof(object)); in test_overlap()
153 object[0].handle = handle; in test_overlap()
157 execbuf.buffers_ptr = to_user_pointer(object); in test_overlap()
162 object[0].offset); in test_overlap()
164 object[0].handle = gem_create(fd, size); in test_overlap()
165 object[0].offset += size; in test_overlap()
166 object[0].flags |= EXEC_OBJECT_PINNED; in test_overlap()
167 object[1].handle = gem_create(fd, size); in test_overlap()
168 object[1].flags |= EXEC_OBJECT_PINNED; in test_overlap()
169 gem_write(fd, object[1].handle, 0, &bbe, sizeof(bbe)); in test_overlap()
173 object[1].offset = object[0].offset - size; in test_overlap()
175 igt_assert_eq_u64(object[1].offset + size, object[0].offset); in test_overlap()
177 object[1].offset = object[0].offset + size; in test_overlap()
179 igt_assert_eq_u64(object[1].offset - size, object[0].offset); in test_overlap()
182 for (offset = object[0].offset - size + 4096; in test_overlap()
183 offset < object[0].offset + size; in test_overlap()
185 object[1].offset = offset; in test_overlap()
187 (long long)object[0].offset, in test_overlap()
188 (long long)object[0].offset + size, in test_overlap()
189 (long long)object[1].offset, in test_overlap()
190 (long long)object[1].offset + size); in test_overlap()
192 igt_assert_eq_u64(object[1].offset, offset); in test_overlap()
195 gem_close(fd, object[1].handle); in test_overlap()
196 gem_close(fd, object[0].handle); in test_overlap()
205 struct drm_i915_gem_exec_object2 object[2]; in busy_batch() local
210 memset(object, 0, sizeof(object)); in busy_batch()
211 object[0].handle = gem_create(fd, 1024*1024); in busy_batch()
212 object[1].handle = gem_create(fd, 4096); in busy_batch()
213 map = gem_mmap__cpu(fd, object[1].handle, 0, 4096, PROT_WRITE); in busy_batch()
214 gem_set_domain(fd, object[1].handle, in busy_batch()
220 execbuf.buffers_ptr = to_user_pointer(object); in busy_batch()
227 object[0].offset, object[1].offset); in busy_batch()
232 gem_set_domain(fd, object[1].handle, in busy_batch()
242 map[i++] = object[0].offset; in busy_batch()
244 map[i++] = object[0].offset >> 32; in busy_batch()
247 map[i++] = object[0].offset; in busy_batch()
249 map[i++] = object[0].offset >> 32; in busy_batch()
254 object[0].flags = EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE; in busy_batch()
255 object[1].flags = EXEC_OBJECT_PINNED; in busy_batch()
257 gem_close(fd, object[0].handle); in busy_batch()
258 gem_close(fd, object[1].handle); in busy_batch()
260 return object[1].offset; in busy_batch()
267 struct drm_i915_gem_exec_object2 object; in test_evict_active() local
270 memset(&object, 0, sizeof(object)); in test_evict_active()
271 object.handle = gem_create(fd, 4096); in test_evict_active()
272 gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); in test_evict_active()
275 execbuf.buffers_ptr = to_user_pointer(&object); in test_evict_active()
279 object.offset = expected; in test_evict_active()
280 object.flags = EXEC_OBJECT_PINNED; in test_evict_active()
284 igt_assert_eq_u64(object.offset, expected); in test_evict_active()
286 gem_close(fd, object.handle); in test_evict_active()
293 struct drm_i915_gem_exec_object2 object[2]; in test_evict_snoop() local
300 execbuf.buffers_ptr = to_user_pointer(object); in test_evict_snoop()
304 memset(object, 0, sizeof(object)); in test_evict_snoop()
305 object[0].handle = gem_create(fd, 5*4096); in test_evict_snoop()
306 gem_write(fd, object[0].handle, 0, &bbe, sizeof(bbe)); in test_evict_snoop()
308 gem_close(fd, object[0].handle); in test_evict_snoop()
309 hole = object[0].offset + 4096; in test_evict_snoop()
312 object[0].handle = gem_create(fd, 4096); in test_evict_snoop()
313 object[0].flags = EXEC_OBJECT_PINNED; in test_evict_snoop()
314 gem_set_caching(fd, object[0].handle, 1); in test_evict_snoop()
315 object[1].handle = gem_create(fd, 4096); in test_evict_snoop()
316 object[1].flags = EXEC_OBJECT_PINNED; in test_evict_snoop()
317 gem_write(fd, object[1].handle, 4096-sizeof(bbe), &bbe, sizeof(bbe)); in test_evict_snoop()
321 object[0].offset = hole; in test_evict_snoop()
322 object[1].offset = hole + 4096; in test_evict_snoop()
326 object[0].offset = hole + 4096; in test_evict_snoop()
327 object[1].offset = hole; in test_evict_snoop()
331 object[0].offset = hole + 2*4096; in test_evict_snoop()
332 object[1].offset = hole; in test_evict_snoop()
336 object[0].flags = 0; in test_evict_snoop()
337 object[1].offset = hole + 4096; in test_evict_snoop()
339 igt_assert(object[0].offset != hole); in test_evict_snoop()
340 igt_assert(object[0].offset != hole + 2*4096); in test_evict_snoop()
342 gem_close(fd, object[0].handle); in test_evict_snoop()
343 gem_close(fd, object[1].handle); in test_evict_snoop()
350 struct drm_i915_gem_exec_object2 object; in test_evict_hang() local
354 memset(&object, 0, sizeof(object)); in test_evict_hang()
355 object.handle = gem_create(fd, 4096); in test_evict_hang()
356 gem_write(fd, object.handle, 0, &bbe, sizeof(bbe)); in test_evict_hang()
359 execbuf.buffers_ptr = to_user_pointer(&object); in test_evict_hang()
366 object.offset = expected; in test_evict_hang()
367 object.flags = EXEC_OBJECT_PINNED; in test_evict_hang()
369 igt_assert_eq_u64(object.offset, expected); in test_evict_hang()
372 gem_close(fd, object.handle); in test_evict_hang()
377 struct drm_i915_gem_exec_object2 *object = array; in xchg_offset() local
378 uint64_t tmp = object[i].offset; in xchg_offset()
379 object[i].offset = object[j].offset; in xchg_offset()
380 object[j].offset = tmp; in xchg_offset()
390 struct drm_i915_gem_exec_object2 object[257]; in test_noreloc() local
396 handle = gem_create(fd, (ARRAY_SIZE(object)+1)*size); in test_noreloc()
399 memset(object, 0, sizeof(object)); in test_noreloc()
400 object[0].handle = handle; in test_noreloc()
404 execbuf.buffers_ptr = to_user_pointer(object); in test_noreloc()
409 gem_close(fd, object[0].handle); in test_noreloc()
412 (int)ARRAY_SIZE(object), size/1024, object[0].offset); in test_noreloc()
414 offset = object[0].offset; in test_noreloc()
415 for (i = 0; i < ARRAY_SIZE(object) - 1; i++) { in test_noreloc()
416 object[i].handle = gem_create(fd, size); in test_noreloc()
417 object[i].offset = offset + i*size; in test_noreloc()
418 object[i].flags = EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE; in test_noreloc()
420 object[i].handle = gem_create(fd, 2*size); in test_noreloc()
421 object[i].offset = offset + i*size; in test_noreloc()
422 object[i].flags = EXEC_OBJECT_PINNED; in test_noreloc()
424 b = batch = gem_mmap__cpu(fd, object[i].handle, 0, 2*size, PROT_WRITE); in test_noreloc()
425 gem_set_domain(fd, object[i].handle, in test_noreloc()
427 for (i = 0; i < ARRAY_SIZE(object) - 1; i++) { in test_noreloc()
430 *b++ = object[i].offset; in test_noreloc()
431 *b++ = object[i].offset >> 32; in test_noreloc()
434 *b++ = object[i].offset; in test_noreloc()
437 *b++ = object[i].offset; in test_noreloc()
445 execbuf.buffer_count = ARRAY_SIZE(object); in test_noreloc()
447 igt_permute_array(object, ARRAY_SIZE(object)-1, xchg_offset); in test_noreloc()
465 for (i = 0; i < ARRAY_SIZE(object) - 1; i++) { in test_noreloc()
468 gem_read(fd, object[i].handle, 0, &val, sizeof(val)); in test_noreloc()
469 igt_assert_eq(val, (object[i].offset - offset)/size); in test_noreloc()
473 for (i = 0; i < ARRAY_SIZE(object); i++) in test_noreloc()
474 gem_close(fd, object[i].handle); in test_noreloc()