mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-22 22:02:57 +00:00
Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace
__gem_mmap__{cpu,gtt,wc}() + igt_assert() with it.
Mostly done with coccinelle, with some manual help:
@@
identifier I;
expression E1, E2, E3, E4, E5, E6;
@@
(
- I = __gem_mmap__gtt(E1, E2, E3, E4);
+ I = gem_mmap__gtt(E1, E2, E3, E4);
...
- igt_assert(I);
|
- I = __gem_mmap__cpu(E1, E2, E3, E4, E5);
+ I = gem_mmap__cpu(E1, E2, E3, E4, E5);
...
- igt_assert(I);
|
- I = __gem_mmap__wc(E1, E2, E3, E4, E5);
+ I = gem_mmap__wc(E1, E2, E3, E4, E5);
...
- igt_assert(I);
)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -71,8 +71,7 @@ create_bo(int fd)
|
||||
/* Write throught the fence to tiled the data.
|
||||
* We then manually detile on reading back through the mmap(wc).
|
||||
*/
|
||||
data = __gem_mmap__gtt(fd, handle, SIZE, PROT_READ | PROT_WRITE);
|
||||
igt_assert(data);
|
||||
data = gem_mmap__gtt(fd, handle, SIZE, PROT_READ | PROT_WRITE);
|
||||
for (i = 0; i < WIDTH*HEIGHT; i++)
|
||||
data[i] = i;
|
||||
munmap(data, SIZE);
|
||||
@@ -179,9 +178,7 @@ igt_simple_main
|
||||
last_page = (offset + len + PAGE_SIZE) & ~(PAGE_SIZE-1);
|
||||
offset -= first_page;
|
||||
|
||||
linear = __gem_mmap__cpu(fd, handle, first_page, last_page - first_page, PROT_READ);
|
||||
igt_assert(linear);
|
||||
|
||||
linear = gem_mmap__cpu(fd, handle, first_page, last_page - first_page, PROT_READ);
|
||||
|
||||
/* Translate from offsets in the read buffer to the swizzled
|
||||
* address that it corresponds to. This is the opposite of
|
||||
|
||||
Reference in New Issue
Block a user