summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_pci.h
diff options
context:
space:
mode:
authorPiotr PiĆ³rkowski <piotr.piorkowski@intel.com>2022-08-05 17:59:59 +0200
committerJani Nikula <jani.nikula@intel.com>2022-08-10 13:11:17 +0300
commit1bba7323c79b169d855ecb4a1eba410f18a38674 (patch)
tree7e3f2175753acb1ec2923b68490b140c0c13fe43 /drivers/gpu/drm/i915/i915_pci.h
parent6bba2b30d29cbba78ba0f935210108e74dbe7ab3 (diff)
drm/i915: Sanitycheck PCI BARs
For proper operation of i915 we need usable PCI GTTMMADDR BAR 0 (1 for GEN2). In most cases we also need usable PCI GFXMEM BAR 2. Let's add functions to check if BARs are set, and that it have a size greater than 0. In case GTTMMADDR BAR, let's validate at the beginning of i915 initialization. For other BARs, let's validate before first use. Signed-off-by: Piotr PiĆ³rkowski <piotr.piorkowski@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220805155959.1983584-3-piotr.piorkowski@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_pci.h')
-rw-r--r--drivers/gpu/drm/i915/i915_pci.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_pci.h b/drivers/gpu/drm/i915/i915_pci.h
index ee048c238174..8dfe19f9a775 100644
--- a/drivers/gpu/drm/i915/i915_pci.h
+++ b/drivers/gpu/drm/i915/i915_pci.h
@@ -6,7 +6,13 @@
#ifndef __I915_PCI_H__
#define __I915_PCI_H__
+#include <linux/types.h>
+
+struct pci_dev;
+
int i915_pci_register_driver(void);
void i915_pci_unregister_driver(void);
+bool i915_pci_resource_valid(struct pci_dev *pdev, int bar);
+
#endif /* __I915_PCI_H__ */