Commit 3543e84e authored by Ben Skeggs's avatar Ben Skeggs Committed by Danilo Krummrich
Browse files

drm/nouveau: remove chan->drm



The nouveau_cli that owns the channel is now stored in nouveau_chan, and
it has a pointer to the drm device already.

Signed-off-by: default avatarBen Skeggs <bskeggs@nvidia.com>
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240726043828.58966-34-bskeggs@nvidia.com
parent 2eb58f22
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1057,7 +1057,7 @@ nv04_finish_page_flip(struct nouveau_channel *chan,
		      struct nv04_page_flip_state *ps)
{
	struct nouveau_fence_chan *fctx = chan->fence;
	struct nouveau_drm *drm = chan->drm;
	struct nouveau_drm *drm = chan->cli->drm;
	struct drm_device *dev = drm->dev;
	struct nv04_page_flip_state *s;
	unsigned long flags;
@@ -1113,7 +1113,7 @@ nv04_page_flip_emit(struct nouveau_channel *chan,
		    struct nouveau_fence **pfence)
{
	struct nouveau_fence_chan *fctx = chan->fence;
	struct nouveau_drm *drm = chan->drm;
	struct nouveau_drm *drm = chan->cli->drm;
	struct drm_device *dev = drm->dev;
	struct nvif_push *push = chan->chan.push;
	unsigned long flags;
+1 −1
Original line number Diff line number Diff line
@@ -104,6 +104,6 @@ nv04_bo_move_init(struct nouveau_channel *chan, u32 handle)
		return ret;

	PUSH_MTHD(push, NV039, SET_OBJECT, handle);
	PUSH_MTHD(push, NV039, SET_CONTEXT_DMA_NOTIFIES, chan->drm->ntfy.handle);
	PUSH_MTHD(push, NV039, SET_CONTEXT_DMA_NOTIFIES, chan->cli->drm->ntfy.handle);
	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ nv50_bo_move_init(struct nouveau_channel *chan, u32 handle)
		return ret;

	PUSH_MTHD(push, NV5039, SET_OBJECT, handle);
	PUSH_MTHD(push, NV5039, SET_CONTEXT_DMA_NOTIFY, chan->drm->ntfy.handle,
	PUSH_MTHD(push, NV5039, SET_CONTEXT_DMA_NOTIFY, chan->cli->drm->ntfy.handle,
				SET_CONTEXT_DMA_BUFFER_IN, chan->vram.handle,
				SET_CONTEXT_DMA_BUFFER_OUT, chan->vram.handle);
	return 0;
+9 −14
Original line number Diff line number Diff line
@@ -90,12 +90,10 @@ nouveau_channel_del(struct nouveau_channel **pchan)
{
	struct nouveau_channel *chan = *pchan;
	if (chan) {
		struct nouveau_cli *cli = (void *)chan->user.client;

		if (chan->fence)
			nouveau_fence(chan->drm)->context_del(chan);
			nouveau_fence(chan->cli->drm)->context_del(chan);

		if (cli)
		if (nvif_object_constructed(&chan->user))
			nouveau_svmm_part(chan->vmm->svmm, chan->inst);

		nvif_object_dtor(&chan->blit);
@@ -157,7 +155,6 @@ nouveau_channel_prep(struct nouveau_cli *cli,
		return -ENOMEM;

	chan->cli = cli;
	chan->drm = drm;
	chan->vmm = nouveau_cli_vmm(cli);
	atomic_set(&chan->killed, 0);

@@ -228,12 +225,11 @@ nouveau_channel_prep(struct nouveau_cli *cli,
			args.limit = device->info.ram_user - 1;
		}
	} else {
		if (chan->drm->agp.bridge) {
		if (drm->agp.bridge) {
			args.target = NV_DMA_V0_TARGET_AGP;
			args.access = NV_DMA_V0_ACCESS_RDWR;
			args.start = chan->drm->agp.base;
			args.limit = chan->drm->agp.base +
				     chan->drm->agp.size - 1;
			args.start = drm->agp.base;
			args.limit = drm->agp.base + drm->agp.size - 1;
		} else {
			args.target = NV_DMA_V0_TARGET_VM;
			args.access = NV_DMA_V0_ACCESS_RDWR;
@@ -420,12 +416,11 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
			args.start = 0;
			args.limit = chan->vmm->vmm.limit - 1;
		} else
		if (chan->drm->agp.bridge) {
		if (drm->agp.bridge) {
			args.target = NV_DMA_V0_TARGET_AGP;
			args.access = NV_DMA_V0_ACCESS_RDWR;
			args.start = chan->drm->agp.base;
			args.limit = chan->drm->agp.base +
				     chan->drm->agp.size - 1;
			args.start = drm->agp.base;
			args.limit = drm->agp.base + drm->agp.size - 1;
		} else {
			args.target = NV_DMA_V0_TARGET_VM;
			args.access = NV_DMA_V0_ACCESS_RDWR;
@@ -490,7 +485,7 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
	}

	/* initialise synchronisation */
	return nouveau_fence(chan->drm)->context_new(chan);
	return nouveau_fence(drm)->context_new(chan);
}

int
+0 −1
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ struct nouveau_channel {
	} chan;

	struct nouveau_cli *cli;
	struct nouveau_drm *drm;
	struct nouveau_vmm *vmm;

	struct nvif_mem mem_userd;
Loading