All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thellstrom@vmware.com>
To: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: [RFC PATCH] drm/ttm: get rid of ttm bo refcounting
Date: Wed, 13 Nov 2013 10:06:34 +0100	[thread overview]
Message-ID: <5283411A.7060101@vmware.com> (raw)
In-Reply-To: <5282BF20.30504@canonical.com>

On 11/13/2013 12:52 AM, Maarten Lankhorst wrote:
> op 12-11-13 22:49, Thomas Hellstrom schreef:
>> On 11/12/2013 07:26 PM, Maarten Lankhorst wrote:
>>> Most drivers have refcounting done in gem, so lets get rid of another refcounting layer. ;)
>>> It has been confusing to keep track of 2 refcounts, so lets just let the driver worry about
>>> refcounting, and keep it hidden from ttm entirely. The core doesn't need to know about the
>>> refcounting anywhere.
>>>
>>> Vmwgfx has 1 bo that doesn't use vmw_dma_buffer, but instead ttm_bo_create. Converting this call
>>> makes every bo use vmw_dma_buffer as base, which means I can simply add refcount to vmw_dma_buffer.
>>>
>>> Mostly meant as a RFC, so I only took effort into converting vmwgfx, radeon, nouveau. Thoughts?
>> Hmm. I don't really see the purpose of this?
> With the patches that embed a GEM object I think it's stupid to keep another refcount. When I was playing with
> TTM in nouveau it was very unclear for me when an object is truly dead due to the various not-dead stages.
> I want to get rid of this confusion and either have a ttm object in a alive state, with the gem object still alive too,
> or in a dying state when ttm_bo_release is called and delayed destroy is used

Vmwgfx embed a ttm base object in the exact same way, and it's working 
perfectly. If there is confusion about
whether the user-interface part is alive or not, that's might to being 
sloppy when passing object pointers around.
Better go fix that up by being strict with pointer types.

The fact is with this code you're going to duplicate a large amount of 
mmap code, and the vmwgfx driver will be uglified to save an IMO 
completely irrelevant amount of memory and cpu-resources.

I believe what you want to do with the gem drivers can be accomplished 
anyway, if needed, by simply not using the ttm bo refcount, but since 
IMO ttm buffer objects are intended to be used standalone and are used 
standalone, this is a NAK for vmwgfx and TTM.

Thanks,
/Thomas

      reply	other threads:[~2013-11-13  9:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 18:26 [RFC PATCH] drm/ttm: get rid of ttm bo refcounting Maarten Lankhorst
2013-11-12 21:49 ` Thomas Hellstrom
2013-11-12 23:52   ` Maarten Lankhorst
2013-11-13  9:06     ` Thomas Hellstrom [this message]

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=5283411A.7060101@vmware.com \
    --to=thellstrom@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maarten.lankhorst@canonical.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.