All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström (Intel)" <thomas_os@shipmail.org>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
	dri-devel@lists.freedesktop.org
Cc: daniel.vetter@ffwll.ch, matthew.william.auld@gmail.com
Subject: Re: [PATCH 06/13] drm/ttm: flip over the range manager to self allocated nodes
Date: Sat, 29 May 2021 17:48:16 +0200	[thread overview]
Message-ID: <f792308b-389d-67da-0cf8-667c1e6ac96d@shipmail.org> (raw)
In-Reply-To: <20210430092508.60710-6-christian.koenig@amd.com>

Hi, Christian,

On 4/30/21 11:25 AM, Christian König wrote:
> Start with the range manager to make the resource object the base
> class for the allocated nodes.
>
> While at it cleanup a lot of the code around that.

Could you briefly describe the design thoughts around this. While it's 
clear to me that we want separately allocated struct ttm_resource 
objects, it's not clear why the visibility of those are pushed down the 
interfaces to the range managers?

In addition to the need for a separately allocated struct ttm_resource, 
when looking at TTM-ify i915 I've come across a couple of problems.

1) People have started abusing the range manager interface to attach 
device private data to the mm_node, or probably really to the struct 
ttm_resource. That makes it very unclear what the input needed for the 
managers really are. For examle what members of the bo does the range 
manager really use and why? Same for the struct ttm_resource. I think in 
a perfect world, the interface to these range managers should be a 
struct ttm_placement as input and as output an opaque mm node and 
perhaps a way to convert that mm node to something useful like a range 
or a scatter-gather table.

2) But that doesn't really address the problem of drivers wanting to 
attach device private data to a struct ttm_resource, which at some point 
caused someone to add a bo to the manager interface. The novueau driver 
attaches a "kind" member to the mm node that it pulls out of the bo; The 
i915 driver would want to cache an st table and a radix tree to cache 
index-to-pfn maps.

3) In the end we'd probably want the kmap iterator methods and the 
various mapping funtions to be methods of the struct ttm_resource.

So basically here

1) Would help making range managers with various functionality simple to 
write and share.
2) Would help drivers attach private data to a struct ttm_resource 
without abusing the manager interfaces,
3) Would help clean up the mapping code.

But at least 2) here would probably mean that we need a driver callback 
to allocate a struct ttm_resource rather than having the managers 
allocate them. Drivers can then embed them in private structs if needed.

Or is there a way to achieve these goals or something similar with the 
approach you are taking here?

Thanks,

Thomas




  parent reply	other threads:[~2021-05-29 15:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30  9:24 [PATCH 01/13] drm/ttm: add ttm_sys_manager v2 Christian König
2021-04-30  9:24 ` [PATCH 02/13] drm/ttm: always initialize the full ttm_resource Christian König
2021-04-30 12:05   ` Matthew Auld
2021-04-30 12:51     ` Christian König
2021-04-30  9:24 ` [PATCH 03/13] drm/ttm: properly allocate sys resource during swapout Christian König
2021-04-30 10:22   ` Matthew Auld
2021-04-30  9:24 ` [PATCH 04/13] drm/ttm: rename bo->mem and make it a pointer Christian König
2021-04-30  9:25 ` [PATCH 05/13] drm/ttm: allocate resource object instead of embedding it Christian König
2021-04-30 11:19   ` Matthew Auld
2021-04-30  9:25 ` [PATCH 06/13] drm/ttm: flip over the range manager to self allocated nodes Christian König
2021-04-30 13:14   ` Matthew Auld
2021-05-29 15:48   ` Thomas Hellström (Intel) [this message]
2021-05-30 16:51     ` Christian König
2021-05-31  8:56       ` Thomas Hellström (Intel)
2021-04-30  9:25 ` [PATCH 07/13] drm/ttm: flip over the sys " Christian König
2021-04-30 13:16   ` Matthew Auld
2021-04-30 15:04   ` Matthew Auld
2021-05-03 11:08     ` Christian König
2021-04-30  9:25 ` [PATCH 08/13] drm/amdgpu: revert "drm/amdgpu: stop allocating dummy GTT nodes" Christian König
2021-05-05 16:48   ` Matthew Auld
2021-04-30  9:25 ` [PATCH 09/13] drm/amdgpu: switch the GTT backend to self alloc Christian König
2021-04-30 14:43   ` Matthew Auld
2021-04-30  9:25 ` [PATCH 10/13] drm/amdgpu: switch the VRAM " Christian König
2021-04-30 14:53   ` Matthew Auld
2021-04-30  9:25 ` [PATCH 11/13] drm/nouveau: switch the TTM backends " Christian König
2021-04-30 15:02   ` Matthew Auld
2021-05-03 11:14     ` Christian König
2021-05-05 16:46       ` Matthew Auld
2021-04-30  9:25 ` [PATCH 12/13] drm/vmwgfx: " Christian König
2021-05-05 16:49   ` Matthew Auld
2021-04-30  9:25 ` [PATCH 13/13] drm/ttm: flip the switch for driver allocated resources Christian König
2021-05-03 16:15   ` Nirmoy
2021-05-05 16:44   ` Matthew Auld
2021-04-30 10:09 ` [PATCH 01/13] drm/ttm: add ttm_sys_manager v2 Matthew Auld

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=f792308b-389d-67da-0cf8-667c1e6ac96d@shipmail.org \
    --to=thomas_os@shipmail.org \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=matthew.william.auld@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.