mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-24 06:43:01 +00:00
ioctl_wrappers: Pass in offset to CPU mmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
|
||||
I915_GEM_DOMAIN_CPU);
|
||||
|
||||
{
|
||||
uint32_t *base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
|
||||
uint32_t *base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
|
||||
volatile uint32_t *ptr = base;
|
||||
int x = 0;
|
||||
|
||||
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
|
||||
/* mmap read */
|
||||
gettimeofday(&start, NULL);
|
||||
for (loop = 0; loop < 1000; loop++) {
|
||||
base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
|
||||
base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
|
||||
ptr = base;
|
||||
x = 0;
|
||||
|
||||
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
|
||||
/* mmap write */
|
||||
gettimeofday(&start, NULL);
|
||||
for (loop = 0; loop < 1000; loop++) {
|
||||
base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
|
||||
base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
|
||||
ptr = base;
|
||||
|
||||
for (i = 0; i < size/sizeof(*ptr); i++)
|
||||
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
|
||||
|
||||
gettimeofday(&start, NULL);
|
||||
for (loop = 0; loop < 1000; loop++) {
|
||||
base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
|
||||
base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
|
||||
memset(base, 0, size);
|
||||
munmap(base, size);
|
||||
}
|
||||
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
|
||||
size/1024, elapsed(&start, &end, loop));
|
||||
|
||||
gettimeofday(&start, NULL);
|
||||
base = gem_mmap__cpu(fd, handle, size, PROT_READ | PROT_WRITE);
|
||||
base = gem_mmap__cpu(fd, handle, 0, size, PROT_READ | PROT_WRITE);
|
||||
for (loop = 0; loop < 1000; loop++)
|
||||
memset(base, 0, size);
|
||||
munmap(base, size);
|
||||
|
||||
Reference in New Issue
Block a user