Patch "drm/prime: Unbreak virtgpu dma-buf export" has been added to the 6.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/prime: Unbreak virtgpu dma-buf export

to the 6.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-prime-unbreak-virtgpu-dma-buf-export.patch
and it can be found in the queue-6.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4451e59833ad0f598122eb112c014747f30beec0
Author: Rob Clark <robdclark@xxxxxxxxxxxx>
Date:   Fri Mar 22 14:48:01 2024 -0700

    drm/prime: Unbreak virtgpu dma-buf export
    
    [ Upstream commit a4ec240f6b7c21cf846d10017c3ce423a0eae92c ]
    
    virtgpu "vram" GEM objects do not implement obj->get_sg_table().  But
    they also don't use drm_gem_map_dma_buf().  In fact they may not even
    have guest visible pages.  But it is perfectly fine to export and share
    with other virtual devices.
    
    Reported-by: Dominik Behr <dbehr@xxxxxxxxxxxx>
    Fixes: 207395da5a97 ("drm/prime: reject DMA-BUF attach when get_sg_table is missing")
    Signed-off-by: Rob Clark <robdclark@xxxxxxxxxxxx>
    Reviewed-by: Simon Ser <contact@xxxxxxxxxxx>
    Signed-off-by: Simon Ser <contact@xxxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240322214801.319975-1-robdclark@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 7352bde299d54..03bd3c7bd0dc2 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -582,7 +582,12 @@ int drm_gem_map_attach(struct dma_buf *dma_buf,
 {
 	struct drm_gem_object *obj = dma_buf->priv;
 
-	if (!obj->funcs->get_sg_table)
+	/*
+	 * drm_gem_map_dma_buf() requires obj->get_sg_table(), but drivers
+	 * that implement their own ->map_dma_buf() do not.
+	 */
+	if (dma_buf->ops->map_dma_buf == drm_gem_map_dma_buf &&
+	    !obj->funcs->get_sg_table)
 		return -ENOSYS;
 
 	return drm_gem_pin(obj);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux