Merge branch 'master' into mpx

Conflicts:

	dix/devices.c
	hw/xfree86/common/xf86Xinput.c
	hw/xfree86/loader/xf86sym.c
	mi/mieq.c
This commit is contained in:
Peter Hutterer
2007-06-19 17:20:52 +09:30
129 changed files with 3203 additions and 15263 deletions

View File

@@ -1365,7 +1365,7 @@ do { \
# define write_mem_barrier() /* NOP */
# if !defined(__SUNPRO_C)
# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__)
# if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__)
# ifdef GCCUSESGAS
/*

View File

@@ -1 +1,2 @@
#define BUILD_DATE @BUILD_DATE@
#define BUILD_TIME @BUILD_TIME@

View File

@@ -3004,7 +3004,7 @@ xf86FindPrimaryDevice()
}
#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__)
#if !defined(__sparc) && !defined(__sparc__) && !defined(__powerpc__) && !defined(__mips__) && !defined(__arm__)
#include "vgaHW.h"
#include "compiler.h"
#endif

View File

@@ -131,9 +131,9 @@ static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input,
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
static Bool addDefaultModes(MonPtr monitorp);
#ifdef XF86DRI
static Bool configDRI(XF86ConfDRIPtr drip);
static void configDRI(XF86ConfDRIPtr drip);
#endif
static Bool configExtensions(XF86ConfExtensionsPtr conf_ext);
static void configExtensions(XF86ConfExtensionsPtr conf_ext);
/*
* xf86GetPathElem --
@@ -254,6 +254,7 @@ xf86ModulelistFromConfig(pointer **optlist)
char *ignore[] = { "GLcore", "speedo", "bitmap", "drm", NULL };
pointer *optarray;
XF86LoadPtr modp;
Bool found;
/*
* make sure the config file has been parsed and that we have a
@@ -266,35 +267,76 @@ xf86ModulelistFromConfig(pointer **optlist)
}
if (xf86configptr->conf_modules) {
/*
* Walk the list of modules in the "Module" section to determine how
* many we have.
*/
modp = xf86configptr->conf_modules->mod_load_lst;
while (modp) {
for (i = 0; ignore[i]; i++) {
if (strcmp(modp->load_name, ignore[i]) == 0)
modp->ignore = 1;
/* Walk the disable list and let people know what we've parsed to
* not be loaded
*/
modp = xf86configptr->conf_modules->mod_disable_lst;
while (modp) {
xf86Msg(X_WARNING, "\"%s\" will not be loaded unless you've specified it to be loaded elsewhere.\n", modp->load_name);
modp = (XF86LoadPtr) modp->list.next;
}
/*
* Walk the default settings table. For each module listed to be
* loaded, make sure it's in the mod_load_lst. If it's not, make
* sure it's not in the mod_no_load_lst. If it's not disabled,
* append it to mod_load_lst
*/
for (i=0 ; ModuleDefaults[i].name != NULL ; i++) {
if (ModuleDefaults[i].toLoad == FALSE) {
xf86Msg(X_WARNING, "\"%s\" is not to be loaded by default. Skipping.\n", ModuleDefaults[i].name);
continue;
}
if (!modp->ignore)
count++;
modp = (XF86LoadPtr) modp->list.next;
}
found = FALSE;
modp = xf86configptr->conf_modules->mod_load_lst;
while (modp) {
if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) {
xf86Msg(X_INFO, "\"%s\" will be loaded. This was enabled by default and also specified in the config file.\n", ModuleDefaults[i].name);
found = TRUE;
break;
}
modp = (XF86LoadPtr) modp->list.next;
}
if (found == FALSE) {
modp = xf86configptr->conf_modules->mod_disable_lst;
while (modp) {
if (strcmp(modp->load_name, ModuleDefaults[i].name) == 0) {
xf86Msg(X_INFO, "\"%s\" will be loaded even though the default is to disable it.\n", ModuleDefaults[i].name);
found = TRUE;
break;
}
modp = (XF86LoadPtr) modp->list.next;
}
}
if (found == FALSE) {
XF86ConfModulePtr ptr = xf86configptr->conf_modules;
ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
xf86Msg(X_INFO, "\"%s\" will be loaded by default.\n", ModuleDefaults[i].name);
}
}
} else {
xf86configptr->conf_modules = xnfcalloc(1, sizeof(XF86ConfModuleRec));
for (i=0 ; ModuleDefaults[i].name != NULL ; i++) {
if (ModuleDefaults[i].toLoad == TRUE) {
XF86ConfModulePtr ptr = xf86configptr->conf_modules;
ptr = xf86addNewLoadDirective(ptr, ModuleDefaults[i].name, XF86_LOAD_MODULE, ModuleDefaults[i].load_opt);
}
}
}
if (count == 0) {
XF86ConfModulePtr ptr = xf86configptr->conf_modules;
ptr = xf86addNewLoadDirective(ptr, "extmod", XF86_LOAD_MODULE, NULL);
ptr = xf86addNewLoadDirective(ptr, "dbe", XF86_LOAD_MODULE, NULL);
ptr = xf86addNewLoadDirective(ptr, "glx", XF86_LOAD_MODULE, NULL);
ptr = xf86addNewLoadDirective(ptr, "freetype", XF86_LOAD_MODULE, NULL);
ptr = xf86addNewLoadDirective(ptr, "type1", XF86_LOAD_MODULE, NULL);
ptr = xf86addNewLoadDirective(ptr, "record", XF86_LOAD_MODULE, NULL);
ptr = xf86addNewLoadDirective(ptr, "dri", XF86_LOAD_MODULE, NULL);
count = 7;
}
/*
* Walk the list of modules in the "Module" section to determine how
* many we have.
*/
modp = xf86configptr->conf_modules->mod_load_lst;
while (modp) {
for (i = 0; ignore[i]; i++) {
if (strcmp(modp->load_name, ignore[i]) == 0)
modp->ignore = 1;
}
if (!modp->ignore)
count++;
modp = (XF86LoadPtr) modp->list.next;
}
/*
* allocate the memory and walk the list again to fill in the pointers
@@ -303,22 +345,22 @@ xf86ModulelistFromConfig(pointer **optlist)
optarray = xnfalloc((count + 1) * sizeof(pointer));
count = 0;
if (xf86configptr->conf_modules) {
modp = xf86configptr->conf_modules->mod_load_lst;
while (modp) {
modp = xf86configptr->conf_modules->mod_load_lst;
while (modp) {
if (!modp->ignore) {
modulearray[count] = modp->load_name;
optarray[count] = modp->load_opt;
count++;
modulearray[count] = modp->load_name;
optarray[count] = modp->load_opt;
count++;
}
modp = (XF86LoadPtr) modp->list.next;
}
modp = (XF86LoadPtr) modp->list.next;
}
}
modulearray[count] = NULL;
optarray[count] = NULL;
if (optlist)
*optlist = optarray;
*optlist = optarray;
else
xfree(optarray);
xfree(optarray);
return modulearray;
}
@@ -556,7 +598,7 @@ xf86ConfigError(char *msg, ...)
return;
}
static Bool
static void
configFiles(XF86ConfFilesPtr fileconf)
{
MessageType pathFrom = X_DEFAULT;
@@ -565,16 +607,24 @@ configFiles(XF86ConfFilesPtr fileconf)
char *log_buf;
/* FontPath */
/* Try XF86Config FontPath first */
if (!xf86fpFlag) {
if (fileconf) {
if (fileconf->file_fontpath) {
char *f = xf86ValidateFontPath(fileconf->file_fontpath);
pathFrom = X_CONFIG;
if (*f)
defaultFontPath = f;
else {
if (*f) {
if (xf86Info.useDefaultFontPath) {
xf86Msg(X_DEFAULT, "Including the default font path %s.\n", defaultFontPath);
char *g = xnfalloc(strlen(defaultFontPath) + strlen(f) + 3);
strcpy(g, f);
strcat(g, ",");
defaultFontPath = strcat(g, defaultFontPath);
xfree(f);
} else {
defaultFontPath = f;
}
} else {
xf86Msg(X_WARNING,
"FontPath is completely invalid. Using compiled-in default.\n");
fontPath = NULL;
@@ -582,7 +632,7 @@ configFiles(XF86ConfFilesPtr fileconf)
}
}
} else {
xf86Msg(X_WARNING,
xf86Msg(X_DEFAULT,
"No FontPath specified. Using compiled-in default.\n");
pathFrom = X_DEFAULT;
}
@@ -742,6 +792,7 @@ typedef enum {
FLAG_AIGLX,
FLAG_IGNORE_ABI,
FLAG_ALLOW_EMPTY_INPUT,
FLAG_USE_DEFAULT_FONT_PATH
} FlagValues;
static OptionInfoRec FlagOptions[] = {
@@ -817,6 +868,8 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
{ FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN,
{0}, FALSE },
{ -1, NULL, OPTV_NONE,
{0}, FALSE },
};
@@ -1016,6 +1069,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
if (xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &value))
xf86Info.allowEmptyInput = TRUE;
xf86Info.useDefaultFontPath = TRUE;
xf86Info.useDefaultFontPathFrom = X_DEFAULT;
if (xf86GetOptValBool(FlagOptions, FLAG_USE_DEFAULT_FONT_PATH, &value)) {
xf86Info.useDefaultFontPath = value;
xf86Info.useDefaultFontPathFrom = X_CONFIG;
}
/* Make sure that timers don't overflow CARD32's after multiplying */
#define MAX_TIME_IN_MIN (0x7fffffff / MILLI_PER_MIN)
@@ -1414,13 +1474,13 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
}
if (pointerMsg) {
xf86Msg(X_WARNING, "The core pointer device wasn't specified "
xf86Msg(X_DEFAULT, "The core pointer device wasn't specified "
"explicitly in the layout.\n"
"\tUsing the %s.\n", pointerMsg);
}
if (keyboardMsg) {
xf86Msg(X_WARNING, "The core keyboard device wasn't specified "
xf86Msg(X_DEFAULT, "The core keyboard device wasn't specified "
"explicitly in the layout.\n"
"\tUsing the %s.\n", keyboardMsg);
}
@@ -1749,7 +1809,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen)
indp = xnfalloc(sizeof(IDevRec));
indp->identifier = NULL;
servlayoutp->inputs = indp;
if (!xf86Info.allowEmptyInput && checkCoreInputDevices(servlayoutp, TRUE))
if (!xf86Info.allowEmptyInput && !checkCoreInputDevices(servlayoutp, TRUE))
return FALSE;
return TRUE;
@@ -1877,7 +1937,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
}
if (defaultMonitor) {
xf86Msg(X_WARNING, "No monitor specified for screen \"%s\".\n"
xf86Msg(X_DEFAULT, "No monitor specified for screen \"%s\".\n"
"\tUsing a default monitor configuration.\n", screenp->id);
}
return TRUE;
@@ -2168,7 +2228,7 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active)
}
#ifdef XF86DRI
static Bool
static void
configDRI(XF86ConfDRIPtr drip)
{
int count = 0;
@@ -2209,12 +2269,10 @@ configDRI(XF86ConfDRIPtr drip)
xf86ConfigDRI.bufs[i].flags = 0;
}
}
return TRUE;
}
#endif
static Bool
static void
configExtensions(XF86ConfExtensionsPtr conf_ext)
{
XF86OptionPtr o;
@@ -2249,11 +2307,9 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
xf86NameCmp(val, "false") == 0) {
enable = !enable;
} else {
xf86Msg(X_ERROR,
"%s is not a valid value for the Extension option\n",
val);
xf86Msg(X_WARNING, "Ignoring unrecognized value \"%s\"\n", val);
xfree(n);
return FALSE;
continue;
}
if (EnableDisableExtension(name, enable)) {
@@ -2266,8 +2322,6 @@ configExtensions(XF86ConfExtensionsPtr conf_ext)
xfree(n);
}
}
return TRUE;
}
static Bool
@@ -2397,7 +2451,7 @@ xf86HandleConfigFile(Bool autoconfig)
if (xf86configptr->conf_layout_lst == NULL || xf86ScreenName != NULL) {
if (xf86ScreenName == NULL) {
xf86Msg(X_WARNING,
xf86Msg(X_DEFAULT,
"No Layout section. Using the first Screen section.\n");
}
if (!configImpliedLayout(&xf86ConfigLayout,
@@ -2450,19 +2504,17 @@ xf86HandleConfigFile(Bool autoconfig)
}
/* Now process everything else */
if (!configFiles(xf86configptr->conf_files) ||
!configServerFlags(xf86configptr->conf_flags,
xf86ConfigLayout.options) ||
!configExtensions(xf86configptr->conf_extensions)
#ifdef XF86DRI
|| !configDRI(xf86configptr->conf_dri)
#endif
) {
if (!configServerFlags(xf86configptr->conf_flags,xf86ConfigLayout.options)){
ErrorF ("Problem when converting the config data structures\n");
return CONFIG_PARSE_ERROR;
}
configFiles(xf86configptr->conf_files);
configExtensions(xf86configptr->conf_extensions);
#ifdef XF86DRI
configDRI(xf86configptr->conf_dri);
#endif
/*
* Handle some command line options that can override some of the
* ServerFlags settings.

View File

@@ -33,6 +33,8 @@
#ifndef _xf86_config_h
#define _xf86_config_h
#include "xf86Optrec.h"
#ifdef HAVE_PARSER_DECLS
/*
* global structure that holds the result of parsing the config file
@@ -46,6 +48,23 @@ typedef enum _ConfigStatus {
CONFIG_NOFILE
} ConfigStatus;
typedef struct _ModuleDefault {
char *name;
Bool toLoad;
XF86OptionPtr load_opt;
} ModuleDefault;
static ModuleDefault ModuleDefaults[] = {
{.name = "extmod", .toLoad = TRUE, .load_opt=NULL},
{.name = "dbe", .toLoad = TRUE, .load_opt=NULL},
{.name = "glx", .toLoad = TRUE, .load_opt=NULL},
{.name = "freetype", .toLoad = TRUE, .load_opt=NULL},
{.name = "type1", .toLoad = TRUE, .load_opt=NULL},
{.name = "record", .toLoad = TRUE, .load_opt=NULL},
{.name = "dri", .toLoad = TRUE, .load_opt=NULL},
{.name = NULL, .toLoad = FALSE, .load_opt=NULL}
};
/*
* prototypes
*/

View File

@@ -1210,31 +1210,3 @@ _X_EXPORT void
DDXRingBell(int volume, int pitch, int duration) {
xf86OSRingBell(volume, pitch, duration);
}
#ifdef WSCONS_SUPPORT
/* XXX Currently XKB is mandatory. */
extern int WSKbdToKeycode(int);
void
xf86PostWSKbdEvent(struct wscons_event *event)
{
int type = event->type;
int value = event->value;
unsigned int keycode;
int blocked;
if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) {
Bool down = (type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);
/* map the scancodes to standard XFree86 scancode */
keycode = WSKbdToKeycode(value);
if (!down) keycode |= 0x80;
/* It seems better to block SIGIO there */
blocked = xf86BlockSIGIO();
xf86PostKbdEvent(keycode);
xf86UnblockSIGIO(blocked);
}
}
#endif /* WSCONS_SUPPORT */

View File

@@ -1730,8 +1730,16 @@ xf86PrintBanner()
t.tm_mday = BUILD_DATE % 100;
t.tm_mon = (BUILD_DATE / 100) % 100 - 1;
t.tm_year = BUILD_DATE / 10000 - 1900;
#if defined(BUILD_TIME)
t.tm_sec = BUILD_TIME % 100;
t.tm_min = (BUILD_TIME / 100) % 100;
t.tm_hour = (BUILD_TIME / 10000) % 100;
if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%s%p", &t))
ErrorF("Build Date: %s\n", buf);
#else
if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
ErrorF("Build Date: %s\n", buf);
#endif
}
#endif
#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)

View File

@@ -1890,7 +1890,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
virtX, virtY, vx, vy);
virtX = vx;
virtY = vy;
linePitch = miScanLineWidth(vx, vy, linePitch, apertureSize,
linePitch = miScanLineWidth(vx, vy, minPitch, apertureSize,
BankFormat, pitchInc);
}
}

