Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/display: perform transient flush

Perform manual transient cache flush prior to flip and at the end of
frontbuffer_flush. This is needed to ensure display engine doesn't see
garbage if the surface is L3:XD dirty.

Testcase: igt@xe-pat@display-vs-wb-transient
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Acked-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240430172850.1881525-19-radhakrishna.sripada@intel.com

authored by

Matthew Auld and committed by
Radhakrishna Sripada
4071ada7 c01c6066

+45 -1
+3
drivers/gpu/drm/i915/display/intel_display.c
··· 109 109 #include "intel_sdvo.h" 110 110 #include "intel_snps_phy.h" 111 111 #include "intel_tc.h" 112 + #include "intel_tdf.h" 112 113 #include "intel_tv.h" 113 114 #include "intel_vblank.h" 114 115 #include "intel_vdsc.h" ··· 7233 7232 int i; 7234 7233 7235 7234 intel_atomic_commit_fence_wait(state); 7235 + 7236 + intel_td_flush(dev_priv); 7236 7237 7237 7238 drm_atomic_helper_wait_for_dependencies(&state->base); 7238 7239 drm_dp_mst_atomic_wait_for_dependencies(&state->base);
+2
drivers/gpu/drm/i915/display/intel_frontbuffer.c
··· 65 65 #include "intel_fbc.h" 66 66 #include "intel_frontbuffer.h" 67 67 #include "intel_psr.h" 68 + #include "intel_tdf.h" 68 69 69 70 /** 70 71 * frontbuffer_flush - flush frontbuffer ··· 94 93 trace_intel_frontbuffer_flush(i915, frontbuffer_bits, origin); 95 94 96 95 might_sleep(); 96 + intel_td_flush(i915); 97 97 intel_drrs_flush(i915, frontbuffer_bits); 98 98 intel_psr_flush(i915, frontbuffer_bits, origin); 99 99 intel_fbc_flush(i915, frontbuffer_bits, origin);
+25
drivers/gpu/drm/i915/display/intel_tdf.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright © 2024 Intel Corporation 4 + */ 5 + 6 + #ifndef __INTEL_TDF_H__ 7 + #define __INTEL_TDF_H__ 8 + 9 + /* 10 + * TDF (Transient-Data-Flush) is needed for Xe2+ where special L3:XD caching can 11 + * be enabled through various PAT index modes. Idea is to use this caching mode 12 + * when for example rendering onto the display surface, with the promise that 13 + * KMD will ensure transient cache entries are always flushed by the time we do 14 + * the display flip, since display engine is never coherent with CPU/GPU caches. 15 + */ 16 + 17 + struct drm_i915_private; 18 + 19 + #ifdef I915 20 + static inline void intel_td_flush(struct drm_i915_private *i915) {} 21 + #else 22 + void intel_td_flush(struct drm_i915_private *i915); 23 + #endif 24 + 25 + #endif
+2 -1
drivers/gpu/drm/xe/Makefile
··· 204 204 display/xe_dsb_buffer.o \ 205 205 display/xe_fb_pin.o \ 206 206 display/xe_hdcp_gsc.o \ 207 - display/xe_plane_initial.o 207 + display/xe_plane_initial.o \ 208 + display/xe_tdf.o 208 209 209 210 # SOC code shared with i915 210 211 xe-$(CONFIG_DRM_XE_DISPLAY) += \
+13
drivers/gpu/drm/xe/display/xe_tdf.c
··· 1 + // SPDX-License-Identifier: MIT 2 + /* 3 + * Copyright © 2024 Intel Corporation 4 + */ 5 + 6 + #include "xe_device.h" 7 + #include "intel_display_types.h" 8 + #include "intel_tdf.h" 9 + 10 + void intel_td_flush(struct drm_i915_private *i915) 11 + { 12 + xe_device_td_flush(i915); 13 + }