]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/nouveau: fix dma_address check for CPU/GPU sync
authorChristian König <christian.koenig@amd.com>
Fri, 11 Jun 2021 12:34:50 +0000 (14:34 +0200)
committerChristian König <christian.koenig@amd.com>
Thu, 24 Jun 2021 13:40:44 +0000 (15:40 +0200)
AGP for example doesn't have a dma_address array.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210614110517.1624-1-christian.koenig@amd.com
drivers/gpu/drm/nouveau/nouveau_bo.c

index 3e09df0472ce40183caf0babe242ac61ee3fe519..170aba99a11015ebab91f318ccfa11b8b1c98cca 100644 (file)
@@ -546,7 +546,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)
        struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;
        int i, j;
 
-       if (!ttm_dma)
+       if (!ttm_dma || !ttm_dma->dma_address)
                return;
        if (!ttm_dma->pages) {
                NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma);
@@ -582,7 +582,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)
        struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm;
        int i, j;
 
-       if (!ttm_dma)
+       if (!ttm_dma || !ttm_dma->dma_address)
                return;
        if (!ttm_dma->pages) {
                NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma);