]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: mark up internal objects with start_cpu_write
authorMatthew Auld <matthew.auld@intel.com>
Mon, 18 Oct 2021 17:45:07 +0000 (18:45 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Wed, 20 Oct 2021 15:50:25 +0000 (16:50 +0100)
commit0f341fe6765581709f7b4727af06dbf1d179fc83
tree22221ceaf9bf9bc1ade31a0c73dba3c8f17add2d
parent63f97b32d23e0a92809978478e46acaccd8a40c5
drm/i915: mark up internal objects with start_cpu_write

While the pages can't be swapped out, they can be discarded by the shrinker.
Normally such objects are marked with __I915_MADV_PURGED, which can't be
unset, and therefore requires a new object. For kernel internal objects
this is not true, since the madv hint is reset for our special volatile
objects, such that we can re-acquire new pages, if so desired, without
needing a new object. As a result we should probably be paranoid here
and put the object back into the CPU domain when discarding the pages,
and also correctly set cache_dirty, if required.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211018174508.2137279-8-matthew.auld@intel.com
drivers/gpu/drm/i915/gem/i915_gem_internal.c