diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-11-23 19:15:05 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-12-21 02:17:28 -0500 |
commit | effd6e066f406277254ad7603cf2c7465c4f114b (patch) | |
tree | 33a9e5ffe4c432b13ffed8becbb5dd46b130f0de | |
parent | 7460d70355eb568817296d6d3364f72d72eeba70 (diff) |
drm/nvc0: implement channel structure initialisation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_object.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c index c64fd971b867..d77b1fcd19d4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_object.c +++ b/drivers/gpu/drm/nouveau/nouveau_object.c | |||
@@ -779,6 +779,25 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan, | |||
779 | 779 | ||
780 | NV_DEBUG(dev, "ch%d vram=0x%08x tt=0x%08x\n", chan->id, vram_h, tt_h); | 780 | NV_DEBUG(dev, "ch%d vram=0x%08x tt=0x%08x\n", chan->id, vram_h, tt_h); |
781 | 781 | ||
782 | if (dev_priv->card_type == NV_C0) { | ||
783 | struct nouveau_vm *vm = dev_priv->chan_vm; | ||
784 | struct nouveau_vm_pgd *vpgd; | ||
785 | |||
786 | ret = nouveau_gpuobj_new(dev, NULL, 4096, 0x1000, 0, | ||
787 | &chan->ramin); | ||
788 | if (ret) | ||
789 | return ret; | ||
790 | |||
791 | nouveau_vm_ref(vm, &chan->vm, NULL); | ||
792 | |||
793 | vpgd = list_first_entry(&vm->pgd_list, struct nouveau_vm_pgd, head); | ||
794 | nv_wo32(chan->ramin, 0x0200, lower_32_bits(vpgd->obj->vinst)); | ||
795 | nv_wo32(chan->ramin, 0x0204, upper_32_bits(vpgd->obj->vinst)); | ||
796 | nv_wo32(chan->ramin, 0x0208, 0xffffffff); | ||
797 | nv_wo32(chan->ramin, 0x020c, 0x000000ff); | ||
798 | return 0; | ||
799 | } | ||
800 | |||
782 | /* Allocate a chunk of memory for per-channel object storage */ | 801 | /* Allocate a chunk of memory for per-channel object storage */ |
783 | ret = nouveau_gpuobj_channel_init_pramin(chan); | 802 | ret = nouveau_gpuobj_channel_init_pramin(chan); |
784 | if (ret) { | 803 | if (ret) { |
@@ -786,7 +805,7 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan, | |||
786 | return ret; | 805 | return ret; |
787 | } | 806 | } |
788 | 807 | ||
789 | /* NV50/NVC0 VM | 808 | /* NV50 VM |
790 | * - Allocate per-channel page-directory | 809 | * - Allocate per-channel page-directory |
791 | * - Link with shared channel VM | 810 | * - Link with shared channel VM |
792 | */ | 811 | */ |
@@ -884,9 +903,6 @@ nouveau_gpuobj_channel_takedown(struct nouveau_channel *chan) | |||
884 | 903 | ||
885 | NV_DEBUG(dev, "ch%d\n", chan->id); | 904 | NV_DEBUG(dev, "ch%d\n", chan->id); |
886 | 905 | ||
887 | if (!chan->ramht) | ||
888 | return; | ||
889 | |||
890 | nouveau_ramht_ref(NULL, &chan->ramht, chan); | 906 | nouveau_ramht_ref(NULL, &chan->ramht, chan); |
891 | 907 | ||
892 | nouveau_vm_ref(NULL, &chan->vm, chan->vm_pd); | 908 | nouveau_vm_ref(NULL, &chan->vm, chan->vm_pd); |