1 /**********************************************************
2 * Copyright 2008-2009 VMware, Inc. All rights reserved.
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 **********************************************************/
28 * Glue file for Xorg State Tracker.
30 * @author Alan Hourihane <alanh@tungstengraphics.com>
31 * @author Jakob Bornecrantz <wallbraker@gmail.com>
36 static void vmw_xorg_identify(int flags
);
37 static Bool
vmw_xorg_pci_probe(DriverPtr driver
,
39 struct pci_device
*device
,
42 static const struct pci_id_match vmw_xorg_device_match
[] = {
43 {0x15ad, PCI_MATCH_ANY
, PCI_MATCH_ANY
, PCI_MATCH_ANY
, 0, 0, 0},
44 {0, 0, 0, 0, 0, 0, 0},
47 static SymTabRec vmw_xorg_chipsets
[] = {
48 {PCI_MATCH_ANY
, "VMware SVGA Device"},
52 static PciChipsets vmw_xorg_pci_devices
[] = {
53 {PCI_MATCH_ANY
, PCI_MATCH_ANY
, NULL
},
57 static XF86ModuleVersionInfo vmw_xorg_version
= {
63 0, 1, 0, /* major, minor, patch */
71 * Xorg driver exported structures
74 _X_EXPORT DriverRec vmwgfx
= {
79 xorg_tracker_available_options
,
83 vmw_xorg_device_match
,
87 static MODULESETUPPROTO(vmw_xorg_setup
);
89 _X_EXPORT XF86ModuleData vmwgfxModuleData
= {
96 * Xorg driver functions
100 vmw_xorg_setup(pointer module
, pointer opts
, int *errmaj
, int *errmin
)
102 static Bool setupDone
= 0;
104 /* This module should be loaded only once, but check to be sure.
108 xf86AddDriver(&vmwgfx
, module
, HaveDriverFuncs
);
111 * The return value must be non-NULL on success even though there
112 * is no TearDownProc.
117 *errmaj
= LDR_ONCEONLY
;
123 vmw_xorg_identify(int flags
)
125 xf86PrintChipsets("vmwgfx", "Driver for VMware SVGA device",
130 vmw_xorg_pci_probe(DriverPtr driver
,
131 int entity_num
, struct pci_device
*device
, intptr_t match_data
)
133 ScrnInfoPtr scrn
= NULL
;
134 EntityInfoPtr entity
;
136 scrn
= xf86ConfigPciEntity(scrn
, 0, entity_num
, vmw_xorg_pci_devices
,
137 NULL
, NULL
, NULL
, NULL
, NULL
);
139 scrn
->driverVersion
= 1;
140 scrn
->driverName
= "vmwgfx";
141 scrn
->name
= "vmwgfx";
144 entity
= xf86GetEntityInfo(entity_num
);
146 /* Use all the functions from the xorg tracker */
147 xorg_tracker_set_functions(scrn
);
149 vmw_screen_set_functions(scrn
);