mirror-linux/include/drm
Thomas Hellström 754c232384 drm/pagemap, drm/xe: Ensure that the devmem allocation is idle before use
In situations where no system memory is migrated to devmem, and in
upcoming patches where another GPU is performing the migration to
the newly allocated devmem buffer, there is nothing to ensure any
ongoing clear to the devmem allocation or async eviction from the
devmem allocation is complete.

Address that by passing a struct dma_fence down to the copy
functions, and ensure it is waited for before migration is marked
complete.

v3:
- New patch.
v4:
- Update the logic used for determining when to wait for the
  pre_migrate_fence.
- Update the logic used for determining when to warn for the
  pre_migrate_fence since the scheduler fences apparently
  can signal out-of-order.
v5:
- Fix a UAF (CI)
- Remove references to source P2P migration (Himal)
- Put the pre_migrate_fence after migration.
v6:
- Pipeline the pre_migrate_fence dependency (Matt Brost)

Fixes: c5b3eb5a90 ("drm/xe: Add GPUSVM device memory copy vfunc functions")
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: <stable@vger.kernel.org> # v6.15+
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> # For merging through drm-xe.
Link: https://patch.msgid.link/20251219113320.183860-4-thomas.hellstrom@linux.intel.com
(cherry picked from commit 16b5ad3195)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
2025-12-23 10:11:59 +01:00
..
amd drm/amd/amdgpu: Add helper functions for isp buffers 2025-07-16 16:17:35 -04:00
bridge drm/bridge: dw-hdmi-qp: Handle platform supported formats and color depth 2025-11-14 23:10:34 +01:00
clients drm/client: Move public client header to clients/ subdirectory 2024-11-15 09:42:13 +01:00
display Merge tag 'drm-intel-next-2025-11-04' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next 2025-11-07 09:47:56 +10:00
intel drm/xe/pf: Export helpers for VFIO 2025-12-01 09:42:37 +01:00
ttm drm/ttm: rework pipelined eviction fence handling 2025-11-26 13:12:23 +01:00
Makefile kbuild: Let kernel-doc.py use PYTHON3 override 2025-11-08 19:42:22 -07:00
amd_asic_type.h
drm_accel.h drm: move drm based debugfs funcs to drm_debugfs.c 2025-07-04 15:58:22 +02:00
drm_atomic.h drm/colorop: define a new macro for_each_new_colorop_in_state 2025-11-26 23:03:34 +01:00
drm_atomic_helper.h drm/atomic-helper: Introduce drm_atomic_helper_reset_crtc() 2025-02-13 16:17:46 +01:00
drm_atomic_state_helper.h
drm_atomic_uapi.h drm/plane: Add COLOR PIPELINE property 2025-11-26 23:03:32 +01:00
drm_audio_component.h
drm_auth.h
drm_blend.h
drm_bridge.h drm/bridge: get the bridge returned by drm_bridge_get_next_bridge() 2025-09-16 15:22:41 +02:00
drm_bridge_connector.h
drm_bridge_helper.h drm/bridge: Add helper to reset bridge pipeline 2025-03-20 14:45:48 +01:00
drm_buddy.h drm/buddy: replace drm_print.h include with a forward declaration 2025-10-31 10:34:55 +02:00
drm_cache.h
drm_client.h drm/client: Pass force parameter to client restore 2025-11-25 08:43:46 +01:00
drm_client_event.h drm/client: Pass force parameter to client restore 2025-11-25 08:43:46 +01:00
drm_color_mgmt.h drm: Add helper to extract lut from struct drm_color_lut32 2025-11-26 23:03:35 +01:00
drm_colorop.h drm/colorop: Add DRM_COLOROP_1D_CURVE_GAMMA22 to 1D Curve 2025-11-26 23:09:44 +01:00
drm_connector.h drm-misc-next for 6.17: 2025-06-27 09:58:05 +10:00
drm_crtc.h Merge tag 'drm-intel-next-2025-11-04' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next 2025-11-07 09:47:56 +10:00
drm_crtc_helper.h
drm_damage_helper.h drm/damage-helper: add const qualifier in drm_atomic_helper_damage_merged() 2025-03-03 14:45:40 +02:00
drm_debugfs.h drm: add debugfs support on per client-id basis 2025-07-04 15:59:06 +02:00
drm_debugfs_crc.h
drm_device.h drm/client: Support emergency restore via sysrq for all clients 2025-11-25 08:43:47 +01:00
drm_drv.h drm: move drm based debugfs funcs to drm_debugfs.c 2025-07-04 15:58:22 +02:00
drm_dumb_buffers.h drm/dumb-buffers: Provide helper to set pitch and size 2025-09-29 13:57:43 +02:00
drm_edid.h drm/edid: add DRM_EDID_IDENT_INIT() to initialize struct drm_edid_ident 2025-11-04 14:49:21 +02:00
drm_eld.h
drm_encoder.h
drm_exec.h
drm_fb_dma_helper.h
drm_fb_helper.h drm/fb-helper: Allocate and release fb_info in single place 2025-11-25 11:02:43 +01:00
drm_fbdev_dma.h drm/fbdev-dma: Remove obsolete setup function 2024-09-26 09:31:27 +02:00
drm_fbdev_shmem.h drm/fbdev-shmem: Remove obsolete setup function 2024-09-26 09:31:28 +02:00
drm_fbdev_ttm.h drm/fbdev-ttm: Remove obsolete setup function 2024-09-26 09:31:29 +02:00
drm_file.h drm/colorop: Introduce DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE 2025-11-26 23:03:32 +01:00
drm_fixed.h drm: Add helper for conversion from signed-magnitude 2025-11-26 22:16:13 +01:00
drm_flip_work.h
drm_format_helper.h drm/format-helper: Remove drm_fb_blit() 2025-09-23 15:06:06 +02:00
drm_fourcc.h drm: Pass pixel_format+modifier directly to drm_get_format_info() 2025-07-16 20:01:13 +03:00
drm_framebuffer.h drm/framebuffer: Acquire internal references on GEM handles 2025-07-09 14:03:28 +02:00
drm_gem.h gpuvm: remove gem.gpuva.lock_dep_map 2025-08-28 12:40:43 +02:00
drm_gem_atomic_helper.h
drm_gem_dma_helper.h fs: move FMODE_UNSIGNED_OFFSET to fop_flags 2024-08-30 08:22:36 +02:00
drm_gem_framebuffer_helper.h drm/gem/afbc: Eliminate redundant drm_get_format_info() 2025-07-16 20:06:22 +03:00
drm_gem_shmem_helper.h drm/gem/shmem: Extract drm_gem_shmem_release() from drm_gem_shmem_free() 2025-09-12 19:04:37 -04:00
drm_gem_ttm_helper.h
drm_gem_vram_helper.h drm/gem-vram: Un-export pin helpers 2025-05-30 09:47:28 +02:00
drm_gpusvm.h drm/gpusvm, drm/xe: Allow mixed mappings for userptr 2025-10-17 10:25:27 +02:00
drm_gpuvm.h Linux 6.18-rc2 2025-10-20 11:49:19 +00:00
drm_ioctl.h
drm_kunit_helpers.h Merge tag 'drm-misc-next-2025-04-09' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next 2025-04-14 15:29:49 +10:00
drm_lease.h
drm_managed.h drm: Simplify drmm_alloc_ordered_workqueue return 2025-07-03 10:14:56 -07:00
drm_mipi_dbi.h
drm_mipi_dsi.h drm: Add MIPI read_multi func and two write macros 2025-08-14 15:42:26 -07:00
drm_mm.h drm/mm: replace drm_print.h include with a forward declaration 2025-10-31 10:34:56 +02:00
drm_mode_config.h drm/colorop: Introduce new drm_colorop mode object 2025-11-26 23:03:30 +01:00
drm_mode_object.h drm/drm_mode_object: fix typo in kerneldoc 2025-02-04 14:11:14 +01:00
drm_modes.h
drm_modeset_helper.h drm: Allow the caller to pass in the format info to drm_helper_mode_fill_fb_struct() 2025-07-16 20:04:45 +03:00
drm_modeset_helper_vtables.h drm/vblank: Add vblank timer 2025-10-01 08:31:59 +02:00
drm_modeset_lock.h
drm_module.h
drm_of.h drm: of: Add drm_of_lvds_get_dual_link_pixel_order_sink() 2024-11-05 13:26:42 +02:00
drm_pagemap.h drm/pagemap, drm/xe: Ensure that the devmem allocation is idle before use 2025-12-23 10:11:59 +01:00
drm_panel.h drm/panel: Allow powering on panel follower after panel is enabled 2025-08-25 09:17:49 -07:00
drm_panic.h drm/panic: Add a private field to struct drm_scanout_buffer 2025-06-27 11:48:22 +02:00
drm_pciids.h
drm_plane.h drm/plane: Add COLOR PIPELINE property 2025-11-26 23:03:32 +01:00
drm_plane_helper.h
drm_prime.h drm/shmem-helper: Import dmabuf without mapping its sg_table 2025-06-03 09:21:01 +02:00
drm_print.h drm/print: Add drm_coredump_printer_is_full 2025-04-24 15:51:41 -07:00
drm_privacy_screen_consumer.h
drm_privacy_screen_driver.h
drm_privacy_screen_machine.h
drm_probe_helper.h drm/probe-helper: Do not fail from drmm_kms_helper_poll_init() 2025-03-24 09:31:03 +01:00
drm_property.h
drm_rect.h
drm_self_refresh_helper.h
drm_simple_kms_helper.h
drm_suballoc.h
drm_syncobj.h
drm_sysfs.h
drm_util.h drm: Move for_each_if() to util_macros.h for wider use 2025-02-17 14:27:35 +01:00
drm_utils.h drm: panel-backlight-quirks: Add brightness mask quirk 2025-09-03 10:23:01 -05:00
drm_vblank.h drm/vblank: Add vblank timer 2025-10-01 08:31:59 +02:00
drm_vblank_helper.h drm/vblank: Add CRTC helpers for simple use cases 2025-10-01 08:32:00 +02:00
drm_vblank_work.h
drm_vma_manager.h
drm_writeback.h drm: writeback: Create drmm variants for drm_writeback_connector initialization 2025-01-21 10:32:33 +01:00
gpu_scheduler.h drm/sched: backend_ops doc fix 2025-09-17 14:58:33 +02:00
gud.h
spsc_queue.h drm/sched: Increment job count before swapping tail spsc queue 2025-07-01 16:14:47 -07:00
task_barrier.h