Skip to contentSkip to conversation

drm/nouveau: idle all channels before suspending

PATCH NAK Maarten Lankhorst 2 participants 3 messages Apr 8, 2013 – Apr 9, 2013 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: idle all channels before suspending

Seems to make suspend slightly more reliable on my system.

---

drivers/gpu/drm/nouveau/nouveau_drm.c +17 -0
index b6bdc9f..5032c31 100644
@@ -464,6 +464,23 @@ nouveau_do_suspend(struct drm_device *dev)
 	NV_INFO(drm, "evicting buffers...\n");
 	ttm_bo_evict_mm(&drm->ttm.bdev, TTM_PL_VRAM);
 
+	list_for_each_entry(cli, &drm->clients, head) {
+		struct nouveau_abi16 *abi16 = cli->abi16;
+		struct nouveau_abi16_chan *chan;
+
+		if (!abi16)
+			continue;
+
+		list_for_each_entry(chan, &abi16->channels, head)
+			nouveau_channel_idle(chan->chan);
+	}
+
+	if (drm->channel)
+		nouveau_channel_idle(drm->channel);
+
+	if (drm->cechan)
+		nouveau_channel_idle(drm->cechan);
+
 	if (drm->fence && nouveau_fence(drm)->suspend) {
 		if (!nouveau_fence(drm)->suspend(drm))
 			return -ENOMEM;

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 2 lines · Maarten Lankhorst

Seems to make suspend slightly more reliable on my system.

NACK.

"Seems to", and "slightly" don't make a very good argument for this.
Likely all you've done is change the timing of certain things happening.

The PFIFO and engine (PGRAPH etc) modules already take care of idling and unloading active channels. If something is broken there, that's where it needs fixing, not this hack that "maybe" "possibly" "slightly" works.

Ben.

Quoted 33 lines

---

drivers/gpu/drm/nouveau/nouveau_drm.c +17 -0
index b6bdc9f..5032c31 100644
@@ -464,6 +464,23 @@ nouveau_do_suspend(struct drm_device *dev)
        NV_INFO(drm, "evicting buffers...\n");
        ttm_bo_evict_mm(&drm->ttm.bdev, TTM_PL_VRAM);
 
+       list_for_each_entry(cli, &drm->clients, head) {
+               struct nouveau_abi16 *abi16 = cli->abi16;
+               struct nouveau_abi16_chan *chan;
+
+               if (!abi16)
+                       continue;
+
+               list_for_each_entry(chan, &abi16->channels, head)
+                       nouveau_channel_idle(chan->chan);
+       }
+
+       if (drm->channel)
+               nouveau_channel_idle(drm->channel);
+
+       if (drm->cechan)
+               nouveau_channel_idle(drm->cechan);
+
        if (drm->fence && nouveau_fence(drm)->suspend) {
                if (!nouveau_fence(drm)->suspend(drm))
                        return -ENOMEM;
Quoted 5 lines

_______________________________________________
dri-devel mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#3 lore raw

Op 09-04-13 01:14, Ben Skeggs schreef:

Quoted 5 lines
Quoted 2 lines · Maarten Lankhorst

Seems to make suspend slightly more reliable on my system.

Quoted 8 lines

NACK.

"Seems to", and "slightly" don't make a very good argument for this.
Likely all you've done is change the timing of certain things happening.

The PFIFO and engine (PGRAPH etc) modules already take care of idling and unloading active channels. If something is broken there, that's where it needs fixing, not this hack that "maybe" "possibly" "slightly" works.

The channel idle was not for PFIFO or PGRAPH, it's for nouveau_fence suspend.
If you want to save the fence seqnos, you have to be sure that all channels are idle first, or move the saving of fence seqnos until after you're done with unloading all the fifo engines.

~Maarten