mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 18:21:24 +02:00
drm/i915: Introduce pin_params.needs_cpu_lmem_access
Add a new flag pin_params.neeeds_cpu_lmem_access so that the low level pinning code doesn't need to peek into the display driver's framebuffer structure. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patch.msgid.link/20260416174448.28264-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
861e31fb43
commit
2423bd7e73
|
|
@ -19,6 +19,7 @@ struct intel_fb_pin_params {
|
|||
unsigned int alignment;
|
||||
unsigned int phys_alignment;
|
||||
unsigned int vtd_guard;
|
||||
bool needs_cpu_lmem_access;
|
||||
};
|
||||
|
||||
struct i915_vma *
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ intel_fb_pin_to_dpt(const struct drm_framebuffer *fb,
|
|||
* ensure it is always in the mappable part of lmem, if this is
|
||||
* a small-bar device.
|
||||
*/
|
||||
if (intel_fb_needs_cpu_access(fb))
|
||||
if (pin_params->needs_cpu_lmem_access)
|
||||
flags &= ~I915_BO_ALLOC_GPU_ONLY;
|
||||
ret = __i915_gem_object_migrate(obj, &ww, INTEL_REGION_LMEM_0,
|
||||
flags);
|
||||
|
|
@ -275,6 +275,7 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state,
|
|||
.alignment = intel_plane_fb_min_alignment(plane_state),
|
||||
.phys_alignment = intel_plane_fb_min_phys_alignment(plane_state),
|
||||
.vtd_guard = intel_plane_fb_vtd_guard(plane_state),
|
||||
.needs_cpu_lmem_access = intel_fb_needs_cpu_access(&fb->base),
|
||||
};
|
||||
int fence_id = -1;
|
||||
|
||||
|
|
@ -289,6 +290,7 @@ int intel_plane_pin_fb(struct intel_plane_state *plane_state,
|
|||
struct intel_fb_pin_params pin_params = {
|
||||
.view = &plane_state->view.gtt,
|
||||
.alignment = intel_plane_fb_min_alignment(plane_state),
|
||||
.needs_cpu_lmem_access = intel_fb_needs_cpu_access(&fb->base),
|
||||
};
|
||||
|
||||
vma = i915_dpt_pin_to_ggtt(fb->dpt, pin_params.alignment / 512);
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ static struct i915_vma *__xe_pin_fb_vma(const struct intel_framebuffer *fb,
|
|||
|
||||
refcount_set(&vma->ref, 1);
|
||||
if (IS_DGFX(to_xe_device(bo->ttm.base.dev)) &&
|
||||
intel_fb_needs_cpu_access(&fb->base) &&
|
||||
pin_params->needs_cpu_lmem_access &&
|
||||
!(bo->flags & XE_BO_FLAG_NEEDS_CPU_ACCESS)) {
|
||||
struct xe_vram_region *vram = xe_device_get_root_tile(xe)->mem.vram;
|
||||
|
||||
|
|
@ -474,6 +474,7 @@ int intel_plane_pin_fb(struct intel_plane_state *new_plane_state,
|
|||
struct intel_fb_pin_params pin_params = {
|
||||
.view = &new_plane_state->view.gtt,
|
||||
.alignment = plane->min_alignment(plane, fb, 0),
|
||||
.needs_cpu_lmem_access = intel_fb_needs_cpu_access(fb),
|
||||
};
|
||||
|
||||
if (reuse_vma(new_plane_state, old_plane_state))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user