Skip to contentSkip to conversation

drm/nouveau: Fix CE channel creation on pre-Kepler GPUs

PATCH New Munique Feitoza 1 participant 1 message Oct 30

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

PATCH 1/1 drm/nouveau: Fix CE channel creation on pre-Kepler GPUs

Commit 04e0481526e3 ("nouveau/dmem: Fix privileged error in copy engine channel") changed nouveau_accel_ce_init() to unconditionally request a privileged channel (priv = true) when calling nouveau_channel_new().

However, privileged channels (func->ramfc->priv) are only supported on Kepler (gk104_chan_ramfc) and newer FIFO implementations. On pre-Kepler GPUs that expose a Copy Engine runlist, func->ramfc->priv is false, which causes nvkm_chan_new_() to reject the channel creation with -EINVAL:

nouveau 0000:01:00.0: DRM: failed to create ce channel, -22

Specifically, this affects:
- Tesla GT215 (NVA3), GT216 (NVA5), GT218 (NVA8), and MCP89 (NVAF) using g84_chan_ramfc (GeForce GT 210/220/240, 310/320M/330M, etc.).
- Fermi GF100 (NVC0), GF108 (NVC1), GF106 (NVC3), GF104 (NVC4), GF110 (NVC8), GF114 (NVCE), GF116 (NVCF), GF117 (NVD7), and GF119 (NVD9) using gf100_chan_ramfc (GeForce GTX 400/500 series and Fermi-based GeForce GT 600/700 series such as the GT 730).

As a result, drm->cechan remains NULL on Fermi GPUs and TTM buffer moves in nouveau_bo_move_init() cannot use the dedicated hardware Copy Engines (COPY0/COPY1), falling back to M2MF on the main graphics channel.

Only request a privileged CE channel when device->info.family >= NV_DEVICE_INFO_V0_KEPLER.

Fixes 04e0481526e3 ("nouveau/dmem: Fix privileged error in copy engine channel")
---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_drm.c +8 -1
index 5e1336615..0a15f1281 100644
@@ -337,6 +337,7 @@ static void
 nouveau_accel_ce_init(struct nouveau_drm *drm)
 {
 	struct nvif_device *device = &drm->client.device;
+	bool priv;
 	u64 runm;
 	int ret = 0;
 
@@ -349,7 +350,13 @@ nouveau_accel_ce_init(struct nouveau_drm *drm)
 		return;
 	}
 
-	ret = nouveau_channel_new(&drm->client, true, runm, NvDmaFB, NvDmaTT, &drm->cechan);
+	/* nouveau_dmem copies require a privileged channel, which is only
+	 * supported by Kepler and newer FIFO implementations.
+	 */
+	priv = device->info.family >= NV_DEVICE_INFO_V0_KEPLER;
+
+	ret = nouveau_channel_new(&drm->client, priv, runm, NvDmaFB, NvDmaTT,
+				  &drm->cechan);
 	if (ret)
 		NV_ERROR(drm, "failed to create ce channel, %d\n", ret);
 }
Signature · 1 line
2.56.0