mirror-linux/drivers/gpu/drm/virtio
Oleksandr Tyshchenko 5ed267cc7b drm/virtio: Pass correct device to dma_sync_sgtable_for_device()
[ Upstream commit a54bace095 ]

The "vdev->dev.parent" should be used instead of "vdev->dev" as a device
for which to perform the DMA operation in both
virtio_gpu_cmd_transfer_to_host_2d(3d).

Because the virtio-gpu device "vdev->dev" doesn't really have DMA OPS
assigned to it, but parent (virtio-pci or virtio-mmio) device
"vdev->dev.parent" has. The more, the sgtable in question the code is
trying to sync here was mapped for the parent device (by using its DMA OPS)
previously at:
virtio_gpu_object_shmem_init()->drm_gem_shmem_get_pages_sgt()->
dma_map_sgtable(), so should be synced here for the same parent device.

Fixes: b5c9ed70d1 ("drm/virtio: Improve DMA API usage for shmem BOs")
Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230224153450.526222-1-olekstysh@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-22 13:33:39 +01:00
..
Kconfig
Makefile
virtgpu_debugfs.c
virtgpu_display.c drm/virtio: set fb_modifiers_not_supported 2022-09-07 12:13:22 +02:00
virtgpu_drv.c drm/virtio: Use dev_is_pci() 2022-07-19 14:40:58 +02:00
virtgpu_drv.h drm/virtio: Improve DMA API usage for shmem BOs 2022-07-19 14:40:58 +02:00
virtgpu_fence.c
virtgpu_gem.c
virtgpu_ioctl.c drm/virtio: exbuf->fence_fd unmodified on interrupted wait 2023-02-14 19:11:45 +01:00
virtgpu_kms.c drm/virtio: kms: use drm managed resources 2022-07-19 14:40:59 +02:00
virtgpu_object.c drm/virtio: Fix memory leak in virtio_gpu_object_create() 2023-01-12 12:02:26 +01:00
virtgpu_plane.c drm/virtio: remove drm_plane_cleanup() destroy hook 2022-08-19 16:00:15 +02:00
virtgpu_prime.c
virtgpu_trace.h
virtgpu_trace_points.c
virtgpu_vq.c drm/virtio: Pass correct device to dma_sync_sgtable_for_device() 2023-03-22 13:33:39 +01:00
virtgpu_vram.c