xen_igd.h 957 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2007, Neocleus Corporation.
  3. * Copyright (c) 2007, Intel Corporation.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0-only
  6. *
  7. * Alex Novik <alex@neocleus.com>
  8. * Allen Kay <allen.m.kay@intel.com>
  9. * Guy Zana <guy@neocleus.com>
  10. */
  11. #ifndef XEN_IGD_H
  12. #define XEN_IGD_H
  13. #include "hw/xen/xen-host-pci-device.h"
  14. typedef struct XenPCIPassthroughState XenPCIPassthroughState;
  15. bool xen_igd_gfx_pt_enabled(void);
  16. void xen_igd_gfx_pt_set(bool value, Error **errp);
  17. uint32_t igd_read_opregion(XenPCIPassthroughState *s);
  18. void xen_igd_reserve_slot(PCIBus *pci_bus);
  19. void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val);
  20. void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
  21. XenHostPCIDevice *dev);
  22. static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
  23. {
  24. return (xen_igd_gfx_pt_enabled()
  25. && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA));
  26. }
  27. #endif