dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: Daniel Vetter <daniel@ffwll.ch>, Thomas Zimmermann <tzimmermann@suse.de>
Cc: "airlied@linux.ie" <airlied@linux.ie>,
	"puck.chen@hisilicon.com" <puck.chen@hisilicon.com>,
	"Zhang, Jerry" <Jerry.Zhang@amd.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"z.liuxinliang@hisilicon.com" <z.liuxinliang@hisilicon.com>,
	"hdegoede@redhat.com" <hdegoede@redhat.com>,
	"kong.kongxinwei@hisilicon.com" <kong.kongxinwei@hisilicon.com>,
	"Huang, Ray" <Ray.Huang@amd.com>,
	"kraxel@redhat.com" <kraxel@redhat.com>,
	"zourongrong@gmail.com" <zourongrong@gmail.com>
Subject: Re: [PATCH 00/15] Share TTM code among framebuffer drivers
Date: Tue, 16 Apr 2019 10:05:49 +0000	[thread overview]
Message-ID: <9a3af097-d907-30da-73db-bcf00223e70b@amd.com> (raw)
In-Reply-To: <CAKMK7uG+E1uTwSifSu5TrXwQXqu0Cpr30B02_S9bf95HEyqY_g@mail.gmail.com>

Am 15.04.19 um 21:17 schrieb Daniel Vetter:
> On Mon, Apr 15, 2019 at 6:21 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> Hi
>>
>> Am 15.04.19 um 17:54 schrieb Daniel Vetter:
>>> On Tue, Apr 09, 2019 at 09:50:40AM +0200, Thomas Zimmermann wrote:
>>>> Hi
>>>>
>>>> Am 09.04.19 um 09:12 schrieb kraxel@redhat.com:
>>>> [SNIP]
>>>>> I'd expect the same applies to the vbox driver.
>>>>>
>>>>> Dunno about the other drm drivers and the fbdev drivers you plan to
>>>>> migrate over.
>>>> The AST HW can support up to 512 MiB, but 32-64 MiB seems more realistic
>>>> for a server. It's similar with mgag200 HW. The old fbdev-supported
>>>> device are all somewhere in the range between cirrus and bochs. Some
>>>> drivers would probably benefit from the cirrus approach, some could use
>>>> VRAM directly.
>>> I think for dumb scanout with vram all we need is:
>>> - pin framebuffers, which potentially moves the underlying bo into vram
>>> - unpin framebuffers (which is just accounting, we don't want to move the
>>>    bo on every flip!)
>>> - if a pin doesn't find enough space, move one of the unpinned bo still
>>>    resident in vram out
>> For dumb buffers, I'd expect userspace to have a working set of only a
>> front and back buffer (plus maybe a third one). This working set has to
>> reside in VRAM for performance reasons; non-WS BOs from other userspace
>> programs don't have to be.
>>
>> So we could simplify even more: if there's not enough free space in
>> vram, remove all unpinned BO's. This would avoid the need to implement
>> an LRU algorithm or another eviction strategy. Userspace with a WS
>> larger than the absolute VRAM would see degraded performance but
>> otherwise still work.
> You still need a list of unpinned bo, and the lru scan algorithm is
> just a few lines of code more than unpinning everything. Plus it'd be
> a neat example of the drm_mm scan logic. Given that some folks might
> think that not having lru evict si a problem and get them to type
> their own, I'd just add it. But up to you. Plus with ttm you get it no
> matter what.

Well how about making an drm_lru component which just does the following 
(and nothing else, please :):

1. Keep a list of objects and a spinlock protecting the list.

2. Offer helpers for adding/deleting/moving stuff from the list.

3. Offer a functionality to do the necessary dance of picking the first 
entry where we can trylock it's reservation object.

4. Offer bulk move functionality similar to what TTM does at the moment 
(can be implemented later on).

Regards,
Christian.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-04-16 10:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08  9:21 [PATCH 00/15] Share TTM code among framebuffer drivers Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 01/15] drm: Add |struct drm_gem_ttm_object| and helpers Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 02/15] drm: Add |struct drm_gem_ttm_object| callbacks for |struct ttm_bo_driver| Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 03/15] drm: Add |struct drm_gem_ttm_object| callbacks for |struct drm_driver| Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 04/15] drm: Add drm_gem_ttm_fill_create_dumb() to create dumb buffers Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 05/15] drm: Add Simple TTM, a memory manager for dedicated VRAM Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 06/15] drm/ast: Convert AST driver to |struct drm_gem_ttm_object| Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 07/15] drm/ast: Convert AST driver to Simple TTM Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 08/15] drm/bochs: Convert Bochs driver to |struct drm_gem_ttm_object| Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 09/15] drm/bochs: Convert Bochs driver to Simple TTM Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 10/15] drm/mgag200: Convert mgag200 driver to |struct drm_gem_ttm_object| Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 11/15] drm/mgag200: Convert mgag200 driver to Simple TTM Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 12/15] drm/vboxvideo: Convert vboxvideo driver to |struct drm_gem_ttm_object| Thomas Zimmermann
2019-04-09  7:09   ` Hans de Goede
2019-04-08  9:21 ` [PATCH 13/15] drm/vboxvideo: Convert vboxvideo driver to Simple TTM Thomas Zimmermann
2019-04-09  7:09   ` Hans de Goede
2019-04-09  7:37     ` Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 14/15] drm/hisilicon: Convert hibmc-drm driver to |struct drm_gem_ttm_object| Thomas Zimmermann
2019-04-08  9:21 ` [PATCH 15/15] drm/hisilicon: Convert hibmc-drm driver to Simple TTM Thomas Zimmermann
2019-04-08 11:10 ` [PATCH 00/15] Share TTM code among framebuffer drivers Koenig, Christian
2019-04-08 11:59   ` Thomas Zimmermann
2019-04-09  7:12     ` kraxel
2019-04-09  7:42       ` Dave Airlie
2019-04-09  8:29         ` kraxel
2019-04-09 11:55           ` Christian König
2019-04-09  7:50       ` Thomas Zimmermann
2019-04-15 15:54         ` Daniel Vetter
2019-04-15 15:57           ` Daniel Vetter
2019-04-15 16:21           ` Thomas Zimmermann
2019-04-15 19:17             ` Daniel Vetter
2019-04-16 10:05               ` Koenig, Christian [this message]
2019-04-16 11:03                 ` Daniel Vetter
2019-04-16 11:10                   ` Koenig, Christian
2019-04-09 13:39     ` Koenig, Christian

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=9a3af097-d907-30da-73db-bcf00223e70b@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Jerry.Zhang@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=kraxel@redhat.com \
    --cc=puck.chen@hisilicon.com \
    --cc=tzimmermann@suse.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=z.liuxinliang@hisilicon.com \
    --cc=zourongrong@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox