From: Shixiong Ou <oushixi...@kylinos.cn>

Import dmabuf without mapping its sg_table to avoid issues likes:
   udl 2-1.4:1.0: swiotlb buffer is full (sz: 2097152 bytes), total 65536 
(slots), used 1 (slots)

Signed-off-by: Shixiong Ou <oushixi...@kylinos.cn>
---
 drivers/gpu/drm/udl/udl_drv.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
index 05b3a152cc33..8107549b12e5 100644
--- a/drivers/gpu/drm/udl/udl_drv.c
+++ b/drivers/gpu/drm/udl/udl_drv.c
@@ -49,22 +49,6 @@ static int udl_usb_reset_resume(struct usb_interface 
*interface)
        return drm_mode_config_helper_resume(dev);
 }
 
-/*
- * FIXME: Dma-buf sharing requires DMA support by the importing device.
- *        This function is a workaround to make USB devices work as well.
- *        See todo.rst for how to fix the issue in the dma-buf framework.
- */
-static struct drm_gem_object *udl_driver_gem_prime_import(struct drm_device 
*dev,
-                                                         struct dma_buf 
*dma_buf)
-{
-       struct udl_device *udl = to_udl(dev);
-
-       if (!udl->dmadev)
-               return ERR_PTR(-ENODEV);
-
-       return drm_gem_prime_import_dev(dev, dma_buf, udl->dmadev);
-}
-
 DEFINE_DRM_GEM_FOPS(udl_driver_fops);
 
 static const struct drm_driver driver = {
@@ -72,8 +56,7 @@ static const struct drm_driver driver = {
 
        /* GEM hooks */
        .fops = &udl_driver_fops,
-       DRM_GEM_SHMEM_DRIVER_OPS,
-       .gem_prime_import = udl_driver_gem_prime_import,
+       DRM_GEM_SHMEM_SIMPLE_DRIVER_OPS,
        DRM_FBDEV_SHMEM_DRIVER_OPS,
 
        .name = DRIVER_NAME,
-- 
2.17.1

Reply via email to