[Intel-gfx] [PATCH 6/7] drm/i915: Switch to object allocations for page directories

Matthew Auld matthew.william.auld at gmail.com
Wed Jul 8 18:32:26 UTC 2020


On Wed, 8 Jul 2020 at 14:48, Chris Wilson <chris at chris-wilson.co.uk> wrote:
>
> The GEM object is grossly overweight for the practicality of tracking
> large numbers of individual pages, yet it is currently our only
> abstraction for tracking DMA allocations. Since those allocations need
> to be reserved upfront before an operation, and that we need to break
> away from simple system memory, we need to ditch using plain struct page
> wrappers.
>
> In the process, we drop the WC mapping as we ended up clflushing
> everything anyway due to various issues across a wider range of
> platforms. Though in a future step, we need to drop the kmap_atomic
> approach which suggests we need to pre-map all the pages and keep them
> mapped.
>
> v2: Verify our large scratch page is suitably DMA aligned; and manually
> clear the scratch since we are allocating random struct pages.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld at intel.com>
> ---
>  .../gpu/drm/i915/gem/i915_gem_object_types.h  |   1 +
>  .../gpu/drm/i915/gem/selftests/huge_pages.c   |   2 +-
>  .../drm/i915/gem/selftests/i915_gem_context.c |   2 +-
>  drivers/gpu/drm/i915/gt/gen6_ppgtt.c          |  53 +--
>  drivers/gpu/drm/i915/gt/gen6_ppgtt.h          |   1 +
>  drivers/gpu/drm/i915/gt/gen8_ppgtt.c          |  89 ++---
>  drivers/gpu/drm/i915/gt/intel_ggtt.c          |  37 ++-
>  drivers/gpu/drm/i915/gt/intel_gtt.c           | 303 ++++--------------
>  drivers/gpu/drm/i915/gt/intel_gtt.h           |  94 ++----
>  drivers/gpu/drm/i915/gt/intel_ppgtt.c         |  42 ++-
>  .../gpu/drm/i915/gt/intel_ring_submission.c   |  16 +-
>  drivers/gpu/drm/i915/gvt/scheduler.c          |  17 +-
>  drivers/gpu/drm/i915/i915_drv.c               |   1 +
>  drivers/gpu/drm/i915/i915_drv.h               |   5 -
>  drivers/gpu/drm/i915/i915_vma.c               |  18 +-
>  drivers/gpu/drm/i915/selftests/i915_gem_gtt.c |  23 ++
>  drivers/gpu/drm/i915/selftests/mock_gtt.c     |   4 +
>  17 files changed, 287 insertions(+), 421 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
> index 5335f799b548..d0847d7896f9 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h
> @@ -282,6 +282,7 @@ struct drm_i915_gem_object {
>                 } userptr;
>
>                 unsigned long scratch;
> +               u64 encode;
>
>                 void *gvt_info;
>         };
> diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> index 8291ede6902c..9fb06fcc8f8f 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> @@ -393,7 +393,7 @@ static int igt_mock_exhaust_device_supported_pages(void *arg)
>          */
>
>         for (i = 1; i < BIT(ARRAY_SIZE(page_sizes)); i++) {
> -               unsigned int combination = 0;
> +               unsigned int combination = SZ_4K;

Just an unrelated change?


More information about the Intel-gfx mailing list