]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
x86/gpu: Reserve stolen memory for first integrated Intel GPU
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 14 Jan 2022 00:28:39 +0000 (16:28 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 7 Mar 2022 15:35:17 +0000 (16:35 +0100)
commit90f4628f7ad07bc96f178e5e1f7a3e6f68dad023
tree82ab346412407b8ba66013ff2d65a0cdce3509ed
parent33a28628a85ff6d13985bb8f4dda071b09dafa14
x86/gpu: Reserve stolen memory for first integrated Intel GPU

BugLink: https://bugs.launchpad.net/bugs/1960566
commit 9c494ca4d3a535f9ca11ad6af1813983c1c6cbdd upstream.

"Stolen memory" is memory set aside for use by an Intel integrated GPU.
The intel_graphics_quirks() early quirk reserves this memory when it is
called for a GPU that appears in the intel_early_ids[] table of integrated
GPUs.

Previously intel_graphics_quirks() was marked as QFLAG_APPLY_ONCE, so it
was called only for the first Intel GPU found.  If a discrete GPU happened
to be enumerated first, intel_graphics_quirks() was called for it but not
for any integrated GPU found later.  Therefore, stolen memory for such an
integrated GPU was never reserved.

For example, this problem occurs in this Alderlake-P (integrated) + DG2
(discrete) topology where the DG2 is found first, but stolen memory is
associated with the integrated GPU:

  - 00:01.0 Bridge
    `- 03:00.0 DG2 discrete GPU
  - 00:02.0 Integrated GPU (with stolen memory)

Remove the QFLAG_APPLY_ONCE flag and call intel_graphics_quirks() for every
Intel GPU.  Reserve stolen memory for the first GPU that appears in
intel_early_ids[].

[bhelgaas: commit log, add code comment, squash in
https://lore.kernel.org/r/20220118190558.2ququ4vdfjuahicm@ldmartin-desk2]
Link: https://lore.kernel.org/r/20220114002843.2083382-1-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/early-quirks.c