From: Thomas Zimmermann <tzimmermann@suse.de>
To: daniel@ffwll.ch, airlied@linux.ie, kraxel@redhat.com,
christian.koenig@amd.com, ray.huang@amd.com, Jerry.Zhang@amd.com,
hdegoede@redhat.com, z.liuxinliang@hisilicon.com,
zourongrong@gmail.com, kong.kongxinwei@hisilicon.com,
puck.chen@hisilicon.com
Cc: dri-devel@lists.freedesktop.org,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v2 02/17] drm: Add |struct drm_gem_vram_object| callbacks for |struct ttm_bo_driver|
Date: Wed, 24 Apr 2019 14:05:06 +0200 [thread overview]
Message-ID: <0fb26281-af29-5d94-6d45-6617fc886e45@suse.de> (raw)
In-Reply-To: <20190424114842.4723-3-tzimmermann@suse.de>
[-- Attachment #1.1.1: Type: text/plain, Size: 1793 bytes --]
Hi Christian,
Am 24.04.19 um 13:48 schrieb Thomas Zimmermann:
> +
> +/*
> + * Helpers for struct ttm_bo_driver
> + */
> +
> +static bool drm_is_gem_vram(struct ttm_buffer_object *bo)
> +{
> + return (bo->destroy == ttm_buffer_object_destroy);
> +}
> +
> +/**
> + * drm_gem_vram_bo_driver_evict_flags() - \
> + Implements &struct ttm_bo_driver.evict_flags
> + * @bo: TTM buffer object. Refers to &struct drm_gem_vram_object.bo
> + * @pl: TTM placement information.
> + */
> +void drm_gem_vram_bo_driver_evict_flags(struct ttm_buffer_object *bo,
> + struct ttm_placement *pl)
> +{
> + struct drm_gem_vram_object *gbo;
> +
> + /* TTM may pass BOs that are not GEM VRAM BOs. */
> + if (!drm_is_gem_vram(bo))
> + return;
> +
> + gbo = drm_gem_vram_of_bo(bo);
> + drm_gem_vram_placement(gbo, TTM_PL_FLAG_SYSTEM);
> + *pl = gbo->placement;
> +}
For drm_is_gem_vram(), I'm not quite sure what else to test for. So
there are still a few things I'd like to discuss.
1) If this test is about the placement flags, then it's unrelated to
the actual DRM driver. All buffers of type |struct drm_gem_vram_object|
share the same placement flags.
2) I tested the code to work with ast and mgag200.
3) If this test is really about individual instances of each DRM
driver, then the current implementations are already broken. In this
scenario TTM should sort out BOs with a BO device different from the one
that triggered the eviction process; or pass the original BO device to
the evict_flags callback, so we can sort out buffers here.
Best regards
Thomas
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2019-04-24 12:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190424114842.4723-1-tzimmermann@suse.de>
2019-04-24 11:48 ` [PATCH v2 01/17] drm: Add |struct drm_gem_vram_object| and helpers Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 02/17] drm: Add |struct drm_gem_vram_object| callbacks for |struct ttm_bo_driver| Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 03/17] drm: Add |struct drm_gem_vram_object| callbacks for |struct drm_driver| Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 04/17] drm: Add drm_gem_vram_fill_create_dumb() to create dumb buffers Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 05/17] drm: Add VRAM MM, a simple memory manager for dedicated VRAM Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 06/17] drm/ast: Convert AST driver to |struct drm_gem_vram_object| Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 07/17] drm/ast: Convert AST driver to VRAM MM Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 08/17] drm/ast: Replace mapping code with drm_gem_vram_{kmap/kunmap}() Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 09/17] drm/bochs: Convert bochs driver to |struct drm_gem_vram_object| Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 10/17] drm/bochs: Convert bochs driver to VRAM MM Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 11/17] drm/mgag200: Convert mgag200 driver to |struct drm_gem_vram_object| Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 12/17] drm/mgag200: Convert mgag200 driver to VRAM MM Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 13/17] drm/mgag200: Replace mapping code with drm_gem_vram_{kmap/kunmap}() Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 14/17] drm/vboxvideo: Convert vboxvideo driver to |struct drm_gem_vram_object| Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 15/17] drm/vboxvideo: Convert vboxvideo driver to VRAM MM Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 16/17] drm/hisilicon: Convert hibmc-drm driver to |struct drm_gem_vram_object| Thomas Zimmermann
2019-04-24 11:48 ` [PATCH v2 17/17] drm/hisilicon: Convert hibmc-drm driver to VRAM MM Thomas Zimmermann
[not found] ` <20190424114842.4723-3-tzimmermann@suse.de>
2019-04-24 12:05 ` Thomas Zimmermann [this message]
2019-04-24 14:13 ` [PATCH v2 02/17] drm: Add |struct drm_gem_vram_object| callbacks for |struct ttm_bo_driver| Koenig, Christian
[not found] ` <20190424114842.4723-8-tzimmermann@suse.de>
2019-04-24 13:04 ` [PATCH v2 07/17] drm/ast: Convert AST driver to VRAM MM Daniel Vetter
[not found] ` <20190424114842.4723-6-tzimmermann@suse.de>
2019-04-24 13:07 ` [PATCH v2 05/17] drm: Add VRAM MM, a simple memory manager for dedicated VRAM Daniel Vetter
2019-04-24 13:09 ` [PATCH v2 00/17] Share TTM code among DRM framebuffer drivers Daniel Vetter
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=0fb26281-af29-5d94-6d45-6617fc886e45@suse.de \
--to=tzimmermann@suse.de \
--cc=Jerry.Zhang@amd.com \
--cc=airlied@linux.ie \
--cc=christian.koenig@amd.com \
--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=ray.huang@amd.com \
--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