From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: "Thomas Hellström (Intel)" <thomas_os@shipmail.org>,
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: Sun, 30 May 2021 18:51:47 +0200 [thread overview]
Message-ID: <7b4129a9-7e12-a3ac-f456-0c18b01a174c@gmail.com> (raw)
In-Reply-To: <f792308b-389d-67da-0cf8-667c1e6ac96d@shipmail.org>
Hi Thomas,
Am 29.05.21 um 17:48 schrieb Thomas Hellström (Intel):
> 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?
Why do you think the visibility is pushed to the range manger?
>
> 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.
Well I don't see that as an abuse. The backend allocation are completely
driver specific and the range manager is just implementing some common
ground for drm_mm based backends.
>
> 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.
Driver specific backends should inherit either from the range manager
when they want to implement a drm_mm based backend or from ttm_resource
directly.
>
> 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.
Yes moving the iterators into that was also my idea.
>
> So basically here
>
> 1) Would help making range managers with various functionality simple
> to write and share.
I don't think we want that. Instead allocation backends should be driver
specific and we should just implement some common ground helpers for
drm_mm based backends in TTM.
> 2) Would help drivers attach private data to a struct ttm_resource
> without abusing the manager interfaces,
I don't think that this is abusive in the first place. Drivers should
append resource specific information by inheriting from the ttm_resource
object.
Regards,
Christian.
> 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
>
>
>
next prev parent reply other threads:[~2021-05-30 16:51 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)
2021-05-30 16:51 ` Christian König [this message]
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=7b4129a9-7e12-a3ac-f456-0c18b01a174c@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=matthew.william.auld@gmail.com \
--cc=thomas_os@shipmail.org \
/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;
as well as URLs for NNTP newsgroup(s).