linux/drivers/gpu/drm/i915/i915_pci.h
Piotr Piórkowski 1bba7323c7 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
2022-08-10 13:11:17 +03:00

19 lines
338 B
C

/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2021 Intel Corporation
*/
#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__ */