xref: /openbmc/qemu/include/hw/xen/xen_igd.h (revision 7d87775f)
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 
14 #include "hw/xen/xen-host-pci-device.h"
15 
16 typedef struct XenPCIPassthroughState XenPCIPassthroughState;
17 
18 bool xen_igd_gfx_pt_enabled(void);
19 void xen_igd_gfx_pt_set(bool value, Error **errp);
20 
21 uint32_t igd_read_opregion(XenPCIPassthroughState *s);
22 void xen_igd_reserve_slot(PCIBus *pci_bus);
23 void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val);
24 void xen_igd_passthrough_isa_bridge_create(XenPCIPassthroughState *s,
25                                            XenHostPCIDevice *dev);
26 
27 static inline bool is_igd_vga_passthrough(XenHostPCIDevice *dev)
28 {
29     return (xen_igd_gfx_pt_enabled()
30             && ((dev->class_code >> 0x8) == PCI_CLASS_DISPLAY_VGA));
31 }
32 
33 #endif
34