mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
drm/i915/display: add intel_display_run_as_guest()
Add intel_display_utils.c for display utilities that need more than a header. Start off with intel_display_run_as_guest(). The implementation is intentional duplication of the i915_utils.h i915_run_as_guest(), with the idea that it's small enough to not matter. Reviewed-by: Luca Coelho <luciano.coelho@intel.com> Link: https://patch.msgid.link/469f9c41e0c3e3099314a3cf1a7671bf36ec8ffd.1761146196.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
7c15791d19
commit
cd81a70d76
|
|
@ -256,6 +256,7 @@ i915-y += \
|
|||
display/intel_display_rpm.o \
|
||||
display/intel_display_rps.o \
|
||||
display/intel_display_snapshot.o \
|
||||
display/intel_display_utils.o \
|
||||
display/intel_display_wa.o \
|
||||
display/intel_dmc.o \
|
||||
display/intel_dmc_wl.o \
|
||||
|
|
|
|||
18
drivers/gpu/drm/i915/display/intel_display_utils.c
Normal file
18
drivers/gpu/drm/i915/display/intel_display_utils.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
/* Copyright © 2025 Intel Corporation */
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
#include <asm/hypervisor.h>
|
||||
#endif
|
||||
|
||||
#include "intel_display_utils.h"
|
||||
|
||||
bool intel_display_run_as_guest(struct intel_display *display)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_X86)
|
||||
return !hypervisor_is_type(X86_HYPER_NATIVE);
|
||||
#else
|
||||
/* Not supported yet */
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -4,7 +4,13 @@
|
|||
#ifndef __INTEL_DISPLAY_UTILS__
|
||||
#define __INTEL_DISPLAY_UTILS__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct intel_display;
|
||||
|
||||
#define KHz(x) (1000 * (x))
|
||||
#define MHz(x) KHz(1000 * (x))
|
||||
|
||||
bool intel_display_run_as_guest(struct intel_display *display);
|
||||
|
||||
#endif /* __INTEL_DISPLAY_UTILS__ */
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_utils.h"
|
||||
#include "intel_display_core.h"
|
||||
#include "intel_display_utils.h"
|
||||
#include "intel_pch.h"
|
||||
|
||||
#define INTEL_PCH_DEVICE_ID_MASK 0xff80
|
||||
|
|
@ -328,7 +328,7 @@ void intel_pch_detect(struct intel_display *display)
|
|||
"Display disabled, reverting to NOP PCH\n");
|
||||
display->pch_type = PCH_NOP;
|
||||
} else if (!pch) {
|
||||
if (i915_run_as_guest() && HAS_DISPLAY(display)) {
|
||||
if (intel_display_run_as_guest(display) && HAS_DISPLAY(display)) {
|
||||
intel_virt_detect_pch(display, &id, &pch_type);
|
||||
display->pch_type = pch_type;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -254,6 +254,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
|
|||
i915-display/intel_display_power_map.o \
|
||||
i915-display/intel_display_power_well.o \
|
||||
i915-display/intel_display_trace.o \
|
||||
i915-display/intel_display_utils.o \
|
||||
i915-display/intel_display_wa.o \
|
||||
i915-display/intel_dkl_phy.o \
|
||||
i915-display/intel_dmc.o \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user