AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Zack Rusin <zackr@vmware.com>
To: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"ckoenig.leichtzumerken@gmail.com"
	<ckoenig.leichtzumerken@gmail.com>
Cc: Martin Krastev <krastevm@vmware.com>,
	"dakr@redhat.com" <dakr@redhat.com>,
	Linux-graphics-maintainer <Linux-graphics-maintainer@vmware.com>,
	Maaz Mombasawala <mombasawalam@vmware.com>,
	"arunpravin.paneerselvam@amd.com"
	<arunpravin.paneerselvam@amd.com>
Subject: Re: [PATCH 9/9] drm: move ttm_execbuf_util into vmwgfx
Date: Thu, 9 Mar 2023 05:14:49 +0000	[thread overview]
Message-ID: <40318db5b88601e42e68a94115da2bdcf6e18db8.camel@vmware.com> (raw)
In-Reply-To: <6933b07b-af79-5350-b161-12ee73732b30@gmail.com>

On Wed, 2023-03-08 at 10:10 +0100, Christian König wrote:
> 
> Am 08.03.23 um 06:14 schrieb Zack Rusin:
> > On Tue, 2023-02-28 at 09:34 +0100, Christian König wrote:
> > > VMWGFX is the only remaining user of this and should probably moved over
> > > to drm_exec when it starts using GEM as well.
> > Is this because vmwgfx piggybacks buffer-id relocations on top of ttm
> > validations or
> > did you just find it too hard to port it over? I'd prefer to avoid ttm moves to
> > vmwgfx and at least have a clear idea of what we need to do to port.
> 
> I've just found it to hard to port it over because vmwgfx does some
> strange things with the validation code here.
> 
> If you want we can take a deeper look at this together, but I need to
> find some time.
> 
> Alternatively just tell me how to do it and I will add that to the patch
> set :)

I don't want to hold up the set (it looks good btw), because I had to look at
something else today and tomorrow. 

We overload the validation lists to do quite a bit more than just reservations
though. 

There are, I think, four separate things that need to be refactored there
(Christian, feel free to skip this section, this is mainly for VMware folks on the
team):
1) Relocations - userspace uses the id's of the bo's in the command stream, but on
the kernel side those id's are different (or in vmwgfx terminology gem id != mob
id), so the buffer id's in the command stream need to be replaced,
2) Resource validation. vmwgfx splits the userspace objects into buffers and
resources (shaders, surfaces, contexts). The resources are not buffers but are
backed by them. A single buffer can back multiple different resources and sometimes
the kernel has to actually allocate a buffer to back a resource and attach it to it
(i.e. in common terminology buffer is the memory and resources are placed in it) .
Now this shouldn't be in the kernel at all, the resources shouldn't have been kernel
objects and instead we should have left them completely to userspace.
3) Coherency tracking. We use validation lists as a central place for tracking which
bo's/resources are used in a command buffer and we use it to keep track of which
buffers/resources will endup dirty to implement coherency.
4) Central place to allocate memory for relocation/validation nodes.

Where we want to endup is with 2 completely gone from the kernel side and 1, 3 and 4
refactored and cleaned up. I think there's at least 4 separate patches to this port,
so it's not a trivial thing. We will take a look at this on Friday in more detail to
see what we can do.

z

  reply	other threads:[~2023-03-09  5:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28  8:33 Common DRM execution context v3 Christian König
2023-02-28  8:33 ` [PATCH 1/9] drm: execution context for GEM buffers v3 Christian König
2023-02-28 19:13   ` Danilo Krummrich
2023-03-02  7:49     ` Christian König
2023-03-03 13:45     ` Luben Tuikov
2023-03-03 14:11   ` Luben Tuikov
2023-03-10 10:42   ` Thomas Hellström (Intel)
2023-04-14 14:29     ` Francois Dugast
2023-02-28  8:33 ` [PATCH 2/9] drm: add drm_exec selftests Christian König
2023-02-28  8:34 ` [PATCH 3/9] drm/amdkfd: switch over to using drm_exec Christian König
2023-04-21 21:28   ` Felix Kuehling
2023-02-28  8:34 ` [PATCH 4/9] drm/amdgpu: use drm_exec for GEM and CSA handling Christian König
2023-02-28  8:34 ` [PATCH 5/9] drm/amdgpu: use drm_exec for MES testing Christian König
2023-02-28  8:34 ` [PATCH 6/9] drm/amdgpu: use the new drm_exec object for CS v2 Christian König
2023-02-28  8:34 ` [PATCH 7/9] drm/radeon: switch over to drm_exec Christian König
2023-02-28 16:45   ` kernel test robot
2023-02-28  8:34 ` [PATCH 8/9] drm/qxl: switch to using drm_exec Christian König
2023-02-28 16:03   ` kernel test robot
2023-02-28 16:34   ` kernel test robot
2023-02-28  8:34 ` [PATCH 9/9] drm: move ttm_execbuf_util into vmwgfx Christian König
2023-03-08  5:14   ` Zack Rusin
2023-03-08  9:10     ` Christian König
2023-03-09  5:14       ` Zack Rusin [this message]
2023-03-09  8:35         ` Thomas Hellström (Intel)
2023-03-09  8:26       ` Thomas Hellström (Intel)
2023-02-28 19:11 ` Common DRM execution context v3 Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40318db5b88601e42e68a94115da2bdcf6e18db8.camel@vmware.com \
    --to=zackr@vmware.com \
    --cc=Linux-graphics-maintainer@vmware.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arunpravin.paneerselvam@amd.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dakr@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krastevm@vmware.com \
    --cc=mombasawalam@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox