diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-08-03 15:46:01 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-10-02 23:12:42 -0400 |
commit | 3a92d37e4099054fe187b485a9d27c439c10eca7 (patch) | |
tree | 11ea651bf310f568fc1a135d831eabf2f31d530e /drivers/gpu/drm/nouveau | |
parent | d6ba6d215a538a58f0f0026f0961b0b9125e8042 (diff) |
drm/nouveau/gem: use bo.offset rather than mm_node.start
Won't necessarily be a drm_mm_node in the future, and I can't think of any
good reason to not use the offset from the bo struct. There may have been
some reason once apon a time, but, separate commit just in case.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_gem.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index af7cfb825716..0c9399bb9bf6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c | |||
@@ -733,10 +733,8 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, | |||
733 | for (i = 0; i < req->nr_push; i++) { | 733 | for (i = 0; i < req->nr_push; i++) { |
734 | struct nouveau_bo *nvbo = (void *)(unsigned long) | 734 | struct nouveau_bo *nvbo = (void *)(unsigned long) |
735 | bo[push[i].bo_index].user_priv; | 735 | bo[push[i].bo_index].user_priv; |
736 | struct drm_mm_node *mem = nvbo->bo.mem.mm_node; | ||
737 | 736 | ||
738 | OUT_RING(chan, ((mem->start << PAGE_SHIFT) + | 737 | OUT_RING(chan, (nvbo->bo.offset + push[i].offset) | 2); |
739 | push[i].offset) | 2); | ||
740 | OUT_RING(chan, 0); | 738 | OUT_RING(chan, 0); |
741 | } | 739 | } |
742 | } else { | 740 | } else { |
@@ -749,7 +747,6 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, | |||
749 | for (i = 0; i < req->nr_push; i++) { | 747 | for (i = 0; i < req->nr_push; i++) { |
750 | struct nouveau_bo *nvbo = (void *)(unsigned long) | 748 | struct nouveau_bo *nvbo = (void *)(unsigned long) |
751 | bo[push[i].bo_index].user_priv; | 749 | bo[push[i].bo_index].user_priv; |
752 | struct drm_mm_node *mem = nvbo->bo.mem.mm_node; | ||
753 | uint32_t cmd; | 750 | uint32_t cmd; |
754 | 751 | ||
755 | cmd = chan->pushbuf_base + ((chan->dma.cur + 2) << 2); | 752 | cmd = chan->pushbuf_base + ((chan->dma.cur + 2) << 2); |
@@ -771,8 +768,8 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, | |||
771 | push[i].length - 8) / 4, cmd); | 768 | push[i].length - 8) / 4, cmd); |
772 | } | 769 | } |
773 | 770 | ||
774 | OUT_RING(chan, ((mem->start << PAGE_SHIFT) + | 771 | OUT_RING(chan, 0x20000000 | |
775 | push[i].offset) | 0x20000000); | 772 | (nvbo->bo.offset + push[i].offset)); |
776 | OUT_RING(chan, 0); | 773 | OUT_RING(chan, 0); |
777 | for (j = 0; j < NOUVEAU_DMA_SKIPS; j++) | 774 | for (j = 0; j < NOUVEAU_DMA_SKIPS; j++) |
778 | OUT_RING(chan, 0); | 775 | OUT_RING(chan, 0); |