OSDN Git Service

drm/i915/ttm: implement access_memory
authorMatthew Auld <matthew.auld@intel.com>
Mon, 3 Oct 2022 17:28:19 +0000 (18:28 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Tue, 4 Oct 2022 13:30:48 +0000 (14:30 +0100)
commit26b15eb0940c9a52aa997f6e6f00e3a6e628f107
treed06f3d30afe861573a76e5a9c179e410c97cc401
parentc24538f538ef2f70c10f4326c1c0efd6ec6561c9
drm/i915/ttm: implement access_memory

It looks like we need this for local-memory, if we want to use ptrace.
Something more is still needed if we want to handle non-mappable memory,
which looks quite annoying.

v2:
  - ttm_bo_kmap doesn't seem to work well here, and seems to expect
    contiguous resource.
v3(Andi):
  - s/PAGE_SIZE/bytes/ when passing in the size of the mapping.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/6989
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221003172819.99245-1-matthew.auld@intel.com
drivers/gpu/drm/i915/gem/i915_gem_ttm.c