mirror of
https://github.com/torvalds/linux.git
synced 2026-04-23 00:55:48 -04:00
Prepare power-well and DC handling for a full power lost during D3Cold, then sanitize it upon D3->D0. Otherwise we get a bunch of state mismatch. Ideally we could leave DC9 enabled and wouldn't need to move DC9->DC0 on every runtime resume, however, the disable_DC is part of the power-well checks and intrinsic to the dc_off power well. In the future that can be detangled so we can have even bigger power savings. But for now, let's focus on getting a D3Cold, which saves much more power by itself. v2: create new functions to avoid full-suspend-resume path, which would result in a deadlock between xe_gem_fault and the modeset-ioctl. v3: Only avoid the full modeset to avoid the race, for a more robust suspend-resume. Cc: Anshuman Gupta <anshuman.gupta@intel.com> Cc: Uma Shankar <uma.shankar@intel.com> Tested-by: Francois Dugast <francois.dugast@intel.com> Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240522170105.327472-5-rodrigo.vivi@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
73 lines
2.8 KiB
C
73 lines
2.8 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2023 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_DISPLAY_H_
|
|
#define _XE_DISPLAY_H_
|
|
|
|
#include "xe_device.h"
|
|
|
|
struct drm_driver;
|
|
|
|
#if IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
|
|
|
|
bool xe_display_driver_probe_defer(struct pci_dev *pdev);
|
|
void xe_display_driver_set_hooks(struct drm_driver *driver);
|
|
void xe_display_driver_remove(struct xe_device *xe);
|
|
|
|
int xe_display_create(struct xe_device *xe);
|
|
|
|
int xe_display_probe(struct xe_device *xe);
|
|
|
|
int xe_display_init_nommio(struct xe_device *xe);
|
|
int xe_display_init_noirq(struct xe_device *xe);
|
|
int xe_display_init_noaccel(struct xe_device *xe);
|
|
int xe_display_init(struct xe_device *xe);
|
|
void xe_display_fini(struct xe_device *xe);
|
|
|
|
void xe_display_register(struct xe_device *xe);
|
|
void xe_display_unregister(struct xe_device *xe);
|
|
|
|
void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl);
|
|
void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir);
|
|
void xe_display_irq_reset(struct xe_device *xe);
|
|
void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt);
|
|
|
|
void xe_display_pm_suspend(struct xe_device *xe, bool runtime);
|
|
void xe_display_pm_suspend_late(struct xe_device *xe);
|
|
void xe_display_pm_resume_early(struct xe_device *xe);
|
|
void xe_display_pm_resume(struct xe_device *xe, bool runtime);
|
|
|
|
#else
|
|
|
|
static inline int xe_display_driver_probe_defer(struct pci_dev *pdev) { return 0; }
|
|
static inline void xe_display_driver_set_hooks(struct drm_driver *driver) { }
|
|
static inline void xe_display_driver_remove(struct xe_device *xe) {}
|
|
|
|
static inline int xe_display_create(struct xe_device *xe) { return 0; }
|
|
|
|
static inline int xe_display_probe(struct xe_device *xe) { return 0; }
|
|
|
|
static inline int xe_display_init_nommio(struct xe_device *xe) { return 0; }
|
|
static inline int xe_display_init_noirq(struct xe_device *xe) { return 0; }
|
|
static inline int xe_display_init_noaccel(struct xe_device *xe) { return 0; }
|
|
static inline int xe_display_init(struct xe_device *xe) { return 0; }
|
|
static inline void xe_display_fini(struct xe_device *xe) {}
|
|
|
|
static inline void xe_display_register(struct xe_device *xe) {}
|
|
static inline void xe_display_unregister(struct xe_device *xe) {}
|
|
|
|
static inline void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl) {}
|
|
static inline void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir) {}
|
|
static inline void xe_display_irq_reset(struct xe_device *xe) {}
|
|
static inline void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt) {}
|
|
|
|
static inline void xe_display_pm_suspend(struct xe_device *xe, bool runtime) {}
|
|
static inline void xe_display_pm_suspend_late(struct xe_device *xe) {}
|
|
static inline void xe_display_pm_resume_early(struct xe_device *xe) {}
|
|
static inline void xe_display_pm_resume(struct xe_device *xe, bool runtime) {}
|
|
|
|
#endif /* CONFIG_DRM_XE_DISPLAY */
|
|
#endif /* _XE_DISPLAY_H_ */
|