[Intel-gfx] [RFC PATCH 10/42] drm/i915/lmem: add helper to get CPU visible pfn
Chris Wilson
chris at chris-wilson.co.uk
Thu Feb 14 15:33:13 UTC 2019
Quoting Matthew Auld (2019-02-14 14:57:08)
> From: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
Why?
So can something without a CPU visible struct page even have a pfn?
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_region_lmem.c | 11 +++++++++++
> drivers/gpu/drm/i915/intel_region_lmem.h | 3 +++
> 2 files changed, 14 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_region_lmem.c b/drivers/gpu/drm/i915/intel_region_lmem.c
> index 4a205639cbb6..b398becb2733 100644
> --- a/drivers/gpu/drm/i915/intel_region_lmem.c
> +++ b/drivers/gpu/drm/i915/intel_region_lmem.c
> @@ -65,6 +65,17 @@ static const struct intel_memory_region_ops region_lmem_ops = {
> .object_create = region_lmem_object_create,
> };
>
> +unsigned long i915_gem_object_lmem_io_pfn(struct drm_i915_gem_object *obj,
> + unsigned long n)
> +{
> + struct intel_memory_region *mem = obj->memory_region;
> + resource_size_t offset;
> +
> + offset = i915_gem_object_get_dma_address(obj, n);
Magic of type convenience?
We definitely do not want to be returning a dma_address as a CPU
address. The semantics here needs to be cleaned up.
-Chris
More information about the Intel-gfx
mailing list