drm/{i915, xe}/stolen: add device pointer to struct intel_stolen_node

Add backpointers to i915/xe to allow simplifying some interfaces in
follow-up.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/321354d47f9e530159caefef510d5394f4177470.1758732183.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
Jani Nikula 2025-09-24 19:43:37 +03:00
parent f74bab2d90
commit e8848d3d37
2 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,7 @@
#include "intel_pci_config.h"
struct intel_stolen_node {
struct drm_i915_private *i915;
struct drm_mm_node node;
};
@ -1064,12 +1065,15 @@ u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node)
struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm)
{
struct drm_i915_private *i915 = to_i915(drm);
struct intel_stolen_node *node;
node = kzalloc(sizeof(*node), GFP_KERNEL);
if (!node)
return NULL;
node->i915 = i915;
return node;
}

View File

@ -7,6 +7,7 @@
#include "xe_validation.h"
struct intel_stolen_node {
struct xe_device *xe;
struct xe_bo *bo;
};
@ -104,12 +105,15 @@ u64 i915_gem_stolen_node_size(const struct intel_stolen_node *node)
struct intel_stolen_node *i915_gem_stolen_node_alloc(struct drm_device *drm)
{
struct xe_device *xe = to_xe_device(drm);
struct intel_stolen_node *node;
node = kzalloc(sizeof(*node), GFP_KERNEL);
if (!node)
return NULL;
node->xe = xe;
return node;
}