]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gtt: Serialise both updates to PDE and our shadow
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 17 Jun 2019 14:04:26 +0000 (15:04 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 17 Jun 2019 19:53:03 +0000 (20:53 +0100)
commit766d9e6d56d0e4403b731501c930b7ea35d45021
tree4d077fc715d46755017e9d84634906f98e2c6cf5
parent6d61563e1f96c92cf9ab2a9c70f5759f7753c354
drm/i915/gtt: Serialise both updates to PDE and our shadow

Currently, we perform a locked update of the shadow entry when
allocating a page directory entry such that if two clients are
concurrently allocating neighbouring ranges we only insert one new entry
for the pair of them. However, we also need to serialise both clients
wrt to the actual entry in the HW table, or else we may allow one client
or even a third client to proceed ahead of the HW write. My handwave
before was that under the _pathological_ condition we would see the
scratch entry instead of the expected entry, causing a temporary
glitch. That starvation condition will eventually show up in practice, so
fix it.

The reason for the previous cheat was to avoid having to free the extra
allocation while under the spinlock. Now, we keep the extra entry
allocated until the end instead.

v2: Fix error paths for gen6

Fixes: 250e448c7731 ("drm/i915/gtt: Replace struct_mutex serialisation for allocation")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190617140426.7203-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_gtt.c