Skip to content

Commit 4141a5e

Browse files
committed
Merge tag 'pci-v5.17-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull pci fix from Bjorn Helgaas: - Reserve "stolen memory" for integrated Intel GPU, even if it's not the first GPU to be enumerated (Lucas De Marchi) * tag 'pci-v5.17-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: x86/gpu: Reserve stolen memory for first integrated Intel GPU
2 parents 85e67d5 + 9c494ca commit 4141a5e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

arch/x86/kernel/early-quirks.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ static const struct intel_early_ops gen11_early_ops __initconst = {
515515
.stolen_size = gen9_stolen_size,
516516
};
517517

518+
/* Intel integrated GPUs for which we need to reserve "stolen memory" */
518519
static const struct pci_device_id intel_early_ids[] __initconst = {
519520
INTEL_I830_IDS(&i830_early_ops),
520521
INTEL_I845G_IDS(&i845_early_ops),
@@ -592,6 +593,13 @@ static void __init intel_graphics_quirks(int num, int slot, int func)
592593
u16 device;
593594
int i;
594595

596+
/*
597+
* Reserve "stolen memory" for an integrated GPU. If we've already
598+
* found one, there's nothing to do for other (discrete) GPUs.
599+
*/
600+
if (resource_size(&intel_graphics_stolen_res))
601+
return;
602+
595603
device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID);
596604

597605
for (i = 0; i < ARRAY_SIZE(intel_early_ids); i++) {
@@ -704,7 +712,7 @@ static struct chipset early_qrk[] __initdata = {
704712
{ PCI_VENDOR_ID_INTEL, 0x3406, PCI_CLASS_BRIDGE_HOST,
705713
PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check },
706714
{ PCI_VENDOR_ID_INTEL, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA, PCI_ANY_ID,
707-
QFLAG_APPLY_ONCE, intel_graphics_quirks },
715+
0, intel_graphics_quirks },
708716
/*
709717
* HPET on the current version of the Baytrail platform has accuracy
710718
* problems: it will halt in deep idle state - so we disable it.

0 commit comments

Comments
 (0)