Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/xserver into mpx
Conflicts: dix/events.c
This commit is contained in:
commit
3c8f166022
|
@ -20,6 +20,10 @@ Files:
|
|||
mpx/listdev.c
|
||||
include/mpxextinit.h
|
||||
|
||||
____________________________________________________________
|
||||
|
||||
Merging from master
|
||||
|
||||
|
||||
== 01.12.06 ==
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
|
|||
* __glXDispatch() or as a callback from the resource manager. In
|
||||
* the latter case we need to lift the DRI lock manually. */
|
||||
|
||||
if (glxBlockClients) {
|
||||
if (!glxBlockClients) {
|
||||
__glXleaveServer();
|
||||
cx->destroy(cx);
|
||||
__glXenterServer();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
26
Xext/xace.h
26
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 */
|
||||
|
|
14
configure.ac
14
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;
|
||||
|
@ -546,7 +546,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
|
||||
|
@ -656,6 +656,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)
|
||||
|
@ -1394,6 +1397,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])
|
||||
|
||||
|
@ -1769,13 +1773,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])
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -135,9 +135,7 @@ int ProcInitialConnection();
|
|||
#include "panoramiX.h"
|
||||
#include "panoramiXsrv.h"
|
||||
#endif
|
||||
#ifdef XACE
|
||||
#include "xace.h"
|
||||
#endif
|
||||
#ifdef XAPPGROUP
|
||||
#include "appgroup.h"
|
||||
#endif
|
||||
|
@ -504,16 +502,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 +1159,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 +2153,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 +2257,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 +2286,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 +2325,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 +2351,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 +3323,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);
|
||||
|
|
|
@ -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
|
||||
|
|
53
dix/events.c
53
dix/events.c
|
@ -143,9 +143,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>
|
||||
|
@ -362,8 +360,7 @@ static void ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py)
|
|||
static void PostNewCursor(DeviceIntPtr pDev);
|
||||
|
||||
#define SyntheticMotion(x, y) \
|
||||
PostSyntheticMotion(x, y, noPanoramiXExtension ? 0 : \
|
||||
sprite->screen->myNum, \
|
||||
PostSyntheticMotion(x, y, sprite.screen, \
|
||||
syncEvents.playingEvents ? \
|
||||
syncEvents.time.milliseconds : \
|
||||
currentTime.milliseconds);
|
||||
|
@ -2648,10 +2645,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;
|
||||
|
@ -3012,9 +3007,7 @@ drawable.id:0;
|
|||
if (deactivateGrab)
|
||||
(*keybd->DeactivateGrab)(keybd);
|
||||
|
||||
#ifdef XACE
|
||||
XaceHook(XACE_KEY_AVAIL, xE, keybd, count);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef XKB
|
||||
|
@ -3446,17 +3439,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,
|
||||
|
@ -3559,15 +3548,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(dev, pWin, (xEvent *)&ke, 1,
|
||||
KeymapStateMask, NullGrab, 0);
|
||||
|
@ -3830,10 +3816,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);
|
||||
}
|
||||
|
@ -4095,18 +4081,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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include "cursorstr.h"
|
||||
#include "dixstruct.h"
|
||||
#include "globals.h"
|
||||
#include "dixevents.h"
|
||||
#include "mipointer.h"
|
||||
|
||||
#ifdef XKB
|
||||
|
@ -53,10 +54,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"
|
||||
|
@ -803,7 +800,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;
|
||||
|
||||
|
@ -812,8 +809,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
|
||||
|
||||
|
@ -821,6 +818,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);
|
||||
}
|
||||
|
|
15
dix/main.c
15
dix/main.c
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
42
dix/window.c
42
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) )
|
||||
|
|
3
fb/fb.h
3
fb/fb.h
|
@ -1341,6 +1341,9 @@ fbCreateDefColormap(ScreenPtr pScreen);
|
|||
void
|
||||
fbClearVisualTypes(void);
|
||||
|
||||
Bool
|
||||
fbHasVisualTypes (int depth);
|
||||
|
||||
Bool
|
||||
fbSetVisualTypes (int depth, int visuals, int bitsPerRGB);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ endif
|
|||
|
||||
AM_YFLAGS = -d
|
||||
AM_CFLAGS = \
|
||||
\
|
||||
$(DIX_CFLAGS) \
|
||||
-I$(top_srcdir)/hw/dmx \
|
||||
$(GLX_INCS) \
|
||||
-DHAVE_DMX_CONFIG_H \
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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) \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -94,4 +94,4 @@ if LNXACPI
|
|||
XORG_CFLAGS += -DHAVE_ACPI
|
||||
endif
|
||||
|
||||
AM_CFLAGS = $(XORG_CFLAGS)
|
||||
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#define _XF86_BUS_H
|
||||
|
||||
#include "xf86pciBus.h"
|
||||
#ifdef __sparc__
|
||||
#if defined(__sparc__) || defined(__sparc)
|
||||
#include "xf86sbusBus.h"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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__
|
||||
|
@ -1117,6 +1119,9 @@ ddxGiveUp()
|
|||
DGAShutdown();
|
||||
#endif
|
||||
|
||||
while (xf86NumScreens)
|
||||
xf86DeleteScreen(xf86NumScreens - 1, 0);
|
||||
|
||||
xf86CloseConsole();
|
||||
|
||||
xf86CloseLog();
|
||||
|
@ -1376,6 +1381,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 +1640,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");
|
||||
|
@ -1747,6 +1764,18 @@ xf86PrintMarkers()
|
|||
LogPrintMarkers();
|
||||
}
|
||||
|
||||
static void
|
||||
xf86PrintDefaultModulePath(void)
|
||||
{
|
||||
ErrorF("%s\n", DEFAULT_MODULE_PATH);
|
||||
}
|
||||
|
||||
static void
|
||||
xf86PrintDefaultLibraryPath(void)
|
||||
{
|
||||
ErrorF("%s\n", DEFAULT_LIBRARY_PATH);
|
||||
}
|
||||
|
||||
static void
|
||||
xf86RunVtInit(void)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
348
hw/xfree86/ddc/edid_modes.c
Normal file
348
hw/xfree86/ddc/edid_modes.c
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -59,6 +59,8 @@ extern void xf86print_vdif(
|
|||
xf86vdifPtr v
|
||||
);
|
||||
|
||||
DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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 .
|
||||
|
|
|
@ -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@
|
||||
|
|
|
@ -85,7 +85,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.
|
||||
|
@ -177,8 +177,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) {
|
||||
|
@ -594,7 +592,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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 $@
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -683,28 +683,28 @@ xf86MapDomainMemory(int ScreenNum, int Flags, PCITAG Tag,
|
|||
ADDRESS Base, unsigned long Size)
|
||||
{
|
||||
int domain = xf86GetPciDomain(Tag);
|
||||
int fd;
|
||||
int fd = -1;
|
||||
pointer addr;
|
||||
|
||||
/*
|
||||
* We use /proc/bus/pci on non-legacy addresses or if the Linux sysfs
|
||||
* legacy_mem interface is unavailable.
|
||||
*/
|
||||
if (Base > 1024*1024)
|
||||
return linuxMapPci(ScreenNum, Flags, Tag, Base, Size,
|
||||
if (Base >= 1024*1024)
|
||||
addr = linuxMapPci(ScreenNum, Flags, Tag, Base, Size,
|
||||
PCIIOC_MMAP_IS_MEM);
|
||||
|
||||
if ((fd = linuxOpenLegacy(Tag, "legacy_mem")) < 0)
|
||||
return linuxMapPci(ScreenNum, Flags, Tag, Base, Size,
|
||||
else if ((fd = linuxOpenLegacy(Tag, "legacy_mem")) < 0)
|
||||
addr = linuxMapPci(ScreenNum, Flags, Tag, Base, Size,
|
||||
PCIIOC_MMAP_IS_MEM);
|
||||
else
|
||||
addr = mmap(NULL, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base);
|
||||
|
||||
addr = mmap(NULL, Size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, Base);
|
||||
if (addr == MAP_FAILED) {
|
||||
close (fd);
|
||||
if (fd >= 0)
|
||||
close(fd);
|
||||
if (addr == NULL || addr == MAP_FAILED) {
|
||||
perror("mmap failure");
|
||||
FatalError("xf86MapDomainMem(): mmap() failure\n");
|
||||
}
|
||||
close(fd);
|
||||
return addr;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -5,4 +5,4 @@ sdk_HEADERS = xf86RAC.h
|
|||
|
||||
INCLUDES = $(XORG_INCS)
|
||||
|
||||
AM_CFLAGS = $(XORG_CFLAGS)
|
||||
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -6,4 +6,4 @@ sdk_HEADERS = shadowfb.h
|
|||
|
||||
INCLUDES = $(XORG_INCS)
|
||||
|
||||
AM_CFLAGS = $(XORG_CFLAGS)
|
||||
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ SUBDIRS = \
|
|||
$(XEGL_SUBDIRS)
|
||||
|
||||
AM_CFLAGS = \
|
||||
\
|
||||
$(DIX_CFLAGS) \
|
||||
-DHAVE_XGL_CONFIG_H \
|
||||
-DHAVE_DIX_CONFIG_H \
|
||||
-I$(top_srcdir)/GL/glx \
|
||||
|
|
|
@ -9,7 +9,7 @@ SUBDIRS = \
|
|||
$(XGL_MODULE_DIRS)
|
||||
|
||||
AM_CFLAGS = \
|
||||
\
|
||||
$(DIX_CFLAGS) \
|
||||
-DHAVE_XGL_CONFIG_H \
|
||||
-DHAVE_DIX_CONFIG_H \
|
||||
$(XEGLMODULES_CFLAGS)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
AM_CFLAGS = \
|
||||
$(DIX_CFLAGS) \
|
||||
-I$(srcdir)/.. \
|
||||
-I$(srcdir)/../.. \
|
||||
$(XEGLMODULES_CFLAGS)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
SUBDIRS = module
|
||||
|
||||
AM_CFLAGS = \
|
||||
\
|
||||
$(DIX_CFLAGS) \
|
||||
-DHAVE_XGL_CONFIG_H \
|
||||
-DHAVE_DIX_CONFIG_H \
|
||||
$(XGLMODULES_CFLAGS) \
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
AM_CFLAGS = \
|
||||
\
|
||||
$(DIX_CFLAGS) \
|
||||
-DHAVE_XGL_CONFIG_H \
|
||||
-DHAVE_DIX_CONFIG_H \
|
||||
$(XGLMODULES_CFLAGS) \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -424,7 +424,7 @@ extern int GetProximityEvents(
|
|||
extern void PostSyntheticMotion(
|
||||
int x,
|
||||
int y,
|
||||
int screenNum,
|
||||
ScreenPtr pScreen,
|
||||
unsigned long time);
|
||||
|
||||
extern int GetMotionHistorySize(
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
16
os/WaitFor.c
16
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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
2
os/log.c
2
os/log.c
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
179
randr/mirandr.c
179
randr/mirandr.c
|
@ -1,39 +1,78 @@
|
|||
/*
|
||||
*
|
||||
* 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>
|
||||
|
||||
Bool
|
||||
miRRGetInfo (ScreenPtr pScreen, Rotation *rotations)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Any hardware that can actually change anything will need something
|
||||
* different here
|
||||
*/
|
||||
Bool
|
||||
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
|
||||
|
@ -43,59 +82,65 @@
|
|||
* 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;
|
||||
}
|
||||
|
||||
/*
|
||||
* Any hardware that can actually change anything will need something
|
||||
* different here
|
||||
*/
|
||||
Bool
|
||||
miRRSetConfig (ScreenPtr pScreen,
|
||||
Rotation rotation,
|
||||
int rate,
|
||||
RRScreenSizePtr pSize)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user