xref: /linux/drivers/gpu/drm/i915/display/intel_display_utils.h (revision 69050f8d6d075dc01af7a5f2f550a8067510366f)
1 /* SPDX-License-Identifier: MIT */
2 /* Copyright © 2025 Intel Corporation */
3 
4 #ifndef __INTEL_DISPLAY_UTILS__
5 #define __INTEL_DISPLAY_UTILS__
6 
7 #include <linux/bug.h>
8 #include <linux/types.h>
9 
10 struct intel_display;
11 
12 #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
13 			     __stringify(x), (long)(x))
14 
15 #define fetch_and_zero(ptr) ({						\
16 	typeof(*ptr) __T = *(ptr);					\
17 	*(ptr) = (typeof(*ptr))0;					\
18 	__T;								\
19 })
20 
21 #define KHz(x) (1000 * (x))
22 #define MHz(x) KHz(1000 * (x))
23 
24 bool intel_display_run_as_guest(struct intel_display *display);
25 bool intel_display_vtd_active(struct intel_display *display);
26 
27 #endif /* __INTEL_DISPLAY_UTILS__ */
28