diff options
author | Jeremy C. Reed <reed@glacier.reedmedia.net> | 2006-12-08 15:52:37 -0600 |
---|---|---|
committer | Jeremy C. Reed <reed@glacier.reedmedia.net> | 2006-12-08 15:52:37 -0600 |
commit | d56249a15ead51ad4d2117d5538ada24af05b693 (patch) | |
tree | ddb281b1b8d1a5ae2be291e460f96bd45b65705e | |
parent | f1f8df1889ab656bb57596e2f85408f15f42cd5d (diff) | |
parent | ec84f72d077eaf2e7768a1f5398f65a5e1714d08 (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver
124 files changed, 7202 insertions, 2112 deletions
diff --git a/GL/glx/indirect_dispatch.h b/GL/glx/indirect_dispatch.h index 9bf74ebd1..17a372f91 100644 --- a/GL/glx/indirect_dispatch.h +++ b/GL/glx/indirect_dispatch.h @@ -85,8 +85,6 @@ extern HIDDEN void __glXDisp_EvalCoord2fv(GLbyte * pc); extern HIDDEN void __glXDispSwap_EvalCoord2fv(GLbyte * pc); extern HIDDEN int __glXDisp_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_DestroyPixmap(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc); extern HIDDEN int __glXDisp_GetMapiv(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_GetMapiv(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDisp_SwapBuffers(struct __GLXclientStateRec *, GLbyte *); @@ -123,6 +121,8 @@ extern HIDDEN int __glXDisp_VendorPrivate(struct __GLXclientStateRec *, GLbyte * extern HIDDEN int __glXDispSwap_VendorPrivate(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDisp_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN void __glXDisp_VertexAttrib1fvNV(GLbyte * pc); +extern HIDDEN void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc); extern HIDDEN void __glXDisp_Vertex3iv(GLbyte * pc); extern HIDDEN void __glXDispSwap_Vertex3iv(GLbyte * pc); extern HIDDEN void __glXDisp_CopyConvolutionFilter1D(GLbyte * pc); @@ -279,6 +279,8 @@ extern HIDDEN void __glXDisp_ClearStencil(GLbyte * pc); extern HIDDEN void __glXDispSwap_ClearStencil(GLbyte * pc); extern HIDDEN void __glXDisp_VertexAttrib3dvARB(GLbyte * pc); extern HIDDEN void __glXDispSwap_VertexAttrib3dvARB(GLbyte * pc); +extern HIDDEN void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc); +extern HIDDEN void __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc); extern HIDDEN void __glXDisp_ConvolutionParameteriv(GLbyte * pc); extern HIDDEN void __glXDispSwap_ConvolutionParameteriv(GLbyte * pc); extern HIDDEN void __glXDisp_RasterPos2fv(GLbyte * pc); @@ -327,6 +329,8 @@ extern HIDDEN int __glXDisp_GetVertexAttribdvNV(struct __GLXclientStateRec *, GL extern HIDDEN int __glXDispSwap_GetVertexAttribdvNV(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN void __glXDisp_Normal3fv(GLbyte * pc); extern HIDDEN void __glXDispSwap_Normal3fv(GLbyte * pc); +extern HIDDEN void __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc); +extern HIDDEN void __glXDispSwap_ProgramEnvParameter4dvARB(GLbyte * pc); extern HIDDEN void __glXDisp_VertexAttrib4ivARB(GLbyte * pc); extern HIDDEN void __glXDispSwap_VertexAttrib4ivARB(GLbyte * pc); extern HIDDEN void __glXDisp_End(GLbyte * pc); @@ -457,8 +461,6 @@ extern HIDDEN void __glXDisp_BindFramebufferEXT(GLbyte * pc); extern HIDDEN void __glXDispSwap_BindFramebufferEXT(GLbyte * pc); extern HIDDEN void __glXDisp_PushAttrib(GLbyte * pc); extern HIDDEN void __glXDispSwap_PushAttrib(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib4usvARB(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib4usvARB(GLbyte * pc); extern HIDDEN int __glXDisp_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_DestroyPbuffer(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN void __glXDisp_TexParameteriv(GLbyte * pc); @@ -615,6 +617,8 @@ extern HIDDEN void __glXDisp_PrioritizeTextures(GLbyte * pc); extern HIDDEN void __glXDispSwap_PrioritizeTextures(GLbyte * pc); extern HIDDEN int __glXDisp_PixelStorei(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_PixelStorei(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN void __glXDisp_VertexAttrib4usvARB(GLbyte * pc); +extern HIDDEN void __glXDispSwap_VertexAttrib4usvARB(GLbyte * pc); extern HIDDEN void __glXDisp_Color4iv(GLbyte * pc); extern HIDDEN void __glXDispSwap_Color4iv(GLbyte * pc); extern HIDDEN void __glXDisp_EvalCoord2dv(GLbyte * pc); @@ -783,8 +787,6 @@ extern HIDDEN void __glXDisp_VertexAttribs2fvNV(GLbyte * pc); extern HIDDEN void __glXDispSwap_VertexAttribs2fvNV(GLbyte * pc); extern HIDDEN void __glXDisp_Rectiv(GLbyte * pc); extern HIDDEN void __glXDispSwap_Rectiv(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttrib1fvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib1fvNV(GLbyte * pc); extern HIDDEN void __glXDisp_SecondaryColor3dvEXT(GLbyte * pc); extern HIDDEN void __glXDispSwap_SecondaryColor3dvEXT(GLbyte * pc); extern HIDDEN void __glXDisp_Vertex2fv(GLbyte * pc); @@ -919,8 +921,6 @@ extern HIDDEN void __glXDisp_DrawBuffersARB(GLbyte * pc); extern HIDDEN void __glXDispSwap_DrawBuffersARB(GLbyte * pc); extern HIDDEN void __glXDisp_LoadName(GLbyte * pc); extern HIDDEN void __glXDispSwap_LoadName(GLbyte * pc); -extern HIDDEN void __glXDisp_VertexAttribs4ubvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttribs4ubvNV(GLbyte * pc); extern HIDDEN void __glXDisp_CopyTexSubImage1D(GLbyte * pc); extern HIDDEN void __glXDispSwap_CopyTexSubImage1D(GLbyte * pc); extern HIDDEN void __glXDisp_CullFace(GLbyte * pc); diff --git a/GL/glx/indirect_dispatch_swap.c b/GL/glx/indirect_dispatch_swap.c index 1d45676b3..136f0d010 100644 --- a/GL/glx/indirect_dispatch_swap.c +++ b/GL/glx/indirect_dispatch_swap.c @@ -28,7 +28,7 @@ #include <X11/Xmd.h> #include <GL/gl.h> #include <GL/glxproto.h> -#if defined(__linux__) || defined(__GNU__) +#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) #include <byteswap.h> #elif defined(__OpenBSD__) #include <sys/endian.h> diff --git a/GL/glx/indirect_program.c b/GL/glx/indirect_program.c index d0fd3d135..8d5f0e60f 100644 --- a/GL/glx/indirect_program.c +++ b/GL/glx/indirect_program.c @@ -46,7 +46,7 @@ #include "dispatch.h" #include "glapioffsets.h" -#ifdef __linux__ +#if defined(__linux__) || defined (__GLIBC__) || defined (__GNU__) #include <byteswap.h> #elif defined(__OpenBSD__) #include <sys/endian.h> diff --git a/GL/glx/indirect_reqsize.c b/GL/glx/indirect_reqsize.c index 1c332da79..d3e2bc516 100644 --- a/GL/glx/indirect_reqsize.c +++ b/GL/glx/indirect_reqsize.c @@ -31,7 +31,7 @@ #include "indirect_size.h" #include "indirect_reqsize.h" -#if defined(__linux__) || defined(__GNU__) +#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) # include <byteswap.h> # define SWAP_32(v) do { (v) = bswap_32(v); } while(0) #else diff --git a/GL/glx/indirect_table.c b/GL/glx/indirect_table.c index a6fd3a39a..60d676064 100644 --- a/GL/glx/indirect_table.c +++ b/GL/glx/indirect_table.c @@ -645,7 +645,7 @@ static const void *Render_function_table[400][2] = { /* [ 302] = 4182 */ {__glXDisp_RequestResidentProgramsNV, __glXDispSwap_RequestResidentProgramsNV}, /* [ 303] = 4183 */ {__glXDisp_LoadProgramNV, __glXDispSwap_LoadProgramNV}, /* [ 304] = 4184 */ {__glXDisp_ProgramParameter4fvNV, __glXDispSwap_ProgramParameter4fvNV}, - /* [ 305] = 4185 */ {__glXDisp_ProgramParameter4dvNV, __glXDispSwap_ProgramParameter4dvNV}, + /* [ 305] = 4185 */ {__glXDisp_ProgramEnvParameter4dvARB, __glXDispSwap_ProgramEnvParameter4dvARB}, /* [ 306] = 4186 */ {__glXDisp_ProgramParameters4fvNV, __glXDispSwap_ProgramParameters4fvNV}, /* [ 307] = 4187 */ {__glXDisp_ProgramParameters4dvNV, __glXDispSwap_ProgramParameters4dvNV}, /* [ 308] = 4188 */ {__glXDisp_TrackMatrixNV, __glXDispSwap_TrackMatrixNV}, @@ -886,10 +886,10 @@ static const int_fast16_t Render_size_table[400][2] = { /* [140] = 140 */ { 0, ~0}, /* [141] = 141 */ { 4, ~0}, /* [142] = 142 */ { 8, ~0}, - /* [143] = 143 */ { 40, 20}, - /* [144] = 144 */ { 28, 21}, - /* [145] = 145 */ { 64, 22}, - /* [146] = 146 */ { 44, 23}, + /* [143] = 143 */ { 28, 20}, + /* [144] = 144 */ { 20, 21}, + /* [145] = 145 */ { 48, 22}, + /* [146] = 146 */ { 32, 23}, /* [147] = 147 */ { 24, ~0}, /* [148] = 148 */ { 16, ~0}, /* [149] = 149 */ { 44, ~0}, diff --git a/GL/glx/indirect_texture_compression.c b/GL/glx/indirect_texture_compression.c index 0c42ea034..35af1d235 100644 --- a/GL/glx/indirect_texture_compression.c +++ b/GL/glx/indirect_texture_compression.c @@ -39,7 +39,7 @@ #include "glthread.h" #include "dispatch.h" -#ifdef __linux__ +#if defined(__linux__) || defined (__GLIBC__) || defined (__GNU__) #include <byteswap.h> #elif defined(__OpenBSD__) #include <sys/endian.h> diff --git a/GL/glx/indirect_util.c b/GL/glx/indirect_util.c index 2d64f3399..09b7ab87c 100644 --- a/GL/glx/indirect_util.c +++ b/GL/glx/indirect_util.c @@ -28,7 +28,7 @@ #include <X11/Xmd.h> #include <GL/gl.h> #include <GL/glxproto.h> -#if defined(__linux__) || defined(__GNU__) +#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__) #include <byteswap.h> #elif defined(__OpenBSD__) #include <sys/endian.h> diff --git a/GL/glx/swap_interval.c b/GL/glx/swap_interval.c index bcc1c4793..c4137c1aa 100644 --- a/GL/glx/swap_interval.c +++ b/GL/glx/swap_interval.c @@ -40,7 +40,7 @@ #include "dispatch.h" #include "glapioffsets.h" -#ifdef __linux__ +#if defined(__linux__) || defined (__GLIBC__) || defined (__GNU__) #include <byteswap.h> #elif defined(__OpenBSD__) #include <sys/endian.h> diff --git a/Xext/security.c b/Xext/security.c index ac762794a..572f81196 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -1251,7 +1251,7 @@ typedef struct _PropertyAccessRec { } PropertyAccessRec, *PropertyAccessPtr; static PropertyAccessPtr PropertyAccessList = NULL; -static char SecurityDefaultAction = SecurityErrorOperation; +static char SecurityDefaultAction = XaceErrorOperation; static char *SecurityPolicyFile = DEFAULTPOLICYFILE; static ATOM SecurityMaxPropertyName = 0; @@ -1410,9 +1410,9 @@ SecurityParsePropertyAccessRule( { switch (c) { - case 'i': action = SecurityIgnoreOperation; break; - case 'a': action = SecurityAllowOperation; break; - case 'e': action = SecurityErrorOperation; break; + case 'i': action = XaceIgnoreOperation; break; + case 'a': action = XaceAllowOperation; break; + case 'e': action = XaceErrorOperation; break; case 'r': readAction = action; break; case 'w': writeAction = action; break; @@ -1797,7 +1797,7 @@ CALLBACK(SecurityCheckPropertyAccess) * If pacl doesn't apply, something above should have * executed a continue, which will skip the follwing code. */ - action = SecurityAllowOperation; + action = XaceAllowOperation; if (access_mode & SecurityReadAccess) action = max(action, pacl->readAction); if (access_mode & SecurityWriteAccess) @@ -1808,11 +1808,11 @@ CALLBACK(SecurityCheckPropertyAccess) } /* end for each pacl */ } /* end if propertyName <= SecurityMaxPropertyName */ - if (SecurityAllowOperation != action) + if (XaceAllowOperation != action) { /* audit the access violation */ int cid = CLIENT_ID(pWin->drawable.id); int reqtype = ((xReq *)client->requestBuffer)->reqType; - char *actionstr = (SecurityIgnoreOperation == action) ? + char *actionstr = (XaceIgnoreOperation == action) ? "ignored" : "error"; SecurityAudit("client %d attempted request %d with window 0x%x property %s (atom 0x%x) of client %d, %s\n", client->index, reqtype, pWin->drawable.id, diff --git a/Xext/xace.c b/Xext/xace.c index 7f7944a17..6fc5c12ee 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -99,7 +99,7 @@ int XaceHook(int hook, ...) va_arg(ap, WindowPtr), va_arg(ap, Atom), va_arg(ap, Mask), - SecurityAllowOperation /* default allow */ + XaceAllowOperation /* default allow */ }; calldata = &rec; prv = &rec.rval; diff --git a/Xext/xace.h b/Xext/xace.h index 6cb4b4f5d..7231b04bc 100644 --- a/Xext/xace.h +++ b/Xext/xace.h @@ -20,6 +20,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _XACE_H #define _XACE_H +/* Hook return codes */ +#define XaceErrorOperation 0 +#define XaceAllowOperation 1 +#define XaceIgnoreOperation 2 + +#ifdef XACE + #define XACE_EXTENSION_NAME "XAccessControlExtension" #define XACE_MAJOR_VERSION 1 #define XACE_MINOR_VERSION 0 @@ -75,11 +82,6 @@ extern int XaceHook( /* From the original Security extension... */ -/* Hook return codes */ -#define SecurityAllowOperation 0 -#define SecurityIgnoreOperation 1 -#define SecurityErrorOperation 2 - /* Proc vectors for untrusted clients, swapped and unswapped versions. * These are the same as the normal proc vectors except that extensions * that haven't declared themselves secure will have ProcBadRequest plugged @@ -100,4 +102,18 @@ extern void XaceCensorImage( char * pBuf ); +#else /* XACE */ + +/* Define calls away when XACE is not being built. */ + +#ifdef __GNUC__ +#define XaceHook(args...) XaceAllowOperation +#define XaceCensorImage(args...) { ; } +#else +#define XaceHook(...) XaceAllowOperation +#define XaceCensorImage(...) { ; } +#endif + +#endif /* XACE */ + #endif /* _XACE_H */ diff --git a/composite/compext.c b/composite/compext.c index a7ad4e2fd..13936fa18 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -269,7 +269,10 @@ ProcCompositeNameWindowPixmap (ClientPtr client) client->errorValue = stuff->window; return BadWindow; } - + + if (!pWin->viewable) + return BadMatch; + LEGAL_NEW_RESOURCE (stuff->pixmap, client); cw = GetCompWindow (pWin); diff --git a/config/config.c b/config/config.c index 05757e2c8..523327d04 100644 --- a/config/config.c +++ b/config/config.c @@ -36,10 +36,10 @@ /* the above comment lies. there is no better way. */ #include "input.h" #include "inputstr.h" -#include "config.h" +#include "hotplug.h" #include "os.h" -#define MATCH_RULE "type='method_call',interface='org.x.config.input'" +#define CONFIG_MATCH_RULE "type='method_call',interface='org.x.config.input'" #define MALFORMED_MSG "[config] malformed message, dropping" #define MALFORMED_MESSAGE() { DebugF(MALFORMED_MSG "\n"); \ @@ -50,18 +50,44 @@ ret = BadValue; \ goto unwind; } -static DBusConnection *configConnection = NULL; -static int configfd = -1; -static char busobject[32] = { 0 }; -static char busname[64] = { 0 }; +/* How often to attempt reconnecting when we get booted off the bus. */ +#define RECONNECT_DELAY 10000 /* in ms */ -void -configDispatch() +struct config_data { + int fd; + DBusConnection *connection; + char busobject[32]; + char busname[64]; +}; + +static struct config_data *configData; + +static CARD32 configReconnect(OsTimerPtr timer, CARD32 time, pointer arg); + +static void +configWakeupHandler(pointer blockData, int err, pointer pReadMask) { - if (!configConnection) - return; + struct config_data *data = blockData; - dbus_connection_read_write_dispatch(configConnection, 0); + if (data->connection && FD_ISSET(data->fd, (fd_set *) pReadMask)) + dbus_connection_read_write_dispatch(data->connection, 0); +} + +static void +configBlockHandler(pointer data, struct timeval **tv, pointer pReadMask) +{ +} + +static void +configTeardown(void) +{ + if (configData) { + RemoveGeneralSocket(configData->fd); + RemoveBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler, + configData); + xfree(configData); + configData = NULL; + } } static int @@ -217,23 +243,22 @@ configMessage(DBusConnection *connection, DBusMessage *message, void *closure) ret = configAddDevice(message, &iter, &error); else if (strcmp(dbus_message_get_member(message), "remove") == 0) ret = configRemoveDevice(message, &iter, &error); - } + if (ret != BadDrawable && ret != BadAlloc) { + reply = dbus_message_new_method_return(message); + dbus_message_iter_init_append(reply, &iter); - if (ret != BadDrawable && ret != BadAlloc) { - reply = dbus_message_new_method_return(message); - dbus_message_iter_init_append(reply, &iter); + if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret)) { + ErrorF("[config] couldn't append to iterator\n"); + dbus_error_free(&error); + return DBUS_HANDLER_RESULT_HANDLED; + } - if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32, &ret)) { - ErrorF("[config] couldn't append to iterator\n"); - dbus_error_free(&error); - return DBUS_HANDLER_RESULT_HANDLED; - } - - if (!dbus_connection_send(bus, reply, NULL)) - ErrorF("[config] failed to send reply\n"); - dbus_connection_flush(bus); + if (!dbus_connection_send(bus, reply, NULL)) + ErrorF("[config] failed to send reply\n"); + dbus_connection_flush(bus); - dbus_message_unref(reply); + dbus_message_unref(reply); + } } dbus_error_free(&error); @@ -246,71 +271,147 @@ configMessage(DBusConnection *connection, DBusMessage *message, void *closure) return DBUS_HANDLER_RESULT_HANDLED; } -void -configInitialise() +/** + * This is a filter, which only handles the disconnected signal, which + * doesn't go to the normal message handling function. This takes + * precedence over the message handling function, so have have to be + * careful to ignore anything we don't want to deal with here. + * + * Yes, this is brutally stupid. + */ +static DBusHandlerResult +configFilter(DBusConnection *connection, DBusMessage *message, void *closure) +{ + if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, + "Disconnected")) { + ErrorF("[dbus] disconnected from bus\n"); + TimerSet(NULL, 0, RECONNECT_DELAY, configReconnect, NULL); + configTeardown(); + return DBUS_HANDLER_RESULT_HANDLED; + } + + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +} + +static Bool +configSetup(void) { - DBusConnection *bus = NULL; DBusError error; DBusObjectPathVTable vtable = { .message_function = configMessage }; - configConnection = NULL; + if (!configData) + configData = (struct config_data *) xcalloc(sizeof(struct config_data), 1); + if (!configData) { + ErrorF("[dbus] failed to allocate data struct.\n"); + return FALSE; + } dbus_error_init(&error); - bus = dbus_bus_get(DBUS_BUS_SYSTEM, &error); - if (!bus || dbus_error_is_set(&error)) { + configData->connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error); + if (!configData->connection || dbus_error_is_set(&error)) { ErrorF("[dbus] some kind of error occurred: %s (%s)\n", error.name, error.message); dbus_error_free(&error); - return; + xfree(configData); + configData = NULL; + return FALSE; } - if (!dbus_connection_get_unix_fd(bus, &configfd)) { - dbus_connection_unref(bus); + dbus_connection_set_exit_on_disconnect(configData->connection, FALSE); + + if (!dbus_connection_get_unix_fd(configData->connection, &configData->fd)) { + dbus_connection_unref(configData->connection); ErrorF("[dbus] couldn't get fd for bus\n"); dbus_error_free(&error); - configfd = -1; - return; + xfree(configData); + configData = NULL; + return FALSE; } - snprintf(busname, sizeof(busname), "org.x.config.display%d", atoi(display)); - if (!dbus_bus_request_name(bus, busname, 0, &error) || - dbus_error_is_set(&error)) { + snprintf(configData->busname, sizeof(configData->busname), + "org.x.config.display%d", atoi(display)); + if (!dbus_bus_request_name(configData->connection, configData->busname, + 0, &error) || dbus_error_is_set(&error)) { ErrorF("[dbus] couldn't take over org.x.config: %s (%s)\n", error.name, error.message); dbus_error_free(&error); - dbus_connection_unref(bus); - configfd = -1; - return; + dbus_connection_unref(configData->connection); + xfree(configData); + configData = NULL; + return FALSE; } /* blocks until we get a reply. */ - dbus_bus_add_match(bus, MATCH_RULE, &error); + dbus_bus_add_match(configData->connection, CONFIG_MATCH_RULE, &error); if (dbus_error_is_set(&error)) { ErrorF("[dbus] couldn't match X.Org rule: %s (%s)\n", error.name, error.message); dbus_error_free(&error); - dbus_bus_release_name(bus, busname, &error); - dbus_connection_unref(bus); - configfd = -1; - return; + dbus_bus_release_name(configData->connection, configData->busname, + &error); + dbus_connection_unref(configData->connection); + xfree(configData); + configData = NULL; + return FALSE; + } + + if (!dbus_connection_add_filter(configData->connection, configFilter, + configData, NULL)) { + + ErrorF("[dbus] couldn't add signal filter: %s (%s)\n", error.name, + error.message); + dbus_error_free(&error); + dbus_bus_release_name(configData->connection, configData->busname, + &error); + dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE, + &error); + dbus_connection_unref(configData->connection); + xfree(configData); + configData = NULL; + return FALSE; } - snprintf(busobject, sizeof(busobject), "/org/x/config/%d", atoi(display)); - if (!dbus_connection_register_object_path(bus, busobject, &vtable, bus)) { + snprintf(configData->busobject, sizeof(configData->busobject), + "/org/x/config/%d", atoi(display)); + if (!dbus_connection_register_object_path(configData->connection, + configData->busobject, &vtable, + configData->connection)) { ErrorF("[dbus] couldn't register object path\n"); - configfd = -1; - dbus_bus_release_name(bus, busname, &error); - dbus_bus_remove_match(bus, MATCH_RULE, &error); - dbus_connection_unref(bus); + dbus_bus_release_name(configData->connection, configData->busname, + &error); + dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE, + &error); + dbus_connection_unref(configData->connection); dbus_error_free(&error); - return; + xfree(configData); + configData = NULL; + return FALSE; } - DebugF("[dbus] registered object path %s\n", busobject); + DebugF("[dbus] registered object path %s\n", configData->busobject); dbus_error_free(&error); - configConnection = bus; - AddGeneralSocket(configfd); + AddGeneralSocket(configData->fd); + + RegisterBlockAndWakeupHandlers(configBlockHandler, configWakeupHandler, + configData); + + return TRUE; +} + +static CARD32 +configReconnect(OsTimerPtr timer, CARD32 time, pointer arg) +{ + if (configSetup()) + return 0; + else + return RECONNECT_DELAY; +} + +void +configInitialise() +{ + TimerSet(NULL, 0, 1, configReconnect, NULL); } void @@ -318,27 +419,25 @@ configFini() { DBusError error; - if (configConnection) { + if (configData) { dbus_error_init(&error); - dbus_connection_unregister_object_path(configConnection, busobject); - dbus_bus_remove_match(configConnection, MATCH_RULE, &error); - dbus_bus_release_name(configConnection, busname, &error); - dbus_connection_unref(configConnection); - RemoveGeneralSocket(configfd); - configConnection = NULL; - configfd = -1; + dbus_connection_unregister_object_path(configData->connection, + configData->busobject); + dbus_connection_remove_filter(configData->connection, configFilter, + configData); + dbus_bus_remove_match(configData->connection, CONFIG_MATCH_RULE, + &error); + dbus_bus_release_name(configData->connection, configData->busname, + &error); + dbus_connection_unref(configData->connection); dbus_error_free(&error); + configTeardown(); } } #else /* !HAVE_DBUS */ void -configDispatch() -{ -} - -void configInitialise() { } diff --git a/configure.ac b/configure.ac index 2108db4d3..002be624c 100644 --- a/configure.ac +++ b/configure.ac @@ -174,7 +174,7 @@ AC_CACHE_CHECK([for SYSV IPC], [AC_TRY_LINK([ #include <sys/shm.h> ],[ -int main () { +{ int id; id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R); if (id < 0) return -1; @@ -391,7 +391,7 @@ AC_ARG_WITH(mesa-source, AS_HELP_STRING([--with-mesa-source=MESA_SOURCE], [P AC_ARG_WITH(fontdir, AS_HELP_STRING([--with-fontdir=FONTDIR], [Path to top level dir where fonts are installed (default: ${libdir}/X11/fonts)]), [ FONTDIR="$withval" ], [ FONTDIR="${libdir}/X11/fonts" ]) -DEFAULT_FONT_PATH="${FONTDIR}/misc/,${FONTDIR}/TTF/,${FONTDIR}/OTF,${FONTDIR}/Type1/,${FONTDIR}/CID/,${FONTDIR}/100dpi/,${FONTDIR}/75dpi/" +DEFAULT_FONT_PATH="${FONTDIR}/misc/,${FONTDIR}/TTF/,${FONTDIR}/OTF,${FONTDIR}/Type1/,${FONTDIR}/100dpi/,${FONTDIR}/75dpi/" AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]), [ FONTPATH="$withval" ], [ FONTPATH="${DEFAULT_FONT_PATH}" ]) @@ -545,7 +545,7 @@ XEXT_LIB='$(top_builddir)/Xext/libXext.la' XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la' dnl Core modules for most extensions, et al. -REQUIRED_MODULES="randrproto renderproto [fixesproto >= 4.0] damageproto xcmiscproto xextproto xproto xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4] [kbproto >= 1.0.3]" +REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] damageproto xcmiscproto xextproto xproto xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.4] [kbproto >= 1.0.3]" REQUIRED_LIBS="xfont xau fontenc" if test "x$DBUS" = xauto; then @@ -655,6 +655,9 @@ if test "x$DRI" = xyes; then PKG_CHECK_MODULES([DRIPROTO], [xf86driproto]) PKG_CHECK_MODULES([LIBDRM], [libdrm >= 2.3.0]) PKG_CHECK_MODULES([GL], [glproto >= 1.4.1]) + PKG_CHECK_EXISTS(libdrm >= 2.2.0, + [AC_DEFINE([HAVE_LIBDRM_2_2], 1, + [Has version 2.2 (or newer) of the drm library])]) AC_SUBST(DRIPROTO_CFLAGS) AC_SUBST(LIBDRM_CFLAGS) AC_SUBST(LIBDRM_LIBS) @@ -1056,7 +1059,7 @@ AC_MSG_RESULT([$XVFB]) AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) if test "x$XVFB" = xyes; then - XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" + XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB $LIBS" AC_SUBST([XVFB_LIBS]) fi @@ -1383,6 +1386,7 @@ dnl has it in libc), or if libdl is needed to get it. AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file]) AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path]) + AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path]) AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location]) AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) @@ -1758,13 +1762,11 @@ AM_CONDITIONAL(BUILD_KBD_MODE, [test x$BUILD_KBD_MODE = xyes]) AM_CONDITIONAL(BSD_KBD_MODE, [test x$KBD_MODE_TYPE = xbsd]) AM_CONDITIONAL(SUN_KBD_MODE, [test x$KBD_MODE_TYPE = xsun]) -CFLAGS="$XSERVER_CFLAGS $CFLAGS" -AC_SUBST([CFLAGS]) - BUILD_DATE="$(date +'%Y%m%d')" AC_SUBST([BUILD_DATE]) -DIX_CFLAGS="-DHAVE_DIX_CONFIG_H" +DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" + AC_SUBST([DIX_CFLAGS]) AC_SUBST([libdir exec_prefix prefix]) diff --git a/dix/Makefile.am b/dix/Makefile.am index d0d6e8785..a1f02c1b6 100644 --- a/dix/Makefile.am +++ b/dix/Makefile.am @@ -52,7 +52,7 @@ Xserver-dtrace.h: $(srcdir)/Xserver.d dtrace-dix.o: $(top_srcdir)/dix/Xserver.d $(am_libdix_la_OBJECTS) $(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o -noinst_LIBRARIES = dix.O +noinst_PROGRAMS = dix.O dix.O: dtrace-dix.o $(am_libdix_la_OBJECTS) ld -r -o $@ .libs/*.o diff --git a/dix/devices.c b/dix/devices.c index aa0486219..e6a504954 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -69,9 +69,7 @@ SOFTWARE. #ifdef XKB #include <X11/extensions/XKBsrv.h> #endif -#ifdef XACE #include "xace.h" -#endif #include "dispatch.h" #include "swaprep.h" @@ -1178,10 +1176,8 @@ DoSetModifierMapping(ClientPtr client, KeyCode *inputMap, } } -#ifdef XACE if (!XaceHook(XACE_DEVICE_ACCESS, client, pDev, TRUE)) return BadAccess; -#endif /* None of the modifiers (old or new) may be down while we change * the map. */ @@ -1302,14 +1298,12 @@ ProcChangeKeyboardMapping(ClientPtr client) return BadValue; } -#ifdef XACE for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->key) { if (!XaceHook(XACE_DEVICE_ACCESS, client, pDev, TRUE)) return BadAccess; } } -#endif keysyms.minKeyCode = stuff->firstKeyCode; keysyms.maxKeyCode = stuff->firstKeyCode + stuff->keyCodes - 1; @@ -1655,7 +1649,6 @@ ProcChangeKeyboardControl (ClientPtr client) if (client->req_len != (sizeof(xChangeKeyboardControlReq)>>2)+Ones(vmask)) return BadLength; -#ifdef XACE for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if ((pDev->coreEvents || pDev == inputInfo.keyboard) && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) { @@ -1663,7 +1656,6 @@ ProcChangeKeyboardControl (ClientPtr client) return BadAccess; } } -#endif for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if ((pDev->coreEvents || pDev == inputInfo.keyboard) && @@ -1920,15 +1912,13 @@ ProcQueryKeymap(ClientPtr client) rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.length = 2; -#ifdef XACE - if (!XaceHook(XACE_DEVICE_ACCESS, client, inputInfo.keyboard, TRUE)) - { - bzero((char *)&rep.map[0], 32); - } + + if (XaceHook(XACE_DEVICE_ACCESS, client, inputInfo.keyboard, TRUE)) + for (i = 0; i<32; i++) + rep.map[i] = down[i]; else -#endif - for (i = 0; i<32; i++) - rep.map[i] = down[i]; + bzero((char *)&rep.map[0], 32); + WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep); return Success; } diff --git a/dix/dispatch.c b/dix/dispatch.c index 26cb54445..0a761eb6c 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -130,14 +130,11 @@ int ProcInitialConnection(); #include "dispatch.h" #include "swaprep.h" #include "swapreq.h" -#include "config.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" #endif -#ifdef XACE #include "xace.h" -#endif #ifdef XAPPGROUP #include "appgroup.h" #endif @@ -428,9 +425,6 @@ Dispatch(void) nready = WaitForSomething(clientReady); - /* this is an enormous hack and NEEDS TO GO AWAY. */ - configDispatch(); - #ifdef SMART_SCHEDULE if (nready && !SmartScheduleDisable) { @@ -504,16 +498,11 @@ Dispatch(void) #endif if (result > (maxBigRequestSize << 2)) result = BadLength; - else -#ifdef XACE - { + else { XaceHook(XACE_AUDIT_BEGIN, client); result = (* client->requestVector[MAJOROP])(client); XaceHook(XACE_AUDIT_END, client, result); } -#else - result = (* client->requestVector[MAJOROP])(client); -#endif /* XACE */ #ifdef XSERVER_DTRACE XSERVER_REQUEST_DONE(GetRequestName(MAJOROP), MAJOROP, client->sequence, client->index, result); @@ -1166,14 +1155,11 @@ ProcConvertSelection(register ClientPtr client) i = 0; while ((i < NumCurrentSelections) && CurrentSelections[i].selection != stuff->selection) i++; - if ((i < NumCurrentSelections) && - (CurrentSelections[i].window != None) -#ifdef XACE - && XaceHook(XACE_RESOURCE_ACCESS, client, - CurrentSelections[i].window, RT_WINDOW, - SecurityReadAccess, CurrentSelections[i].pWin) -#endif - ) + if ((i < NumCurrentSelections) && + (CurrentSelections[i].window != None) && + XaceHook(XACE_RESOURCE_ACCESS, client, + CurrentSelections[i].window, RT_WINDOW, + SecurityReadAccess, CurrentSelections[i].pWin)) { event.u.u.type = SelectionRequest; event.u.selectionRequest.time = stuff->time; @@ -2163,9 +2149,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, Mask plane = 0; char *pBuf; xGetImageReply xgi; -#ifdef XACE RegionPtr pVisibleRegion = NULL; -#endif if ((format != XYPixmap) && (format != ZPixmap)) { @@ -2269,17 +2253,16 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, WriteReplyToClient(client, sizeof (xGetImageReply), &xgi); } -#ifdef XACE if (pDraw->type == DRAWABLE_WINDOW && !XaceHook(XACE_DRAWABLE_ACCESS, client, pDraw)) { pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw); if (pVisibleRegion) { - REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, -pDraw->x, -pDraw->y); + REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, + -pDraw->x, -pDraw->y); } } -#endif if (linesPerBuf == 0) { @@ -2299,12 +2282,10 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, format, planemask, (pointer) pBuf); -#ifdef XACE if (pVisibleRegion) XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y + linesDone, width, nlines, format, pBuf); -#endif /* Note that this is NOT a call to WriteSwappedDataToClient, as we do NOT byte swap */ @@ -2340,13 +2321,11 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, format, plane, (pointer)pBuf); -#ifdef XACE if (pVisibleRegion) XaceCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y + linesDone, width, nlines, format, pBuf); -#endif /* Note: NOT a call to WriteSwappedDataToClient, as we do NOT byte swap */ @@ -2368,10 +2347,8 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, } } } -#ifdef XACE if (pVisibleRegion) REGION_DESTROY(pDraw->pScreen, pVisibleRegion); -#endif if (!im_return) DEALLOCATE_LOCAL(pBuf); return (client->noClientException); @@ -3342,13 +3319,11 @@ ProcListHosts(register ClientPtr client) /* REQUEST(xListHostsReq); */ REQUEST_SIZE_MATCH(xListHostsReq); -#ifdef XACE + /* untrusted clients can't list hosts */ if (!XaceHook(XACE_HOSTLIST_ACCESS, client, SecurityReadAccess)) - { return BadAccess; - } -#endif + result = GetHosts(&pdata, &nHosts, &len, &reply.enabled); if (result != Success) return(result); diff --git a/dix/dixutils.c b/dix/dixutils.c index a395d4474..af7e1c8f1 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -95,9 +95,7 @@ Author: Adobe Systems Incorporated #include "scrnintstr.h" #define XK_LATIN1 #include <X11/keysymdef.h> -#ifdef XACE #include "xace.h" -#endif /* * CompareTimeStamps returns -1, 0, or +1 depending on if the first diff --git a/dix/events.c b/dix/events.c index e5701eec2..0a39dcd9e 100644 --- a/dix/events.c +++ b/dix/events.c @@ -137,9 +137,7 @@ of the copyright holder. extern Bool XkbFilterEvents(ClientPtr, int, xEvent *); #endif -#ifdef XACE #include "xace.h" -#endif #ifdef XSERVER_DTRACE #include <sys/types.h> @@ -2463,10 +2461,8 @@ CheckPassiveGrabsOnWindow( (grab->confineTo->realized && BorderSizeNotEmpty(grab->confineTo)))) { -#ifdef XACE if (!XaceHook(XACE_DEVICE_ACCESS, wClient(pWin), device, FALSE)) return FALSE; -#endif #ifdef XKB if (!noXkbExtension) { XE_KBPTR.state &= 0x1f00; @@ -2827,9 +2823,7 @@ drawable.id:0; if (deactivateGrab) (*keybd->DeactivateGrab)(keybd); -#ifdef XACE XaceHook(XACE_KEY_AVAIL, xE, keybd, count); -#endif } #ifdef XKB @@ -3253,17 +3247,13 @@ EnterLeaveEvent( if ((type == EnterNotify) && (mask & KeymapStateMask)) { xKeymapEvent ke; - -#ifdef XACE ClientPtr client = grab ? rClient(grab) : clients[CLIENT_ID(pWin->drawable.id)]; - if (!XaceHook(XACE_DEVICE_ACCESS, client, keybd, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } + if (XaceHook(XACE_DEVICE_ACCESS, client, keybd, FALSE)) + memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31); else -#endif - memmove((char *)&ke.map[0], (char *)&keybd->key->down[1], 31); + bzero((char *)&ke.map[0], 31); + ke.type = KeymapNotify; if (grab) (void)TryClientEvents(rClient(grab), (xEvent *)&ke, 1, mask, @@ -3349,15 +3339,12 @@ FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr ((pWin->eventMask | wOtherEventMasks(pWin)) & KeymapStateMask)) { xKeymapEvent ke; -#ifdef XACE ClientPtr client = clients[CLIENT_ID(pWin->drawable.id)]; - if (!XaceHook(XACE_DEVICE_ACCESS, client, dev, FALSE)) - { - bzero((char *)&ke.map[0], 31); - } + if (XaceHook(XACE_DEVICE_ACCESS, client, dev, FALSE)) + memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31); else -#endif - memmove((char *)&ke.map[0], (char *)&dev->key->down[1], 31); + bzero((char *)&ke.map[0], 31); + ke.type = KeymapNotify; (void)DeliverEventsToWindow(pWin, (xEvent *)&ke, 1, KeymapStateMask, NullGrab, 0); @@ -3620,10 +3607,10 @@ ProcSetInputFocus(client) REQUEST(xSetInputFocusReq); REQUEST_SIZE_MATCH(xSetInputFocusReq); -#ifdef XACE + if (!XaceHook(XACE_DEVICE_ACCESS, client, inputInfo.keyboard, TRUE)) return Success; -#endif + return SetInputFocus(client, inputInfo.keyboard, stuff->focus, stuff->revertTo, stuff->time, FALSE); } @@ -3885,18 +3872,17 @@ ProcGrabKeyboard(ClientPtr client) int result; REQUEST_SIZE_MATCH(xGrabKeyboardReq); -#ifdef XACE - if (!XaceHook(XACE_DEVICE_ACCESS, client, inputInfo.keyboard, TRUE)) - { + + if (XaceHook(XACE_DEVICE_ACCESS, client, inputInfo.keyboard, TRUE)) + result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode, + stuff->pointerMode, stuff->grabWindow, + stuff->ownerEvents, stuff->time, + KeyPressMask | KeyReleaseMask, &rep.status); + else { result = Success; rep.status = AlreadyGrabbed; } - else -#endif - result = GrabDevice(client, inputInfo.keyboard, stuff->keyboardMode, - stuff->pointerMode, stuff->grabWindow, - stuff->ownerEvents, stuff->time, - KeyPressMask | KeyReleaseMask, &rep.status); + if (result != Success) return result; rep.type = X_Reply; diff --git a/dix/extension.c b/dix/extension.c index fe779b2be..29cae8676 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -59,9 +59,7 @@ SOFTWARE. #include "gcstruct.h" #include "scrnintstr.h" #include "dispatch.h" -#ifdef XACE #include "xace.h" -#endif #define EXTENSION_BASE 128 #define EXTENSION_EVENT_BASE 64 @@ -256,11 +254,9 @@ GetExtensionEntry(int major) _X_EXPORT void DeclareExtensionSecurity(char *extname, Bool secure) { -#ifdef XACE int i = FindExtension(extname, strlen(extname)); if (i >= 0) XaceHook(XACE_DECLARE_EXT_SECURE, extensions[i], secure); -#endif } _X_EXPORT unsigned short @@ -336,12 +332,7 @@ ProcQueryExtension(ClientPtr client) else { i = FindExtension((char *)&stuff[1], stuff->nbytes); - if (i < 0 -#ifdef XACE - /* call callbacks to find out whether to show extension */ - || !XaceHook(XACE_EXT_ACCESS, client, extensions[i]) -#endif - ) + if (i < 0 || !XaceHook(XACE_EXT_ACCESS, client, extensions[i])) reply.present = xFalse; else { @@ -376,11 +367,10 @@ ProcListExtensions(ClientPtr client) for (i=0; i<NumExtensions; i++) { -#ifdef XACE /* call callbacks to find out whether to show extension */ if (!XaceHook(XACE_EXT_ACCESS, client, extensions[i])) continue; -#endif + total_length += strlen(extensions[i]->name) + 1; reply.nExtensions += 1 + extensions[i]->num_aliases; for (j = extensions[i]->num_aliases; --j >= 0;) @@ -393,10 +383,9 @@ ProcListExtensions(ClientPtr client) for (i=0; i<NumExtensions; i++) { int len; -#ifdef XACE if (!XaceHook(XACE_EXT_ACCESS, client, extensions[i])) continue; -#endif + *bufptr++ = len = strlen(extensions[i]->name); memmove(bufptr, extensions[i]->name, len); bufptr += len; diff --git a/dix/getevents.c b/dix/getevents.c index c1b8840f9..0150d6658 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -39,6 +39,7 @@ #include "cursorstr.h" #include "dixstruct.h" #include "globals.h" +#include "dixevents.h" #include "mipointer.h" #ifdef XKB @@ -47,10 +48,6 @@ extern Bool XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies); #endif -#ifdef XACE -#include "xace.h" -#endif - #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" @@ -487,6 +484,8 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, int num_events = 0, final_valuator = 0; CARD32 ms = 0; deviceKeyButtonPointer *kbp = NULL; + /* Thanks to a broken lib, we _always_ have to chase DeviceMotionNotifies + * with DeviceValuators. */ Bool sendValuators = (type == MotionNotify || flags & POINTER_ABSOLUTE); DeviceIntPtr cp = inputInfo.pointer; int x = 0, y = 0; @@ -503,15 +502,16 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, else num_events = 1; + if (type == MotionNotify && num_valuators <= 0) { + return 0; + } + /* Do we need to send a DeviceValuator event? */ - if ((num_valuators + first_valuator) > 2 && sendValuators) { + if (sendValuators) { if ((((num_valuators - 1) / 6) + 1) > MAX_VALUATOR_EVENTS) num_valuators = MAX_VALUATOR_EVENTS * 6; num_events += ((num_valuators - 1) / 6) + 1; } - else if (type == MotionNotify && num_valuators <= 0) { - return 0; - } final_valuator = num_valuators + first_valuator; @@ -543,7 +543,7 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, } else { if (pDev->coreEvents) - x = cp->valuator->lasty; + y = cp->valuator->lasty; else y = pDev->valuator->lasty; } @@ -617,7 +617,7 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, kbp->root_y = y; events++; - if (final_valuator > 2 && sendValuators) { + if (sendValuators) { kbp->deviceid |= MORE_EVENTS; clipValuators(pDev, first_valuator, num_valuators, valuators); events = getValuatorEvents(events, pDev, first_valuator, @@ -761,7 +761,7 @@ SwitchCorePointer(DeviceIntPtr pDev) * to shift the pointer to get it inside the new bounds. */ void -PostSyntheticMotion(int x, int y, int screenNum, unsigned long time) +PostSyntheticMotion(int x, int y, ScreenPtr pScreen, unsigned long time) { xEvent xE; @@ -770,8 +770,8 @@ PostSyntheticMotion(int x, int y, int screenNum, unsigned long time) will translate from sprite screen to screen 0 upon reentry to the DIX layer. */ if (!noPanoramiXExtension) { - x += panoramiXdataPtr[0].x - panoramiXdataPtr[screenNum].x; - y += panoramiXdataPtr[0].y - panoramiXdataPtr[screenNum].y; + x += panoramiXdataPtr[0].x - panoramiXdataPtr[pScreen->myNum].x; + y += panoramiXdataPtr[0].y - panoramiXdataPtr[pScreen->myNum].y; } #endif @@ -779,6 +779,7 @@ PostSyntheticMotion(int x, int y, int screenNum, unsigned long time) xE.u.u.type = MotionNotify; xE.u.keyButtonPointer.rootX = x; xE.u.keyButtonPointer.rootY = y; + xE.u.keyButtonPointer.time = time; (*inputInfo.pointer->public.processInputProc)(&xE, inputInfo.pointer, 1); } diff --git a/dix/main.c b/dix/main.c index 88d775571..3a77533a5 100644 --- a/dix/main.c +++ b/dix/main.c @@ -98,7 +98,7 @@ Equipment Corporation. #include <X11/fonts/font.h> #include "opaque.h" #include "servermd.h" -#include "config.h" +#include "hotplug.h" #include "site.h" #include "dixfont.h" #include "extnsionst.h" @@ -309,9 +309,9 @@ main(int argc, char *argv[], char *envp[]) DPMSPowerLevel = 0; #endif InitBlockAndWakeupHandlers(); - configInitialise(); /* Perform any operating system dependent initializations you'd like */ - OsInit(); + OsInit(); + configInitialise(); if(serverGeneration == 1) { CreateWellKnownSockets(); @@ -414,21 +414,24 @@ main(int argc, char *argv[], char *envp[]) ErrorF("failed to set default font path '%s'", defaultFontPath); } - if (!SetDefaultFont(defaultTextFont)) + if (!SetDefaultFont(defaultTextFont)) { FatalError("could not open default font '%s'", defaultTextFont); + } #ifdef NULL_ROOT_CURSOR cm.width = 0; cm.height = 0; cm.xhot = 0; cm.yhot = 0; - if (!(rootCursor = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0))) + if (!(rootCursor = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0))) { FatalError("could not create empty root cursor"); + } AddResource(FakeClientID(0), RT_CURSOR, (pointer)rootCursor); #else - if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0))) + if (!(rootCursor = CreateRootCursor(defaultCursorFont, 0))) { FatalError("could not open default cursor font '%s'", defaultCursorFont); + } #endif #ifdef DPMSExtension /* check all screens, looking for DPMS Capabilities */ @@ -452,13 +455,15 @@ main(int argc, char *argv[], char *envp[]) #ifdef PANORAMIX if (!noPanoramiXExtension) { - if (!PanoramiXCreateConnectionBlock()) + if (!PanoramiXCreateConnectionBlock()) { FatalError("could not create connection block info"); + } } else #endif { - if (!CreateConnectionBlock()) + if (!CreateConnectionBlock()) { FatalError("could not create connection block info"); + } } Dispatch(); diff --git a/dix/property.c b/dix/property.c index da983838f..00d485655 100644 --- a/dix/property.c +++ b/dix/property.c @@ -58,9 +58,7 @@ SOFTWARE. #include "dixstruct.h" #include "dispatch.h" #include "swaprep.h" -#ifdef XACE #include "xace.h" -#endif /***************************************************************** * Property Stuff @@ -118,27 +116,19 @@ ProcRotateProperties(ClientPtr client) return(BadAlloc); for (i = 0; i < stuff->nAtoms; i++) { -#ifdef XACE char action = XaceHook(XACE_PROPERTY_ACCESS, client, pWin, atoms[i], SecurityReadAccess|SecurityWriteAccess); -#endif - if (!ValidAtom(atoms[i]) -#ifdef XACE - || (SecurityErrorOperation == action) -#endif - ) - { + + if (!ValidAtom(atoms[i]) || (XaceErrorOperation == action)) { DEALLOCATE_LOCAL(props); client->errorValue = atoms[i]; return BadAtom; } -#ifdef XACE - if (SecurityIgnoreOperation == action) - { + if (XaceIgnoreOperation == action) { DEALLOCATE_LOCAL(props); return Success; } -#endif + for (j = i + 1; j < stuff->nAtoms; j++) if (atoms[j] == atoms[i]) { @@ -233,17 +223,15 @@ ProcChangeProperty(ClientPtr client) return(BadAtom); } -#ifdef XACE switch (XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property, - SecurityWriteAccess)) + SecurityWriteAccess)) { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom; - case SecurityIgnoreOperation: - return Success; + case XaceErrorOperation: + client->errorValue = stuff->property; + return BadAtom; + case XaceIgnoreOperation: + return Success; } -#endif err = ChangeWindowProperty(pWin, stuff->property, stuff->type, (int)format, (int)mode, len, (pointer)&stuff[1], TRUE); @@ -460,6 +448,7 @@ ProcGetProperty(ClientPtr client) unsigned long n, len, ind; WindowPtr pWin; xGetPropertyReply reply; + Mask access_mode = SecurityReadAccess; REQUEST(xGetPropertyReq); REQUEST_SIZE_MATCH(xGetPropertyReq); @@ -501,24 +490,18 @@ ProcGetProperty(ClientPtr client) if (!pProp) return NullPropertyReply(client, None, 0, &reply); -#ifdef XACE + if (stuff->delete) + access_mode |= SecurityDestroyAccess; + switch (XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property, + access_mode)) { - Mask access_mode = SecurityReadAccess; - - if (stuff->delete) - access_mode |= SecurityDestroyAccess; - switch(XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property, - access_mode)) - { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return NullPropertyReply(client, pProp->type, pProp->format, - &reply); - } + case XaceErrorOperation: + client->errorValue = stuff->property; + return BadAtom;; + case XaceIgnoreOperation: + return NullPropertyReply(client, pProp->type, pProp->format, &reply); } -#endif + /* If the request type and actual type don't match. Return the property information, but not the data. */ @@ -663,17 +646,15 @@ ProcDeleteProperty(register ClientPtr client) return (BadAtom); } -#ifdef XACE - switch(XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property, - SecurityDestroyAccess)) + switch (XaceHook(XACE_PROPERTY_ACCESS, client, pWin, stuff->property, + SecurityDestroyAccess)) { - case SecurityErrorOperation: - client->errorValue = stuff->property; - return BadAtom;; - case SecurityIgnoreOperation: - return Success; + case XaceErrorOperation: + client->errorValue = stuff->property; + return BadAtom;; + case XaceIgnoreOperation: + return Success; } -#endif result = DeleteProperty(pWin, stuff->property); if (client->noClientException != Success) diff --git a/dix/resource.c b/dix/resource.c index efb759e75..c2044601f 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -148,9 +148,7 @@ Equipment Corporation. #include "panoramiX.h" #include "panoramiXsrv.h" #endif -#ifdef XACE #include "xace.h" -#endif #include <assert.h> #ifdef XSERVER_DTRACE @@ -904,11 +902,10 @@ SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) break; } } -#ifdef XACE if (retval && client && !XaceHook(XACE_RESOURCE_ACCESS, client, id, rtype, mode, retval)) retval = NULL; -#endif + return retval; } @@ -932,11 +929,10 @@ SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) break; } } -#ifdef XACE if (retval && client && !XaceHook(XACE_RESOURCE_ACCESS, client, id, res->type, mode, retval)) retval = NULL; -#endif + return retval; } diff --git a/dix/window.c b/dix/window.c index f0079e09d..fa6906f2a 100644 --- a/dix/window.c +++ b/dix/window.c @@ -126,9 +126,7 @@ Equipment Corporation. #ifdef XAPPGROUP #include "appgroup.h" #endif -#ifdef XACE #include "xace.h" -#endif /****** * Window stuff for server @@ -531,9 +529,7 @@ InitRootWindow(WindowPtr pWin) /* We SHOULD check for an error value here XXX */ (*pScreen->ChangeWindowAttributes)(pWin, backFlag); -#ifdef XACE XaceHook(XACE_WINDOW_INIT, serverClient, pWin); -#endif MapWindow(pWin, serverClient); } @@ -738,18 +734,16 @@ CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w, } pWin->borderWidth = bw; -#ifdef XACE + /* can't let untrusted clients have background None windows; * they make it too easy to steal window contents */ - if (!XaceHook(XACE_BACKGRND_ACCESS, client, pWin)) - { + if (XaceHook(XACE_BACKGRND_ACCESS, client, pWin)) + pWin->backgroundState = None; + else { pWin->backgroundState = BackgroundPixel; pWin->background.pixel = 0; } - else -#endif - pWin->backgroundState = None; pWin->borderIsPixel = pParent->borderIsPixel; pWin->border = pParent->border; @@ -769,9 +763,7 @@ CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w, REGION_NULL(pScreen, &pWin->winSize); REGION_NULL(pScreen, &pWin->borderSize); -#ifdef XACE XaceHook(XACE_WINDOW_INIT, client, pWin); -#endif pHead = RealChildHead(pParent); if (pHead) @@ -1036,24 +1028,18 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt borderRelative = TRUE; if (pixID == None) { -#ifdef XACE /* can't let untrusted clients have background None windows */ - if (XaceHook(XACE_BACKGRND_ACCESS, client, pWin)) - { -#endif - if (pWin->backgroundState == BackgroundPixmap) - (*pScreen->DestroyPixmap)(pWin->background.pixmap); - if (!pWin->parent) - MakeRootTile(pWin); - else - pWin->backgroundState = None; -#ifdef XACE - } - else - { /* didn't change the background to None, so don't tell ddx */ + if (XaceHook(XACE_BACKGRND_ACCESS, client, pWin)) { + if (pWin->backgroundState == BackgroundPixmap) + (*pScreen->DestroyPixmap)(pWin->background.pixmap); + if (!pWin->parent) + MakeRootTile(pWin); + else + pWin->backgroundState = None; + } else { + /* didn't change the backgrnd to None, so don't tell ddx */ index2 = 0; } -#endif } else if (pixID == ParentRelative) { @@ -2739,11 +2725,9 @@ MapWindow(register WindowPtr pWin, ClientPtr client) if (pWin->mapped) return(Success); -#ifdef XACE /* general check for permission to map window */ if (!XaceHook(XACE_MAP_ACCESS, client, pWin)) return Success; -#endif pScreen = pWin->drawable.pScreen; if ( (pParent = pWin->parent) ) @@ -1342,6 +1342,9 @@ void fbClearVisualTypes(void); Bool +fbHasVisualTypes (int depth); + +Bool fbSetVisualTypes (int depth, int visuals, int bitsPerRGB); Bool diff --git a/hw/dmx/config/Makefile.am b/hw/dmx/config/Makefile.am index fbc7f35a1..c31e04942 100644 --- a/hw/dmx/config/Makefile.am +++ b/hw/dmx/config/Makefile.am @@ -27,7 +27,7 @@ endif AM_YFLAGS = -d AM_CFLAGS = \ - \ + $(DIX_CFLAGS) \ -I$(top_srcdir)/hw/dmx \ $(GLX_INCS) \ -DHAVE_DMX_CONFIG_H \ diff --git a/hw/dmx/glxProxy/Makefile.am b/hw/dmx/glxProxy/Makefile.am index 2f4a3b708..1fbc8d764 100644 --- a/hw/dmx/glxProxy/Makefile.am +++ b/hw/dmx/glxProxy/Makefile.am @@ -32,7 +32,7 @@ libglxproxy_a_SOURCES = compsize.c \ unpack.h AM_CFLAGS = \ - \ + $(DIX_CFLAGS) \ -I$(top_srcdir)/hw/dmx \ -I$(top_srcdir)/include \ -I$(top_srcdir)/GL/include \ diff --git a/hw/dmx/input/Makefile.am b/hw/dmx/input/Makefile.am index 326506e77..da8de0546 100644 --- a/hw/dmx/input/Makefile.am +++ b/hw/dmx/input/Makefile.am @@ -60,7 +60,7 @@ GLX_DEFS = @GL_CFLAGS@ GLX_INCS = -I@MESA_SOURCE@/include endif -AM_CFLAGS = \ +AM_CFLAGS = $(DIX_CFLAGS) \ -I$(top_srcdir)/hw/dmx \ -I$(top_srcdir)/hw/xfree86/common \ $(GLX_INCS) \ diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c index b7571f66e..ad9907a59 100644 --- a/hw/kdrive/linux/keyboard.c +++ b/hw/kdrive/linux/keyboard.c @@ -745,14 +745,11 @@ LinuxKeyboardEnable (KdKeyboardInfo *ki) cfsetispeed(&nTty, 9600); cfsetospeed(&nTty, 9600); tcsetattr(fd, TCSANOW, &nTty); - /* Our kernel cleverly ignores O_NONBLOCK. Sigh. */ -#if 0 /* * Flush any pending keystrokes */ while ((n = read (fd, buf, sizeof (buf))) > 0) ; -#endif KdRegisterFd (fd, LinuxKeyboardRead, ki); return Success; } diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c index 44b4b5413..41b74fabd 100644 --- a/hw/kdrive/linux/tslib.c +++ b/hw/kdrive/linux/tslib.c @@ -75,10 +75,7 @@ TsRead (int fd, void *closure) while (ts_read(private->tsDev, &event, 1) == 1) { if (event.pressure) { - if (event.pressure > pi->dixdev->absolute->button_threshold) - flags = KD_BUTTON_8; - else - flags = KD_BUTTON_1; + flags = KD_BUTTON_1; /* * Here we test for the touch screen driver actually being on the @@ -113,9 +110,8 @@ TsRead (int fd, void *closure) static Status TslibEnable (KdPointerInfo *pi) { - struct TslibPrivate *private = pi->driverPrivate; + struct TslibPrivate *private = pi->driverPrivate; - private->holdThumbEvents = 1; private->raw_event_hook = NULL; private->raw_event_closure = NULL; private->tsDev = ts_open(pi->path, 0); @@ -126,9 +122,6 @@ TslibEnable (KdPointerInfo *pi) close(private->fd); return BadAlloc; } - if (pi->dixdev && pi->dixdev->absolute && - pi->dixdev->absolute->button_threshold == 0) - pi->dixdev->absolute->button_threshold = 115; KdRegisterFd(private->fd, TsRead, pi); @@ -141,12 +134,12 @@ TslibDisable (KdPointerInfo *pi) { struct TslibPrivate *private = pi->driverPrivate; - if (private->fd) { - KdUnregisterFd(pi, private->fd); - close(private->fd); - } + if (private->fd) + KdUnregisterFd(pi, private->fd, TRUE); + if (private->tsDev) ts_close(private->tsDev); + private->fd = 0; private->tsDev = NULL; } @@ -156,7 +149,6 @@ static Status TslibInit (KdPointerInfo *pi) { int fd = 0, i = 0; - char devpath[PATH_MAX], devname[TS_NAME_SIZE]; DIR *inputdir = NULL; struct dirent *inputent = NULL; struct tsdev *tsDev = NULL; diff --git a/hw/kdrive/mga/g400_composite.c b/hw/kdrive/mga/g400_composite.c index 671e517fb..da2e8b810 100644 --- a/hw/kdrive/mga/g400_composite.c +++ b/hw/kdrive/mga/g400_composite.c @@ -286,10 +286,8 @@ mgaCheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, if (pMaskPicture->componentAlpha) MGA_FALLBACK(("Component alpha unsupported")); - switch (pDstPicture->format) { - case PICT_a8: + if (pDstPicture->format == PICT_a8) MGA_FALLBACK(("render to A8 unsupported")); - } return TRUE; } diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index baab5ca22..2a0151f57 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -21,8 +21,8 @@ Xvfb_LDFLAGS = AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ -DNO_HW_ONLY_EXTS \ -DNO_MODULE_EXTS \ - \ - $(XVFBMODULES_CFLAGS) + $(XVFBMODULES_CFLAGS) \ + $(DIX_CFLAGS) # Man page include $(top_srcdir)/cpprules.in diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index 72befea19..0c1306f09 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -22,7 +22,7 @@ DIST_SUBDIRS = common ddc dummylib i2c x86emu int10 fbdevhw os-support \ bin_PROGRAMS = Xorg -AM_CFLAGS = @XORG_CFLAGS@ +AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ Xorg_SOURCES = xorg.c @@ -93,7 +93,6 @@ CPP_FILES_FLAGS = \ -DMISCFONTPATH="\"$(BASE_FONT_PATH)/misc\"" \ -DT1FONTPATH="\"$(BASE_FONT_PATH)/Type1\"" \ -DTRUETYPEFONTPATH="\"$(BASE_FONT_PATH)/TTF\"" \ - -DCIDFONTPATH="\"$(BASE_FONT_PATH)/CID\"" \ -DDPI75FONTPATH="\"$(BASE_FONT_PATH)/75dpi\"" \ -DDPI100FONTPATH="\"$(BASE_FONT_PATH)/100dpi\"" \ -DMODULEPATH=\"$(DEFAULT_MODULE_PATH)\" diff --git a/hw/xfree86/common/Makefile.am b/hw/xfree86/common/Makefile.am index 6ad8566e0..d15e99a51 100644 --- a/hw/xfree86/common/Makefile.am +++ b/hw/xfree86/common/Makefile.am @@ -94,4 +94,4 @@ if LNXACPI XORG_CFLAGS += -DHAVE_ACPI endif -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index a330fadf4..ea995eda1 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -118,7 +118,7 @@ extern int ffs(unsigned long); # if defined(NO_INLINE) || defined(DO_PROTOTYPES) # if !defined(__arm__) -# if !defined(__sparc__) && !defined(__arm32__) \ +# if !defined(__sparc__) && !defined(__sparc) && !defined(__arm32__) \ && !(defined(__alpha__) && defined(linux)) \ && !(defined(__ia64__) && defined(linux)) \ @@ -1697,7 +1697,7 @@ static __inline__ void ppc_flush_icache(char *addr) : : "r"(addr) : "memory"); } -# elif defined(__sparc__) || defined(sparc) +# elif defined(__sparc__) || defined(sparc) || defined(__sparc) /* * Like powerpc, we provide byteswapping and no byteswapping functions * here with byteswapping as default, drivers that don't need byteswapping diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 51125304e..169a957d2 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -64,7 +64,7 @@ extern ScrnInfoPtr xf86CurrentScreen; extern Bool pciSlotClaimed; extern Bool isaSlotClaimed; extern Bool fbSlotClaimed; -#ifdef __sparc__ +#if defined(__sparc__) || defined(__sparc) extern Bool sbusSlotClaimed; #endif extern confDRIRec xf86ConfigDRI; @@ -418,6 +418,15 @@ void xf86PruneDriverModes(ScrnInfoPtr scrp); void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags); void xf86PrintModes(ScrnInfoPtr scrp); void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges); +double xf86ModeHSync(DisplayModePtr mode); +double xf86ModeVRefresh(DisplayModePtr mode); +void xf86SetModeDefaultName(DisplayModePtr mode); +void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags); +DisplayModePtr xf86DuplicateMode(DisplayModePtr pMode); +DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList); +Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2); +void xf86PrintModeline(int scrnIndex,DisplayModePtr mode); +DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new); /* xf86Option.c */ diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index e20837851..7617bf78a 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -113,7 +113,7 @@ void xf86BusProbe(void) { xf86PciProbe(); -#if defined(__sparc__) && !defined(__OpenBSD__) +#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) xf86SbusProbe(); #endif } @@ -2373,7 +2373,7 @@ xf86PostProbe(void) if (fbSlotClaimed) { if (pciSlotClaimed || isaSlotClaimed -#if defined(__sparc__) && !defined(__OpenBSD__) +#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) || sbusSlotClaimed #endif ) { @@ -3006,7 +3006,7 @@ xf86FindPrimaryDevice() } -#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) +#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) #include "vgaHW.h" #include "compiler.h" #endif @@ -3018,7 +3018,7 @@ static void CheckGenericGA() { /* This needs to be changed for multiple domains */ -#if !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__arm__) && !defined(__s390__) +#if !defined(__sparc__) && !defined(__sparc) && !defined(__powerpc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__arm__) && !defined(__s390__) IOADDRESS GenericIOBase = VGAHW_GET_IOBASE(); CARD8 CurrentValue, TestValue; diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h index b7d16089c..b638e9026 100644 --- a/hw/xfree86/common/xf86Bus.h +++ b/hw/xfree86/common/xf86Bus.h @@ -40,7 +40,7 @@ #define _XF86_BUS_H #include "xf86pciBus.h" -#ifdef __sparc__ +#if defined(__sparc__) || defined(__sparc) #include "xf86sbusBus.h" #endif diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index f1f173dd8..f71486c9d 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -48,7 +48,7 @@ #include "Configint.h" #include "vbe.h" #include "xf86DDC.h" -#if defined(__sparc__) && !defined(__OpenBSD__) +#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) #include "xf86Bus.h" #include "xf86Sbus.h" #endif @@ -57,7 +57,7 @@ typedef struct _DevToConfig { GDevRec GDev; pciVideoPtr pVideo; -#if defined(__sparc__) && !defined(__OpenBSD__) +#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) sbusDevicePtr sVideo; #endif int iDriver; @@ -134,7 +134,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int if (!DevToConfig[i].pVideo) return NULL; break; -#if defined(__sparc__) && !defined(__OpenBSD__) +#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) case BUS_SBUS: for (i = 0; i < nDevToConfig; i++) if (DevToConfig[i].sVideo && @@ -213,7 +213,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int NewDevice.GDev.identifier = "ISA Adapter"; NewDevice.GDev.busID = "ISA"; break; -#if defined(__sparc__) && !defined(__OpenBSD__) +#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) case BUS_SBUS: { char *promPath = NULL; NewDevice.sVideo = (sbusDevicePtr) busData; diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 5469426f2..05e62f184 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -789,8 +789,6 @@ xf86ReleaseKeys(DeviceIntPtr pDev) xEvent ke; int i = 0, j = 0, nevents = 0; - ErrorF("releasekeys: called on device %s (%d)\n", pDev->name, pDev->id); - if (!pDev || !pDev->key) return; diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 33351f2c1..ff878d59c 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -100,6 +100,8 @@ static void xf86PrintBanner(void); static void xf86PrintMarkers(void); +static void xf86PrintDefaultModulePath(void); +static void xf86PrintDefaultLibraryPath(void); static void xf86RunVtInit(void); #ifdef __UNIXOS2__ @@ -1376,6 +1378,16 @@ ddxProcessArgument(int argc, char **argv, int i) xf86PrintBanner(); exit(0); } + if (!strcmp(argv[i],"-showDefaultModulePath")) + { + xf86PrintDefaultModulePath(); + exit(0); + } + if (!strcmp(argv[i],"-showDefaultLibPath")) + { + xf86PrintDefaultLibraryPath(); + exit(0); + } /* Notice the -fp flag, but allow it to pass to the dix layer */ if (!strcmp(argv[i], "-fp")) { @@ -1625,6 +1637,8 @@ ddxUseMsg() ErrorF("-ignoreABI make module ABI mismatches non-fatal\n"); ErrorF("-isolateDevice bus_id restrict device resets to bus_id (PCI only)\n"); ErrorF("-version show the server version\n"); + ErrorF("-showDefaultModulePath show the server default module path\n"); + ErrorF("-showDefaultLibPath show the server default library path\n"); /* OS-specific usage */ xf86UseMsg(); ErrorF("\n"); @@ -1748,6 +1762,18 @@ xf86PrintMarkers() } static void +xf86PrintDefaultModulePath(void) +{ + ErrorF("%s\n", DEFAULT_MODULE_PATH); +} + +static void +xf86PrintDefaultLibraryPath(void) +{ + ErrorF("%s\n", DEFAULT_LIBRARY_PATH); +} + +static void xf86RunVtInit(void) { int i; diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index 456331d3f..3cebac754 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -368,8 +368,9 @@ xf86HandleBuiltinMode(ScrnInfoPtr scrp, return MODE_OK; } -static double -ModeHSync(DisplayModePtr mode) +/** Calculates the horizontal sync rate of a mode */ +_X_EXPORT double +xf86ModeHSync(DisplayModePtr mode) { double hsync = 0.0; @@ -381,8 +382,9 @@ ModeHSync(DisplayModePtr mode) return hsync; } -static double -ModeVRefresh(DisplayModePtr mode) +/** Calculates the vertical refresh rate of a mode */ +_X_EXPORT double +xf86ModeVRefresh(DisplayModePtr mode) { double refresh = 0.0; @@ -400,6 +402,16 @@ ModeVRefresh(DisplayModePtr mode) return refresh; } +/** Sets a default mode name of <width>x<height> on a mode. */ +_X_EXPORT void +xf86SetModeDefaultName(DisplayModePtr mode) +{ + if (mode->name != NULL) + xfree(mode->name); + + mode->name = XNFprintf("%dx%d", mode->HDisplay, mode->VDisplay); +} + /* * xf86LookupMode * @@ -529,7 +541,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, ModePrivFlags = cp->PrivFlags; break; } - refresh = ModeVRefresh(p); + refresh = xf86ModeVRefresh(p); if (p->Flags & V_INTERLACE) refresh /= INTERLACE_REFRESH_WEIGHT; if (refresh > bestRefresh) { @@ -570,7 +582,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, found = TRUE; if (strategy == LOOKUP_BEST_REFRESH) { - refresh = ModeVRefresh(p); + refresh = xf86ModeVRefresh(p); if (p->Flags & V_INTERLACE) refresh /= INTERLACE_REFRESH_WEIGHT; if (refresh > bestRefresh) { @@ -674,7 +686,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, * Initialises the Crtc parameters for a mode. The initialisation includes * adjustments for interlaced and double scan modes. */ -static void +_X_EXPORT void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags) { if ((p == NULL) || ((p->type & M_T_CRTC_C) == M_T_BUILTIN)) @@ -756,6 +768,87 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags) } } +/** + * Allocates and returns a copy of pMode, including pointers within pMode. + */ +_X_EXPORT DisplayModePtr +xf86DuplicateMode(DisplayModePtr pMode) +{ + DisplayModePtr pNew; + + pNew = xnfalloc(sizeof(DisplayModeRec)); + *pNew = *pMode; + pNew->next = NULL; + pNew->prev = NULL; + if (pNew->name == NULL) { + xf86SetModeDefaultName(pMode); + } else { + pNew->name = xnfstrdup(pMode->name); + } + + return pNew; +} + +/** + * Duplicates every mode in the given list and returns a pointer to the first + * mode. + * + * \param modeList doubly-linked mode list + */ +_X_EXPORT DisplayModePtr +xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList) +{ + DisplayModePtr first = NULL, last = NULL; + DisplayModePtr mode; + + for (mode = modeList; mode != NULL; mode = mode->next) { + DisplayModePtr new; + + new = xf86DuplicateMode(mode); + + /* Insert pNew into modeList */ + if (last) { + last->next = new; + new->prev = last; + } else { + first = new; + new->prev = NULL; + } + new->next = NULL; + last = new; + } + + return first; +} + +/** + * Returns true if the given modes should program to the same timings. + * + * This doesn't use Crtc values, as it might be used on ModeRecs without the + * Crtc values set. So, it's assumed that the other numbers are enough. + */ +_X_EXPORT Bool +xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2) +{ + if (pMode1->Clock == pMode2->Clock && + pMode1->HDisplay == pMode2->HDisplay && + pMode1->HSyncStart == pMode2->HSyncStart && + pMode1->HSyncEnd == pMode2->HSyncEnd && + pMode1->HTotal == pMode2->HTotal && + pMode1->HSkew == pMode2->HSkew && + pMode1->VDisplay == pMode2->VDisplay && + pMode1->VSyncStart == pMode2->VSyncStart && + pMode1->VSyncEnd == pMode2->VSyncEnd && + pMode1->VTotal == pMode2->VTotal && + pMode1->VScan == pMode2->VScan && + pMode1->Flags == pMode2->Flags) + { + return TRUE; + } else { + return FALSE; + } +} + /* * xf86CheckModeForMonitor * @@ -789,7 +882,7 @@ xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor) if (monitor->nHsync > 0) { /* Check hsync against the allowed ranges */ - float hsync = ModeHSync(mode); + float hsync = xf86ModeHSync(mode); for (i = 0; i < monitor->nHsync; i++) if ((hsync > monitor->hsync[i].lo * (1.0 - SYNC_TOLERANCE)) && (hsync < monitor->hsync[i].hi * (1.0 + SYNC_TOLERANCE))) @@ -802,7 +895,7 @@ xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor) if (monitor->nVrefresh > 0) { /* Check vrefresh against the allowed ranges */ - float vrefrsh = ModeVRefresh(mode); + float vrefrsh = xf86ModeVRefresh(mode); for (i = 0; i < monitor->nVrefresh; i++) if ((vrefrsh > monitor->vrefresh[i].lo * (1.0 - SYNC_TOLERANCE)) && (vrefrsh < monitor->vrefresh[i].hi * (1.0 + SYNC_TOLERANCE))) @@ -1033,8 +1126,8 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, / (mode->CrtcHTotal * mode->CrtcVTotal); } - mode->HSync = ModeHSync(mode); - mode->VRefresh = ModeVRefresh(mode); + mode->HSync = xf86ModeHSync(mode); + mode->VRefresh = xf86ModeVRefresh(mode); /* Assume it is OK */ return MODE_OK; @@ -1572,7 +1665,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, "TargetRefresh", 0.0); if (targetRefresh > 0.0) { for (p = scrp->modePool; p != NULL; p = p->next) { - if (ModeVRefresh(p) > targetRefresh * (1.0 - SYNC_TOLERANCE)) + if (xf86ModeVRefresh(p) > targetRefresh * (1.0 - SYNC_TOLERANCE)) break; } if (!p) @@ -1661,7 +1754,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, * If there is a target refresh rate, skip modes that * don't match up. */ - if (ModeVRefresh(q) < + if (xf86ModeVRefresh(q) < (1.0 - SYNC_TOLERANCE) * targetRefresh) continue; @@ -1981,8 +2074,8 @@ add(char **p, char *new) strcat(*p, new); } -static void -PrintModeline(int scrnIndex,DisplayModePtr mode) +_X_EXPORT void +xf86PrintModeline(int scrnIndex,DisplayModePtr mode) { char tmp[256]; char *flags = xnfcalloc(1, 1); @@ -2037,8 +2130,8 @@ xf86PrintModes(ScrnInfoPtr scrp) do { desc = desc2 = ""; - hsync = ModeHSync(p); - refresh = ModeVRefresh(p); + hsync = xf86ModeHSync(p); + refresh = xf86ModeVRefresh(p); if (p->Flags & V_INTERLACE) { desc = " (I)"; } @@ -2081,7 +2174,31 @@ xf86PrintModes(ScrnInfoPtr scrp) p->SynthClock / 1000.0, hsync, refresh, desc, desc2); } if (hsync != 0 && refresh != 0) - PrintModeline(scrp->scrnIndex,p); + xf86PrintModeline(scrp->scrnIndex,p); p = p->next; } while (p != NULL && p != scrp->modes); } + +/** + * Adds the new mode into the mode list, and returns the new list + * + * \param modes doubly-linked mode list. + */ +_X_EXPORT DisplayModePtr +xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new) +{ + if (modes == NULL) + return new; + + if (new) { + DisplayModePtr mode = modes; + + while (mode->next) + mode = mode->next; + + mode->next = new; + new->prev = mode; + } + + return modes; +} diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index be3368dff..16e330d43 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -90,16 +90,6 @@ #include "mi.h" -/****************************************************************************** - * debugging macro - *****************************************************************************/ -#ifdef DEBUG -static int debug_level = 0; -#define DBG(lvl, f) {if ((lvl) <= debug_level) f;} -#else -#define DBG(lvl, f) -#endif - xEvent *xf86Events = NULL; static Bool @@ -140,33 +130,6 @@ xf86ProcessCommonOptions(LocalDevicePtr local, } } -void -xf86AlwaysCoreControl(DeviceIntPtr pDev, IntegerCtrl *control) -{ -} - -/*********************************************************************** - * - * xf86XinputFinalizeInit -- - * - * Create and initialize an integer feedback to control the always - * core feature. - * - *********************************************************************** - */ -void -xf86XinputFinalizeInit(DeviceIntPtr dev) -{ - LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate; - - if (InitIntegerFeedbackClassDeviceStruct(dev, xf86AlwaysCoreControl) == FALSE) { - ErrorF("Unable to init integer feedback for always core feature\n"); - } else { - local->always_core_feedback = dev->intfeed; - dev->intfeed->ctrl.integer_displayed = (local->flags & XI86_ALWAYS_CORE) ? 1 : 0; - } -} - /*********************************************************************** * * xf86ActivateDevice -- @@ -193,8 +156,6 @@ xf86ActivateDevice(LocalDevicePtr local) dev->public.devicePrivate = (pointer) local; local->dev = dev; - xf86XinputFinalizeInit(dev); - dev->coreEvents = local->flags & XI86_ALWAYS_CORE; RegisterOtherDevice(dev); @@ -435,9 +396,9 @@ xf86PostMotionEvent(DeviceIntPtr device, va_list var; int i = 0, nevents = 0; Bool drag = xf86SendDragEvents(device); - LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate; int *valuators = NULL; int flags = 0; + xEvent *xE = NULL; if (is_absolute) flags = POINTER_ABSOLUTE; @@ -460,8 +421,14 @@ xf86PostMotionEvent(DeviceIntPtr device, flags, first_valuator, num_valuators, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(device, xf86Events + i); + for (i = 0; i < nevents; i++) { + xE = xf86Events + i; + /* Don't post core motion events for devices not registered to send + * drag events. */ + if (xE->u.u.type != MotionNotify || drag) { + mieqEnqueue(device, xf86Events + i); + } + } xfree(valuators); } diff --git a/hw/xfree86/ddc/Makefile.am b/hw/xfree86/ddc/Makefile.am index 7cfff4763..a04b5e8fe 100644 --- a/hw/xfree86/ddc/Makefile.am +++ b/hw/xfree86/ddc/Makefile.am @@ -4,10 +4,11 @@ module_LTLIBRARIES = libddc.la libddc_la_LDFLAGS = -avoid-version libddc_la_SOURCES = xf86DDC.c edid.c interpret_edid.c print_edid.c \ - interpret_vdif.c print_vdif.c ddcProperty.c + interpret_vdif.c print_vdif.c ddcProperty.c \ + edid_modes.c INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) EXTRA_DIST = ddcPriv.h DDC.HOWTO diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c index a1650bc03..11b5e26ed 100644 --- a/hw/xfree86/ddc/ddcProperty.c +++ b/hw/xfree86/ddc/ddcProperty.c @@ -32,391 +32,8 @@ #include "propertyst.h" #include "xf86DDC.h" -/* - * xf86Mode.c should have a some more DisplayModePtr list handling. - */ -static DisplayModePtr -xf86ModesAdd(DisplayModePtr Modes, DisplayModePtr Additions) -{ - if (!Modes) { - if (Additions) - return Additions; - else - return NULL; - } - - if (Additions) { - DisplayModePtr Mode = Modes; - - while (Mode->next) - Mode = Mode->next; - - Mode->next = Additions; - Additions->prev = Mode; - } - - return Modes; -} - -static DisplayModePtr -xf86ModeCopy(DisplayModePtr Mode) -{ - DisplayModePtr New; - - if (!Mode) - return NULL; - - New = xnfalloc(sizeof(DisplayModeRec)); - - memcpy(New, Mode, sizeof(DisplayModeRec)); - - New->name = xnfalloc(strlen(Mode->name) + 1); - memcpy(New->name, Mode->name, strlen(Mode->name) + 1); - - /* We ignore privates as DDC code doesn't use it currently */ - return New; -} - -/* - * Temporary. - */ -static void -add(char **p, char *new) -{ - *p = xnfrealloc(*p, strlen(*p) + strlen(new) + 2); - strcat(*p, " "); - strcat(*p, new); -} - -static void -PrintModeline(int scrnIndex,DisplayModePtr mode) -{ - char tmp[256]; - char *flags = xnfcalloc(1, 1); - - if (mode->HSkew) { - snprintf(tmp, 256, "hskew %i", mode->HSkew); - add(&flags, tmp); - } - if (mode->VScan) { - snprintf(tmp, 256, "vscan %i", mode->VScan); - add(&flags, tmp); - } - if (mode->Flags & V_INTERLACE) add(&flags, "interlace"); - if (mode->Flags & V_CSYNC) add(&flags, "composite"); - if (mode->Flags & V_DBLSCAN) add(&flags, "doublescan"); - if (mode->Flags & V_BCAST) add(&flags, "bcast"); - if (mode->Flags & V_PHSYNC) add(&flags, "+hsync"); - if (mode->Flags & V_NHSYNC) add(&flags, "-hsync"); - if (mode->Flags & V_PVSYNC) add(&flags, "+vsync"); - if (mode->Flags & V_NVSYNC) add(&flags, "-vsync"); - if (mode->Flags & V_PCSYNC) add(&flags, "+csync"); - if (mode->Flags & V_NCSYNC) add(&flags, "-csync"); -#if 0 - if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2"); -#endif - xf86DrvMsgVerb(scrnIndex, X_INFO, 3, - "Modeline \"%s\" %6.2f %i %i %i %i %i %i %i %i%s\n", - mode->name, mode->Clock/1000., mode->HDisplay, - mode->HSyncStart, mode->HSyncEnd, mode->HTotal, - mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, - mode->VTotal, flags); - xfree(flags); -} - -/* - * TODO: - * - for those with access to the VESA DMT standard; review please. - */ -#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DRIVER -#define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0 - -DisplayModeRec DDCEstablishedModes[17] = { - { MODEPREFIX("800x600"), 40000, 800, 840, 968, 1056, 0, 600, 601, 605, 628, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@60Hz */ - { MODEPREFIX("800x600"), 36000, 800, 824, 896, 1024, 0, 600, 601, 603, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@56Hz */ - { MODEPREFIX("640x480"), 31500, 640, 656, 720, 840, 0, 480, 481, 484, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@75Hz */ - { MODEPREFIX("640x480"), 31500, 640, 664, 704, 832, 0, 480, 489, 491, 520, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@72Hz */ - { MODEPREFIX("640x480"), 30240, 640, 704, 768, 864, 0, 480, 483, 486, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@67Hz */ - { MODEPREFIX("640x480"), 25200, 640, 656, 752, 800, 0, 480, 490, 492, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@60Hz */ - { MODEPREFIX("720x400"), 35500, 720, 738, 846, 900, 0, 400, 421, 423, 449, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 720x400@88Hz */ - { MODEPREFIX("720x400"), 28320, 720, 738, 846, 900, 0, 400, 412, 414, 449, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, /* 720x400@70Hz */ - { MODEPREFIX("1280x1024"), 135000, 1280, 1296, 1440, 1688, 0, 1024, 1025, 1028, 1066, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1280x1024@75Hz */ - { MODEPREFIX("1024x768"), 78800, 1024, 1040, 1136, 1312, 0, 768, 769, 772, 800, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1024x768@75Hz */ - { MODEPREFIX("1024x768"), 75000, 1024, 1048, 1184, 1328, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 1024x768@70Hz */ - { MODEPREFIX("1024x768"), 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 1024x768@60Hz */ - { MODEPREFIX("1024x768"), 44900, 1024, 1032, 1208, 1264, 0, 768, 768, 776, 817, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX }, /* 1024x768@43Hz */ - { MODEPREFIX("832x624"), 57284, 832, 864, 928, 1152, 0, 624, 625, 628, 667, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 832x624@75Hz */ - { MODEPREFIX("800x600"), 49500, 800, 816, 896, 1056, 0, 600, 601, 604, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@75Hz */ - { MODEPREFIX("800x600"), 50000, 800, 856, 976, 1040, 0, 600, 637, 643, 666, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@72Hz */ - { MODEPREFIX("1152x864"), 108000, 1152, 1216, 1344, 1600, 0, 864, 865, 868, 900, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1152x864@75Hz */ -}; - -static DisplayModePtr -DDCModesFromEstablished(int scrnIndex, struct established_timings *timing) -{ - DisplayModePtr Modes = NULL, Mode = NULL; - CARD32 bits = (timing->t1) | (timing->t2 << 8) | - ((timing->t_manu & 0x80) << 9); - int i; - - for (i = 0; i < 17; i++) - if (bits & (0x01 << i)) { - Mode = xf86ModeCopy(&(DDCEstablishedModes[i])); - Modes = xf86ModesAdd(Modes, Mode); - } - - return Modes; -} - -/* - * - */ -static DisplayModePtr -DDCModesFromStandardTiming(int scrnIndex, struct std_timings *timing) -{ - DisplayModePtr Modes = NULL, Mode = NULL; - int i; - - for (i = 0; i < STD_TIMINGS; i++) - if (timing[i].hsize && timing[i].vsize && timing[i].refresh) { - Mode = xf86CVTMode(timing[i].hsize, timing[i].vsize, - timing[i].refresh, FALSE, FALSE); - Mode->type = M_T_DRIVER; - Modes = xf86ModesAdd(Modes, Mode); - } - - return Modes; -} - -/* - * - */ -static DisplayModePtr -DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, - int preferred) -{ - DisplayModePtr Mode; - - /* We don't do stereo */ - if (timing->stereo) { - xf86DrvMsg(scrnIndex, X_INFO, "%s: Ignoring: We don't handle stereo.\n", - __func__); - return NULL; - } - - /* We only do seperate sync currently */ - if (timing->sync != 0x03) { - xf86DrvMsg(scrnIndex, X_INFO, "%s: %dx%d Warning: We only handle seperate" - " sync.\n", __func__, timing->h_active, timing->v_active); - } - - Mode = xnfalloc(sizeof(DisplayModeRec)); - memset(Mode, 0, sizeof(DisplayModeRec)); - - Mode->name = xnfalloc(10); /* "1234x1234" */ - xf86snprintf(Mode->name, 20, "%dx%d", timing->h_active, - timing->v_active); - - Mode->type = M_T_DRIVER; - if (preferred) - Mode->type |= M_T_PREFERRED; - - Mode->Clock = timing->clock / 1000.0; - - Mode->HDisplay = timing->h_active; - Mode->HSyncStart = timing->h_active + timing->h_sync_off; - Mode->HSyncEnd = Mode->HSyncStart + timing->h_sync_width; - Mode->HTotal = timing->h_active + timing->h_blanking; - - Mode->VDisplay = timing->v_active; - Mode->VSyncStart = timing->v_active + timing->v_sync_off; - Mode->VSyncEnd = Mode->VSyncStart + timing->v_sync_width; - Mode->VTotal = timing->v_active + timing->v_blanking; - - /* We ignore h/v_size and h/v_border for now. */ - - if (timing->interlaced) - Mode->Flags |= V_INTERLACE; - - if (timing->misc & 0x02) - Mode->Flags |= V_PHSYNC; - else - Mode->Flags |= V_NHSYNC; - - if (timing->misc & 0x01) - Mode->Flags |= V_PVSYNC; - else - Mode->Flags |= V_NVSYNC; - - return Mode; -} - -/* - * - */ -static void -DDCGuessRangesFromModes(int scrnIndex, MonPtr Monitor, DisplayModePtr Modes) -{ - DisplayModePtr Mode = Modes; - - if (!Monitor || !Modes) - return; - - /* set up the ranges for scanning through the modes */ - Monitor->nHsync = 1; - Monitor->hsync[0].lo = 1024.0; - Monitor->hsync[0].hi = 0.0; - - Monitor->nVrefresh = 1; - Monitor->vrefresh[0].lo = 1024.0; - Monitor->vrefresh[0].hi = 0.0; - - while (Mode) { - if (!Mode->HSync) - Mode->HSync = ((float) Mode->Clock ) / ((float) Mode->HTotal); - - if (!Mode->VRefresh) - Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) / - ((float) (Mode->HTotal * Mode->VTotal)); - - if (Mode->HSync < Monitor->hsync[0].lo) - Monitor->hsync[0].lo = Mode->HSync; - - if (Mode->HSync > Monitor->hsync[0].hi) - Monitor->hsync[0].hi = Mode->HSync; - - if (Mode->VRefresh < Monitor->vrefresh[0].lo) - Monitor->vrefresh[0].lo = Mode->VRefresh; - - if (Mode->VRefresh > Monitor->vrefresh[0].hi) - Monitor->vrefresh[0].hi = Mode->VRefresh; - - Mode = Mode->next; - } -} - -/* - * Fill out MonPtr with xf86MonPtr information. - */ -void -xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) -{ - DisplayModePtr Modes = NULL, Mode; - int i, clock; - Bool have_hsync = FALSE, have_vrefresh = FALSE; - int preferred; - - if (!Monitor || !DDC) - return; - - Monitor->DDC = DDC; - - preferred = PREFERRED_TIMING_MODE(DDC->features.msc); - - Monitor->widthmm = 10 * DDC->features.hsize; - Monitor->heightmm = 10 * DDC->features.vsize; - - /* If this is a digital display, then we can use reduced blanking */ - if (DDC->features.input_type) - Monitor->reducedblanking = TRUE; - /* Allow the user to also enable this through config */ - - /* Add established timings */ - Mode = DDCModesFromEstablished(scrnIndex, &DDC->timings1); - Modes = xf86ModesAdd(Modes, Mode); - - /* Add standard timings */ - Mode = DDCModesFromStandardTiming(scrnIndex, DDC->timings2); - Modes = xf86ModesAdd(Modes, Mode); - - /* Skip EDID ranges if they were specified in the config file */ - have_hsync = (Monitor->nHsync != 0); - have_vrefresh = (Monitor->nVrefresh != 0); - - /* Go through the detailed monitor sections */ - for (i = 0; i < DET_TIMINGS; i++) - switch (DDC->det_mon[i].type) { - case DS_RANGES: - if (!have_hsync) { - if (!Monitor->nHsync) - xf86DrvMsg(scrnIndex, X_INFO, - "Using EDID range info for horizontal sync\n"); - Monitor->hsync[Monitor->nHsync].lo = - DDC->det_mon[i].section.ranges.min_h; - Monitor->hsync[Monitor->nHsync].hi = - DDC->det_mon[i].section.ranges.max_h; - Monitor->nHsync++; - } else { - xf86DrvMsg(scrnIndex, X_INFO, - "Using hsync ranges from config file\n"); - } - - if (!have_vrefresh) { - if (!Monitor->nVrefresh) - xf86DrvMsg(scrnIndex, X_INFO, - "Using EDID range info for vertical refresh\n"); - Monitor->vrefresh[Monitor->nVrefresh].lo = - DDC->det_mon[i].section.ranges.min_v; - Monitor->vrefresh[Monitor->nVrefresh].hi = - DDC->det_mon[i].section.ranges.max_v; - Monitor->nVrefresh++; - } else { - xf86DrvMsg(scrnIndex, X_INFO, - "Using vrefresh ranges from config file\n"); - } - - clock = DDC->det_mon[i].section.ranges.max_clock * 1000; - if (clock > Monitor->maxPixClock) - Monitor->maxPixClock = clock; - break; - case DT: - Mode = DDCModeFromDetailedTiming(scrnIndex, - &DDC->det_mon[i].section.d_timings, - preferred); - preferred = 0; - Modes = xf86ModesAdd(Modes, Mode); - break; - case DS_STD_TIMINGS: - Mode = DDCModesFromStandardTiming(scrnIndex, - DDC->det_mon[i].section.std_t); - Modes = xf86ModesAdd(Modes, Mode); - break; - default: - break; - } - if (Modes) { - /* Print Modes */ - xf86DrvMsg(scrnIndex, X_INFO, "Printing DDC gathered Modelines:\n"); - - Mode = Modes; - while (Mode) { - PrintModeline(scrnIndex, Mode); - Mode = Mode->next; - } - - /* Do we still need ranges to be filled in? */ - if (!Monitor->nHsync || !Monitor->nVrefresh) - DDCGuessRangesFromModes(scrnIndex, Monitor, Modes); - - /* look for last Mode */ - Mode = Modes; - - while (Mode->next) - Mode = Mode->next; - - /* add to MonPtr */ - if (Monitor->Modes) { - Monitor->Last->next = Modes; - Modes->prev = Monitor->Last; - Monitor->Last = Mode; - } else { - Monitor->Modes = Modes; - Monitor->Last = Mode; - } - } -} #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA" #define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA" diff --git a/hw/xfree86/ddc/edid_modes.c b/hw/xfree86/ddc/edid_modes.c new file mode 100644 index 000000000..cfc8ddc13 --- /dev/null +++ b/hw/xfree86/ddc/edid_modes.c @@ -0,0 +1,348 @@ +/* + * Copyright 2006 Luc Verhaegen. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include <xorg-config.h> +#endif + +#include "xf86.h" +#include "xf86DDC.h" +#include <X11/Xatom.h> +#include "property.h" +#include "propertyst.h" +#include "xf86DDC.h" + +/* + * TODO: + * - for those with access to the VESA DMT standard; review please. + */ +#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DRIVER +#define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0 + +DisplayModeRec DDCEstablishedModes[17] = { + { MODEPREFIX("800x600"), 40000, 800, 840, 968, 1056, 0, 600, 601, 605, 628, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@60Hz */ + { MODEPREFIX("800x600"), 36000, 800, 824, 896, 1024, 0, 600, 601, 603, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@56Hz */ + { MODEPREFIX("640x480"), 31500, 640, 656, 720, 840, 0, 480, 481, 484, 500, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@75Hz */ + { MODEPREFIX("640x480"), 31500, 640, 664, 704, 832, 0, 480, 489, 491, 520, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@72Hz */ + { MODEPREFIX("640x480"), 30240, 640, 704, 768, 864, 0, 480, 483, 486, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@67Hz */ + { MODEPREFIX("640x480"), 25200, 640, 656, 752, 800, 0, 480, 490, 492, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 640x480@60Hz */ + { MODEPREFIX("720x400"), 35500, 720, 738, 846, 900, 0, 400, 421, 423, 449, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 720x400@88Hz */ + { MODEPREFIX("720x400"), 28320, 720, 738, 846, 900, 0, 400, 412, 414, 449, 0, V_NHSYNC | V_PVSYNC, MODESUFFIX }, /* 720x400@70Hz */ + { MODEPREFIX("1280x1024"), 135000, 1280, 1296, 1440, 1688, 0, 1024, 1025, 1028, 1066, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1280x1024@75Hz */ + { MODEPREFIX("1024x768"), 78800, 1024, 1040, 1136, 1312, 0, 768, 769, 772, 800, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1024x768@75Hz */ + { MODEPREFIX("1024x768"), 75000, 1024, 1048, 1184, 1328, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 1024x768@70Hz */ + { MODEPREFIX("1024x768"), 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 1024x768@60Hz */ + { MODEPREFIX("1024x768"), 44900, 1024, 1032, 1208, 1264, 0, 768, 768, 776, 817, 0, V_PHSYNC | V_PVSYNC | V_INTERLACE, MODESUFFIX }, /* 1024x768@43Hz */ + { MODEPREFIX("832x624"), 57284, 832, 864, 928, 1152, 0, 624, 625, 628, 667, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX }, /* 832x624@75Hz */ + { MODEPREFIX("800x600"), 49500, 800, 816, 896, 1056, 0, 600, 601, 604, 625, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@75Hz */ + { MODEPREFIX("800x600"), 50000, 800, 856, 976, 1040, 0, 600, 637, 643, 666, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 800x600@72Hz */ + { MODEPREFIX("1152x864"), 108000, 1152, 1216, 1344, 1600, 0, 864, 865, 868, 900, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* 1152x864@75Hz */ +}; + +static DisplayModePtr +DDCModesFromEstablished(int scrnIndex, struct established_timings *timing) +{ + DisplayModePtr Modes = NULL, Mode = NULL; + CARD32 bits = (timing->t1) | (timing->t2 << 8) | + ((timing->t_manu & 0x80) << 9); + int i; + + for (i = 0; i < 17; i++) { + if (bits & (0x01 << i)) { + Mode = xf86DuplicateMode(&DDCEstablishedModes[i]); + Modes = xf86ModesAdd(Modes, Mode); + } + } + + return Modes; +} + +/* + * + */ +static DisplayModePtr +DDCModesFromStandardTiming(int scrnIndex, struct std_timings *timing) +{ + DisplayModePtr Modes = NULL, Mode = NULL; + int i; + + for (i = 0; i < STD_TIMINGS; i++) { + if (timing[i].hsize && timing[i].vsize && timing[i].refresh) { + Mode = xf86CVTMode(timing[i].hsize, timing[i].vsize, + timing[i].refresh, FALSE, FALSE); + Mode->type = M_T_DRIVER; + Modes = xf86ModesAdd(Modes, Mode); + } + } + + return Modes; +} + +/* + * + */ +static DisplayModePtr +DDCModeFromDetailedTiming(int scrnIndex, struct detailed_timings *timing, + int preferred) +{ + DisplayModePtr Mode; + + /* We don't do stereo */ + if (timing->stereo) { + xf86DrvMsg(scrnIndex, X_INFO, + "%s: Ignoring: We don't handle stereo.\n", __func__); + return NULL; + } + + /* We only do seperate sync currently */ + if (timing->sync != 0x03) { + xf86DrvMsg(scrnIndex, X_INFO, + "%s: %dx%d Warning: We only handle seperate" + " sync.\n", __func__, timing->h_active, timing->v_active); + } + + Mode = xnfalloc(sizeof(DisplayModeRec)); + memset(Mode, 0, sizeof(DisplayModeRec)); + + Mode->type = M_T_DRIVER; + if (preferred) + Mode->type |= M_T_PREFERRED; + + Mode->Clock = timing->clock / 1000.0; + + Mode->HDisplay = timing->h_active; + Mode->HSyncStart = timing->h_active + timing->h_sync_off; + Mode->HSyncEnd = Mode->HSyncStart + timing->h_sync_width; + Mode->HTotal = timing->h_active + timing->h_blanking; + + Mode->VDisplay = timing->v_active; + Mode->VSyncStart = timing->v_active + timing->v_sync_off; + Mode->VSyncEnd = Mode->VSyncStart + timing->v_sync_width; + Mode->VTotal = timing->v_active + timing->v_blanking; + + xf86SetModeDefaultName(Mode); + + /* We ignore h/v_size and h/v_border for now. */ + + if (timing->interlaced) + Mode->Flags |= V_INTERLACE; + + if (timing->misc & 0x02) + Mode->Flags |= V_PHSYNC; + else + Mode->Flags |= V_NHSYNC; + + if (timing->misc & 0x01) + Mode->Flags |= V_PVSYNC; + else + Mode->Flags |= V_NVSYNC; + + return Mode; +} + +/* + * + */ +static void +DDCGuessRangesFromModes(int scrnIndex, MonPtr Monitor, DisplayModePtr Modes) +{ + DisplayModePtr Mode = Modes; + + if (!Monitor || !Modes) + return; + + /* set up the ranges for scanning through the modes */ + Monitor->nHsync = 1; + Monitor->hsync[0].lo = 1024.0; + Monitor->hsync[0].hi = 0.0; + + Monitor->nVrefresh = 1; + Monitor->vrefresh[0].lo = 1024.0; + Monitor->vrefresh[0].hi = 0.0; + + while (Mode) { + if (!Mode->HSync) + Mode->HSync = ((float) Mode->Clock ) / ((float) Mode->HTotal); + + if (!Mode->VRefresh) + Mode->VRefresh = (1000.0 * ((float) Mode->Clock)) / + ((float) (Mode->HTotal * Mode->VTotal)); + + if (Mode->HSync < Monitor->hsync[0].lo) + Monitor->hsync[0].lo = Mode->HSync; + + if (Mode->HSync > Monitor->hsync[0].hi) + Monitor->hsync[0].hi = Mode->HSync; + + if (Mode->VRefresh < Monitor->vrefresh[0].lo) + Monitor->vrefresh[0].lo = Mode->VRefresh; + + if (Mode->VRefresh > Monitor->vrefresh[0].hi) + Monitor->vrefresh[0].hi = Mode->VRefresh; + + Mode = Mode->next; + } +} + +DisplayModePtr +xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) +{ + int preferred, i; + DisplayModePtr Modes = NULL, Mode; + + preferred = PREFERRED_TIMING_MODE(DDC->features.msc); + + /* Add established timings */ + Mode = DDCModesFromEstablished(scrnIndex, &DDC->timings1); + Modes = xf86ModesAdd(Modes, Mode); + + /* Add standard timings */ + Mode = DDCModesFromStandardTiming(scrnIndex, DDC->timings2); + Modes = xf86ModesAdd(Modes, Mode); + + for (i = 0; i < DET_TIMINGS; i++) { + struct detailed_monitor_section *det_mon = &DDC->det_mon[i]; + + switch (det_mon->type) { + case DT: + Mode = DDCModeFromDetailedTiming(scrnIndex, + &det_mon->section.d_timings, + preferred); + preferred = 0; + Modes = xf86ModesAdd(Modes, Mode); + break; + case DS_STD_TIMINGS: + Mode = DDCModesFromStandardTiming(scrnIndex, + det_mon->section.std_t); + Modes = xf86ModesAdd(Modes, Mode); + break; + default: + break; + } + } + + return Modes; +} + +/* + * Fill out MonPtr with xf86MonPtr information. + */ +void +xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) +{ + DisplayModePtr Modes = NULL, Mode; + int i, clock; + Bool have_hsync = FALSE, have_vrefresh = FALSE; + + if (!Monitor || !DDC) + return; + + Monitor->DDC = DDC; + + Monitor->widthmm = 10 * DDC->features.hsize; + Monitor->heightmm = 10 * DDC->features.vsize; + + /* If this is a digital display, then we can use reduced blanking */ + if (DDC->features.input_type) + Monitor->reducedblanking = TRUE; + /* Allow the user to also enable this through config */ + + Modes = xf86DDCGetModes(scrnIndex, DDC); + + /* Skip EDID ranges if they were specified in the config file */ + have_hsync = (Monitor->nHsync != 0); + have_vrefresh = (Monitor->nVrefresh != 0); + + /* Go through the detailed monitor sections */ + for (i = 0; i < DET_TIMINGS; i++) { + switch (DDC->det_mon[i].type) { + case DS_RANGES: + if (!have_hsync) { + if (!Monitor->nHsync) + xf86DrvMsg(scrnIndex, X_INFO, + "Using EDID range info for horizontal sync\n"); + Monitor->hsync[Monitor->nHsync].lo = + DDC->det_mon[i].section.ranges.min_h; + Monitor->hsync[Monitor->nHsync].hi = + DDC->det_mon[i].section.ranges.max_h; + Monitor->nHsync++; + } else { + xf86DrvMsg(scrnIndex, X_INFO, + "Using hsync ranges from config file\n"); + } + + if (!have_vrefresh) { + if (!Monitor->nVrefresh) + xf86DrvMsg(scrnIndex, X_INFO, + "Using EDID range info for vertical refresh\n"); + Monitor->vrefresh[Monitor->nVrefresh].lo = + DDC->det_mon[i].section.ranges.min_v; + Monitor->vrefresh[Monitor->nVrefresh].hi = + DDC->det_mon[i].section.ranges.max_v; + Monitor->nVrefresh++; + } else { + xf86DrvMsg(scrnIndex, X_INFO, + "Using vrefresh ranges from config file\n"); + } + + clock = DDC->det_mon[i].section.ranges.max_clock * 1000; + if (clock > Monitor->maxPixClock) + Monitor->maxPixClock = clock; + + break; + default: + break; + } + } + + if (Modes) { + /* Print Modes */ + xf86DrvMsg(scrnIndex, X_INFO, "Printing DDC gathered Modelines:\n"); + + Mode = Modes; + while (Mode) { + xf86PrintModeline(scrnIndex, Mode); + Mode = Mode->next; + } + + /* Do we still need ranges to be filled in? */ + if (!Monitor->nHsync || !Monitor->nVrefresh) + DDCGuessRangesFromModes(scrnIndex, Monitor, Modes); + + /* look for last Mode */ + Mode = Modes; + + while (Mode->next) + Mode = Mode->next; + + /* add to MonPtr */ + if (Monitor->Modes) { + Monitor->Last->next = Modes; + Modes->prev = Monitor->Last; + Monitor->Last = Mode; + } else { + Monitor->Modes = Modes; + Monitor->Last = Mode; + } + } +} diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h index 5def97a81..77994715e 100644 --- a/hw/xfree86/ddc/xf86DDC.h +++ b/hw/xfree86/ddc/xf86DDC.h @@ -59,6 +59,8 @@ extern void xf86print_vdif( xf86vdifPtr v ); +DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC); + #endif diff --git a/hw/xfree86/dixmods/extmod/Makefile.am b/hw/xfree86/dixmods/extmod/Makefile.am index 229d4e592..9f6c4081b 100644 --- a/hw/xfree86/dixmods/extmod/Makefile.am +++ b/hw/xfree86/dixmods/extmod/Makefile.am @@ -11,7 +11,7 @@ if XV XV_SRCS = xvmod.c xvmodproc.h endif -AM_CFLAGS = @XORG_CFLAGS@ +AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ \ -I$(top_srcdir)/afb \ -I$(top_srcdir)/mfb \ diff --git a/hw/xfree86/dixmods/type1mod.c b/hw/xfree86/dixmods/type1mod.c index 48c1d0421..3da53eae5 100644 --- a/hw/xfree86/dixmods/type1mod.c +++ b/hw/xfree86/dixmods/type1mod.c @@ -57,9 +57,6 @@ static XF86ModuleVersionInfo VersRec = _X_EXPORT XF86ModuleData type1ModuleData = { &VersRec, type1Setup, NULL }; extern void Type1RegisterFontFileFunctions(void); -#ifdef BUILDCID -extern void CIDRegisterFontFileFunctions(void); -#endif FontModule type1Module = { Type1RegisterFontFileFunctions, @@ -67,23 +64,11 @@ FontModule type1Module = { NULL }; -#ifdef BUILDCID -FontModule CIDModule = { - CIDRegisterFontFileFunctions, - "CID", - NULL -}; -#endif - static pointer type1Setup(pointer module, pointer opts, int *errmaj, int *errmin) { type1Module.module = module; LoadFont(&type1Module); -#ifdef BUILDCID - CIDModule.module = module; - LoadFont(&CIDModule); -#endif /* Need a non-NULL return */ return (pointer)1; diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/doc/man/Xorg.man.pre index d91b79641..43f0518d2 100644 --- a/hw/xfree86/doc/man/Xorg.man.pre +++ b/hw/xfree86/doc/man/Xorg.man.pre @@ -426,6 +426,12 @@ Print out the server version, patchlevel, release date, the operating system/platform it was built on, and whether it includes module loader support. .TP 8 +.B \-showDefaultModulePath +Print out the default module path the server was compiled with. +.TP 8 +.B \-showDefaultLibPath +Print out the path libraries should be installed to. +.TP 8 .BI \-config " file" Read the server configuration from .IR file . diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre index abf31468a..8d52b2bcf 100644 --- a/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/hw/xfree86/doc/man/xorg.conf.man.pre @@ -311,7 +311,6 @@ font path elements: .I __projectroot__/lib/X11/fonts/misc/ .I __projectroot__/lib/X11/fonts/TTF/ .I __projectroot__/lib/X11/fonts/Type1/ -.I __projectroot__/lib/X11/fonts/CID/ .I __projectroot__/lib/X11/fonts/75dpi/ .I __projectroot__/lib/X11/fonts/100dpi/ .fi @@ -326,7 +325,6 @@ The recommended font path contains the following font path elements: .I __projectroot__/lib/X11/fonts/75dpi/:unscaled .I __projectroot__/lib/X11/fonts/100dpi/:unscaled .I __projectroot__/lib/X11/fonts/Type1/ -.I __projectroot__/lib/X11/fonts/CID/ .I __projectroot__/lib/X11/fonts/Speedo/ .I __projectroot__/lib/X11/fonts/75dpi/ .I __projectroot__/lib/X11/fonts/100dpi/ diff --git a/hw/xfree86/dri/Makefile.am b/hw/xfree86/dri/Makefile.am index 4def3874b..68f1eaefa 100644 --- a/hw/xfree86/dri/Makefile.am +++ b/hw/xfree86/dri/Makefile.am @@ -7,7 +7,7 @@ libdri_la_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \ -I$(top_builddir)/GL/include \ -I@MESA_SOURCE@/include \ -DHAVE_XORG_CONFIG_H \ - @DRIPROTO_CFLAGS@ \ + @DIX_CFLAGS@ @DRIPROTO_CFLAGS@ \ @LIBDRM_CFLAGS@ \ @GL_CFLAGS@ libdri_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@ diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index a49c63212..5337f9a4a 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -84,7 +84,7 @@ static RESTYPE DRIDrawablePrivResType; static RESTYPE DRIContextPrivResType; static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv); -static drmServerInfo DRIDRMServerInfo; +drmServerInfo DRIDRMServerInfo; /* Wrapper just like xf86DrvMsg, but without the verbosity level checking. @@ -176,8 +176,6 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) else openbusid = NULL; - drmSetServerInfo(&DRIDRMServerInfo); - /* Note that drmOpen will try to load the kernel module, if needed. */ fd = drmOpen(pDRIInfo->drmDriverName, openbusid); if (fd < 0) { @@ -593,7 +591,7 @@ static void dri_drm_get_perms(gid_t *group, mode_t *mode) *mode = xf86ConfigDRI.mode; } -static drmServerInfo DRIDRMServerInfo = { +drmServerInfo DRIDRMServerInfo = { dri_drm_debug_print, xf86LoadKernelModule, dri_drm_get_perms, diff --git a/hw/xfree86/dri/drimodule.c b/hw/xfree86/dri/drimodule.c index b39c22e11..0e3d84eb8 100644 --- a/hw/xfree86/dri/drimodule.c +++ b/hw/xfree86/dri/drimodule.c @@ -39,8 +39,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86Module.h" #include "globals.h" +#include "xf86drm.h" static MODULESETUPPROTO(driSetup); +drmServerInfo DRIDRMServerInfo; + static XF86ModuleVersionInfo VersRec = { "dri", @@ -81,6 +84,9 @@ driSetup(pointer module, pointer opts, int *errmaj, int *errmin) } else { if (errmaj) *errmaj = LDR_ONCEONLY; } + + drmSetServerInfo(&DRIDRMServerInfo); + /* Need a non-NULL return value to indicate success */ return 1; } diff --git a/hw/xfree86/dummylib/Makefile.am b/hw/xfree86/dummylib/Makefile.am index d89ee59a8..6299a1ff7 100644 --- a/hw/xfree86/dummylib/Makefile.am +++ b/hw/xfree86/dummylib/Makefile.am @@ -6,7 +6,7 @@ noinst_LIBRARIES = libdummy-nonserver.a INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) if NEED_STRLCAT STRL_SRCS = $(top_srcdir)/os/strlcat.c $(top_srcdir)/os/strlcpy.c diff --git a/hw/xfree86/exa/Makefile.am b/hw/xfree86/exa/Makefile.am index 31682c425..9eb2e1797 100644 --- a/hw/xfree86/exa/Makefile.am +++ b/hw/xfree86/exa/Makefile.am @@ -7,7 +7,7 @@ INCLUDES = \ -I$(srcdir)/../../../exa \ -I$(srcdir)/../../../miext/cw -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) libexa_la_SOURCES = \ examodule.c diff --git a/hw/xfree86/fbdevhw/Makefile.am b/hw/xfree86/fbdevhw/Makefile.am index 10de50e83..6a4a6e4e6 100644 --- a/hw/xfree86/fbdevhw/Makefile.am +++ b/hw/xfree86/fbdevhw/Makefile.am @@ -11,7 +11,7 @@ endif INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = fbdevhw.h diff --git a/hw/xfree86/i2c/Makefile.am b/hw/xfree86/i2c/Makefile.am index cbf4f6571..e73fcaeb8 100644 --- a/hw/xfree86/i2c/Makefile.am +++ b/hw/xfree86/i2c/Makefile.am @@ -15,7 +15,7 @@ libi2c_la_SOURCES = xf86i2c.c xf86i2cmodule.c INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = xf86i2c.h bt829.h fi1236.h msp3430.h tda8425.h tda9850.h tda9885.h uda1380.h i2c_def.h diff --git a/hw/xfree86/int10/Makefile.am b/hw/xfree86/int10/Makefile.am index 3a18afb8a..28e20d502 100644 --- a/hw/xfree86/int10/Makefile.am +++ b/hw/xfree86/int10/Makefile.am @@ -18,7 +18,7 @@ I386_VIDEO_CFLAGS = -D_PC endif if INT10_VM86 -AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(XORG_CFLAGS) $(EXTRA_CFLAGS) +AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(DIX_CFLAGS) $(XORG_CFLAGS) $(EXTRA_CFLAGS) INCLUDES = $(XORG_INCS) libint10_la_SOURCES = \ $(COMMON_SOURCES) \ @@ -28,7 +28,7 @@ endif if INT10_X86EMU AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_X86EMU -DNO_SYS_HEADERS \ - $(XORG_CFLAGS) $(EXTRA_CFLAGS) + $(XORG_CFLAGS) $(EXTRA_CFLAGS) $(DIX_CFLAGS) INCLUDES = $(XORG_INCS) -I$(srcdir)/../x86emu libint10_la_SOURCES = \ $(COMMON_SOURCES) \ @@ -38,7 +38,7 @@ libint10_la_SOURCES = \ endif if INT10_STUB -AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(XORG_CFLAGS) $(EXTRA_CFLAGS) +AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(DIX_CFLAGS) $(XORG_CFLAGS) $(EXTRA_CFLAGS) libint10_la_SOURCES = stub.c xf86int10module.c endif diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am index 030672389..206600214 100644 --- a/hw/xfree86/loader/Makefile.am +++ b/hw/xfree86/loader/Makefile.am @@ -5,7 +5,7 @@ INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(srcdir)/../dixmods/extmod \ -I$(srcdir)/../ddc -I$(srcdir)/../i2c #AM_LDFLAGS = -r -AM_CFLAGS = -DIN_LOADER $(XORG_CFLAGS) +AM_CFLAGS = -DIN_LOADER $(DIX_CFLAGS) $(XORG_CFLAGS) if XORG_LOADER_SPARC SPARC_SOURCES = SparcMulDiv.S diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 3051dedaf..1cb7dae08 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -499,7 +499,7 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86AddModuleInfo) SYMFUNC(xf86DeleteModuleInfo) -#if defined(__sparc__) && !defined(__OpenBSD__) +#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) /* xf86sbusBus.c */ SYMFUNC(xf86MatchSbusInstances) SYMFUNC(xf86GetSbusInfoForEntity) diff --git a/hw/xfree86/os-support/Makefile.am b/hw/xfree86/os-support/Makefile.am index 6346d1c47..e5a71c00a 100644 --- a/hw/xfree86/os-support/Makefile.am +++ b/hw/xfree86/os-support/Makefile.am @@ -15,6 +15,8 @@ libxorgos_la_LIBADD = @XORG_OS_SUBDIR@/lib@XORG_OS_SUBDIR@.la \ bus/libbus.la \ misc/libmisc.la +AM_CFLAGS = $(DIX_CFLAGS) + xorgos.c: touch $@ diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am index e456328df..099240467 100644 --- a/hw/xfree86/os-support/bsd/Makefile.am +++ b/hw/xfree86/os-support/bsd/Makefile.am @@ -50,7 +50,7 @@ ARCH_SOURCES = \ endif # FIXME: NetBSD Aperture defines (configure.ac) -AM_CFLAGS = -DUSESTDRES $(XORG_CFLAGS) +AM_CFLAGS = -DUSESTDRES $(XORG_CFLAGS) $(DIX_CFLAGS) INCLUDES = $(XORG_INCS) diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am index c56f3d717..fba6e5421 100644 --- a/hw/xfree86/os-support/bus/Makefile.am +++ b/hw/xfree86/os-support/bus/Makefile.am @@ -53,6 +53,6 @@ libbus_la_SOURCES = Pci.c Pci.h $(PCI_SOURCES) $(PLATFORM_PCI_SOURCES) \ INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) EXTRA_DIST = $(sdk_HEADERS) diff --git a/hw/xfree86/os-support/hurd/Makefile.am b/hw/xfree86/os-support/hurd/Makefile.am index b80fdde99..731ff083d 100644 --- a/hw/xfree86/os-support/hurd/Makefile.am +++ b/hw/xfree86/os-support/hurd/Makefile.am @@ -12,6 +12,6 @@ libhurd_la_SOURCES = hurd_bell.c hurd_init.c hurd_mmap.c \ $(srcdir)/../shared/kmod_noop.c \ $(srcdir)/../shared/agp_noop.c -AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) +AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS) INCLUDES = $(XORG_INCS) diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am index caf600787..9c4fa4984 100644 --- a/hw/xfree86/os-support/linux/Makefile.am +++ b/hw/xfree86/os-support/linux/Makefile.am @@ -34,7 +34,7 @@ liblinux_la_SOURCES = lnx_init.c lnx_video.c lnx_mouse.c \ $(APM_SRCS) \ $(PLATFORM_PCI_SUPPORT) -AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(PLATFORM_DEFINES) +AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) INCLUDES = $(XORG_INCS) $(PLATFORM_INCLUDES) -I/usr/include/drm # FIXME this last part is crack diff --git a/hw/xfree86/os-support/misc/Makefile.am b/hw/xfree86/os-support/misc/Makefile.am index 8bec35088..65fbe92b4 100644 --- a/hw/xfree86/os-support/misc/Makefile.am +++ b/hw/xfree86/os-support/misc/Makefile.am @@ -18,6 +18,6 @@ libmisc_la_SOURCES = xf86_Util.c Delay.c $(ARCH_SRCS) INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS) $(ILHACK_SRCS) diff --git a/hw/xfree86/os-support/solaris/Makefile.am b/hw/xfree86/os-support/solaris/Makefile.am index 291c329ea..57ec89e57 100644 --- a/hw/xfree86/os-support/solaris/Makefile.am +++ b/hw/xfree86/os-support/solaris/Makefile.am @@ -30,7 +30,7 @@ nodist_libsolaris_la_SOURCES = $(SOLARIS_INOUT_SRC) sdk_HEADERS = agpgart.h nodist_sdk_HEADERS = solaris-$(SOLARIS_INOUT_ARCH).il -AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) +AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(XORG_CFLAGS) $(DIX_CFLAGS) INCLUDES = $(XORG_INCS) diff --git a/hw/xfree86/os-support/solaris/sun_bell.c b/hw/xfree86/os-support/solaris/sun_bell.c index b3a9bfe7e..29ecd7300 100644 --- a/hw/xfree86/os-support/solaris/sun_bell.c +++ b/hw/xfree86/os-support/solaris/sun_bell.c @@ -48,7 +48,7 @@ #define AUDIO_DEVICE "/dev/audio" -_X_EXPORT int +_X_EXPORT void xf86OSRingBell(int loudness, int pitch, int duration) { static short samples[BELL_SAMPLES]; @@ -66,7 +66,7 @@ xf86OSRingBell(int loudness, int pitch, int duration) int audioFD; if ((loudness <= 0) || (pitch <= 0) || (duration <= 0)) { - return 0; + return; } lastFreq = 0; @@ -76,7 +76,7 @@ xf86OSRingBell(int loudness, int pitch, int duration) if (audioFD == -1) { xf86Msg(X_ERROR, "Bell: cannot open audio device \"%s\": %s\n", AUDIO_DEVICE, strerror(errno)); - return -1; + return; } freq = pitch; @@ -126,7 +126,7 @@ xf86OSRingBell(int loudness, int pitch, int duration) "Bell: AUDIO_SETINFO failed on audio device \"%s\": %s\n", AUDIO_DEVICE, strerror(errno)); close(audioFD); - return -1; + return; } iovcnt = 0; @@ -155,7 +155,7 @@ xf86OSRingBell(int loudness, int pitch, int duration) "Bell: writev failed on audio device \"%s\": %s\n", AUDIO_DEVICE, strerror(errno)); close(audioFD); - return -1; + return; } i = iovcnt; } else { @@ -181,5 +181,5 @@ xf86OSRingBell(int loudness, int pitch, int duration) } close(audioFD); - return 0; + return; } diff --git a/hw/xfree86/parser/Makefile.am b/hw/xfree86/parser/Makefile.am index abe9a5a4a..1c1ba3f13 100644 --- a/hw/xfree86/parser/Makefile.am +++ b/hw/xfree86/parser/Makefile.am @@ -25,7 +25,7 @@ libxf86config_a_SOURCES = \ DRI.c \ Extensions.c -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) EXTRA_DIST = \ Configint.h \ diff --git a/hw/xfree86/rac/Makefile.am b/hw/xfree86/rac/Makefile.am index 2d8d87975..b25068271 100644 --- a/hw/xfree86/rac/Makefile.am +++ b/hw/xfree86/rac/Makefile.am @@ -5,4 +5,4 @@ sdk_HEADERS = xf86RAC.h INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/hw/xfree86/ramdac/Makefile.am b/hw/xfree86/ramdac/Makefile.am index c9afdad60..8d944455f 100644 --- a/hw/xfree86/ramdac/Makefile.am +++ b/hw/xfree86/ramdac/Makefile.am @@ -13,7 +13,7 @@ EXTRA_DIST = BTPriv.h IBMPriv.h TIPriv.h xf86CursorPriv.h xf86RamDacPriv.h \ CURSOR.NOTES AM_CFLAGS = -DXAAReverseBitOrder=xf86ReverseBitOrder -DRAMDAC_MODULE \ - $(XORG_CFLAGS) + $(DIX_CFLAGS) $(XORG_CFLAGS) INCLUDES = $(XORG_INCS) xf86BitOrder.c: diff --git a/hw/xfree86/scanpci/Makefile.am b/hw/xfree86/scanpci/Makefile.am index 7e5671aa1..d4d9da222 100644 --- a/hw/xfree86/scanpci/Makefile.am +++ b/hw/xfree86/scanpci/Makefile.am @@ -8,7 +8,7 @@ libscanpci_la_SOURCES = xf86ScanPci.c INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) BUILT_SOURCES = xf86PciIds.h diff --git a/hw/xfree86/scanpci/pci.ids b/hw/xfree86/scanpci/pci.ids index c6f565370..d48e25c58 100644 --- a/hw/xfree86/scanpci/pci.ids +++ b/hw/xfree86/scanpci/pci.ids @@ -11,7 +11,7 @@ # This file can be distributed under either the GNU General Public License # (version 2 or higher) or the 3-clause BSD License. # -# Daily snapshot on Tue 2006-10-03 01:05:01 +# Daily snapshot on Wed 2006-12-06 02:05:02 # # Vendors, devices and subsystems. Please keep sorted. @@ -3012,20 +3012,22 @@ 2200 QLA2200 64-bit Fibre Channel Adapter 1077 0002 QLA2200 2300 QLA2300 64-bit Fibre Channel Adapter - 2312 QLA2312 Fibre Channel Adapter + 2312 ISP2312-based 2Gb Fibre Channel to PCI-X HBA 103c 0131 2Gb Fibre Channel - Single port [A7538A] 103c 12ba 2Gb Fibre Channel - Dual port [A6826A] - 2322 QLA2322 Fibre Channel Adapter - 2422 QLA2422 Fibre Channel Adapter + 2322 ISP2322-based 2Gb Fibre Channel to PCI-X HBA + 2422 ISP2422-based 4Gb Fibre Channel to PCI-X HBA 103c 12d7 4Gb Fibre Channel [AB379A] 103c 12dd 4Gb Fibre Channel [AB429A] - 2432 QLA2432 Fibre Channel Adapter - 3010 QLA3010 Network Adapter - 3022 QLA3022 Network Adapter - 4010 QLA4010 iSCSI TOE Adapter - 4022 QLA4022 iSCSI TOE Adapter - 6312 QLA6312 Fibre Channel Adapter - 6322 QLA6322 Fibre Channel Adapter + 2432 ISP2432-based 4Gb Fibre Channel to PCI Express HBA + 3022 ISP4022-based Ethernet NIC + 3032 ISP4032-based Ethernet NIC + 4010 ISP4010-based iSCSI TOE HBA + 4022 ISP4022-based iSCSI TOE HBA + 4032 ISP4032-based iSCSI TOE IPv6 HBA + 5432 SP232-based 4Gb Fibre Channel to PCI Express HBA + 6312 SP202-based 2Gb Fibre Channel to PCI-X HBA + 6322 SP212-based 2Gb Fibre Channel to PCI-X HBA 1078 Cyrix Corporation 0000 5510 [Grappa] 0001 PCI Master @@ -10565,7 +10567,9 @@ 16be 1040 V.9X DSP Data Fax Modem 1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter 103c 08b0 tc1100 tablet + 8086 2522 Samsung P30 integrated WLAN 8086 2527 MIM2000/Centrino + 8086 2581 Toshiba Satellite M10 1048 PRO/10GbE LR Server Adapter 8086 a01f PRO/10GbE LR Server Adapter 8086 a11f PRO/10GbE LR Server Adapter @@ -10583,6 +10587,10 @@ 1051 82801EB/ER (ICH5/ICH5R) integrated LAN Controller 1052 PRO/100 VM Network Connection 1053 PRO/100 VM Network Connection + 1054 PRO/100 VE Network Connection + 1055 PRO/100 VM Network Connection + 1056 PRO/100 VE Network Connection + 1057 PRO/100 VE Network Connection 1059 82551QM Ethernet Controller 105b 82546GB Gigabit Ethernet Controller (Copper) 105e 82571EB Gigabit Ethernet Controller @@ -10673,19 +10681,30 @@ 108c 82573E Gigabit Ethernet Controller (Copper) 108e 82573E KCS (Active Management) 108f Active Management Technology - SOL + 1091 PRO/100 VM Network Connection 1092 PRO/100 VE Network Connection + 1093 PRO/100 VM Network Connection + 1094 PRO/100 VE Network Connection + 1095 PRO/100 VE Network Connection 1096 80003ES2LAN Gigabit Ethernet Controller (Copper) 1097 631xESB/632xESB DPT LAN Controller (Fiber) 1098 80003ES2LAN Gigabit Ethernet Controller (Serdes) 1099 82546GB Gigabit Ethernet Controller (Copper) 8086 1099 PRO/1000 GT Quad Port Server Adapter 109a 82573L Gigabit Ethernet Controller + 1179 ff10 PRO/1000 PL 17aa 2001 ThinkPad T60 17aa 207e Thinkpad X60s 8086 109a PRO/1000 PL Network Connection 109b 82546GB PRO/1000 GF Quad Port Server Adapter + 109e 82597EX 10GbE Ethernet Controller + 8086 a01f PRO/10GbE CX4 Server Adapter + 8086 a11f PRO/10GbE CX4 Server Adapter 10a0 82571EB PRO/1000 AT Quad Port Bypass Adapter 10a1 82571EB PRO/1000 AF Quad Port Bypass Adapter + 10a4 82571EB Gigabit Ethernet Controller + 8086 10a4 PRO/1000 PT Quad Port Server Adapter + 8086 11a4 PRO/1000 PT Quad Port Server Adapter 10b0 82573L PRO/1000 PL Network Connection 10b2 82573V PRO/1000 PM Network Connection 10b3 82573E PRO/1000 PM Network Connection @@ -10699,6 +10718,11 @@ 8086 1093 PRO/1000 PT Desktop Adapter 10ba 80003ES2LAN Gigabit Ethernet Controller (Copper) 10bb 80003ES2LAN Gigabit Ethernet Controller (Serdes) + 10bc 82571EB Gigabit Ethernet Controller (Copper) + 8086 10bc PRO/1000 PT Quad Port LP Server Adapter + 8086 11bc PRO/1000 PT Quad Port LP Server Adapter + 10c4 82562GT 10/100 Network Connection + 10c5 82562G 10/100 Network Connection 1107 PRO/1000 MF Server Adapter (LX) 1130 82815 815 Chipset Host Bridge and Memory Controller Hub 1025 1016 Travelmate 612 TX @@ -10946,6 +10970,9 @@ 1a31 82845 845 (Brookdale) Chipset AGP Bridge 1a38 5000 Series Chipset DMA Engine 1a48 PRO/10GbE SR Server Adapter + 1b48 82597EX 10GbE Ethernet Controller + 8086 a01f PRO/10GbE LR Server Adapter + 8086 a11f PRO/10GbE LR Server Adapter 2410 82801AA ISA Bridge (LPC) 2411 82801AA IDE 2412 82801AA USB @@ -10998,6 +11025,7 @@ 147b 0507 TH7II-RAID 8086 4532 D815EEA2 mainboard 2445 82801BA/BAM AC'97 Audio + 0e11 000b Compaq Deskpro EN Audio 0e11 0088 Evo D500 1014 01c6 Netvista A40/A40p 1025 1016 Travelmate 612 TX @@ -11010,6 +11038,7 @@ 104d 80df Vaio PCG-FX403 2448 82801 Mobile PCI Bridge 103c 099c NX6110/NC6120 + 144d c00c P30 notebook 1734 1055 Amilo M1420 2449 82801BA/BAM/CA/CAM Ethernet Controller 0e11 0012 EtherExpress PRO/100 VM @@ -11129,6 +11158,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1462 5800 845PE Max (MS-6580) 1509 2990 Averatec 5110H laptop 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) @@ -11160,6 +11190,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1462 5800 845PE Max (MS-6580) 1509 2990 Averatec 5110H 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) @@ -11177,6 +11208,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1458 a002 GA-8PE667 Ultra 1462 5800 845PE Max (MS-6580) 1734 1005 D1451 (SCENIC N300, i845GV) Sigmatel STAC9750T @@ -11190,6 +11222,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 24c7 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 1014 0267 NetVista A30p 1014 052d Thinkpad R50e model 1634 @@ -11201,6 +11234,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1462 5800 845PE Max (MS-6580) 1509 2990 Averatec 5110H 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) @@ -11215,6 +11249,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1734 1055 Amilo M1420 8086 4541 Latitude D400 24cb 82801DB (ICH4) IDE Controller @@ -11225,6 +11260,7 @@ 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 4c53 1090 Cx9 / Vx9 mainboard 24cc 82801DBM (ICH4-M) LPC Interface Bridge + 144d c00c P30 notebook 1734 1055 Amilo M1420 24cd 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller 1014 0267 NetVista A30p @@ -11240,6 +11276,7 @@ 103c 08b0 tc1100 tablet 1071 8160 MIM2000 1179 ff00 Satellite 2430 + 144d c00c P30 notebook 1462 3981 845PE Max (MS-6580) 1509 1968 Averatec 5110H 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) @@ -11278,6 +11315,7 @@ 1014 02ed xSeries server mainboard 1028 0156 Precision 360 1028 0169 Precision 470 + 103c 12bc d330 uT 1043 80a6 P4P800 Mainboard 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) 1462 7280 865PE Neo2 (MS-6728) @@ -11304,6 +11342,7 @@ 8086 4c43 Desktop Board D865GLC 8086 524c D865PERL mainboard 24d5 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller + 100a 147b Abit IS7-E motherboard 1028 0169 Precision 470 103c 006a NX9500 103c 12bc d330 uT @@ -11427,6 +11466,7 @@ 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 2570 82865G/PE/P DRAM Controller/Host-Hub Interface 103c 006a NX9500 + 103c 12bc d330 uT 1043 80f2 P5P800-MX Mainboard 1458 2570 GA-8IPE1000 Pro2 motherboard (865PE) 2571 82865G/PE/P PCI to AGP Controller @@ -11533,7 +11573,7 @@ 25e5 5000 Series Chipset PCI Express x4 Port 5 25e6 5000 Series Chipset PCI Express x4 Port 6 25e7 5000 Series Chipset PCI Express x4 Port 7 - 25f0 5000 Series Chipset Error Reporting Registers + 25f0 5000 Series Chipset FSB Registers 25f1 5000 Series Chipset Reserved Registers 25f3 5000 Series Chipset Reserved Registers 25f5 5000 Series Chipset FBD Registers @@ -11554,7 +11594,7 @@ 2609 E8500/E8501 PCI Express x8 Port B 260a E8500/E8501 PCI Express x8 Port A 260c E8500/E8501 IMI Registers - 2610 E8500/E8501 Front Side Bus, Boot, and Interrupt Registers + 2610 E8500/E8501 FSB Registers 2611 E8500/E8501 Address Mapping Registers 2612 E8500/E8501 RAS Registers 2613 E8500/E8501 Reserved Registers @@ -11713,6 +11753,7 @@ 107b 5048 E4500 8086 544e DeskTop Board D945GTP 27b9 82801GBM (ICH7-M) LPC Interface Bridge + 10f7 8338 Panasonic CF-Y5 laptop 17aa 2009 ThinkPad T60/R60 series 27bd 82801GHM (ICH7-M DH) LPC Interface Bridge 27c0 82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controller IDE @@ -11749,9 +11790,12 @@ 27d6 82801G (ICH7 Family) PCI Express Port 4 27d8 82801G (ICH7 Family) High Definition Audio Controller 107b 5048 E4500 + 10f7 8338 Panasonic CF-Y5 laptop + 1179 ff31 Toshiba America Information Systems:AC97 Data Fax SoftModem with SmartCP 152d 0753 Softmodem 17aa 2010 ThinkPad T60/R60 series 27da 82801G (ICH7 Family) SMBus Controller + 10f7 8338 Panasonic CF-Y5 laptop 17aa 200f ThinkPad T60/R60 series 8086 544e DeskTop Board D945GTP 27dc 82801G (ICH7 Family) LAN Controller @@ -11760,6 +11804,7 @@ 27de 82801G (ICH7 Family) AC'97 Audio Controller 27df 82801G (ICH7 Family) IDE Controller 107b 5048 E4500 + 10f7 8338 Panasonic CF-Y5 laptop 17aa 200c Thinkpad R60e model 0657 8086 544e DeskTop Board D945GTP 27e0 82801GR/GH/GHM (ICH7 Family) PCI Express Port 5 @@ -11770,21 +11815,28 @@ 2814 82801HO (ICH8DO) LPC Interface Controller 2815 Mobile LPC Interface Controller 2820 82801H (ICH8 Family) 4 port SATA IDE Controller - 2821 82801HB (ICH8) SATA AHCI Controller + 1462 7235 P965 Neo MS-7235 mainboard + 2821 82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA AHCI Controller 2822 82801HR/HO/HH (ICH8R/DO/DH) SATA RAID Controller - 2824 82801HR/HO/HH (ICH8R/DO/DH) SATA AHCI Controller + 2824 82801HB (ICH8) 4 port SATA AHCI Controller 2825 82801H (ICH8 Family) 2 port SATA IDE Controller + 1462 7235 P965 Neo MS-7235 mainboard 2828 Mobile SATA IDE Controller 2829 Mobile SATA AHCI Controller 282a Mobile SATA RAID Controller 2830 82801H (ICH8 Family) USB UHCI #1 + 1462 7235 P965 Neo MS-7235 mainboard 2831 82801H (ICH8 Family) USB UHCI #2 + 1462 7235 P965 Neo MS-7235 mainboard 2832 82801H (ICH8 Family) USB UHCI #3 2834 82801H (ICH8 Family) USB UHCI #4 + 1462 7235 P965 Neo MS-7235 mainboard 2835 82801H (ICH8 Family) USB UHCI #5 2836 82801H (ICH8 Family) USB2 EHCI #1 + 1462 7235 P965 Neo MS-7235 mainboard 283a 82801H (ICH8 Family) USB2 EHCI #2 283e 82801H (ICH8 Family) SMBus Controller + 1462 7235 P965 Neo MS-7235 mainboard 283f 82801H (ICH8 Family) PCI Express Port 1 2841 82801H (ICH8 Family) PCI Express Port 2 2843 82801H (ICH8 Family) PCI Express Port 3 @@ -11831,12 +11883,15 @@ 2a07 Mobile KT Controller 3092 Integrated RAID 3200 GD31244 PCI-X SATA HBA + 1775 c200 C2K onboard SATA host bus adapter 3340 82855PM Processor to I/O Controller 1025 005a TravelMate 290 103c 088c NC8000 laptop 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet + 144d c00c P30 notebook 3341 82855PM Processor to AGP Controller + 144d c00c P30 notebook 3500 6311ESB/6321ESB PCI Express Upstream Port 3501 6310ESB PCI Express Upstream Port 3504 6311ESB/6321ESB I/OxAPIC Interrupt Controller diff --git a/hw/xfree86/scanpci/xf86PciStdIds.h b/hw/xfree86/scanpci/xf86PciStdIds.h index d86d686c8..0cf8d4e55 100644 --- a/hw/xfree86/scanpci/xf86PciStdIds.h +++ b/hw/xfree86/scanpci/xf86PciStdIds.h @@ -5712,7 +5712,7 @@ static const char pci_device_1077_2200[] = "QLA2200 64-bit Fibre Channel Adapter static const char pci_subsys_1077_2200_1077_0002[] = "QLA2200"; #endif static const char pci_device_1077_2300[] = "QLA2300 64-bit Fibre Channel Adapter"; -static const char pci_device_1077_2312[] = "QLA2312 Fibre Channel Adapter"; +static const char pci_device_1077_2312[] = "ISP2312-based 2Gb Fibre Channel to PCI-X HBA"; #endif #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1077_2312_103c_0131[] = "2Gb Fibre Channel - Single port [A7538A]"; @@ -5723,8 +5723,8 @@ static const char pci_subsys_1077_2312_103c_0131[] = "2Gb Fibre Channel - Single static const char pci_subsys_1077_2312_103c_12ba[] = "2Gb Fibre Channel - Dual port [A6826A]"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO -static const char pci_device_1077_2322[] = "QLA2322 Fibre Channel Adapter"; -static const char pci_device_1077_2422[] = "QLA2422 Fibre Channel Adapter"; +static const char pci_device_1077_2322[] = "ISP2322-based 2Gb Fibre Channel to PCI-X HBA"; +static const char pci_device_1077_2422[] = "ISP2422-based 4Gb Fibre Channel to PCI-X HBA"; #endif #ifdef INIT_SUBSYS_INFO static const char pci_subsys_1077_2422_103c_12d7[] = "4Gb Fibre Channel [AB379A]"; @@ -5735,13 +5735,15 @@ static const char pci_subsys_1077_2422_103c_12d7[] = "4Gb Fibre Channel [AB379A] static const char pci_subsys_1077_2422_103c_12dd[] = "4Gb Fibre Channel [AB429A]"; #endif #ifdef VENDOR_INCLUDE_NONVIDEO -static const char pci_device_1077_2432[] = "QLA2432 Fibre Channel Adapter"; -static const char pci_device_1077_3010[] = "QLA3010 Network Adapter"; -static const char pci_device_1077_3022[] = "QLA3022 Network Adapter"; -static const char pci_device_1077_4010[] = "QLA4010 iSCSI TOE Adapter"; -static const char pci_device_1077_4022[] = "QLA4022 iSCSI TOE Adapter"; -static const char pci_device_1077_6312[] = "QLA6312 Fibre Channel Adapter"; -static const char pci_device_1077_6322[] = "QLA6322 Fibre Channel Adapter"; +static const char pci_device_1077_2432[] = "ISP2432-based 4Gb Fibre Channel to PCI Express HBA"; +static const char pci_device_1077_3022[] = "ISP4022-based Ethernet NIC"; +static const char pci_device_1077_3032[] = "ISP4032-based Ethernet NIC"; +static const char pci_device_1077_4010[] = "ISP4010-based iSCSI TOE HBA"; +static const char pci_device_1077_4022[] = "ISP4022-based iSCSI TOE HBA"; +static const char pci_device_1077_4032[] = "ISP4032-based iSCSI TOE IPv6 HBA"; +static const char pci_device_1077_5432[] = "SP232-based 4Gb Fibre Channel to PCI Express HBA"; +static const char pci_device_1077_6312[] = "SP202-based 2Gb Fibre Channel to PCI-X HBA"; +static const char pci_device_1077_6322[] = "SP212-based 2Gb Fibre Channel to PCI-X HBA"; #endif static const char pci_vendor_1078[] = "Cyrix Corporation"; static const char pci_device_1078_0000[] = "5510 [Grappa]"; @@ -20449,10 +20451,8 @@ static const char pci_device_19e7_1003[] = "STIX - 2 Port T1/E1 Card"; static const char pci_device_19e7_1004[] = "STIX - 4 Port T1/E1 Card"; static const char pci_device_19e7_1005[] = "STIX - 4 Port FXS Card"; #endif -#ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1a03[] = "ASPEED Technology, Inc."; static const char pci_device_1a03_2000[] = "AST2000"; -#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const char pci_vendor_1a08[] = "Sierra semiconductor"; static const char pci_device_1a08_0000[] = "SC15064"; @@ -21670,8 +21670,14 @@ static const char pci_device_8086_1043[] = "PRO/Wireless LAN 2100 3B Mini PCI Ad static const char pci_subsys_8086_1043_103c_08b0[] = "tc1100 tablet"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_1043_8086_2522[] = "Samsung P30 integrated WLAN"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_1043_8086_2527[] = "MIM2000/Centrino"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_1043_8086_2581[] = "Toshiba Satellite M10"; +#endif static const char pci_device_8086_1048[] = "PRO/10GbE LR Server Adapter"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_1048_8086_a01f[] = "PRO/10GbE LR Server Adapter"; @@ -21703,6 +21709,10 @@ static const char pci_subsys_8086_1050_8086_3427[] = "S875WP1-E mainboard"; static const char pci_device_8086_1051[] = "82801EB/ER (ICH5/ICH5R) integrated LAN Controller"; static const char pci_device_8086_1052[] = "PRO/100 VM Network Connection"; static const char pci_device_8086_1053[] = "PRO/100 VM Network Connection"; +static const char pci_device_8086_1054[] = "PRO/100 VE Network Connection"; +static const char pci_device_8086_1055[] = "PRO/100 VM Network Connection"; +static const char pci_device_8086_1056[] = "PRO/100 VE Network Connection"; +static const char pci_device_8086_1057[] = "PRO/100 VE Network Connection"; static const char pci_device_8086_1059[] = "82551QM Ethernet Controller"; static const char pci_device_8086_105b[] = "82546GB Gigabit Ethernet Controller (Copper)"; static const char pci_device_8086_105e[] = "82571EB Gigabit Ethernet Controller"; @@ -21897,7 +21907,11 @@ static const char pci_device_8086_108b[] = "82573V Gigabit Ethernet Controller ( static const char pci_device_8086_108c[] = "82573E Gigabit Ethernet Controller (Copper)"; static const char pci_device_8086_108e[] = "82573E KCS (Active Management)"; static const char pci_device_8086_108f[] = "Active Management Technology - SOL"; +static const char pci_device_8086_1091[] = "PRO/100 VM Network Connection"; static const char pci_device_8086_1092[] = "PRO/100 VE Network Connection"; +static const char pci_device_8086_1093[] = "PRO/100 VM Network Connection"; +static const char pci_device_8086_1094[] = "PRO/100 VE Network Connection"; +static const char pci_device_8086_1095[] = "PRO/100 VE Network Connection"; static const char pci_device_8086_1096[] = "80003ES2LAN Gigabit Ethernet Controller (Copper)"; static const char pci_device_8086_1097[] = "631xESB/632xESB DPT LAN Controller (Fiber)"; static const char pci_device_8086_1098[] = "80003ES2LAN Gigabit Ethernet Controller (Serdes)"; @@ -21907,6 +21921,9 @@ static const char pci_subsys_8086_1099_8086_1099[] = "PRO/1000 GT Quad Port Serv #endif static const char pci_device_8086_109a[] = "82573L Gigabit Ethernet Controller"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_109a_1179_ff10[] = "PRO/1000 PL"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_109a_17aa_2001[] = "ThinkPad T60"; #endif #ifdef INIT_SUBSYS_INFO @@ -21916,8 +21933,22 @@ static const char pci_subsys_8086_109a_17aa_207e[] = "Thinkpad X60s"; static const char pci_subsys_8086_109a_8086_109a[] = "PRO/1000 PL Network Connection"; #endif static const char pci_device_8086_109b[] = "82546GB PRO/1000 GF Quad Port Server Adapter"; +static const char pci_device_8086_109e[] = "82597EX 10GbE Ethernet Controller"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_109e_8086_a01f[] = "PRO/10GbE CX4 Server Adapter"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_109e_8086_a11f[] = "PRO/10GbE CX4 Server Adapter"; +#endif static const char pci_device_8086_10a0[] = "82571EB PRO/1000 AT Quad Port Bypass Adapter"; static const char pci_device_8086_10a1[] = "82571EB PRO/1000 AF Quad Port Bypass Adapter"; +static const char pci_device_8086_10a4[] = "82571EB Gigabit Ethernet Controller"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_10a4_8086_10a4[] = "PRO/1000 PT Quad Port Server Adapter"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_10a4_8086_11a4[] = "PRO/1000 PT Quad Port Server Adapter"; +#endif static const char pci_device_8086_10b0[] = "82573L PRO/1000 PL Network Connection"; static const char pci_device_8086_10b2[] = "82573V PRO/1000 PM Network Connection"; static const char pci_device_8086_10b3[] = "82573E PRO/1000 PM Network Connection"; @@ -21941,6 +21972,15 @@ static const char pci_subsys_8086_10b9_8086_1093[] = "PRO/1000 PT Desktop Adapte #endif static const char pci_device_8086_10ba[] = "80003ES2LAN Gigabit Ethernet Controller (Copper)"; static const char pci_device_8086_10bb[] = "80003ES2LAN Gigabit Ethernet Controller (Serdes)"; +static const char pci_device_8086_10bc[] = "82571EB Gigabit Ethernet Controller (Copper)"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_10bc_8086_10bc[] = "PRO/1000 PT Quad Port LP Server Adapter"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_10bc_8086_11bc[] = "PRO/1000 PT Quad Port LP Server Adapter"; +#endif +static const char pci_device_8086_10c4[] = "82562GT 10/100 Network Connection"; +static const char pci_device_8086_10c5[] = "82562G 10/100 Network Connection"; static const char pci_device_8086_1107[] = "PRO/1000 MF Server Adapter (LX)"; static const char pci_device_8086_1130[] = "82815 815 Chipset Host Bridge and Memory Controller Hub"; #ifdef INIT_SUBSYS_INFO @@ -22587,6 +22627,13 @@ static const char pci_subsys_8086_1a30_1028_010e[] = "Optiplex GX240"; static const char pci_device_8086_1a31[] = "82845 845 (Brookdale) Chipset AGP Bridge"; static const char pci_device_8086_1a38[] = "5000 Series Chipset DMA Engine"; static const char pci_device_8086_1a48[] = "PRO/10GbE SR Server Adapter"; +static const char pci_device_8086_1b48[] = "82597EX 10GbE Ethernet Controller"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_1b48_8086_a01f[] = "PRO/10GbE LR Server Adapter"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_1b48_8086_a11f[] = "PRO/10GbE LR Server Adapter"; +#endif static const char pci_device_8086_2410[] = "82801AA ISA Bridge (LPC)"; static const char pci_device_8086_2411[] = "82801AA IDE"; static const char pci_device_8086_2412[] = "82801AA USB"; @@ -22706,6 +22753,9 @@ static const char pci_subsys_8086_2444_8086_4532[] = "D815EEA2 mainboard"; #endif static const char pci_device_8086_2445[] = "82801BA/BAM AC'97 Audio"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2445_0e11_000b[] = "Compaq Deskpro EN Audio"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2445_0e11_0088[] = "Evo D500"; #endif #ifdef INIT_SUBSYS_INFO @@ -22738,6 +22788,9 @@ static const char pci_device_8086_2448[] = "82801 Mobile PCI Bridge"; static const char pci_subsys_8086_2448_103c_099c[] = "NX6110/NC6120"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2448_144d_c00c[] = "P30 notebook"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2448_1734_1055[] = "Amilo M1420"; #endif static const char pci_device_8086_2449[] = "82801BA/BAM/CA/CAM Ethernet Controller"; @@ -23045,6 +23098,9 @@ static const char pci_subsys_8086_24c2_103c_08b0[] = "tc1100 tablet"; static const char pci_subsys_8086_24c2_1071_8160[] = "MIM2000"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24c2_144d_c00c[] = "P30 notebook"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c2_1462_5800[] = "845PE Max (MS-6580)"; #endif #ifdef INIT_SUBSYS_INFO @@ -23134,6 +23190,9 @@ static const char pci_subsys_8086_24c4_103c_08b0[] = "tc1100 tablet"; static const char pci_subsys_8086_24c4_1071_8160[] = "MIM2000"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24c4_144d_c00c[] = "P30 notebook"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c4_1462_5800[] = "845PE Max (MS-6580)"; #endif #ifdef INIT_SUBSYS_INFO @@ -23183,6 +23242,9 @@ static const char pci_subsys_8086_24c5_103c_08b0[] = "tc1100 tablet"; static const char pci_subsys_8086_24c5_1071_8160[] = "MIM2000"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24c5_144d_c00c[] = "P30 notebook"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c5_1458_a002[] = "GA-8PE667 Ultra"; #endif #ifdef INIT_SUBSYS_INFO @@ -23219,6 +23281,9 @@ static const char pci_subsys_8086_24c6_103c_08b0[] = "tc1100 tablet"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c6_1071_8160[] = "MIM2000"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24c6_144d_c00c[] = "P30 notebook"; +#endif static const char pci_device_8086_24c7[] = "82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c7_1014_0267[] = "NetVista A30p"; @@ -23251,6 +23316,9 @@ static const char pci_subsys_8086_24c7_103c_08b0[] = "tc1100 tablet"; static const char pci_subsys_8086_24c7_1071_8160[] = "MIM2000"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24c7_144d_c00c[] = "P30 notebook"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24c7_1462_5800[] = "845PE Max (MS-6580)"; #endif #ifdef INIT_SUBSYS_INFO @@ -23291,6 +23359,9 @@ static const char pci_subsys_8086_24ca_103c_08b0[] = "tc1100 tablet"; static const char pci_subsys_8086_24ca_1071_8160[] = "MIM2000"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24ca_144d_c00c[] = "P30 notebook"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24ca_1734_1055[] = "Amilo M1420"; #endif #ifdef INIT_SUBSYS_INFO @@ -23317,6 +23388,9 @@ static const char pci_subsys_8086_24cb_4c53_1090[] = "Cx9 / Vx9 mainboard"; #endif static const char pci_device_8086_24cc[] = "82801DBM (ICH4-M) LPC Interface Bridge"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24cc_144d_c00c[] = "P30 notebook"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24cc_1734_1055[] = "Amilo M1420"; #endif static const char pci_device_8086_24cd[] = "82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller"; @@ -23360,6 +23434,9 @@ static const char pci_subsys_8086_24cd_1071_8160[] = "MIM2000"; static const char pci_subsys_8086_24cd_1179_ff00[] = "Satellite 2430"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24cd_144d_c00c[] = "P30 notebook"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24cd_1462_3981[] = "845PE Max (MS-6580)"; #endif #ifdef INIT_SUBSYS_INFO @@ -23466,6 +23543,9 @@ static const char pci_subsys_8086_24d3_1028_0156[] = "Precision 360"; static const char pci_subsys_8086_24d3_1028_0169[] = "Precision 470"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24d3_103c_12bc[] = "d330 uT"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24d3_1043_80a6[] = "P4P800 Mainboard"; #endif #ifdef INIT_SUBSYS_INFO @@ -23540,6 +23620,9 @@ static const char pci_subsys_8086_24d4_8086_524c[] = "D865PERL mainboard"; #endif static const char pci_device_8086_24d5[] = "82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_24d5_100a_147b[] = "Abit IS7-E motherboard"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_24d5_1028_0169[] = "Precision 470"; #endif #ifdef INIT_SUBSYS_INFO @@ -23835,6 +23918,9 @@ static const char pci_device_8086_2570[] = "82865G/PE/P DRAM Controller/Host-Hub static const char pci_subsys_8086_2570_103c_006a[] = "NX9500"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2570_103c_12bc[] = "d330 uT"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_2570_1043_80f2[] = "P5P800-MX Mainboard"; #endif #ifdef INIT_SUBSYS_INFO @@ -24068,7 +24154,7 @@ static const char pci_device_8086_25e4[] = "5000 Series Chipset PCI Express x4 P static const char pci_device_8086_25e5[] = "5000 Series Chipset PCI Express x4 Port 5"; static const char pci_device_8086_25e6[] = "5000 Series Chipset PCI Express x4 Port 6"; static const char pci_device_8086_25e7[] = "5000 Series Chipset PCI Express x4 Port 7"; -static const char pci_device_8086_25f0[] = "5000 Series Chipset Error Reporting Registers"; +static const char pci_device_8086_25f0[] = "5000 Series Chipset FSB Registers"; static const char pci_device_8086_25f1[] = "5000 Series Chipset Reserved Registers"; static const char pci_device_8086_25f3[] = "5000 Series Chipset Reserved Registers"; static const char pci_device_8086_25f5[] = "5000 Series Chipset FBD Registers"; @@ -24089,7 +24175,7 @@ static const char pci_device_8086_2608[] = "E8500/E8501 PCI Express x8 Port C"; static const char pci_device_8086_2609[] = "E8500/E8501 PCI Express x8 Port B"; static const char pci_device_8086_260a[] = "E8500/E8501 PCI Express x8 Port A"; static const char pci_device_8086_260c[] = "E8500/E8501 IMI Registers"; -static const char pci_device_8086_2610[] = "E8500/E8501 Front Side Bus, Boot, and Interrupt Registers"; +static const char pci_device_8086_2610[] = "E8500/E8501 FSB Registers"; static const char pci_device_8086_2611[] = "E8500/E8501 Address Mapping Registers"; static const char pci_device_8086_2612[] = "E8500/E8501 RAS Registers"; static const char pci_device_8086_2613[] = "E8500/E8501 Reserved Registers"; @@ -24400,6 +24486,9 @@ static const char pci_subsys_8086_27b8_8086_544e[] = "DeskTop Board D945GTP"; #endif static const char pci_device_8086_27b9[] = "82801GBM (ICH7-M) LPC Interface Bridge"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_27b9_10f7_8338[] = "Panasonic CF-Y5 laptop"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_27b9_17aa_2009[] = "ThinkPad T60/R60 series"; #endif static const char pci_device_8086_27bd[] = "82801GHM (ICH7-M DH) LPC Interface Bridge"; @@ -24474,6 +24563,12 @@ static const char pci_device_8086_27d8[] = "82801G (ICH7 Family) High Definition static const char pci_subsys_8086_27d8_107b_5048[] = "E4500"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_27d8_10f7_8338[] = "Panasonic CF-Y5 laptop"; +#endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_27d8_1179_ff31[] = "Toshiba America Information Systems:AC97 Data Fax SoftModem with SmartCP"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_27d8_152d_0753[] = "Softmodem"; #endif #ifdef INIT_SUBSYS_INFO @@ -24481,6 +24576,9 @@ static const char pci_subsys_8086_27d8_17aa_2010[] = "ThinkPad T60/R60 series"; #endif static const char pci_device_8086_27da[] = "82801G (ICH7 Family) SMBus Controller"; #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_27da_10f7_8338[] = "Panasonic CF-Y5 laptop"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_27da_17aa_200f[] = "ThinkPad T60/R60 series"; #endif #ifdef INIT_SUBSYS_INFO @@ -24497,6 +24595,9 @@ static const char pci_device_8086_27df[] = "82801G (ICH7 Family) IDE Controller" static const char pci_subsys_8086_27df_107b_5048[] = "E4500"; #endif #ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_27df_10f7_8338[] = "Panasonic CF-Y5 laptop"; +#endif +#ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_27df_17aa_200c[] = "Thinkpad R60e model 0657"; #endif #ifdef INIT_SUBSYS_INFO @@ -24510,21 +24611,42 @@ static const char pci_device_8086_2812[] = "82801HH (ICH8DH) LPC Interface Contr static const char pci_device_8086_2814[] = "82801HO (ICH8DO) LPC Interface Controller"; static const char pci_device_8086_2815[] = "Mobile LPC Interface Controller"; static const char pci_device_8086_2820[] = "82801H (ICH8 Family) 4 port SATA IDE Controller"; -static const char pci_device_8086_2821[] = "82801HB (ICH8) SATA AHCI Controller"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2820_1462_7235[] = "P965 Neo MS-7235 mainboard"; +#endif +static const char pci_device_8086_2821[] = "82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA AHCI Controller"; static const char pci_device_8086_2822[] = "82801HR/HO/HH (ICH8R/DO/DH) SATA RAID Controller"; -static const char pci_device_8086_2824[] = "82801HR/HO/HH (ICH8R/DO/DH) SATA AHCI Controller"; +static const char pci_device_8086_2824[] = "82801HB (ICH8) 4 port SATA AHCI Controller"; static const char pci_device_8086_2825[] = "82801H (ICH8 Family) 2 port SATA IDE Controller"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2825_1462_7235[] = "P965 Neo MS-7235 mainboard"; +#endif static const char pci_device_8086_2828[] = "Mobile SATA IDE Controller"; static const char pci_device_8086_2829[] = "Mobile SATA AHCI Controller"; static const char pci_device_8086_282a[] = "Mobile SATA RAID Controller"; static const char pci_device_8086_2830[] = "82801H (ICH8 Family) USB UHCI #1"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2830_1462_7235[] = "P965 Neo MS-7235 mainboard"; +#endif static const char pci_device_8086_2831[] = "82801H (ICH8 Family) USB UHCI #2"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2831_1462_7235[] = "P965 Neo MS-7235 mainboard"; +#endif static const char pci_device_8086_2832[] = "82801H (ICH8 Family) USB UHCI #3"; static const char pci_device_8086_2834[] = "82801H (ICH8 Family) USB UHCI #4"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2834_1462_7235[] = "P965 Neo MS-7235 mainboard"; +#endif static const char pci_device_8086_2835[] = "82801H (ICH8 Family) USB UHCI #5"; static const char pci_device_8086_2836[] = "82801H (ICH8 Family) USB2 EHCI #1"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_2836_1462_7235[] = "P965 Neo MS-7235 mainboard"; +#endif static const char pci_device_8086_283a[] = "82801H (ICH8 Family) USB2 EHCI #2"; static const char pci_device_8086_283e[] = "82801H (ICH8 Family) SMBus Controller"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_283e_1462_7235[] = "P965 Neo MS-7235 mainboard"; +#endif static const char pci_device_8086_283f[] = "82801H (ICH8 Family) PCI Express Port 1"; static const char pci_device_8086_2841[] = "82801H (ICH8 Family) PCI Express Port 2"; static const char pci_device_8086_2843[] = "82801H (ICH8 Family) PCI Express Port 3"; @@ -24571,6 +24693,9 @@ static const char pci_device_8086_2a06[] = "Mobile PT IDER Controller"; static const char pci_device_8086_2a07[] = "Mobile KT Controller"; static const char pci_device_8086_3092[] = "Integrated RAID"; static const char pci_device_8086_3200[] = "GD31244 PCI-X SATA HBA"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_3200_1775_c200[] = "C2K onboard SATA host bus adapter"; +#endif static const char pci_device_8086_3340[] = "82855PM Processor to I/O Controller"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_3340_1025_005a[] = "TravelMate 290"; @@ -24584,7 +24709,13 @@ static const char pci_subsys_8086_3340_103c_0890[] = "NC6000 laptop"; #ifdef INIT_SUBSYS_INFO static const char pci_subsys_8086_3340_103c_08b0[] = "tc1100 tablet"; #endif +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_3340_144d_c00c[] = "P30 notebook"; +#endif static const char pci_device_8086_3341[] = "82855PM Processor to AGP Controller"; +#ifdef INIT_SUBSYS_INFO +static const char pci_subsys_8086_3341_144d_c00c[] = "P30 notebook"; +#endif static const char pci_device_8086_3500[] = "6311ESB/6321ESB PCI Express Upstream Port"; static const char pci_device_8086_3501[] = "6310ESB PCI Express Upstream Port"; static const char pci_device_8086_3504[] = "6311ESB/6321ESB I/OxAPIC Interrupt Controller"; @@ -40853,10 +40984,18 @@ static const pciSubsystemInfo pci_ss_info_8086_1043_103c_08b0 = {0x103c, 0x08b0, pci_subsys_8086_1043_103c_08b0, 0}; #undef pci_ss_info_103c_08b0 #define pci_ss_info_103c_08b0 pci_ss_info_8086_1043_103c_08b0 +static const pciSubsystemInfo pci_ss_info_8086_1043_8086_2522 = + {0x8086, 0x2522, pci_subsys_8086_1043_8086_2522, 0}; +#undef pci_ss_info_8086_2522 +#define pci_ss_info_8086_2522 pci_ss_info_8086_1043_8086_2522 static const pciSubsystemInfo pci_ss_info_8086_1043_8086_2527 = {0x8086, 0x2527, pci_subsys_8086_1043_8086_2527, 0}; #undef pci_ss_info_8086_2527 #define pci_ss_info_8086_2527 pci_ss_info_8086_1043_8086_2527 +static const pciSubsystemInfo pci_ss_info_8086_1043_8086_2581 = + {0x8086, 0x2581, pci_subsys_8086_1043_8086_2581, 0}; +#undef pci_ss_info_8086_2581 +#define pci_ss_info_8086_2581 pci_ss_info_8086_1043_8086_2581 static const pciSubsystemInfo pci_ss_info_8086_1048_8086_a01f = {0x8086, 0xa01f, pci_subsys_8086_1048_8086_a01f, 0}; #undef pci_ss_info_8086_a01f @@ -41097,6 +41236,10 @@ static const pciSubsystemInfo pci_ss_info_8086_1099_8086_1099 = {0x8086, 0x1099, pci_subsys_8086_1099_8086_1099, 0}; #undef pci_ss_info_8086_1099 #define pci_ss_info_8086_1099 pci_ss_info_8086_1099_8086_1099 +static const pciSubsystemInfo pci_ss_info_8086_109a_1179_ff10 = + {0x1179, 0xff10, pci_subsys_8086_109a_1179_ff10, 0}; +#undef pci_ss_info_1179_ff10 +#define pci_ss_info_1179_ff10 pci_ss_info_8086_109a_1179_ff10 static const pciSubsystemInfo pci_ss_info_8086_109a_17aa_2001 = {0x17aa, 0x2001, pci_subsys_8086_109a_17aa_2001, 0}; #undef pci_ss_info_17aa_2001 @@ -41109,6 +41252,22 @@ static const pciSubsystemInfo pci_ss_info_8086_109a_8086_109a = {0x8086, 0x109a, pci_subsys_8086_109a_8086_109a, 0}; #undef pci_ss_info_8086_109a #define pci_ss_info_8086_109a pci_ss_info_8086_109a_8086_109a +static const pciSubsystemInfo pci_ss_info_8086_109e_8086_a01f = + {0x8086, 0xa01f, pci_subsys_8086_109e_8086_a01f, 0}; +#undef pci_ss_info_8086_a01f +#define pci_ss_info_8086_a01f pci_ss_info_8086_109e_8086_a01f +static const pciSubsystemInfo pci_ss_info_8086_109e_8086_a11f = + {0x8086, 0xa11f, pci_subsys_8086_109e_8086_a11f, 0}; +#undef pci_ss_info_8086_a11f +#define pci_ss_info_8086_a11f pci_ss_info_8086_109e_8086_a11f +static const pciSubsystemInfo pci_ss_info_8086_10a4_8086_10a4 = + {0x8086, 0x10a4, pci_subsys_8086_10a4_8086_10a4, 0}; +#undef pci_ss_info_8086_10a4 +#define pci_ss_info_8086_10a4 pci_ss_info_8086_10a4_8086_10a4 +static const pciSubsystemInfo pci_ss_info_8086_10a4_8086_11a4 = + {0x8086, 0x11a4, pci_subsys_8086_10a4_8086_11a4, 0}; +#undef pci_ss_info_8086_11a4 +#define pci_ss_info_8086_11a4 pci_ss_info_8086_10a4_8086_11a4 static const pciSubsystemInfo pci_ss_info_8086_10b5_103c_3109 = {0x103c, 0x3109, pci_subsys_8086_10b5_103c_3109, 0}; #undef pci_ss_info_103c_3109 @@ -41129,6 +41288,14 @@ static const pciSubsystemInfo pci_ss_info_8086_10b9_8086_1093 = {0x8086, 0x1093, pci_subsys_8086_10b9_8086_1093, 0}; #undef pci_ss_info_8086_1093 #define pci_ss_info_8086_1093 pci_ss_info_8086_10b9_8086_1093 +static const pciSubsystemInfo pci_ss_info_8086_10bc_8086_10bc = + {0x8086, 0x10bc, pci_subsys_8086_10bc_8086_10bc, 0}; +#undef pci_ss_info_8086_10bc +#define pci_ss_info_8086_10bc pci_ss_info_8086_10bc_8086_10bc +static const pciSubsystemInfo pci_ss_info_8086_10bc_8086_11bc = + {0x8086, 0x11bc, pci_subsys_8086_10bc_8086_11bc, 0}; +#undef pci_ss_info_8086_11bc +#define pci_ss_info_8086_11bc pci_ss_info_8086_10bc_8086_11bc static const pciSubsystemInfo pci_ss_info_8086_1130_1025_1016 = {0x1025, 0x1016, pci_subsys_8086_1130_1025_1016, 0}; #undef pci_ss_info_1025_1016 @@ -41929,6 +42096,14 @@ static const pciSubsystemInfo pci_ss_info_8086_1a30_1028_010e = {0x1028, 0x010e, pci_subsys_8086_1a30_1028_010e, 0}; #undef pci_ss_info_1028_010e #define pci_ss_info_1028_010e pci_ss_info_8086_1a30_1028_010e +static const pciSubsystemInfo pci_ss_info_8086_1b48_8086_a01f = + {0x8086, 0xa01f, pci_subsys_8086_1b48_8086_a01f, 0}; +#undef pci_ss_info_8086_a01f +#define pci_ss_info_8086_a01f pci_ss_info_8086_1b48_8086_a01f +static const pciSubsystemInfo pci_ss_info_8086_1b48_8086_a11f = + {0x8086, 0xa11f, pci_subsys_8086_1b48_8086_a11f, 0}; +#undef pci_ss_info_8086_a11f +#define pci_ss_info_8086_a11f pci_ss_info_8086_1b48_8086_a11f static const pciSubsystemInfo pci_ss_info_8086_2415_1028_0095 = {0x1028, 0x0095, pci_subsys_8086_2415_1028_0095, 0}; #undef pci_ss_info_1028_0095 @@ -42061,6 +42236,10 @@ static const pciSubsystemInfo pci_ss_info_8086_2444_8086_4532 = {0x8086, 0x4532, pci_subsys_8086_2444_8086_4532, 0}; #undef pci_ss_info_8086_4532 #define pci_ss_info_8086_4532 pci_ss_info_8086_2444_8086_4532 +static const pciSubsystemInfo pci_ss_info_8086_2445_0e11_000b = + {0x0e11, 0x000b, pci_subsys_8086_2445_0e11_000b, 0}; +#undef pci_ss_info_0e11_000b +#define pci_ss_info_0e11_000b pci_ss_info_8086_2445_0e11_000b static const pciSubsystemInfo pci_ss_info_8086_2445_0e11_0088 = {0x0e11, 0x0088, pci_subsys_8086_2445_0e11_0088, 0}; #undef pci_ss_info_0e11_0088 @@ -42101,6 +42280,10 @@ static const pciSubsystemInfo pci_ss_info_8086_2448_103c_099c = {0x103c, 0x099c, pci_subsys_8086_2448_103c_099c, 0}; #undef pci_ss_info_103c_099c #define pci_ss_info_103c_099c pci_ss_info_8086_2448_103c_099c +static const pciSubsystemInfo pci_ss_info_8086_2448_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_2448_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_2448_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_2448_1734_1055 = {0x1734, 0x1055, pci_subsys_8086_2448_1734_1055, 0}; #undef pci_ss_info_1734_1055 @@ -42477,6 +42660,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24c2_1071_8160 = {0x1071, 0x8160, pci_subsys_8086_24c2_1071_8160, 0}; #undef pci_ss_info_1071_8160 #define pci_ss_info_1071_8160 pci_ss_info_8086_24c2_1071_8160 +static const pciSubsystemInfo pci_ss_info_8086_24c2_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_24c2_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_24c2_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_24c2_1462_5800 = {0x1462, 0x5800, pci_subsys_8086_24c2_1462_5800, 0}; #undef pci_ss_info_1462_5800 @@ -42593,6 +42780,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24c4_1071_8160 = {0x1071, 0x8160, pci_subsys_8086_24c4_1071_8160, 0}; #undef pci_ss_info_1071_8160 #define pci_ss_info_1071_8160 pci_ss_info_8086_24c4_1071_8160 +static const pciSubsystemInfo pci_ss_info_8086_24c4_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_24c4_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_24c4_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_24c4_1462_5800 = {0x1462, 0x5800, pci_subsys_8086_24c4_1462_5800, 0}; #undef pci_ss_info_1462_5800 @@ -42657,6 +42848,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24c5_1071_8160 = {0x1071, 0x8160, pci_subsys_8086_24c5_1071_8160, 0}; #undef pci_ss_info_1071_8160 #define pci_ss_info_1071_8160 pci_ss_info_8086_24c5_1071_8160 +static const pciSubsystemInfo pci_ss_info_8086_24c5_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_24c5_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_24c5_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_24c5_1458_a002 = {0x1458, 0xa002, pci_subsys_8086_24c5_1458_a002, 0}; #undef pci_ss_info_1458_a002 @@ -42705,6 +42900,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24c6_1071_8160 = {0x1071, 0x8160, pci_subsys_8086_24c6_1071_8160, 0}; #undef pci_ss_info_1071_8160 #define pci_ss_info_1071_8160 pci_ss_info_8086_24c6_1071_8160 +static const pciSubsystemInfo pci_ss_info_8086_24c6_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_24c6_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_24c6_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_24c7_1014_0267 = {0x1014, 0x0267, pci_subsys_8086_24c7_1014_0267, 0}; #undef pci_ss_info_1014_0267 @@ -42745,6 +42944,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24c7_1071_8160 = {0x1071, 0x8160, pci_subsys_8086_24c7_1071_8160, 0}; #undef pci_ss_info_1071_8160 #define pci_ss_info_1071_8160 pci_ss_info_8086_24c7_1071_8160 +static const pciSubsystemInfo pci_ss_info_8086_24c7_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_24c7_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_24c7_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_24c7_1462_5800 = {0x1462, 0x5800, pci_subsys_8086_24c7_1462_5800, 0}; #undef pci_ss_info_1462_5800 @@ -42797,6 +43000,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24ca_1071_8160 = {0x1071, 0x8160, pci_subsys_8086_24ca_1071_8160, 0}; #undef pci_ss_info_1071_8160 #define pci_ss_info_1071_8160 pci_ss_info_8086_24ca_1071_8160 +static const pciSubsystemInfo pci_ss_info_8086_24ca_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_24ca_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_24ca_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_24ca_1734_1055 = {0x1734, 0x1055, pci_subsys_8086_24ca_1734_1055, 0}; #undef pci_ss_info_1734_1055 @@ -42829,6 +43036,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24cb_4c53_1090 = {0x4c53, 0x1090, pci_subsys_8086_24cb_4c53_1090, 0}; #undef pci_ss_info_4c53_1090 #define pci_ss_info_4c53_1090 pci_ss_info_8086_24cb_4c53_1090 +static const pciSubsystemInfo pci_ss_info_8086_24cc_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_24cc_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_24cc_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_24cc_1734_1055 = {0x1734, 0x1055, pci_subsys_8086_24cc_1734_1055, 0}; #undef pci_ss_info_1734_1055 @@ -42885,6 +43096,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24cd_1179_ff00 = {0x1179, 0xff00, pci_subsys_8086_24cd_1179_ff00, 0}; #undef pci_ss_info_1179_ff00 #define pci_ss_info_1179_ff00 pci_ss_info_8086_24cd_1179_ff00 +static const pciSubsystemInfo pci_ss_info_8086_24cd_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_24cd_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_24cd_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_24cd_1462_3981 = {0x1462, 0x3981, pci_subsys_8086_24cd_1462_3981, 0}; #undef pci_ss_info_1462_3981 @@ -43021,6 +43236,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24d3_1028_0169 = {0x1028, 0x0169, pci_subsys_8086_24d3_1028_0169, 0}; #undef pci_ss_info_1028_0169 #define pci_ss_info_1028_0169 pci_ss_info_8086_24d3_1028_0169 +static const pciSubsystemInfo pci_ss_info_8086_24d3_103c_12bc = + {0x103c, 0x12bc, pci_subsys_8086_24d3_103c_12bc, 0}; +#undef pci_ss_info_103c_12bc +#define pci_ss_info_103c_12bc pci_ss_info_8086_24d3_103c_12bc static const pciSubsystemInfo pci_ss_info_8086_24d3_1043_80a6 = {0x1043, 0x80a6, pci_subsys_8086_24d3_1043_80a6, 0}; #undef pci_ss_info_1043_80a6 @@ -43117,6 +43336,10 @@ static const pciSubsystemInfo pci_ss_info_8086_24d4_8086_524c = {0x8086, 0x524c, pci_subsys_8086_24d4_8086_524c, 0}; #undef pci_ss_info_8086_524c #define pci_ss_info_8086_524c pci_ss_info_8086_24d4_8086_524c +static const pciSubsystemInfo pci_ss_info_8086_24d5_100a_147b = + {0x100a, 0x147b, pci_subsys_8086_24d5_100a_147b, 0}; +#undef pci_ss_info_100a_147b +#define pci_ss_info_100a_147b pci_ss_info_8086_24d5_100a_147b static const pciSubsystemInfo pci_ss_info_8086_24d5_1028_0169 = {0x1028, 0x0169, pci_subsys_8086_24d5_1028_0169, 0}; #undef pci_ss_info_1028_0169 @@ -43461,6 +43684,10 @@ static const pciSubsystemInfo pci_ss_info_8086_2570_103c_006a = {0x103c, 0x006a, pci_subsys_8086_2570_103c_006a, 0}; #undef pci_ss_info_103c_006a #define pci_ss_info_103c_006a pci_ss_info_8086_2570_103c_006a +static const pciSubsystemInfo pci_ss_info_8086_2570_103c_12bc = + {0x103c, 0x12bc, pci_subsys_8086_2570_103c_12bc, 0}; +#undef pci_ss_info_103c_12bc +#define pci_ss_info_103c_12bc pci_ss_info_8086_2570_103c_12bc static const pciSubsystemInfo pci_ss_info_8086_2570_1043_80f2 = {0x1043, 0x80f2, pci_subsys_8086_2570_1043_80f2, 0}; #undef pci_ss_info_1043_80f2 @@ -44021,6 +44248,10 @@ static const pciSubsystemInfo pci_ss_info_8086_27b8_8086_544e = {0x8086, 0x544e, pci_subsys_8086_27b8_8086_544e, 0}; #undef pci_ss_info_8086_544e #define pci_ss_info_8086_544e pci_ss_info_8086_27b8_8086_544e +static const pciSubsystemInfo pci_ss_info_8086_27b9_10f7_8338 = + {0x10f7, 0x8338, pci_subsys_8086_27b9_10f7_8338, 0}; +#undef pci_ss_info_10f7_8338 +#define pci_ss_info_10f7_8338 pci_ss_info_8086_27b9_10f7_8338 static const pciSubsystemInfo pci_ss_info_8086_27b9_17aa_2009 = {0x17aa, 0x2009, pci_subsys_8086_27b9_17aa_2009, 0}; #undef pci_ss_info_17aa_2009 @@ -44097,6 +44328,14 @@ static const pciSubsystemInfo pci_ss_info_8086_27d8_107b_5048 = {0x107b, 0x5048, pci_subsys_8086_27d8_107b_5048, 0}; #undef pci_ss_info_107b_5048 #define pci_ss_info_107b_5048 pci_ss_info_8086_27d8_107b_5048 +static const pciSubsystemInfo pci_ss_info_8086_27d8_10f7_8338 = + {0x10f7, 0x8338, pci_subsys_8086_27d8_10f7_8338, 0}; +#undef pci_ss_info_10f7_8338 +#define pci_ss_info_10f7_8338 pci_ss_info_8086_27d8_10f7_8338 +static const pciSubsystemInfo pci_ss_info_8086_27d8_1179_ff31 = + {0x1179, 0xff31, pci_subsys_8086_27d8_1179_ff31, 0}; +#undef pci_ss_info_1179_ff31 +#define pci_ss_info_1179_ff31 pci_ss_info_8086_27d8_1179_ff31 static const pciSubsystemInfo pci_ss_info_8086_27d8_152d_0753 = {0x152d, 0x0753, pci_subsys_8086_27d8_152d_0753, 0}; #undef pci_ss_info_152d_0753 @@ -44105,6 +44344,10 @@ static const pciSubsystemInfo pci_ss_info_8086_27d8_17aa_2010 = {0x17aa, 0x2010, pci_subsys_8086_27d8_17aa_2010, 0}; #undef pci_ss_info_17aa_2010 #define pci_ss_info_17aa_2010 pci_ss_info_8086_27d8_17aa_2010 +static const pciSubsystemInfo pci_ss_info_8086_27da_10f7_8338 = + {0x10f7, 0x8338, pci_subsys_8086_27da_10f7_8338, 0}; +#undef pci_ss_info_10f7_8338 +#define pci_ss_info_10f7_8338 pci_ss_info_8086_27da_10f7_8338 static const pciSubsystemInfo pci_ss_info_8086_27da_17aa_200f = {0x17aa, 0x200f, pci_subsys_8086_27da_17aa_200f, 0}; #undef pci_ss_info_17aa_200f @@ -44121,6 +44364,10 @@ static const pciSubsystemInfo pci_ss_info_8086_27df_107b_5048 = {0x107b, 0x5048, pci_subsys_8086_27df_107b_5048, 0}; #undef pci_ss_info_107b_5048 #define pci_ss_info_107b_5048 pci_ss_info_8086_27df_107b_5048 +static const pciSubsystemInfo pci_ss_info_8086_27df_10f7_8338 = + {0x10f7, 0x8338, pci_subsys_8086_27df_10f7_8338, 0}; +#undef pci_ss_info_10f7_8338 +#define pci_ss_info_10f7_8338 pci_ss_info_8086_27df_10f7_8338 static const pciSubsystemInfo pci_ss_info_8086_27df_17aa_200c = {0x17aa, 0x200c, pci_subsys_8086_27df_17aa_200c, 0}; #undef pci_ss_info_17aa_200c @@ -44129,6 +44376,38 @@ static const pciSubsystemInfo pci_ss_info_8086_27df_8086_544e = {0x8086, 0x544e, pci_subsys_8086_27df_8086_544e, 0}; #undef pci_ss_info_8086_544e #define pci_ss_info_8086_544e pci_ss_info_8086_27df_8086_544e +static const pciSubsystemInfo pci_ss_info_8086_2820_1462_7235 = + {0x1462, 0x7235, pci_subsys_8086_2820_1462_7235, 0}; +#undef pci_ss_info_1462_7235 +#define pci_ss_info_1462_7235 pci_ss_info_8086_2820_1462_7235 +static const pciSubsystemInfo pci_ss_info_8086_2825_1462_7235 = + {0x1462, 0x7235, pci_subsys_8086_2825_1462_7235, 0}; +#undef pci_ss_info_1462_7235 +#define pci_ss_info_1462_7235 pci_ss_info_8086_2825_1462_7235 +static const pciSubsystemInfo pci_ss_info_8086_2830_1462_7235 = + {0x1462, 0x7235, pci_subsys_8086_2830_1462_7235, 0}; +#undef pci_ss_info_1462_7235 +#define pci_ss_info_1462_7235 pci_ss_info_8086_2830_1462_7235 +static const pciSubsystemInfo pci_ss_info_8086_2831_1462_7235 = + {0x1462, 0x7235, pci_subsys_8086_2831_1462_7235, 0}; +#undef pci_ss_info_1462_7235 +#define pci_ss_info_1462_7235 pci_ss_info_8086_2831_1462_7235 +static const pciSubsystemInfo pci_ss_info_8086_2834_1462_7235 = + {0x1462, 0x7235, pci_subsys_8086_2834_1462_7235, 0}; +#undef pci_ss_info_1462_7235 +#define pci_ss_info_1462_7235 pci_ss_info_8086_2834_1462_7235 +static const pciSubsystemInfo pci_ss_info_8086_2836_1462_7235 = + {0x1462, 0x7235, pci_subsys_8086_2836_1462_7235, 0}; +#undef pci_ss_info_1462_7235 +#define pci_ss_info_1462_7235 pci_ss_info_8086_2836_1462_7235 +static const pciSubsystemInfo pci_ss_info_8086_283e_1462_7235 = + {0x1462, 0x7235, pci_subsys_8086_283e_1462_7235, 0}; +#undef pci_ss_info_1462_7235 +#define pci_ss_info_1462_7235 pci_ss_info_8086_283e_1462_7235 +static const pciSubsystemInfo pci_ss_info_8086_3200_1775_c200 = + {0x1775, 0xc200, pci_subsys_8086_3200_1775_c200, 0}; +#undef pci_ss_info_1775_c200 +#define pci_ss_info_1775_c200 pci_ss_info_8086_3200_1775_c200 static const pciSubsystemInfo pci_ss_info_8086_3340_1025_005a = {0x1025, 0x005a, pci_subsys_8086_3340_1025_005a, 0}; #undef pci_ss_info_1025_005a @@ -44145,6 +44424,14 @@ static const pciSubsystemInfo pci_ss_info_8086_3340_103c_08b0 = {0x103c, 0x08b0, pci_subsys_8086_3340_103c_08b0, 0}; #undef pci_ss_info_103c_08b0 #define pci_ss_info_103c_08b0 pci_ss_info_8086_3340_103c_08b0 +static const pciSubsystemInfo pci_ss_info_8086_3340_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_3340_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_3340_144d_c00c +static const pciSubsystemInfo pci_ss_info_8086_3341_144d_c00c = + {0x144d, 0xc00c, pci_subsys_8086_3341_144d_c00c, 0}; +#undef pci_ss_info_144d_c00c +#define pci_ss_info_144d_c00c pci_ss_info_8086_3341_144d_c00c static const pciSubsystemInfo pci_ss_info_8086_3575_0e11_0030 = {0x0e11, 0x0030, pci_subsys_8086_3575_0e11_0030, 0}; #undef pci_ss_info_0e11_0030 @@ -48590,10 +48877,12 @@ static const pciSubsystemInfo *pci_ss_list_1077_2422[] = { NULL }; #define pci_ss_list_1077_2432 NULL -#define pci_ss_list_1077_3010 NULL #define pci_ss_list_1077_3022 NULL +#define pci_ss_list_1077_3032 NULL #define pci_ss_list_1077_4010 NULL #define pci_ss_list_1077_4022 NULL +#define pci_ss_list_1077_4032 NULL +#define pci_ss_list_1077_5432 NULL #define pci_ss_list_1077_6312 NULL #define pci_ss_list_1077_6322 NULL #endif @@ -55730,7 +56019,9 @@ static const pciSubsystemInfo *pci_ss_list_8086_1040[] = { }; static const pciSubsystemInfo *pci_ss_list_8086_1043[] = { &pci_ss_info_8086_1043_103c_08b0, + &pci_ss_info_8086_1043_8086_2522, &pci_ss_info_8086_1043_8086_2527, + &pci_ss_info_8086_1043_8086_2581, NULL }; static const pciSubsystemInfo *pci_ss_list_8086_1048[] = { @@ -55754,6 +56045,10 @@ static const pciSubsystemInfo *pci_ss_list_8086_1050[] = { #define pci_ss_list_8086_1051 NULL #define pci_ss_list_8086_1052 NULL #define pci_ss_list_8086_1053 NULL +#define pci_ss_list_8086_1054 NULL +#define pci_ss_list_8086_1055 NULL +#define pci_ss_list_8086_1056 NULL +#define pci_ss_list_8086_1057 NULL #define pci_ss_list_8086_1059 NULL #define pci_ss_list_8086_105b NULL static const pciSubsystemInfo *pci_ss_list_8086_105e[] = { @@ -55874,7 +56169,11 @@ static const pciSubsystemInfo *pci_ss_list_8086_108a[] = { #define pci_ss_list_8086_108c NULL #define pci_ss_list_8086_108e NULL #define pci_ss_list_8086_108f NULL +#define pci_ss_list_8086_1091 NULL #define pci_ss_list_8086_1092 NULL +#define pci_ss_list_8086_1093 NULL +#define pci_ss_list_8086_1094 NULL +#define pci_ss_list_8086_1095 NULL #define pci_ss_list_8086_1096 NULL #define pci_ss_list_8086_1097 NULL #define pci_ss_list_8086_1098 NULL @@ -55883,14 +56182,25 @@ static const pciSubsystemInfo *pci_ss_list_8086_1099[] = { NULL }; static const pciSubsystemInfo *pci_ss_list_8086_109a[] = { + &pci_ss_info_8086_109a_1179_ff10, &pci_ss_info_8086_109a_17aa_2001, &pci_ss_info_8086_109a_17aa_207e, &pci_ss_info_8086_109a_8086_109a, NULL }; #define pci_ss_list_8086_109b NULL +static const pciSubsystemInfo *pci_ss_list_8086_109e[] = { + &pci_ss_info_8086_109e_8086_a01f, + &pci_ss_info_8086_109e_8086_a11f, + NULL +}; #define pci_ss_list_8086_10a0 NULL #define pci_ss_list_8086_10a1 NULL +static const pciSubsystemInfo *pci_ss_list_8086_10a4[] = { + &pci_ss_info_8086_10a4_8086_10a4, + &pci_ss_info_8086_10a4_8086_11a4, + NULL +}; #define pci_ss_list_8086_10b0 NULL #define pci_ss_list_8086_10b2 NULL #define pci_ss_list_8086_10b3 NULL @@ -55908,6 +56218,13 @@ static const pciSubsystemInfo *pci_ss_list_8086_10b9[] = { }; #define pci_ss_list_8086_10ba NULL #define pci_ss_list_8086_10bb NULL +static const pciSubsystemInfo *pci_ss_list_8086_10bc[] = { + &pci_ss_info_8086_10bc_8086_10bc, + &pci_ss_info_8086_10bc_8086_11bc, + NULL +}; +#define pci_ss_list_8086_10c4 NULL +#define pci_ss_list_8086_10c5 NULL #define pci_ss_list_8086_1107 NULL static const pciSubsystemInfo *pci_ss_list_8086_1130[] = { &pci_ss_info_8086_1130_1025_1016, @@ -56176,6 +56493,11 @@ static const pciSubsystemInfo *pci_ss_list_8086_1a30[] = { #define pci_ss_list_8086_1a31 NULL #define pci_ss_list_8086_1a38 NULL #define pci_ss_list_8086_1a48 NULL +static const pciSubsystemInfo *pci_ss_list_8086_1b48[] = { + &pci_ss_info_8086_1b48_8086_a01f, + &pci_ss_info_8086_1b48_8086_a11f, + NULL +}; #define pci_ss_list_8086_2410 NULL #define pci_ss_list_8086_2411 NULL #define pci_ss_list_8086_2412 NULL @@ -56238,6 +56560,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_2444[] = { NULL }; static const pciSubsystemInfo *pci_ss_list_8086_2445[] = { + &pci_ss_info_8086_2445_0e11_000b, &pci_ss_info_8086_2445_0e11_0088, &pci_ss_info_8086_2445_1014_01c6, &pci_ss_info_8086_2445_1025_1016, @@ -56254,6 +56577,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_2446[] = { }; static const pciSubsystemInfo *pci_ss_list_8086_2448[] = { &pci_ss_info_8086_2448_103c_099c, + &pci_ss_info_8086_2448_144d_c00c, &pci_ss_info_8086_2448_1734_1055, NULL }; @@ -56401,6 +56725,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24c2[] = { &pci_ss_info_8086_24c2_103c_0890, &pci_ss_info_8086_24c2_103c_08b0, &pci_ss_info_8086_24c2_1071_8160, + &pci_ss_info_8086_24c2_144d_c00c, &pci_ss_info_8086_24c2_1462_5800, &pci_ss_info_8086_24c2_1509_2990, &pci_ss_info_8086_24c2_1734_1004, @@ -56436,6 +56761,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24c4[] = { &pci_ss_info_8086_24c4_103c_0890, &pci_ss_info_8086_24c4_103c_08b0, &pci_ss_info_8086_24c4_1071_8160, + &pci_ss_info_8086_24c4_144d_c00c, &pci_ss_info_8086_24c4_1462_5800, &pci_ss_info_8086_24c4_1509_2990, &pci_ss_info_8086_24c4_1734_1004, @@ -56455,6 +56781,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24c5[] = { &pci_ss_info_8086_24c5_103c_0890, &pci_ss_info_8086_24c5_103c_08b0, &pci_ss_info_8086_24c5_1071_8160, + &pci_ss_info_8086_24c5_144d_c00c, &pci_ss_info_8086_24c5_1458_a002, &pci_ss_info_8086_24c5_1462_5800, &pci_ss_info_8086_24c5_1734_1005, @@ -56470,6 +56797,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24c6[] = { &pci_ss_info_8086_24c6_103c_0890, &pci_ss_info_8086_24c6_103c_08b0, &pci_ss_info_8086_24c6_1071_8160, + &pci_ss_info_8086_24c6_144d_c00c, NULL }; static const pciSubsystemInfo *pci_ss_list_8086_24c7[] = { @@ -56483,6 +56811,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24c7[] = { &pci_ss_info_8086_24c7_103c_0890, &pci_ss_info_8086_24c7_103c_08b0, &pci_ss_info_8086_24c7_1071_8160, + &pci_ss_info_8086_24c7_144d_c00c, &pci_ss_info_8086_24c7_1462_5800, &pci_ss_info_8086_24c7_1509_2990, &pci_ss_info_8086_24c7_1734_1004, @@ -56499,6 +56828,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24ca[] = { &pci_ss_info_8086_24ca_103c_0890, &pci_ss_info_8086_24ca_103c_08b0, &pci_ss_info_8086_24ca_1071_8160, + &pci_ss_info_8086_24ca_144d_c00c, &pci_ss_info_8086_24ca_1734_1055, &pci_ss_info_8086_24ca_8086_4541, NULL @@ -56513,6 +56843,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24cb[] = { NULL }; static const pciSubsystemInfo *pci_ss_list_8086_24cc[] = { + &pci_ss_info_8086_24cc_144d_c00c, &pci_ss_info_8086_24cc_1734_1055, NULL }; @@ -56530,6 +56861,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24cd[] = { &pci_ss_info_8086_24cd_103c_08b0, &pci_ss_info_8086_24cd_1071_8160, &pci_ss_info_8086_24cd_1179_ff00, + &pci_ss_info_8086_24cd_144d_c00c, &pci_ss_info_8086_24cd_1462_3981, &pci_ss_info_8086_24cd_1509_1968, &pci_ss_info_8086_24cd_1734_1004, @@ -56574,6 +56906,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24d3[] = { &pci_ss_info_8086_24d3_1014_02ed, &pci_ss_info_8086_24d3_1028_0156, &pci_ss_info_8086_24d3_1028_0169, + &pci_ss_info_8086_24d3_103c_12bc, &pci_ss_info_8086_24d3_1043_80a6, &pci_ss_info_8086_24d3_1458_24d2, &pci_ss_info_8086_24d3_1462_7280, @@ -56604,6 +56937,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_24d4[] = { NULL }; static const pciSubsystemInfo *pci_ss_list_8086_24d5[] = { + &pci_ss_info_8086_24d5_100a_147b, &pci_ss_info_8086_24d5_1028_0169, &pci_ss_info_8086_24d5_103c_006a, &pci_ss_info_8086_24d5_103c_12bc, @@ -56757,6 +57091,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_2562[] = { }; static const pciSubsystemInfo *pci_ss_list_8086_2570[] = { &pci_ss_info_8086_2570_103c_006a, + &pci_ss_info_8086_2570_103c_12bc, &pci_ss_info_8086_2570_1043_80f2, &pci_ss_info_8086_2570_1458_2570, NULL @@ -57122,6 +57457,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_27b8[] = { NULL }; static const pciSubsystemInfo *pci_ss_list_8086_27b9[] = { + &pci_ss_info_8086_27b9_10f7_8338, &pci_ss_info_8086_27b9_17aa_2009, NULL }; @@ -57174,11 +57510,14 @@ static const pciSubsystemInfo *pci_ss_list_8086_27cc[] = { #define pci_ss_list_8086_27d6 NULL static const pciSubsystemInfo *pci_ss_list_8086_27d8[] = { &pci_ss_info_8086_27d8_107b_5048, + &pci_ss_info_8086_27d8_10f7_8338, + &pci_ss_info_8086_27d8_1179_ff31, &pci_ss_info_8086_27d8_152d_0753, &pci_ss_info_8086_27d8_17aa_2010, NULL }; static const pciSubsystemInfo *pci_ss_list_8086_27da[] = { + &pci_ss_info_8086_27da_10f7_8338, &pci_ss_info_8086_27da_17aa_200f, &pci_ss_info_8086_27da_8086_544e, NULL @@ -57191,6 +57530,7 @@ static const pciSubsystemInfo *pci_ss_list_8086_27dc[] = { #define pci_ss_list_8086_27de NULL static const pciSubsystemInfo *pci_ss_list_8086_27df[] = { &pci_ss_info_8086_27df_107b_5048, + &pci_ss_info_8086_27df_10f7_8338, &pci_ss_info_8086_27df_17aa_200c, &pci_ss_info_8086_27df_8086_544e, NULL @@ -57202,22 +57542,43 @@ static const pciSubsystemInfo *pci_ss_list_8086_27df[] = { #define pci_ss_list_8086_2812 NULL #define pci_ss_list_8086_2814 NULL #define pci_ss_list_8086_2815 NULL -#define pci_ss_list_8086_2820 NULL +static const pciSubsystemInfo *pci_ss_list_8086_2820[] = { + &pci_ss_info_8086_2820_1462_7235, + NULL +}; #define pci_ss_list_8086_2821 NULL #define pci_ss_list_8086_2822 NULL #define pci_ss_list_8086_2824 NULL -#define pci_ss_list_8086_2825 NULL +static const pciSubsystemInfo *pci_ss_list_8086_2825[] = { + &pci_ss_info_8086_2825_1462_7235, + NULL +}; #define pci_ss_list_8086_2828 NULL #define pci_ss_list_8086_2829 NULL #define pci_ss_list_8086_282a NULL -#define pci_ss_list_8086_2830 NULL -#define pci_ss_list_8086_2831 NULL +static const pciSubsystemInfo *pci_ss_list_8086_2830[] = { + &pci_ss_info_8086_2830_1462_7235, + NULL +}; +static const pciSubsystemInfo *pci_ss_list_8086_2831[] = { + &pci_ss_info_8086_2831_1462_7235, + NULL +}; #define pci_ss_list_8086_2832 NULL -#define pci_ss_list_8086_2834 NULL +static const pciSubsystemInfo *pci_ss_list_8086_2834[] = { + &pci_ss_info_8086_2834_1462_7235, + NULL +}; #define pci_ss_list_8086_2835 NULL -#define pci_ss_list_8086_2836 NULL +static const pciSubsystemInfo *pci_ss_list_8086_2836[] = { + &pci_ss_info_8086_2836_1462_7235, + NULL +}; #define pci_ss_list_8086_283a NULL -#define pci_ss_list_8086_283e NULL +static const pciSubsystemInfo *pci_ss_list_8086_283e[] = { + &pci_ss_info_8086_283e_1462_7235, + NULL +}; #define pci_ss_list_8086_283f NULL #define pci_ss_list_8086_2841 NULL #define pci_ss_list_8086_2843 NULL @@ -57263,15 +57624,22 @@ static const pciSubsystemInfo *pci_ss_list_8086_27df[] = { #define pci_ss_list_8086_2a06 NULL #define pci_ss_list_8086_2a07 NULL #define pci_ss_list_8086_3092 NULL -#define pci_ss_list_8086_3200 NULL +static const pciSubsystemInfo *pci_ss_list_8086_3200[] = { + &pci_ss_info_8086_3200_1775_c200, + NULL +}; static const pciSubsystemInfo *pci_ss_list_8086_3340[] = { &pci_ss_info_8086_3340_1025_005a, &pci_ss_info_8086_3340_103c_088c, &pci_ss_info_8086_3340_103c_0890, &pci_ss_info_8086_3340_103c_08b0, + &pci_ss_info_8086_3340_144d_c00c, + NULL +}; +static const pciSubsystemInfo *pci_ss_list_8086_3341[] = { + &pci_ss_info_8086_3341_144d_c00c, NULL }; -#define pci_ss_list_8086_3341 NULL #define pci_ss_list_8086_3500 NULL #define pci_ss_list_8086_3501 NULL #define pci_ss_list_8086_3504 NULL @@ -58120,6 +58488,7 @@ static const pciSubsystemInfo *pci_ss_list_0925[] = { #define pci_ss_list_0b49 NULL #define pci_ss_list_0ccd NULL static const pciSubsystemInfo *pci_ss_list_0e11[] = { + &pci_ss_info_0e11_000b, &pci_ss_info_0e11_0012, &pci_ss_info_0e11_001e, &pci_ss_info_0e11_0022, @@ -58382,7 +58751,12 @@ static const pciSubsystemInfo *pci_ss_list_1005[] = { #define pci_ss_list_1006 NULL #define pci_ss_list_1007 NULL #define pci_ss_list_1008 NULL -#define pci_ss_list_100a NULL +#ifdef VENDOR_INCLUDE_NONVIDEO +static const pciSubsystemInfo *pci_ss_list_100a[] = { + &pci_ss_info_100a_147b, + NULL +}; +#endif #define pci_ss_list_100b NULL #define pci_ss_list_100c NULL #define pci_ss_list_100d NULL @@ -60499,6 +60873,7 @@ static const pciSubsystemInfo *pci_ss_list_1179[] = { &pci_ss_info_1179_ff00, &pci_ss_info_1179_ff01, &pci_ss_info_1179_ff10, + &pci_ss_info_1179_ff31, NULL }; #endif @@ -62200,6 +62575,7 @@ static const pciSubsystemInfo *pci_ss_list_1462[] = { &pci_ss_info_1462_7030, &pci_ss_info_1462_7100, &pci_ss_info_1462_7207, + &pci_ss_info_1462_7235, &pci_ss_info_1462_7280, &pci_ss_info_1462_728c, &pci_ss_info_1462_7580, @@ -63348,6 +63724,7 @@ static const pciSubsystemInfo *pci_ss_list_1775[] = { &pci_ss_info_1775_10d0, &pci_ss_info_1775_10d1, &pci_ss_info_1775_6003, + &pci_ss_info_1775_c200, &pci_ss_info_1775_ce90, NULL }; @@ -64030,6 +64407,8 @@ static const pciSubsystemInfo *pci_ss_list_8086[] = { &pci_ss_info_8086_1094, &pci_ss_info_8086_1099, &pci_ss_info_8086_109a, + &pci_ss_info_8086_10a4, + &pci_ss_info_8086_10bc, &pci_ss_info_8086_10f0, &pci_ss_info_8086_1107, &pci_ss_info_8086_1109, @@ -64046,6 +64425,8 @@ static const pciSubsystemInfo *pci_ss_list_8086[] = { &pci_ss_info_8086_117a, &pci_ss_info_8086_118a, &pci_ss_info_8086_1199, + &pci_ss_info_8086_11a4, + &pci_ss_info_8086_11bc, &pci_ss_info_8086_125e, &pci_ss_info_8086_125f, &pci_ss_info_8086_1276, @@ -64098,7 +64479,9 @@ static const pciSubsystemInfo *pci_ss_list_8086[] = { &pci_ss_info_8086_2413, &pci_ss_info_8086_24db, &pci_ss_info_8086_2513, + &pci_ss_info_8086_2522, &pci_ss_info_8086_2527, + &pci_ss_info_8086_2581, &pci_ss_info_8086_265c, &pci_ss_info_8086_3000, &pci_ss_info_8086_3001, @@ -79384,19 +79767,19 @@ static const pciDeviceInfo pci_dev_info_1077_2432 = { #endif 0 }; -static const pciDeviceInfo pci_dev_info_1077_3010 = { - 0x3010, pci_device_1077_3010, +static const pciDeviceInfo pci_dev_info_1077_3022 = { + 0x3022, pci_device_1077_3022, #ifdef INIT_SUBSYS_INFO - pci_ss_list_1077_3010, + pci_ss_list_1077_3022, #else NULL, #endif 0 }; -static const pciDeviceInfo pci_dev_info_1077_3022 = { - 0x3022, pci_device_1077_3022, +static const pciDeviceInfo pci_dev_info_1077_3032 = { + 0x3032, pci_device_1077_3032, #ifdef INIT_SUBSYS_INFO - pci_ss_list_1077_3022, + pci_ss_list_1077_3032, #else NULL, #endif @@ -79420,6 +79803,24 @@ static const pciDeviceInfo pci_dev_info_1077_4022 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_1077_4032 = { + 0x4032, pci_device_1077_4032, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1077_4032, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_1077_5432 = { + 0x5432, pci_device_1077_5432, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_1077_5432, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_1077_6312 = { 0x6312, pci_device_1077_6312, #ifdef INIT_SUBSYS_INFO @@ -109037,7 +109438,6 @@ static const pciDeviceInfo pci_dev_info_19e7_1005 = { 0 }; #endif -#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_1a03_2000 = { 0x2000, pci_device_1a03_2000, #ifdef INIT_SUBSYS_INFO @@ -109047,7 +109447,6 @@ static const pciDeviceInfo pci_dev_info_1a03_2000 = { #endif 0 }; -#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo pci_dev_info_1a08_0000 = { 0x0000, pci_device_1a08_0000, @@ -111843,6 +112242,42 @@ static const pciDeviceInfo pci_dev_info_8086_1053 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_1054 = { + 0x1054, pci_device_8086_1054, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1054, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_1055 = { + 0x1055, pci_device_8086_1055, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1055, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_1056 = { + 0x1056, pci_device_8086_1056, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1056, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_1057 = { + 0x1057, pci_device_8086_1057, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1057, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_1059 = { 0x1059, pci_device_8086_1059, #ifdef INIT_SUBSYS_INFO @@ -112185,6 +112620,15 @@ static const pciDeviceInfo pci_dev_info_8086_108f = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_1091 = { + 0x1091, pci_device_8086_1091, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1091, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_1092 = { 0x1092, pci_device_8086_1092, #ifdef INIT_SUBSYS_INFO @@ -112194,6 +112638,33 @@ static const pciDeviceInfo pci_dev_info_8086_1092 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_1093 = { + 0x1093, pci_device_8086_1093, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1093, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_1094 = { + 0x1094, pci_device_8086_1094, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1094, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_1095 = { + 0x1095, pci_device_8086_1095, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1095, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_1096 = { 0x1096, pci_device_8086_1096, #ifdef INIT_SUBSYS_INFO @@ -112248,6 +112719,15 @@ static const pciDeviceInfo pci_dev_info_8086_109b = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_109e = { + 0x109e, pci_device_8086_109e, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_109e, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_10a0 = { 0x10a0, pci_device_8086_10a0, #ifdef INIT_SUBSYS_INFO @@ -112266,6 +112746,15 @@ static const pciDeviceInfo pci_dev_info_8086_10a1 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_10a4 = { + 0x10a4, pci_device_8086_10a4, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_10a4, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_10b0 = { 0x10b0, pci_device_8086_10b0, #ifdef INIT_SUBSYS_INFO @@ -112338,6 +112827,33 @@ static const pciDeviceInfo pci_dev_info_8086_10bb = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_10bc = { + 0x10bc, pci_device_8086_10bc, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_10bc, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_10c4 = { + 0x10c4, pci_device_8086_10c4, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_10c4, +#else + NULL, +#endif + 0 +}; +static const pciDeviceInfo pci_dev_info_8086_10c5 = { + 0x10c5, pci_device_8086_10c5, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_10c5, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_1107 = { 0x1107, pci_device_8086_1107, #ifdef INIT_SUBSYS_INFO @@ -112752,6 +113268,15 @@ static const pciDeviceInfo pci_dev_info_8086_1a48 = { #endif 0 }; +static const pciDeviceInfo pci_dev_info_8086_1b48 = { + 0x1b48, pci_device_8086_1b48, +#ifdef INIT_SUBSYS_INFO + pci_ss_list_8086_1b48, +#else + NULL, +#endif + 0 +}; static const pciDeviceInfo pci_dev_info_8086_2410 = { 0x2410, pci_device_8086_2410, #ifdef INIT_SUBSYS_INFO @@ -120919,10 +121444,12 @@ static const pciDeviceInfo *pci_dev_list_1077[] = { &pci_dev_info_1077_2322, &pci_dev_info_1077_2422, &pci_dev_info_1077_2432, - &pci_dev_info_1077_3010, &pci_dev_info_1077_3022, + &pci_dev_info_1077_3032, &pci_dev_info_1077_4010, &pci_dev_info_1077_4022, + &pci_dev_info_1077_4032, + &pci_dev_info_1077_5432, &pci_dev_info_1077_6312, &pci_dev_info_1077_6322, NULL @@ -127194,12 +127721,10 @@ static const pciDeviceInfo *pci_dev_list_19e7[] = { NULL }; #endif -#ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1a03[] = { &pci_dev_info_1a03_2000, NULL }; -#endif #ifdef VENDOR_INCLUDE_NONVIDEO static const pciDeviceInfo *pci_dev_list_1a08[] = { &pci_dev_info_1a08_0000, @@ -127727,6 +128252,10 @@ static const pciDeviceInfo *pci_dev_list_8086[] = { &pci_dev_info_8086_1051, &pci_dev_info_8086_1052, &pci_dev_info_8086_1053, + &pci_dev_info_8086_1054, + &pci_dev_info_8086_1055, + &pci_dev_info_8086_1056, + &pci_dev_info_8086_1057, &pci_dev_info_8086_1059, &pci_dev_info_8086_105b, &pci_dev_info_8086_105e, @@ -127765,15 +128294,21 @@ static const pciDeviceInfo *pci_dev_list_8086[] = { &pci_dev_info_8086_108c, &pci_dev_info_8086_108e, &pci_dev_info_8086_108f, + &pci_dev_info_8086_1091, &pci_dev_info_8086_1092, + &pci_dev_info_8086_1093, + &pci_dev_info_8086_1094, + &pci_dev_info_8086_1095, &pci_dev_info_8086_1096, &pci_dev_info_8086_1097, &pci_dev_info_8086_1098, &pci_dev_info_8086_1099, &pci_dev_info_8086_109a, &pci_dev_info_8086_109b, + &pci_dev_info_8086_109e, &pci_dev_info_8086_10a0, &pci_dev_info_8086_10a1, + &pci_dev_info_8086_10a4, &pci_dev_info_8086_10b0, &pci_dev_info_8086_10b2, &pci_dev_info_8086_10b3, @@ -127782,6 +128317,9 @@ static const pciDeviceInfo *pci_dev_list_8086[] = { &pci_dev_info_8086_10b9, &pci_dev_info_8086_10ba, &pci_dev_info_8086_10bb, + &pci_dev_info_8086_10bc, + &pci_dev_info_8086_10c4, + &pci_dev_info_8086_10c5, &pci_dev_info_8086_1107, &pci_dev_info_8086_1130, &pci_dev_info_8086_1131, @@ -127828,6 +128366,7 @@ static const pciDeviceInfo *pci_dev_list_8086[] = { &pci_dev_info_8086_1a31, &pci_dev_info_8086_1a38, &pci_dev_info_8086_1a48, + &pci_dev_info_8086_1b48, &pci_dev_info_8086_2410, &pci_dev_info_8086_2411, &pci_dev_info_8086_2412, @@ -133715,9 +134254,7 @@ static const pciVendorInfo pciVendorInfoList[] = { #ifdef VENDOR_INCLUDE_NONVIDEO {0x19e7, pci_vendor_19e7, pci_dev_list_19e7}, #endif -#ifdef VENDOR_INCLUDE_NONVIDEO {0x1a03, pci_vendor_1a03, pci_dev_list_1a03}, -#endif #ifdef VENDOR_INCLUDE_NONVIDEO {0x1a08, pci_vendor_1a08, pci_dev_list_1a08}, #endif @@ -139176,9 +139713,7 @@ static const pciVendorSubsysInfo pciVendorSubsysInfoList[] = { #ifdef VENDOR_INCLUDE_NONVIDEO {0x19e7, pci_vendor_19e7, pci_ss_list_19e7}, #endif -#ifdef VENDOR_INCLUDE_NONVIDEO {0x1a03, pci_vendor_1a03, pci_ss_list_1a03}, -#endif #ifdef VENDOR_INCLUDE_NONVIDEO {0x1a08, pci_vendor_1a08, pci_ss_list_1a08}, #endif diff --git a/hw/xfree86/shadowfb/Makefile.am b/hw/xfree86/shadowfb/Makefile.am index cb5ebb14a..02d2dd4ea 100644 --- a/hw/xfree86/shadowfb/Makefile.am +++ b/hw/xfree86/shadowfb/Makefile.am @@ -6,4 +6,4 @@ sdk_HEADERS = shadowfb.h INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/hw/xfree86/utils/cvt/Makefile.am b/hw/xfree86/utils/cvt/Makefile.am index ff3c1f7bc..365c6cb88 100644 --- a/hw/xfree86/utils/cvt/Makefile.am +++ b/hw/xfree86/utils/cvt/Makefile.am @@ -33,7 +33,7 @@ DUMMYLIB_SRCDIR = $(XFREE86_SRCDIR)/dummylib # gah cvt_SOURCES = cvt.c $(top_srcdir)/hw/xfree86/common/xf86cvt.c -cvt_CFLAGS = $(XORG_CFLAGS) +cvt_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) cvt_LDADD = $(top_builddir)/hw/xfree86/dummylib/libdummy-nonserver.a man1_MANS = cvt.man diff --git a/hw/xfree86/utils/ioport/Makefile.am b/hw/xfree86/utils/ioport/Makefile.am index e96681bbf..1839c9a60 100644 --- a/hw/xfree86/utils/ioport/Makefile.am +++ b/hw/xfree86/utils/ioport/Makefile.am @@ -33,7 +33,7 @@ DUMMYLIB_SRCDIR = $(XFREE86_SRCDIR)/dummylib INCLUDES = $(XORG_INCS) -I$(DUMMYLIB_SRCDIR) -ioport_CFLAGS = $(XORG_CFLAGS) +ioport_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) ioport_LDADD = \ ../../os-support/libxorgos.la \ ../../dummylib/libdummy-nonserver.a \ diff --git a/hw/xfree86/utils/pcitweak/Makefile.am b/hw/xfree86/utils/pcitweak/Makefile.am index 9a565adc8..5c2a6eb56 100644 --- a/hw/xfree86/utils/pcitweak/Makefile.am +++ b/hw/xfree86/utils/pcitweak/Makefile.am @@ -33,7 +33,7 @@ DUMMYLIB_SRCDIR = $(XFREE86_SRCDIR)/dummylib INCLUDES = $(XORG_INCS) -I$(DUMMYLIB_SRCDIR) -pcitweak_CFLAGS = $(XORG_CFLAGS) +pcitweak_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) pcitweak_LDADD = \ ../../os-support/libxorgos.la \ ../../dummylib/libdummy-nonserver.a \ diff --git a/hw/xfree86/utils/scanpci/Makefile.am b/hw/xfree86/utils/scanpci/Makefile.am index f4e2cbb37..6af8eaee5 100644 --- a/hw/xfree86/utils/scanpci/Makefile.am +++ b/hw/xfree86/utils/scanpci/Makefile.am @@ -34,7 +34,7 @@ DUMMYLIB_SRCDIR = $(XFREE86_SRCDIR)/dummylib INCLUDES = $(XORG_INCS) -I$(SCANPCI_SRCDIR) -I$(DUMMYLIB_SRCDIR) -scanpci_CFLAGS = $(XORG_CFLAGS) +scanpci_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) scanpci_LDADD = \ ../../scanpci/libscanpci.la \ ../../os-support/libxorgos.la \ diff --git a/hw/xfree86/utils/xorgcfg/loadmod.c b/hw/xfree86/utils/xorgcfg/loadmod.c index 598d0c06a..6f83f3509 100644 --- a/hw/xfree86/utils/xorgcfg/loadmod.c +++ b/hw/xfree86/utils/xorgcfg/loadmod.c @@ -181,7 +181,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86memchr) SYMFUNC(xf86memcmp) SYMFUNC(xf86memcpy) -#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__ia64__) || defined (__amd64__) +#if (defined(__powerpc__) && (defined(Lynx) || defined(linux))) || defined(__sparc__) || defined(__sparc) || defined(__ia64__) || defined (__amd64__) /* * Some PPC, SPARC, and IA64 compilers generate calls to memcpy to handle * structure copies. This causes a problem both here and in shared diff --git a/hw/xfree86/vbe/Makefile.am b/hw/xfree86/vbe/Makefile.am index 02fdb4837..85c6fd82a 100644 --- a/hw/xfree86/vbe/Makefile.am +++ b/hw/xfree86/vbe/Makefile.am @@ -4,7 +4,7 @@ libvbe_la_SOURCES = vbe.c vbeModes.c vbe_module.c sdk_HEADERS = vbe.h vbeModes.h -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../int10 diff --git a/hw/xfree86/vgahw/Makefile.am b/hw/xfree86/vgahw/Makefile.am index 2aa27fa41..f48e46a11 100644 --- a/hw/xfree86/vgahw/Makefile.am +++ b/hw/xfree86/vgahw/Makefile.am @@ -2,7 +2,7 @@ module_LTLIBRARIES = libvgahw.la libvgahw_la_LDFLAGS = -avoid-version libvgahw_la_SOURCES = vgaHW.c vgaHWmodule.c INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) sdk_HEADERS = vgaHW.h diff --git a/hw/xfree86/x86emu/Makefile.am b/hw/xfree86/x86emu/Makefile.am index 5959c867a..9f9c87f4f 100644 --- a/hw/xfree86/x86emu/Makefile.am +++ b/hw/xfree86/x86emu/Makefile.am @@ -11,7 +11,7 @@ libx86emu_a_SOURCES = debug.c \ INCLUDES = -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) EXTRA_DIST = validate.c \ x86emu/debug.h \ diff --git a/hw/xfree86/xaa/Makefile.am b/hw/xfree86/xaa/Makefile.am index 23b7e16b1..5d529b118 100644 --- a/hw/xfree86/xaa/Makefile.am +++ b/hw/xfree86/xaa/Makefile.am @@ -68,4 +68,4 @@ EXTRA_DIST = xaacexp.h xaawrap.h xaaLine.c xaaDashLine.c \ INCLUDES = $(XORG_INCS) -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/hw/xfree86/xf4bpp/Makefile.am b/hw/xfree86/xf4bpp/Makefile.am index 7cb4ac235..9af336446 100644 --- a/hw/xfree86/xf4bpp/Makefile.am +++ b/hw/xfree86/xf4bpp/Makefile.am @@ -59,4 +59,4 @@ mfbseg.c: INCLUDES = $(XORG_INCS) -I$(srcdir)/../xf1bpp -I$(top_srcdir)/mfb -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/hw/xfree86/xf8_16bpp/Makefile.am b/hw/xfree86/xf8_16bpp/Makefile.am index 5b30f45ed..3c5b8c93d 100644 --- a/hw/xfree86/xf8_16bpp/Makefile.am +++ b/hw/xfree86/xf8_16bpp/Makefile.am @@ -4,7 +4,7 @@ sdk_HEADERS = cfb8_16.h INCLUDES = $(XORG_INCS) -I$(top_srcdir)/fb -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) libxf8_16bpp_la_LDFLAGS = -avoid-version diff --git a/hw/xfree86/xf8_32bpp/Makefile.am b/hw/xfree86/xf8_32bpp/Makefile.am index 3050b81d1..bbcd10f94 100644 --- a/hw/xfree86/xf8_32bpp/Makefile.am +++ b/hw/xfree86/xf8_32bpp/Makefile.am @@ -4,7 +4,7 @@ sdk_HEADERS = cfb8_32.h INCLUDES = $(XORG_INCS) -I$(top_srcdir)/mfb -I$(top_srcdir)/cfb -AM_CFLAGS = $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) libxf8_32bpp_la_LDFLAGS = -avoid-version diff --git a/hw/xfree86/xorgconf.cpp b/hw/xfree86/xorgconf.cpp index 71abe130d..1995045b8 100644 --- a/hw/xfree86/xorgconf.cpp +++ b/hw/xfree86/xorgconf.cpp @@ -56,7 +56,6 @@ XCOMM command (or a combination of both methods) FontPath MISCFONTPATH FontPath T1FONTPATH FontPath TRUETYPEFONTPATH - FontPath CIDFONTPATH FontPath DPI75FONTPATH FontPath DPI100FONTPATH diff --git a/hw/xgl/Makefile.am b/hw/xgl/Makefile.am index 48a9825d2..965060cd7 100644 --- a/hw/xgl/Makefile.am +++ b/hw/xgl/Makefile.am @@ -19,7 +19,7 @@ SUBDIRS = \ $(XEGL_SUBDIRS) AM_CFLAGS = \ - \ + $(DIX_CFLAGS) \ -DHAVE_XGL_CONFIG_H \ -DHAVE_DIX_CONFIG_H \ -I$(top_srcdir)/GL/glx \ diff --git a/hw/xgl/egl/Makefile.am b/hw/xgl/egl/Makefile.am index ded4a15e2..5136e58b1 100644 --- a/hw/xgl/egl/Makefile.am +++ b/hw/xgl/egl/Makefile.am @@ -9,7 +9,7 @@ SUBDIRS = \ $(XGL_MODULE_DIRS) AM_CFLAGS = \ - \ + $(DIX_CFLAGS) \ -DHAVE_XGL_CONFIG_H \ -DHAVE_DIX_CONFIG_H \ $(XEGLMODULES_CFLAGS) diff --git a/hw/xgl/egl/module/Makefile.am b/hw/xgl/egl/module/Makefile.am index 7ed217322..c84f85c90 100644 --- a/hw/xgl/egl/module/Makefile.am +++ b/hw/xgl/egl/module/Makefile.am @@ -1,4 +1,5 @@ AM_CFLAGS = \ + $(DIX_CFLAGS) \ -I$(srcdir)/.. \ -I$(srcdir)/../.. \ $(XEGLMODULES_CFLAGS) diff --git a/hw/xgl/glx/Makefile.am b/hw/xgl/glx/Makefile.am index 10a831f94..314c02e96 100644 --- a/hw/xgl/glx/Makefile.am +++ b/hw/xgl/glx/Makefile.am @@ -15,7 +15,7 @@ AM_CFLAGS = \ -I$(top_srcdir)/GL/include \ -I@MESA_SOURCE@/include \ -I@MESA_SOURCE@/src/mesa/glapi \ - \ + $(DIX_CFLAGS) \ -DHAVE_XGL_CONFIG_H \ -DHAVE_DIX_CONFIG_H \ $(XGLXMODULES_CFLAGS) diff --git a/hw/xgl/glx/module/Makefile.am b/hw/xgl/glx/module/Makefile.am index 846942a43..bd1c4b08f 100644 --- a/hw/xgl/glx/module/Makefile.am +++ b/hw/xgl/glx/module/Makefile.am @@ -2,7 +2,7 @@ if GLX GLX_LIB = $(top_builddir)/hw/xgl/glxext/libxglglxext.la endif -AM_CFLAGS = \ +AM_CFLAGS = $(DIX_CFLAGS) \ -I$(srcdir)/.. \ -I$(srcdir)/../.. \ $(XGLXMODULES_CFLAGS) diff --git a/hw/xgl/glxext/Makefile.am b/hw/xgl/glxext/Makefile.am index c400f364a..98a9b13c4 100644 --- a/hw/xgl/glxext/Makefile.am +++ b/hw/xgl/glxext/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = module AM_CFLAGS = \ - \ + $(DIX_CFLAGS) \ -DHAVE_XGL_CONFIG_H \ -DHAVE_DIX_CONFIG_H \ $(XGLMODULES_CFLAGS) \ diff --git a/hw/xgl/glxext/module/Makefile.am b/hw/xgl/glxext/module/Makefile.am index 82c4211d8..4633f7ffa 100644 --- a/hw/xgl/glxext/module/Makefile.am +++ b/hw/xgl/glxext/module/Makefile.am @@ -1,5 +1,5 @@ AM_CFLAGS = \ - \ + $(DIX_CFLAGS) \ -DHAVE_XGL_CONFIG_H \ -DHAVE_DIX_CONFIG_H \ $(XGLMODULES_CFLAGS) \ diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index dbbcb0545..57e20102e 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -161,7 +161,7 @@ CLEANFILES = $(BUILT_SOURCES) AM_YFLAGS = -d AM_LFLAGS = -i -AM_CFLAGS = -DHAVE_XWIN_CONFIG_H \ +AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ $(XWINMODULES_CFLAGS) dist_man1_MANS = XWin.man XWinrc.man diff --git a/include/Makefile.am b/include/Makefile.am index 9f07fa650..4289b818d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,7 +7,7 @@ sdk_HEADERS = \ closure.h \ colormap.h \ colormapst.h \ - config.h \ + hotplug.h \ cursor.h \ cursorstr.h \ dix.h \ diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 1120337e8..7aabae2ec 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -127,6 +127,9 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have version 2.2 (or newer) of the drm library */ +#undef HAVE_LIBDRM_2_2 + /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM diff --git a/include/dixevents.h b/include/dixevents.h index 2a9458f08..c78fb0e85 100644 --- a/include/dixevents.h +++ b/include/dixevents.h @@ -102,4 +102,8 @@ extern int ProcUngrabButton(ClientPtr /* client */); extern int ProcRecolorCursor(ClientPtr /* client */); +#ifdef PANORAMIX +extern void PostSyntheticMotion(int x, int y, ScreenPtr pScreen, unsigned long time); +#endif + #endif /* DIXEVENTS_H */ diff --git a/include/config.h b/include/hotplug.h index 0c304b15e..0c304b15e 100644 --- a/include/config.h +++ b/include/hotplug.h diff --git a/include/input.h b/include/input.h index e7017cb27..ebb0915c4 100644 --- a/include/input.h +++ b/include/input.h @@ -421,7 +421,7 @@ extern int GetProximityEvents( extern void PostSyntheticMotion( int x, int y, - int screenNum, + ScreenPtr pScreen, unsigned long time); extern int GetMotionHistorySize( diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in index 4a64522a7..b9643a2a4 100644 --- a/include/xorg-config.h.in +++ b/include/xorg-config.h.in @@ -45,6 +45,9 @@ /* Path to loadable modules. */ #undef DEFAULT_MODULE_PATH +/* Path to installed libraries. */ +#undef DEFAULT_LIBRARY_PATH + /* Path to server log file. */ #undef DEFAULT_LOGPREFIX diff --git a/os/Makefile.am b/os/Makefile.am index 7381797ab..d8d1405ce 100644 --- a/os/Makefile.am +++ b/os/Makefile.am @@ -56,7 +56,7 @@ if XSERVER_DTRACE dtrace.o: $(top_srcdir)/dix/Xserver.d $(am_libos_la_OBJECTS) $(DTRACE) -G -C -o $@ -s $(top_srcdir)/dix/Xserver.d .libs/*.o ../dix/.libs/*.o -noinst_LIBRARIES = os.O +noinst_PROGRAMS = os.O os.O: dtrace.o $(am_libos_la_OBJECTS) ld -r -o $@ dtrace.o .libs/*.o diff --git a/os/WaitFor.c b/os/WaitFor.c index 6109e3477..ba227a3b6 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -205,15 +205,17 @@ WaitForSomething(int *pClientsReady) if (timeout > 0 && timeout > timers->delta + 250) { /* time has rewound. reset the timers. */ CheckAllTimers(now); - timeout = timers->expires - now; } - if (timeout < 0) - timeout = 0; - waittime.tv_sec = timeout / MILLI_PER_SECOND; - waittime.tv_usec = (timeout % MILLI_PER_SECOND) * - (1000000 / MILLI_PER_SECOND); - wt = &waittime; + if (timers) { + timeout = timers->expires - now; + if (timeout < 0) + timeout = 0; + waittime.tv_sec = timeout / MILLI_PER_SECOND; + waittime.tv_usec = (timeout % MILLI_PER_SECOND) * + (1000000 / MILLI_PER_SECOND); + wt = &waittime; + } } XFD_COPYSET(&AllSockets, &LastSelectMask); #ifdef SMART_SCHEDULE diff --git a/os/access.c b/os/access.c index cdb17589c..d61edeffc 100644 --- a/os/access.c +++ b/os/access.c @@ -202,9 +202,7 @@ SOFTWARE. #include "dixstruct.h" #include "osdep.h" -#ifdef XACE #include "xace.h" -#endif #ifndef PATH_MAX #ifdef MAXPATHLEN @@ -1528,11 +1526,11 @@ AuthorizedClient(ClientPtr client) { if (!client || defeatAccessControl) return TRUE; -#ifdef XACE + /* untrusted clients can't change host access */ if (!XaceHook(XACE_HOSTLIST_ACCESS, client, SecurityWriteAccess)) return FALSE; -#endif + return LocalClient(client); } diff --git a/os/connection.c b/os/connection.c index 100f1e522..ffe911e45 100644 --- a/os/connection.c +++ b/os/connection.c @@ -148,9 +148,7 @@ extern __const__ int _nfiles; #ifdef XAPPGROUP #include "appgroup.h" #endif -#ifdef XACE #include "xace.h" -#endif #ifdef XCSECURITY #include "securitysrv.h" #endif @@ -750,9 +748,9 @@ ClientAuthorized(ClientPtr client, /* indicate to Xdmcp protocol that we've opened new client */ XdmcpOpenDisplay(priv->fd); #endif /* XDMCP */ -#ifdef XACE + XaceHook(XACE_AUTH_AVAIL, client, auth_id); -#endif + /* At this point, if the client is authorized to change the access control * list, we should getpeername() information, and add the client to * the selfhosts list. It's not really the host machine, but the @@ -89,6 +89,7 @@ OR PERFORMANCE OF THIS SOFTWARE. #include <stdlib.h> /* for malloc() */ #include <errno.h> +#include "input.h" #include "site.h" #include "opaque.h" @@ -404,6 +405,7 @@ void AbortServer(void) { OsCleanup(TRUE); + CloseDownDevices(); AbortDDX(); fflush(stderr); if (CoreDump) diff --git a/randr/Makefile.am b/randr/Makefile.am index bd30aed8a..9bf0e6531 100644 --- a/randr/Makefile.am +++ b/randr/Makefile.am @@ -9,4 +9,14 @@ endif librandr_la_SOURCES = \ mirandr.c \ randr.c \ - randrstr.h + randrstr.h \ + rrcrtc.c \ + rrdispatch.c \ + rrinfo.c \ + rrmode.c \ + rroutput.c \ + rrpointer.c \ + rrproperty.c \ + rrscreen.c \ + rrsdispatch.c \ + rrxinerama.c diff --git a/randr/mirandr.c b/randr/mirandr.c index 0954028d1..0b763e111 100644 --- a/randr/mirandr.c +++ b/randr/mirandr.c @@ -1,75 +1,42 @@ /* - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. + * Copyright © 2000 Compaq Computer Corporation + * Copyright © 2002 Hewlett-Packard Company + * Copyright © 2006 Intel Corporation * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. + * Author: Jim Gettys, Hewlett-Packard Company, Inc. + * Keith Packard, Intel Corporation */ - #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include "scrnintstr.h" #include "mi.h" -#include <X11/extensions/randr.h> #include "randrstr.h" #include <stdio.h> -/* - * This function assumes that only a single depth can be - * displayed at a time, but that all visuals of that depth - * can be displayed simultaneously. It further assumes that - * only a single size is available. Hardware providing - * additional capabilties should use different code. - * XXX what to do here.... - */ - Bool miRRGetInfo (ScreenPtr pScreen, Rotation *rotations) { - int i; - Bool setConfig = FALSE; - - *rotations = RR_Rotate_0; - for (i = 0; i < pScreen->numDepths; i++) - { - if (pScreen->allowedDepths[i].numVids) - { - RRScreenSizePtr pSize; - - pSize = RRRegisterSize (pScreen, - pScreen->width, - pScreen->height, - pScreen->mmWidth, - pScreen->mmHeight); - if (!pSize) - return FALSE; - if (!setConfig) - { - RRSetCurrentConfig (pScreen, RR_Rotate_0, 0, pSize); - setConfig = TRUE; - } - } - } return TRUE; } @@ -78,24 +45,102 @@ miRRGetInfo (ScreenPtr pScreen, Rotation *rotations) * different here */ Bool -miRRSetConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) +miRRCrtcSet (ScreenPtr pScreen, + RRCrtcPtr crtc, + RRModePtr mode, + int x, + int y, + Rotation rotation, + int numOutput, + RROutputPtr *outputs) { return TRUE; } +static Bool +miRRCrtcSetGamma (ScreenPtr pScreen, + RRCrtcPtr crtc) +{ + return TRUE; +} + +Bool +miRROutputSetProperty (ScreenPtr pScreen, + RROutputPtr output, + Atom property, + RRPropertyValuePtr value) +{ + return TRUE; +} + +/* + * This function assumes that only a single depth can be + * displayed at a time, but that all visuals of that depth + * can be displayed simultaneously. It further assumes that + * only a single size is available. Hardware providing + * additional capabilties should use different code. + * XXX what to do here.... + */ Bool miRandRInit (ScreenPtr pScreen) { - rrScrPrivPtr rp; + rrScrPrivPtr pScrPriv; +#if RANDR_12_INTERFACE + RRModePtr mode; + RRCrtcPtr crtc; + RROutputPtr output; + xRRModeInfo modeInfo; + char name[64]; +#endif if (!RRScreenInit (pScreen)) return FALSE; - rp = rrGetScrPriv(pScreen); - rp->rrGetInfo = miRRGetInfo; - rp->rrSetConfig = miRRSetConfig; + pScrPriv = rrGetScrPriv(pScreen); + pScrPriv->rrGetInfo = miRRGetInfo; +#if RANDR_12_INTERFACE + pScrPriv->rrCrtcSet = miRRCrtcSet; + pScrPriv->rrCrtcSetGamma = miRRCrtcSetGamma; + pScrPriv->rrOutputSetProperty = miRROutputSetProperty; + + + RRScreenSetSizeRange (pScreen, + pScreen->width, pScreen->height, + pScreen->width, pScreen->height); + + sprintf (name, "%dx%d", pScreen->width, pScreen->height); + memset (&modeInfo, '\0', sizeof (modeInfo)); + modeInfo.width = pScreen->width; + modeInfo.height = pScreen->height; + modeInfo.nameLength = strlen (name); + + mode = RRModeGet (&modeInfo, name); + if (!mode) + return FALSE; + + crtc = RRCrtcCreate (NULL); + if (!crtc) + return FALSE; + if (!RRCrtcAttachScreen (crtc, pScreen)) + { + RRCrtcDestroy (crtc); + return FALSE; + } + + output = RROutputCreate ("screen", 6, NULL); + if (!output) + return FALSE; + if (!RROutputAttachScreen (output, pScreen)) + return FALSE; + if (!RROutputSetClones (output, NULL, 0)) + return FALSE; + if (!RROutputSetModes (output, &mode, 1, 0)) + return FALSE; + if (!RROutputSetCrtcs (output, &crtc, 1)) + return FALSE; + if (!RROutputSetConnection (output, RR_Connected)) + return FALSE; + RRCrtcNotify (crtc, mode, 0, 0, RR_Rotate_0, 1, &output); +#endif return TRUE; } diff --git a/randr/randr.c b/randr/randr.c index d0bbfe50f..147df8c2c 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -1,54 +1,37 @@ /* - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. + * Copyright © 2000 Compaq Computer Corporation + * Copyright © 2002 Hewlett-Packard Company + * Copyright © 2006 Intel Corporation * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. + * Author: Jim Gettys, Hewlett-Packard Company, Inc. + * Keith Packard, Intel Corporation */ - #define NEED_REPLIES #define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif -#include <X11/X.h> -#include <X11/Xproto.h> -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "servermd.h" -#include <X11/extensions/randr.h> -#include <X11/extensions/randrproto.h> #include "randrstr.h" -#ifdef RENDER -#include <X11/extensions/render.h> /* we share subpixel order information */ -#include "picturestr.h" -#endif -#include <X11/Xfuncproto.h> /* From render.h */ #ifndef SubPixelUnknown @@ -56,13 +39,7 @@ #endif #define RR_VALIDATE -int RRGeneration; -int RRNScreens; - -static int ProcRRQueryVersion (ClientPtr pClient); -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); -static int SProcRRQueryVersion (ClientPtr pClient); +static int RRNScreens; #define wrap(priv,real,mem,func) {\ priv->mem = real->mem; \ @@ -73,57 +50,16 @@ static int SProcRRQueryVersion (ClientPtr pClient); real->mem = priv->mem; \ } -#if 0 -static CARD8 RRReqCode; -static int RRErrBase; -#endif -static int RREventBase; -static RESTYPE ClientType, EventType; /* resource types for event masks */ -static int RRClientPrivateIndex; - -typedef struct _RRTimes { - TimeStamp setTime; - TimeStamp configTime; -} RRTimesRec, *RRTimesPtr; - -typedef struct _RRClient { - int major_version; - int minor_version; -/* RRTimesRec times[0]; */ -} RRClientRec, *RRClientPtr; - -/* - * each window has a list of clients requesting - * RRNotify events. Each client has a resource - * for each window it selects RRNotify input for, - * this resource is used to delete the RRNotifyRec - * entry from the per-window queue. - */ - -typedef struct _RREvent *RREventPtr; +static int ProcRRDispatch (ClientPtr pClient); +static int SProcRRDispatch (ClientPtr pClient); -typedef struct _RREvent { - RREventPtr next; - ClientPtr client; - WindowPtr window; - XID clientResource; - int mask; -} RREventRec; +int RREventBase; +int RRErrorBase; +RESTYPE RRClientType, RREventType; /* resource types for event masks */ +int RRClientPrivateIndex; int rrPrivIndex = -1; -#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr) -#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) - -static Bool -RRClientKnowsRates (ClientPtr pClient) -{ - rrClientPriv(pClient); - - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); -} - static void RRClientCallback (CallbackListPtr *list, pointer closure, @@ -159,10 +95,14 @@ static Bool RRCloseScreen (int i, ScreenPtr pScreen) { rrScrPriv(pScreen); + int j; unwrap (pScrPriv, pScreen, CloseScreen); - if (pScrPriv->pSizes) - xfree (pScrPriv->pSizes); + for (j = pScrPriv->numCrtcs - 1; j >= 0; j--) + RRCrtcDestroy (pScrPriv->crtcs[j]); + for (j = pScrPriv->numOutputs - 1; j >= 0; j--) + RROutputDestroy (pScrPriv->outputs[j]); + xfree (pScrPriv); RRNScreens -= 1; /* ok, one fewer screen with RandR running */ return (*pScreen->CloseScreen) (i, pScreen); @@ -187,15 +127,107 @@ SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, cpswaps(from->subpixelOrder, to->subpixelOrder); } +static void +SRRCrtcChangeNotifyEvent(xRRCrtcChangeNotifyEvent *from, + xRRCrtcChangeNotifyEvent *to) +{ + to->type = from->type; + to->subCode = from->subCode; + cpswaps(from->sequenceNumber, to->sequenceNumber); + cpswapl(from->timestamp, to->timestamp); + cpswapl(from->window, to->window); + cpswapl(from->crtc, to->crtc); + cpswapl(from->mode, to->mode); + cpswapl(from->window, to->window); + cpswaps(from->rotation, to->rotation); + cpswaps(from->x, to->x); + cpswaps(from->y, to->y); + cpswaps(from->width, to->width); + cpswaps(from->height, to->height); +} + +static void +SRROutputChangeNotifyEvent(xRROutputChangeNotifyEvent *from, + xRROutputChangeNotifyEvent *to) +{ + to->type = from->type; + to->subCode = from->subCode; + cpswaps(from->sequenceNumber, to->sequenceNumber); + cpswapl(from->timestamp, to->timestamp); + cpswapl(from->configTimestamp, to->configTimestamp); + cpswapl(from->window, to->window); + cpswapl(from->output, to->output); + cpswapl(from->crtc, to->crtc); + cpswapl(from->mode, to->mode); + cpswaps(from->rotation, to->rotation); +} + +static void +SRROutputPropertyNotifyEvent(xRROutputPropertyNotifyEvent *from, + xRROutputPropertyNotifyEvent *to) +{ + to->type = from->type; + to->subCode = from->subCode; + cpswaps(from->sequenceNumber, to->sequenceNumber); + cpswapl(from->window, to->window); + cpswapl(from->output, to->output); + cpswapl(from->atom, to->atom); + cpswapl(from->timestamp, to->timestamp); +} + +static void +SRRNotifyEvent (xEvent *from, + xEvent *to) +{ + switch (from->u.u.detail) { + case RRNotify_CrtcChange: + SRRCrtcChangeNotifyEvent ((xRRCrtcChangeNotifyEvent *) from, + (xRRCrtcChangeNotifyEvent *) to); + break; + case RRNotify_OutputChange: + SRROutputChangeNotifyEvent ((xRROutputChangeNotifyEvent *) from, + (xRROutputChangeNotifyEvent *) to); + break; + case RRNotify_OutputProperty: + SRROutputPropertyNotifyEvent ((xRROutputPropertyNotifyEvent *) from, + (xRROutputPropertyNotifyEvent *) to); + break; + default: + break; + } +} + +static int RRGeneration; + +Bool RRInit (void) +{ + if (RRGeneration != serverGeneration) + { + if (!RRModeInit ()) + return FALSE; + if (!RRCrtcInit ()) + return FALSE; + if (!RROutputInit ()) + return FALSE; + RRGeneration = serverGeneration; + } + return TRUE; +} + +static int RRScreenGeneration; + Bool RRScreenInit(ScreenPtr pScreen) { rrScrPrivPtr pScrPriv; - if (RRGeneration != serverGeneration) + if (!RRInit ()) + return FALSE; + + if (RRScreenGeneration != serverGeneration) { if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0) return FALSE; - RRGeneration = serverGeneration; + RRScreenGeneration = serverGeneration; } pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec)); @@ -207,8 +239,27 @@ Bool RRScreenInit(ScreenPtr pScreen) /* * Calling function best set these function vectors */ - pScrPriv->rrSetConfig = 0; pScrPriv->rrGetInfo = 0; + pScrPriv->maxWidth = pScrPriv->minWidth = pScreen->width; + pScrPriv->maxHeight = pScrPriv->minHeight = pScreen->height; + +#if RANDR_12_INTERFACE + pScrPriv->rrScreenSetSize = NULL; + pScrPriv->rrCrtcSet = NULL; + pScrPriv->rrCrtcSetGamma = NULL; +#endif +#if RANDR_10_INTERFACE + pScrPriv->rrSetConfig = 0; + pScrPriv->rotations = RR_Rotate_0; + pScrPriv->reqWidth = pScreen->width; + pScrPriv->reqHeight = pScreen->height; + pScrPriv->nSizes = 0; + pScrPriv->pSizes = NULL; + pScrPriv->rotation = RR_Rotate_0; + pScrPriv->rate = 0; + pScrPriv->size = 0; +#endif + /* * This value doesn't really matter -- any client must call * GetScreenInfo before reading it which will automatically update @@ -219,14 +270,10 @@ Bool RRScreenInit(ScreenPtr pScreen) wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - pScrPriv->rotations = RR_Rotate_0; - - pScrPriv->nSizes = 0; - pScrPriv->nSizesInUse = 0; - pScrPriv->pSizes = 0; - - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->size = -1; + pScrPriv->numOutputs = 0; + pScrPriv->outputs = NULL; + pScrPriv->numCrtcs = 0; + pScrPriv->crtcs = NULL; RRNScreens += 1; /* keep count of screens that implement randr */ return TRUE; @@ -242,7 +289,7 @@ RRFreeClient (pointer data, XID id) pRREvent = (RREventPtr) data; pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, EventType); + pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, RREventType); if (pHead) { pPrev = 0; for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) @@ -268,7 +315,7 @@ RRFreeEvents (pointer data, XID id) pHead = (RREventPtr *) data; for (pCur = *pHead; pCur; pCur = pNext) { pNext = pCur->next; - FreeResource (pCur->clientResource, ClientType); + FreeResource (pCur->clientResource, RRClientType); xfree ((pointer) pCur); } xfree ((pointer) pHead); @@ -290,1038 +337,152 @@ RRExtensionInit (void) if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) return; - ClientType = CreateNewResourceType(RRFreeClient); - if (!ClientType) + RRClientType = CreateNewResourceType(RRFreeClient); + if (!RRClientType) return; - EventType = CreateNewResourceType(RRFreeEvents); - if (!EventType) + RREventType = CreateNewResourceType(RRFreeEvents); + if (!RREventType) return; extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, ProcRRDispatch, SProcRRDispatch, RRResetProc, StandardMinorOpcode); if (!extEntry) return; -#if 0 - RRReqCode = (CARD8) extEntry->base; - RRErrBase = extEntry->errorBase; -#endif + RRErrorBase = extEntry->errorBase; RREventBase = extEntry->eventBase; EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; + SRRScreenChangeNotifyEvent; + EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr) + SRRNotifyEvent; - return; + RRXineramaExtensionInit(); } - + static int TellChanged (WindowPtr pWin, pointer value) { RREventPtr *pHead, pRREvent; ClientPtr client; - xRRScreenChangeNotifyEvent se; ScreenPtr pScreen = pWin->drawable.pScreen; rrScrPriv(pScreen); - RRScreenSizePtr pSize; - WindowPtr pRoot = WindowTable[pScreen->myNum]; + int i; - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, EventType); + pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, RREventType); if (!pHead) return WT_WALKCHILDREN; - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) pScrPriv->rotation; - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; -#ifdef RENDER - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); -#else - se.subpixelOrder = SubPixelUnknown; -#endif - if (pScrPriv->size >= 0) - { - pSize = &pScrPriv->pSizes[pScrPriv->size]; - se.sizeID = pSize->id; - se.widthInPixels = pSize->width; - se.heightInPixels = pSize->height; - se.widthInMillimeters = pSize->mmWidth; - se.heightInMillimeters = pSize->mmHeight; - } - else - { - /* - * This "shouldn't happen", but a broken DDX can - * forget to set the current configuration on GetInfo - */ - se.sizeID = 0xffff; - se.widthInPixels = 0; - se.heightInPixels = 0; - se.widthInMillimeters = 0; - se.heightInMillimeters = 0; - } for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { client = pRREvent->client; if (client == serverClient || client->clientGone) continue; - se.sequenceNumber = client->sequence; - if(pRREvent->mask & RRScreenChangeNotifyMask) - WriteEventsToClient (client, 1, (xEvent *) &se); - } - return WT_WALKCHILDREN; -} - -static Bool -RRGetInfo (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i, j, k, l; - Bool changed; - Rotation rotations; - RRScreenSizePtr pSize; - RRScreenRatePtr pRate; - - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - pSize->oldReferenced = pSize->referenced; - pSize->referenced = FALSE; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - pRate->oldReferenced = pRate->referenced; - pRate->referenced = FALSE; - } - } - if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) - return FALSE; - - changed = FALSE; - - /* - * Check whether anything changed and simultaneously generate - * the protocol id values for the objects - */ - if (rotations != pScrPriv->rotations) - { - pScrPriv->rotations = rotations; - changed = TRUE; - } - j = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->oldReferenced != pSize->referenced) - changed = TRUE; - if (pSize->referenced) - pSize->id = j++; - l = 0; - for (k = 0; k < pSize->nRates; k++) + if (pRREvent->mask & RRScreenChangeNotifyMask) + RRDeliverScreenEvent (client, pWin, pScreen); + + if (pRREvent->mask & RRCrtcChangeNotifyMask) { - pRate = &pSize->pRates[k]; - if (pRate->oldReferenced != pRate->referenced) - changed = TRUE; - if (pRate->referenced) - l++; - } - pSize->nRatesInUse = l; - } - pScrPriv->nSizesInUse = j; - if (changed) - { - UpdateCurrentTime (); - pScrPriv->lastConfigTime = currentTime; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - } - return TRUE; -} - -static void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -static int -ProcRRQueryVersion (ClientPtr client) -{ - xRRQueryVersionReply rep; - register int n; - REQUEST(xRRQueryVersionReq); - rrClientPriv(client); - - REQUEST_SIZE_MATCH(xRRQueryVersionReq); - pRRClient->major_version = stuff->majorVersion; - pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RANDR_MAJOR; - rep.minorVersion = RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -static void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -static int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - unsigned long extraLen; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - - if (!pWin) - return BadWindow; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - if (!pScrPriv) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - - RRGetInfo (pScreen); - - rep.type = X_Reply; - rep.setOfRotations = pScrPriv->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = pScrPriv->rotation; - rep.nSizes = pScrPriv->nSizesInUse; - rep.rate = pScrPriv->rate; - rep.nrateEnts = 0; - if (has_rate) - { - for (i = 0; i < pScrPriv->nSizes; i++) + for (i = 0; i < pScrPriv->numCrtcs; i++) { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - rep.nrateEnts += (1 + pSize->nRatesInUse); - } + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + if (crtc->changed) + RRDeliverCrtcEvent (client, pWin, crtc); } } - - if (pScrPriv->size >= 0) - rep.sizeID = pScrPriv->pSizes[pScrPriv->size].id; - else - return BadImplementation; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - return BadAlloc; - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pScrPriv->nSizes; i++) + + if (pRREvent->mask & RROutputChangeNotifyMask) { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) + for (i = 0; i < pScrPriv->numOutputs; i++) { - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRatesInUse; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - RRScreenRatePtr pRate = &pSize->pRates[j]; - if (pRate->referenced) - { - *rates = pRate->rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } + RROutputPtr output = pScrPriv->outputs[i]; + if (output->changed) + RRDeliverOutputEvent (client, pWin, output); } } - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n", - (unsigned long)(data8 - (CARD8 *) extra), extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); + return WT_WALKCHILDREN; } -static int -ProcRRSetScreenConfig (ClientPtr client) +/* + * Something changed; send events and adjust pointer position + */ +void +RRTellChanged (ScreenPtr pScreen) { - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp configTime; - TimeStamp time; - RRScreenSizePtr pSize; - int i; - Rotation rotation; - int rate; - short oldWidth, oldHeight; - Bool has_rate; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, - SecurityWriteAccess); - - pScreen = pDraw->pScreen; - - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - /* - * Search for the requested size - */ - pSize = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced && pSize->id == stuff->sizeID) - { - break; - } - } - if (i == pScrPriv->nSizes) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - return BadValue; - } + rrScrPriv (pScreen); + int i; - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) + if (pScrPriv->changed) { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) + UpdateCurrentTime (); + pScrPriv->lastConfigTime = currentTime; + pScrPriv->changed = FALSE; + WalkTree (pScreen, TellChanged, (pointer) pScreen); + for (i = 0; i < pScrPriv->numOutputs; i++) + pScrPriv->outputs[i]->changed = FALSE; + for (i = 0; i < pScrPriv->numCrtcs; i++) + pScrPriv->crtcs[i]->changed = FALSE; + if (pScrPriv->layoutChanged) { - /* - * Invalid rate - */ - client->errorValue = rate; - return BadValue; + pScrPriv->layoutChanged = FALSE; + RRPointerScreenConfigured (pScreen); + RRSendConfigNotify (pScreen); } } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - rep.status = RRSetConfigFailed; - goto sendReply; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - pScrPriv->lastSetTime = time; - - /* - * Report Success - */ - rep.status = RRSetConfigSuccess; - -sendReply: - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); } -int -RRSetScreenConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) +/* + * Return the first output which is connected to an active CRTC + * Used in emulating 1.0 behaviour + */ +RROutputPtr +RRFirstOutput (ScreenPtr pScreen) { - rrScrPrivPtr pScrPriv; - int i; - short oldWidth, oldHeight; - - pScrPriv = rrGetScrPriv(pScreen); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!RRGetInfo (pScreen)) - return BadAlloc; + rrScrPriv(pScreen); + RROutputPtr output; + int i, j; - /* - * Validate requested rotation - */ - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (rate) + for (i = 0; i < pScrPriv->numCrtcs; i++) { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + for (j = 0; j < pScrPriv->numOutputs; j++) { - /* - * Invalid rate - */ - return BadValue; + output = pScrPriv->outputs[j]; + if (output->crtc == crtc) + return output; } } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - return BadImplementation; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - - return Success; + return NULL; } -static int -ProcRRSelectInput (ClientPtr client) +CARD16 +RRVerticalRefresh (xRRModeInfo *mode) { - REQUEST(xRRSelectInputReq); - rrClientPriv(client); - RRTimesPtr pTimes; - WindowPtr pWin; - RREventPtr pRREvent, pNewRREvent, *pHead; - XID clientResource; - - REQUEST_SIZE_MATCH(xRRSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; - pHead = (RREventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, - SecurityWriteAccess); - - if (stuff->enable & (RRScreenChangeNotifyMask)) - { - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - - if (pHead) - { - /* check for existing entry. */ - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - if (pRREvent->client == client) - return Success; - } - - /* build the entry */ - pNewRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); - if (!pNewRREvent) - return BadAlloc; - pNewRREvent->next = 0; - pNewRREvent->client = client; - pNewRREvent->window = pWin; - pNewRREvent->mask = stuff->enable; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pNewRREvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewRREvent)) - return BadAlloc; - /* - * create a resource to contain a pointer to the list - * of clients selecting input. This must be indirect as - * the list may be arbitrarily rearranged which cannot be - * done through the resource database. - */ - if (!pHead) - { - pHead = (RREventPtr *) xalloc (sizeof (RREventPtr)); - if (!pHead || - !AddResource (pWin->drawable.id, EventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pNewRREvent->next = *pHead; - *pHead = pNewRREvent; - /* - * Now see if the client needs an event - */ - if (pScrPriv) - { - pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; - if (CompareTimeStamps (pTimes->setTime, - pScrPriv->lastSetTime) != 0 || - CompareTimeStamps (pTimes->configTime, - pScrPriv->lastConfigTime) != 0) - { - TellChanged (pWin, (pointer) pScreen); - } - } - } - else if (stuff->enable == xFalse) - { - /* delete the interest */ - if (pHead) { - pNewRREvent = 0; - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { - if (pRREvent->client == client) - break; - pNewRREvent = pRREvent; - } - if (pRREvent) { - FreeResource (pRREvent->clientResource, ClientType); - if (pNewRREvent) - pNewRREvent->next = pRREvent->next; - else - *pHead = pRREvent->next; - xfree (pRREvent); - } - } - } - else - { - client->errorValue = stuff->enable; - return BadValue; - } - return Success; + CARD32 refresh; + CARD32 dots = mode->hTotal * mode->vTotal; + if (!dots) + return 0; + refresh = (mode->dotClock + dots/2) / dots; + if (refresh > 0xffff) + refresh = 0xffff; + return (CARD16) refresh; } - static int ProcRRDispatch (ClientPtr client) { REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return ProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return ProcRRSetScreenConfig(client); - case X_RRSelectInput: - return ProcRRSelectInput(client); - case X_RRGetScreenInfo: - return ProcRRGetScreenInfo(client); - default: + if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data]) return BadRequest; - } -} - -static int -SProcRRQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRRQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return ProcRRQueryVersion(client); + return (*ProcRandrVector[stuff->data]) (client); } static int -SProcRRGetScreenInfo (ClientPtr client) -{ - register int n; - REQUEST(xRRGetScreenInfoReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRGetScreenInfo(client); -} - -static int -SProcRRSetScreenConfig (ClientPtr client) -{ - register int n; - REQUEST(xRRSetScreenConfigReq); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - swaps (&stuff->rate, n); - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - } - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->sizeID, n); - swaps(&stuff->rotation, n); - return ProcRRSetScreenConfig(client); -} - -static int -SProcRRSelectInput (ClientPtr client) -{ - register int n; - REQUEST(xRRSelectInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - swaps(&stuff->enable, n); - return ProcRRSelectInput(client); -} - - -static int SProcRRDispatch (ClientPtr client) { REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return SProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return SProcRRSetScreenConfig(client); - case X_RRSelectInput: - return SProcRRSelectInput(client); - case X_RRGetScreenInfo: - return SProcRRGetScreenInfo(client); - default: + if (stuff->data >= RRNumberRequests || !ProcRandrVector[stuff->data]) return BadRequest; - } -} - - -static Bool -RRScreenSizeMatches (RRScreenSizePtr a, - RRScreenSizePtr b) -{ - if (a->width != b->width) - return FALSE; - if (a->height != b->height) - return FALSE; - if (a->mmWidth != b->mmWidth) - return FALSE; - if (a->mmHeight != b->mmHeight) - return FALSE; - return TRUE; -} - -RRScreenSizePtr -RRRegisterSize (ScreenPtr pScreen, - short width, - short height, - short mmWidth, - short mmHeight) -{ - rrScrPriv (pScreen); - int i; - RRScreenSize tmp; - RRScreenSizePtr pNew; - - if (!pScrPriv) - return 0; - - tmp.width = width; - tmp.height= height; - tmp.mmWidth = mmWidth; - tmp.mmHeight = mmHeight; - tmp.pRates = 0; - tmp.nRates = 0; - tmp.nRatesInUse = 0; - tmp.referenced = TRUE; - tmp.oldReferenced = FALSE; - for (i = 0; i < pScrPriv->nSizes; i++) - if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i])) - { - pScrPriv->pSizes[i].referenced = TRUE; - return &pScrPriv->pSizes[i]; - } - pNew = xrealloc (pScrPriv->pSizes, - (pScrPriv->nSizes + 1) * sizeof (RRScreenSize)); - if (!pNew) - return 0; - pNew[pScrPriv->nSizes++] = tmp; - pScrPriv->pSizes = pNew; - return &pNew[pScrPriv->nSizes-1]; -} - -Bool RRRegisterRate (ScreenPtr pScreen, - RRScreenSizePtr pSize, - int rate) -{ - rrScrPriv(pScreen); - int i; - RRScreenRatePtr pNew, pRate; - - if (!pScrPriv) - return FALSE; - - for (i = 0; i < pSize->nRates; i++) - { - pRate = &pSize->pRates[i]; - if (pRate->rate == rate) - { - pRate->referenced = TRUE; - return TRUE; - } - } - - pNew = xrealloc (pSize->pRates, - (pSize->nRates + 1) * sizeof (RRScreenRate)); - if (!pNew) - return FALSE; - pRate = &pNew[pSize->nRates++]; - pRate->rate = rate; - pRate->referenced = TRUE; - pRate->oldReferenced = FALSE; - pSize->pRates = pNew; - return TRUE; + return (*SProcRandrVector[stuff->data]) (client); } -Rotation -RRGetRotation(ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - - if (!pScrPriv) - return RR_Rotate_0; - - return pScrPriv->rotation; -} - -void -RRSetCurrentConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPriv (pScreen); - - if (!pScrPriv) - return; - - pScrPriv->rotation = rotation; - pScrPriv->size = pSize - pScrPriv->pSizes; - pScrPriv->rate = rate; -} diff --git a/randr/randrstr.h b/randr/randrstr.h index 27ab61abb..27ede9226 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -1,24 +1,28 @@ /* - * * Copyright © 2000 Compaq Computer Corporation + * Copyright © 2002 Hewlett-Packard Company + * Copyright © 2006 Intel Corporation * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Compaq makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. * - * COMPAQ DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL COMPAQ BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + * + * Author: Jim Gettys, Hewlett-Packard Company, Inc. + * Keith Packard, Intel Corporation */ #ifdef HAVE_DIX_CONFIG_H @@ -28,56 +32,219 @@ #ifndef _RANDRSTR_H_ #define _RANDRSTR_H_ +#include <X11/X.h> +#include <X11/Xproto.h> +#include "misc.h" +#include "os.h" +#include "dixstruct.h" +#include "resource.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "pixmapstr.h" +#include "extnsionst.h" +#include "servermd.h" #include <X11/extensions/randr.h> +#include <X11/extensions/randrproto.h> +#ifdef RENDER +#include <X11/extensions/render.h> /* we share subpixel order information */ +#include "picturestr.h" +#endif +#include <X11/Xfuncproto.h> + +/* required for ABI compatibility for now */ +#define RANDR_10_INTERFACE 1 +#define RANDR_12_INTERFACE 1 + +typedef XID RRMode; +typedef XID RROutput; +typedef XID RRCrtc; + +extern int RREventBase, RRErrorBase; + +extern int (*ProcRandrVector[RRNumberRequests])(ClientPtr); +extern int (*SProcRandrVector[RRNumberRequests])(ClientPtr); + +/* + * Modeline for a monitor. Name follows directly after this struct + */ + +#define RRModeName(pMode) ((char *) (pMode + 1)) +typedef struct _rrMode RRModeRec, *RRModePtr; +typedef struct _rrPropertyValue RRPropertyValueRec, *RRPropertyValuePtr; +typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr; +typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr; +typedef struct _rrOutput RROutputRec, *RROutputPtr; + +struct _rrMode { + int refcnt; + xRRModeInfo mode; + char *name; + void *devPrivate; + Bool userDefined; +}; + +struct _rrPropertyValue { + Atom type; /* ignored by server */ + short format; /* format of data for swapping - 8,16,32 */ + long size; /* size of data in (format/8) bytes */ + pointer data; /* private to client */ +}; + +struct _rrProperty { + RRPropertyPtr next; + ATOM propertyName; + Bool is_pending; + Bool range; + Bool immutable; + int num_valid; + INT32 *valid_values; + RRPropertyValueRec current, pending; +}; + +struct _rrCrtc { + RRCrtc id; + ScreenPtr pScreen; + RRModePtr mode; + int x, y; + Rotation rotation; + Rotation rotations; + Bool changed; + int numOutputs; + RROutputPtr *outputs; + int gammaSize; + CARD16 *gammaRed; + CARD16 *gammaBlue; + CARD16 *gammaGreen; + void *devPrivate; +}; + +struct _rrOutput { + RROutput id; + ScreenPtr pScreen; + char *name; + int nameLength; + CARD8 connection; + CARD8 subpixelOrder; + int mmWidth; + int mmHeight; + RRCrtcPtr crtc; + int numCrtcs; + RRCrtcPtr *crtcs; + int numClones; + RROutputPtr *clones; + int numModes; + int numPreferred; + RRModePtr *modes; + Bool changed; + RRPropertyPtr properties; + void *devPrivate; +}; + +#if RANDR_12_INTERFACE +typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen, + CARD16 width, + CARD16 height, + CARD32 mmWidth, + CARD32 mmHeight); + +typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen, + RRCrtcPtr crtc, + RRModePtr mode, + int x, + int y, + Rotation rotation, + int numOutputs, + RROutputPtr *outputs); + +typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, + RRCrtcPtr crtc); -typedef struct _rrScreenRate { - int rate; - Bool referenced; - Bool oldReferenced; +typedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen, + RROutputPtr output, + Atom property, + RRPropertyValuePtr value); + +#endif + +typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations); +typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen); + +/* These are for 1.0 compatibility */ + +typedef struct _rrRefresh { + CARD16 rate; + RRModePtr mode; } RRScreenRate, *RRScreenRatePtr; typedef struct _rrScreenSize { int id; short width, height; short mmWidth, mmHeight; - RRScreenRatePtr pRates; int nRates; - int nRatesInUse; - Bool referenced; - Bool oldReferenced; + RRScreenRatePtr pRates; } RRScreenSize, *RRScreenSizePtr; +#ifdef RANDR_10_INTERFACE + typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize); -typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations); -typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen); +#endif + typedef struct _rrScrPriv { + /* + * 'public' part of the structure; DDXen fill this in + * as they initialize + */ +#if RANDR_10_INTERFACE RRSetConfigProcPtr rrSetConfig; +#endif RRGetInfoProcPtr rrGetInfo; +#if RANDR_12_INTERFACE + RRScreenSetSizeProcPtr rrScreenSetSize; + RRCrtcSetProcPtr rrCrtcSet; + RRCrtcSetGammaProcPtr rrCrtcSetGamma; + RROutputSetPropertyProcPtr rrOutputSetProperty; +#endif + /* + * Private part of the structure; not considered part of the ABI + */ TimeStamp lastSetTime; /* last changed by client */ TimeStamp lastConfigTime; /* possible configs changed */ RRCloseScreenProcPtr CloseScreen; + Bool changed; /* some config changed */ + CARD16 minWidth, minHeight; + CARD16 maxWidth, maxHeight; + CARD16 width, height; /* last known screen size */ + Bool layoutChanged; /* screen layout changed */ + + int numOutputs; + RROutputPtr *outputs; + + int numCrtcs; + RRCrtcPtr *crtcs; + + /* Last known pointer position */ + RRCrtcPtr pointerCrtc; +#ifdef RANDR_10_INTERFACE /* * Configuration information */ Rotation rotations; + CARD16 reqWidth, reqHeight; int nSizes; - int nSizesInUse; RRScreenSizePtr pSizes; - - /* - * Current state - */ + Rotation rotation; - int size; int rate; + int size; +#endif } rrScrPrivRec, *rrScrPrivPtr; extern int rrPrivIndex; @@ -86,10 +253,175 @@ extern int rrPrivIndex; #define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr) #define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p)) +/* + * each window has a list of clients requesting + * RRNotify events. Each client has a resource + * for each window it selects RRNotify input for, + * this resource is used to delete the RRNotifyRec + * entry from the per-window queue. + */ + +typedef struct _RREvent *RREventPtr; + +typedef struct _RREvent { + RREventPtr next; + ClientPtr client; + WindowPtr window; + XID clientResource; + int mask; +} RREventRec; + +typedef struct _RRTimes { + TimeStamp setTime; + TimeStamp configTime; +} RRTimesRec, *RRTimesPtr; + +typedef struct _RRClient { + int major_version; + int minor_version; +/* RRTimesRec times[0]; */ +} RRClientRec, *RRClientPtr; + +extern RESTYPE RRClientType, RREventType; /* resource types for event masks */ +extern int RRClientPrivateIndex; +extern RESTYPE RRCrtcType, RRModeType, RROutputType; + +#define LookupOutput(client,id,a) ((RROutputPtr) \ + (SecurityLookupIDByType (client, id, \ + RROutputType, a))) +#define LookupCrtc(client,id,a) ((RRCrtcPtr) \ + (SecurityLookupIDByType (client, id, \ + RRCrtcType, a))) +#define LookupMode(client,id,a) ((RRModePtr) \ + (SecurityLookupIDByType (client, id, \ + RRModeType, a))) + +#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr) +#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) + /* Initialize the extension */ void RRExtensionInit (void); +#ifdef RANDR_12_INTERFACE +/* + * Set the range of sizes for the screen + */ +void +RRScreenSetSizeRange (ScreenPtr pScreen, + CARD16 minWidth, + CARD16 minHeight, + CARD16 maxWidth, + CARD16 maxHeight); +#endif + +/* rrscreen.c */ +/* + * Notify the extension that the screen size has been changed. + * The driver is responsible for calling this whenever it has changed + * the size of the screen + */ +void +RRScreenSizeNotify (ScreenPtr pScreen); + +/* + * Request that the screen be resized + */ +Bool +RRScreenSizeSet (ScreenPtr pScreen, + CARD16 width, + CARD16 height, + CARD32 mmWidth, + CARD32 mmHeight); + +/* + * Send ConfigureNotify event to root window when 'something' happens + */ +void +RRSendConfigNotify (ScreenPtr pScreen); + +/* + * screen dispatch + */ +int +ProcRRGetScreenSizeRange (ClientPtr client); + +int +ProcRRSetScreenSize (ClientPtr client); + +int +ProcRRGetScreenResources (ClientPtr client); + +int +ProcRRSetScreenConfig (ClientPtr client); + +int +ProcRRGetScreenInfo (ClientPtr client); + +/* + * Deliver a ScreenNotify event + */ +void +RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen); + +/* mirandr.c */ +Bool +miRandRInit (ScreenPtr pScreen); + +Bool +miRRGetInfo (ScreenPtr pScreen, Rotation *rotations); + +Bool +miRRGetScreenInfo (ScreenPtr pScreen); + +Bool +miRRCrtcSet (ScreenPtr pScreen, + RRCrtcPtr crtc, + RRModePtr mode, + int x, + int y, + Rotation rotation, + int numOutput, + RROutputPtr *outputs); + +Bool +miRROutputSetProperty (ScreenPtr pScreen, + RROutputPtr output, + Atom property, + RRPropertyValuePtr value); + +/* randr.c */ +/* + * Send all pending events + */ +void +RRTellChanged (ScreenPtr pScreen); + +/* + * Poll the driver for changed information + */ +Bool +RRGetInfo (ScreenPtr pScreen); + +Bool RRInit (void); + +Bool RRScreenInit(ScreenPtr pScreen); + +RROutputPtr +RRFirstOutput (ScreenPtr pScreen); + +Rotation +RRGetRotation (ScreenPtr pScreen); + +CARD16 +RRVerticalRefresh (xRRModeInfo *mode); + +#ifdef RANDR_10_INTERFACE +/* + * This is the old interface, deprecated but left + * around for compatibility + */ + /* * Then, register the specific size with the screen */ @@ -115,7 +447,7 @@ RRSetCurrentConfig (ScreenPtr pScreen, int rate, RRScreenSizePtr pSize); -Bool RRScreenInit(ScreenPtr pScreen); +Bool RRScreenInit (ScreenPtr pScreen); Rotation RRGetRotation (ScreenPtr pScreen); @@ -126,19 +458,363 @@ RRSetScreenConfig (ScreenPtr pScreen, int rate, RRScreenSizePtr pSize); +#endif + +/* rrcrtc.c */ + +/* + * Notify the CRTC of some change; layoutChanged indicates that + * some position or size element changed + */ +void +RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged); + +/* + * Create a CRTC + */ +RRCrtcPtr +RRCrtcCreate (void *devPrivate); + +/* + * Attach a CRTC to a screen. Once done, this cannot be + * undone without destroying the CRTC; it is separate from Create + * only to allow an xf86-based driver to create objects in preinit + */ Bool -miRandRInit (ScreenPtr pScreen); +RRCrtcAttachScreen (RRCrtcPtr crtc, ScreenPtr pScreen); + +/* + * Notify the extension that the Crtc has been reconfigured, + * the driver calls this whenever it has updated the mode + */ +Bool +RRCrtcNotify (RRCrtcPtr crtc, + RRModePtr mode, + int x, + int y, + Rotation rotation, + int numOutputs, + RROutputPtr *outputs); +void +RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc); + +/* + * Request that the Crtc be reconfigured + */ Bool -miRRGetInfo (ScreenPtr pScreen, Rotation *rotations); +RRCrtcSet (RRCrtcPtr crtc, + RRModePtr mode, + int x, + int y, + Rotation rotation, + int numOutput, + RROutputPtr *outputs); + +/* + * Request that the Crtc gamma be changed + */ + +Bool +RRCrtcGammaSet (RRCrtcPtr crtc, + CARD16 *red, + CARD16 *green, + CARD16 *blue); + +/* + * Notify the extension that the Crtc gamma has been changed + * The driver calls this whenever it has changed the gamma values + * in the RRCrtcRec + */ Bool -miRRSetConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr size); +RRCrtcGammaNotify (RRCrtcPtr crtc); + +/* + * Set the size of the gamma table at server startup time + */ Bool -miRRGetScreenInfo (ScreenPtr pScreen); +RRCrtcGammaSetSize (RRCrtcPtr crtc, + int size); + +/* + * Destroy a Crtc at shutdown + */ +void +RRCrtcDestroy (RRCrtcPtr crtc); + +/* + * Initialize crtc type + */ +Bool +RRCrtcInit (void); + +/* + * Crtc dispatch + */ + +int +ProcRRGetCrtcInfo (ClientPtr client); + +int +ProcRRSetCrtcConfig (ClientPtr client); + +int +ProcRRGetCrtcGammaSize (ClientPtr client); + +int +ProcRRGetCrtcGamma (ClientPtr client); + +int +ProcRRSetCrtcGamma (ClientPtr client); + +/* rrdispatch.c */ +Bool +RRClientKnowsRates (ClientPtr pClient); + +/* rrmode.c */ +/* + * Find, and if necessary, create a mode + */ + +RRModePtr +RRModeGet (xRRModeInfo *modeInfo, + const char *name); + +void +RRModePruneUnused (ScreenPtr pScreen); + +/* + * Destroy a mode. + */ + +void +RRModeDestroy (RRModePtr mode); + +/* + * Return a list of modes that are valid for some output in pScreen + */ +RRModePtr * +RRModesForScreen (ScreenPtr pScreen, int *num_ret); + +/* + * Initialize mode type + */ +Bool +RRModeInit (void); + +int +ProcRRCreateMode (ClientPtr client); + +int +ProcRRDestroyMode (ClientPtr client); + +int +ProcRRAddOutputMode (ClientPtr client); + +int +ProcRRDeleteOutputMode (ClientPtr client); + +/* rroutput.c */ + +/* + * Notify the output of some change + */ +void +RROutputChanged (RROutputPtr output); + +/* + * Create an output + */ + +RROutputPtr +RROutputCreate (const char *name, + int nameLength, + void *devPrivate); + +/* + * Attach an output to a screen, again split from creation so + * xf86 DDXen can create randr resources before the ScreenRec + * exists + */ +Bool +RROutputAttachScreen (RROutputPtr output, ScreenPtr pScreen); + +/* + * Notify extension that output parameters have been changed + */ +Bool +RROutputSetClones (RROutputPtr output, + RROutputPtr *clones, + int numClones); + +Bool +RROutputSetModes (RROutputPtr output, + RRModePtr *modes, + int numModes, + int numPreferred); + +Bool +RROutputSetCrtcs (RROutputPtr output, + RRCrtcPtr *crtcs, + int numCrtcs); + +void +RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc); + +Bool +RROutputSetConnection (RROutputPtr output, + CARD8 connection); + +Bool +RROutputSetSubpixelOrder (RROutputPtr output, + int subpixelOrder); + +Bool +RROutputSetPhysicalSize (RROutputPtr output, + int mmWidth, + int mmHeight); + +void +RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output); + +void +RROutputDestroy (RROutputPtr output); + +int +ProcRRGetOutputInfo (ClientPtr client); + +/* + * Initialize output type + */ +Bool +RROutputInit (void); + +/* rrpointer.c */ +void +RRPointerMoved (ScreenPtr pScreen, int x, int y); + +void +RRPointerScreenConfigured (ScreenPtr pScreen); + +/* rrproperty.c */ + +void +RRDeleteAllOutputProperties (RROutputPtr output); + +RRPropertyValuePtr +RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending); + +RRPropertyPtr +RRQueryOutputProperty (RROutputPtr output, Atom property); + +void +RRDeleteOutputProperty (RROutputPtr output, Atom property); + +int +RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, + int format, int mode, unsigned long len, + pointer value, Bool sendevent); + +int +RRConfigureOutputProperty (RROutputPtr output, Atom property, + Bool pending, Bool range, Bool immutable, + int num_values, INT32 *values); +int +ProcRRChangeOutputProperty (ClientPtr client); + +int +ProcRRGetOutputProperty (ClientPtr client); + +int +ProcRRListOutputProperties (ClientPtr client); + +int +ProcRRQueryOutputProperty (ClientPtr client); + +int +ProcRRConfigureOutputProperty (ClientPtr client); + +int +ProcRRDeleteOutputProperty (ClientPtr client); + +/* rrxinerama.c */ +void +RRXineramaExtensionInit(void); #endif /* _RANDRSTR_H_ */ + +/* + +randr extension implementation structure + +Query state: + ProcRRGetScreenInfo/ProcRRGetScreenResources + RRGetInfo + + • Request configuration from driver, either 1.0 or 1.2 style + • These functions only record state changes, all + other actions are pended until RRTellChanged is called + + ->rrGetInfo + 1.0: + RRRegisterSize + RRRegisterRate + RRSetCurrentConfig + 1.2: + RRScreenSetSizeRange + RROutputSetCrtcs + RROutputSetCrtc + RRModeGet + RROutputSetModes + RROutputSetConnection + RROutputSetSubpixelOrder + RROutputSetClones + RRCrtcNotify + + • Must delay scanning configuration until after ->rrGetInfo returns + because some drivers will call SetCurrentConfig in the middle + of the ->rrGetInfo operation. + + 1.0: + + • Scan old configuration, mirror to new structures + + RRScanOldConfig + RRCrtcCreate + RROutputCreate + RROutputSetCrtcs + RROutputSetCrtc + RROutputSetConnection + RROutputSetSubpixelOrder + RROldModeAdd • This adds modes one-at-a-time + RRModeGet + RRCrtcNotify + + • send events, reset pointer if necessary + + RRTellChanged + WalkTree (sending events) + + • when layout has changed: + RRPointerScreenConfigured + RRSendConfigNotify + +Asynchronous state setting (1.2 only) + When setting state asynchronously, the driver invokes the + ->rrGetInfo function and then calls RRTellChanged to flush + the changes to the clients and reset pointer if necessary + +Set state + + ProcRRSetScreenConfig + RRCrtcSet + 1.2: + ->rrCrtcSet + RRCrtcNotify + 1.0: + ->rrSetConfig + RRCrtcNotify + RRTellChanged + */ diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c new file mode 100644 index 000000000..e8a7b79e1 --- /dev/null +++ b/randr/rrcrtc.c @@ -0,0 +1,848 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" +#include "swaprep.h" + +RESTYPE RRCrtcType; + +/* + * Notify the CRTC of some change + */ +void +RRCrtcChanged (RRCrtcPtr crtc, Bool layoutChanged) +{ + ScreenPtr pScreen = crtc->pScreen; + + crtc->changed = TRUE; + if (pScreen) + { + rrScrPriv(pScreen); + + pScrPriv->changed = TRUE; + /* + * Send ConfigureNotify on any layout change + */ + if (layoutChanged) + pScrPriv->layoutChanged = TRUE; + } +} + +/* + * Create a CRTC + */ +RRCrtcPtr +RRCrtcCreate (void *devPrivate) +{ + RRCrtcPtr crtc; + + if (!RRInit()) + return NULL; + crtc = xalloc (sizeof (RRCrtcRec)); + if (!crtc) + return NULL; + crtc->id = FakeClientID (0); + crtc->pScreen = NULL; + crtc->mode = NULL; + crtc->x = 0; + crtc->y = 0; + crtc->rotation = RR_Rotate_0; + crtc->rotations = RR_Rotate_0; + crtc->outputs = NULL; + crtc->numOutputs = 0; + crtc->gammaSize = 0; + crtc->gammaRed = crtc->gammaBlue = crtc->gammaGreen = NULL; + crtc->changed = FALSE; + crtc->devPrivate = devPrivate; + + if (!AddResource (crtc->id, RRCrtcType, (pointer) crtc)) + return NULL; + + return crtc; +} + +/* + * Attach a Crtc to a screen. This is done as a separate step + * so that an xf86-based driver can create CRTCs in PreInit + * before the Screen has been created + */ + +Bool +RRCrtcAttachScreen (RRCrtcPtr crtc, ScreenPtr pScreen) +{ + rrScrPriv (pScreen); + RRCrtcPtr *crtcs; + + /* make space for the crtc pointer */ + if (pScrPriv->numCrtcs) + crtcs = xrealloc (pScrPriv->crtcs, + (pScrPriv->numCrtcs + 1) * sizeof (RRCrtcPtr)); + else + crtcs = xalloc (sizeof (RRCrtcPtr)); + if (!crtcs) + return FALSE; + + /* attach the screen and crtc together */ + crtc->pScreen = pScreen; + pScrPriv->crtcs = crtcs; + pScrPriv->crtcs[pScrPriv->numCrtcs++] = crtc; + + RRCrtcChanged (crtc, TRUE); + return TRUE; +} + +/* + * Notify the extension that the Crtc has been reconfigured, + * the driver calls this whenever it has updated the mode + */ +Bool +RRCrtcNotify (RRCrtcPtr crtc, + RRModePtr mode, + int x, + int y, + Rotation rotation, + int numOutputs, + RROutputPtr *outputs) +{ + int i, j; + + /* + * Check to see if any of the new outputs were + * not in the old list and mark them as changed + */ + for (i = 0; i < numOutputs; i++) + { + for (j = 0; j < crtc->numOutputs; j++) + if (outputs[i] == crtc->outputs[j]) + break; + if (j == crtc->numOutputs) + { + RROutputChanged (outputs[i]); + RRCrtcChanged (crtc, FALSE); + } + } + /* + * Check to see if any of the old outputs are + * not in the new list and mark them as changed + */ + for (j = 0; j < crtc->numOutputs; j++) + { + for (i = 0; i < numOutputs; i++) + if (outputs[i] == crtc->outputs[j]) + break; + if (i == numOutputs) + { + RROutputChanged (crtc->outputs[j]); + RRCrtcChanged (crtc, FALSE); + } + } + /* + * Reallocate the crtc output array if necessary + */ + if (numOutputs != crtc->numOutputs) + { + RROutputPtr *newoutputs; + + if (numOutputs) + { + if (crtc->numOutputs) + newoutputs = xrealloc (crtc->outputs, + numOutputs * sizeof (RROutputPtr)); + else + newoutputs = xalloc (numOutputs * sizeof (RROutputPtr)); + if (!newoutputs) + return FALSE; + } + else + { + if (crtc->outputs) + xfree (crtc->outputs); + newoutputs = NULL; + } + crtc->outputs = newoutputs; + crtc->numOutputs = numOutputs; + } + /* + * Copy the new list of outputs into the crtc + */ + memcpy (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr)); + /* + * Update remaining crtc fields + */ + if (mode != crtc->mode) + { + if (crtc->mode) + RRModeDestroy (crtc->mode); + crtc->mode = mode; + if (mode != NULL) + mode->refcnt++; + RRCrtcChanged (crtc, TRUE); + } + if (x != crtc->x) + { + crtc->x = x; + RRCrtcChanged (crtc, TRUE); + } + if (y != crtc->y) + { + crtc->y = y; + RRCrtcChanged (crtc, TRUE); + } + if (rotation != crtc->rotation) + { + crtc->rotation = rotation; + RRCrtcChanged (crtc, TRUE); + } + return TRUE; +} + +void +RRDeliverCrtcEvent (ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + rrScrPriv (pScreen); + xRRCrtcChangeNotifyEvent ce; + RRModePtr mode = crtc->mode; + + ce.type = RRNotify + RREventBase; + ce.subCode = RRNotify_CrtcChange; + ce.sequenceNumber = client->sequence; + ce.timestamp = pScrPriv->lastSetTime.milliseconds; + ce.window = pWin->drawable.id; + ce.crtc = crtc->id; + ce.rotation = crtc->rotation; + if (mode) + { + ce.mode = mode->mode.id; + ce.x = crtc->x; + ce.y = crtc->y; + ce.width = mode->mode.width; + ce.height = mode->mode.height; + } + else + { + ce.mode = None; + ce.x = 0; + ce.y = 0; + ce.width = 0; + ce.height = 0; + } + WriteEventsToClient (client, 1, (xEvent *) &ce); +} + +/* + * Request that the Crtc be reconfigured + */ +Bool +RRCrtcSet (RRCrtcPtr crtc, + RRModePtr mode, + int x, + int y, + Rotation rotation, + int numOutputs, + RROutputPtr *outputs) +{ + ScreenPtr pScreen = crtc->pScreen; + + /* See if nothing changed */ + if (crtc->mode == mode && + crtc->x == x && + crtc->y == y && + crtc->rotation == rotation && + crtc->numOutputs == numOutputs && + !memcmp (crtc->outputs, outputs, numOutputs * sizeof (RROutputPtr))) + { + return TRUE; + } + if (pScreen) + { +#if RANDR_12_INTERFACE + rrScrPriv(pScreen); + if (pScrPriv->rrCrtcSet) + { + return (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y, + rotation, numOutputs, outputs); + } +#endif +#if RANDR_10_INTERFACE + if (pScrPriv->rrSetConfig) + { + RRScreenSize size; + RRScreenRate rate; + Bool ret; + + size.width = mode->mode.width; + size.height = mode->mode.height; + if (outputs[0]->mmWidth && outputs[0]->mmHeight) + { + size.mmWidth = outputs[0]->mmWidth; + size.mmHeight = outputs[0]->mmHeight; + } + else + { + size.mmWidth = pScreen->mmWidth; + size.mmHeight = pScreen->mmHeight; + } + size.nRates = 1; + rate.rate = RRVerticalRefresh (&mode->mode); + size.pRates = &rate; + ret = (*pScrPriv->rrSetConfig) (pScreen, rotation, rate.rate, &size); + /* + * Old 1.0 interface tied screen size to mode size + */ + if (ret) + RRCrtcNotify (crtc, mode, x, y, rotation, 1, outputs); + return ret; + } +#endif + RRTellChanged (pScreen); + } + return FALSE; +} + +/* + * Destroy a Crtc at shutdown + */ +void +RRCrtcDestroy (RRCrtcPtr crtc) +{ + FreeResource (crtc->id, 0); +} + +static int +RRCrtcDestroyResource (pointer value, XID pid) +{ + RRCrtcPtr crtc = (RRCrtcPtr) value; + ScreenPtr pScreen = crtc->pScreen; + + if (pScreen) + { + rrScrPriv(pScreen); + int i; + + for (i = 0; i < pScrPriv->numCrtcs; i++) + { + if (pScrPriv->crtcs[i] == crtc) + { + memmove (pScrPriv->crtcs + i, pScrPriv->crtcs + i + 1, + (pScrPriv->numCrtcs - (i + 1)) * sizeof (RRCrtcPtr)); + --pScrPriv->numCrtcs; + break; + } + } + } + if (crtc->gammaRed) + xfree (crtc->gammaRed); + xfree (crtc); + return 1; +} + +/* + * Request that the Crtc gamma be changed + */ + +Bool +RRCrtcGammaSet (RRCrtcPtr crtc, + CARD16 *red, + CARD16 *green, + CARD16 *blue) +{ + Bool ret = TRUE; +#if RANDR_12_INTERFACE + ScreenPtr pScreen = crtc->pScreen; +#endif + + memcpy (crtc->gammaRed, red, crtc->gammaSize * sizeof (CARD16)); + memcpy (crtc->gammaGreen, green, crtc->gammaSize * sizeof (CARD16)); + memcpy (crtc->gammaBlue, blue, crtc->gammaSize * sizeof (CARD16)); +#if RANDR_12_INTERFACE + if (pScreen) + { + rrScrPriv(pScreen); + if (pScrPriv->rrCrtcSetGamma) + ret = (*pScrPriv->rrCrtcSetGamma) (pScreen, crtc); + } +#endif + return ret; +} + +/* + * Notify the extension that the Crtc gamma has been changed + * The driver calls this whenever it has changed the gamma values + * in the RRCrtcRec + */ + +Bool +RRCrtcGammaNotify (RRCrtcPtr crtc) +{ + return TRUE; /* not much going on here */ +} + +/* + * Set the size of the gamma table at server startup time + */ + +Bool +RRCrtcGammaSetSize (RRCrtcPtr crtc, + int size) +{ + CARD16 *gamma; + + if (size == crtc->gammaSize) + return TRUE; + if (size) + { + gamma = xalloc (size * 3 * sizeof (CARD16)); + if (!gamma) + return FALSE; + } + else + gamma = NULL; + if (crtc->gammaRed) + xfree (crtc->gammaRed); + crtc->gammaRed = gamma; + crtc->gammaGreen = gamma + size; + crtc->gammaBlue = gamma + size*2; + crtc->gammaSize = size; + return TRUE; +} + +/* + * Initialize crtc type + */ +Bool +RRCrtcInit (void) +{ + RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource); + if (!RRCrtcType) + return FALSE; +#ifdef XResExtension + RegisterResourceName (RRCrtcType, "CRTC"); +#endif + return TRUE; +} + +int +ProcRRGetCrtcInfo (ClientPtr client) +{ + REQUEST(xRRGetCrtcInfoReq);; + xRRGetCrtcInfoReply rep; + RRCrtcPtr crtc; + CARD8 *extra; + unsigned long extraLen; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + RRModePtr mode; + RROutput *outputs; + RROutput *possible; + int i, j, k, n; + + REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); + crtc = LookupCrtc(client, stuff->crtc, SecurityReadAccess); + + if (!crtc) + return RRErrorBase + BadRRCrtc; + + /* All crtcs must be associated with screens before client + * requests are processed + */ + pScreen = crtc->pScreen; + pScrPriv = rrGetScrPriv(pScreen); + + mode = crtc->mode; + + rep.type = X_Reply; + rep.status = RRSetConfigSuccess; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep.x = crtc->x; + rep.y = crtc->y; + rep.width = mode ? mode->mode.width : 0; + rep.height = mode ? mode->mode.height : 0; + rep.mode = mode ? mode->mode.id : 0; + rep.rotation = crtc->rotation; + rep.rotations = crtc->rotations; + rep.nOutput = crtc->numOutputs; + k = 0; + for (i = 0; i < pScrPriv->numOutputs; i++) + for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) + if (pScrPriv->outputs[i]->crtcs[j] == crtc) + k++; + rep.nPossibleOutput = k; + + rep.length = rep.nOutput + rep.nPossibleOutput; + + extraLen = rep.length << 2; + if (extraLen) + { + extra = xalloc (extraLen); + if (!extra) + return BadAlloc; + } + else + extra = NULL; + + outputs = (RROutput *) extra; + possible = (RROutput *) (outputs + rep.nOutput); + + for (i = 0; i < crtc->numOutputs; i++) + { + outputs[i] = crtc->outputs[i]->id; + if (client->swapped) + swapl (&outputs[i], n); + } + k = 0; + for (i = 0; i < pScrPriv->numOutputs; i++) + for (j = 0; j < pScrPriv->outputs[i]->numCrtcs; j++) + if (pScrPriv->outputs[i]->crtcs[j] == crtc) + { + possible[k] = pScrPriv->outputs[i]->id; + if (client->swapped) + swapl (&possible[k], n); + k++; + } + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.timestamp, n); + swaps(&rep.x, n); + swaps(&rep.y, n); + swaps(&rep.width, n); + swaps(&rep.height, n); + swapl(&rep.mode, n); + swaps(&rep.rotation, n); + swaps(&rep.rotations, n); + swaps(&rep.nOutput, n); + swaps(&rep.nPossibleOutput, n); + } + WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *)&rep); + if (extraLen) + { + WriteToClient (client, extraLen, (char *) extra); + xfree (extra); + } + + return client->noClientException; +} + +int +ProcRRSetCrtcConfig (ClientPtr client) +{ + REQUEST(xRRSetCrtcConfigReq); + xRRSetCrtcConfigReply rep; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + RRCrtcPtr crtc; + RRModePtr mode; + int numOutputs; + RROutputPtr *outputs = NULL; + RROutput *outputIds; + TimeStamp configTime; + TimeStamp time; + Rotation rotation; + int i, j; + + REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); + numOutputs = (stuff->length - (SIZEOF (xRRSetCrtcConfigReq) >> 2)); + + crtc = LookupIDByType (stuff->crtc, RRCrtcType); + if (!crtc) + { + client->errorValue = stuff->crtc; + return RRErrorBase + BadRRCrtc; + } + if (stuff->mode == None) + { + mode = NULL; + if (numOutputs > 0) + return BadMatch; + } + else + { + mode = LookupIDByType (stuff->mode, RRModeType); + if (!mode) + { + client->errorValue = stuff->mode; + return RRErrorBase + BadRRMode; + } + if (numOutputs == 0) + return BadMatch; + } + if (numOutputs) + { + outputs = xalloc (numOutputs * sizeof (RROutputPtr)); + if (!outputs) + return BadAlloc; + } + else + outputs = NULL; + + outputIds = (RROutput *) (stuff + 1); + for (i = 0; i < numOutputs; i++) + { + outputs[i] = (RROutputPtr) LookupIDByType (outputIds[i], RROutputType); + if (!outputs[i]) + { + client->errorValue = outputIds[i]; + if (outputs) + xfree (outputs); + return RRErrorBase + BadRROutput; + } + /* validate crtc for this output */ + for (j = 0; j < outputs[i]->numCrtcs; j++) + if (outputs[i]->crtcs[j] == crtc) + break; + if (j == outputs[i]->numCrtcs) + { + if (outputs) + xfree (outputs); + return BadMatch; + } + /* validate mode for this output */ + for (j = 0; j < outputs[i]->numModes; j++) + if (outputs[i]->modes[j] == mode) + break; + if (j == outputs[i]->numModes) + { + if (outputs) + xfree (outputs); + return BadMatch; + } + } + + pScreen = crtc->pScreen; + pScrPriv = rrGetScrPriv(pScreen); + + time = ClientTimeToServerTime(stuff->timestamp); + configTime = ClientTimeToServerTime(stuff->configTimestamp); + + if (!pScrPriv) + { + time = currentTime; + rep.status = RRSetConfigFailed; + goto sendReply; + } + + /* + * if the client's config timestamp is not the same as the last config + * timestamp, then the config information isn't up-to-date and + * can't even be validated + */ + if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) + { + rep.status = RRSetConfigInvalidConfigTime; + goto sendReply; + } + + /* + * Validate requested rotation + */ + rotation = (Rotation) stuff->rotation; + + /* test the rotation bits only! */ + switch (rotation & 0xf) { + case RR_Rotate_0: + case RR_Rotate_90: + case RR_Rotate_180: + case RR_Rotate_270: + break; + default: + /* + * Invalid rotation + */ + client->errorValue = stuff->rotation; + if (outputs) + xfree (outputs); + return BadValue; + } + + if (mode) + { + if ((~crtc->rotations) & rotation) + { + /* + * requested rotation or reflection not supported by screen + */ + client->errorValue = stuff->rotation; + if (outputs) + xfree (outputs); + return BadMatch; + } + +#ifdef RANDR_12_INTERFACE + /* + * Check screen size bounds if the DDX provides a 1.2 interface + * for setting screen size. Else, assume the CrtcSet sets + * the size along with the mode + */ + if (pScrPriv->rrScreenSetSize) + { + if (stuff->x + mode->mode.width > pScreen->width) + { + client->errorValue = stuff->x; + if (outputs) + xfree (outputs); + return BadValue; + } + + if (stuff->y + mode->mode.height > pScreen->height) + { + client->errorValue = stuff->y; + if (outputs) + xfree (outputs); + return BadValue; + } + } +#endif + } + + /* + * Make sure the requested set-time is not older than + * the last set-time + */ + if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) + { + rep.status = RRSetConfigInvalidTime; + goto sendReply; + } + + if (!RRCrtcSet (crtc, mode, stuff->x, stuff->y, + rotation, numOutputs, outputs)) + { + rep.status = RRSetConfigFailed; + goto sendReply; + } + rep.status = RRSetConfigSuccess; + +sendReply: + if (outputs) + xfree (outputs); + + rep.type = X_Reply; + /* rep.status has already been filled in */ + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.newTimestamp = pScrPriv->lastConfigTime.milliseconds; + + if (client->swapped) + { + int n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.newTimestamp, n); + } + WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep); + + return client->noClientException; +} + +int +ProcRRGetCrtcGammaSize (ClientPtr client) +{ + REQUEST(xRRGetCrtcGammaSizeReq); + xRRGetCrtcGammaSizeReply reply; + RRCrtcPtr crtc; + int n; + + REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); + crtc = LookupCrtc (client, stuff->crtc, SecurityReadAccess); + if (!crtc) + return RRErrorBase + BadRRCrtc; + + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + reply.length = 0; + reply.size = crtc->gammaSize; + if (client->swapped) { + swaps (&reply.sequenceNumber, n); + swapl (&reply.length, n); + swaps (&reply.size, n); + } + WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply); + return client->noClientException; +} + +int +ProcRRGetCrtcGamma (ClientPtr client) +{ + REQUEST(xRRGetCrtcGammaReq); + xRRGetCrtcGammaReply reply; + RRCrtcPtr crtc; + int n; + unsigned long len; + + REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); + crtc = LookupCrtc (client, stuff->crtc, SecurityReadAccess); + if (!crtc) + return RRErrorBase + BadRRCrtc; + + len = crtc->gammaSize * 3 * 2; + + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + reply.length = (len + 3) >> 2; + reply.size = crtc->gammaSize; + if (client->swapped) { + swaps (&reply.sequenceNumber, n); + swapl (&reply.length, n); + swaps (&reply.size, n); + } + WriteToClient (client, sizeof (xRRGetCrtcGammaReply), (char *) &reply); + if (crtc->gammaSize) + { + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; + WriteSwappedDataToClient (client, len, (char *) crtc->gammaRed); + } + return client->noClientException; +} + +int +ProcRRSetCrtcGamma (ClientPtr client) +{ + REQUEST(xRRSetCrtcGammaReq); + RRCrtcPtr crtc; + unsigned long len; + CARD16 *red, *green, *blue; + + REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq); + crtc = LookupCrtc (client, stuff->crtc, SecurityWriteAccess); + if (!crtc) + return RRErrorBase + BadRRCrtc; + + len = client->req_len - (sizeof (xRRSetCrtcGammaReq) >> 2); + if (len < (stuff->size * 3 + 1) >> 1) + return BadLength; + + if (stuff->size != crtc->gammaSize) + return BadMatch; + + red = (CARD16 *) (stuff + 1); + green = red + crtc->gammaSize; + blue = green + crtc->gammaSize; + + RRCrtcGammaSet (crtc, red, green, blue); + + return Success; +} + diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c new file mode 100644 index 000000000..6b61b9cd7 --- /dev/null +++ b/randr/rrdispatch.c @@ -0,0 +1,210 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" + +Bool +RRClientKnowsRates (ClientPtr pClient) +{ + rrClientPriv(pClient); + + return (pRRClient->major_version > 1 || + (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); +} + +static int +ProcRRQueryVersion (ClientPtr client) +{ + xRRQueryVersionReply rep; + register int n; + REQUEST(xRRQueryVersionReq); + rrClientPriv(client); + + REQUEST_SIZE_MATCH(xRRQueryVersionReq); + pRRClient->major_version = stuff->majorVersion; + pRRClient->minor_version = stuff->minorVersion; + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + /* + * Report the current version; the current + * spec says they're all compatible after 1.0 + */ + rep.majorVersion = RANDR_MAJOR; + rep.minorVersion = RANDR_MINOR; + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.majorVersion, n); + swapl(&rep.minorVersion, n); + } + WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); + return (client->noClientException); +} + +static int +ProcRRSelectInput (ClientPtr client) +{ + REQUEST(xRRSelectInputReq); + rrClientPriv(client); + RRTimesPtr pTimes; + WindowPtr pWin; + RREventPtr pRREvent, *pHead; + XID clientResource; + + REQUEST_SIZE_MATCH(xRRSelectInputReq); + pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); + if (!pWin) + return BadWindow; + pHead = (RREventPtr *)SecurityLookupIDByType(client, + pWin->drawable.id, RREventType, + SecurityWriteAccess); + + if (stuff->enable & (RRScreenChangeNotifyMask| + RRCrtcChangeNotifyMask| + RROutputChangeNotifyMask)) + { + ScreenPtr pScreen = pWin->drawable.pScreen; + rrScrPriv (pScreen); + + pRREvent = NULL; + if (pHead) + { + /* check for existing entry. */ + for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) + if (pRREvent->client == client) + break; + } + + if (!pRREvent) + { + /* build the entry */ + pRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); + if (!pRREvent) + return BadAlloc; + pRREvent->next = 0; + pRREvent->client = client; + pRREvent->window = pWin; + pRREvent->mask = stuff->enable; + /* + * add a resource that will be deleted when + * the client goes away + */ + clientResource = FakeClientID (client->index); + pRREvent->clientResource = clientResource; + if (!AddResource (clientResource, RRClientType, (pointer)pRREvent)) + return BadAlloc; + /* + * create a resource to contain a pointer to the list + * of clients selecting input. This must be indirect as + * the list may be arbitrarily rearranged which cannot be + * done through the resource database. + */ + if (!pHead) + { + pHead = (RREventPtr *) xalloc (sizeof (RREventPtr)); + if (!pHead || + !AddResource (pWin->drawable.id, RREventType, (pointer)pHead)) + { + FreeResource (clientResource, RT_NONE); + return BadAlloc; + } + *pHead = 0; + } + pRREvent->next = *pHead; + *pHead = pRREvent; + } + /* + * Now see if the client needs an event + */ + if (pScrPriv && (pRREvent->mask & RRScreenChangeNotifyMask)) + { + pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; + if (CompareTimeStamps (pTimes->setTime, + pScrPriv->lastSetTime) != 0 || + CompareTimeStamps (pTimes->configTime, + pScrPriv->lastConfigTime) != 0) + { + RRDeliverScreenEvent (client, pWin, pScreen); + } + } + } + else if (stuff->enable == 0) + { + /* delete the interest */ + if (pHead) { + RREventPtr pNewRREvent = 0; + for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { + if (pRREvent->client == client) + break; + pNewRREvent = pRREvent; + } + if (pRREvent) { + FreeResource (pRREvent->clientResource, RRClientType); + if (pNewRREvent) + pNewRREvent->next = pRREvent->next; + else + *pHead = pRREvent->next; + xfree (pRREvent); + } + } + } + else + { + client->errorValue = stuff->enable; + return BadValue; + } + return Success; +} + +int (*ProcRandrVector[RRNumberRequests])(ClientPtr) = { + ProcRRQueryVersion, /* 0 */ +/* we skip 1 to make old clients fail pretty immediately */ + NULL, /* 1 ProcRandrOldGetScreenInfo */ +/* V1.0 apps share the same set screen config request id */ + ProcRRSetScreenConfig, /* 2 */ + NULL, /* 3 ProcRandrOldScreenChangeSelectInput */ +/* 3 used to be ScreenChangeSelectInput; deprecated */ + ProcRRSelectInput, /* 4 */ + ProcRRGetScreenInfo, /* 5 */ +/* V1.2 additions */ + ProcRRGetScreenSizeRange, /* 6 */ + ProcRRSetScreenSize, /* 7 */ + ProcRRGetScreenResources, /* 8 */ + ProcRRGetOutputInfo, /* 9 */ + ProcRRListOutputProperties, /* 10 */ + ProcRRQueryOutputProperty, /* 11 */ + ProcRRConfigureOutputProperty, /* 12 */ + ProcRRChangeOutputProperty, /* 13 */ + ProcRRDeleteOutputProperty, /* 14 */ + ProcRRGetOutputProperty, /* 15 */ + ProcRRCreateMode, /* 16 */ + ProcRRDestroyMode, /* 17 */ + ProcRRAddOutputMode, /* 18 */ + ProcRRDeleteOutputMode, /* 19 */ + ProcRRGetCrtcInfo, /* 20 */ + ProcRRSetCrtcConfig, /* 21 */ + ProcRRGetCrtcGammaSize, /* 22 */ + ProcRRGetCrtcGamma, /* 23 */ + ProcRRSetCrtcGamma, /* 24 */ +}; + diff --git a/randr/rrinfo.c b/randr/rrinfo.c new file mode 100644 index 000000000..244b089f3 --- /dev/null +++ b/randr/rrinfo.c @@ -0,0 +1,342 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" + +#ifdef RANDR_10_INTERFACE +static RRModePtr +RROldModeAdd (RROutputPtr output, RRScreenSizePtr size, int refresh) +{ + ScreenPtr pScreen = output->pScreen; + rrScrPriv(pScreen); + xRRModeInfo modeInfo; + char name[100]; + RRModePtr mode; + int i; + RRModePtr *modes; + + memset (&modeInfo, '\0', sizeof (modeInfo)); + sprintf (name, "%dx%d", size->width, size->height); + + modeInfo.width = size->width; + modeInfo.height = size->height; + modeInfo.hTotal = size->width; + modeInfo.vTotal = size->height; + modeInfo.dotClock = ((CARD32) size->width * (CARD32) size->height * + (CARD32) refresh); + modeInfo.nameLength = strlen (name); + mode = RRModeGet (&modeInfo, name); + if (!mode) + return NULL; + for (i = 0; i < output->numModes; i++) + if (output->modes[i] == mode) + { + RRModeDestroy (mode); + return mode; + } + + if (output->numModes) + modes = xrealloc (output->modes, + (output->numModes + 1) * sizeof (RRModePtr)); + else + modes = xalloc (sizeof (RRModePtr)); + if (!modes) + { + RRModeDestroy (mode); + FreeResource (mode->mode.id, 0); + return NULL; + } + modes[output->numModes++] = mode; + output->modes = modes; + output->changed = TRUE; + pScrPriv->changed = TRUE; + return mode; +} + +static void +RRScanOldConfig (ScreenPtr pScreen, Rotation rotations) +{ + rrScrPriv(pScreen); + RROutputPtr output; + RRCrtcPtr crtc; + RRModePtr mode, newMode = NULL; + int i; + CARD16 minWidth = MAXSHORT, minHeight = MAXSHORT; + CARD16 maxWidth = 0, maxHeight = 0; + + /* + * First time through, create a crtc and output and hook + * them together + */ + if (pScrPriv->numOutputs == 0 && + pScrPriv->numCrtcs == 0) + { + crtc = RRCrtcCreate (NULL); + if (!crtc) + return; + if (!RRCrtcAttachScreen (crtc, pScreen)) + { + RRCrtcDestroy (crtc); + return; + } + output = RROutputCreate ("default", 7, NULL); + if (!output) + return; + if (!RROutputAttachScreen (output, pScreen)) + return; + RROutputSetCrtcs (output, &crtc, 1); + RROutputSetCrtc (output, crtc); + RROutputSetConnection (output, RR_Connected); +#ifdef RENDER + RROutputSetSubpixelOrder (output, PictureGetSubpixelOrder (pScreen)); +#endif + } + + output = RRFirstOutput (pScreen); + if (!output) + return; + crtc = output->crtc; + + /* check rotations */ + if (rotations != crtc->rotations) + { + crtc->rotations = rotations; + crtc->changed = TRUE; + pScrPriv->changed = TRUE; + } + + /* regenerate mode list */ + for (i = 0; i < pScrPriv->nSizes; i++) + { + RRScreenSizePtr size = &pScrPriv->pSizes[i]; + int r; + + if (size->nRates) + { + for (r = 0; r < size->nRates; r++) + { + mode = RROldModeAdd (output, size, size->pRates[r].rate); + if (i == pScrPriv->size && + size->pRates[r].rate == pScrPriv->rate) + { + newMode = mode; + } + } + xfree (size->pRates); + } + else + { + mode = RROldModeAdd (output, size, 0); + if (i == pScrPriv->size) + newMode = mode; + } + } + if (pScrPriv->nSizes) + xfree (pScrPriv->pSizes); + pScrPriv->pSizes = NULL; + pScrPriv->nSizes = 0; + + /* find size bounds */ + for (i = 0; i < output->numModes; i++) + { + RRModePtr mode = output->modes[i]; + CARD16 width = mode->mode.width; + CARD16 height = mode->mode.height; + + if (width < minWidth) minWidth = width; + if (width > maxWidth) maxWidth = width; + if (height < minHeight) minHeight = height; + if (height > maxHeight) maxHeight = height; + } + + if (minWidth != pScrPriv->minWidth) { + pScrPriv->minWidth = minWidth; pScrPriv->changed = TRUE; + } + if (maxWidth != pScrPriv->maxWidth) { + pScrPriv->maxWidth = maxWidth; pScrPriv->changed = TRUE; + } + if (minHeight != pScrPriv->minHeight) { + pScrPriv->minHeight = minHeight; pScrPriv->changed = TRUE; + } + if (maxHeight != pScrPriv->maxHeight) { + pScrPriv->maxHeight = maxHeight; pScrPriv->changed = TRUE; + } + + /* notice current mode */ + if (newMode) + RRCrtcNotify (output->crtc, newMode, 0, 0, pScrPriv->rotation, + 1, &output); +} +#endif + +/* + * Poll the driver for changed information + */ +Bool +RRGetInfo (ScreenPtr pScreen) +{ + rrScrPriv (pScreen); + Rotation rotations; + int i; + + for (i = 0; i < pScrPriv->numOutputs; i++) + pScrPriv->outputs[i]->changed = FALSE; + for (i = 0; i < pScrPriv->numCrtcs; i++) + pScrPriv->crtcs[i]->changed = FALSE; + + rotations = 0; + pScrPriv->changed = FALSE; + + if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) + return FALSE; + +#if RANDR_10_INTERFACE + if (pScrPriv->nSizes) + RRScanOldConfig (pScreen, rotations); +#endif + RRTellChanged (pScreen); + return TRUE; +} + +#if RANDR_12_INTERFACE +/* + * Register the range of sizes for the screen + */ +void +RRScreenSetSizeRange (ScreenPtr pScreen, + CARD16 minWidth, + CARD16 minHeight, + CARD16 maxWidth, + CARD16 maxHeight) +{ + rrScrPriv (pScreen); + + if (!pScrPriv) + return; + pScrPriv->minWidth = minWidth; + pScrPriv->minHeight = minHeight; + pScrPriv->maxWidth = maxWidth; + pScrPriv->maxHeight = maxHeight; +} +#endif + +#ifdef RANDR_10_INTERFACE +static Bool +RRScreenSizeMatches (RRScreenSizePtr a, + RRScreenSizePtr b) +{ + if (a->width != b->width) + return FALSE; + if (a->height != b->height) + return FALSE; + if (a->mmWidth != b->mmWidth) + return FALSE; + if (a->mmHeight != b->mmHeight) + return FALSE; + return TRUE; +} + +RRScreenSizePtr +RRRegisterSize (ScreenPtr pScreen, + short width, + short height, + short mmWidth, + short mmHeight) +{ + rrScrPriv (pScreen); + int i; + RRScreenSize tmp; + RRScreenSizePtr pNew; + + if (!pScrPriv) + return 0; + + tmp.id = 0; + tmp.width = width; + tmp.height= height; + tmp.mmWidth = mmWidth; + tmp.mmHeight = mmHeight; + tmp.pRates = 0; + tmp.nRates = 0; + for (i = 0; i < pScrPriv->nSizes; i++) + if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i])) + return &pScrPriv->pSizes[i]; + pNew = xrealloc (pScrPriv->pSizes, + (pScrPriv->nSizes + 1) * sizeof (RRScreenSize)); + if (!pNew) + return 0; + pNew[pScrPriv->nSizes++] = tmp; + pScrPriv->pSizes = pNew; + return &pNew[pScrPriv->nSizes-1]; +} + +Bool RRRegisterRate (ScreenPtr pScreen, + RRScreenSizePtr pSize, + int rate) +{ + rrScrPriv(pScreen); + int i; + RRScreenRatePtr pNew, pRate; + + if (!pScrPriv) + return FALSE; + + for (i = 0; i < pSize->nRates; i++) + if (pSize->pRates[i].rate == rate) + return TRUE; + + pNew = xrealloc (pSize->pRates, + (pSize->nRates + 1) * sizeof (RRScreenRate)); + if (!pNew) + return FALSE; + pRate = &pNew[pSize->nRates++]; + pRate->rate = rate; + pSize->pRates = pNew; + return TRUE; +} + +Rotation +RRGetRotation(ScreenPtr pScreen) +{ + RROutputPtr output = RRFirstOutput (pScreen); + + if (!output) + return RR_Rotate_0; + + return output->crtc->rotation; +} + +void +RRSetCurrentConfig (ScreenPtr pScreen, + Rotation rotation, + int rate, + RRScreenSizePtr pSize) +{ + rrScrPriv (pScreen); + + if (!pScrPriv) + return; + pScrPriv->size = pSize - pScrPriv->pSizes; + pScrPriv->rotation = rotation; + pScrPriv->rate = rate; +} +#endif diff --git a/randr/rrmode.c b/randr/rrmode.c new file mode 100644 index 000000000..a0696e170 --- /dev/null +++ b/randr/rrmode.c @@ -0,0 +1,221 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" + +RESTYPE RRModeType; + +static Bool +RRModeEqual (xRRModeInfo *a, xRRModeInfo *b) +{ + if (a->width != b->width) return FALSE; + if (a->height != b->height) return FALSE; + if (a->dotClock != b->dotClock) return FALSE; + if (a->hSyncStart != b->hSyncStart) return FALSE; + if (a->hSyncEnd != b->hSyncEnd) return FALSE; + if (a->hTotal != b->hTotal) return FALSE; + if (a->hSkew != b->hSkew) return FALSE; + if (a->vSyncStart != b->vSyncStart) return FALSE; + if (a->vSyncEnd != b->vSyncEnd) return FALSE; + if (a->vTotal != b->vTotal) return FALSE; + if (a->nameLength != b->nameLength) return FALSE; + if (a->modeFlags != b->modeFlags) return FALSE; + return TRUE; +} + +/* + * Keep a list so it's easy to find modes in the resource database. + */ +static int num_modes; +static RRModePtr *modes; + +RRModePtr +RRModeGet (xRRModeInfo *modeInfo, + const char *name) +{ + int i; + RRModePtr mode; + RRModePtr *newModes; + + for (i = 0; i < num_modes; i++) + { + mode = modes[i]; + if (RRModeEqual (&mode->mode, modeInfo) && + !memcmp (name, mode->name, modeInfo->nameLength)) + { + ++mode->refcnt; + return mode; + } + } + + if (!RRInit ()) + return NULL; + + mode = xalloc (sizeof (RRModeRec) + modeInfo->nameLength + 1); + if (!mode) + return NULL; + mode->refcnt = 1; + mode->mode = *modeInfo; + mode->name = (char *) (mode + 1); + memcpy (mode->name, name, modeInfo->nameLength); + mode->name[modeInfo->nameLength] = '\0'; + mode->userDefined = FALSE; + + if (num_modes) + newModes = xrealloc (modes, (num_modes + 1) * sizeof (RRModePtr)); + else + newModes = xalloc (sizeof (RRModePtr)); + + if (!newModes) + { + xfree (mode); + return NULL; + } + + mode->mode.id = FakeClientID(0); + if (!AddResource (mode->mode.id, RRModeType, (pointer) mode)) + return NULL; + modes = newModes; + modes[num_modes++] = mode; + + /* + * give the caller a reference to this mode + */ + ++mode->refcnt; + return mode; +} + +RRModePtr * +RRModesForScreen (ScreenPtr pScreen, int *num_ret) +{ + rrScrPriv(pScreen); + int o; + RRModePtr *screen_modes; + int num_screen_modes = 0; + + screen_modes = xalloc ((num_modes ? num_modes : 1) * sizeof (RRModePtr)); + + for (o = 0; o < pScrPriv->numOutputs; o++) + { + RROutputPtr output = pScrPriv->outputs[o]; + int m, n; + + for (m = 0; m < output->numModes; m++) + { + RRModePtr mode = output->modes[m]; + for (n = 0; n < num_screen_modes; n++) + if (screen_modes[n] == mode) + break; + if (n == num_screen_modes) + screen_modes[num_screen_modes++] = mode; + } + } + *num_ret = num_screen_modes; + return screen_modes; +} + +void +RRModeDestroy (RRModePtr mode) +{ + int m; + + if (--mode->refcnt > 0) + return; + for (m = 0; m < num_modes; m++) + { + if (modes[m] == mode) + { + memmove (modes + m, modes + m + 1, + (num_modes - m - 1) * sizeof (RRModePtr)); + num_modes--; + if (!num_modes) + { + xfree (modes); + modes = NULL; + } + break; + } + } + + xfree (mode); +} + +static int +RRModeDestroyResource (pointer value, XID pid) +{ + RRModeDestroy ((RRModePtr) value); + return 1; +} + +Bool +RRModeInit (void) +{ + assert (num_modes == 0); + assert (modes == NULL); + RRModeType = CreateNewResourceType (RRModeDestroyResource); + if (!RRModeType) + return FALSE; +#ifdef XResExtension + RegisterResourceName (RRModeType, "MODE"); +#endif + return TRUE; +} + +int +ProcRRCreateMode (ClientPtr client) +{ + REQUEST(xRRCreateModeReq); + + REQUEST_SIZE_MATCH(xRRCreateModeReq); + (void) stuff; + return BadImplementation; +} + +int +ProcRRDestroyMode (ClientPtr client) +{ + REQUEST(xRRDestroyModeReq); + + REQUEST_SIZE_MATCH(xRRDestroyModeReq); + (void) stuff; + return BadImplementation; +} + +int +ProcRRAddOutputMode (ClientPtr client) +{ + REQUEST(xRRAddOutputModeReq); + + REQUEST_SIZE_MATCH(xRRAddOutputModeReq); + (void) stuff; + return BadImplementation; +} + +int +ProcRRDeleteOutputMode (ClientPtr client) +{ + REQUEST(xRRDeleteOutputModeReq); + + REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq); + (void) stuff; + return BadImplementation; +} diff --git a/randr/rroutput.c b/randr/rroutput.c new file mode 100644 index 000000000..430f8bdaa --- /dev/null +++ b/randr/rroutput.c @@ -0,0 +1,463 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" + +RESTYPE RROutputType; + +/* + * Notify the output of some change + */ +void +RROutputChanged (RROutputPtr output) +{ + ScreenPtr pScreen = output->pScreen; + + output->changed = TRUE; + if (pScreen) + { + rrScrPriv (pScreen); + pScrPriv->changed = TRUE; + } +} + +/* + * Create an output + */ + +RROutputPtr +RROutputCreate (const char *name, + int nameLength, + void *devPrivate) +{ + RROutputPtr output; + + if (!RRInit()) + return NULL; + output = xalloc (sizeof (RROutputRec) + nameLength + 1); + if (!output) + return NULL; + output->id = FakeClientID (0); + output->pScreen = NULL; + output->name = (char *) (output + 1); + output->nameLength = nameLength; + memcpy (output->name, name, nameLength); + output->name[nameLength] = '\0'; + output->connection = RR_UnknownConnection; + output->subpixelOrder = SubPixelUnknown; + output->mmWidth = 0; + output->mmHeight = 0; + output->crtc = NULL; + output->numCrtcs = 0; + output->crtcs = NULL; + output->numClones = 0; + output->clones = NULL; + output->numModes = 0; + output->numPreferred = 0; + output->modes = NULL; + output->properties = NULL; + output->changed = FALSE; + output->devPrivate = devPrivate; + + if (!AddResource (output->id, RROutputType, (pointer) output)) + return NULL; + + return output; +} + +/* + * Attach an Output to a screen. This is done as a separate step + * so that an xf86-based driver can create Outputs in PreInit + * before the Screen has been created + */ + +Bool +RROutputAttachScreen (RROutputPtr output, ScreenPtr pScreen) +{ + rrScrPriv (pScreen); + RROutputPtr *outputs; + + if (pScrPriv->numOutputs) + outputs = xrealloc (pScrPriv->outputs, + (pScrPriv->numOutputs + 1) * sizeof (RROutputPtr)); + else + outputs = xalloc (sizeof (RROutputPtr)); + if (!outputs) + return FALSE; + output->pScreen = pScreen; + pScrPriv->outputs = outputs; + pScrPriv->outputs[pScrPriv->numOutputs++] = output; + RROutputChanged (output); + return TRUE; +} + +/* + * Notify extension that output parameters have been changed + */ +Bool +RROutputSetClones (RROutputPtr output, + RROutputPtr *clones, + int numClones) +{ + RROutputPtr *newClones; + int i; + + if (numClones == output->numClones) + { + for (i = 0; i < numClones; i++) + if (output->clones[i] != clones[i]) + break; + if (i == numClones) + return TRUE; + } + if (numClones) + { + newClones = xalloc (numClones * sizeof (RROutputPtr)); + if (!newClones) + return FALSE; + } + else + newClones = NULL; + if (output->clones) + xfree (output->clones); + memcpy (newClones, clones, numClones * sizeof (RROutputPtr)); + output->clones = newClones; + output->numClones = numClones; + RROutputChanged (output); + return TRUE; +} + +Bool +RROutputSetModes (RROutputPtr output, + RRModePtr *modes, + int numModes, + int numPreferred) +{ + RRModePtr *newModes; + int i; + + if (numModes == output->numModes && numPreferred == output->numPreferred) + { + for (i = 0; i < numModes; i++) + if (output->modes[i] != modes[i]) + break; + if (i == numModes) + { + for (i = 0; i < numModes; i++) + RRModeDestroy (modes[i]); + return TRUE; + } + } + + if (numModes) + { + newModes = xalloc (numModes * sizeof (RRModePtr)); + if (!newModes) + return FALSE; + } + else + newModes = NULL; + if (output->modes) + { + for (i = 0; i < output->numModes; i++) + RRModeDestroy (output->modes[i]); + xfree (output->modes); + } + memcpy (newModes, modes, numModes * sizeof (RRModePtr)); + output->modes = newModes; + output->numModes = numModes; + output->numPreferred = numPreferred; + RROutputChanged (output); + return TRUE; +} + +Bool +RROutputSetCrtcs (RROutputPtr output, + RRCrtcPtr *crtcs, + int numCrtcs) +{ + RRCrtcPtr *newCrtcs; + int i; + + if (numCrtcs == output->numCrtcs) + { + for (i = 0; i < numCrtcs; i++) + if (output->crtcs[i] != crtcs[i]) + break; + if (i == numCrtcs) + return TRUE; + } + if (numCrtcs) + { + newCrtcs = xalloc (numCrtcs * sizeof (RRCrtcPtr)); + if (!newCrtcs) + return FALSE; + } + else + newCrtcs = NULL; + if (output->crtcs) + xfree (output->crtcs); + memcpy (newCrtcs, crtcs, numCrtcs * sizeof (RRCrtcPtr)); + output->crtcs = newCrtcs; + output->numCrtcs = numCrtcs; + RROutputChanged (output); + return TRUE; +} + +void +RROutputSetCrtc (RROutputPtr output, RRCrtcPtr crtc) +{ + if (output->crtc == crtc) + return; + output->crtc = crtc; + RROutputChanged (output); +} + +Bool +RROutputSetConnection (RROutputPtr output, + CARD8 connection) +{ + if (output->connection == connection) + return TRUE; + output->connection = connection; + RROutputChanged (output); + return TRUE; +} + +Bool +RROutputSetSubpixelOrder (RROutputPtr output, + int subpixelOrder) +{ + if (output->subpixelOrder == subpixelOrder) + return TRUE; + + output->subpixelOrder = subpixelOrder; + RROutputChanged (output); + return TRUE; +} + +Bool +RROutputSetPhysicalSize (RROutputPtr output, + int mmWidth, + int mmHeight) +{ + if (output->mmWidth == mmWidth && output->mmHeight == mmHeight) + return TRUE; + output->mmWidth = mmWidth; + output->mmHeight = mmHeight; + RROutputChanged (output); + return TRUE; +} + + +void +RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + rrScrPriv (pScreen); + xRROutputChangeNotifyEvent oe; + RRCrtcPtr crtc = output->crtc; + RRModePtr mode = crtc ? crtc->mode : 0; + + oe.type = RRNotify + RREventBase; + oe.subCode = RRNotify_OutputChange; + oe.sequenceNumber = client->sequence; + oe.timestamp = pScrPriv->lastSetTime.milliseconds; + oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds; + oe.window = pWin->drawable.id; + oe.output = output->id; + if (crtc) + { + oe.crtc = crtc->id; + oe.mode = mode ? mode->mode.id : None; + oe.rotation = crtc->rotation; + } + else + { + oe.crtc = None; + oe.mode = None; + oe.rotation = RR_Rotate_0; + } + oe.connection = output->connection; + oe.subpixelOrder = output->subpixelOrder; + WriteEventsToClient (client, 1, (xEvent *) &oe); +} + +/* + * Destroy a Output at shutdown + */ +void +RROutputDestroy (RROutputPtr crtc) +{ + FreeResource (crtc->id, 0); +} + +static int +RROutputDestroyResource (pointer value, XID pid) +{ + RROutputPtr output = (RROutputPtr) value; + ScreenPtr pScreen = output->pScreen; + + if (pScreen) + { + rrScrPriv(pScreen); + int i; + + for (i = 0; i < pScrPriv->numOutputs; i++) + { + if (pScrPriv->outputs[i] == output) + { + memmove (pScrPriv->outputs + i, pScrPriv->outputs + i + 1, + (pScrPriv->numOutputs - (i + 1)) * sizeof (RROutputPtr)); + --pScrPriv->numOutputs; + break; + } + } + } + if (output->modes) + xfree (output->modes); + if (output->crtcs) + xfree (output->crtcs); + if (output->clones) + xfree (output->clones); + RRDeleteAllOutputProperties (output); + xfree (output); + return 1; +} + +/* + * Initialize output type + */ +Bool +RROutputInit (void) +{ + RROutputType = CreateNewResourceType (RROutputDestroyResource); + if (!RROutputType) + return FALSE; +#ifdef XResExtension + RegisterResourceName (RROutputType, "OUTPUT"); +#endif + return TRUE; +} + +#define OutputInfoExtra (SIZEOF(xRRGetOutputInfoReply) - 32) + +int +ProcRRGetOutputInfo (ClientPtr client) +{ + REQUEST(xRRGetOutputInfoReq);; + xRRGetOutputInfoReply rep; + RROutputPtr output; + CARD8 *extra; + unsigned long extraLen; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + RRCrtc *crtcs; + RRMode *modes; + RROutput *clones; + char *name; + int i, n; + + REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); + output = LookupOutput(client, stuff->output, SecurityReadAccess); + + if (!output) + return RRErrorBase + BadRROutput; + + pScreen = output->pScreen; + pScrPriv = rrGetScrPriv(pScreen); + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = OutputInfoExtra >> 2; + rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep.crtc = output->crtc ? output->crtc->id : None; + rep.mmWidth = output->mmWidth; + rep.mmHeight = output->mmHeight; + rep.connection = output->connection; + rep.subpixelOrder = output->subpixelOrder; + rep.nCrtcs = output->numCrtcs; + rep.nModes = output->numModes; + rep.nPreferred = output->numPreferred; + rep.nClones = output->numClones; + rep.nameLength = output->nameLength; + + extraLen = ((output->numCrtcs + + output->numModes + + output->numClones + + ((rep.nameLength + 3) >> 2)) << 2); + + if (extraLen) + { + rep.length += extraLen >> 2; + extra = xalloc (extraLen); + if (!extra) + return BadAlloc; + } + else + extra = NULL; + + crtcs = (RRCrtc *) extra; + modes = (RRMode *) (crtcs + output->numCrtcs); + clones = (RROutput *) (modes + output->numModes); + name = (char *) (clones + output->numClones); + + for (i = 0; i < output->numCrtcs; i++) + { + crtcs[i] = output->crtcs[i]->id; + if (client->swapped) + swapl (&crtcs[i], n); + } + for (i = 0; i < output->numModes; i++) + { + modes[i] = output->modes[i]->mode.id; + if (client->swapped) + swapl (&modes[i], n); + } + for (i = 0; i < output->numClones; i++) + { + clones[i] = output->clones[i]->id; + if (client->swapped) + swapl (&clones[i], n); + } + memcpy (name, output->name, output->nameLength); + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.timestamp, n); + swapl(&rep.crtc, n); + swapl(&rep.mmWidth, n); + swapl(&rep.mmHeight, n); + swaps(&rep.nCrtcs, n); + swaps(&rep.nModes, n); + swaps(&rep.nClones, n); + swaps(&rep.nameLength, n); + } + WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *)&rep); + if (extraLen) + { + WriteToClient (client, extraLen, (char *) extra); + xfree (extra); + } + + return client->noClientException; +} diff --git a/randr/rrpointer.c b/randr/rrpointer.c new file mode 100644 index 000000000..c092e494b --- /dev/null +++ b/randr/rrpointer.c @@ -0,0 +1,137 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" + +/* + * When the pointer moves, check to see if the specified position is outside + * any of theavailable CRTCs and move it to a 'sensible' place if so, where + * sensible is the closest monitor to the departing edge. + * + * Returns whether the position was adjusted + */ + +static Bool +RRCrtcContainsPosition (RRCrtcPtr crtc, int x, int y) +{ + RRModePtr mode = crtc->mode; + + if (!mode) + return FALSE; + if (crtc->x <= x && x < crtc->x + mode->mode.width && + crtc->y <= y && y < crtc->y + mode->mode.height) + return TRUE; + return FALSE; +} + +/* + * Find the CRTC nearest the specified position, ignoring 'skip' + */ +static void +RRPointerToNearestCrtc (ScreenPtr pScreen, int x, int y, RRCrtcPtr skip) +{ + rrScrPriv (pScreen); + int c; + RRCrtcPtr nearest = NULL; + int best = 0; + int best_dx = 0, best_dy = 0; + + for (c = 0; c < pScrPriv->numCrtcs; c++) + { + RRCrtcPtr crtc = pScrPriv->crtcs[c]; + RRModePtr mode = crtc->mode; + int dx, dy; + int dist; + + if (!mode) + continue; + if (crtc == skip) + continue; + if (x < crtc->x) + dx = crtc->x - x; + else if (x > crtc->x + mode->mode.width) + dx = x - (crtc->x + mode->mode.width); + else + dx = 0; + if (y < crtc->y) + dy = crtc->y - x; + else if (y > crtc->y + mode->mode.height) + dy = y - (crtc->y + mode->mode.height); + else + dy = 0; + dist = dx + dy; + if (!nearest || dist < best) + { + nearest = crtc; + best_dx = dx; + best_dy = dy; + } + } + if (best_dx || best_dy) + (*pScreen->SetCursorPosition) (pScreen, x + best_dx, y + best_dy, TRUE); + pScrPriv->pointerCrtc = nearest; +} + +void +RRPointerMoved (ScreenPtr pScreen, int x, int y) +{ + rrScrPriv (pScreen); + RRCrtcPtr pointerCrtc = pScrPriv->pointerCrtc;; + int c; + + /* Check last known CRTC */ + if (pointerCrtc && RRCrtcContainsPosition (pointerCrtc, x, y)) + return; + + /* Check all CRTCs */ + for (c = 0; c < pScrPriv->numCrtcs; c++) + { + RRCrtcPtr crtc = pScrPriv->crtcs[c]; + + if (RRCrtcContainsPosition (crtc, x, y)) + { + /* Remember containing CRTC */ + pScrPriv->pointerCrtc = crtc; + return; + } + } + + /* None contain pointer, find nearest */ + RRPointerToNearestCrtc (pScreen, x, y, pointerCrtc); +} + +/* + * When the screen is reconfigured, move the pointer to the nearest + * CRTC + */ +void +RRPointerScreenConfigured (ScreenPtr pScreen) +{ + WindowPtr pRoot = GetCurrentRootWindow (); + ScreenPtr pCurrentScreen = pRoot ? pRoot->drawable.pScreen : NULL; + int x, y; + + if (pScreen != pCurrentScreen) + return; + GetSpritePosition (&x, &y); + RRPointerToNearestCrtc (pScreen, x, y, NULL); +} diff --git a/randr/rrproperty.c b/randr/rrproperty.c new file mode 100644 index 000000000..13e848340 --- /dev/null +++ b/randr/rrproperty.c @@ -0,0 +1,624 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" +#include "propertyst.h" +#include "swaprep.h" + +static void +RRDeliverEvent (ScreenPtr pScreen, xEvent *event, CARD32 mask) +{ + +} + +void +RRDeleteAllOutputProperties (RROutputPtr output) +{ + RRPropertyPtr prop, next; + xRROutputPropertyNotifyEvent event; + + for (prop = output->properties; prop; prop = next) + { + next = prop->next; + event.type = RREventBase + RRNotify; + event.subCode = RRNotify_OutputProperty; + event.output = output->id; + event.state = PropertyDelete; + event.atom = prop->propertyName; + event.timestamp = currentTime.milliseconds; + RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask); + if (prop->current.data) + xfree(prop->current.data); + if (prop->pending.data) + xfree(prop->pending.data); + xfree(prop); + } +} + +static void +RRInitOutputPropertyValue (RRPropertyValuePtr property_value) +{ + property_value->type = None; + property_value->format = 0; + property_value->size = 0; + property_value->data = NULL; +} + +static RRPropertyPtr +RRCreateOutputProperty (Atom property) +{ + RRPropertyPtr prop; + + prop = (RRPropertyPtr)xalloc(sizeof(RRPropertyRec)); + if (!prop) + return NULL; + prop->next = NULL; + prop->propertyName = property; + prop->is_pending = FALSE; + prop->range = FALSE; + prop->immutable = FALSE; + prop->num_valid = 0; + prop->valid_values = NULL; + RRInitOutputPropertyValue (&prop->current); + RRInitOutputPropertyValue (&prop->pending); + return prop; +} + +static void +RRDestroyOutputProperty (RRPropertyPtr prop) +{ + if (prop->valid_values) + xfree (prop->valid_values); + if (prop->current.data) + xfree(prop->current.data); + if (prop->pending.data) + xfree(prop->pending.data); + xfree(prop); +} + +void +RRDeleteOutputProperty (RROutputPtr output, Atom property) +{ + RRPropertyPtr prop, *prev; + xRROutputPropertyNotifyEvent event; + + for (prev = &output->properties; (prop = *prev); prev = &(prop->next)) + if (prop->propertyName == property) + break; + if (prop) + { + *prev = prop->next; + event.type = RREventBase + RRNotify; + event.subCode = RRNotify_OutputProperty; + event.output = output->id; + event.state = PropertyDelete; + event.atom = prop->propertyName; + event.timestamp = currentTime.milliseconds; + RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask); + RRDestroyOutputProperty (prop); + } +} + +int +RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type, + int format, int mode, unsigned long len, + pointer value, Bool sendevent) +{ + RRPropertyPtr prop; + xRROutputPropertyNotifyEvent event; + int sizeInBytes; + int totalSize; + pointer data; + RRPropertyValuePtr prop_value; + Bool add = FALSE; + + sizeInBytes = format >> 3; + totalSize = len * sizeInBytes; + + /* first see if property already exists */ + prop = RRQueryOutputProperty (output, property); + if (!prop) /* just add to list */ + { + prop = RRCreateOutputProperty (property); + if (!prop) + return(BadAlloc); + add = TRUE; + mode = PropModeReplace; + } + if (prop->is_pending) + prop_value = &prop->pending; + else + prop_value = &prop->current; + + /* To append or prepend to a property the request format and type + must match those of the already defined property. The + existing format and type are irrelevant when using the mode + "PropModeReplace" since they will be written over. */ + + if ((format != prop_value->format) && (mode != PropModeReplace)) + return(BadMatch); + if ((prop_value->type != type) && (mode != PropModeReplace)) + return(BadMatch); + if (mode == PropModeReplace) + { + if (totalSize != prop_value->size * (prop_value->format >> 3)) + { + if (prop_value->data) + data = (pointer)xrealloc(prop_value->data, totalSize); + else + data = (pointer)xalloc (totalSize); + if (!data && len) + { + if (add) + RRDestroyOutputProperty (prop); + return(BadAlloc); + } + prop_value->data = data; + } + if (len) + memmove((char *)prop_value->data, (char *)value, totalSize); + prop_value->size = len; + prop_value->type = type; + prop_value->format = format; + } + else if (len == 0) + { + /* do nothing */ + } + else if (mode == PropModeAppend) + { + data = (pointer)xrealloc(prop_value->data, + sizeInBytes * (len + prop_value->size)); + if (!data) + return(BadAlloc); + prop_value->data = data; + memmove(&((char *)data)[prop_value->size * sizeInBytes], + (char *)value, + totalSize); + prop_value->size += len; + } + else if (mode == PropModePrepend) + { + data = (pointer)xalloc(sizeInBytes * (len + prop_value->size)); + if (!data) + return(BadAlloc); + memmove(&((char *)data)[totalSize], (char *)prop_value->data, + (int)(prop_value->size * sizeInBytes)); + memmove((char *)data, (char *)value, totalSize); + xfree(prop_value->data); + prop_value->data = data; + prop_value->size += len; + } + if (add) + { + prop->next = output->properties; + output->properties = prop; + } + if (sendevent) + { + event.type = RREventBase + RRNotify; + event.subCode = RRNotify_OutputProperty; + event.output = output->id; + event.state = PropertyNewValue; + event.atom = prop->propertyName; + event.timestamp = currentTime.milliseconds; + RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask); + } + return(Success); +} + +RRPropertyPtr +RRQueryOutputProperty (RROutputPtr output, Atom property) +{ + RRPropertyPtr prop; + + for (prop = output->properties; prop; prop = prop->next) + if (prop->propertyName == property) + return prop; + return NULL; +} + +RRPropertyValuePtr +RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending) +{ + RRPropertyPtr prop = RRQueryOutputProperty (output, property); + + if (!prop) + return NULL; + if (pending && prop->is_pending) + return &prop->pending; + else + return &prop->current; +} + +int +RRConfigureOutputProperty (RROutputPtr output, Atom property, + Bool pending, Bool range, Bool immutable, + int num_values, INT32 *values) +{ + RRPropertyPtr prop = RRQueryOutputProperty (output, property); + Bool add = FALSE; + INT32 *new_values; + + if (!prop) + { + prop = RRCreateOutputProperty (property); + if (!prop) + return(BadAlloc); + add = TRUE; + } else if (prop->immutable && !immutable) + return(BadAccess); + + /* + * ranges must have even number of values + */ + if (range && (num_values & 1)) + return BadMatch; + + new_values = xalloc (num_values * sizeof (INT32)); + if (!new_values && num_values) + return BadAlloc; + if (num_values) + memcpy (new_values, values, num_values * sizeof (INT32)); + + /* + * Property moving from pending to non-pending + * loses any pending values + */ + if (prop->is_pending && !pending) + { + if (prop->pending.data) + xfree (prop->pending.data); + RRInitOutputPropertyValue (&prop->pending); + } + + prop->is_pending = pending; + prop->range = range; + prop->immutable = immutable; + prop->num_valid = num_values; + if (prop->valid_values) + xfree (prop->valid_values); + prop->valid_values = new_values; + return Success; +} + +int +ProcRRListOutputProperties (ClientPtr client) +{ + REQUEST(xRRListOutputPropertiesReq); + Atom *pAtoms = NULL, *temppAtoms; + xRRListOutputPropertiesReply rep; + int numProps = 0; + RROutputPtr output; + RRPropertyPtr prop; + + REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq); + + output = LookupOutput (client, stuff->output, SecurityReadAccess); + + if (!output) + return RRErrorBase + BadRROutput; + + for (prop = output->properties; prop; prop = prop->next) + numProps++; + if (numProps) + if(!(pAtoms = (Atom *)ALLOCATE_LOCAL(numProps * sizeof(Atom)))) + return(BadAlloc); + + rep.type = X_Reply; + rep.length = (numProps * sizeof(Atom)) >> 2; + rep.sequenceNumber = client->sequence; + rep.nAtoms = numProps; + if (client->swapped) + { + int n; + swaps (&rep.sequenceNumber, n); + swapl (&rep.length, n); + } + temppAtoms = pAtoms; + for (prop = output->properties; prop; prop = prop->next) + *temppAtoms++ = prop->propertyName; + + WriteReplyToClient(client, sizeof(xRRListOutputPropertiesReply), &rep); + if (numProps) + { + client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; + WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); + DEALLOCATE_LOCAL(pAtoms); + } + return(client->noClientException); +} + +int +ProcRRQueryOutputProperty (ClientPtr client) +{ + REQUEST(xRRQueryOutputPropertyReq); + xRRQueryOutputPropertyReply rep; + RROutputPtr output; + RRPropertyPtr prop; + + REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); + + output = LookupOutput (client, stuff->output, SecurityReadAccess); + + if (!output) + return RRErrorBase + BadRROutput; + + prop = RRQueryOutputProperty (output, stuff->property); + if (!prop) + return BadName; + + rep.type = X_Reply; + rep.length = prop->num_valid; + rep.sequenceNumber = client->sequence; + rep.pending = prop->is_pending; + rep.range = prop->range; + rep.immutable = prop->immutable; + if (client->swapped) + { + int n; + swaps (&rep.sequenceNumber, n); + swapl (&rep.length, n); + } + WriteReplyToClient (client, sizeof (xRRQueryOutputPropertyReply), &rep); + if (prop->num_valid) + { + client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; + WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32), + prop->valid_values); + } + return(client->noClientException); +} + +int +ProcRRConfigureOutputProperty (ClientPtr client) +{ + REQUEST(xRRConfigureOutputPropertyReq); + RROutputPtr output; + int num_valid; + + REQUEST_SIZE_MATCH(xRRConfigureOutputPropertyReq); + + output = LookupOutput (client, stuff->output, SecurityReadAccess); + + if (!output) + return RRErrorBase + BadRROutput; + + num_valid = stuff->length - (sizeof (xRRConfigureOutputPropertyReq) >> 2); + return RRConfigureOutputProperty (output, stuff->property, + stuff->pending, stuff->range, + FALSE, num_valid, + (INT32 *) (stuff + 1)); +} + +int +ProcRRChangeOutputProperty (ClientPtr client) +{ + REQUEST(xRRChangeOutputPropertyReq); + RROutputPtr output; + char format, mode; + unsigned long len; + int sizeInBytes; + int totalSize; + int err; + + REQUEST_AT_LEAST_SIZE(xRRChangeOutputPropertyReq); + UpdateCurrentTime(); + format = stuff->format; + mode = stuff->mode; + if ((mode != PropModeReplace) && (mode != PropModeAppend) && + (mode != PropModePrepend)) + { + client->errorValue = mode; + return BadValue; + } + if ((format != 8) && (format != 16) && (format != 32)) + { + client->errorValue = format; + return BadValue; + } + len = stuff->nUnits; + if (len > ((0xffffffff - sizeof(xChangePropertyReq)) >> 2)) + return BadLength; + sizeInBytes = format>>3; + totalSize = len * sizeInBytes; + REQUEST_FIXED_SIZE(xRRChangeOutputPropertyReq, totalSize); + + output = LookupOutput (client, stuff->output, SecurityWriteAccess); + if (!output) + return RRErrorBase + BadRROutput; + + if (!ValidAtom(stuff->property)) + { + client->errorValue = stuff->property; + return(BadAtom); + } + if (!ValidAtom(stuff->type)) + { + client->errorValue = stuff->type; + return(BadAtom); + } + + err = RRChangeOutputProperty(output, stuff->property, + stuff->type, (int)format, + (int)mode, len, (pointer)&stuff[1], TRUE); + if (err != Success) + return err; + else + return client->noClientException; +} + +int +ProcRRDeleteOutputProperty (ClientPtr client) +{ + REQUEST(xRRDeleteOutputPropertyReq); + RROutputPtr output; + + REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); + UpdateCurrentTime(); + output = LookupOutput (client, stuff->output, SecurityWriteAccess); + if (!output) + return RRErrorBase + BadRROutput; + + if (!ValidAtom(stuff->property)) + { + client->errorValue = stuff->property; + return (BadAtom); + } + + + RRDeleteOutputProperty(output, stuff->property); + return client->noClientException; +} + +int +ProcRRGetOutputProperty (ClientPtr client) +{ + REQUEST(xRRGetOutputPropertyReq); + RRPropertyPtr prop, *prev; + RRPropertyValuePtr prop_value; + unsigned long n, len, ind; + RROutputPtr output; + xRRGetOutputPropertyReply reply; + + REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq); + if (stuff->delete) + UpdateCurrentTime(); + output = LookupOutput (client, stuff->output, + stuff->delete ? SecurityWriteAccess : + SecurityReadAccess); + if (!output) + return RRErrorBase + BadRROutput; + + if (!ValidAtom(stuff->property)) + { + client->errorValue = stuff->property; + return(BadAtom); + } + if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) + { + client->errorValue = stuff->delete; + return(BadValue); + } + if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) + { + client->errorValue = stuff->type; + return(BadAtom); + } + + for (prev = &output->properties; (prop = *prev); prev = &prop->next) + if (prop->propertyName == stuff->property) + break; + + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + if (!prop) + { + reply.nItems = 0; + reply.length = 0; + reply.bytesAfter = 0; + reply.propertyType = None; + reply.format = 0; + WriteReplyToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); + return(client->noClientException); + } + + if (prop->immutable && stuff->delete) + return BadAccess; + + if (stuff->pending && prop->is_pending) + prop_value = &prop->pending; + else + prop_value = &prop->current; + + /* If the request type and actual type don't match. Return the + property information, but not the data. */ + + if (((stuff->type != prop_value->type) && + (stuff->type != AnyPropertyType)) + ) + { + reply.bytesAfter = prop_value->size; + reply.format = prop_value->format; + reply.length = 0; + reply.nItems = 0; + reply.propertyType = prop_value->type; + WriteReplyToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); + return(client->noClientException); + } + +/* + * Return type, format, value to client + */ + n = (prop_value->format/8) * prop_value->size; /* size (bytes) of prop */ + ind = stuff->longOffset << 2; + + /* If longOffset is invalid such that it causes "len" to + be negative, it's a value error. */ + + if (n < ind) + { + client->errorValue = stuff->longOffset; + return BadValue; + } + + len = min(n - ind, 4 * stuff->longLength); + + reply.bytesAfter = n - (ind + len); + reply.format = prop_value->format; + reply.length = (len + 3) >> 2; + reply.nItems = len / (prop_value->format / 8 ); + reply.propertyType = prop_value->type; + + if (stuff->delete && (reply.bytesAfter == 0)) + { + xRROutputPropertyNotifyEvent event; + + event.type = RREventBase + RRNotify; + event.subCode = RRNotify_OutputProperty; + event.output = output->id; + event.state = PropertyDelete; + event.atom = prop->propertyName; + event.timestamp = currentTime.milliseconds; + RRDeliverEvent (output->pScreen, (xEvent *) &event, RROutputPropertyNotifyMask); + } + + WriteReplyToClient(client, sizeof(xGenericReply), &reply); + if (len) + { + switch (reply.format) { + case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break; + case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break; + default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break; + } + WriteSwappedDataToClient(client, len, + (char *)prop_value->data + ind); + } + + if (stuff->delete && (reply.bytesAfter == 0)) + { /* delete the Property */ + *prev = prop->next; + RRDestroyOutputProperty (prop); + } + return(client->noClientException); +} + diff --git a/randr/rrscreen.c b/randr/rrscreen.c new file mode 100644 index 000000000..76c16b010 --- /dev/null +++ b/randr/rrscreen.c @@ -0,0 +1,913 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" + +extern char *ConnectionInfo; + +static int padlength[4] = {0, 3, 2, 1}; + +/* + * Edit connection information block so that new clients + * see the current screen size on connect + */ +static void +RREditConnectionInfo (ScreenPtr pScreen) +{ + xConnSetup *connSetup; + char *vendor; + xPixmapFormat *formats; + xWindowRoot *root; + xDepth *depth; + xVisualType *visual; + int screen = 0; + int d; + + connSetup = (xConnSetup *) ConnectionInfo; + vendor = (char *) connSetup + sizeof (xConnSetup); + formats = (xPixmapFormat *) ((char *) vendor + + connSetup->nbytesVendor + + padlength[connSetup->nbytesVendor & 3]); + root = (xWindowRoot *) ((char *) formats + + sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); + while (screen != pScreen->myNum) + { + depth = (xDepth *) ((char *) root + + sizeof (xWindowRoot)); + for (d = 0; d < root->nDepths; d++) + { + visual = (xVisualType *) ((char *) depth + + sizeof (xDepth)); + depth = (xDepth *) ((char *) visual + + depth->nVisuals * sizeof (xVisualType)); + } + root = (xWindowRoot *) ((char *) depth); + screen++; + } + root->pixWidth = pScreen->width; + root->pixHeight = pScreen->height; + root->mmWidth = pScreen->mmWidth; + root->mmHeight = pScreen->mmHeight; +} + +void +RRSendConfigNotify (ScreenPtr pScreen) +{ + WindowPtr pWin = WindowTable[pScreen->myNum]; + xEvent event; + + event.u.u.type = ConfigureNotify; + event.u.configureNotify.window = pWin->drawable.id; + event.u.configureNotify.aboveSibling = None; + event.u.configureNotify.x = 0; + event.u.configureNotify.y = 0; + + /* XXX xinerama stuff ? */ + + event.u.configureNotify.width = pWin->drawable.width; + event.u.configureNotify.height = pWin->drawable.height; + event.u.configureNotify.borderWidth = wBorderWidth (pWin); + event.u.configureNotify.override = pWin->overrideRedirect; + DeliverEvents(pWin, &event, 1, NullWindow); +} + +void +RRDeliverScreenEvent (ClientPtr client, WindowPtr pWin, ScreenPtr pScreen) +{ + rrScrPriv (pScreen); + xRRScreenChangeNotifyEvent se; + RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL; + RROutputPtr output = pScrPriv->numOutputs ? pScrPriv->outputs[0] : NULL; + RRModePtr mode = crtc ? crtc->mode : NULL; + WindowPtr pRoot = WindowTable[pScreen->myNum]; + int i; + + se.type = RRScreenChangeNotify + RREventBase; + se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); + se.timestamp = pScrPriv->lastSetTime.milliseconds; + se.sequenceNumber = client->sequence; + se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; + se.root = pRoot->drawable.id; + se.window = pWin->drawable.id; +#ifdef RENDER + se.subpixelOrder = PictureGetSubpixelOrder (pScreen); +#else + se.subpixelOrder = SubPixelUnknown; +#endif + + se.sequenceNumber = client->sequence; + if (mode) + { + se.sizeID = -1; + for (i = 0; i < output->numModes; i++) + if (mode == output->modes[i]) + { + se.sizeID = i; + break; + } + se.widthInPixels = mode->mode.width; + se.heightInPixels = mode->mode.height; + se.widthInMillimeters = pScreen->mmWidth; + se.heightInMillimeters = pScreen->mmHeight; + } + else + { + /* + * This "shouldn't happen", but a broken DDX can + * forget to set the current configuration on GetInfo + */ + se.sizeID = 0xffff; + se.widthInPixels = 0; + se.heightInPixels = 0; + se.widthInMillimeters = 0; + se.heightInMillimeters = 0; + } + WriteEventsToClient (client, 1, (xEvent *) &se); +} + +/* + * Notify the extension that the screen size has been changed. + * The driver is responsible for calling this whenever it has changed + * the size of the screen + */ +void +RRScreenSizeNotify (ScreenPtr pScreen) +{ + rrScrPriv(pScreen); + /* + * Deliver ConfigureNotify events when root changes + * pixel size + */ + if (pScrPriv->width == pScreen->width && + pScrPriv->height == pScreen->height) + return; + + pScrPriv->width = pScreen->width; + pScrPriv->height = pScreen->height; + pScrPriv->changed = TRUE; +/* pScrPriv->sizeChanged = TRUE; */ + + RRTellChanged (pScreen); + RRSendConfigNotify (pScreen); + RREditConnectionInfo (pScreen); + + RRPointerScreenConfigured (pScreen); + /* + * Fix pointer bounds and location + */ + ScreenRestructured (pScreen); +} + +/* + * Request that the screen be resized + */ +Bool +RRScreenSizeSet (ScreenPtr pScreen, + CARD16 width, + CARD16 height, + CARD32 mmWidth, + CARD32 mmHeight) +{ + rrScrPriv(pScreen); + +#if RANDR_12_INTERFACE + if (pScrPriv->rrScreenSetSize) + { + return (*pScrPriv->rrScreenSetSize) (pScreen, + width, height, + mmWidth, mmHeight); + } +#endif +#if RANDR_10_INTERFACE + if (pScrPriv->rrSetConfig) + { + return TRUE; /* can't set size separately */ + } +#endif + return FALSE; +} + +/* + * Retrieve valid screen size range + */ +int +ProcRRGetScreenSizeRange (ClientPtr client) +{ + REQUEST(xRRGetScreenSizeRangeReq); + xRRGetScreenSizeRangeReply rep; + WindowPtr pWin; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + + REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); + pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, + SecurityReadAccess); + + if (!pWin) + return BadWindow; + + pScreen = pWin->drawable.pScreen; + pScrPriv = rrGetScrPriv(pScreen); + + rep.type = X_Reply; + rep.pad = 0; + rep.sequenceNumber = client->sequence; + rep.length = 0; + + if (pScrPriv) + { + RRGetInfo (pScreen); + rep.minWidth = pScrPriv->minWidth; + rep.minHeight = pScrPriv->minHeight; + rep.maxWidth = pScrPriv->maxWidth; + rep.maxHeight = pScrPriv->maxHeight; + } + else + { + rep.maxWidth = rep.minWidth = pScreen->width; + rep.maxHeight = rep.minHeight = pScreen->height; + } + if (client->swapped) + { + int n; + + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.minWidth, n); + swaps(&rep.minHeight, n); + swaps(&rep.maxWidth, n); + swaps(&rep.maxHeight, n); + } + WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep); + return (client->noClientException); +} + +int +ProcRRSetScreenSize (ClientPtr client) +{ + REQUEST(xRRSetScreenSizeReq); + WindowPtr pWin; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + RRCrtcPtr crtc; + int i; + + REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); + pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, + SecurityReadAccess); + + if (!pWin) + return BadWindow; + + pScreen = pWin->drawable.pScreen; + pScrPriv = rrGetScrPriv(pScreen); + if (stuff->width < pScrPriv->minWidth || pScrPriv->maxWidth < stuff->width) + { + client->errorValue = stuff->width; + return BadValue; + } + if (stuff->height < pScrPriv->minHeight || + pScrPriv->maxHeight < stuff->height) + { + client->errorValue = stuff->height; + return BadValue; + } + for (i = 0; i < pScrPriv->numCrtcs; i++) { + crtc = pScrPriv->crtcs[i]; + if (crtc->mode && + (crtc->x + crtc->mode->mode.width > stuff->width || + crtc->y + crtc->mode->mode.height > stuff->height)) + return BadMatch; + } + if (stuff->widthInMillimeters == 0 || stuff->heightInMillimeters == 0) + { + client->errorValue = 0; + return BadValue; + } + if (!RRScreenSizeSet (pScreen, + stuff->width, stuff->height, + stuff->widthInMillimeters, + stuff->heightInMillimeters)) + { + return BadMatch; + } + return Success; +} + +int +ProcRRGetScreenResources (ClientPtr client) +{ + REQUEST(xRRGetScreenResourcesReq); + xRRGetScreenResourcesReply rep; + WindowPtr pWin; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + CARD8 *extra; + unsigned long extraLen; + int i; + RRCrtc *crtcs; + RROutput *outputs; + xRRModeInfo *modeinfos; + CARD8 *names; + int n; + + REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); + pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, + SecurityReadAccess); + + if (!pWin) + return BadWindow; + + pScreen = pWin->drawable.pScreen; + pScrPriv = rrGetScrPriv(pScreen); + rep.pad = 0; + + if (pScrPriv) + RRGetInfo (pScreen); + + if (!pScrPriv) + { + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.timestamp = currentTime.milliseconds; + rep.configTimestamp = currentTime.milliseconds; + rep.nCrtcs = 0; + rep.nOutputs = 0; + rep.nModes = 0; + rep.nbytesNames = 0; + extra = NULL; + extraLen = 0; + } + else + { + RRModePtr *modes; + int num_modes; + + modes = RRModesForScreen (pScreen, &num_modes); + if (!modes) + return BadAlloc; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; + rep.nCrtcs = pScrPriv->numCrtcs; + rep.nOutputs = pScrPriv->numOutputs; + rep.nModes = num_modes; + rep.nbytesNames = 0; + + for (i = 0; i < num_modes; i++) + rep.nbytesNames += modes[i]->mode.nameLength; + + rep.length = (pScrPriv->numCrtcs + + pScrPriv->numOutputs + + num_modes * (SIZEOF(xRRModeInfo) >> 2) + + ((rep.nbytesNames + 3) >> 2)); + + extraLen = rep.length << 2; + if (extraLen) + { + extra = xalloc (extraLen); + if (!extra) + { + xfree (modes); + return BadAlloc; + } + } + else + extra = NULL; + + crtcs = (RRCrtc *) extra; + outputs = (RROutput *) (crtcs + pScrPriv->numCrtcs); + modeinfos = (xRRModeInfo *) (outputs + pScrPriv->numOutputs); + names = (CARD8 *) (modeinfos + num_modes); + + for (i = 0; i < pScrPriv->numCrtcs; i++) + { + crtcs[i] = pScrPriv->crtcs[i]->id; + if (client->swapped) + swapl (&crtcs[i], n); + } + + for (i = 0; i < pScrPriv->numOutputs; i++) + { + outputs[i] = pScrPriv->outputs[i]->id; + if (client->swapped) + swapl (&outputs[i], n); + } + + for (i = 0; i < num_modes; i++) + { + RRModePtr mode = modes[i]; + modeinfos[i] = mode->mode; + if (client->swapped) + { + swapl (&modeinfos[i].id, n); + swaps (&modeinfos[i].width, n); + swaps (&modeinfos[i].height, n); + swapl (&modeinfos[i].dotClock, n); + swaps (&modeinfos[i].hSyncStart, n); + swaps (&modeinfos[i].hSyncEnd, n); + swaps (&modeinfos[i].hTotal, n); + swaps (&modeinfos[i].hSkew, n); + swaps (&modeinfos[i].vSyncStart, n); + swaps (&modeinfos[i].vSyncEnd, n); + swaps (&modeinfos[i].vTotal, n); + swaps (&modeinfos[i].nameLength, n); + swapl (&modeinfos[i].modeFlags, n); + } + memcpy (names, mode->name, + mode->mode.nameLength); + names += mode->mode.nameLength; + } + xfree (modes); + assert (((((char *) names - (char *) extra) + 3) >> 2) == rep.length); + } + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.timestamp, n); + swapl(&rep.configTimestamp, n); + swaps(&rep.nCrtcs, n); + swaps(&rep.nOutputs, n); + swaps(&rep.nModes, n); + swaps(&rep.nbytesNames, n); + } + WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *)&rep); + if (extraLen) + { + WriteToClient (client, extraLen, (char *) extra); + xfree (extra); + } + return client->noClientException; +} + +typedef struct _RR10Data { + RRScreenSizePtr sizes; + int nsize; + int nrefresh; + int size; + CARD16 refresh; +} RR10DataRec, *RR10DataPtr; + +/* + * Convert 1.2 monitor data into 1.0 screen data + */ +static RR10DataPtr +RR10GetData (ScreenPtr pScreen, RROutputPtr output) +{ + RR10DataPtr data; + RRScreenSizePtr size; + int nmode = output->numModes; + int i, j, k; + RRScreenRatePtr refresh; + CARD16 vRefresh; + RRModePtr mode; + + /* Make sure there is plenty of space for any combination */ + data = malloc (sizeof (RR10DataRec) + + sizeof (RRScreenSize) * nmode + + sizeof (RRScreenRate) * nmode); + if (!data) + return NULL; + size = (RRScreenSizePtr) (data + 1); + refresh = (RRScreenRatePtr) (size + nmode); + data->sizes = size; + data->nsize = 0; + data->nrefresh = 0; + data->size = 0; + data->refresh = 0; + for (i = 0; i < output->numModes; i++) + { + mode = output->modes[i]; + for (j = 0; j < data->nsize; j++) + if (mode->mode.width == size[j].width && + mode->mode.height == size[j].height) + break; + if (j == data->nsize) + { + size[j].id = j; + size[j].width = mode->mode.width; + size[j].height = mode->mode.height; + if (output->mmWidth && output->mmHeight) { + size[j].mmWidth = output->mmWidth; + size[j].mmHeight = output->mmHeight; + } else { + size[j].mmWidth = pScreen->mmWidth; + size[j].mmHeight = pScreen->mmHeight; + } + size[j].nRates = 0; + size[j].pRates = &refresh[data->nrefresh]; + data->nsize++; + } + vRefresh = RRVerticalRefresh (&mode->mode); + for (k = 0; k < size[j].nRates; k++) + if (vRefresh == size[j].pRates[k].rate) + break; + if (k == size[j].nRates) + { + size[j].pRates[k].rate = vRefresh; + size[j].pRates[k].mode = mode; + size[j].nRates++; + data->nrefresh++; + } + if (mode == output->crtc->mode) + { + data->size = j; + data->refresh = vRefresh; + } + } + return data; +} + +int +ProcRRGetScreenInfo (ClientPtr client) +{ + REQUEST(xRRGetScreenInfoReq); + xRRGetScreenInfoReply rep; + WindowPtr pWin; + int n; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + CARD8 *extra; + unsigned long extraLen; + RROutputPtr output; + + REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); + pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, + SecurityReadAccess); + + if (!pWin) + return BadWindow; + + pScreen = pWin->drawable.pScreen; + pScrPriv = rrGetScrPriv(pScreen); + rep.pad = 0; + + if (pScrPriv) + RRGetInfo (pScreen); + + output = RRFirstOutput (pScreen); + + if (!pScrPriv || !output) + { + rep.type = X_Reply; + rep.setOfRotations = RR_Rotate_0;; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; + rep.timestamp = currentTime.milliseconds; + rep.configTimestamp = currentTime.milliseconds; + rep.nSizes = 0; + rep.sizeID = 0; + rep.rotation = RR_Rotate_0; + rep.rate = 0; + rep.nrateEnts = 0; + extra = 0; + extraLen = 0; + } + else + { + int i, j; + xScreenSizes *size; + CARD16 *rates; + CARD8 *data8; + Bool has_rate = RRClientKnowsRates (client); + RR10DataPtr pData; + RRScreenSizePtr pSize; + + pData = RR10GetData (pScreen, output); + if (!pData) + return BadAlloc; + + rep.type = X_Reply; + rep.setOfRotations = output->crtc->rotations; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; + rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; + rep.rotation = output->crtc->rotation; + rep.nSizes = pData->nsize; + rep.nrateEnts = pData->nrefresh + pData->nsize; + rep.sizeID = pData->size; + rep.rate = pData->refresh; + + extraLen = (rep.nSizes * sizeof (xScreenSizes) + + rep.nrateEnts * sizeof (CARD16)); + + if (extraLen) + { + extra = (CARD8 *) xalloc (extraLen); + if (!extra) + { + xfree (pData); + return BadAlloc; + } + } + else + extra = NULL; + + /* + * First comes the size information + */ + size = (xScreenSizes *) extra; + rates = (CARD16 *) (size + rep.nSizes); + for (i = 0; i < pData->nsize; i++) + { + pSize = &pData->sizes[i]; + size->widthInPixels = pSize->width; + size->heightInPixels = pSize->height; + size->widthInMillimeters = pSize->mmWidth; + size->heightInMillimeters = pSize->mmHeight; + if (client->swapped) + { + swaps (&size->widthInPixels, n); + swaps (&size->heightInPixels, n); + swaps (&size->widthInMillimeters, n); + swaps (&size->heightInMillimeters, n); + } + size++; + if (has_rate) + { + *rates = pSize->nRates; + if (client->swapped) + { + swaps (rates, n); + } + rates++; + for (j = 0; j < pSize->nRates; j++) + { + *rates = pSize->pRates[j].rate; + if (client->swapped) + { + swaps (rates, n); + } + rates++; + } + } + } + xfree (pData); + + data8 = (CARD8 *) rates; + + if (data8 - (CARD8 *) extra != extraLen) + FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n", + (unsigned long)(data8 - (CARD8 *) extra), extraLen); + rep.length = (extraLen + 3) >> 2; + } + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.timestamp, n); + swaps(&rep.rotation, n); + swaps(&rep.nSizes, n); + swaps(&rep.sizeID, n); + swaps(&rep.rate, n); + swaps(&rep.nrateEnts, n); + } + WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); + if (extraLen) + { + WriteToClient (client, extraLen, (char *) extra); + xfree (extra); + } + return (client->noClientException); +} + +int +ProcRRSetScreenConfig (ClientPtr client) +{ + REQUEST(xRRSetScreenConfigReq); + xRRSetScreenConfigReply rep; + DrawablePtr pDraw; + int n; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + TimeStamp configTime; + TimeStamp time; + int i; + Rotation rotation; + int rate; + Bool has_rate; + RROutputPtr output; + RRModePtr mode; + RR10DataPtr pData = NULL; + RRScreenSizePtr pSize; + + UpdateCurrentTime (); + + if (RRClientKnowsRates (client)) + { + REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); + has_rate = TRUE; + } + else + { + REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); + has_rate = FALSE; + } + + SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, + SecurityWriteAccess); + + pScreen = pDraw->pScreen; + + pScrPriv = rrGetScrPriv(pScreen); + + time = ClientTimeToServerTime(stuff->timestamp); + configTime = ClientTimeToServerTime(stuff->configTimestamp); + + if (!pScrPriv) + { + time = currentTime; + rep.status = RRSetConfigFailed; + goto sendReply; + } + if (!RRGetInfo (pScreen)) + return BadAlloc; + + output = RRFirstOutput (pScreen); + if (!output) + { + time = currentTime; + rep.status = RRSetConfigFailed; + goto sendReply; + } + + /* + * if the client's config timestamp is not the same as the last config + * timestamp, then the config information isn't up-to-date and + * can't even be validated + */ + if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) + { + rep.status = RRSetConfigInvalidConfigTime; + goto sendReply; + } + + pData = RR10GetData (pScreen, output); + if (!pData) + return BadAlloc; + + if (stuff->sizeID >= pData->nsize) + { + /* + * Invalid size ID + */ + client->errorValue = stuff->sizeID; + xfree (pData); + return BadValue; + } + pSize = &pData->sizes[stuff->sizeID]; + + /* + * Validate requested rotation + */ + rotation = (Rotation) stuff->rotation; + + /* test the rotation bits only! */ + switch (rotation & 0xf) { + case RR_Rotate_0: + case RR_Rotate_90: + case RR_Rotate_180: + case RR_Rotate_270: + break; + default: + /* + * Invalid rotation + */ + client->errorValue = stuff->rotation; + xfree (pData); + return BadValue; + } + + if ((~output->crtc->rotations) & rotation) + { + /* + * requested rotation or reflection not supported by screen + */ + client->errorValue = stuff->rotation; + xfree (pData); + return BadMatch; + } + + /* + * Validate requested refresh + */ + if (has_rate) + rate = (int) stuff->rate; + else + rate = 0; + + if (rate) + { + for (i = 0; i < pSize->nRates; i++) + { + if (pSize->pRates[i].rate == rate) + break; + } + if (i == pSize->nRates) + { + /* + * Invalid rate + */ + client->errorValue = rate; + xfree (pData); + return BadValue; + } + mode = pSize->pRates[i].mode; + } + else + mode = pSize->pRates[0].mode; + + /* + * Make sure the requested set-time is not older than + * the last set-time + */ + if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) + { + rep.status = RRSetConfigInvalidTime; + goto sendReply; + } + + /* + * If the screen size is changing, adjust all of the other outputs + * to fit the new size, mirroring as much as possible + */ + if (mode->mode.width != pScreen->width || + mode->mode.height != pScreen->height) + { + int c; + + for (c = 0; c < pScrPriv->numCrtcs; c++) + { + rep.status = RRCrtcSet (pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0, + 0, NULL); + if (rep.status != Success) + goto sendReply; + } + if (!RRScreenSizeSet (pScreen, mode->mode.width, mode->mode.height, + pScreen->mmWidth, pScreen->mmHeight)) + { + rep.status = RRSetConfigFailed; + goto sendReply; + } + } + + rep.status = RRCrtcSet (output->crtc, mode, 0, 0, stuff->rotation, + 1, &output); + + /* + * XXX Configure other crtcs to mirror as much as possible + */ + +sendReply: + + if (pData) + xfree (pData); + + rep.type = X_Reply; + /* rep.status has already been filled in */ + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; + rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; + rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; + + if (client->swapped) + { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.newTimestamp, n); + swapl(&rep.newConfigTimestamp, n); + swapl(&rep.root, n); + } + WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); + + return (client->noClientException); +} + diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c new file mode 100644 index 000000000..4a6a6e43f --- /dev/null +++ b/randr/rrsdispatch.c @@ -0,0 +1,305 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" + +static int +SProcRRQueryVersion (ClientPtr client) +{ + register int n; + REQUEST(xRRQueryVersionReq); + + swaps(&stuff->length, n); + swapl(&stuff->majorVersion, n); + swapl(&stuff->minorVersion, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); +} + +static int +SProcRRGetScreenInfo (ClientPtr client) +{ + register int n; + REQUEST(xRRGetScreenInfoReq); + + swaps(&stuff->length, n); + swapl(&stuff->window, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); +} + +static int +SProcRRSetScreenConfig (ClientPtr client) +{ + register int n; + REQUEST(xRRSetScreenConfigReq); + + if (RRClientKnowsRates (client)) + { + REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); + swaps (&stuff->rate, n); + } + else + { + REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); + } + + swaps(&stuff->length, n); + swapl(&stuff->drawable, n); + swapl(&stuff->timestamp, n); + swaps(&stuff->sizeID, n); + swaps(&stuff->rotation, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); +} + +static int +SProcRRSelectInput (ClientPtr client) +{ + register int n; + REQUEST(xRRSelectInputReq); + + swaps(&stuff->length, n); + swapl(&stuff->window, n); + swaps(&stuff->enable, n); + return (*ProcRandrVector[stuff->randrReqType]) (client); +} + +static int +SProcRRGetScreenSizeRange (ClientPtr client) +{ + REQUEST(xRRGetScreenSizeRangeReq); + + REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRSetScreenSize (ClientPtr client) +{ + REQUEST(xRRSetScreenSizeReq); + + REQUEST_SIZE_MATCH(xRRSetScreenSizeReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRGetScreenResources (ClientPtr client) +{ + REQUEST(xRRGetScreenResourcesReq); + + REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRGetOutputInfo (ClientPtr client) +{ + REQUEST(xRRGetOutputInfoReq);; + + REQUEST_SIZE_MATCH(xRRGetOutputInfoReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRListOutputProperties (ClientPtr client) +{ + REQUEST(xRRListOutputPropertiesReq); + + REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRQueryOutputProperty (ClientPtr client) +{ + REQUEST(xRRQueryOutputPropertyReq); + + REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRConfigureOutputProperty (ClientPtr client) +{ + REQUEST(xRRConfigureOutputPropertyReq); + + REQUEST_SIZE_MATCH(xRRConfigureOutputPropertyReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRChangeOutputProperty (ClientPtr client) +{ + REQUEST(xRRChangeOutputPropertyReq); + + REQUEST_SIZE_MATCH(xRRChangeOutputPropertyReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRDeleteOutputProperty (ClientPtr client) +{ + REQUEST(xRRDeleteOutputPropertyReq); + + REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRGetOutputProperty (ClientPtr client) +{ + REQUEST(xRRGetOutputPropertyReq); + + REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRCreateMode (ClientPtr client) +{ + REQUEST(xRRCreateModeReq); + + REQUEST_SIZE_MATCH(xRRCreateModeReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRDestroyMode (ClientPtr client) +{ + REQUEST(xRRDestroyModeReq); + + REQUEST_SIZE_MATCH(xRRDestroyModeReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRAddOutputMode (ClientPtr client) +{ + REQUEST(xRRAddOutputModeReq); + + REQUEST_SIZE_MATCH(xRRAddOutputModeReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRDeleteOutputMode (ClientPtr client) +{ + REQUEST(xRRDeleteOutputModeReq); + + REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRGetCrtcInfo (ClientPtr client) +{ + REQUEST(xRRGetCrtcInfoReq); + + REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRSetCrtcConfig (ClientPtr client) +{ + REQUEST(xRRSetCrtcConfigReq); + + REQUEST_SIZE_MATCH(xRRSetCrtcConfigReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRGetCrtcGammaSize (ClientPtr client) +{ + REQUEST(xRRGetCrtcGammaSizeReq); + + REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRGetCrtcGamma (ClientPtr client) +{ + REQUEST(xRRGetCrtcGammaReq); + + REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq); + (void) stuff; + return BadImplementation; +} + +static int +SProcRRSetCrtcGamma (ClientPtr client) +{ + REQUEST(xRRSetCrtcGammaReq); + + REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq); + (void) stuff; + return BadImplementation; +} + +int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = { + SProcRRQueryVersion, /* 0 */ +/* we skip 1 to make old clients fail pretty immediately */ + NULL, /* 1 SProcRandrOldGetScreenInfo */ +/* V1.0 apps share the same set screen config request id */ + SProcRRSetScreenConfig, /* 2 */ + NULL, /* 3 SProcRandrOldScreenChangeSelectInput */ +/* 3 used to be ScreenChangeSelectInput; deprecated */ + SProcRRSelectInput, /* 4 */ + SProcRRGetScreenInfo, /* 5 */ +/* V1.2 additions */ + SProcRRGetScreenSizeRange, /* 6 */ + SProcRRSetScreenSize, /* 7 */ + SProcRRGetScreenResources, /* 8 */ + SProcRRGetOutputInfo, /* 9 */ + SProcRRListOutputProperties,/* 10 */ + SProcRRQueryOutputProperty, /* 11 */ + SProcRRConfigureOutputProperty, /* 12 */ + SProcRRChangeOutputProperty,/* 13 */ + SProcRRDeleteOutputProperty,/* 14 */ + SProcRRGetOutputProperty, /* 15 */ + SProcRRCreateMode, /* 16 */ + SProcRRDestroyMode, /* 17 */ + SProcRRAddOutputMode, /* 18 */ + SProcRRDeleteOutputMode, /* 19 */ + SProcRRGetCrtcInfo, /* 20 */ + SProcRRSetCrtcConfig, /* 21 */ + SProcRRGetCrtcGammaSize, /* 22 */ + SProcRRGetCrtcGamma, /* 23 */ + SProcRRSetCrtcGamma, /* 24 */ +}; + diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c new file mode 100644 index 000000000..771ed0976 --- /dev/null +++ b/randr/rrxinerama.c @@ -0,0 +1,431 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ +/* + * This Xinerama implementation comes from the SiS driver which has + * the following notice: + */ +/* + * SiS driver main code + * + * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2) Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3) The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Thomas Winischhofer <thomas@winischhofer.net> + * - driver entirely rewritten since 2001, only basic structure taken from + * old code (except sis_dri.c, sis_shadow.c, sis_accel.c and parts of + * sis_dga.c; these were mostly taken over; sis_dri.c was changed for + * new versions of the DRI layer) + * + * This notice covers the entire driver code unless indicated otherwise. + * + * Formerly based on code which was + * Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England. + * Written by: + * Alan Hourihane <alanh@fairlite.demon.co.uk>, + * Mike Chapman <mike@paranoia.com>, + * Juanjo Santamarta <santamarta@ctv.es>, + * Mitani Hiroshi <hmitani@drl.mei.co.jp>, + * David Thomas <davtom@dream.org.uk>. + */ + +#include "randrstr.h" +#include "swaprep.h" +#include <X11/extensions/panoramiXproto.h> + +#define RR_XINERAMA_MAJOR_VERSION 1 +#define RR_XINERAMA_MINOR_VERSION 1 + +/* Xinerama is not multi-screen capable; just report about screen 0 */ +#define RR_XINERAMA_SCREEN 0 + +static int ProcRRXineramaQueryVersion(ClientPtr client); +static int ProcRRXineramaGetState(ClientPtr client); +static int ProcRRXineramaGetScreenCount(ClientPtr client); +static int ProcRRXineramaGetScreenSize(ClientPtr client); +static int ProcRRXineramaIsActive(ClientPtr client); +static int ProcRRXineramaQueryScreens(ClientPtr client); +static int SProcRRXineramaDispatch(ClientPtr client); + +/* Proc */ + +int +ProcRRXineramaQueryVersion(ClientPtr client) +{ + xPanoramiXQueryVersionReply rep; + register int n; + + REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.majorVersion = RR_XINERAMA_MAJOR_VERSION; + rep.minorVersion = RR_XINERAMA_MINOR_VERSION; + if(client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.majorVersion, n); + swaps(&rep.minorVersion, n); + } + WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep); + return (client->noClientException); +} + +int +ProcRRXineramaGetState(ClientPtr client) +{ + REQUEST(xPanoramiXGetStateReq); + WindowPtr pWin; + xPanoramiXGetStateReply rep; + register int n; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + Bool active = FALSE; + + REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); + pWin = LookupWindow(stuff->window, client); + if(!pWin) return BadWindow; + + pScreen = pWin->drawable.pScreen; + pScrPriv = rrGetScrPriv(pScreen); + if (pScrPriv) + { + /* XXX do we need more than this? */ + active = TRUE; + } + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.state = active; + if(client->swapped) { + swaps (&rep.sequenceNumber, n); + swapl (&rep.length, n); + swaps (&rep.state, n); + } + WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); + return client->noClientException; +} + +static Bool +RRXineramaScreenActive (ScreenPtr pScreen) +{ + return rrGetScrPriv(pScreen) != NULL; +} + +static Bool +RRXineramaCrtcActive (RRCrtcPtr crtc) +{ + return crtc->mode != NULL && crtc->numOutputs > 0; +} + +static int +RRXineramaScreenCount (ScreenPtr pScreen) +{ + int i, n; + + n = 0; + if (RRXineramaScreenActive (pScreen)) + { + rrScrPriv(pScreen); + for (i = 0; i < pScrPriv->numCrtcs; i++) + if (RRXineramaCrtcActive (pScrPriv->crtcs[i])) + n++; + } + return n; +} + +int +ProcRRXineramaGetScreenCount(ClientPtr client) +{ + REQUEST(xPanoramiXGetScreenCountReq); + WindowPtr pWin; + xPanoramiXGetScreenCountReply rep; + register int n; + + REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); + pWin = LookupWindow(stuff->window, client); + if(!pWin) return BadWindow; + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.ScreenCount = RRXineramaScreenCount (pWin->drawable.pScreen); + if(client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.ScreenCount, n); + } + WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); + return client->noClientException; +} + +int +ProcRRXineramaGetScreenSize(ClientPtr client) +{ + REQUEST(xPanoramiXGetScreenSizeReq); + WindowPtr pWin, pRoot; + ScreenPtr pScreen; + xPanoramiXGetScreenSizeReply rep; + register int n; + + REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); + pWin = LookupWindow (stuff->window, client); + if(!pWin) return BadWindow; + + pScreen = pWin->drawable.pScreen; + pRoot = WindowTable[pScreen->myNum]; + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.width = pRoot->drawable.width; + rep.height = pRoot->drawable.height; + if(client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.width, n); + swaps(&rep.height, n); + } + WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); + return client->noClientException; +} + +int +ProcRRXineramaIsActive(ClientPtr client) +{ + xXineramaIsActiveReply rep; + + REQUEST_SIZE_MATCH(xXineramaIsActiveReq); + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.state = RRXineramaScreenActive (screenInfo.screens[RR_XINERAMA_SCREEN]); + if(client->swapped) { + register int n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.state, n); + } + WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); + return client->noClientException; +} + +int +ProcRRXineramaQueryScreens(ClientPtr client) +{ + xXineramaQueryScreensReply rep; + ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN]; + + REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); + + if (RRXineramaScreenActive (pScreen)) + { + rrScrPriv(pScreen); + if (pScrPriv->numCrtcs == 0 || pScrPriv->numOutputs == 0) + RRGetInfo (pScreen); + } + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.number = RRXineramaScreenCount (pScreen); + rep.length = rep.number * sz_XineramaScreenInfo >> 2; + if(client->swapped) { + register int n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.number, n); + } + WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep); + + if(rep.number) { + rrScrPriv(pScreen); + xXineramaScreenInfo scratch; + int i; + + for(i = 0; i < pScrPriv->numCrtcs; i++) { + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + if (RRXineramaCrtcActive (crtc)) + { + scratch.x_org = crtc->x; + scratch.y_org = crtc->y; + scratch.width = crtc->mode->mode.width; + scratch.height = crtc->mode->mode.height; + if(client->swapped) { + register int n; + swaps(&scratch.x_org, n); + swaps(&scratch.y_org, n); + swaps(&scratch.width, n); + swaps(&scratch.height, n); + } + WriteToClient(client, sz_XineramaScreenInfo, (char *)&scratch); + } + } + } + + return client->noClientException; +} + +static int +ProcRRXineramaDispatch(ClientPtr client) +{ + REQUEST(xReq); + switch (stuff->data) { + case X_PanoramiXQueryVersion: + return ProcRRXineramaQueryVersion(client); + case X_PanoramiXGetState: + return ProcRRXineramaGetState(client); + case X_PanoramiXGetScreenCount: + return ProcRRXineramaGetScreenCount(client); + case X_PanoramiXGetScreenSize: + return ProcRRXineramaGetScreenSize(client); + case X_XineramaIsActive: + return ProcRRXineramaIsActive(client); + case X_XineramaQueryScreens: + return ProcRRXineramaQueryScreens(client); + } + return BadRequest; +} + +/* SProc */ + +static int +SProcRRXineramaQueryVersion (ClientPtr client) +{ + REQUEST(xPanoramiXQueryVersionReq); + register int n; + swaps(&stuff->length,n); + REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq); + return ProcRRXineramaQueryVersion(client); +} + +static int +SProcRRXineramaGetState(ClientPtr client) +{ + REQUEST(xPanoramiXGetStateReq); + register int n; + swaps (&stuff->length, n); + REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); + return ProcRRXineramaGetState(client); +} + +static int +SProcRRXineramaGetScreenCount(ClientPtr client) +{ + REQUEST(xPanoramiXGetScreenCountReq); + register int n; + swaps (&stuff->length, n); + REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); + return ProcRRXineramaGetScreenCount(client); +} + +static int +SProcRRXineramaGetScreenSize(ClientPtr client) +{ + REQUEST(xPanoramiXGetScreenSizeReq); + register int n; + swaps (&stuff->length, n); + REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); + return ProcRRXineramaGetScreenSize(client); +} + +static int +SProcRRXineramaIsActive(ClientPtr client) +{ + REQUEST(xXineramaIsActiveReq); + register int n; + swaps (&stuff->length, n); + REQUEST_SIZE_MATCH(xXineramaIsActiveReq); + return ProcRRXineramaIsActive(client); +} + +static int +SProcRRXineramaQueryScreens(ClientPtr client) +{ + REQUEST(xXineramaQueryScreensReq); + register int n; + swaps (&stuff->length, n); + REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); + return ProcRRXineramaQueryScreens(client); +} + +int +SProcRRXineramaDispatch(ClientPtr client) +{ + REQUEST(xReq); + switch (stuff->data) { + case X_PanoramiXQueryVersion: + return SProcRRXineramaQueryVersion(client); + case X_PanoramiXGetState: + return SProcRRXineramaGetState(client); + case X_PanoramiXGetScreenCount: + return SProcRRXineramaGetScreenCount(client); + case X_PanoramiXGetScreenSize: + return SProcRRXineramaGetScreenSize(client); + case X_XineramaIsActive: + return SProcRRXineramaIsActive(client); + case X_XineramaQueryScreens: + return SProcRRXineramaQueryScreens(client); + } + return BadRequest; +} + +static void +RRXineramaResetProc(ExtensionEntry* extEntry) +{ +} + +void +RRXineramaExtensionInit(void) +{ +#ifdef PANORAMIX + if(!noPanoramiXExtension) + return; +#endif + + (void) AddExtension(PANORAMIX_PROTOCOL_NAME, 0,0, + ProcRRXineramaDispatch, + SProcRRXineramaDispatch, + RRXineramaResetProc, + StandardMinorOpcode); +} diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 321bf2e1b..c9c5ed018 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -1144,6 +1144,11 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies) memcpy(dtype->map, stype->map, stype->map_count * sizeof(XkbKTMapEntryRec)); } + else { + if (dtype->map && i < dst->map->num_types) + xfree(dtype->map); + dtype->map = NULL; + } if (stype->preserve) { if (stype->map_count != dtype->map_count && @@ -1168,17 +1173,22 @@ XkbCopyKeymap(XkbDescPtr src, XkbDescPtr dst, Bool sendNotifies) memcpy(dtype->preserve, stype->preserve, stype->map_count * sizeof(XkbModsRec)); } + else { + if (dtype->preserve && i < dst->map->num_types) + xfree(dtype->preserve); + dtype->preserve = NULL; + } dtype->map_count = stype->map_count; } else { - if (dtype->map_count) { + if (dtype->map_count && i < dst->map->num_types) { if (dtype->map) xfree(dtype->map); if (dtype->preserve) xfree(dtype->preserve); - dtype->map_count = 0; } + dtype->map_count = 0; dtype->map = NULL; dtype->preserve = NULL; } |