[PATCH 03/10] drm/gem-dma: Use dma_buf from GEM object instance

Anusha Srivatsa asrivats at redhat.com
Fri Feb 28 16:12:32 UTC 2025


On Wed, Feb 26, 2025 at 12:28 PM Thomas Zimmermann <tzimmermann at suse.de>
wrote:

> Avoid dereferencing struct drm_gem_object.import_attach for the
> imported dma-buf. The dma_buf field in the GEM object instance refers
> to the same buffer. Prepares to make import_attach optional.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> ---
>  drivers/gpu/drm/drm_gem_dma_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_gem_dma_helper.c
> b/drivers/gpu/drm/drm_gem_dma_helper.c
> index 4f0320df858f..b7f033d4352a 100644
> --- a/drivers/gpu/drm/drm_gem_dma_helper.c
> +++ b/drivers/gpu/drm/drm_gem_dma_helper.c
> @@ -230,7 +230,7 @@ void drm_gem_dma_free(struct drm_gem_dma_object
> *dma_obj)
>
>         if (drm_gem_is_imported(gem_obj)) {
>                 if (dma_obj->vaddr)
> -
>  dma_buf_vunmap_unlocked(gem_obj->import_attach->dmabuf, &map);
> +                       dma_buf_vunmap_unlocked(gem_obj->dma_buf, &map);
>                 drm_prime_gem_destroy(gem_obj, dma_obj->sgt);
>         } else if (dma_obj->vaddr) {
>                 if (dma_obj->map_noncoherent)
>

Reviewed-by: Anusha Srivatsa <asrivats at redhat.com>


> --
> 2.48.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20250228/8d74fcbd/attachment.htm>


More information about the dri-devel mailing list