From: Thomas Zimmermann <tzimmermann@suse.de>
To: boris.brezillon@collabora.com, simona@ffwll.ch,
airlied@gmail.com, mripard@kernel.org,
maarten.lankhorst@linux.intel.com, ogabbay@kernel.org,
mamin506@gmail.com, lizhi.hou@amd.com,
maciej.falkowski@linux.intel.com,
karol.wachowski@linux.intel.com, tomeu@tomeuvizoso.net,
frank.binns@imgtec.com, matt.coster@imgtec.com, yuq825@gmail.com,
robh@kernel.org, steven.price@arm.com,
adrian.larumbe@collabora.com, liviu.dudau@arm.com,
mwen@igalia.com, kraxel@redhat.com,
dmitry.osipenko@collabora.com, gurchetansingh@chromium.org,
olvaffe@gmail.com, corbet@lwn.net
Cc: dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org,
virtualization@lists.linux.dev, linux-doc@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 04/13] drm/gem-uma: Remove unused interfaces
Date: Tue, 9 Dec 2025 14:42:01 +0100 [thread overview]
Message-ID: <20251209140141.94407-5-tzimmermann@suse.de> (raw)
In-Reply-To: <20251209140141.94407-1-tzimmermann@suse.de>
Copying from GEM-SHMEM duplicated a number of interfaces that are not
required. Remove them.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/gpu/drm/drm_gem_uma_helper.c | 111 ---------------------------
include/drm/drm_gem_uma_helper.h | 16 ----
2 files changed, 127 deletions(-)
diff --git a/drivers/gpu/drm/drm_gem_uma_helper.c b/drivers/gpu/drm/drm_gem_uma_helper.c
index d617cfd981e1..2b88e21b1db9 100644
--- a/drivers/gpu/drm/drm_gem_uma_helper.c
+++ b/drivers/gpu/drm/drm_gem_uma_helper.c
@@ -18,7 +18,6 @@
#include <drm/drm.h>
#include <drm/drm_device.h>
#include <drm/drm_drv.h>
-#include <drm/drm_dumb_buffers.h>
#include <drm/drm_gem_uma_helper.h>
#include <drm/drm_prime.h>
#include <drm/drm_print.h>
@@ -466,29 +465,6 @@ void drm_gem_uma_vunmap_locked(struct drm_gem_uma_object *uma, struct iosys_map
}
EXPORT_SYMBOL_GPL(drm_gem_uma_vunmap_locked);
-static int
-drm_gem_uma_create_with_handle(struct drm_file *file_priv,
- struct drm_device *dev, size_t size,
- uint32_t *handle)
-{
- struct drm_gem_uma_object *uma;
- int ret;
-
- uma = drm_gem_uma_create(dev, size);
- if (IS_ERR(uma))
- return PTR_ERR(uma);
-
- /*
- * Allocate an id of idr table where the obj is registered
- * and handle has the id what user can see.
- */
- ret = drm_gem_handle_create(file_priv, &uma->base, handle);
- /* drop reference from allocate - handle holds it now. */
- drm_gem_object_put(&uma->base);
-
- return ret;
-}
-
/* Update madvise status, returns true if not purged, else
* false or -errno.
*/
@@ -537,36 +513,6 @@ void drm_gem_uma_purge_locked(struct drm_gem_uma_object *uma)
}
EXPORT_SYMBOL_GPL(drm_gem_uma_purge_locked);
-/**
- * drm_gem_uma_dumb_create - Create a dumb UMA buffer object
- * @file: DRM file structure to create the dumb buffer for
- * @dev: DRM device
- * @args: IOCTL data
- *
- * This function computes the pitch of the dumb buffer and rounds it up to an
- * integer number of bytes per pixel. Drivers for hardware that doesn't have
- * any additional restrictions on the pitch can directly use this function as
- * their &drm_driver.dumb_create callback.
- *
- * For hardware with additional restrictions, drivers can adjust the fields
- * set up by userspace before calling into this function.
- *
- * Returns:
- * 0 on success or a negative error code on failure.
- */
-int drm_gem_uma_dumb_create(struct drm_file *file, struct drm_device *dev,
- struct drm_mode_create_dumb *args)
-{
- int ret;
-
- ret = drm_mode_size_dumb(dev, args, SZ_8, 0);
- if (ret)
- return ret;
-
- return drm_gem_uma_create_with_handle(file, dev, args->size, &args->handle);
-}
-EXPORT_SYMBOL_GPL(drm_gem_uma_dumb_create);
-
static vm_fault_t drm_gem_uma_fault(struct vm_fault *vmf)
{
struct vm_area_struct *vma = vmf->vma;
@@ -836,63 +782,6 @@ drm_gem_uma_prime_import_sg_table(struct drm_device *dev,
}
EXPORT_SYMBOL_GPL(drm_gem_uma_prime_import_sg_table);
-/**
- * drm_gem_uma_prime_import_no_map - Import dmabuf without mapping its sg_table
- * @dev: Device to import into
- * @dma_buf: dma-buf object to import
- *
- * Drivers that use the GEM UMA helpers but also wants to import dmabuf without
- * mapping its sg_table can use this as their &drm_driver.gem_prime_import
- * implementation.
- */
-struct drm_gem_object *drm_gem_uma_prime_import_no_map(struct drm_device *dev,
- struct dma_buf *dma_buf)
-{
- struct dma_buf_attachment *attach;
- struct drm_gem_uma_object *uma;
- struct drm_gem_object *obj;
- size_t size;
- int ret;
-
- if (drm_gem_is_prime_exported_dma_buf(dev, dma_buf)) {
- /*
- * Importing dmabuf exported from our own gem increases
- * refcount on gem itself instead of f_count of dmabuf.
- */
- obj = dma_buf->priv;
- drm_gem_object_get(obj);
- return obj;
- }
-
- attach = dma_buf_attach(dma_buf, dev->dev);
- if (IS_ERR(attach))
- return ERR_CAST(attach);
-
- get_dma_buf(dma_buf);
-
- size = PAGE_ALIGN(attach->dmabuf->size);
-
- uma = __drm_gem_uma_create(dev, size, true, NULL);
- if (IS_ERR(uma)) {
- ret = PTR_ERR(uma);
- goto fail_detach;
- }
-
- drm_dbg_prime(dev, "size = %zu\n", size);
-
- uma->base.import_attach = attach;
- uma->base.resv = dma_buf->resv;
-
- return &uma->base;
-
-fail_detach:
- dma_buf_detach(dma_buf, attach);
- dma_buf_put(dma_buf);
-
- return ERR_PTR(ret);
-}
-EXPORT_SYMBOL_GPL(drm_gem_uma_prime_import_no_map);
-
MODULE_DESCRIPTION("DRM UMA memory-management helpers");
MODULE_IMPORT_NS("DMA_BUF");
MODULE_LICENSE("GPL");
diff --git a/include/drm/drm_gem_uma_helper.h b/include/drm/drm_gem_uma_helper.h
index e7722c625fab..3d6de27efe79 100644
--- a/include/drm/drm_gem_uma_helper.h
+++ b/include/drm/drm_gem_uma_helper.h
@@ -13,7 +13,6 @@
#include <drm/drm_prime.h>
struct dma_buf_attachment;
-struct drm_mode_create_dumb;
struct drm_printer;
struct sg_table;
@@ -290,20 +289,5 @@ struct drm_gem_object *
drm_gem_uma_prime_import_sg_table(struct drm_device *dev,
struct dma_buf_attachment *attach,
struct sg_table *sgt);
-int drm_gem_uma_dumb_create(struct drm_file *file, struct drm_device *dev,
- struct drm_mode_create_dumb *args);
-struct drm_gem_object *drm_gem_uma_prime_import_no_map(struct drm_device *dev,
- struct dma_buf *buf);
-
-/**
- * DRM_GEM_UMA_DRIVER_OPS - Default GEM UMA operations
- *
- * This macro provides a shortcut for setting the GEM UMA operations
- * in the &drm_driver structure. Drivers that do not require an s/g table
- * for imported buffers should use this.
- */
-#define DRM_GEM_UMA_DRIVER_OPS \
- .gem_prime_import = drm_gem_uma_prime_import_no_map, \
- .dumb_create = drm_gem_uma_dumb_create
#endif /* __DRM_GEM_UMA_HELPER_H__ */
--
2.52.0
next prev parent reply other threads:[~2025-12-09 14:02 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 13:41 [RFC][PATCH 00/13] drm: Introduce GEM-UMA memory management Thomas Zimmermann
2025-12-09 13:41 ` [PATCH 01/13] drm/gem-shmem: Fix typos in documentation Thomas Zimmermann
2025-12-11 10:00 ` Boris Brezillon
2025-12-11 12:03 ` Thomas Zimmermann
2025-12-09 13:41 ` [PATCH 02/13] drm/gem-shmem: Fix the MODULE_LICENSE() string Thomas Zimmermann
2025-12-11 10:01 ` Boris Brezillon
2025-12-11 12:04 ` Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 03/13] drm: Add GEM-UMA helpers for memory management Thomas Zimmermann
2025-12-09 13:42 ` Thomas Zimmermann [this message]
2025-12-09 13:42 ` [PATCH 05/13] drm/imagination: Use " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 06/13] drm/lima: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 07/13] drm/panfrost: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 08/13] drm/panthor: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 09/13] drm/v3d: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 10/13] drm/virtgpu: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 11/13] accel/amdxdna: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 12/13] accel/ivpu: " Thomas Zimmermann
2025-12-09 14:24 ` Karol Wachowski
2025-12-09 14:25 ` Karol Wachowski
2025-12-09 13:42 ` [PATCH 13/13] accel/rocket: " Thomas Zimmermann
2025-12-09 14:27 ` [RFC][PATCH 00/13] drm: Introduce GEM-UMA " Boris Brezillon
2025-12-09 14:51 ` Thomas Zimmermann
2025-12-09 15:30 ` Boris Brezillon
2025-12-10 7:34 ` Thomas Zimmermann
2025-12-10 9:21 ` Boris Brezillon
2025-12-10 9:57 ` 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=20251209140141.94407-5-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=adrian.larumbe@collabora.com \
--cc=airlied@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=corbet@lwn.net \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=frank.binns@imgtec.com \
--cc=gurchetansingh@chromium.org \
--cc=karol.wachowski@linux.intel.com \
--cc=kraxel@redhat.com \
--cc=lima@lists.freedesktop.org \
--cc=linux-doc@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=lizhi.hou@amd.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=maciej.falkowski@linux.intel.com \
--cc=mamin506@gmail.com \
--cc=matt.coster@imgtec.com \
--cc=mripard@kernel.org \
--cc=mwen@igalia.com \
--cc=ogabbay@kernel.org \
--cc=olvaffe@gmail.com \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=steven.price@arm.com \
--cc=tomeu@tomeuvizoso.net \
--cc=virtualization@lists.linux.dev \
--cc=yuq825@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;
as well as URLs for NNTP newsgroup(s).