Skip to contentSkip to conversation

gpu: nova-core: add SizeConstants trait for SZ_* constants

PATCH In review John Hubbard 1 participant 3 messages Jun 4 – Jun 24

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

cover gpu: nova-core: add SizeConstants trait for SZ_* constants

v6 is here:

    https://lore.kernel.org/all/[email protected]/

Changes in v7:

* v6 patch 1/2 was already applied as commit 98e508e5b016 ("gpu:
nova-core: use SizeConstants trait for u64 size constants") on drm-rust-next, so this series is now a single standalone patch.

* Moved the todo entry to Documentation/gpu/todo.rst per Danilo's suggestion.

John Hubbard (1):
gpu: add todo entry for device address type wrappers

 Documentation/gpu/todo.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

base-commit: 99676aed1fec109d62822e21a06760eb098dc5f4

Signature · 1 line
2.54.0
#1 lore raw

PATCH 1/1 gpu: add todo entry for device address type wrappers

The SizeConstants trait provides SZ_* size constants for 32-bit, 64-bit, and pointer-sized integers. Device-centric DRM APIs such as GPU VM management and buddy allocators could benefit from newtype wrappers around those integer types for device addresses and sizes. Add a todo entry to track designing those wrappers and a marker trait for use as a generic bound.

---
 Documentation/gpu/todo.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Documentation/gpu/todo.rst +14 -0
index cdddf8db35f5..d7dbe8b298ce 100644
@@ -686,6 +686,20 @@ Contact: Thomas Zimmermann <[email protected]>
 
 Level: Advanced
 
+Device address type wrappers
+-----------------------------
+
+The ``SizeConstants`` trait provides ``SZ_*`` constants as associated constants
+on ``u32``, ``u64``, and ``usize``. Device-centric APIs such as GPU VM
+management and buddy allocators could benefit from newtype wrappers around these
+integer types to represent device addresses and sizes. A separate marker trait
+could then serve as a generic bound for those wrappers. See the `original
+discussion <https://lore.kernel.org/all/[email protected]/>`_.
+
+Contact: Danilo Krummrich <[email protected]>
+
+Level: Intermediate
+
 Better Testing
 ==============
 
Signature · 1 line
2.54.0
#2 lore raw
In reply to John Hubbard
Quoted 4 lines · John Hubbard

v6 is here:

    https://lore.kernel.org/all/[email protected]/

Changes in v7:

And actually, the subject line should have said [PATCH v7..., but I somehow omitted that by accident here.

thanks,

Signature · 1 line
John Hubbard
Quoted 16 lines

* v6 patch 1/2 was already applied as commit 98e508e5b016 ("gpu:
nova-core: use SizeConstants trait for u64 size constants") on drm-rust-next, so this series is now a single standalone patch.

* Moved the todo entry to Documentation/gpu/todo.rst per Danilo's suggestion.

John Hubbard (1):
gpu: add todo entry for device address type wrappers

 Documentation/gpu/todo.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

base-commit: 99676aed1fec109d62822e21a06760eb098dc5f4