]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: tweak the ordering in cpu_write_needs_clflush
authorMatthew Auld <matthew.auld@intel.com>
Wed, 22 Jun 2022 15:59:19 +0000 (16:59 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Mon, 27 Jun 2022 11:56:52 +0000 (12:56 +0100)
commit37d7e6dc8716eff16ee7b05bcc74eb83c804e1e6
treef4b07e4e56e7ed80aaa8d24c08b574d29dc547df
parentb3915231a47796176c4488c6431fb339095db035
drm/i915: tweak the ordering in cpu_write_needs_clflush

For imported dma-buf objects we leave the object as cache_coherent = 0
across all platforms, which is reasonable given that have no clue what
the memory underneath is, and its not like the driver can ever manually
clflush the pages anyway (like with i915_gem_clflush_object) for such
objects. However on discrete we choose to treat cache_dirty = true as a
programmer error, leading to a warning. The simplest fix looks to be to
just change the ordering in cpu_write_needs_clflush to prevent ever
setting cache_dirty for dma-buf objects on discrete.

Fixes: cc066f8e7327 ("drm/i915/dmabuf: Fix prime_mmap to work when using LMEM")
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5266
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220622155919.355081-1-matthew.auld@intel.com
drivers/gpu/drm/i915/gem/i915_gem_domain.c