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>
History 2023-03-22 13:33:39 +01:00
..
Kconfig drivers: gpu: drm: virtio: fix dependency of DRM_VIRTIO_GPU on VIRTIO 2020-12-22 13:43:29 +01:00
Makefile drm/virtio: implement blob resources: implement vram object 2020-09-29 11:23:33 +02:00
virtgpu_debugfs.c drm: Convert open-coded yes/no strings to yesno() 2022-02-07 13:04:25 -08:00
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 drm/virtio: implement context init: add virtio_gpu_fence_event 2021-09-29 09:22:31 +02:00
virtgpu_gem.c drm/virtio: Unlock reservations on dma_resv_reserve_fences() error 2022-07-19 14:40:58 +02:00
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 drm/virtio: simplify the return expression 2022-06-09 07:30:13 +02:00
virtgpu_trace.h drm/virtio: add trace events for commands 2019-05-06 10:52:58 +02:00
virtgpu_trace_points.c drm/virtio: add trace events for commands 2019-05-06 10:52:58 +02:00
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 drm/virtio: support mapping exported vram 2021-08-16 14:09:40 +02:00