summaryrefslogtreecommitdiff
path: root/include/linux/aperture.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-04-06 16:21:09 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2023-04-16 15:18:10 +0300
commit116b1c5a364bcbdc40be64d4f3ec9dbc32e264dd (patch)
tree022d48d0daef251a872e92514ff3df09cad0ca47 /include/linux/aperture.h
parent5ca1479cd35d9003040e6ac829380debe89b802b (diff)
downloadlinux-116b1c5a364bcbdc40be64d4f3ec9dbc32e264dd.tar.xz
video/aperture: Provide a VGA helper for gma500 and internal use
The hardware for gma500 is different from the rest, as it uses stolen framebuffer memory that is not available via PCI BAR. The regular PCI removal helper cannot detect the framebuffer, while the non-PCI helper misses possible conflicting VGA devices (i.e., a framebuffer or text console). Gma500 therefore calls both helpers to catch all cases. It's confusing as it implies that there's something about the PCI device that requires ownership management. The relationship between the PCI device and the VGA devices is non-obvious. At worst, readers might assume that calling two functions for clearing aperture ownership is a bug in the driver. Hence, move the PCI removal helper's code for VGA functionality into a separate function and call this function from gma500. Documents the purpose of each call to aperture helpers. The change contains comments and example code form the discussion at [1]. v5: * fix grammar in gma500 comment (Javier) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.kernel.org/project/dri-devel/patch/20230404201842.567344-1-daniel.vetter@ffwll.ch/ # 1 Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230406132109.32050-10-tzimmermann@suse.de
Diffstat (limited to 'include/linux/aperture.h')
-rw-r--r--include/linux/aperture.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/aperture.h b/include/linux/aperture.h
index 7248727753be..1a9a88b11584 100644
--- a/include/linux/aperture.h
+++ b/include/linux/aperture.h
@@ -16,6 +16,8 @@ int devm_aperture_acquire_for_platform_device(struct platform_device *pdev,
int aperture_remove_conflicting_devices(resource_size_t base, resource_size_t size,
const char *name);
+int __aperture_remove_legacy_vga_devices(struct pci_dev *pdev);
+
int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name);
#else
static inline int devm_aperture_acquire_for_platform_device(struct platform_device *pdev,
@@ -31,6 +33,11 @@ static inline int aperture_remove_conflicting_devices(resource_size_t base, reso
return 0;
}
+static inline int __aperture_remove_legacy_vga_devices(struct pci_dev *pdev)
+{
+ return 0;
+}
+
static inline int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *name)
{
return 0;