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

Commit 7a5c23de authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nvc0/fifo: kick channels off during suspend



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent fe799114
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -240,6 +240,22 @@ nvc0_fifo_load_context(struct nouveau_channel *chan)
int
nvc0_fifo_unload_context(struct drm_device *dev)
{
	struct drm_nouveau_private *dev_priv = dev->dev_private;
	int i;

	for (i = 0; i < 128; i++) {
		if (!(nv_rd32(dev, 0x003004 + (i * 4)) & 1))
			continue;

		nv_mask(dev, 0x003004 + (i * 4), 0x00000001, 0x00000000);
		nv_wr32(dev, 0x002634, i);
		if (!nv_wait(dev, 0x002634, 0xffffffff, i)) {
			NV_INFO(dev, "PFIFO: kick ch %d failed: 0x%08x\n",
				i, nv_rd32(dev, 0x002634));
			return -EBUSY;
		}
	}

	return 0;
}