diff options
| author | Jani Nikula <jani.nikula@intel.com> | 2025-10-22 18:17:13 +0300 |
|---|---|---|
| committer | Jani Nikula <jani.nikula@intel.com> | 2025-10-31 13:22:52 +0200 |
| commit | b062cf5456bfdf8976ac279953af29456cac13e5 (patch) | |
| tree | 82cac5aa984ecd55cdc0060222cffb8a52b301af /drivers/gpu/drm/i915/display/intel_display_utils.h | |
| parent | aaccf0ba7ebad8b140463a213878447a047ea08c (diff) | |
drm/i915/display: switch to intel_display_utils.h
The remaining utils display needs from i915_utils.h are primarily
MISSING_CASE() and fetch_and_zero(), with a couple of
i915_inject_probe_failure() uses.
To avoid excessive churn, add duplicates of MISSING_CASE() and
fetch_and_zero() to intel_display_utils.h, and switch display to use the
display utils.
As long as there are display files that include i915_drv.h, which
includes i915_utils.h, we'll need #ifndef guards for MISSING_CASE() and
fetch_and_zero() in both utils headers. We can remove them once display
no longer depends on i915_drv.h.
A couple of files in display still need i915_utils.h for
i915_inject_probe_failure(). Annotate this. They will be handled
separately.
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://patch.msgid.link/79f9e31ca64c8c045834d48e20ceb0c515d1e9e1.1761146196.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_display_utils.h')
| -rw-r--r-- | drivers/gpu/drm/i915/display/intel_display_utils.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_display_utils.h b/drivers/gpu/drm/i915/display/intel_display_utils.h index af1e34bac720..2a18f160320c 100644 --- a/drivers/gpu/drm/i915/display/intel_display_utils.h +++ b/drivers/gpu/drm/i915/display/intel_display_utils.h @@ -4,10 +4,24 @@ #ifndef __INTEL_DISPLAY_UTILS__ #define __INTEL_DISPLAY_UTILS__ +#include <linux/bug.h> #include <linux/types.h> struct intel_display; +#ifndef MISSING_CASE +#define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \ + __stringify(x), (long)(x)) +#endif + +#ifndef fetch_and_zero +#define fetch_and_zero(ptr) ({ \ + typeof(*ptr) __T = *(ptr); \ + *(ptr) = (typeof(*ptr))0; \ + __T; \ +}) +#endif + #define KHz(x) (1000 * (x)) #define MHz(x) KHz(1000 * (x)) |
