mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 23:34:00 -04:00
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>
32 lines
721 B
C
32 lines
721 B
C
/* SPDX-License-Identifier: MIT */
|
|
/* Copyright © 2025 Intel Corporation */
|
|
|
|
#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))
|
|
|
|
bool intel_display_run_as_guest(struct intel_display *display);
|
|
bool intel_display_vtd_active(struct intel_display *display);
|
|
|
|
#endif /* __INTEL_DISPLAY_UTILS__ */
|