On Wed, Apr 08, 2015 at 01:51:52PM +0300, Joonas Lahtinen wrote:
> +     /* Test read/write to first/last page through CPU after GTT writes.
> +      * Require that previous GTT written values still exist.
> +      */
> +     ptr_cpu = gem_mmap__cpu(fd, bo, 0, huge_object_size,
> +                             PROT_READ | PROT_WRITE);
> +     if (!ptr_cpu) {
> +             igt_warn("Not enough free memory to complete huge BO test!\n");
> +             goto out;
> +     }
> +
> +     set_domain_cpu(fd, bo);
> +
> +     igt_assert(memcmp(ptr_cpu              , gtt_pattern, PAGE_SIZE) == 0);
> +     igt_assert(memcmp(ptr_cpu + last_offset, gtt_pattern, PAGE_SIZE) == 0);
> +
> +     memcpy(ptr_cpu, cpu_pattern, PAGE_SIZE);
> +     igt_assert(memcmp(ptr_cpu              , cpu_pattern, PAGE_SIZE) == 0);
> +     igt_assert(memcmp(ptr_cpu + last_offset, gtt_pattern, PAGE_SIZE) == 0);
> +
> +     memcpy(ptr_cpu + last_offset, cpu_pattern, PAGE_SIZE);
> +     igt_assert(memcmp(ptr_cpu              , cpu_pattern, PAGE_SIZE) == 0);
> +     igt_assert(memcmp(ptr_cpu + last_offset, cpu_pattern, PAGE_SIZE) == 0);

On second thought I think this is better using pread as on non-llc
platforms this will a second gigantic clflush. Otherwise lgtm.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to