diff options
author | Matthew Auld <matthew.auld@intel.com> | 2022-02-25 14:54:56 +0000 |
---|---|---|
committer | Matthew Auld <matthew.auld@intel.com> | 2022-02-28 08:47:27 +0000 |
commit | 235582ca96214b50fa03ea77a5e85e59d94cf358 (patch) | |
tree | 088e7fa89caf84cb4e1a5f02b37d6fc3e1d6924f /drivers/gpu/drm/i915/intel_memory_region.c | |
parent | d2cc01e1794bd13199f7568298614f1bdcea1683 (diff) | |
download | linux-235582ca96214b50fa03ea77a5e85e59d94cf358.tar.gz |
drm/i915: add io_size plumbing
With small LMEM-BAR we need to be able to differentiate between the
total size of LMEM, and how much of it is CPU mappable. The end goal is
to be able to utilize the entire range, even if part of is it not CPU
accessible.
v2: also update intelfb_create
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>
Acked-by: Nirmoy Das <nirmoy.das@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220225145502.331818-1-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_memory_region.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_memory_region.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_memory_region.c b/drivers/gpu/drm/i915/intel_memory_region.c index 16ab62d605b1..1c841f68169a 100644 --- a/drivers/gpu/drm/i915/intel_memory_region.c +++ b/drivers/gpu/drm/i915/intel_memory_region.c @@ -100,10 +100,10 @@ static int iomemtest(struct intel_memory_region *mem, resource_size_t last, page; int err; - if (resource_size(&mem->region) < PAGE_SIZE) + if (mem->io_size < PAGE_SIZE) return 0; - last = resource_size(&mem->region) - PAGE_SIZE; + last = mem->io_size - PAGE_SIZE; /* * Quick test to check read/write access to the iomap (backing store). @@ -221,6 +221,7 @@ intel_memory_region_create(struct drm_i915_private *i915, resource_size_t size, resource_size_t min_page_size, resource_size_t io_start, + resource_size_t io_size, u16 type, u16 instance, const struct intel_memory_region_ops *ops) @@ -235,6 +236,7 @@ intel_memory_region_create(struct drm_i915_private *i915, mem->i915 = i915; mem->region = (struct resource)DEFINE_RES_MEM(start, size); mem->io_start = io_start; + mem->io_size = io_size; mem->min_page_size = min_page_size; mem->ops = ops; mem->total = size; |