[PATCH v2] drm/ttm: add generic drvparam[] alias for ttm_place::fpfn/lpfn
From: Arunpravin Paneer Selvam
Date: Fri Jun 26 2026 - 02:42:57 EST
The fpfn/lpfn fields in struct ttm_place are named after page frame
numbers, but they are really just placement parameters interpreted by
the backend resource manager. Wrap them in a union with a generic
drvparam[2] array so backends can access the same storage without the
PFN-specific naming.
drvparam[0]/drvparam[1] alias fpfn/lpfn, so existing users and the
VRAM range manager are unchanged. This decouples the API from
PFN/range-specific semantics so that these fields can be used more
flexibly in the future (e.g. mask-based or segment-aware placement
constraints). No functional change.
v2: Use a union exposing a generic drvparam[2] array instead of
renaming fpfn/lpfn to param1/param2, keeping existing users
unchanged (Tvrtko Ursulin)
Suggested-by: Christian König <christian.koenig@xxxxxxx>
Assisted-by: Claude:claude-opus-4-8
Cc: Christian König <christian.koenig@xxxxxxx>
Cc: Thomas Hellström <thomas.hellstrom@xxxxxxxxxxxxxxx>
Cc: Matthew Auld <matthew.auld@xxxxxxxxx>
Cc: Matthew Brost <matthew.brost@xxxxxxxxx>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@xxxxxxx>
---
include/drm/ttm/ttm_placement.h | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
index ab2639e42c54..7db2073f3236 100644
--- a/include/drm/ttm/ttm_placement.h
+++ b/include/drm/ttm/ttm_placement.h
@@ -75,14 +75,22 @@
*
* @fpfn: first valid page frame number to put the object
* @lpfn: last valid page frame number to put the object
+ * @drvparam: generic driver/backend placement parameters; the
+ * interpretation is defined by the backend resource manager.
+ * drvparam[0] and drvparam[1] alias @fpfn and @lpfn.
* @mem_type: One of TTM_PL_* where the resource should be allocated from.
* @flags: memory domain and caching flags for the object
*
* Structure indicating a possible place to put an object.
*/
struct ttm_place {
- uint64_t fpfn;
- uint64_t lpfn;
+ union {
+ struct {
+ uint64_t fpfn;
+ uint64_t lpfn;
+ };
+ uint64_t drvparam[2];
+ };
uint32_t mem_type;
uint32_t flags;
};
base-commit: cdeb2ccd993ed8647adbbda2c3b103aa717fd6f7
--
2.34.1