some half-baked ttm ideas

Dave Airlie airlied at gmail.com
Wed Sep 16 07:30:22 UTC 2020


On Wed, 16 Sep 2020 at 16:58, Christian König <christian.koenig at amd.com> wrote:
>
> Am 16.09.20 um 08:44 schrieb Thomas Hellström (Intel):
> >
> > On 9/16/20 6:28 AM, Dave Airlie wrote:
> >> On Wed, 16 Sep 2020 at 14:19, Dave Airlie <airlied at gmail.com> wrote:
> >>> On Wed, 16 Sep 2020 at 00:12, Christian König
> >>> <ckoenig.leichtzumerken at gmail.com> wrote:
> >>>> Hi Dave,
> >>>>
> >>>> I think we should just completely nuke ttm_tt_bind() and
> >>>> ttm_tt_unbind()
> >>>> and all of that.
> >>>>
> >>>> Drivers can to this from their move_notify() callback now instead.
> >>> Good plan, I've put a bunch of rework into the same branch,
> >>>
> >>> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fairlied%2Flinux%2Fcommits%2Fttm-half-baked-ideas&data=02%7C01%7Cchristian.koenig%40amd.com%7C3d6c9abffa5543a3881008d85a0c013c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637358354912162169&sdata=kaR1uC3yLF%2F8AT1bgTpo%2F8An%2B0yywHZBAfXTD%2Ft%2BMb0%3D&reserved=0
> >>>
> >>>
> >>> but I've fried my brain a bit, I'm having trouble reconciling move
> >>> notify and unbinding in the right places, I feel like I'm circling
> >>> around the answer but haven't hit it yet.
> >> drm/ttm: add unbind to move notify paths.
> >>
> >> In that tree is incorrect and I think where things fall apart, since
> >> if we are moving TTM to VRAM that will unbind the TTM object from the
> >> GTT at move notify time before the move has executed.
> >>
> >> I'm feeling a move_complete_notify might be an idea, but I'm wondering
> >> if it's a bad idea.
> >>
> >> Dave.
> >
> > I don't know if this complicates things more, but move_notify was
> > originally only thought to be an invalidation callback, and was never
> > intended to drive any other actions in the driver than to invalidate
> > various GPU bindings.
>
> And exactly that's what we need to change. See TTM or more precisely the
> eviction handling should only manage where buffers are located and
> notify that driver that something needs to move.
>
> Managing the whole binding/unbinding and actually moving the buffer
> around inside TTM was a bad idea to begin with.
>
> In other words we have domains A, B, C.... and manage which BOs are
> inside those domains and can be evicted when necessary.
>
> If the need arise to evict something the driver gets a notification
> which BO was picked for eviction and acts accordingly.
>
> This means that the eviction_valuable, evict_flag, move_notify, binding,
> unbinding etc... callbacks should be removed in the long term.

I've pushed a few more WIP direction changes into my branch now, I
think the fun bit I have to face next is splitting the
move_accel_cleanup and pipeline move cleanups.

but I'll keep in mind the goal of trying to get to a cleaner finished solution.

Dave.


More information about the dri-devel mailing list