aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_object.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-02-06 22:29:23 -0500
committerBen Skeggs <bskeggs@redhat.com>2011-02-24 15:45:11 -0500
commitcdccc70eff1eaf3627a716374f9ebc115fc4621c (patch)
tree744a5a9e35c5749326d3bfb85336afceb24c2b4d /drivers/gpu/drm/nouveau/nouveau_object.c
parent45c4e0aae96c6354bf5131a282a74fe38d032de3 (diff)
drm/nv50-nvc0: initialise display sync channels
Also imports a couple of helper functions that'll be used to implement page flipping in the following commits.. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_object.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_object.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_object.c b/drivers/gpu/drm/nouveau/nouveau_object.c
index 710a7053dc99..4f00c87ed86e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_object.c
+++ b/drivers/gpu/drm/nouveau/nouveau_object.c
@@ -36,6 +36,7 @@
36#include "nouveau_drm.h" 36#include "nouveau_drm.h"
37#include "nouveau_ramht.h" 37#include "nouveau_ramht.h"
38#include "nouveau_vm.h" 38#include "nouveau_vm.h"
39#include "nv50_display.h"
39 40
40struct nouveau_gpuobj_method { 41struct nouveau_gpuobj_method {
41 struct list_head head; 42 struct list_head head;
@@ -782,7 +783,7 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan,
782 struct drm_device *dev = chan->dev; 783 struct drm_device *dev = chan->dev;
783 struct drm_nouveau_private *dev_priv = dev->dev_private; 784 struct drm_nouveau_private *dev_priv = dev->dev_private;
784 struct nouveau_gpuobj *vram = NULL, *tt = NULL; 785 struct nouveau_gpuobj *vram = NULL, *tt = NULL;
785 int ret; 786 int ret, i;
786 787
787 NV_DEBUG(dev, "ch%d vram=0x%08x tt=0x%08x\n", chan->id, vram_h, tt_h); 788 NV_DEBUG(dev, "ch%d vram=0x%08x tt=0x%08x\n", chan->id, vram_h, tt_h);
788 789
@@ -847,6 +848,25 @@ nouveau_gpuobj_channel_init(struct nouveau_channel *chan,
847 nouveau_gpuobj_ref(NULL, &ramht); 848 nouveau_gpuobj_ref(NULL, &ramht);
848 if (ret) 849 if (ret)
849 return ret; 850 return ret;
851
852 /* dma objects for display sync channel semaphore blocks */
853 for (i = 0; i < 2; i++) {
854 struct nouveau_gpuobj *sem = NULL;
855 struct nv50_display_crtc *dispc =
856 &nv50_display(dev)->crtc[i];
857 u64 offset = dispc->sem.bo->bo.mem.start << PAGE_SHIFT;
858
859 ret = nouveau_gpuobj_dma_new(chan, 0x3d, offset, 0xfff,
860 NV_MEM_ACCESS_RW,
861 NV_MEM_TARGET_VRAM, &sem);
862 if (ret)
863 return ret;
864
865 ret = nouveau_ramht_insert(chan, NvEvoSema0 + i, sem);
866 nouveau_gpuobj_ref(NULL, &sem);
867 if (ret)
868 return ret;
869 }
850 } 870 }
851 871
852 /* VRAM ctxdma */ 872 /* VRAM ctxdma */