diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_state.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_state.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 989322be3728..fec29522298d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "nouveau_drv.h" | 35 | #include "nouveau_drv.h" |
36 | #include "nouveau_drm.h" | 36 | #include "nouveau_drm.h" |
37 | #include "nouveau_fbcon.h" | 37 | #include "nouveau_fbcon.h" |
38 | #include "nouveau_ramht.h" | ||
38 | #include "nv50_display.h" | 39 | #include "nv50_display.h" |
39 | 40 | ||
40 | static void nouveau_stub_takedown(struct drm_device *dev) {} | 41 | static void nouveau_stub_takedown(struct drm_device *dev) {} |
@@ -437,16 +438,14 @@ static int | |||
437 | nouveau_card_init_channel(struct drm_device *dev) | 438 | nouveau_card_init_channel(struct drm_device *dev) |
438 | { | 439 | { |
439 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 440 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
440 | struct nouveau_gpuobj *gpuobj; | 441 | struct nouveau_gpuobj *gpuobj = NULL; |
441 | int ret; | 442 | int ret; |
442 | 443 | ||
443 | ret = nouveau_channel_alloc(dev, &dev_priv->channel, | 444 | ret = nouveau_channel_alloc(dev, &dev_priv->channel, |
444 | (struct drm_file *)-2, | 445 | (struct drm_file *)-2, NvDmaFB, NvDmaTT); |
445 | NvDmaFB, NvDmaTT); | ||
446 | if (ret) | 446 | if (ret) |
447 | return ret; | 447 | return ret; |
448 | 448 | ||
449 | gpuobj = NULL; | ||
450 | ret = nouveau_gpuobj_dma_new(dev_priv->channel, NV_CLASS_DMA_IN_MEMORY, | 449 | ret = nouveau_gpuobj_dma_new(dev_priv->channel, NV_CLASS_DMA_IN_MEMORY, |
451 | 0, dev_priv->vram_size, | 450 | 0, dev_priv->vram_size, |
452 | NV_DMA_ACCESS_RW, NV_DMA_TARGET_VIDMEM, | 451 | NV_DMA_ACCESS_RW, NV_DMA_TARGET_VIDMEM, |
@@ -454,26 +453,25 @@ nouveau_card_init_channel(struct drm_device *dev) | |||
454 | if (ret) | 453 | if (ret) |
455 | goto out_err; | 454 | goto out_err; |
456 | 455 | ||
457 | ret = nouveau_gpuobj_ref_add(dev, dev_priv->channel, NvDmaVRAM, | 456 | ret = nouveau_ramht_insert(dev_priv->channel, NvDmaVRAM, gpuobj); |
458 | gpuobj, NULL); | 457 | nouveau_gpuobj_ref(NULL, &gpuobj); |
459 | if (ret) | 458 | if (ret) |
460 | goto out_err; | 459 | goto out_err; |
461 | 460 | ||
462 | gpuobj = NULL; | ||
463 | ret = nouveau_gpuobj_gart_dma_new(dev_priv->channel, 0, | 461 | ret = nouveau_gpuobj_gart_dma_new(dev_priv->channel, 0, |
464 | dev_priv->gart_info.aper_size, | 462 | dev_priv->gart_info.aper_size, |
465 | NV_DMA_ACCESS_RW, &gpuobj, NULL); | 463 | NV_DMA_ACCESS_RW, &gpuobj, NULL); |
466 | if (ret) | 464 | if (ret) |
467 | goto out_err; | 465 | goto out_err; |
468 | 466 | ||
469 | ret = nouveau_gpuobj_ref_add(dev, dev_priv->channel, NvDmaGART, | 467 | ret = nouveau_ramht_insert(dev_priv->channel, NvDmaGART, gpuobj); |
470 | gpuobj, NULL); | 468 | nouveau_gpuobj_ref(NULL, &gpuobj); |
471 | if (ret) | 469 | if (ret) |
472 | goto out_err; | 470 | goto out_err; |
473 | 471 | ||
474 | return 0; | 472 | return 0; |
473 | |||
475 | out_err: | 474 | out_err: |
476 | nouveau_gpuobj_del(dev, &gpuobj); | ||
477 | nouveau_channel_free(dev_priv->channel); | 475 | nouveau_channel_free(dev_priv->channel); |
478 | dev_priv->channel = NULL; | 476 | dev_priv->channel = NULL; |
479 | return ret; | 477 | return ret; |