View File

@@ -85,7 +85,7 @@ typedef enum {
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(2, 0)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 0)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 1)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 5)

View File

@@ -120,6 +120,8 @@ typedef struct {
MessageType randRFrom;
Bool aiglx;
MessageType aiglxFrom;
Bool useDefaultFontPath;
MessageType useDefaultFontPathFrom;
Bool ignoreABI;
struct {
Bool disabled; /* enable/disable deactivating

View File

@@ -110,7 +110,7 @@ xf86SendDragEvents(DeviceIntPtr device)
{
LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
if (device->button->buttonsDown > 0)
if (device->button && device->button->buttonsDown > 0)
return (local->flags & XI86_SEND_DRAG_EVENTS);
else
return (TRUE);
@@ -129,9 +129,11 @@ xf86ProcessCommonOptions(LocalDevicePtr local,
pointer list)
{
if (xf86SetBoolOption(list, "AlwaysCore", 0) ||
xf86SetBoolOption(list, "SendCoreEvents", 0) ||
xf86SetBoolOption(list, "CorePointer", 0) ||
xf86SetBoolOption(list, "CoreKeyboard", 0)) {
!xf86SetBoolOption(list, "SendCoreEvents", 1) ||
!xf86SetBoolOption(list, "CorePointer", 1) ||
!xf86SetBoolOption(list, "CoreKeyboard", 1)) {
xf86Msg(X_CONFIG, "%s: doesn't report core events\n", local->name);
} else {
local->flags |= XI86_ALWAYS_CORE;
xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name);
}
@@ -358,7 +360,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
return BadAlloc;
for (option = options; option; option = option->next) {
if (strcmp(option->key, "driver") == 0) {
if (strcasecmp(option->key, "driver") == 0) {
if (idev->driver) {
rval = BadRequest;
goto unwind;
@@ -381,8 +383,8 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
goto unwind;
}
}
if (strcmp(option->key, "name") == 0 ||
strcmp(option->key, "identifier") == 0) {
if (strcasecmp(option->key, "name") == 0 ||
strcasecmp(option->key, "identifier") == 0) {
if (idev->identifier) {
rval = BadRequest;
goto unwind;
@@ -445,7 +447,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev)
dev = pInfo->dev;
ActivateDevice(dev);
if (dev->inited && dev->startup)
if (dev->inited && dev->startup && xf86Screens[0]->vtSema)
EnableDevice(dev);
if (!IsPointerDevice(dev))
@@ -505,26 +507,47 @@ xf86PostMotionEvent(DeviceIntPtr device,
...)
{
va_list var;
int i = 0, nevents = 0;
int dx, dy;
Bool drag = xf86SendDragEvents(device);
int *valuators = NULL;
int flags = 0;
xEvent *xE = NULL;
int index;
int i = 0;
static int *valuators = NULL;
static int n_valuators = 0;
if (is_absolute)
flags = POINTER_ABSOLUTE;
else
flags = POINTER_RELATIVE | POINTER_ACCELERATE;
if (num_valuators > n_valuators) {
xfree (valuators);
valuators = NULL;
}
valuators = xcalloc(sizeof(int), num_valuators);
if (!valuators) {
valuators = xcalloc(sizeof(int), num_valuators);
n_valuators = num_valuators;
}
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
valuators[i] = va_arg(var, int);
va_end(var);
xf86PostMotionEventP(device, is_absolute, first_valuator, num_valuators, valuators);
}
_X_EXPORT void
xf86PostMotionEventP(DeviceIntPtr device,
int is_absolute,
int first_valuator,
int num_valuators,
int *valuators)
{
int i = 0, nevents = 0;
int dx, dy;
Bool drag = xf86SendDragEvents(device);
xEvent *xE = NULL;
int index;
int flags = 0;
if (is_absolute)
flags = POINTER_ABSOLUTE;
else
flags = POINTER_RELATIVE | POINTER_ACCELERATE;
#if XFreeXDGA
if (first_valuator == 0 && num_valuators >= 2) {
if (miPointerGetScreen(inputInfo.pointer)) {
@@ -538,7 +561,7 @@ xf86PostMotionEvent(DeviceIntPtr device,
dy = valuators[1];
}
if (DGAStealMotionEvent(index, dx, dy))
goto out;
return;
}
}
#endif
@@ -560,9 +583,6 @@ xf86PostMotionEvent(DeviceIntPtr device,
mieqEnqueue(device, (xf86Events + i)->event);
}
}
out:
xfree(valuators);
}
_X_EXPORT void

View File

@@ -164,6 +164,8 @@ extern InputInfoPtr xf86InputDevs;
void InitExtInput(void);
void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
int first_valuator, int num_valuators, ...);
void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
int first_valuator, int num_valuators, int *valuators);
void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
int first_valuator, int num_valuators, ...);
void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,

View File

@@ -979,6 +979,9 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
winPriv->next = PrivRoot;
pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
}
portPriv->pDraw = (DrawablePtr)pWin;
return Success;
}
@@ -1375,7 +1378,6 @@ xf86XVPutVideo(
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
if(result != Success) return result;
portPriv->pDraw = pDraw;
portPriv->type = XvInputMask;
/* save a copy of these parameters */
@@ -1479,7 +1481,6 @@ xf86XVPutStill(
xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
portPriv->isOn = XV_ON;
portPriv->pDraw = pDraw;
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
portPriv->type = 0; /* no mask means it's transient and should
@@ -1529,7 +1530,6 @@ xf86XVGetVideo(
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
if(result != Success) return result;
portPriv->pDraw = pDraw;
portPriv->type = XvOutputMask;
/* save a copy of these parameters */
@@ -1784,7 +1784,6 @@ xf86XVPutImage(
(portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
portPriv->isOn = XV_ON;
portPriv->pDraw = pDraw;
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
portPriv->type = 0; /* no mask means it's transient and should
@@ -1876,42 +1875,35 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
_X_EXPORT void
xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
{
XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen);
DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
XID pval[2];
BoxPtr pbox = REGION_RECTS(clipboxes);
int i, nbox = REGION_NUM_RECTS(clipboxes);
xRectangle *rects;
GCPtr gc;
if(!xf86Screens[pScreen->myNum]->vtSema) return;
if(!ScreenPriv->videoGC) {
int status;
pval[0] = key;
pval[1] = IncludeInferiors;
ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode,
pval, &status);
if(!ScreenPriv->videoGC) return;
ValidateGC(root, ScreenPriv->videoGC);
} else if (key != ScreenPriv->videoGC->fgPixel){
pval[0] = key;
ChangeGC(ScreenPriv->videoGC, GCForeground, pval);
ValidateGC(root, ScreenPriv->videoGC);
}
gc = GetScratchGC(root->depth, pScreen);
pval[0] = key;
pval[1] = IncludeInferiors;
(void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval);
ValidateGC(root, gc);
rects = ALLOCATE_LOCAL(nbox * sizeof(xRectangle));
rects = xalloc (nbox * sizeof(xRectangle));
for(i = 0; i < nbox; i++, pbox++) {
for(i = 0; i < nbox; i++, pbox++)
{
rects[i].x = pbox->x1;
rects[i].y = pbox->y1;
rects[i].width = pbox->x2 - pbox->x1;
rects[i].height = pbox->y2 - pbox->y1;
}
(*ScreenPriv->videoGC->ops->PolyFillRect)(
root, ScreenPriv->videoGC, nbox, rects);
DEALLOCATE_LOCAL(rects);
(*gc->ops->PolyFillRect)(root, gc, nbox, rects);
xfree (rects);
FreeScratchGC (gc);
}
/* xf86XVClipVideoHelper -

View File

@@ -1,9 +1,9 @@
sdk_HEADERS = edid.h vdif.h xf86DDC.h
sdk_HEADERS = edid.h xf86DDC.h
noinst_LIBRARIES = libddc.a
libddc_a_SOURCES = xf86DDC.c edid.c interpret_edid.c print_edid.c \
interpret_vdif.c print_vdif.c ddcProperty.c
ddcProperty.c
INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c

View File

@@ -35,7 +35,6 @@
#define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
#define EDID2_ATOM_NAME "XFree86_DDC_EDID2_RAWDATA"
#define VDIF_ATOM_NAME "XFree86_DDC_VDIF_RAWDATA"
static void
addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
@@ -103,16 +102,6 @@ addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
xf86RegisterRootWindowProperty(scrnIndex, EDID2Atom, XA_INTEGER, 8,
256, (unsigned char *)EDID2rawdata);
}
#if 0
if (DDC->vdif) {
#define VDIF_DUMMY_STRING "setting dummy VDIF property - please insert correct values\n"
VDIFAtom = MakeAtom(VDIF_ATOM_NAME, sizeof(VDIF_ATOM_NAME), TRUE);
xf86RegisterRootWindowProperty(scrnIndex, VDIFAtom, XA_STRING, 8,
strlen(VDIF_DUMMY_STRING), VDIF_DUMMY_STRING);
}
#endif
}
Bool

View File

@@ -12,8 +12,6 @@
#ifndef _EDID_H_
#define _EDID_H_
#include "vdif.h"
/* read complete EDID record */
#define EDID1_LEN 128
#define BITS_PER_BYTE 9
@@ -453,7 +451,7 @@ typedef struct {
struct established_timings timings1;
struct std_timings timings2[8];
struct detailed_monitor_section det_mon[4];
xf86vdifPtr vdif;
void *vdif; /* unused */
int no_sections;
Uchar *rawData;
} xf86Monitor, *xf86MonPtr;

View File

@@ -1,132 +0,0 @@
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include <X11/Xarch.h>
#include "xf86DDC.h"
#include "vdif.h"
static xf86VdifLimitsPtr* get_limits(CARD8 *c);
static xf86VdifGammaPtr* get_gamma(CARD8 *c);
static xf86VdifTimingPtr* get_timings(CARD8 *c);
#if X_BYTE_ORDER == X_BIG_ENDIAN
static CARD32 swap_byte_order(CARD32 c);
#endif
xf86vdifPtr
xf86InterpretVdif(CARD8 *c)
{
xf86VdifPtr p = (xf86VdifPtr)c;
xf86vdifPtr vdif;
int i;
#if X_BYTE_ORDER == X_BIG_ENDIAN
int length;
#endif
unsigned long l = 0;
if (c == NULL) return NULL;
#if X_BYTE_ORDER == X_BIG_ENDIAN
length = swap_byte_order(p->FileLength);
for (i = 0; i < (length >>2); i++)
((CARD32*)c)[i] = swap_byte_order(((CARD32*)c)[i]) ;
#endif
if (p->VDIFId[0] != 'V' || p->VDIFId[1] != 'D' || p->VDIFId[2] != 'I'
|| p->VDIFId[3] != 'F') return NULL;
for ( i = 12; i < p->FileLength; i++)
l += c[i];
if ( l != p->Checksum) return NULL;
vdif = xalloc(sizeof(xf86vdif));
vdif->vdif = p;
vdif->limits = get_limits(c);
vdif->timings = get_timings(c);
vdif->gamma = get_gamma(c);
vdif->strings = VDIF_STRING(((xf86VdifPtr)c),0);
xfree(c);
return vdif;
}
static xf86VdifLimitsPtr*
get_limits(CARD8 *c)
{
int num, i, j;
xf86VdifLimitsPtr *pp;
xf86VdifLimitsPtr p;
num = ((xf86VdifPtr)c)->NumberOperationalLimits;
pp = xalloc(sizeof(xf86VdifLimitsPtr) * (num+1));
p = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
j = 0;
for ( i = 0; i<num; i++) {
if (p->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
pp[j++] = p;
VDIF_NEXT_OPERATIONAL_LIMITS(p);
}
pp[j] = NULL;
return pp;
}
static xf86VdifGammaPtr*
get_gamma(CARD8 *c)
{
int num, i, j;
xf86VdifGammaPtr *pp;
xf86VdifGammaPtr p;
num = ((xf86VdifPtr)c)->NumberOptions;
pp = xalloc(sizeof(xf86VdifGammaPtr) * (num+1));
p = (xf86VdifGammaPtr)VDIF_OPTIONS(((xf86VdifPtr)c));
j = 0;
for ( i = 0; i<num; i++)
{
if (p->Header.ScnTag == VDIF_GAMMA_TABLE_TAG)
pp[j++] = p;
VDIF_NEXT_OPTIONS(p);
}
pp[j] = NULL;
return pp;
}
static xf86VdifTimingPtr*
get_timings(CARD8 *c)
{
int num, num_limits;
int i,j,k;
xf86VdifLimitsPtr lp;
xf86VdifTimingPtr *pp;
xf86VdifTimingPtr p;
num = ((xf86VdifPtr)c)->NumberOperationalLimits;
lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr)c));
num_limits = 0;
for (i = 0; i < num; i++) {
if (lp->Header.ScnTag == VDIF_OPERATIONAL_LIMITS_TAG)
num_limits += lp->NumberPreadjustedTimings;
VDIF_NEXT_OPERATIONAL_LIMITS(lp);
}
pp = xalloc(sizeof(xf86VdifTimingPtr)
* (num_limits+1));
j = 0;
lp = VDIF_OPERATIONAL_LIMITS(((xf86VdifPtr) c));
for (i = 0; i < num; i++) {
p = VDIF_PREADJUSTED_TIMING(lp);
for (k = 0; k < lp->NumberPreadjustedTimings; k++) {
if (p->Header.ScnTag == VDIF_PREADJUSTED_TIMING_TAG)
pp[j++] = p;
VDIF_NEXT_PREADJUSTED_TIMING(p);
}
VDIF_NEXT_OPERATIONAL_LIMITS(lp);
}
pp[j] = NULL;
return pp;
}
#if X_BYTE_ORDER == X_BIG_ENDIAN
static CARD32
swap_byte_order(CARD32 c)
{
return ((c & 0xFF000000) >> 24) | ((c & 0xFF0000) >> 8)
| ((c & 0xFF00) << 8) | ((c & 0xFF) << 24);
}
#endif

View File

@@ -1,225 +0,0 @@
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
#include "vdif.h"
#include "misc.h"
#include "xf86DDC.h"
static void print_vdif(xf86VdifPtr l, char *s);
static void print_timings(xf86VdifTimingPtr *pt);
static void print_limits(xf86VdifLimitsPtr *pl);
static void print_gamma(xf86VdifGammaPtr *pg);
static void print_type(CARD8 c);
static void print_polarity(CARD8 c);
void
xf86print_vdif(xf86vdifPtr v)
{
print_vdif(v->vdif,v->strings);
print_limits(v->limits);
print_timings(v->timings);
print_gamma(v->gamma);
}
static void
print_vdif(xf86VdifPtr l, char *s)
{
ErrorF("Version %i.%i",l->VDIFVersion,l->VDIFRevision);
ErrorF(" Date: %i/%i/%i, Manufactured: %i/%i/%i\n",l->Date[0],
l->Date[1],l->Date[2],l->DateManufactured[0],
l->DateManufactured[1],l->DateManufactured[2]);
ErrorF("File Revision: %i",l->FileRevision);
ErrorF("Manufacturer: %s\n",s + l->Manufacturer);
ErrorF("ModelNumber: %s\n",s + l->ModelNumber);
ErrorF("VDIFIndex: %s\n",s +l->MinVDIFIndex);
ErrorF("Version: %s\n",s + l->Version);
ErrorF("SerialNumber %s\n",s + l->SerialNumber);
ErrorF("MonitorType: ");
switch (l->MonitorType) {
case VDIF_MONITOR_MONOCHROME:
ErrorF("Mono\n");
break;
case VDIF_MONITOR_COLOR:
ErrorF("Color\n");
break;
}
ErrorF("CRT Size: %i inches\n",l->CRTSize);
switch (l->MonitorType) {
case VDIF_MONITOR_MONOCHROME:
ErrorF("Border: %i percent\n",
l->BorderRed);
ErrorF("Phosphor Decay: 1: %i,",l->RedPhosphorDecay);
if (l->GreenPhosphorDecay !=0)
ErrorF(" 2: %i,",l->GreenPhosphorDecay);
if (l->BluePhosphorDecay !=0)
ErrorF(" 3: %i",l->BluePhosphorDecay);
ErrorF(" ms\n");
if (l->RedChromaticity_x)
ErrorF("Chromaticity: 1: x:%f, y:%f; ",
l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0);
if (l->GreenChromaticity_x)
ErrorF("Chromaticity: 2: x:%f, y:%f; ",
l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0);
if (l->BlueChromaticity_x)
ErrorF("Chromaticity: 3: x:%f, y:%f ",
l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
ErrorF("\n");
ErrorF("Gamma: %f\n",l->RedGamma/1000.0);
break;
case VDIF_MONITOR_COLOR:
ErrorF("Border: Red: %i Green: %i Blue: %i percent\n",
l->BorderRed,l->BorderGreen,l->BorderBlue);
ErrorF("Phosphor Decay: Red: %i, Green: %i, Blue: %i ms\n",
l->RedPhosphorDecay,l->GreenPhosphorDecay,l->BluePhosphorDecay);
ErrorF("Chromaticity: Red: x:%f, y:%f; Green: x:%f, y:%f; "
"Blue: x:%f, y:%f\n",
l->RedChromaticity_x/1000.0,l->RedChromaticity_y/1000.0,
l->GreenChromaticity_x/1000.0,l->GreenChromaticity_y/1000.0,
l->BlueChromaticity_x/1000.0,l->BlueChromaticity_y/1000.0);
ErrorF("Gamma: Red:%f, Green:%f, Blue:%f\n",l->RedGamma/1000.0,
l->GreenGamma/1000.0,l->BlueGamma/1000.0);
break;
}
ErrorF("White Point: x: %f y: %f Y: %f\n",l->WhitePoint_x/1000.0,
l->WhitePoint_y/1000.0,l->WhitePoint_Y/1000.0);
}
static void
print_limits(xf86VdifLimitsPtr *pl)
{
int i = 0;
xf86VdifLimitsPtr l;
while((l = pl[i]) != NULL) {
ErrorF("Max display resolution: %i x %i pixel\n",l->MaxHorPixel,
l->MaxVerPixel);
ErrorF("Size of active area: %i x %i millimeters\n",l->MaxHorActiveLength,
l->MaxVerActiveHeight);
ErrorF("Video Type: ");
print_type(l->VideoType);
ErrorF("Sync Type: ");
print_type(l->SyncType);
ErrorF("Sync Configuration ");
switch (l->SyncConfiguration) {
case VDIF_SYNC_SEPARATE:
ErrorF("separate\n");
break;
case VDIF_SYNC_C:
ErrorF("composite C\n");
break;
case VDIF_SYNC_CP:
ErrorF("composite CP\n");
break;
case VDIF_SYNC_G:
ErrorF("composite G\n");
break;
case VDIF_SYNC_GP:
ErrorF("composite GP\n");
break;
case VDIF_SYNC_OTHER:
ErrorF("other\n");
break;
}
ErrorF("Termination Resistance: %i\n",l->TerminationResistance);
ErrorF("Levels: white: %i, black: %i, blank: %i, sync: %i mV\n",
l->WhiteLevel,l->BlackLevel,l->BlankLevel,l->SyncLevel);
ErrorF("Max. Pixel Clock: %f MHz\n",l->MaxPixelClock/1000.0);
ErrorF("Freq. Range: Hor.: %f - %f kHz, Ver.: %f - %f Hz\n",
l->MaxHorFrequency/1000.0,l->MinHorFrequency/1000.0,
l->MaxVerFrequency/1000.0,l->MinVerFrequency/1000.0);
ErrorF("Retrace time: Hor: %f us, Ver: %f ms\n",l->MinHorRetrace/1000.0,
l->MinVerRetrace/1000.0);
}
}
static void
print_timings(xf86VdifTimingPtr *pt)
{
int i = 0;
xf86VdifTimingPtr t;
while((t = pt[i]) != NULL) {
ErrorF("SVGA / SVPMI mode number: %i\n",t->PreadjustedTimingName);
ErrorF("Mode %i x %i\n",t->HorPixel,t->VerPixel);
ErrorF("Size: %i x %i mm\n",t->HorAddrLength,t->VerAddrHeight);
ErrorF("Ratios: %i/%i\n",t->PixelWidthRatio,t->PixelHeightRatio);
ErrorF("Character width: %i",t->CharacterWidth);
ErrorF("Clock: %f MHz HFreq.: %f kHz, VFreq: %f Hz\n",t->PixelClock/1000.0,
t->HorFrequency/1000.0,t->VerFrequency/1000.0);
ErrorF("Htotal: %f us, Vtotal %f ms\n", t->HorTotalTime/1000.0,
t->VerTotalTime/1000.0);
ErrorF("HDisp: %f, HBlankStart: %f, HBlankLength: %f, "
"HSyncStart: %f HSyncEnd: %f us\n",t->HorAddrTime/1000.0,
t->HorBlankStart/1000.0,t->HorBlankTime/1000.0,
t->HorSyncStart/1000.0,t->HorSyncTime/1000.0);
ErrorF("VDisp: %f, VBlankStart: %f, VBlankLength: %f, "
"VSyncStart: %f VSyncEnd: %f us\n",t->VerAddrTime/1000.0,
t->VerBlankStart/1000.0,t->VerBlankTime/1000.0,
t->VerSyncStart/1000.0,t->VerSyncTime/1000.0);
ErrorF("Scan Type: ");
switch (t->ScanType) {
case VDIF_SCAN_INTERLACED:
ErrorF("interlaced ");
break;
case VDIF_SCAN_NONINTERLACED:
ErrorF("non interlaced ");
break;
case VDIF_SCAN_OTHER:
ErrorF("other ");
break;
}
ErrorF("Polarity: H: ");
print_polarity(t->HorSyncPolarity);
ErrorF("V: ");
print_polarity(t->VerSyncPolarity);
ErrorF("\n");
}
}
static void
print_gamma(xf86VdifGammaPtr *pg)
{
int i = 0;
xf86VdifGammaPtr g;
while((g = pg[i]) != NULL) {
ErrorF("Gamma Table Entries: %i\n",g->GammaTableEntries);
}
}
static void
print_type(CARD8 c)
{
switch (c) {
case VDIF_VIDEO_TTL :
ErrorF("TTL\n");
break;
case VDIF_VIDEO_ANALOG :
ErrorF("Analog\n");
break;
case VDIF_VIDEO_ECL:
ErrorF("ECL\n");
break;
case VDIF_VIDEO_DECL:
ErrorF("DECL\n");
break;
case VDIF_VIDEO_OTHER:
ErrorF("other\n");
break;
}
}
static void
print_polarity(CARD8 c)
{
switch (c) {
case VDIF_POLARITY_NEGATIVE:
ErrorF(" Neg.");
break;
case VDIF_POLARITY_POSITIVE:
ErrorF(" Pos.");
break;
}
}

View File

@@ -1,174 +0,0 @@
#ifndef _VDIF_H
#define _VDIF_H
#define VDIF_MONITOR_MONOCHROME 0
#define VDIF_MONITOR_COLOR 1
#define VDIF_VIDEO_TTL 0
#define VDIF_VIDEO_ANALOG 1
#define VDIF_VIDEO_ECL 2
#define VDIF_VIDEO_DECL 3
#define VDIF_VIDEO_OTHER 4
#define VDIF_SYNC_SEPARATE 0
#define VDIF_SYNC_C 1
#define VDIF_SYNC_CP 2
#define VDIF_SYNC_G 3
#define VDIF_SYNC_GP 4
#define VDIF_SYNC_OTHER 5
#define VDIF_SCAN_NONINTERLACED 0
#define VDIF_SCAN_INTERLACED 1
#define VDIF_SCAN_OTHER 2
#define VDIF_POLARITY_NEGATIVE 0
#define VDIF_POLARITY_POSITIVE 1
#include <X11/Xmd.h>
#undef CARD32
#define CARD32 unsigned int /* ... on all supported platforms */
typedef struct _VDIF { /* Monitor Description: */
CARD8 VDIFId[4]; /* alway "VDIF" */
CARD32 FileLength; /* lenght of the whole file */
CARD32 Checksum; /* sum of all bytes in the file after*/
/* this field */
CARD16 VDIFVersion; /* structure version number */
CARD16 VDIFRevision; /* structure revision number */
CARD16 Date[3]; /* file date Year/Month/Day */
CARD16 DateManufactured[3]; /* date Year/Month/Day */
CARD32 FileRevision; /* file revision string */
CARD32 Manufacturer; /* ASCII ID of the manufacturer */
CARD32 ModelNumber; /* ASCII ID of the model */
CARD32 MinVDIFIndex; /* ASCII ID of Minimum VDIF index */
CARD32 Version; /* ASCII ID of the model version */
CARD32 SerialNumber; /* ASCII ID of the serial number */
CARD8 MonitorType; /* Monochrome or Color */
CARD8 CRTSize; /* inches */
CARD8 BorderRed; /* percent */
CARD8 BorderGreen; /* percent */
CARD8 BorderBlue; /* percent */
CARD8 Reserved1; /* padding */
CARD16 Reserved2; /* padding */
CARD32 RedPhosphorDecay; /* microseconds */
CARD32 GreenPhosphorDecay; /* microseconds */
CARD32 BluePhosphorDecay; /* microseconds */
CARD16 WhitePoint_x; /* WhitePoint in CIExyY (scale 1000) */
CARD16 WhitePoint_y;
CARD16 WhitePoint_Y;
CARD16 RedChromaticity_x; /* Red chromaticity in x,y */
CARD16 RedChromaticity_y;
CARD16 GreenChromaticity_x; /* Green chromaticity in x,y */
CARD16 GreenChromaticity_y;
CARD16 BlueChromaticity_x; /* Blue chromaticity in x,y */
CARD16 BlueChromaticity_y;
CARD16 RedGamma; /* Gamme curve exponent (scale 1000) */
CARD16 GreenGamma;
CARD16 BlueGamma;
CARD32 NumberOperationalLimits;
CARD32 OffsetOperationalLimits;
CARD32 NumberOptions; /* optinal sections (gamma table) */
CARD32 OffsetOptions;
CARD32 OffsetStringTable;
} xf86VdifRec, *xf86VdifPtr;
typedef enum { /* Tags for section identification */
VDIF_OPERATIONAL_LIMITS_TAG = 1,
VDIF_PREADJUSTED_TIMING_TAG,
VDIF_GAMMA_TABLE_TAG
} VDIFScnTag;
typedef struct _VDIFScnHdr { /* Generic Section Header: */
CARD32 ScnLength; /* lenght of section */
CARD32 ScnTag; /* tag for section identification */
} VDIFScnHdrRec, *VDIFScnHdrPtr;
typedef struct _VDIFLimits { /* Operational Limits: */
VDIFScnHdrRec Header; /* common section info */
CARD16 MaxHorPixel; /* pixels */
CARD16 MaxVerPixel; /* lines */
CARD16 MaxHorActiveLength; /* millimeters */
CARD16 MaxVerActiveHeight; /* millimeters */
CARD8 VideoType; /* TTL / Analog / ECL / DECL */
CARD8 SyncType; /* TTL / Analog / ECL / DECL */
CARD8 SyncConfiguration; /* separate / composite / other */
CARD8 Reserved1; /* padding */
CARD16 Reserved2; /* padding */
CARD16 TerminationResistance; /* */
CARD16 WhiteLevel; /* millivolts */
CARD16 BlackLevel; /* millivolts */
CARD16 BlankLevel; /* millivolts */
CARD16 SyncLevel; /* millivolts */
CARD32 MaxPixelClock; /* kiloHertz */
CARD32 MinHorFrequency; /* Hertz */
CARD32 MaxHorFrequency; /* Hertz */
CARD32 MinVerFrequency; /* milliHertz */
CARD32 MaxVerFrequency; /* milliHertz */
CARD16 MinHorRetrace; /* nanoseconds */
CARD16 MinVerRetrace; /* microseconds */
CARD32 NumberPreadjustedTimings;
CARD32 OffsetNextLimits;
} xf86VdifLimitsRec, *xf86VdifLimitsPtr;
typedef struct _VDIFTiming { /* Preadjusted Timing: */
VDIFScnHdrRec Header; /* common section info */
CARD32 PreadjustedTimingName; /* SVGA/SVPMI mode number */
CARD16 HorPixel; /* pixels */
CARD16 VerPixel; /* lines */
CARD16 HorAddrLength; /* millimeters */
CARD16 VerAddrHeight; /* millimeters */
CARD8 PixelWidthRatio; /* gives H:V */
CARD8 PixelHeightRatio;
CARD8 Reserved1; /* padding */
CARD8 ScanType; /* noninterlaced / interlaced / other*/
CARD8 HorSyncPolarity; /* negative / positive */
CARD8 VerSyncPolarity; /* negative / positive */
CARD16 CharacterWidth; /* pixels */
CARD32 PixelClock; /* kiloHertz */
CARD32 HorFrequency; /* Hertz */
CARD32 VerFrequency; /* milliHertz */
CARD32 HorTotalTime; /* nanoseconds */
CARD32 VerTotalTime; /* microseconds */
CARD16 HorAddrTime; /* nanoseconds */
CARD16 HorBlankStart; /* nanoseconds */
CARD16 HorBlankTime; /* nanoseconds */
CARD16 HorSyncStart; /* nanoseconds */
CARD16 HorSyncTime; /* nanoseconds */
CARD16 VerAddrTime; /* microseconds */
CARD16 VerBlankStart; /* microseconds */
CARD16 VerBlankTime; /* microseconds */
CARD16 VerSyncStart; /* microseconds */
CARD16 VerSyncTime; /* microseconds */
} xf86VdifTimingRec, *xf86VdifTimingPtr;
typedef struct _VDIFGamma { /* Gamma Table: */
VDIFScnHdrRec Header; /* common section info */
CARD16 GammaTableEntries; /* count of grays or RGB 3-tuples */
CARD16 Unused1;
} xf86VdifGammaRec, *xf86VdifGammaPtr;
/* access macros */
#define VDIF_OPERATIONAL_LIMITS(vdif) \
((xf86VdifLimitsPtr)((char*)(vdif) + (vdif)->OffsetOperationalLimits))
#define VDIF_NEXT_OPERATIONAL_LIMITS(limits) limits = \
((xf86VdifLimitsPtr)((char*)(limits) + (limits)->OffsetNextLimits))
#define VDIF_PREADJUSTED_TIMING(limits) \
((xf86VdifTimingPtr)((char*)(limits) + (limits)->Header.ScnLength))
#define VDIF_NEXT_PREADJUSTED_TIMING(timing) timing = \
((xf86VdifTimingPtr)((char*)(timing) + (timing)->Header.ScnLength))
#define VDIF_OPTIONS(vdif) \
((VDIFScnHdrPtr)((char*)(vdif) + (vdif)->OffsetOptions))
#define VDIF_NEXT_OPTIONS(options) options = \
((xf86VdifGammaPtr)((char*)(options) + (options)->Header.ScnLength))
#define VDIF_STRING(vdif, string) \
((char*)((char*)vdif + vdif->OffsetStringTable + (string)))
typedef struct _vdif {
xf86VdifPtr vdif;
xf86VdifLimitsPtr *limits;
xf86VdifTimingPtr *timings;
xf86VdifGammaPtr *gamma;
char * strings;
} xf86vdif, *xf86vdifPtr;
#undef CARD32
#endif

View File

@@ -38,12 +38,6 @@ static unsigned char* EDID1Read_DDC2(
I2CBusPtr pBus
);
static unsigned char * VDIFRead(
int scrnIndex,
I2CBusPtr pBus,
int start
);
static unsigned char * DDCRead_DDC2(
int scrnIndex,
I2CBusPtr pBus,
@@ -138,7 +132,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
unsigned char *EDID_block = NULL;
unsigned char *VDIF_Block = NULL;
xf86MonPtr tmp = NULL;
/* Default DDC and DDC2 to enabled. */
Bool noddc = FALSE, noddc2 = FALSE;
@@ -171,11 +164,6 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
else
ErrorF("Sections to follow: %i\n",tmp->no_sections);
#endif
if (tmp) {
VDIF_Block =
VDIFRead(scrnIndex, pBus, EDID1_LEN * (tmp->no_sections + 1));
tmp->vdif = xf86InterpretVdif(VDIF_Block);
}
return tmp;
}
@@ -253,35 +241,6 @@ EDID1Read_DDC2(int scrnIndex, I2CBusPtr pBus)
return DDCRead_DDC2(scrnIndex, pBus, 0, EDID1_LEN);
}
static unsigned char*
VDIFRead(int scrnIndex, I2CBusPtr pBus, int start)
{
unsigned char * Buffer, *v_buffer = NULL, *v_bufferp = NULL;
int i, num = 0;
/* read VDIF length in 64 byte blocks */
Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
if (Buffer == NULL)
return NULL;
#ifdef DEBUG
ErrorF("number of 64 bit blocks: %i\n",Buffer[0]);
#endif
if ((num = Buffer[0]) > 0)
v_buffer = v_bufferp = xalloc(sizeof(unsigned char) * 64 * num);
for (i = 0; i < num; i++) {
Buffer = DDCRead_DDC2(scrnIndex, pBus,start,64);
if (Buffer == NULL) {
xfree (v_buffer);
return NULL;
}
memcpy(v_bufferp,Buffer,63); /* 64th byte is checksum */
xfree(Buffer);
v_bufferp += 63;
}
return v_buffer;
}
static unsigned char *
DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
{

View File

@@ -43,10 +43,6 @@ extern xf86MonPtr xf86InterpretEDID(
int screenIndex, Uchar *block
);
extern xf86vdifPtr xf86InterpretVdif(
CARD8 *c
);
extern void
xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC);
@@ -55,10 +51,6 @@ extern Bool xf86SetDDCproperties(
xf86MonPtr DDC
);
extern void xf86print_vdif(
xf86vdifPtr v
);
DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
#endif

View File

@@ -45,9 +45,6 @@ fontsmodule_LTLIBRARIES = libfreetype.la \
AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@
INCLUDES = @XORG_INCS@ \
-I$(top_srcdir)/afb \
-I$(top_srcdir)/cfb \
-I$(top_srcdir)/mfb \
-I$(top_srcdir)/dbe \
-I$(top_srcdir)/hw/xfree86/loader \
-I$(top_srcdir)/miext/shadow \

View File

@@ -29,7 +29,6 @@
#endif
#include "xf86Module.h"
#include "afb.h"
static MODULESETUPPROTO(afbSetup);

View File

@@ -28,10 +28,7 @@
#include <xorg-config.h>
#endif
#define PSZ 32
#include "xf86Module.h"
#include "cfb.h"
static MODULESETUPPROTO(cfb32Setup);

View File

@@ -28,10 +28,7 @@
#include <xorg-config.h>
#endif
#define PSZ 8
#include "xf86Module.h"
#include "cfb.h"
static MODULESETUPPROTO(cfbSetup);

File diff suppressed because it is too large Load Diff

View File

@@ -1519,13 +1519,18 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
if (x1 > pScreen->width) x1 = pScreen->width;
if (y1 > pScreen->height) y1 = pScreen->height;
pDRIPriv->private_buffer_rect.x1 = x0;
pDRIPriv->private_buffer_rect.y1 = y0;
pDRIPriv->private_buffer_rect.x2 = x1;
pDRIPriv->private_buffer_rect.y2 = y1;
if (y0 >= y1 || x0 >= x1) {
*numBackClipRects = 0;
*pBackClipRects = NULL;
} else {
pDRIPriv->private_buffer_rect.x1 = x0;
pDRIPriv->private_buffer_rect.y1 = y0;
pDRIPriv->private_buffer_rect.x2 = x1;
pDRIPriv->private_buffer_rect.y2 = y1;
*numBackClipRects = 1;
*pBackClipRects = &(pDRIPriv->private_buffer_rect);
*numBackClipRects = 1;
*pBackClipRects = &(pDRIPriv->private_buffer_rect);
}
} else {
/* Use the frontbuffer cliprects for back buffers. */
*numBackClipRects = 0;
@@ -1864,11 +1869,15 @@ DRITreeTraversal(WindowPtr pWin, pointer data)
if(pDRIDrawablePriv) {
ScreenPtr pScreen = pWin->drawable.pScreen;
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
RegionPtr reg = (RegionPtr)data;
REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
if(REGION_NUM_RECTS(&(pWin->clipList)) > 0) {
RegionPtr reg = (RegionPtr)data;
if(pDRIPriv->nrWindows == 1)
REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
pDRIPriv->nrWalked++;
}
if(pDRIPriv->nrWindows == pDRIPriv->nrWalked)
return WT_STOPWALKING;
}
return WT_WALKCHILDREN;
@@ -1886,6 +1895,7 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
RegionRec reg;
REGION_NULL(pScreen, &reg);
pDRIPriv->nrWalked = 0;
TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg));
if(REGION_NOTEMPTY(pScreen, &reg)) {
@@ -2211,6 +2221,19 @@ DRIGetContext(ScreenPtr pScreen)
return pDRIPriv->myContext;
}
void
DRIGetTexOffsetFuncs(ScreenPtr pScreen,
DRITexOffsetStartProcPtr *texOffsetStartFunc,
DRITexOffsetFinishProcPtr *texOffsetFinishFunc)
{
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
if (!pDRIPriv) return;
*texOffsetStartFunc = pDRIPriv->pDriverInfo->texOffsetStart;
*texOffsetFinishFunc = pDRIPriv->pDriverInfo->texOffsetFinish;
}
/* This lets get at the unwrapped functions so that they can correctly
* call the lowerlevel functions, and choose whether they will be
* called at every level of recursion (eg in validatetree).

View File

@@ -107,9 +107,12 @@ typedef struct {
*/
#define DRIINFO_MAJOR_VERSION 5
#define DRIINFO_MINOR_VERSION 2
#define DRIINFO_MINOR_VERSION 3
#define DRIINFO_PATCH_VERSION 0
typedef unsigned long long (*DRITexOffsetStartProcPtr)(PixmapPtr pPix);
typedef void (*DRITexOffsetFinishProcPtr)(PixmapPtr pPix);
typedef struct {
/* driver call back functions
*
@@ -180,6 +183,10 @@ typedef struct {
/* New with DRI version 5.2.0 */
Bool allocSarea;
Bool keepFDOpen;
/* New with DRI version 5.3.0 */
DRITexOffsetStartProcPtr texOffsetStart;
DRITexOffsetFinishProcPtr texOffsetFinish;
} DRIInfoRec, *DRIInfoPtr;
@@ -358,7 +365,9 @@ extern void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
extern drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn);
extern void DRIGetTexOffsetFuncs(ScreenPtr pScreen,
DRITexOffsetStartProcPtr *texOffsetStartFunc,
DRITexOffsetFinishProcPtr *texOffsetFinishFunc);
#define _DRI_H_

