All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zack Rusin <zackr@vmware.com>
To: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"thomas.hellstrom@linux.intel.com"
	<thomas.hellstrom@linux.intel.com>
Cc: "christian.koenig@amd.com" <christian.koenig@amd.com>,
	Martin Krastev <krastevm@vmware.com>
Subject: Re: [PATCH 4/5] drm/vmwgfx: Introduce a new placement for MOB page tables
Date: Wed, 13 Oct 2021 04:09:50 +0000	[thread overview]
Message-ID: <53ebf8a447173915aed47a46e5569ba52ce02f83.camel@vmware.com> (raw)
In-Reply-To: <a0d82e4c-f762-e6c6-0f08-7f92e735e0c2@linux.intel.com>

On Tue, 2021-10-12 at 20:57 +0200, Thomas Hellström wrote:
> > +void vmw_sys_man_fini(struct vmw_private *dev_priv)
> > +{
> > +       struct ttm_resource_manager *man =
> > ttm_manager_type(&dev_priv->bdev,
> > +                                                          
> > VMW_PL_SYSTEM);
> > +
> > +       ttm_resource_manager_evict_all(&dev_priv->bdev, man);
> > +
> > +       ttm_resource_manager_set_used(man, false);
> > +       ttm_resource_manager_cleanup(man);
> > +
> > +       ttm_set_driver_manager(&dev_priv->bdev, VMW_PL_SYSTEM,
> > NULL);
> > +       kfree(man);
> > +}
> 
> I seem to recognize the general pattern here from the
> ttm_sys_manager, 
> Any chance we could add what's needed to the ttm_sys_manager and make
> the code reusable? That's the _fini function and the memory type
> choice 
> I guess. I figure i915 will need exactly the same.

I think technically we could share this entire thing. I'm not sure how
many GPU specific features one needs for "system memory placement but
allowing fencing".

As to sharing just the fini, I'd be happy to share any code we can but
it'd be probably be only between vmwgfx and i915 because the default
sys_man doesn't need the evict_all and it's allocated as part of its
parent struct so it doesn't need to free. We could trivially add void
ttm_fencable_sys_man_fini(struct ttm_device *dev, u32 mem_type) but I'd
probably wait until i915 is ready to use it to avoid adding shared code
that's only used by a single driver :)

z

  reply	other threads:[~2021-10-13  4:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 17:31 [PATCH 0/5] drm/vmwgfx: Support module unload and hotunplug Zack Rusin
2021-10-08 17:31 ` [PATCH 1/5] drm/vmwgfx: Remove the deprecated lower mem limit Zack Rusin
2021-10-08 17:31 ` [PATCH 2/5] drm/vmwgfx: Release ttm memory if probe fails Zack Rusin
2021-10-08 17:31 ` [PATCH 3/5] drm/vmwgfx: Fail to initialize on broken configs Zack Rusin
2021-10-08 17:31 ` [PATCH 4/5] drm/vmwgfx: Introduce a new placement for MOB page tables Zack Rusin
2021-10-12 18:57   ` Thomas Hellström
2021-10-13  4:09     ` Zack Rusin [this message]
2021-10-08 17:31 ` [PATCH 5/5] drm/vmwgfx: Switch the internal BO's to ttm_bo_type_kernel Zack Rusin
2021-10-08 20:28 ` [PATCH 0/5] drm/vmwgfx: Support module unload and hotunplug Thomas Hellström
2021-10-08 20:40   ` Zack Rusin
2021-10-08 21:13     ` Thomas Hellström
2021-10-11  8:17       ` Christian König
2021-10-11 12:04         ` Thomas Hellström
2021-10-12  8:27           ` Christian König
2021-10-12  9:10             ` Thomas Hellström
2021-10-12 17:34               ` Zack Rusin
2021-10-13 12:50                 ` Daniel Vetter
2021-10-13 14:56                   ` Zack Rusin

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=53ebf8a447173915aed47a46e5569ba52ce02f83.camel@vmware.com \
    --to=zackr@vmware.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krastevm@vmware.com \
    --cc=thomas.hellstrom@linux.intel.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.