[Intel-gfx] [PATCH] drm/i915: Disable full ppgtt by default

Daniel Vetter daniel.vetter at ffwll.ch
Thu Mar 6 22:42:36 CET 2014


On Thu, Mar 6, 2014 at 9:30 PM, Daniel Vetter <daniel at ffwll.ch> wrote:
>> * Aliasing PPGTT real address treatment: What do you want?
>
> i915_gem_context_free in i195_gem_context.c has a comment:
>
>         /* We refcount even the aliasing PPGTT to keep the code symmetric */
>
> That comment is a lie and _not_ refcounting the aliasing ppgtt would allow
> us to ditch a bunch of hard-to-understand (at least for me) cornercase in
> the lifetime rules. At least that was the case when I've reviewed the
> ppgtt branch 3 months ago. Given that we have issues around the lifetimes
> of these suckers it can't help to have as much clarity as possible.

Let me elaborate, since I really think this isn't a bikeshed:

If you look at the aliasing ppgtt from a logical perspective, it's not
a full ppgtt at all:
- The lifetime is fully linked to the global gtt. Refcounting it makes
zero sense.
- It doesn't have an independent drm_mm.
- Besides at driver load or after reset it never gets changed in the
hw, it's essentially a constant piece.

Imo the correct way to think about global gtt + aliasing ppgtt is as
one address space, with one set of ptes. Normal hw engineers would the
behaviour with 2 simple bits:
- one bit controls whether priviledged access is possible
- one bit controls whether unpriviledged access from userspace batch
buffers is possible.

The only crazy thing here is that we don't have two bits in the pte,
but instead two completely separate pagetable hirarchies. But
logically they work as if there's just one pagetable with 2 special
bits.

Hence why we also need the vma_bind/unbind vfuncs, they hide the
logical pagetable used by the core code from the actual reality of
things.

When I've reviewed the full ppgtt branch I've noticed 3 areas where
this was all mixed up:
- secure batch pinning - the current code now works for aliasing ppgtt
but is now broken on full ppgtt. But the discussions we've had last
autumn was all about this fine disdinction.
- All the confusion with the vma_bind flags, partially fixed with
Chris' binding rework, the remaining code.
- Finally the lifetime confusion I've pointed out above.

Since these are all variants on the underlying theme it's imo a real
design bug in the code and not just bikesheds, so I want it fixed. And
I prefer that you fix it up, to make sure we really understand this
all.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list