* [PATCH 0/5] bridges without VGA support
@ 2026-02-17 17:04 Simon Richter
2026-02-17 17:04 ` [PATCH 1/5] vgaarb: pass vga_get errors to userspace Simon Richter
` (5 more replies)
0 siblings, 6 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-17 17:04 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
Hi,
this allows bridges to refuse forwarding VGA, and reports this upwards as an
error, because we cannot set up valid decoding for the requested device in this
case.
I think it should be fine to leave VGA forwarding enabled on lower bridges if a
bridge closer to the root refused to enable forwarding, because no accesses can
reach there anyway.
Simon
Simon Richter (5):
vgaarb: pass vga_get errors to userspace
vgaarb: pass errors from pci_set_vga_state up
vgaarb: mark vga_get family as __must_check
pci: check if VGA decoding was really activated
pci: mark return value of pci_set_vga_state as __must_check
drivers/pci/pci.c | 6 ++++++
drivers/pci/vgaarb.c | 22 +++++++++++++++++++---
include/linux/pci.h | 2 +-
include/linux/vgaarb.h | 9 +++++----
4 files changed, 31 insertions(+), 8 deletions(-)
base-commit: 9702969978695d9a699a1f34771580cdbb153b33
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/5] vgaarb: pass vga_get errors to userspace
2026-02-17 17:04 [PATCH 0/5] bridges without VGA support Simon Richter
@ 2026-02-17 17:04 ` Simon Richter
2026-02-17 17:04 ` [PATCH 2/5] vgaarb: pass errors from pci_set_vga_state up Simon Richter
` (4 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-17 17:04 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
If vga_get fails, return the error code via the write syscall.
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
drivers/pci/vgaarb.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 87143e235033..5c2719cb1bfa 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -1134,6 +1134,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf,
char kbuf[64], *curr_pos;
size_t remaining = count;
+ int err;
int ret_val;
int i;
@@ -1165,7 +1166,12 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf,
goto done;
}
- vga_get_uninterruptible(pdev, io_state);
+ err = vga_get_uninterruptible(pdev, io_state);
+ if (unlikely(err))
+ {
+ ret_val = err;
+ goto done;
+ }
/* Update the client's locks lists */
for (i = 0; i < MAX_USER_CARDS; i++) {
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/5] vgaarb: pass errors from pci_set_vga_state up
2026-02-17 17:04 [PATCH 0/5] bridges without VGA support Simon Richter
2026-02-17 17:04 ` [PATCH 1/5] vgaarb: pass vga_get errors to userspace Simon Richter
@ 2026-02-17 17:04 ` Simon Richter
2026-02-17 17:04 ` [PATCH 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
` (3 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-17 17:04 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
pci_set_vga_state returns an error code, which so far has been ignored. Pass
this code through __vga_tryget (via ERR_PTR).
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
drivers/pci/vgaarb.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 5c2719cb1bfa..322c028539f0 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -215,6 +215,7 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
struct vga_device *conflict;
unsigned int pci_bits;
u32 flags = 0;
+ int err = 0;
/*
* Account for "normal" resources to lock. If we decode the legacy,
@@ -307,7 +308,9 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
if (change_bridge)
flags |= PCI_VGA_STATE_CHANGE_BRIDGE;
- pci_set_vga_state(conflict->pdev, false, pci_bits, flags);
+ err = pci_set_vga_state(conflict->pdev, false, pci_bits, flags);
+ if (unlikely(err))
+ return ERR_PTR(err);
conflict->owns &= ~match;
/* If we disabled normal decoding, reflect it in owns */
@@ -337,7 +340,9 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
if (wants & VGA_RSRC_LEGACY_MASK)
flags |= PCI_VGA_STATE_CHANGE_BRIDGE;
- pci_set_vga_state(vgadev->pdev, true, pci_bits, flags);
+ err = pci_set_vga_state(vgadev->pdev, true, pci_bits, flags);
+ if (unlikely(err))
+ return ERR_PTR(err);
vgadev->owns |= wants;
lock_them:
@@ -455,6 +460,11 @@ int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible)
}
conflict = __vga_tryget(vgadev, rsrc);
spin_unlock_irqrestore(&vga_lock, flags);
+ if (IS_ERR(conflict))
+ {
+ rc = PTR_ERR(conflict);
+ break;
+ }
if (conflict == NULL)
break;
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/5] vgaarb: mark vga_get family as __must_check
2026-02-17 17:04 [PATCH 0/5] bridges without VGA support Simon Richter
2026-02-17 17:04 ` [PATCH 1/5] vgaarb: pass vga_get errors to userspace Simon Richter
2026-02-17 17:04 ` [PATCH 2/5] vgaarb: pass errors from pci_set_vga_state up Simon Richter
@ 2026-02-17 17:04 ` Simon Richter
2026-02-18 1:51 ` kernel test robot
2026-02-18 5:59 ` kernel test robot
2026-02-17 17:04 ` [PATCH 4/5] pci: check if VGA decoding was really activated Simon Richter
` (2 subsequent siblings)
5 siblings, 2 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-17 17:04 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
These functions can return an error, but some callers expect they don't, and
unconditionally access VGA registers afterwards and call vga_put.
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
include/linux/vgaarb.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 97129a1bbb7d..de683d499dfa 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -27,7 +27,8 @@ struct pci_dev;
#ifdef CONFIG_VGA_ARB
void vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes);
-int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible);
+int __must_check vga_get(struct pci_dev *pdev, unsigned int rsrc,
+ int interruptible);
void vga_put(struct pci_dev *pdev, unsigned int rsrc);
struct pci_dev *vga_default_device(void);
void vga_set_default_device(struct pci_dev *pdev);
@@ -39,7 +40,7 @@ static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
unsigned int decodes)
{
};
-static inline int vga_get(struct pci_dev *pdev, unsigned int rsrc,
+static inline int __must_check vga_get(struct pci_dev *pdev, unsigned int rsrc,
int interruptible)
{
return 0;
@@ -74,7 +75,7 @@ static inline int vga_client_register(struct pci_dev *pdev,
*
* On success, release the VGA resource again with vga_put().
*/
-static inline int vga_get_interruptible(struct pci_dev *pdev,
+static inline int __must_check vga_get_interruptible(struct pci_dev *pdev,
unsigned int rsrc)
{
return vga_get(pdev, rsrc, 1);
@@ -89,7 +90,7 @@ static inline int vga_get_interruptible(struct pci_dev *pdev,
*
* On success, release the VGA resource again with vga_put().
*/
-static inline int vga_get_uninterruptible(struct pci_dev *pdev,
+static inline int __must_check vga_get_uninterruptible(struct pci_dev *pdev,
unsigned int rsrc)
{
return vga_get(pdev, rsrc, 0);
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 4/5] pci: check if VGA decoding was really activated
2026-02-17 17:04 [PATCH 0/5] bridges without VGA support Simon Richter
` (2 preceding siblings ...)
2026-02-17 17:04 ` [PATCH 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
@ 2026-02-17 17:04 ` Simon Richter
2026-02-17 17:04 ` [PATCH 5/5] pci: mark return value of pci_set_vga_state as __must_check Simon Richter
2026-02-18 13:46 ` [PATCH v2 0/5] Bridges without VGA support Simon Richter
5 siblings, 0 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-17 17:04 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
PCI bridges are allowed to refuse activating VGA decoding, by simply ignoring
attempts to set the bit that enables it, so after setting the bit, read it
back to verify.
One example of such a bridge is the root bridge in IBM PowerNV.
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
drivers/pci/pci.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f3244630bfd0..0984a0aefb88 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -6198,6 +6198,12 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
cmd &= ~PCI_BRIDGE_CTL_VGA;
pci_write_config_word(bridge, PCI_BRIDGE_CONTROL,
cmd);
+ if (decode) {
+ pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
+ &cmd);
+ if(!(cmd & PCI_BRIDGE_CTL_VGA))
+ return -EIO;
+ }
}
bus = bus->parent;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 5/5] pci: mark return value of pci_set_vga_state as __must_check
2026-02-17 17:04 [PATCH 0/5] bridges without VGA support Simon Richter
` (3 preceding siblings ...)
2026-02-17 17:04 ` [PATCH 4/5] pci: check if VGA decoding was really activated Simon Richter
@ 2026-02-17 17:04 ` Simon Richter
2026-02-18 13:46 ` [PATCH v2 0/5] Bridges without VGA support Simon Richter
5 siblings, 0 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-17 17:04 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
This function can return an error, which should be checked.
The only caller so far is __vga_tryget in vgaarb, which did not check.
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
include/linux/pci.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1c270f1d5123..08d7c1ae33b5 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1720,7 +1720,7 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus,
#define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0)
#define PCI_VGA_STATE_CHANGE_DECODES (1 << 1)
-int pci_set_vga_state(struct pci_dev *pdev, bool decode,
+int __must_check pci_set_vga_state(struct pci_dev *pdev, bool decode,
unsigned int command_bits, u32 flags);
/*
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 3/5] vgaarb: mark vga_get family as __must_check
2026-02-17 17:04 ` [PATCH 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
@ 2026-02-18 1:51 ` kernel test robot
2026-02-18 5:59 ` kernel test robot
1 sibling, 0 replies; 17+ messages in thread
From: kernel test robot @ 2026-02-18 1:51 UTC (permalink / raw)
To: Simon Richter, linux-pci
Cc: oe-kbuild-all, intel-xe, dri-devel, Simon Richter
Hi Simon,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 9702969978695d9a699a1f34771580cdbb153b33]
url: https://github.com/intel-lab-lkp/linux/commits/Simon-Richter/vgaarb-pass-vga_get-errors-to-userspace/20260218-010647
base: 9702969978695d9a699a1f34771580cdbb153b33
patch link: https://lore.kernel.org/r/20260217170419.236739-4-Simon.Richter%40hogyros.de
patch subject: [PATCH 3/5] vgaarb: mark vga_get family as __must_check
config: powerpc-randconfig-002-20260218 (https://download.01.org/0day-ci/archive/20260218/202602180912.N7IZbIal-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260218/202602180912.N7IZbIal-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602180912.N7IZbIal-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/gpu/drm/i915/display/intel_vga.c: In function 'intel_vga_disable':
>> drivers/gpu/drm/i915/display/intel_vga.c:68:2: warning: ignoring return value of 'vga_get_uninterruptible', declared with attribute warn_unused_result [-Wunused-result]
vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/display/intel_vga.c: In function 'intel_vga_reset_io_mem':
drivers/gpu/drm/i915/display/intel_vga.c:93:2: warning: ignoring return value of 'vga_get_uninterruptible', declared with attribute warn_unused_result [-Wunused-result]
vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/vga_get_uninterruptible +68 drivers/gpu/drm/i915/display/intel_vga.c
0c80d60ae63461 Ville Syrjälä 2025-04-17 43
4fb8783165b7c6 Jani Nikula 2019-10-01 44 /* Disable the VGA plane that we never use */
4b6e05c43b7542 Ville Syrjälä 2024-09-06 45 void intel_vga_disable(struct intel_display *display)
4fb8783165b7c6 Jani Nikula 2019-10-01 46 {
4b6e05c43b7542 Ville Syrjälä 2024-09-06 47 struct pci_dev *pdev = to_pci_dev(display->drm->dev);
4b6e05c43b7542 Ville Syrjälä 2024-09-06 48 i915_reg_t vga_reg = intel_vga_cntrl_reg(display);
0c80d60ae63461 Ville Syrjälä 2025-04-17 49 enum pipe pipe;
0c80d60ae63461 Ville Syrjälä 2025-04-17 50 u32 tmp;
4fb8783165b7c6 Jani Nikula 2019-10-01 51 u8 sr1;
4fb8783165b7c6 Jani Nikula 2019-10-01 52
0c80d60ae63461 Ville Syrjälä 2025-04-17 53 tmp = intel_de_read(display, vga_reg);
0c80d60ae63461 Ville Syrjälä 2025-04-17 54 if (tmp & VGA_DISP_DISABLE)
a3af0140663dc3 Emil Velikov 2021-06-04 55 return;
a3af0140663dc3 Emil Velikov 2021-06-04 56
0c80d60ae63461 Ville Syrjälä 2025-04-17 57 if (display->platform.cherryview)
0c80d60ae63461 Ville Syrjälä 2025-04-17 58 pipe = REG_FIELD_GET(VGA_PIPE_SEL_MASK_CHV, tmp);
0c80d60ae63461 Ville Syrjälä 2025-04-17 59 else if (has_vga_pipe_sel(display))
0c80d60ae63461 Ville Syrjälä 2025-04-17 60 pipe = REG_FIELD_GET(VGA_PIPE_SEL_MASK, tmp);
0c80d60ae63461 Ville Syrjälä 2025-04-17 61 else
0c80d60ae63461 Ville Syrjälä 2025-04-17 62 pipe = PIPE_A;
0c80d60ae63461 Ville Syrjälä 2025-04-17 63
0c80d60ae63461 Ville Syrjälä 2025-04-17 64 drm_dbg_kms(display->drm, "Disabling VGA plane on pipe %c\n",
0c80d60ae63461 Ville Syrjälä 2025-04-17 65 pipe_name(pipe));
0c80d60ae63461 Ville Syrjälä 2025-04-17 66
4fb8783165b7c6 Jani Nikula 2019-10-01 67 /* WaEnableVGAAccessThroughIOPort:ctg,elk,ilk,snb,ivb,vlv,hsw */
4fb8783165b7c6 Jani Nikula 2019-10-01 @68 vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
f0bb41fad02e03 Jani Nikula 2022-02-02 69 outb(0x01, VGA_SEQ_I);
f0bb41fad02e03 Jani Nikula 2022-02-02 70 sr1 = inb(VGA_SEQ_D);
f0bb41fad02e03 Jani Nikula 2022-02-02 71 outb(sr1 | VGA_SR01_SCREEN_OFF, VGA_SEQ_D);
4fb8783165b7c6 Jani Nikula 2019-10-01 72 vga_put(pdev, VGA_RSRC_LEGACY_IO);
4fb8783165b7c6 Jani Nikula 2019-10-01 73 udelay(300);
4fb8783165b7c6 Jani Nikula 2019-10-01 74
4b6e05c43b7542 Ville Syrjälä 2024-09-06 75 intel_de_write(display, vga_reg, VGA_DISP_DISABLE);
4b6e05c43b7542 Ville Syrjälä 2024-09-06 76 intel_de_posting_read(display, vga_reg);
4fb8783165b7c6 Jani Nikula 2019-10-01 77 }
4fb8783165b7c6 Jani Nikula 2019-10-01 78
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/5] vgaarb: mark vga_get family as __must_check
2026-02-17 17:04 ` [PATCH 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
2026-02-18 1:51 ` kernel test robot
@ 2026-02-18 5:59 ` kernel test robot
1 sibling, 0 replies; 17+ messages in thread
From: kernel test robot @ 2026-02-18 5:59 UTC (permalink / raw)
To: Simon Richter, linux-pci
Cc: oe-kbuild-all, intel-xe, dri-devel, Simon Richter
Hi Simon,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 9702969978695d9a699a1f34771580cdbb153b33]
url: https://github.com/intel-lab-lkp/linux/commits/Simon-Richter/vgaarb-pass-vga_get-errors-to-userspace/20260218-010647
base: 9702969978695d9a699a1f34771580cdbb153b33
patch link: https://lore.kernel.org/r/20260217170419.236739-4-Simon.Richter%40hogyros.de
patch subject: [PATCH 3/5] vgaarb: mark vga_get family as __must_check
config: i386-randconfig-141-20260218 (https://download.01.org/0day-ci/archive/20260218/202602181332.NDKD0g1P-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
smatch version: v0.5.0-8994-gd50c5a4c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260218/202602181332.NDKD0g1P-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602181332.NDKD0g1P-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/i915/display/intel_vga.c:68:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
68 | vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
| ^~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/display/intel_vga.c:93:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
93 | vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
| ^~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
vim +/warn_unused_result +68 drivers/gpu/drm/i915/display/intel_vga.c
0c80d60ae63461 Ville Syrjälä 2025-04-17 43
4fb8783165b7c6 Jani Nikula 2019-10-01 44 /* Disable the VGA plane that we never use */
4b6e05c43b7542 Ville Syrjälä 2024-09-06 45 void intel_vga_disable(struct intel_display *display)
4fb8783165b7c6 Jani Nikula 2019-10-01 46 {
4b6e05c43b7542 Ville Syrjälä 2024-09-06 47 struct pci_dev *pdev = to_pci_dev(display->drm->dev);
4b6e05c43b7542 Ville Syrjälä 2024-09-06 48 i915_reg_t vga_reg = intel_vga_cntrl_reg(display);
0c80d60ae63461 Ville Syrjälä 2025-04-17 49 enum pipe pipe;
0c80d60ae63461 Ville Syrjälä 2025-04-17 50 u32 tmp;
4fb8783165b7c6 Jani Nikula 2019-10-01 51 u8 sr1;
4fb8783165b7c6 Jani Nikula 2019-10-01 52
0c80d60ae63461 Ville Syrjälä 2025-04-17 53 tmp = intel_de_read(display, vga_reg);
0c80d60ae63461 Ville Syrjälä 2025-04-17 54 if (tmp & VGA_DISP_DISABLE)
a3af0140663dc3 Emil Velikov 2021-06-04 55 return;
a3af0140663dc3 Emil Velikov 2021-06-04 56
0c80d60ae63461 Ville Syrjälä 2025-04-17 57 if (display->platform.cherryview)
0c80d60ae63461 Ville Syrjälä 2025-04-17 58 pipe = REG_FIELD_GET(VGA_PIPE_SEL_MASK_CHV, tmp);
0c80d60ae63461 Ville Syrjälä 2025-04-17 59 else if (has_vga_pipe_sel(display))
0c80d60ae63461 Ville Syrjälä 2025-04-17 60 pipe = REG_FIELD_GET(VGA_PIPE_SEL_MASK, tmp);
0c80d60ae63461 Ville Syrjälä 2025-04-17 61 else
0c80d60ae63461 Ville Syrjälä 2025-04-17 62 pipe = PIPE_A;
0c80d60ae63461 Ville Syrjälä 2025-04-17 63
0c80d60ae63461 Ville Syrjälä 2025-04-17 64 drm_dbg_kms(display->drm, "Disabling VGA plane on pipe %c\n",
0c80d60ae63461 Ville Syrjälä 2025-04-17 65 pipe_name(pipe));
0c80d60ae63461 Ville Syrjälä 2025-04-17 66
4fb8783165b7c6 Jani Nikula 2019-10-01 67 /* WaEnableVGAAccessThroughIOPort:ctg,elk,ilk,snb,ivb,vlv,hsw */
4fb8783165b7c6 Jani Nikula 2019-10-01 @68 vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
f0bb41fad02e03 Jani Nikula 2022-02-02 69 outb(0x01, VGA_SEQ_I);
f0bb41fad02e03 Jani Nikula 2022-02-02 70 sr1 = inb(VGA_SEQ_D);
f0bb41fad02e03 Jani Nikula 2022-02-02 71 outb(sr1 | VGA_SR01_SCREEN_OFF, VGA_SEQ_D);
4fb8783165b7c6 Jani Nikula 2019-10-01 72 vga_put(pdev, VGA_RSRC_LEGACY_IO);
4fb8783165b7c6 Jani Nikula 2019-10-01 73 udelay(300);
4fb8783165b7c6 Jani Nikula 2019-10-01 74
4b6e05c43b7542 Ville Syrjälä 2024-09-06 75 intel_de_write(display, vga_reg, VGA_DISP_DISABLE);
4b6e05c43b7542 Ville Syrjälä 2024-09-06 76 intel_de_posting_read(display, vga_reg);
4fb8783165b7c6 Jani Nikula 2019-10-01 77 }
4fb8783165b7c6 Jani Nikula 2019-10-01 78
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 0/5] Bridges without VGA support
2026-02-17 17:04 [PATCH 0/5] bridges without VGA support Simon Richter
` (4 preceding siblings ...)
2026-02-17 17:04 ` [PATCH 5/5] pci: mark return value of pci_set_vga_state as __must_check Simon Richter
@ 2026-02-18 13:46 ` Simon Richter
2026-02-18 13:46 ` [PATCH v2 1/5] vgaarb: pass vga_get errors to userspace Simon Richter
` (5 more replies)
5 siblings, 6 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-18 13:46 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
Hi,
v2 fixes the formatting errors.
This allows bridges to refuse forwarding VGA, and reports this upwards as an
error, because we cannot set up valid decoding for the requested device in this
case.
I think it should be fine to leave VGA forwarding enabled on lower bridges if a
bridge closer to the root refused to enable forwarding, because no accesses can
reach there anyway.
Simon
Simon Richter (5):
vgaarb: pass vga_get errors to userspace
vgaarb: pass errors from pci_set_vga_state up
vgaarb: mark vga_get family as __must_check
pci: check if VGA decoding was really activated
pci: mark return value of pci_set_vga_state as __must_check
drivers/pci/pci.c | 6 ++++++
drivers/pci/vgaarb.c | 20 +++++++++++++++++---
include/linux/pci.h | 4 ++--
include/linux/vgaarb.h | 15 ++++++++-------
4 files changed, 33 insertions(+), 12 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 1/5] vgaarb: pass vga_get errors to userspace
2026-02-18 13:46 ` [PATCH v2 0/5] Bridges without VGA support Simon Richter
@ 2026-02-18 13:46 ` Simon Richter
2026-02-18 13:46 ` [PATCH v2 2/5] vgaarb: pass errors from pci_set_vga_state up Simon Richter
` (4 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-18 13:46 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
If vga_get fails, return the error code via the write syscall.
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
drivers/pci/vgaarb.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 87143e235033..188885d30d41 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -1134,6 +1134,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf,
char kbuf[64], *curr_pos;
size_t remaining = count;
+ int err;
int ret_val;
int i;
@@ -1165,7 +1166,11 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf,
goto done;
}
- vga_get_uninterruptible(pdev, io_state);
+ err = vga_get_uninterruptible(pdev, io_state);
+ if (unlikely(err)) {
+ ret_val = err;
+ goto done;
+ }
/* Update the client's locks lists */
for (i = 0; i < MAX_USER_CARDS; i++) {
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 2/5] vgaarb: pass errors from pci_set_vga_state up
2026-02-18 13:46 ` [PATCH v2 0/5] Bridges without VGA support Simon Richter
2026-02-18 13:46 ` [PATCH v2 1/5] vgaarb: pass vga_get errors to userspace Simon Richter
@ 2026-02-18 13:46 ` Simon Richter
2026-02-18 13:46 ` [PATCH v2 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
` (3 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-18 13:46 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
pci_set_vga_state returns an error code, which so far has been ignored.
Pass this code through __vga_tryget (via ERR_PTR).
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
drivers/pci/vgaarb.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 188885d30d41..93f695f9d768 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -215,6 +215,7 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
struct vga_device *conflict;
unsigned int pci_bits;
u32 flags = 0;
+ int err = 0;
/*
* Account for "normal" resources to lock. If we decode the legacy,
@@ -307,7 +308,9 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
if (change_bridge)
flags |= PCI_VGA_STATE_CHANGE_BRIDGE;
- pci_set_vga_state(conflict->pdev, false, pci_bits, flags);
+ err = pci_set_vga_state(conflict->pdev, false, pci_bits, flags);
+ if (unlikely(err))
+ return ERR_PTR(err);
conflict->owns &= ~match;
/* If we disabled normal decoding, reflect it in owns */
@@ -337,7 +340,9 @@ static struct vga_device *__vga_tryget(struct vga_device *vgadev,
if (wants & VGA_RSRC_LEGACY_MASK)
flags |= PCI_VGA_STATE_CHANGE_BRIDGE;
- pci_set_vga_state(vgadev->pdev, true, pci_bits, flags);
+ err = pci_set_vga_state(vgadev->pdev, true, pci_bits, flags);
+ if (unlikely(err))
+ return ERR_PTR(err);
vgadev->owns |= wants;
lock_them:
@@ -455,6 +460,10 @@ int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible)
}
conflict = __vga_tryget(vgadev, rsrc);
spin_unlock_irqrestore(&vga_lock, flags);
+ if (IS_ERR(conflict)) {
+ rc = PTR_ERR(conflict);
+ break;
+ }
if (conflict == NULL)
break;
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 3/5] vgaarb: mark vga_get family as __must_check
2026-02-18 13:46 ` [PATCH v2 0/5] Bridges without VGA support Simon Richter
2026-02-18 13:46 ` [PATCH v2 1/5] vgaarb: pass vga_get errors to userspace Simon Richter
2026-02-18 13:46 ` [PATCH v2 2/5] vgaarb: pass errors from pci_set_vga_state up Simon Richter
@ 2026-02-18 13:46 ` Simon Richter
2026-02-23 0:52 ` kernel test robot
2026-02-18 13:46 ` [PATCH v2 4/5] pci: check if VGA decoding was really activated Simon Richter
` (2 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Simon Richter @ 2026-02-18 13:46 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
These functions can return an error, but some callers expect they don't,
and unconditionally access VGA registers afterwards and call vga_put.
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
include/linux/vgaarb.h | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 97129a1bbb7d..eed524c67c22 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -27,7 +27,8 @@ struct pci_dev;
#ifdef CONFIG_VGA_ARB
void vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes);
-int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible);
+int __must_check vga_get(struct pci_dev *pdev, unsigned int rsrc,
+ int interruptible);
void vga_put(struct pci_dev *pdev, unsigned int rsrc);
struct pci_dev *vga_default_device(void);
void vga_set_default_device(struct pci_dev *pdev);
@@ -39,8 +40,8 @@ static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
unsigned int decodes)
{
};
-static inline int vga_get(struct pci_dev *pdev, unsigned int rsrc,
- int interruptible)
+static inline int __must_check vga_get(struct pci_dev *pdev, unsigned int rsrc,
+ int interruptible)
{
return 0;
}
@@ -74,8 +75,8 @@ static inline int vga_client_register(struct pci_dev *pdev,
*
* On success, release the VGA resource again with vga_put().
*/
-static inline int vga_get_interruptible(struct pci_dev *pdev,
- unsigned int rsrc)
+static inline int __must_check vga_get_interruptible(struct pci_dev *pdev,
+ unsigned int rsrc)
{
return vga_get(pdev, rsrc, 1);
}
@@ -89,8 +90,8 @@ static inline int vga_get_interruptible(struct pci_dev *pdev,
*
* On success, release the VGA resource again with vga_put().
*/
-static inline int vga_get_uninterruptible(struct pci_dev *pdev,
- unsigned int rsrc)
+static inline int __must_check vga_get_uninterruptible(struct pci_dev *pdev,
+ unsigned int rsrc)
{
return vga_get(pdev, rsrc, 0);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 4/5] pci: check if VGA decoding was really activated
2026-02-18 13:46 ` [PATCH v2 0/5] Bridges without VGA support Simon Richter
` (2 preceding siblings ...)
2026-02-18 13:46 ` [PATCH v2 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
@ 2026-02-18 13:46 ` Simon Richter
2026-02-18 13:46 ` [PATCH v2 5/5] pci: mark return value of pci_set_vga_state as __must_check Simon Richter
2026-02-18 17:51 ` [PATCH v2 0/5] Bridges without VGA support Bjorn Helgaas
5 siblings, 0 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-18 13:46 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
PCI bridges are allowed to refuse activating VGA decoding, by simply
ignoring attempts to set the bit that enables it, so after setting the bit,
read it back to verify.
One example of such a bridge is the root bridge in IBM PowerNV.
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
drivers/pci/pci.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f3244630bfd0..0984a0aefb88 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -6198,6 +6198,12 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
cmd &= ~PCI_BRIDGE_CTL_VGA;
pci_write_config_word(bridge, PCI_BRIDGE_CONTROL,
cmd);
+ if (decode) {
+ pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
+ &cmd);
+ if(!(cmd & PCI_BRIDGE_CTL_VGA))
+ return -EIO;
+ }
}
bus = bus->parent;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 5/5] pci: mark return value of pci_set_vga_state as __must_check
2026-02-18 13:46 ` [PATCH v2 0/5] Bridges without VGA support Simon Richter
` (3 preceding siblings ...)
2026-02-18 13:46 ` [PATCH v2 4/5] pci: check if VGA decoding was really activated Simon Richter
@ 2026-02-18 13:46 ` Simon Richter
2026-02-18 17:51 ` [PATCH v2 0/5] Bridges without VGA support Bjorn Helgaas
5 siblings, 0 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-18 13:46 UTC (permalink / raw)
To: linux-pci; +Cc: intel-xe, dri-devel, Simon Richter
This function can return an error, which should be checked.
The only caller so far is __vga_tryget in vgaarb, which did not check.
Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
---
include/linux/pci.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1c270f1d5123..aa1451d402d1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1720,8 +1720,8 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus,
#define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0)
#define PCI_VGA_STATE_CHANGE_DECODES (1 << 1)
-int pci_set_vga_state(struct pci_dev *pdev, bool decode,
- unsigned int command_bits, u32 flags);
+int __must_check pci_set_vga_state(struct pci_dev *pdev, bool decode,
+ unsigned int command_bits, u32 flags);
/*
* Virtual interrupts allow for more interrupts to be allocated
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v2 0/5] Bridges without VGA support
2026-02-18 13:46 ` [PATCH v2 0/5] Bridges without VGA support Simon Richter
` (4 preceding siblings ...)
2026-02-18 13:46 ` [PATCH v2 5/5] pci: mark return value of pci_set_vga_state as __must_check Simon Richter
@ 2026-02-18 17:51 ` Bjorn Helgaas
2026-02-19 4:06 ` Simon Richter
5 siblings, 1 reply; 17+ messages in thread
From: Bjorn Helgaas @ 2026-02-18 17:51 UTC (permalink / raw)
To: Simon Richter; +Cc: linux-pci, intel-xe, dri-devel
On Wed, Feb 18, 2026 at 10:46:28PM +0900, Simon Richter wrote:
> Hi,
>
> v2 fixes the formatting errors.
I'm not sure if you also fixed the kernel test robot warnings
(https://lore.kernel.org/all/202602180912.N7IZbIal-lkp@intel.com,
https://lore.kernel.org/all/202602181332.NDKD0g1P-lkp@intel.com).
If not, please run "git log --oneline" on these files and match the
historical style (capitalization, "()" after function names, etc).
Also applies to some commit logs.
I assume this series fixes some problem where VGA isn't enabled
correctly in some topology? It wasn't obvious to me from the commit
logs, but it would be good to include that if so.
> This allows bridges to refuse forwarding VGA, and reports this upwards as an
> error, because we cannot set up valid decoding for the requested device in this
> case.
>
> I think it should be fine to leave VGA forwarding enabled on lower bridges if a
> bridge closer to the root refused to enable forwarding, because no accesses can
> reach there anyway.
>
> Simon
>
> Simon Richter (5):
> vgaarb: pass vga_get errors to userspace
> vgaarb: pass errors from pci_set_vga_state up
> vgaarb: mark vga_get family as __must_check
> pci: check if VGA decoding was really activated
> pci: mark return value of pci_set_vga_state as __must_check
>
> drivers/pci/pci.c | 6 ++++++
> drivers/pci/vgaarb.c | 20 +++++++++++++++++---
> include/linux/pci.h | 4 ++--
> include/linux/vgaarb.h | 15 ++++++++-------
> 4 files changed, 33 insertions(+), 12 deletions(-)
>
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 0/5] Bridges without VGA support
2026-02-18 17:51 ` [PATCH v2 0/5] Bridges without VGA support Bjorn Helgaas
@ 2026-02-19 4:06 ` Simon Richter
0 siblings, 0 replies; 17+ messages in thread
From: Simon Richter @ 2026-02-19 4:06 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, intel-xe, dri-devel
Hi Bjorn,
On 2/19/26 2:51 AM, Bjorn Helgaas wrote:
> I'm not sure if you also fixed the kernel test robot warnings
> (https://lore.kernel.org/all/202602180912.N7IZbIal-lkp@intel.com,
> https://lore.kernel.org/all/202602181332.NDKD0g1P-lkp@intel.com).
I think I did, but the () are still missing, will do another round.
> I assume this series fixes some problem where VGA isn't enabled
> correctly in some topology? It wasn't obvious to me from the commit
> logs, but it would be good to include that if so.
It's the missing error handling if VGA cannot be enabled because a
bridge on the way doesn't support VGA forwarding and hardwires the VGA
bit to zero.
The i915 driver has a workaround for two internal state machines that go
out of sync when voltage regulators are reprogrammed, so it needs to
perform a few VGA accesses on initialization, or there is a risk of a
bus error later when control is returned to vgacon.
This isn't a concern if VGA accesses *never* work, so we can simply skip
it in this case, but we need to know that there was an error.
The i915 counterpart to this is
https://patchwork.freedesktop.org/series/161721/
which changes code introduced in December, so if the pci/vgaarb patches
are backported, that one also needs to be backported manually.
That's what the __must_check are for, the warnings they generate go away
when the i915 patch is applied, so it probably makes sense to do that first.
So, for v3:
- expand commit messages with the text above
- recheck commit message style
Does it make sense to Cc stable on these?
Simon
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 3/5] vgaarb: mark vga_get family as __must_check
2026-02-18 13:46 ` [PATCH v2 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
@ 2026-02-23 0:52 ` kernel test robot
0 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2026-02-23 0:52 UTC (permalink / raw)
To: Simon Richter, linux-pci
Cc: oe-kbuild-all, intel-xe, dri-devel, Simon Richter
Hi Simon,
kernel test robot noticed the following build errors:
[auto build test ERROR on pci/next]
[also build test ERROR on pci/for-linus drm-misc/drm-misc-next drm/drm-next linus/master v6.19 next-20260220]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Simon-Richter/vgaarb-pass-vga_get-errors-to-userspace/20260218-214939
base: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next
patch link: https://lore.kernel.org/r/20260218134633.461181-4-Simon.Richter%40hogyros.de
patch subject: [PATCH v2 3/5] vgaarb: mark vga_get family as __must_check
config: x86_64-randconfig-072-20250919 (https://download.01.org/0day-ci/archive/20260223/202602230802.stvvFCIZ-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260223/202602230802.stvvFCIZ-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602230802.stvvFCIZ-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/display/intel_vga.c: In function 'intel_vga_disable':
>> drivers/gpu/drm/i915/display/intel_vga.c:68:9: error: ignoring return value of 'vga_get_uninterruptible' declared with attribute 'warn_unused_result' [-Werror=unused-result]
68 | vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/display/intel_vga.c: In function 'intel_vga_reset_io_mem':
drivers/gpu/drm/i915/display/intel_vga.c:93:9: error: ignoring return value of 'vga_get_uninterruptible' declared with attribute 'warn_unused_result' [-Werror=unused-result]
93 | vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +68 drivers/gpu/drm/i915/display/intel_vga.c
0c80d60ae63461 Ville Syrjälä 2025-04-17 43
4fb8783165b7c6 Jani Nikula 2019-10-01 44 /* Disable the VGA plane that we never use */
4b6e05c43b7542 Ville Syrjälä 2024-09-06 45 void intel_vga_disable(struct intel_display *display)
4fb8783165b7c6 Jani Nikula 2019-10-01 46 {
4b6e05c43b7542 Ville Syrjälä 2024-09-06 47 struct pci_dev *pdev = to_pci_dev(display->drm->dev);
4b6e05c43b7542 Ville Syrjälä 2024-09-06 48 i915_reg_t vga_reg = intel_vga_cntrl_reg(display);
0c80d60ae63461 Ville Syrjälä 2025-04-17 49 enum pipe pipe;
0c80d60ae63461 Ville Syrjälä 2025-04-17 50 u32 tmp;
4fb8783165b7c6 Jani Nikula 2019-10-01 51 u8 sr1;
4fb8783165b7c6 Jani Nikula 2019-10-01 52
0c80d60ae63461 Ville Syrjälä 2025-04-17 53 tmp = intel_de_read(display, vga_reg);
0c80d60ae63461 Ville Syrjälä 2025-04-17 54 if (tmp & VGA_DISP_DISABLE)
a3af0140663dc3 Emil Velikov 2021-06-04 55 return;
a3af0140663dc3 Emil Velikov 2021-06-04 56
0c80d60ae63461 Ville Syrjälä 2025-04-17 57 if (display->platform.cherryview)
0c80d60ae63461 Ville Syrjälä 2025-04-17 58 pipe = REG_FIELD_GET(VGA_PIPE_SEL_MASK_CHV, tmp);
0c80d60ae63461 Ville Syrjälä 2025-04-17 59 else if (has_vga_pipe_sel(display))
0c80d60ae63461 Ville Syrjälä 2025-04-17 60 pipe = REG_FIELD_GET(VGA_PIPE_SEL_MASK, tmp);
0c80d60ae63461 Ville Syrjälä 2025-04-17 61 else
0c80d60ae63461 Ville Syrjälä 2025-04-17 62 pipe = PIPE_A;
0c80d60ae63461 Ville Syrjälä 2025-04-17 63
0c80d60ae63461 Ville Syrjälä 2025-04-17 64 drm_dbg_kms(display->drm, "Disabling VGA plane on pipe %c\n",
0c80d60ae63461 Ville Syrjälä 2025-04-17 65 pipe_name(pipe));
0c80d60ae63461 Ville Syrjälä 2025-04-17 66
4fb8783165b7c6 Jani Nikula 2019-10-01 67 /* WaEnableVGAAccessThroughIOPort:ctg,elk,ilk,snb,ivb,vlv,hsw */
4fb8783165b7c6 Jani Nikula 2019-10-01 @68 vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
f0bb41fad02e03 Jani Nikula 2022-02-02 69 outb(0x01, VGA_SEQ_I);
f0bb41fad02e03 Jani Nikula 2022-02-02 70 sr1 = inb(VGA_SEQ_D);
f0bb41fad02e03 Jani Nikula 2022-02-02 71 outb(sr1 | VGA_SR01_SCREEN_OFF, VGA_SEQ_D);
4fb8783165b7c6 Jani Nikula 2019-10-01 72 vga_put(pdev, VGA_RSRC_LEGACY_IO);
4fb8783165b7c6 Jani Nikula 2019-10-01 73 udelay(300);
4fb8783165b7c6 Jani Nikula 2019-10-01 74
4b6e05c43b7542 Ville Syrjälä 2024-09-06 75 intel_de_write(display, vga_reg, VGA_DISP_DISABLE);
4b6e05c43b7542 Ville Syrjälä 2024-09-06 76 intel_de_posting_read(display, vga_reg);
4fb8783165b7c6 Jani Nikula 2019-10-01 77 }
4fb8783165b7c6 Jani Nikula 2019-10-01 78
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2026-02-23 0:52 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-17 17:04 [PATCH 0/5] bridges without VGA support Simon Richter
2026-02-17 17:04 ` [PATCH 1/5] vgaarb: pass vga_get errors to userspace Simon Richter
2026-02-17 17:04 ` [PATCH 2/5] vgaarb: pass errors from pci_set_vga_state up Simon Richter
2026-02-17 17:04 ` [PATCH 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
2026-02-18 1:51 ` kernel test robot
2026-02-18 5:59 ` kernel test robot
2026-02-17 17:04 ` [PATCH 4/5] pci: check if VGA decoding was really activated Simon Richter
2026-02-17 17:04 ` [PATCH 5/5] pci: mark return value of pci_set_vga_state as __must_check Simon Richter
2026-02-18 13:46 ` [PATCH v2 0/5] Bridges without VGA support Simon Richter
2026-02-18 13:46 ` [PATCH v2 1/5] vgaarb: pass vga_get errors to userspace Simon Richter
2026-02-18 13:46 ` [PATCH v2 2/5] vgaarb: pass errors from pci_set_vga_state up Simon Richter
2026-02-18 13:46 ` [PATCH v2 3/5] vgaarb: mark vga_get family as __must_check Simon Richter
2026-02-23 0:52 ` kernel test robot
2026-02-18 13:46 ` [PATCH v2 4/5] pci: check if VGA decoding was really activated Simon Richter
2026-02-18 13:46 ` [PATCH v2 5/5] pci: mark return value of pci_set_vga_state as __must_check Simon Richter
2026-02-18 17:51 ` [PATCH v2 0/5] Bridges without VGA support Bjorn Helgaas
2026-02-19 4:06 ` Simon Richter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox