diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_object.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_object.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c index 03adfe4c7665..710a7053dc99 100644 --- a/drivers/gpu/drm/nouveau/nouveau_object.c +++ b/drivers/gpu/drm/nouveau/nouveau_object.c | |||
@@ -490,16 +490,22 @@ nouveau_gpuobj_dma_new(struct nouveau_channel *chan, int class, u64 base, | |||
490 | } | 490 | } |
491 | 491 | ||
492 | if (target == NV_MEM_TARGET_GART) { | 492 | if (target == NV_MEM_TARGET_GART) { |
493 | if (dev_priv->gart_info.type == NOUVEAU_GART_AGP) { | 493 | struct nouveau_gpuobj *gart = dev_priv->gart_info.sg_ctxdma; |
494 | target = NV_MEM_TARGET_PCI_NOSNOOP; | 494 | |
495 | base += dev_priv->gart_info.aper_base; | 495 | if (dev_priv->gart_info.type == NOUVEAU_GART_PDMA) { |
496 | } else | 496 | if (base == 0) { |
497 | if (base != 0) { | 497 | nouveau_gpuobj_ref(gart, pobj); |
498 | base = nouveau_sgdma_get_physical(dev, base); | 498 | return 0; |
499 | } | ||
500 | |||
501 | base = nouveau_sgdma_get_physical(dev, base); | ||
499 | target = NV_MEM_TARGET_PCI; | 502 | target = NV_MEM_TARGET_PCI; |
500 | } else { | 503 | } else { |
501 | nouveau_gpuobj_ref(dev_priv->gart_info.sg_ctxdma, pobj); | 504 | base += dev_priv->gart_info.aper_base; |
502 | return 0; | 505 | if (dev_priv->gart_info.type == NOUVEAU_GART_AGP) |
506 | target = NV_MEM_TARGET_PCI_NOSNOOP; | ||
507 | else | ||
508 | target = NV_MEM_TARGET_PCI; | ||
503 | } | 509 | } |
504 | } | 510 | } |
505 | 511 | ||