dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: daniel@ffwll.ch, airlied@gmail.com, mripard@kernel.org,
	maarten.lankhorst@linux.intel.com, zackr@vmware.com,
	contact@emersion.fr, linux-graphics-maintainer@vmware.com,
	alexdeucher@gmail.com, quic_jhugo@quicinc.com
Cc: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Subject: [PATCH v2 0/3] drm: Allow PRIME 'self-import' for all drivers
Date: Tue, 20 Jun 2023 09:59:56 +0200	[thread overview]
Message-ID: <20230620080252.16368-1-tzimmermann@suse.de> (raw)

Set drm_gem_prime_handle_to_fd() and drm_gem_prime_fd_to_handle()
for all DRM drivers. Even drivers that do not support PRIME import
or export of dma-bufs can now import their own buffer objects. This
is required by some userspace, such as wlroots-based compositors, to
share buffers among processes.

The only driver that does not use the drm_gem_prime_*() helpers is
vmwgfx. Leave a comment on the callbacks in struct drm_driver, so that
no other driver uses them.

Simon Ser implemented the feature for drivers based on GEM VRAM helpers
in [1]. This patchset generalizes the code for all drivers that do not
otherwise support PRIME. Tested by running sway with gma500 hardware.

v2:
	* documentation and TODO cleanups (Simon, Zack)
	* small style cleanups

[1] https://lore.kernel.org/dri-devel/20230302143502.500661-1-contact@emersion.fr/

Thomas Zimmermann (3):
  drm: Enable PRIME import/export for all drivers
  drm: Clear fd/handle callbacks in struct drm_driver
  drm/prime: Unexport helpers for fd/handle conversion

 drivers/accel/ivpu/ivpu_drv.c                 |  2 -
 drivers/accel/qaic/qaic_drv.c                 |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |  4 --
 drivers/gpu/drm/armada/armada_drv.c           |  2 -
 drivers/gpu/drm/drm_ioctl.c                   |  3 +-
 drivers/gpu/drm/drm_prime.c                   | 67 +++++++++----------
 drivers/gpu/drm/etnaviv/etnaviv_drv.c         |  2 -
 drivers/gpu/drm/exynos/exynos_drm_drv.c       |  2 -
 drivers/gpu/drm/i915/i915_driver.c            |  2 -
 drivers/gpu/drm/lima/lima_drv.c               |  2 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c        |  2 -
 drivers/gpu/drm/msm/msm_drv.c                 |  2 -
 drivers/gpu/drm/nouveau/nouveau_drm.c         |  2 -
 drivers/gpu/drm/omapdrm/omap_drv.c            |  2 -
 drivers/gpu/drm/panfrost/panfrost_drv.c       |  2 -
 drivers/gpu/drm/pl111/pl111_drv.c             |  2 -
 drivers/gpu/drm/qxl/qxl_drv.c                 |  2 -
 drivers/gpu/drm/radeon/radeon_drv.c           |  2 -
 drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c |  2 -
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c   |  2 -
 drivers/gpu/drm/tegra/drm.c                   |  2 -
 drivers/gpu/drm/v3d/v3d_drv.c                 |  2 -
 drivers/gpu/drm/virtio/virtgpu_drv.c          |  2 -
 drivers/gpu/drm/xen/xen_drm_front.c           |  2 -
 include/drm/drm_drv.h                         | 12 +---
 include/drm/drm_gem_dma_helper.h              |  8 +--
 include/drm/drm_gem_shmem_helper.h            |  4 +-
 include/drm/drm_gem_vram_helper.h             |  8 +--
 include/drm/drm_prime.h                       |  7 --
 29 files changed, 40 insertions(+), 114 deletions(-)


base-commit: 32e260cd0d16cee6f33e747679f168d63ea54bf6
-- 
2.41.0


             reply	other threads:[~2023-06-20  8:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20  7:59 Thomas Zimmermann [this message]
2023-06-20  7:59 ` [PATCH v2 1/3] drm: Enable PRIME import/export for all drivers Thomas Zimmermann
2023-06-20 15:50   ` Jeffrey Hugo
2023-06-20  7:59 ` [PATCH v2 2/3] drm: Clear fd/handle callbacks in struct drm_driver Thomas Zimmermann
2023-06-20  7:59 ` [PATCH v2 3/3] drm/prime: Unexport helpers for fd/handle conversion Thomas Zimmermann
2023-06-20 15:55   ` Jeffrey Hugo
2023-06-21  8:01     ` 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=20230620080252.16368-1-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=alexdeucher@gmail.com \
    --cc=contact@emersion.fr \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    --cc=zackr@vmware.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