summarylogtreecommitdiffstats
path: root/i915-vga-arbiter.patch
diff options
context:
space:
mode:
authorMark Weiman2019-10-08 18:51:27 -0400
committerMark Weiman2019-10-08 18:51:27 -0400
commit99af4f87b49f9ae59c72330e4bf8803ce1ef9860 (patch)
tree174ffeb0ca47e5ed44ceb0af6c61366b09d1b0b0 /i915-vga-arbiter.patch
parent07325f4e70ccca9e4f9dc04b3122ced71d7a907d (diff)
downloadaur-99af4f87b49f9ae59c72330e4bf8803ce1ef9860.tar.gz
Update to 5.3.5-arch1-1
Diffstat (limited to 'i915-vga-arbiter.patch')
-rw-r--r--i915-vga-arbiter.patch156
1 files changed, 78 insertions, 78 deletions
diff --git a/i915-vga-arbiter.patch b/i915-vga-arbiter.patch
index c2e147ae060..455f3a98c32 100644
--- a/i915-vga-arbiter.patch
+++ b/i915-vga-arbiter.patch
@@ -1,8 +1,8 @@
-From a95d3e5bab8d9d6482e81f1c3ea24c16acb2cb42 Mon Sep 17 00:00:00 2001
+From 48be7e32f897277d77359e37db452281dd8b3bf8 Mon Sep 17 00:00:00 2001
From: Mark Weiman <mark.weiman@markzz.com>
-Date: Wed, 12 Dec 2018 10:31:24 -0500
+Date: Tue, 8 Oct 2019 18:48:25 -0400
Subject: [PATCH] i915: Add module option to support VGA arbiter on HD devices
- (4.19)
+ (5.3)
This is an updated version of Alex Williamson's patch from:
https://lkml.org/lkml/2014/5/9/517
@@ -35,18 +35,76 @@ This also rolls in reverted commit 6e1b4fda, which corrected an
ordering issue with 81b5c7bc by delaying the disabling of VGA memory
until after vgacon->fbcon handoff.
---
- drivers/gpu/drm/i915/i915_drv.c | 23 +++++++++++++++----
- drivers/gpu/drm/i915/i915_params.c | 3 +++
- drivers/gpu/drm/i915/i915_params.h | 1 +
- drivers/gpu/drm/i915/intel_display.c | 33 ++++++++++++++++++++++++++++
- drivers/gpu/drm/i915/intel_drv.h | 1 +
+ drivers/gpu/drm/i915/display/intel_display.c | 33 ++++++++++++++++++++
+ drivers/gpu/drm/i915/i915_drv.c | 23 +++++++++++---
+ drivers/gpu/drm/i915/i915_params.c | 3 ++
+ drivers/gpu/drm/i915/i915_params.h | 1 +
+ drivers/gpu/drm/i915/intel_drv.h | 1 +
5 files changed, 57 insertions(+), 4 deletions(-)
+diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
+index 592b92782fab..cafd1396bfcf 100644
+--- a/drivers/gpu/drm/i915/display/intel_display.c
++++ b/drivers/gpu/drm/i915/display/intel_display.c
+@@ -15751,6 +15751,36 @@ static void i915_disable_vga(struct drm_i915_private *dev_priv)
+ POSTING_READ(vga_reg);
+ }
+
++static void i915_enable_vga_mem(struct drm_i915_private *dev_priv)
++{
++ struct pci_dev *pdev = dev_priv->drm.pdev;
++
++ /* Enable VGA memory on Intel HD */
++ if (i915_modparams.enable_hd_vgaarb && HAS_PCH_SPLIT(dev_priv)) {
++ vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
++ outb(inb(VGA_MSR_READ) | VGA_MSR_MEM_EN, VGA_MSR_WRITE);
++ vga_set_legacy_decoding(pdev, VGA_RSRC_LEGACY_IO |
++ VGA_RSRC_LEGACY_MEM |
++ VGA_RSRC_NORMAL_IO |
++ VGA_RSRC_NORMAL_MEM);
++ vga_put(pdev, VGA_RSRC_LEGACY_IO);
++ }
++}
++
++void i915_disable_vga_mem(struct drm_i915_private *dev_priv)
++{
++ struct pci_dev *pdev = dev_priv->drm.pdev;
++ /* Disable VGA memory on Intel HD */
++ if (i915_modparams.enable_hd_vgaarb && HAS_PCH_SPLIT(dev_priv)) {
++ vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
++ outb(inb(VGA_MSR_READ) & ~VGA_MSR_MEM_EN, VGA_MSR_WRITE);
++ vga_set_legacy_decoding(pdev, VGA_RSRC_LEGACY_IO |
++ VGA_RSRC_NORMAL_IO |
++ VGA_RSRC_NORMAL_MEM);
++ vga_put(pdev, VGA_RSRC_LEGACY_IO);
++ }
++}
++
+ void intel_modeset_init_hw(struct drm_device *dev)
+ {
+ struct drm_i915_private *dev_priv = to_i915(dev);
+@@ -16395,6 +16425,7 @@ void i915_redisable_vga_power_on(struct drm_i915_private *dev_priv)
+ if (!(I915_READ(vga_reg) & VGA_DISP_DISABLE)) {
+ DRM_DEBUG_KMS("Something enabled VGA plane, disabling it\n");
+ i915_disable_vga(dev_priv);
++ i915_disable_vga_mem(dev_priv);
+ }
+ }
+
+@@ -16870,6 +16901,8 @@ void intel_modeset_cleanup(struct drm_device *dev)
+ {
+ struct drm_i915_private *dev_priv = to_i915(dev);
+
++ i915_enable_vga_mem(dev_priv);
++
+ flush_workqueue(dev_priv->modeset_wq);
+
+ flush_work(&dev_priv->atomic_helper.free_work);
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
-index f8cfd16be534..f5ba210d7b00 100644
+index bac1ee94f63f..5b10c950b70d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
-@@ -650,11 +650,20 @@ static int i915_load_modeset_init(struct drm_device *dev)
+@@ -697,11 +697,20 @@ static int i915_load_modeset_init(struct drm_device *dev)
* If we are a secondary display controller (!PCI_DISPLAY_CLASS_VGA),
* then we do not take part in VGA arbitration and the
* vga_client_register() fails with -ENODEV.
@@ -71,7 +129,7 @@ index f8cfd16be534..f5ba210d7b00 100644
intel_register_dsm_handler();
ret = vga_switcheroo_register_client(pdev, &i915_switcheroo_ops, false);
-@@ -693,6 +702,12 @@ static int i915_load_modeset_init(struct drm_device *dev)
+@@ -740,6 +749,12 @@ static int i915_load_modeset_init(struct drm_device *dev)
if (ret)
goto cleanup_gem;
@@ -85,10 +143,10 @@ index f8cfd16be534..f5ba210d7b00 100644
intel_hpd_init(dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
-index 295e981e4a39..243edeee97dd 100644
+index 5b07766a1c26..fb63f4c863db 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
-@@ -126,6 +126,9 @@ i915_param_named_unsafe(invert_brightness, int, 0600,
+@@ -127,6 +127,9 @@ i915_param_named_unsafe(invert_brightness, int, 0600,
i915_param_named(disable_display, bool, 0400,
"Disable display (default: false)");
@@ -99,80 +157,22 @@ index 295e981e4a39..243edeee97dd 100644
"Enable the MMIO debug code for the first N failures (default: off). "
"This may negatively affect performance.");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
-index 6c4d4a21474b..72b9bca3cc14 100644
+index a4770ce46bd2..8f836ff6e2e8 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
-@@ -57,6 +57,7 @@ struct drm_printer;
- param(unsigned int, inject_load_failure, 0) \
+@@ -67,6 +67,7 @@ struct drm_printer;
+ param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE) \
/* leave bools at the end to not create holes */ \
param(bool, alpha_support, IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT)) \
+ param(bool, enable_hd_vgaarb, false) \
param(bool, enable_hangcheck, true) \
- param(bool, fastboot, false) \
param(bool, prefault_disable, false) \
-diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index 3bd44d042a1d..b1aaa966679b 100644
---- a/drivers/gpu/drm/i915/intel_display.c
-+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -15025,6 +15025,36 @@ static void i915_disable_vga(struct drm_i915_private *dev_priv)
- POSTING_READ(vga_reg);
- }
-
-+static void i915_enable_vga_mem(struct drm_i915_private *dev_priv)
-+{
-+ struct pci_dev *pdev = dev_priv->drm.pdev;
-+
-+ /* Enable VGA memory on Intel HD */
-+ if (i915_modparams.enable_hd_vgaarb && HAS_PCH_SPLIT(dev_priv)) {
-+ vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
-+ outb(inb(VGA_MSR_READ) | VGA_MSR_MEM_EN, VGA_MSR_WRITE);
-+ vga_set_legacy_decoding(pdev, VGA_RSRC_LEGACY_IO |
-+ VGA_RSRC_LEGACY_MEM |
-+ VGA_RSRC_NORMAL_IO |
-+ VGA_RSRC_NORMAL_MEM);
-+ vga_put(pdev, VGA_RSRC_LEGACY_IO);
-+ }
-+}
-+
-+void i915_disable_vga_mem(struct drm_i915_private *dev_priv)
-+{
-+ struct pci_dev *pdev = dev_priv->drm.pdev;
-+ /* Disable VGA memory on Intel HD */
-+ if (i915_modparams.enable_hd_vgaarb && HAS_PCH_SPLIT(dev_priv)) {
-+ vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
-+ outb(inb(VGA_MSR_READ) & ~VGA_MSR_MEM_EN, VGA_MSR_WRITE);
-+ vga_set_legacy_decoding(pdev, VGA_RSRC_LEGACY_IO |
-+ VGA_RSRC_NORMAL_IO |
-+ VGA_RSRC_NORMAL_MEM);
-+ vga_put(pdev, VGA_RSRC_LEGACY_IO);
-+ }
-+}
-+
- void intel_modeset_init_hw(struct drm_device *dev)
- {
- struct drm_i915_private *dev_priv = to_i915(dev);
-@@ -15540,6 +15570,7 @@ void i915_redisable_vga_power_on(struct drm_i915_private *dev_priv)
- if (!(I915_READ(vga_reg) & VGA_DISP_DISABLE)) {
- DRM_DEBUG_KMS("Something enabled VGA plane, disabling it\n");
- i915_disable_vga(dev_priv);
-+ i915_disable_vga_mem(dev_priv);
- }
- }
-
-@@ -15946,6 +15977,8 @@ void intel_modeset_cleanup(struct drm_device *dev)
- {
- struct drm_i915_private *dev_priv = to_i915(dev);
-
-+ i915_enable_vga_mem(dev_priv);
-+
- flush_workqueue(dev_priv->modeset_wq);
-
- flush_work(&dev_priv->atomic_helper.free_work);
+ param(bool, load_detect_test, false) \
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
-index 8fc61e96754f..c1271e41e592 100644
+index f11979879e7b..06cefd0218a5 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
-@@ -1486,6 +1486,7 @@ int vlv_get_cck_clock_hpll(struct drm_i915_private *dev_priv,
+@@ -1457,6 +1457,7 @@ int vlv_get_cck_clock_hpll(struct drm_i915_private *dev_priv,
const char *name, u32 reg);
void lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv);
void lpt_disable_iclkip(struct drm_i915_private *dev_priv);
@@ -181,5 +181,5 @@ index 8fc61e96754f..c1271e41e592 100644
unsigned int intel_fb_xy_to_linear(int x, int y,
const struct intel_plane_state *state,
--
-2.20.0
+2.23.0