When reviewing some of Tvrtko's usage for i915_gem_object_pin_map(), he suggested replacing some use of kmap(i915_gem_object_get_dirty_page()) with a plain i915_gem_object_pin_map(). This raised the question of who should mark the page as dirty (or the mapping case, the object). We can write simpler, safer code if we mark the entire object as dirty upon obtaining the obj->mapping. (The counter-argument is that the caller should be marking the object as dirty itself, or we should be passing in a direction parameter.) Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: Dave Gordon <david.s.gordon@xxxxxxxxx> Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxxxxx> --- drivers/gpu/drm/i915/i915_gem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index b37ffea8b458..c0a4e38d6392 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2448,6 +2448,8 @@ void *i915_gem_object_pin_map(struct drm_i915_gem_object *obj) } } + /* Presume the caller is going to write into the map */ + obj->dirty = true; return obj->mapping; } -- 2.8.0.rc3 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx