[igt-dev] [PATCH i-g-t] lib/igt_fb: Add missing set_domain calls

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 6 12:34:25 UTC 2018


Quoting Ville Syrjala (2018-09-06 13:27:49)
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> We're missing some set_domain calls around the ggtt mmap paths. This
> means we never tell the kernel that we've dirtied the object. And
> then at some point down the line the kernel throws the pages into
> /dev/null instead of hanging on to them/swapping them out because
> they were never marked as dirty.

They all look fine. The first write into the GTT mmap was supposed to
mark the object as dirty, but that turns out to have been tempermental
due to the GTT mmap not marking its pages as wrprotect and so never
refaulting before a write. That userspace is meant to be doing its own
domain tracking, ie calling set-domain(GTT, GTT), avoiding us having to
pagefault ever again is our excuse. For the record, we changed the
assumption to mark the object as dirty when we fault in a fresh
PROT_WRITE object very recently in 

commit aae7c06b34e4a351c8dab28f3cda6b1ba0637bf9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Sep 3 09:33:34 2018 +0100

    drm/i915: Flag any possible writes for a GTT fault

(because I noticed that copy_to_user() wasn't triggering a fresh fault ;)

> Throw in the missing set_domains(GTT,GTT) calls and rip out the old
> bogus set_domain(CPU,CPU).
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list