Skip to contentSkip to conversation

drm/nouveau: use tile_mode and pte_kind for VM_BIND bo allocations

RFC PATCH Superseded Mohamed Ahmed 1 participant 1 message Apr 30, 2024

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH v2 1/1 drm/nouveau: use tile_mode and pte_kind for VM_BIND bo allocations

Allows PTE kind and tile mode on BO create with VM_BIND, as well as adds a GETPARAM to indicate this change. This is needed to support modifiers in NVK and ensure correctness when dealing with the nouveau GL driver.
---

v2 of the VMA PTE kind and tile mode patch. This one adds the kind and tile mode handling code in the common path and also adds a GETPARAM to indicate the change. The userspace implementation is still a WIP but should be ready within the next week.

Thanks in advance,
Mohamed

 drivers/gpu/drm/nouveau/nouveau_abi16.c |  3 ++
 drivers/gpu/drm/nouveau/nouveau_bo.c    | 45 +++++++++++--------------
 include/uapi/drm/nouveau_drm.h          |  7 ++++
 3 files changed, 30 insertions(+), 25 deletions(-)
drivers/gpu/drm/nouveau/nouveau_abi16.c +3 -0
index 80f74ee0f..47e53e17b 100644
@@ -272,6 +272,9 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
 		getparam->value = (u64)ttm_resource_manager_usage(vram_mgr);
 		break;
 	}
+	case NOUVEAU_GETPARAM_HAS_VMA_TILEMODE:
+		getparam->value = 1;
+		break;
 	default:
 		NV_PRINTK(dbg, cli, "unknown parameter %lld\n", getparam->param);
 		return -EINVAL;
drivers/gpu/drm/nouveau/nouveau_bo.c +20 -25

60 lines not on this page · raw message

include/uapi/drm/nouveau_drm.h +7 -0
index cd84227f1..5402f77ee 100644
@@ -68,6 +68,13 @@ extern "C" {
  */
 #define NOUVEAU_GETPARAM_VRAM_USED 19
 
+/*
+ * NOUVEAU_GETPARAM_HAS_VMA_TILEMODE
+ *
+ * Query whether tile mode and PTE kind are accepted with VM allocs or not.
+ */
+#define NOUVEAU_GETPARAM_HAS_VMA_TILEMODE 20
+
 struct drm_nouveau_getparam {
 	__u64 param;
 	__u64 value;
Signature · 1 line
2.44.0