View File

@@ -88,6 +88,6 @@ driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
drmSetServerInfo(&DRIDRMServerInfo);
/* Need a non-NULL return value to indicate success */
return 1;
return (pointer)1;
}

View File

@@ -452,7 +452,7 @@ ProcXF86DRIGetDrawableInfo(
xXF86DRIGetDrawableInfoReply rep;
DrawablePtr pDrawable;
int X, Y, W, H;
drm_clip_rect_t * pClipRects;
drm_clip_rect_t * pClipRects, *pClippedRects;
drm_clip_rect_t * pBackClipRects;
int backX, backY, rc;
@@ -502,8 +502,35 @@ ProcXF86DRIGetDrawableInfo(
if (rep.numBackClipRects)
rep.length += sizeof(drm_clip_rect_t) * rep.numBackClipRects;
if (rep.numClipRects)
pClippedRects = pClipRects;
if (rep.numClipRects) {
/* Clip cliprects to screen dimensions (redirected windows) */
pClippedRects = xalloc(rep.numClipRects * sizeof(drm_clip_rect_t));
if (pClippedRects) {
ScreenPtr pScreen = screenInfo.screens[stuff->screen];
int i, j;
for (i = 0, j = 0; i < rep.numClipRects; i++) {
pClippedRects[j].x1 = max(pClipRects[i].x1, 0);
pClippedRects[j].y1 = max(pClipRects[i].y1, 0);
pClippedRects[j].x2 = min(pClipRects[i].x2, pScreen->width);
pClippedRects[j].y2 = min(pClipRects[i].y2, pScreen->height);
if (pClippedRects[j].x1 < pClippedRects[j].x2 &&
pClippedRects[j].y1 < pClippedRects[j].y2) {
j++;
}
}
rep.numClipRects = j;
} else {
rep.numClipRects = 0;
}
rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects;
}
rep.length = ((rep.length + 3) & ~3) >> 2;
@@ -512,7 +539,8 @@ ProcXF86DRIGetDrawableInfo(
if (rep.numClipRects) {
WriteToClient(client,
sizeof(drm_clip_rect_t) * rep.numClipRects,
(char *)pClipRects);
(char *)pClippedRects);
xfree(pClippedRects);
}
if (rep.numBackClipRects) {

View File

@@ -96,6 +96,11 @@
#endif
#include "xf86DDC.h"
#include "edid.h"
#include "xf86Cursor.h"
#include "xf86RamDac.h"
#include "BT.h"
#include "IBM.h"
#include "TI.h"
#include "xf86RamDac.h"
#include "BT.h"
@@ -1234,8 +1239,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(xf86DoEDID_DDC2)
SYMFUNC(xf86InterpretEDID)
SYMFUNC(xf86PrintEDID)
SYMFUNC(xf86InterpretVdif)
SYMFUNC(xf86print_vdif)
SYMFUNC(xf86DDCMonitorSet)
SYMFUNC(xf86SetDDCproperties)
@@ -1259,13 +1262,49 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(xf86I2CWriteVec)
SYMFUNC(xf86I2CWriteWord)
/* ramdac */
SYMFUNC(RamDacInit)
/* ramdac/xf86RamDac.c */
SYMFUNC(RamDacCreateInfoRec)
SYMFUNC(RamDacDestroyInfoRec)
SYMFUNC(RamDacHelperCreateInfoRec)
SYMFUNC(RamDacFreeRec)
SYMFUNC(RamDacDestroyInfoRec)
SYMFUNC(RamDacHelperDestroyInfoRec)
SYMFUNC(RamDacInit)
SYMFUNC(RamDacHandleColormaps)
SYMFUNC(RamDacFreeRec)
SYMFUNC(RamDacGetHWIndex)
SYMVAR(RamDacHWPrivateIndex)
SYMVAR(RamDacScreenPrivateIndex)
/* ramdac/xf86Cursor.c */
SYMFUNC(xf86InitCursor)
SYMFUNC(xf86CreateCursorInfoRec)
SYMFUNC(xf86DestroyCursorInfoRec)
SYMFUNC(xf86ForceHWCursor)
/* ramdac/BT.c */
SYMFUNC(BTramdacProbe)
SYMFUNC(BTramdacSave)
SYMFUNC(BTramdacRestore)
SYMFUNC(BTramdacSetBpp)
/* ramdac/IBM.c */
SYMFUNC(IBMramdacProbe)
SYMFUNC(IBMramdacSave)
SYMFUNC(IBMramdacRestore)
SYMFUNC(IBMramdac526SetBpp)
SYMFUNC(IBMramdac640SetBpp)
SYMFUNC(IBMramdac526CalculateMNPCForClock)
SYMFUNC(IBMramdac640CalculateMNPCForClock)
SYMFUNC(IBMramdac526HWCursorInit)
SYMFUNC(IBMramdac640HWCursorInit)
SYMFUNC(IBMramdac526SetBppWeak)
/* ramdac/TI.c */
SYMFUNC(TIramdacCalculateMNPForClock)
SYMFUNC(TIramdacProbe)
SYMFUNC(TIramdacSave)
SYMFUNC(TIramdacRestore)
SYMFUNC(TIramdac3026SetBpp)
SYMFUNC(TIramdac3030SetBpp)
SYMFUNC(TIramdacHWCursorInit)
SYMFUNC(TIramdacLoadPalette)
};

View File

@@ -1217,8 +1217,15 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
int o;
if (maxX == 0 || maxY == 0)
xf86RandR12GetOriginalVirtualSize (scrn, &maxX, &maxY);
/* When canGrow was TRUE in the initial configuration we have to
* compare against the maximum values so that we don't drop modes.
* When canGrow was FALSE, the maximum values would have been clamped
* anyway.
*/
if (maxX == 0 || maxY == 0) {
maxX = config->maxWidth;
maxY = config->maxHeight;
}
/* Elide duplicate modes before defaulting code uses them */
xf86PruneDuplicateMonitorModes (scrn->monitor);
@@ -1723,8 +1730,26 @@ Bool
xf86SetDesiredModes (ScrnInfoPtr scrn)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
int c;
int c, o;
/*
* Turn off everything so mode setting is done
* with hardware in a consistent state
*/
for (o = 0; o < config->num_output; o++)
{
xf86OutputPtr output = config->output[o];
(*output->funcs->dpms)(output, DPMSModeOff);
}
for (c = 0; c < config->num_crtc; c++)
{
xf86CrtcPtr crtc = config->crtc[c];
crtc->funcs->dpms(crtc, DPMSModeOff);
memset(&crtc->mode, 0, sizeof(crtc->mode));
}
for (c = 0; c < config->num_crtc; c++)
{
xf86CrtcPtr crtc = config->crtc[c];

View File

@@ -562,6 +562,10 @@ typedef struct _xf86CrtcConfig {
OptionInfoPtr options;
Bool debug_modes;
/* wrap screen BlockHandler for rotation */
ScreenBlockHandlerProcPtr BlockHandler;
} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
extern int xf86CrtcConfigPrivateIndex;

View File

@@ -71,7 +71,11 @@ static Bool quirk_dt_sync_hm_vp (int scrnIndex, xf86MonPtr DDC)
if (memcmp (DDC->vendor.name, "VSC", 4) == 0 &&
DDC->vendor.prod_id == 58653)
return TRUE;
/* Samsung SyncMaster 205BW */
if (memcmp (DDC->vendor.name, "SAM", 4) == 0 &&
DDC->vendor.prod_id == 541)
return TRUE;
return FALSE;
}

View File

@@ -264,7 +264,7 @@ xf86RotatePrepare (ScreenPtr pScreen)
}
}
static void
static Bool
xf86RotateRedisplay(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@@ -273,7 +273,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
RegionPtr region;
if (!damage)
return;
return FALSE;
xf86RotatePrepare (pScreen);
region = DamageRegion(damage);
if (REGION_NOTEMPTY(pScreen, region))
@@ -317,19 +317,25 @@ xf86RotateRedisplay(ScreenPtr pScreen)
pScreen->SourceValidate = SourceValidate;
DamageEmpty(damage);
}
return TRUE;
}
static void
xf86RotateBlockHandler(pointer data, OSTimePtr pTimeout, pointer pRead)
xf86RotateBlockHandler(int screenNum, pointer blockData,
pointer pTimeout, pointer pReadmask)
{
ScreenPtr pScreen = (ScreenPtr) data;
ScreenPtr pScreen = screenInfo.screens[screenNum];
ScrnInfoPtr pScrn = xf86Screens[screenNum];
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86RotateRedisplay(pScreen);
}
static void
xf86RotateWakeupHandler(pointer data, int i, pointer LastSelectMask)
{
pScreen->BlockHandler = xf86_config->BlockHandler;
(*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask);
if (xf86RotateRedisplay(pScreen))
{
/* Re-wrap if rotation is still happening */
xf86_config->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = xf86RotateBlockHandler;
}
}
static void
@@ -367,10 +373,6 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
}
DamageDestroy (xf86_config->rotation_damage);
xf86_config->rotation_damage = NULL;
/* Free block/wakeup handler */
RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler,
xf86RotateWakeupHandler,
(pointer) pScreen);
}
}
@@ -440,20 +442,12 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation)
if (!xf86_config->rotation_damage)
goto bail2;
/* Assign block/wakeup handler */
if (!RegisterBlockAndWakeupHandlers (xf86RotateBlockHandler,
xf86RotateWakeupHandler,
(pointer) pScreen))
{
goto bail3;
}
/* Wrap block handler */
xf86_config->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = xf86RotateBlockHandler;
}
if (0)
{
bail3:
DamageDestroy (xf86_config->rotation_damage);
xf86_config->rotation_damage = NULL;
bail2:
if (shadow || shadowData)
{

View File

@@ -27,7 +27,7 @@
#include <xorg-config.h>
#endif
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
#if defined (SYSCONS_SUPPORT)
#include <sys/kbio.h>
#endif
@@ -77,7 +77,7 @@ xf86OSRingBell(int loudness, int pitch, int duration)
wsb.pitch = pitch;
wsb.period = duration;
wsb.volume = loudness;
ioctl(KBD_FD(xf86Info), WSKBDIO_COMPLEXBELL,
ioctl(xf86Info.consoleFd, WSKBDIO_COMPLEXBELL,
&wsb);
break;
#endif

View File

@@ -50,6 +50,11 @@
#include <machine/mtrr.h>
#include <machine/sysarch.h>
#include <sys/queue.h>
#ifdef __x86_64__
#define i386_set_mtrr x86_64_set_mtrr
#define i386_get_mtrr x86_64_get_mtrr
#define i386_iopl x86_64_iopl
#endif
#endif
#if defined(__OpenBSD__) && defined(__amd64__)

View File

@@ -327,7 +327,7 @@
# define INCLUDE_XF86_MAP_PCI_MEM
# define INCLUDE_XF86_NO_DOMAIN
# endif
# if !defined(__FreeBSD__)
# if !defined(__FreeBSD__) && !defined(linux)
# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge
# endif
#elif defined(__amd64__) || defined(__amd64)

View File

@@ -788,8 +788,10 @@ xf86ReadDomainMemory(PCITAG Tag, ADDRESS Base, int Len, unsigned char *Buf)
write(fd, "1", 2);
lseek(fd, 0, SEEK_SET);
len = min(Len, st.st_size);
/* copy the ROM until we hit Len, EOF or read error */
for (i = 0; i < Len && read(fd, Buf, 1) > 0; Buf++, i++)
for (; len && (size = read(fd, Buf, len)) > 0 ; Buf+=size, len-=size)
;
write(fd, "0", 2);

View File

@@ -117,49 +117,29 @@ xf86LinearVidMem()
/**************************************************************************
* I/O Permissions section
***************************************************************************/
mach_port_t io_port;
/*
* Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare
* this.
*/
extern int ioperm(unsigned long __from, unsigned long __num, int __turn_on);
Bool
xf86EnableIO()
{
mach_port_t device;
kern_return_t err;
err = get_privileged_ports(NULL, &device);
if( err )
{
errno = err;
FatalError("xf86EnableIO() can't get_privileged_ports. (%s)\n",strerror(errno));
}
err = device_open(device,D_READ|D_WRITE,"io",&io_port);
mach_port_deallocate(mach_task_self(), device);
if( err )
{
errno = err;
FatalError("xf86EnableIO() can't device_open. (%s)\n",strerror(errno));
}
err = i386_io_port_add(mach_thread_self (), io_port);
if( err )
{
errno = err;
FatalError("xf86EnableIO() can't i386_io_port_add.(io_port) (%s)\n",strerror(errno));
if (ioperm(0, 0xffff, 1)) {
FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
return FALSE;
}
ioperm(0x40,4,0); /* trap access to the timer chip */
ioperm(0x60,4,0); /* trap access to the keyboard controller */
return TRUE;
}
void
xf86DisableIO()
{
kern_return_t err;
err = i386_io_port_remove(mach_thread_self (), io_port);
if( err )
{
errno = err;
FatalError("xf86DisableIO() can't i386_io_port_remove.(io_port) (%s)\n",strerror(errno));
}
mach_port_deallocate(mach_task_self(), io_port);
ioperm(0,0xffff,0);
return;
}

View File

@@ -62,7 +62,8 @@ static Bool ExtendedEnabled = FALSE;
#elif !defined(__powerpc__) && \
!defined(__mc68000__) && \
!defined(__sparc__) && \
!defined(__mips__)
!defined(__mips__) && \
!defined(__arm__)
/*
* Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare
@@ -567,7 +568,7 @@ xf86EnableIO(void)
#endif
}
close(fd);
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__)
#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__)
if (ioperm(0, 1024, 1) || iopl(3)) {
if (errno == ENODEV)
ErrorF("xf86EnableIOPorts: no I/O ports found\n");
@@ -603,73 +604,21 @@ xf86DisableIO(void)
return;
}
/***************************************************************************/
/* Interrupt Handling section */
/***************************************************************************/
/* XXX The #ifdefs should be made simpler. */
/*
* Don't use these two functions. They can't possibly work. If you actually
* need interrupts off for something, you ought to be doing it in the kernel
* anyway.
*/
_X_EXPORT Bool
xf86DisableInterrupts()
{
#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
if (!ExtendedEnabled)
if (iopl(3) || ioperm(0, 1024, 1))
return (FALSE);
#endif
#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__)
#else
# ifdef __GNUC__
# if defined(__ia64__)
# if 0
__asm__ __volatile__ (";; rsm psr.i;; srlz.d" ::: "memory");
# endif
# else
__asm__ __volatile__("cli");
# endif
# else
asm("cli");
# endif
#endif
#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
if (!ExtendedEnabled) {
iopl(0);
ioperm(0, 1024, 0);
}
#endif
return (TRUE);
}
_X_EXPORT void
xf86EnableInterrupts()
{
#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__ia64__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
if (!ExtendedEnabled)
if (iopl(3) || ioperm(0, 1024, 1))
return;
#endif
#if defined(__alpha__) || defined(__mc68000__) || defined(__powerpc__) || defined(__sparc__) || defined(__mips__) || defined(__arm__) || defined(__sh__) || defined(__ia64__) || defined(__hppa__) || defined(__s390__)
#else
# ifdef __GNUC__
# if defined(__ia64__)
# if 0
__asm__ __volatile__ (";; ssm psr.i;; srlz.d" ::: "memory");
# endif
# else
__asm__ __volatile__("sti");
# endif
# else
asm("sti");
# endif
#endif
#if !defined(__mc68000__) && !defined(__powerpc__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__ia64__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__)
if (!ExtendedEnabled) {
iopl(0);
ioperm(0, 1024, 0);
}
#endif
return;
}

View File

@@ -35,7 +35,8 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len)
#if !defined(__sparc__) && \
!defined(__powerpc__) && \
!defined(__mips__) && \
!defined(__ia64__)
!defined(__ia64__) && \
!defined(__arm__)
outb(0x80, 0x00);
#endif
}

View File

@@ -76,6 +76,7 @@ static xf86ConfigSymTabRec ModuleTab[] =
{
{ENDSECTION, "endsection"},
{LOAD, "load"},
{DISABLE, "disable"},
{LOAD_DRIVER, "loaddriver"},
{SUBSECTION, "subsection"},
{-1, ""},
@@ -141,6 +142,13 @@ xf86parseModuleSection (void)
xf86addNewLoadDirective (ptr->mod_load_lst, val.str,
XF86_LOAD_MODULE, NULL);
break;
case DISABLE:
if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
Error (QUOTE_MSG, "Disable");
ptr->mod_disable_lst =
xf86addNewLoadDirective (ptr->mod_disable_lst, val.str,
XF86_DISABLE_MODULE, NULL);
break;
case LOAD_DRIVER:
if (xf86getSubToken (&(ptr->mod_comment)) != STRING)
Error (QUOTE_MSG, "LoadDriver");
@@ -257,6 +265,15 @@ xf86freeModules (XF86ConfModulePtr ptr)
lptr = lptr->list.next;
xf86conffree (prev);
}
lptr = ptr->mod_disable_lst;
while (lptr)
{
TestFree (lptr->load_name);
TestFree (lptr->load_comment);
prev = lptr;
lptr = lptr->list.next;
xf86conffree (prev);
}
TestFree (ptr->mod_comment);
xf86conffree (ptr);
}

View File

@@ -82,6 +82,7 @@ XF86ConfFilesRec, *XF86ConfFilesPtr;
/* Values for load_type */
#define XF86_LOAD_MODULE 0
#define XF86_LOAD_DRIVER 1
#define XF86_DISABLE_MODULE 2
typedef struct
{
@@ -97,6 +98,7 @@ XF86LoadRec, *XF86LoadPtr;
typedef struct
{
XF86LoadPtr mod_load_lst;
XF86LoadPtr mod_disable_lst;
char *mod_comment;
}
XF86ConfModuleRec, *XF86ConfModulePtr;

View File

@@ -170,6 +170,7 @@ typedef enum {
/* Module tokens */
LOAD,
LOAD_DRIVER,
DISABLE,
/* Device tokens */
DRIVER,

View File

@@ -32,10 +32,6 @@ Original mi code written by Keith Packard.
#include "xaa.h"
#include "xaalocal.h"
#ifdef ICEILTEMPDECL
ICEILTEMPDECL
#endif
#define DRAW_POINT(pScrn, x, y) \
if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, 1); \
else XAAPointHelper(pScrn, x, y)