All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zenghui Yu <zenghui.yu@linux.dev>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: christian.koenig@amd.com, oushixiong@kylinos.cn,
	louis.chauvet@bootlin.com, hamohammed.sa@gmail.com,
	simona@ffwll.ch, melissa.srw@gmail.com, airlied@redhat.com,
	jfalempe@redhat.com, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org, sean@poorly.run,
	dri-devel@lists.freedesktop.org,
	"José Expósito" <jose.exposito89@gmail.com>
Subject: Re: [PATCH] drm/gem-shmem: Do not map s/g table by default
Date: Wed, 2 Jul 2025 00:20:42 +0800	[thread overview]
Message-ID: <c546bd16-d362-4271-b6d5-5ebba1b559e8@linux.dev> (raw)
In-Reply-To: <20250630143537.309052-1-tzimmermann@suse.de>

On 2025/6/30 22:34, Thomas Zimmermann wrote:
> The vast majority of drivers that use GEM-SHMEM helpers do not use
> an s/g table for imported buffers; specifically all drivers that use
> DRM_GEM_SHMEM_DRIVER_OPS. Therefore convert the initializer macro
> to DRM_GEM_SHMEM_DRIVER_OPS_NO_MAP_SGT and remove the latter. This
> helps to avoid swiotbl errors, such as seen with some Aspeed systems
> 
>   ast 0000:07:00.0: swiotlb buffer is full (sz: 3145728 bytes), total 32768 (slots), used 0 (slots)
> 
> The error is caused by the system's limited DMA capabilities and can
> happen with any GEM-SHMEM-based driver. It results in a performance
> penalty.
> 
> In the case of vgem and vkms, the devices do not support DMA at all,
> which can result in failure to map the buffer object into the kernel's
> address space. [1][2] Avoiding the s/g table fixes this problem.
> 
> The other drivers based on GEM-SHMEM, imagination, lima, panfrost,
> panthor, v3d and virtio, use the s/g table of imported buffers. Neither
> driver uses the default initializer, so they won't be affected by
> this change.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Reported-by: Zenghui Yu <zenghui.yu@linux.dev>
> Closes: https://lore.kernel.org/dri-devel/6d22bce3-4533-4cfa-96ba-64352b715741@linux.dev/ # [1]
> Reported-by: José Expósito <jose.exposito89@gmail.com>
> Closes: https://lore.kernel.org/dri-devel/20250311172054.2903-1-jose.exposito89@gmail.com/ # [2]

Tested-by: Zenghui Yu <zenghui.yu@linux.dev>

Thanks!

  reply	other threads:[~2025-07-01 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 14:34 [PATCH] drm/gem-shmem: Do not map s/g table by default Thomas Zimmermann
2025-07-01 16:20 ` Zenghui Yu [this message]
2025-07-02  7:10 ` Christian König
2025-07-03  8:40 ` Louis Chauvet
2025-07-07 13:50 ` Thomas Zimmermann

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=c546bd16-d362-4271-b6d5-5ebba1b559e8@linux.dev \
    --to=zenghui.yu@linux.dev \
    --cc=airlied@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=jfalempe@redhat.com \
    --cc=jose.exposito89@gmail.com \
    --cc=louis.chauvet@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=melissa.srw@gmail.com \
    --cc=mripard@kernel.org \
    --cc=oushixiong@kylinos.cn \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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.