mirror of
https://github.com/torvalds/linux.git
synced 2026-04-23 09:05:50 -04:00
In some rare cases, the drm_mm node cannot be removed synchronously
due to runtime PM conditions. In this situation, the node removal will
be delegated to a workqueue that will be able to wake up the device
before removing the node.
However, in this situation, the lifetime of the xe_ggtt_node cannot
be restricted to the lifetime of the parent object. So, this patch
introduces the infrastructure so the xe_ggtt_node struct can be
allocated in advance and freed when needed.
By having the ggtt backpointer, it also ensure that the init function
is always called before any attempt to insert or reserve the node
in the GGTT.
v2: s/xe_ggtt_node_force_fini/xe_ggtt_node_fini and use it
internaly (Brost)
v3: - Use GF_NOFS for node allocation (CI)
- Avoid ggtt argument, now that we have it inside the node (Lucas)
- Fix some missed fini cases (CI)
v4: - Fix SRIOV critical case where config->ggtt_region was
lost (Michal)
- Avoid ggtt argument also on removal (missed case on v3) (Michal)
- Remove useless checks (Michal)
- Return 0 instead of negative errno on a u32 addr. (Michal)
- s/xe_ggtt_assign/xe_ggtt_node_assign for coherence, while we
are touching it (Michal)
v5: - Fix VFs' ggtt_balloon
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240821193842.352557-11-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
36 lines
613 B
C
36 lines
613 B
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2023 Intel Corporation
|
|
*/
|
|
|
|
#ifndef I915_VMA_H
|
|
#define I915_VMA_H
|
|
|
|
#include <uapi/drm/i915_drm.h>
|
|
|
|
#include "xe_ggtt_types.h"
|
|
|
|
/* We don't want these from i915_drm.h in case of Xe */
|
|
#undef I915_TILING_X
|
|
#undef I915_TILING_Y
|
|
#define I915_TILING_X 0
|
|
#define I915_TILING_Y 0
|
|
|
|
struct xe_bo;
|
|
|
|
struct i915_vma {
|
|
struct xe_bo *bo, *dpt;
|
|
struct xe_ggtt_node *node;
|
|
};
|
|
|
|
#define i915_ggtt_clear_scanout(bo) do { } while (0)
|
|
|
|
#define i915_vma_fence_id(vma) -1
|
|
|
|
static inline u32 i915_ggtt_offset(const struct i915_vma *vma)
|
|
{
|
|
return vma->node->base.start;
|
|
}
|
|
|
|
#endif
|