Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a92d37e authored by Ben Skeggs's avatar Ben Skeggs
Browse files

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: default avatarBen Skeggs <bskeggs@redhat.com>
parent d6ba6d21
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -733,10 +733,8 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
		for (i = 0; i < req->nr_push; i++) {
		for (i = 0; i < req->nr_push; i++) {
			struct nouveau_bo *nvbo = (void *)(unsigned long)
			struct nouveau_bo *nvbo = (void *)(unsigned long)
				bo[push[i].bo_index].user_priv;
				bo[push[i].bo_index].user_priv;
			struct drm_mm_node *mem = nvbo->bo.mem.mm_node;


			OUT_RING(chan, ((mem->start << PAGE_SHIFT) +
			OUT_RING(chan, (nvbo->bo.offset + push[i].offset) | 2);
					push[i].offset) | 2);
			OUT_RING(chan, 0);
			OUT_RING(chan, 0);
		}
		}
	} else {
	} else {
@@ -749,7 +747,6 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
		for (i = 0; i < req->nr_push; i++) {
		for (i = 0; i < req->nr_push; i++) {
			struct nouveau_bo *nvbo = (void *)(unsigned long)
			struct nouveau_bo *nvbo = (void *)(unsigned long)
				bo[push[i].bo_index].user_priv;
				bo[push[i].bo_index].user_priv;
			struct drm_mm_node *mem = nvbo->bo.mem.mm_node;
			uint32_t cmd;
			uint32_t cmd;


			cmd = chan->pushbuf_base + ((chan->dma.cur + 2) << 2);
			cmd = chan->pushbuf_base + ((chan->dma.cur + 2) << 2);
@@ -771,8 +768,8 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
						push[i].length - 8) / 4, cmd);
						push[i].length - 8) / 4, cmd);
			}
			}


			OUT_RING(chan, ((mem->start << PAGE_SHIFT) +
			OUT_RING(chan, 0x20000000 |
					push[i].offset) | 0x20000000);
				      (nvbo->bo.offset + push[i].offset));
			OUT_RING(chan, 0);
			OUT_RING(chan, 0);
			for (j = 0; j < NOUVEAU_DMA_SKIPS; j++)
			for (j = 0; j < NOUVEAU_DMA_SKIPS; j++)
				OUT_RING(chan, 0);
				OUT_RING(chan, 0);