mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 12:16:29 -04:00
drm/i915/display: move intel_modeset_probe_defer() to intel_display_driver.[ch]
High level display functionality only called from driver top level code. Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/831ed4d0356b51526704269038a6d2d72739e779.1681465222.git.jani.nikula@intel.com
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string_helpers.h>
|
||||
#include <linux/vga_switcheroo.h>
|
||||
|
||||
#include <drm/display/drm_dp_helper.h>
|
||||
#include <drm/drm_atomic.h>
|
||||
@@ -40,7 +39,6 @@
|
||||
#include <drm/drm_damage_helper.h>
|
||||
#include <drm/drm_edid.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
#include <drm/drm_privacy_screen_consumer.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_rect.h>
|
||||
|
||||
@@ -8816,27 +8814,6 @@ void intel_modeset_driver_remove_nogem(struct drm_i915_private *i915)
|
||||
intel_bios_driver_remove(i915);
|
||||
}
|
||||
|
||||
bool intel_modeset_probe_defer(struct pci_dev *pdev)
|
||||
{
|
||||
struct drm_privacy_screen *privacy_screen;
|
||||
|
||||
/*
|
||||
* apple-gmux is needed on dual GPU MacBook Pro
|
||||
* to probe the panel if we're the inactive GPU.
|
||||
*/
|
||||
if (vga_switcheroo_client_probe_defer(pdev))
|
||||
return true;
|
||||
|
||||
/* If the LCD panel has a privacy-screen, wait for it */
|
||||
privacy_screen = drm_privacy_screen_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(privacy_screen) && PTR_ERR(privacy_screen) == -EPROBE_DEFER)
|
||||
return true;
|
||||
|
||||
drm_privacy_screen_put(privacy_screen);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool intel_scanout_needs_vtd_wa(struct drm_i915_private *i915)
|
||||
{
|
||||
return DISPLAY_VER(i915) >= 6 && i915_vtd_active(i915);
|
||||
|
||||
@@ -521,7 +521,6 @@ void intel_plane_fixup_bitmasks(struct intel_crtc_state *crtc_state);
|
||||
void intel_update_watermarks(struct drm_i915_private *i915);
|
||||
|
||||
/* modesetting */
|
||||
bool intel_modeset_probe_defer(struct pci_dev *pdev);
|
||||
void intel_modeset_init_hw(struct drm_i915_private *i915);
|
||||
int intel_modeset_init_noirq(struct drm_i915_private *i915);
|
||||
int intel_modeset_init_nogem(struct drm_i915_private *i915);
|
||||
|
||||
@@ -7,8 +7,10 @@
|
||||
* details here.
|
||||
*/
|
||||
|
||||
#include <linux/vga_switcheroo.h>
|
||||
#include <acpi/video.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_privacy_screen_consumer.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
@@ -19,6 +21,27 @@
|
||||
#include "intel_fbdev.h"
|
||||
#include "intel_opregion.h"
|
||||
|
||||
bool intel_modeset_probe_defer(struct pci_dev *pdev)
|
||||
{
|
||||
struct drm_privacy_screen *privacy_screen;
|
||||
|
||||
/*
|
||||
* apple-gmux is needed on dual GPU MacBook Pro
|
||||
* to probe the panel if we're the inactive GPU.
|
||||
*/
|
||||
if (vga_switcheroo_client_probe_defer(pdev))
|
||||
return true;
|
||||
|
||||
/* If the LCD panel has a privacy-screen, wait for it */
|
||||
privacy_screen = drm_privacy_screen_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(privacy_screen) && PTR_ERR(privacy_screen) == -EPROBE_DEFER)
|
||||
return true;
|
||||
|
||||
drm_privacy_screen_put(privacy_screen);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void intel_display_driver_register(struct drm_i915_private *i915)
|
||||
{
|
||||
if (!HAS_DISPLAY(i915))
|
||||
|
||||
@@ -6,8 +6,12 @@
|
||||
#ifndef __INTEL_DISPLAY_DRIVER_H__
|
||||
#define __INTEL_DISPLAY_DRIVER_H__
|
||||
|
||||
struct drm_i915_private;
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_i915_private;
|
||||
struct pci_dev;
|
||||
|
||||
bool intel_modeset_probe_defer(struct pci_dev *pdev);
|
||||
void intel_display_driver_register(struct drm_i915_private *i915);
|
||||
void intel_display_driver_unregister(struct drm_i915_private *i915);
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <drm/i915_pciids.h>
|
||||
|
||||
#include "display/intel_display.h"
|
||||
#include "display/intel_display_driver.h"
|
||||
#include "gt/intel_gt_regs.h"
|
||||
#include "gt/intel_sa_media.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user