VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.16.0/hotplug.h@ 85817

Last change on this file since 85817 was 52145, checked in by vboxsync, 11 years ago

Additions/x11/x11include: add header files for X.Org Server 1.16.

  • Property svn:eol-style set to native
File size: 3.5 KB
Line 
1/*
2 * Copyright © 2006-2007 Daniel Stone
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 *
23 * Author: Daniel Stone <[email protected]>
24 */
25
26#ifndef HOTPLUG_H
27#define HOTPLUG_H
28
29#include "list.h"
30
31extern _X_EXPORT void config_pre_init(void);
32extern _X_EXPORT void config_init(void);
33extern _X_EXPORT void config_fini(void);
34
35enum { ODEV_ATTRIB_UNKNOWN = -1, ODEV_ATTRIB_STRING = 0, ODEV_ATTRIB_INT };
36
37struct OdevAttribute {
38 struct xorg_list member;
39 int attrib_id;
40 union {
41 char *attrib_name;
42 int attrib_value;
43 };
44 int attrib_type;
45};
46
47struct OdevAttributes {
48 struct xorg_list list;
49};
50
51/* Note starting with xserver 1.16 this function never fails */
52struct OdevAttributes *
53config_odev_allocate_attribute_list(void);
54
55void
56config_odev_free_attribute_list(struct OdevAttributes *attribs);
57
58/* Note starting with xserver 1.16 this function never fails */
59Bool
60config_odev_add_attribute(struct OdevAttributes *attribs, int attrib,
61 const char *attrib_name);
62
63char *
64config_odev_get_attribute(struct OdevAttributes *attribs, int attrib_id);
65
66/* Note starting with xserver 1.16 this function never fails */
67Bool
68config_odev_add_int_attribute(struct OdevAttributes *attribs, int attrib,
69 int attrib_value);
70
71int
72config_odev_get_int_attribute(struct OdevAttributes *attribs, int attrib,
73 int def);
74
75void
76config_odev_free_attributes(struct OdevAttributes *attribs);
77
78/* path to kernel device node - Linux e.g. /dev/dri/card0 */
79#define ODEV_ATTRIB_PATH 1
80/* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */
81#define ODEV_ATTRIB_SYSPATH 2
82/* DRI-style bus id */
83#define ODEV_ATTRIB_BUSID 3
84/* Server managed FD */
85#define ODEV_ATTRIB_FD 4
86/* Major number of the device node pointed to by ODEV_ATTRIB_PATH */
87#define ODEV_ATTRIB_MAJOR 5
88/* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */
89#define ODEV_ATTRIB_MINOR 6
90/* kernel driver name */
91#define ODEV_ATTRIB_DRIVER 7
92
93typedef void (*config_odev_probe_proc_ptr)(struct OdevAttributes *attribs);
94void config_odev_probe(config_odev_probe_proc_ptr probe_callback);
95
96#ifdef CONFIG_UDEV_KMS
97void NewGPUDeviceRequest(struct OdevAttributes *attribs);
98void DeleteGPUDeviceRequest(struct OdevAttributes *attribs);
99#endif
100
101#define ServerIsNotSeat0() (SeatId && strcmp(SeatId, "seat0"))
102
103struct xf86_platform_device *
104xf86_find_platform_device_by_devnum(int major, int minor);
105
106#endif /* HOTPLUG_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette