diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/ChangeLog /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/ChangeLog --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/ChangeLog 2007-08-16 03:13:14.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/ChangeLog 2007-09-22 04:56:03.000000000 +0300 @@ -1,3 +1,53 @@ +commit 7a124edd1fcc0be6bdad489b0e8d7db3efe44b14 +Author: Aaron Plattner +Date: Fri Sep 21 18:55:21 2007 -0700 + + Bump to 2.1.5. + +commit fee39378ee291a715c607b8600c5380dfa80d97e +Author: Aaron Plattner +Date: Fri Sep 21 15:08:46 2007 -0700 + + Fix stupid, stupid typos reported by Alan Coopersmith. + + Thanks! + +commit 5ca45e600dcea17dba7cf078de49aef3821ea687 +Author: Aaron Plattner +Date: Fri Sep 21 12:16:56 2007 -0700 + + Bump to 2.1.4. + +commit e58504defab08492cc60c36d5dae4f5c4c8c1caa +Author: Aaron Plattner +Date: Mon Sep 17 15:44:52 2007 -0700 + + Fix uninitialized variable warning. + +commit 5b56964a29b326d28bcf3a51e98443d426df58bd +Author: Aaron Plattner +Date: Mon Sep 17 15:41:26 2007 -0700 + + New products. + +commit deff2965ef35260b4b7c4bc23718833bec7143b3 +Author: Aaron Plattner +Date: Mon Sep 17 01:12:02 2007 -0700 + + libpciaccess support. + +commit b2db7d414400d80a5567d71eed9a7e94f1043a20 +Author: Aaron Plattner +Date: Tue Sep 11 22:51:20 2007 -0700 + + G80: Fix LVDS detection on some laptops. + +commit 07fb9f0b00fafe18bd33bddff23cbb4325eb50f8 +Author: Aaron Plattner +Date: Mon Aug 27 12:12:44 2007 -0700 + + Add release.sh to .gitignore. + commit 69f7a57cd9baabbbee7b7665c3c2c2b91c056a04 Author: Aaron Plattner Date: Wed Aug 15 17:12:11 2007 -0700 diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/Makefile.in /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/Makefile.in --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/Makefile.in 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/Makefile.in 2007-09-24 11:15:50.000000000 +0300 @@ -153,6 +153,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/Makefile.in /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/Makefile.in --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/Makefile.in 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/Makefile.in 2007-09-24 11:15:50.000000000 +0300 @@ -106,6 +106,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Crtc.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Crtc.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Crtc.c 2007-07-26 21:46:58.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Crtc.c 2007-09-22 01:41:07.000000000 +0300 @@ -45,13 +45,15 @@ #include "picturestr.h" #endif +#include "xf86xv.h" + /* * Initialize xf86CrtcConfig structure */ int xf86CrtcConfigPrivateIndex = -1; -void +_X_EXPORT void xf86CrtcConfigInit (ScrnInfoPtr scrn, const xf86CrtcConfigFuncsRec *funcs) { @@ -66,7 +68,7 @@ scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config; } -void +_X_EXPORT void xf86CrtcSetSizeRange (ScrnInfoPtr scrn, int minWidth, int minHeight, int maxWidth, int maxHeight) @@ -82,7 +84,7 @@ /* * Crtc functions */ -xf86CrtcPtr +_X_EXPORT xf86CrtcPtr xf86CrtcCreate (ScrnInfoPtr scrn, const xf86CrtcFuncsRec *funcs) { @@ -114,7 +116,7 @@ return crtc; } -void +_X_EXPORT void xf86CrtcDestroy (xf86CrtcPtr crtc) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); @@ -126,7 +128,7 @@ { memmove (&xf86_config->crtc[c], &xf86_config->crtc[c+1], - xf86_config->num_crtc - (c + 1)); + ((xf86_config->num_crtc - (c + 1)) * sizeof(void*))); xf86_config->num_crtc--; break; } @@ -138,7 +140,7 @@ * Return whether any outputs are connected to the specified pipe */ -Bool +_X_EXPORT Bool xf86CrtcInUse (xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; @@ -151,7 +153,7 @@ return FALSE; } -void +_X_EXPORT void xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen) { #ifdef RENDER @@ -219,7 +221,7 @@ /** * Sets the given video mode on the given crtc */ -Bool +_X_EXPORT Bool xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) { @@ -490,7 +492,7 @@ return RR_Rotate_0; } -xf86OutputPtr +_X_EXPORT xf86OutputPtr xf86OutputCreate (ScrnInfoPtr scrn, const xf86OutputFuncsRec *funcs, const char *name) @@ -550,7 +552,7 @@ return output; } -Bool +_X_EXPORT Bool xf86OutputRename (xf86OutputPtr output, const char *name) { int len = strlen(name) + 1; @@ -569,7 +571,7 @@ return TRUE; } -void +_X_EXPORT void xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor) { if (use_screen_monitor != output->use_screen_monitor) @@ -579,7 +581,7 @@ } } -void +_X_EXPORT void xf86OutputDestroy (xf86OutputPtr output) { ScrnInfoPtr scrn = output->scrn; @@ -594,7 +596,7 @@ { memmove (&xf86_config->output[o], &xf86_config->output[o+1], - xf86_config->num_output - (o + 1)); + ((xf86_config->num_output - (o + 1)) * sizeof(void*))); xf86_config->num_output--; break; } @@ -655,7 +657,7 @@ /* * Called at ScreenInit time to set up */ -Bool +_X_EXPORT Bool xf86CrtcScreenInit (ScreenPtr screen) { ScrnInfoPtr scrn = xf86Screens[screen->myNum]; @@ -1212,7 +1214,7 @@ return output; } -void +_X_EXPORT void xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); @@ -1453,10 +1455,10 @@ */ /* XXX where does this function belong? Here? */ -void +_X_EXPORT void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y); -void +_X_EXPORT void xf86SetScrnInfoModes (ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); @@ -1524,7 +1526,7 @@ * accordingly. */ -Bool +_X_EXPORT Bool xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); @@ -1728,7 +1730,7 @@ * modes (used in EnterVT functions, or at server startup) */ -Bool +_X_EXPORT Bool xf86SetDesiredModes (ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); @@ -1808,7 +1810,7 @@ * - Closer in refresh rate to the requested mode. */ -DisplayModePtr +_X_EXPORT DisplayModePtr xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired) { DisplayModePtr best = NULL, scan = NULL; @@ -1871,7 +1873,7 @@ * mode across all outputs that are currently active. */ -Bool +_X_EXPORT Bool xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); @@ -1943,7 +1945,7 @@ * If the new mode is off, it will turn off outputs and then CRTCs. * Otherwise, it will affect CRTCs before outputs. */ -void +_X_EXPORT void xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); @@ -1981,7 +1983,7 @@ * Even for monitors with no DPMS support, by the definition of our DPMS hooks, * the outputs will still get disabled (blanked). */ -Bool +_X_EXPORT Bool xf86SaveScreen(ScreenPtr pScreen, int mode) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -1997,7 +1999,7 @@ /** * Disable all inactive crtcs and outputs */ -void +_X_EXPORT void xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); @@ -2051,7 +2053,7 @@ /** * Set the EDID information for the specified output */ -void +_X_EXPORT void xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) { ScrnInfoPtr scrn = output->scrn; @@ -2117,7 +2119,7 @@ * Return the list of modes supported by the EDID information * stored in 'output' */ -DisplayModePtr +_X_EXPORT DisplayModePtr xf86OutputGetEDIDModes (xf86OutputPtr output) { ScrnInfoPtr scrn = output->scrn; @@ -2128,7 +2130,7 @@ return xf86DDCGetModes(scrn->scrnIndex, edid_mon); } -xf86MonPtr +_X_EXPORT xf86MonPtr xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) { ScrnInfoPtr scrn = output->scrn; @@ -2139,8 +2141,124 @@ static char *_xf86ConnectorNames[] = { "None", "VGA", "DVI-I", "DVI-D", "DVI-A", "Composite", "S-Video", "Component", "LFP", "Proprietary" }; -char * +_X_EXPORT char * xf86ConnectorGetName(xf86ConnectorType connector) { return _xf86ConnectorNames[connector]; } + +static void +x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) +{ + dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1; + dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2; + dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1; + dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2; + + if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2) + dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; +} + +static void +x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) +{ + if (crtc->enabled) { + crtc_box->x1 = crtc->x; + crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); + crtc_box->y1 = crtc->y; + crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); + } else + crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0; +} + +static int +xf86_crtc_box_area(BoxPtr box) +{ + return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1); +} + +/* + * Return the crtc covering 'box'. If two crtcs cover a portion of + * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc + * with greater coverage + */ + +static xf86CrtcPtr +xf86_covering_crtc(ScrnInfoPtr pScrn, + BoxPtr box, + xf86CrtcPtr desired, + BoxPtr crtc_box_ret) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcPtr crtc, best_crtc; + int coverage, best_coverage; + int c; + BoxRec crtc_box, cover_box; + + best_crtc = NULL; + best_coverage = 0; + crtc_box_ret->x1 = 0; + crtc_box_ret->x2 = 0; + crtc_box_ret->y1 = 0; + crtc_box_ret->y2 = 0; + for (c = 0; c < xf86_config->num_crtc; c++) { + crtc = xf86_config->crtc[c]; + x86_crtc_box(crtc, &crtc_box); + x86_crtc_box_intersect(&cover_box, &crtc_box, box); + coverage = xf86_crtc_box_area(&cover_box); + if (coverage && crtc == desired) { + *crtc_box_ret = crtc_box; + return crtc; + } else if (coverage > best_coverage) { + *crtc_box_ret = crtc_box; + best_crtc = crtc; + best_coverage = coverage; + } + } + return best_crtc; +} + +/* + * For overlay video, compute the relevant CRTC and + * clip video to that + */ + +_X_EXPORT Bool +xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, + xf86CrtcPtr *crtc_ret, + xf86CrtcPtr desired_crtc, + BoxPtr dst, + INT32 *xa, + INT32 *xb, + INT32 *ya, + INT32 *yb, + RegionPtr reg, + INT32 width, + INT32 height) +{ + Bool ret; + RegionRec crtc_region_local; + RegionPtr crtc_region = reg; + + if (crtc_ret) { + BoxRec crtc_box; + xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst, + desired_crtc, + &crtc_box); + + if (crtc) { + REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1); + crtc_region = &crtc_region_local; + REGION_INTERSECT (pScreen, crtc_region, crtc_region, reg); + } + *crtc_ret = crtc; + } + + ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb, + crtc_region, width, height); + + if (crtc_region != reg) + REGION_UNINIT (pScreen, &crtc_region_local); + + return ret; +} diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Crtc.h /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Crtc.h --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Crtc.h 2007-07-26 21:47:37.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Crtc.h 2007-09-22 01:41:07.000000000 +0300 @@ -765,5 +765,24 @@ */ void xf86_cursors_fini (ScreenPtr screen); + +/* + * For overlay video, compute the relevant CRTC and + * clip video to that. + * wraps xf86XVClipVideoHelper() + */ + +Bool +xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, + xf86CrtcPtr *crtc_ret, + xf86CrtcPtr desired_crtc, + BoxPtr dst, + INT32 *xa, + INT32 *xb, + INT32 *ya, + INT32 *yb, + RegionPtr reg, + INT32 width, + INT32 height); #endif /* _XF86CRTC_H_ */ diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Cursors.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Cursors.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Cursors.c 2007-07-31 23:45:42.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Cursors.c 2007-09-22 01:41:07.000000000 +0300 @@ -256,7 +256,7 @@ } } -void +_X_EXPORT void xf86_hide_cursors (ScrnInfoPtr scrn) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); @@ -282,7 +282,7 @@ } } -void +_X_EXPORT void xf86_show_cursors (ScrnInfoPtr scrn) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); @@ -447,7 +447,10 @@ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + if (xf86_config->cursor) + FreeCursor (xf86_config->cursor, None); xf86_config->cursor = cursor; + ++cursor->refcnt; if (cursor->bits->width > cursor_info->MaxWidth || cursor->bits->height> cursor_info->MaxHeight) @@ -463,7 +466,10 @@ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + if (xf86_config->cursor) + FreeCursor (xf86_config->cursor, None); xf86_config->cursor = cursor; + ++cursor->refcnt; /* Make sure ARGB support is available */ if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0) @@ -522,7 +528,7 @@ } } -Bool +_X_EXPORT Bool xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags) { ScrnInfoPtr scrn = xf86Screens[screen->myNum]; @@ -573,7 +579,7 @@ * Reloads cursor images as needed, then adjusts cursor positions */ -void +_X_EXPORT void xf86_reload_cursors (ScreenPtr screen) { ScrnInfoPtr scrn; @@ -616,7 +622,7 @@ /** * Clean up CRTC-based cursor code */ -void +_X_EXPORT void xf86_cursors_fini (ScreenPtr screen) { ScrnInfoPtr scrn = xf86Screens[screen->myNum]; @@ -632,4 +638,9 @@ xfree (xf86_config->cursor_image); xf86_config->cursor_image = NULL; } + if (xf86_config->cursor) + { + FreeCursor (xf86_config->cursor, None); + xf86_config->cursor = NULL; + } } diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86DiDGA.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86DiDGA.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86DiDGA.c 2007-07-26 20:54:28.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86DiDGA.c 2007-09-22 01:41:07.000000000 +0300 @@ -255,7 +255,7 @@ NULL }; -Bool +_X_EXPORT Bool xf86DiDGAReInit (ScreenPtr pScreen) { ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; @@ -267,7 +267,7 @@ return DGAReInitModes (pScreen, xf86_config->dga_modes, xf86_config->dga_nmode); } -Bool +_X_EXPORT Bool xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address) { ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86EdidModes.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86EdidModes.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86EdidModes.c 2007-08-13 22:23:17.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86EdidModes.c 2007-09-22 01:41:07.000000000 +0300 @@ -303,7 +303,7 @@ } } -DisplayModePtr +_X_EXPORT DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC) { int preferred, i; @@ -389,7 +389,7 @@ /* * Fill out MonPtr with xf86MonPtr information. */ -void +_X_EXPORT void xf86DDCMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC) { DisplayModePtr Modes = NULL, Mode; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Modes.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Modes.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Modes.c 2007-07-26 20:54:28.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Modes.c 2007-09-22 01:41:07.000000000 +0300 @@ -49,7 +49,7 @@ * * Exact copy of xf86Mode.c's. */ -double +_X_EXPORT double xf86ModeHSync(DisplayModePtr mode) { double hsync = 0.0; @@ -67,7 +67,7 @@ * * Exact copy of xf86Mode.c's. */ -double +_X_EXPORT double xf86ModeVRefresh(DisplayModePtr mode) { double refresh = 0.0; @@ -86,7 +86,7 @@ return refresh; } -int +_X_EXPORT int xf86ModeWidth (DisplayModePtr mode, Rotation rotation) { switch (rotation & 0xf) { @@ -101,7 +101,7 @@ } } -int +_X_EXPORT int xf86ModeHeight (DisplayModePtr mode, Rotation rotation) { switch (rotation & 0xf) { @@ -117,7 +117,7 @@ } /** Sets a default mode name of x on a mode. */ -void +_X_EXPORT void xf86SetModeDefaultName(DisplayModePtr mode) { if (mode->name != NULL) @@ -134,7 +134,7 @@ * * Exact copy of xf86Mode.c's. */ -void +_X_EXPORT void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags) { if ((p == NULL) || ((p->type & M_T_CRTC_C) == M_T_BUILTIN)) @@ -185,7 +185,7 @@ /** * Allocates and returns a copy of pMode, including pointers within pMode. */ -DisplayModePtr +_X_EXPORT DisplayModePtr xf86DuplicateMode(DisplayModePtr pMode) { DisplayModePtr pNew; @@ -209,7 +209,7 @@ * * \param modeList doubly-linked mode list */ -DisplayModePtr +_X_EXPORT DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList) { DisplayModePtr first = NULL, last = NULL; @@ -243,7 +243,7 @@ * * This isn't in xf86Modes.c, but it might deserve to be there. */ -Bool +_X_EXPORT Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2) { if (pMode1->Clock == pMode2->Clock && @@ -279,7 +279,7 @@ * * Convenient VRefresh printing was added, though, compared to xf86Mode.c */ -void +_X_EXPORT void xf86PrintModeline(int scrnIndex,DisplayModePtr mode) { char tmp[256]; @@ -327,7 +327,7 @@ * * This is not in xf86Modes.c, but would be part of the proposed new API. */ -void +_X_EXPORT void xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList, int flags) { @@ -348,7 +348,7 @@ * * This is not in xf86Modes.c, but would be part of the proposed new API. */ -void +_X_EXPORT void xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList, int maxX, int maxY, int maxPitch) { @@ -377,7 +377,7 @@ * * This is not in xf86Modes.c, but would be part of the proposed new API. */ -void +_X_EXPORT void xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList, MonPtr mon) { @@ -424,7 +424,7 @@ * * This is not in xf86Modes.c, but would be part of the proposed new API. */ -void +_X_EXPORT void xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList, int *min, int *max, int n_ranges) { @@ -458,7 +458,7 @@ * * This is not in xf86Modes.c, but would be part of the proposed new API. */ -void +_X_EXPORT void xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList) { DisplayModePtr mode; @@ -492,7 +492,7 @@ * * This is not in xf86Modes.c, but would be part of the proposed new API. */ -void +_X_EXPORT void xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr *modeList, Bool verbose) { @@ -526,7 +526,7 @@ * * \param modes doubly-linked mode list. */ -DisplayModePtr +_X_EXPORT DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new) { if (modes == NULL) @@ -592,7 +592,7 @@ /** * Build a mode list from a monitor configuration */ -DisplayModePtr +_X_EXPORT DisplayModePtr xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor) { DisplayModePtr modes = NULL; @@ -624,7 +624,7 @@ /** * Build a mode list containing all of the default modes */ -DisplayModePtr +_X_EXPORT DisplayModePtr xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed) { DisplayModePtr head = NULL, prev = NULL, mode; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86RandR12.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86RandR12.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86RandR12.c 2007-08-13 22:23:17.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86RandR12.c 2007-09-22 01:41:07.000000000 +0300 @@ -244,7 +244,7 @@ return ret; } -Bool +_X_EXPORT Bool xf86RandR12SetConfig (ScreenPtr pScreen, Rotation rotation, int rate, @@ -345,7 +345,7 @@ randrp->virtualX = pScrn->virtualX; randrp->virtualY = pScrn->virtualY; } - if (pRoot) + if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE); /* Let the driver update virtualX and virtualY */ @@ -363,7 +363,7 @@ xf86SetViewport (pScreen, 0, 0); finish: - if (pRoot) + if (pRoot && pScrn->vtSema) (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE); #if RANDR_12_INTERFACE if (WindowTable[pScreen->myNum] && ret) @@ -372,7 +372,7 @@ return ret; } -Rotation +_X_EXPORT Rotation xf86RandR12GetRotation(ScreenPtr pScreen) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); @@ -380,7 +380,7 @@ return randrp->rotation; } -Bool +_X_EXPORT Bool xf86RandR12CreateScreenResources (ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -470,7 +470,7 @@ } -Bool +_X_EXPORT Bool xf86RandR12Init (ScreenPtr pScreen) { rrScrPrivPtr rp; @@ -520,7 +520,7 @@ return TRUE; } -void +_X_EXPORT void xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotations) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); @@ -538,7 +538,7 @@ randrp->supported_rotations = rotations; } -void +_X_EXPORT void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y) { ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; @@ -1072,7 +1072,7 @@ * to DGA, VidMode or hot key. Tell RandR */ -void +_X_EXPORT void xf86RandR12TellChanged (ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; @@ -1122,7 +1122,7 @@ #endif -Bool +_X_EXPORT Bool xf86RandR12PreInit (ScrnInfoPtr pScrn) { return TRUE; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Rotate.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Rotate.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/compat/modes/xf86Rotate.c 2007-07-26 20:54:29.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/compat/modes/xf86Rotate.c 2007-09-22 01:41:07.000000000 +0300 @@ -478,7 +478,7 @@ } } -void +_X_EXPORT void xf86RotateCloseScreen (ScreenPtr screen) { ScrnInfoPtr scrn = xf86Screens[screen->myNum]; @@ -489,7 +489,7 @@ xf86RotateDestroy (xf86_config->crtc[c]); } -Bool +_X_EXPORT Bool xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) { ScrnInfoPtr pScrn = crtc->scrn; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/config.guess /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/config.guess --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/config.guess 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/config.guess 2007-09-24 11:15:50.000000000 +0300 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2007-03-06' +timestamp='2007-07-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -330,7 +330,7 @@ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:*) + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -793,7 +793,7 @@ exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in - x86) + x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/config.sub /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/config.sub --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/config.sub 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/config.sub 2007-09-24 11:15:50.000000000 +0300 @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2007-01-18' +timestamp='2007-06-28' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -475,8 +475,8 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16c) - basic_machine=cr16c-unknown + cr16) + basic_machine=cr16-unknown os=-elf ;; crds | unos) @@ -683,6 +683,10 @@ basic_machine=i386-pc os=-mingw32 ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent ;; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/configure /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/configure --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/configure 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/configure 2007-09-24 11:15:50.000000000 +0300 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for xf86-video-nv 2.1.3. +# Generated by GNU Autoconf 2.61 for xf86-video-nv 2.1.5. # # Report bugs to . # @@ -728,8 +728,8 @@ # Identity of this package. PACKAGE_NAME='xf86-video-nv' PACKAGE_TARNAME='xf86-video-nv' -PACKAGE_VERSION='2.1.3' -PACKAGE_STRING='xf86-video-nv 2.1.3' +PACKAGE_VERSION='2.1.5' +PACKAGE_STRING='xf86-video-nv 2.1.5' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' ac_unique_file="Makefile.am" @@ -877,6 +877,8 @@ PKG_CONFIG XORG_CFLAGS XORG_LIBS +PCIACCESS_CFLAGS +PCIACCESS_LIBS BUILD_XMODES_TRUE BUILD_XMODES_FALSE XMODES_CFLAGS @@ -916,7 +918,9 @@ FFLAGS PKG_CONFIG XORG_CFLAGS -XORG_LIBS' +XORG_LIBS +PCIACCESS_CFLAGS +PCIACCESS_LIBS' # Initialize some variables set by options. @@ -1419,7 +1423,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xf86-video-nv 2.1.3 to adapt to many kinds of systems. +\`configure' configures xf86-video-nv 2.1.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1489,7 +1493,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-video-nv 2.1.3:";; + short | recursive ) echo "Configuration of xf86-video-nv 2.1.5:";; esac cat <<\_ACEOF @@ -1538,6 +1542,10 @@ PKG_CONFIG path to pkg-config utility XORG_CFLAGS C compiler flags for XORG, overriding pkg-config XORG_LIBS linker flags for XORG, overriding pkg-config + PCIACCESS_CFLAGS + C compiler flags for PCIACCESS, overriding pkg-config + PCIACCESS_LIBS + linker flags for PCIACCESS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -1603,7 +1611,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-video-nv configure 2.1.3 +xf86-video-nv configure 2.1.5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1617,7 +1625,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xf86-video-nv $as_me 2.1.3, which was +It was created by xf86-video-nv $as_me 2.1.5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2312,7 +2320,7 @@ # Define the identity of the package. PACKAGE='xf86-video-nv' - VERSION='2.1.3' + VERSION='2.1.5' cat >>confdefs.h <<_ACEOF @@ -4381,7 +4389,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4384 "configure"' > conftest.$ac_ext + echo '#line 4392 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7123,11 +7131,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7126: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7134: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7130: \$? = $ac_status" >&5 + echo "$as_me:7138: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7413,11 +7421,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7416: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7424: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7420: \$? = $ac_status" >&5 + echo "$as_me:7428: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7517,11 +7525,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7520: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7528: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7524: \$? = $ac_status" >&5 + echo "$as_me:7532: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9879,7 +9887,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12410: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12406: \$? = $ac_status" >&5 + echo "$as_me:12414: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12503,11 +12511,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12506: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12514: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12510: \$? = $ac_status" >&5 + echo "$as_me:12518: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14080,11 +14088,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14083: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14091: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14087: \$? = $ac_status" >&5 + echo "$as_me:14095: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14184,11 +14192,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14187: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14195: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14191: \$? = $ac_status" >&5 + echo "$as_me:14199: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16384,11 +16392,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16387: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16395: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16391: \$? = $ac_status" >&5 + echo "$as_me:16399: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16674,11 +16682,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16677: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16685: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16681: \$? = $ac_status" >&5 + echo "$as_me:16689: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16778,11 +16786,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16781: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16789: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16785: \$? = $ac_status" >&5 + echo "$as_me:16793: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -20898,6 +20906,8 @@ save_CFLAGS="$CFLAGS" CFLAGS="$XORG_CFLAGS" + +# RandR 1.2 { echo "$as_me:$LINENO: checking for xf86Modes.h" >&5 echo $ECHO_N "checking for xf86Modes.h... $ECHO_C" >&6; } if test "${ac_cv_header_xf86Modes_h+set}" = set; then @@ -20949,7 +20959,183 @@ fi + +# PCI rework +{ echo "$as_me:$LINENO: checking whether XSERVER_LIBPCIACCESS is declared" >&5 +echo $ECHO_N "checking whether XSERVER_LIBPCIACCESS is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_XSERVER_LIBPCIACCESS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include "xorg-server.h" + +int +main () +{ +#ifndef XSERVER_LIBPCIACCESS + (void) XSERVER_LIBPCIACCESS; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_XSERVER_LIBPCIACCESS=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_XSERVER_LIBPCIACCESS=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_XSERVER_LIBPCIACCESS" >&5 +echo "${ECHO_T}$ac_cv_have_decl_XSERVER_LIBPCIACCESS" >&6; } +if test $ac_cv_have_decl_XSERVER_LIBPCIACCESS = yes; then + XSERVER_LIBPCIACCESS=yes +else + XSERVER_LIBPCIACCESS=no +fi + +if test "x$XSERVER_LIBPCIACCESS" = "xyes"; then + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for PCIACCESS" >&5 +echo $ECHO_N "checking for PCIACCESS... $ECHO_C" >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$PCIACCESS_CFLAGS"; then + pkg_cv_PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.8.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.8.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_PCIACCESS_CFLAGS=`$PKG_CONFIG --cflags "pciaccess >= 0.8.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$PCIACCESS_LIBS"; then + pkg_cv_PCIACCESS_LIBS="$PCIACCESS_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.8.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.8.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_PCIACCESS_LIBS=`$PKG_CONFIG --libs "pciaccess >= 0.8.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "pciaccess >= 0.8.0"` + else + PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pciaccess >= 0.8.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$PCIACCESS_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (pciaccess >= 0.8.0) were not met: + +$PCIACCESS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables PCIACCESS_CFLAGS +and PCIACCESS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (pciaccess >= 0.8.0) were not met: + +$PCIACCESS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables PCIACCESS_CFLAGS +and PCIACCESS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables PCIACCESS_CFLAGS +and PCIACCESS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables PCIACCESS_CFLAGS +and PCIACCESS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + PCIACCESS_CFLAGS=$pkg_cv_PCIACCESS_CFLAGS + PCIACCESS_LIBS=$pkg_cv_PCIACCESS_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + : +fi +fi + CFLAGS="$save_CFLAGS" + if test "x$BUILD_XMODES" = xyes; then BUILD_XMODES_TRUE= BUILD_XMODES_FALSE='#' @@ -21563,7 +21749,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-video-nv $as_me 2.1.3, which was +This file was extended by xf86-video-nv $as_me 2.1.5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21616,7 +21802,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xf86-video-nv config.status 2.1.3 +xf86-video-nv config.status 2.1.5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -21947,6 +22133,8 @@ PKG_CONFIG!$PKG_CONFIG$ac_delim XORG_CFLAGS!$XORG_CFLAGS$ac_delim XORG_LIBS!$XORG_LIBS$ac_delim +PCIACCESS_CFLAGS!$PCIACCESS_CFLAGS$ac_delim +PCIACCESS_LIBS!$PCIACCESS_LIBS$ac_delim BUILD_XMODES_TRUE!$BUILD_XMODES_TRUE$ac_delim BUILD_XMODES_FALSE!$BUILD_XMODES_FALSE$ac_delim XMODES_CFLAGS!$XMODES_CFLAGS$ac_delim @@ -21970,7 +22158,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 32; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 34; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/configure.ac /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/configure.ac --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/configure.ac 2007-08-16 03:12:05.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/configure.ac 2007-09-22 04:55:12.000000000 +0300 @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-nv], - 2.1.3, + 2.1.5, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-nv) @@ -70,8 +70,20 @@ save_CFLAGS="$CFLAGS" CFLAGS="$XORG_CFLAGS" + +# RandR 1.2 AC_CHECK_HEADER(xf86Modes.h,[BUILD_XMODES=no],[BUILD_XMODES=yes],[#include "xorg-server.h"]) + +# PCI rework +AC_CHECK_DECL(XSERVER_LIBPCIACCESS, + [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no], + [#include "xorg-server.h"]) +if test "x$XSERVER_LIBPCIACCESS" = "xyes"; then + PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.8.0]) +fi + CFLAGS="$save_CFLAGS" + AM_CONDITIONAL(BUILD_XMODES, test "x$BUILD_XMODES" = xyes) if test "x$XSERVER_SOURCE" != x; then if test -d "$XSERVER_SOURCE"; then diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/changelog /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/changelog --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/changelog 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/changelog 2007-09-24 11:15:50.000000000 +0300 @@ -1,3 +1,48 @@ +xserver-xorg-video-nv (1:2.1.5-1ubuntu1) gutsy; urgency=low + + * debian/control: + - Ease the Build-Depends on xserver-xorg-dev so it builds. + - Change Maintainer-address. + + -- Timo Aaltonen Mon, 24 Sep 2007 11:12:38 +0300 + +xserver-xorg-video-nv (1:2.1.5-1) unstable; urgency=low + + * New upstream release. + + -- Julien Cristau Sat, 22 Sep 2007 09:54:06 +0200 + +xserver-xorg-video-nv (1:2.1.3-5) unstable; urgency=low + + * Upload to unstable + + -- David Nusinow Sun, 16 Sep 2007 15:43:46 -0400 + +xserver-xorg-video-nv (1:2.1.3-4) experimental; urgency=low + + * Build against xserver 1.4. + * Add upstream URL to debian/copyright. + * Add myself to Uploaders. + + -- Brice Goglin Thu, 13 Sep 2007 23:00:29 +0200 + +xserver-xorg-video-nv (1:2.1.3-3) experimental; urgency=low + + * Add quilt to build-depends + + -- David Nusinow Sun, 19 Aug 2007 15:02:48 -0400 + +xserver-xorg-video-nv (1:2.1.3-2) experimental; urgency=low + + * Build against X server 1.3.99.0 (build-dep on it) + * Add 01_gen_pci_ids.diff. This will ship a set of pci ids that this driver + supports so that the server can automatically load it under the right + conditions. + + Enable our patch system in debian/rules + + autoreconf because this patch touches src/Makefile.am + + -- David Nusinow Sun, 19 Aug 2007 12:20:31 -0400 + xserver-xorg-video-nv (1:2.1.3-1) unstable; urgency=low [ Julien Cristau ] diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/control /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/control --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/control 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/control 2007-09-24 11:15:50.000000000 +0300 @@ -1,9 +1,10 @@ Source: xserver-xorg-video-nv Section: x11 Priority: optional -Maintainer: Debian X Strike Force -Uploaders: David Nusinow , Julien Cristau -Build-Depends: debhelper (>= 5.0.0), pkg-config, xserver-xorg-dev (>= 2:1.2.99.902), x11proto-video-dev, x11proto-core-dev, x11proto-fonts-dev, x11proto-randr-dev (>= 1.2), x11proto-render-dev, x11proto-xext-dev +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Debian X Strike Force +Uploaders: David Nusinow , Julien Cristau , Brice Goglin +Build-Depends: debhelper (>= 5.0.0), pkg-config, quilt, xserver-xorg-dev (>= 2:1.3.0.0), x11proto-video-dev, x11proto-core-dev, x11proto-fonts-dev, x11proto-randr-dev (>= 1.2), x11proto-render-dev, x11proto-xext-dev Standards-Version: 3.7.2.2 XS-Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-video-nv XS-Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-nv.git diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/copyright /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/copyright --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/copyright 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/copyright 2007-09-24 11:15:50.000000000 +0300 @@ -1,3 +1,6 @@ +This package was downloaded from +http://xorg.freedesktop.org/releases/individual/driver/ + Copyright (c) 2007 NVIDIA, Corporation Permission is hereby granted, free of charge, to any person obtaining a diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/patches/01_gen_pci_ids.diff /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/patches/01_gen_pci_ids.diff --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/patches/01_gen_pci_ids.diff 1970-01-01 02:00:00.000000000 +0200 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/patches/01_gen_pci_ids.diff 2007-09-24 11:15:50.000000000 +0300 @@ -0,0 +1,14 @@ +Index: xserver-xorg-video-nv/src/Makefile.am +=================================================================== +--- xserver-xorg-video-nv.orig/src/Makefile.am 2007-08-19 12:15:48.000000000 -0400 ++++ xserver-xorg-video-nv/src/Makefile.am 2007-08-19 12:16:58.000000000 -0400 +@@ -104,3 +104,9 @@ + EXTRA_nv_drv_la_SOURCES = local_xf86Rename.h + nodist_nv_drv_la_SOURCES = $(xmode_sources) + endif ++ ++pcidatadir = $(datadir)/xserver-xorg/pci ++pcidata_DATA = nv.ids ++ ++nv.ids : nv_driver.c ++ awk '/{ 0x.*/ {print $$2}' ${srcdir}/nv_driver.c | sed -e s/0x// -e s/,// > nv.ids diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/patches/series /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/patches/series --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/patches/series 1970-01-01 02:00:00.000000000 +0200 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/patches/series 2007-09-24 11:15:50.000000000 +0300 @@ -0,0 +1 @@ +01_gen_pci_ids.diff diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/rules /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/rules --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/rules 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/rules 2007-09-24 11:15:50.000000000 +0300 @@ -31,7 +31,7 @@ # kbd_drv.a isn't phenomenally useful; kbd_drv.so more so confflags += --disable-static -build: build-stamp +build: patch build-stamp build-stamp: dh_testdir @@ -44,7 +44,7 @@ touch build-stamp -clean: +clean: xsfclean dh_testdir dh_testroot rm -f build-stamp diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/xserver-xorg-video-nv.install /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/xserver-xorg-video-nv.install --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/xserver-xorg-video-nv.install 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/xserver-xorg-video-nv.install 2007-09-24 11:15:50.000000000 +0300 @@ -1,2 +1,3 @@ usr/lib/xorg/modules/drivers/*.so usr/share/man/man4/* +usr/share/xserver-xorg/pci/* diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/xsfbs/xsfbs.sh /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/xsfbs/xsfbs.sh --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/debian/xsfbs/xsfbs.sh 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/debian/xsfbs/xsfbs.sh 2007-09-24 11:15:50.000000000 +0300 @@ -59,13 +59,6 @@ ARCHITECTURE="$(dpkg --print-installation-architecture)" -LAPTOP="" -if [ -n "$(which laptop-detect)" ]; then - if laptop-detect >/dev/null; then - LAPTOP=true - fi -fi - if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then RECONFIGURE="true" else diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/man/Makefile.in /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/man/Makefile.in --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/man/Makefile.in 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/man/Makefile.in 2007-09-24 11:15:50.000000000 +0300 @@ -143,6 +143,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = sed diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/Makefile.in /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/Makefile.in --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/Makefile.in 2007-09-24 11:15:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/Makefile.in 2007-09-24 11:15:50.000000000 +0300 @@ -34,6 +34,7 @@ # 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. + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -67,7 +68,8 @@ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(nv_drv_ladir)" +am__installdirs = "$(DESTDIR)$(nv_drv_ladir)" \ + "$(DESTDIR)$(pcidatadir)" nv_drv_laLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(nv_drv_la_LTLIBRARIES) nv_drv_la_LIBADD = @@ -104,6 +106,8 @@ $(nodist_nv_drv_la_SOURCES) DIST_SOURCES = $(nv_drv_la_SOURCES) \ $(am__EXTRA_nv_drv_la_SOURCES_DIST) +pcidataDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pcidata_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -170,6 +174,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ @@ -317,6 +323,8 @@ @BUILD_XMODES_TRUE@EXTRA_nv_drv_la_SOURCES = local_xf86Rename.h @BUILD_XMODES_TRUE@nodist_nv_drv_la_SOURCES = $(xmode_sources) +pcidatadir = $(datadir)/xserver-xorg/pci +pcidata_DATA = nv.ids all: all-am .SUFFIXES: @@ -503,6 +511,23 @@ clean-libtool: -rm -rf .libs _libs +install-pcidataDATA: $(pcidata_DATA) + @$(NORMAL_INSTALL) + test -z "$(pcidatadir)" || $(MKDIR_P) "$(DESTDIR)$(pcidatadir)" + @list='$(pcidata_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pcidataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pcidatadir)/$$f'"; \ + $(pcidataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pcidatadir)/$$f"; \ + done + +uninstall-pcidataDATA: + @$(NORMAL_UNINSTALL) + @list='$(pcidata_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pcidatadir)/$$f'"; \ + rm -f "$(DESTDIR)$(pcidatadir)/$$f"; \ + done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -580,9 +605,9 @@ done check-am: all-am check: check-am -all-am: Makefile $(LTLIBRARIES) +all-am: Makefile $(LTLIBRARIES) $(DATA) installdirs: - for dir in "$(DESTDIR)$(nv_drv_ladir)"; do \ + for dir in "$(DESTDIR)$(nv_drv_ladir)" "$(DESTDIR)$(pcidatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -630,7 +655,7 @@ info-am: -install-data-am: install-nv_drv_laLTLIBRARIES +install-data-am: install-nv_drv_laLTLIBRARIES install-pcidataDATA install-dvi: install-dvi-am @@ -666,7 +691,7 @@ ps-am: -uninstall-am: uninstall-nv_drv_laLTLIBRARIES +uninstall-am: uninstall-nv_drv_laLTLIBRARIES uninstall-pcidataDATA .MAKE: install-am install-strip @@ -677,13 +702,17 @@ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ - install-nv_drv_laLTLIBRARIES install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + install-nv_drv_laLTLIBRARIES install-pcidataDATA install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-nv_drv_laLTLIBRARIES + tags uninstall uninstall-am uninstall-nv_drv_laLTLIBRARIES \ + uninstall-pcidataDATA + +nv.ids : nv_driver.c + awk '/{ 0x.*/ {print $$2}' ${srcdir}/nv_driver.c | sed -e s/0x// -e s/,// > nv.ids # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/g80_display.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/g80_display.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/g80_display.c 2007-07-25 07:19:30.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/g80_display.c 2007-09-18 01:41:56.000000000 +0300 @@ -514,6 +514,7 @@ int outX, outY; switch(scale) { + default: case G80_SCALE_ASPECT: ComputeAspectScale(mode, &outX, &outY); break; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/g80_driver.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/g80_driver.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/g80_driver.c 2007-07-10 11:51:38.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/g80_driver.c 2007-09-18 01:06:56.000000000 +0300 @@ -188,8 +188,14 @@ { G80Ptr pNv; EntityInfoPtr pEnt; +#if XSERVER_LIBPCIACCESS + struct pci_device *pPci; + int err; + void *p; +#else pciVideoPtr pPci; PCITAG pcitag; +#endif MessageType from; Bool primary; const rgb zeros = {0, 0, 0}; @@ -218,13 +224,22 @@ pEnt = xf86GetEntityInfo(pScrn->entityList[0]); if(pEnt->location.type != BUS_PCI) goto fail; pPci = xf86GetPciInfoForEntity(pEnt->index); - pcitag = pciTag(pPci->bus, pPci->device, pPci->func); +#if XSERVER_LIBPCIACCESS + /* Need this to unmap */ + pNv->pPci = pPci; +#endif primary = xf86IsPrimaryPci(pPci); /* The ROM size sometimes isn't read correctly, so fix it up here. */ +#if XSERVER_LIBPCIACCESS + if(pPci->rom_size == 0) + /* The BIOS is 64k */ + pPci->rom_size = 64 * 1024; +#else if(pPci->biosSize == 0) /* The BIOS is 64k */ pPci->biosSize = 16; +#endif pNv->int10 = NULL; pNv->int10Mode = 0; @@ -324,16 +339,24 @@ if(!xf86SetGamma(pScrn, gzeros)) goto fail; /* Map memory */ - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "MMIO registers at 0x%lx\n", - pPci->memBase[0]); - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Linear framebuffer at 0x%lx\n", - pPci->memBase[1]); - pScrn->memPhysBase = pPci->memBase[1]; + pScrn->memPhysBase = MEMBASE(pPci, 1); pScrn->fbOffset = 0; +#if XSERVER_LIBPCIACCESS + err = pci_device_map_range(pPci, pPci->regions[0].base_addr, G80_REG_SIZE, + PCI_DEV_MAP_FLAG_WRITABLE, &p); + if(err) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to map MMIO registers: %s\n", strerror(err)); + goto fail; + } + pNv->reg = p; +#else + pcitag = pciTag(pPci->bus, pPci->device, pPci->func); pNv->reg = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, pcitag, pPci->memBase[0], G80_REG_SIZE); +#endif xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MMIO registers mapped at %p\n", (void*)pNv->reg); @@ -349,7 +372,11 @@ /* Determine the size of BAR1 */ /* Some configs have BAR1 < total RAM < 256 MB */ +#if XSERVER_LIBPCIACCESS + BAR1sizeKB = pPci->regions[1].size / 1024; +#else BAR1sizeKB = 1UL << (pPci->size[1] - 10); +#endif if(BAR1sizeKB > 256 * 1024) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "BAR1 is > 256 MB, which is " "probably wrong. Clamping to 256 MB.\n"); @@ -375,9 +402,23 @@ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, " Mapped memory: %.1f MB\n", pScrn->videoRam / 1024.0); +#if XSERVER_LIBPCIACCESS + err = pci_device_map_range(pPci, pPci->regions[1].base_addr, + pScrn->videoRam * 1024, + PCI_DEV_MAP_FLAG_WRITABLE | + PCI_DEV_MAP_FLAG_WRITE_COMBINE, + &p); + if(err) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to map framebuffer: %s\n", strerror(err)); + goto fail; + } + pNv->mem = p; +#else pNv->mem = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, pcitag, pPci->memBase[1], pScrn->videoRam * 1024); +#endif xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Linear framebuffer mapped at %p\n", (void*)pNv->mem); @@ -520,8 +561,13 @@ if(xf86ServerIsExiting()) { if(pNv->int10) xf86FreeInt10(pNv->int10); +#if XSERVER_LIBPCIACCESS + pci_device_unmap_range(pNv->pPci, pNv->mem, pNv->videoRam * 1024); + pci_device_unmap_range(pNv->pPci, (void*)pNv->reg, G80_REG_SIZE); +#else xf86UnMapVidMem(pScrn->scrnIndex, pNv->mem, pNv->videoRam * 1024); xf86UnMapVidMem(pScrn->scrnIndex, (void*)pNv->reg, G80_REG_SIZE); +#endif pNv->reg = NULL; pNv->mem = NULL; } diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/g80_output.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/g80_output.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/g80_output.c 2007-07-25 07:19:30.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/g80_output.c 2007-09-12 08:11:30.000000000 +0300 @@ -66,10 +66,11 @@ port = (b >> 4) & 0xf; or = ffs((b >> 24) & 0xf) - 1; - if(type < 4 && port != 0xf) { + if(type == 0xe) break; + + if(type < 4) { switch(type) { case 0: /* CRT */ - case 1: /* TV */ if(pNv->i2cMap[port].dac != -1) { xf86DrvMsg(scrnIndex, X_WARNING, "DDC routing table corrupt! DAC %i -> %i " @@ -78,21 +79,30 @@ } pNv->i2cMap[port].dac = or; break; + case 1: /* TV */ + /* Ignore TVs */ + break; + case 2: /* TMDS */ - case 3: /* LVDS */ if(pNv->i2cMap[port].sor != -1) xf86DrvMsg(scrnIndex, X_WARNING, "DDC routing table corrupt! SOR %i -> %i " "for port %i\n", or, pNv->i2cMap[port].sor, port); pNv->i2cMap[port].sor = or; - pNv->i2cMap[port].panelType = (type == 2) ? TMDS : LVDS; + break; + + case 3: /* LVDS */ + pNv->lvds.present = TRUE; + pNv->lvds.or = or; break; } } } - xf86DrvMsg(scrnIndex, X_PROBED, "I2C map:\n"); + xf86DrvMsg(scrnIndex, X_PROBED, "Connector map:\n"); + if(pNv->lvds.present) + xf86DrvMsg(scrnIndex, X_PROBED, " [N/A] -> SOR%i (LVDS)\n", pNv->lvds.or); for(i = 0; i < 4; i++) { if(pNv->i2cMap[i].dac != -1) xf86DrvMsg(scrnIndex, X_PROBED, " Bus %i -> DAC%i\n", i, pNv->i2cMap[i].dac); @@ -315,8 +325,7 @@ if(pNv->i2cMap[i].dac != -1) dac = G80CreateDac(pScrn, pNv->i2cMap[i].dac); if(pNv->i2cMap[i].sor != -1) - sor = G80CreateSor(pScrn, pNv->i2cMap[i].sor, - pNv->i2cMap[i].panelType); + sor = G80CreateSor(pScrn, pNv->i2cMap[i].sor, TMDS); if(dac) { G80OutputPrivPtr pPriv = dac->driver_private; @@ -334,6 +343,13 @@ } } + if(pNv->lvds.present) { + xf86OutputPtr lvds = G80CreateSor(pScrn, pNv->lvds.or, LVDS); + G80OutputPrivPtr pPriv = lvds->driver_private; + + pPriv->scale = G80_SCALE_ASPECT; + } + /* For each output, set the crtc and clone masks */ for(i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/g80_type.h /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/g80_type.h --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/g80_type.h 2007-07-10 11:51:38.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/g80_type.h 2007-09-17 23:41:44.000000000 +0300 @@ -36,6 +36,9 @@ } AccelMethod; typedef struct G80Rec { +#if XSERVER_LIBPCIACCESS + struct pci_device *pPci; +#endif volatile CARD32 * reg; unsigned char * mem; @@ -48,8 +51,11 @@ struct { ORNum dac; ORNum sor; - PanelType panelType; } i2cMap[4]; + struct { + Bool present; + ORNum or; + } lvds; xf86Int10InfoPtr int10; int int10Mode; /* Console mode to restore */ diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_const.h /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_const.h --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_const.h 2007-07-25 07:03:37.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_const.h 2007-09-17 23:41:44.000000000 +0300 @@ -5,4 +5,17 @@ #define NV_NAME "NV" #define NV_DRIVER_NAME "nv" +/* libpciaccess gratuitous API changes */ +#if XSERVER_LIBPCIACCESS + #define MEMBASE(p,n) (p)->regions[n].base_addr + #define VENDOR_ID(p) (p)->vendor_id + #define DEVICE_ID(p) (p)->device_id + #define CHIP_REVISION(p) (p)->revision +#else + #define MEMBASE(p,n) (p)->memBase[n] + #define VENDOR_ID(p) (p)->vendor + #define DEVICE_ID(p) (p)->chipType + #define CHIP_REVISION(p) (p)->chipRev +#endif + #endif /* __NV_CONST_H__ */ diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_driver.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_driver.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_driver.c 2007-08-16 03:11:50.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_driver.c 2007-09-22 01:24:15.000000000 +0300 @@ -42,7 +42,11 @@ /* Mandatory functions */ static const OptionInfoRec * NVAvailableOptions(int chipid, int busid); static void NVIdentify(int flags); +#if XSERVER_LIBPCIACCESS +static Bool NVPciProbe(DriverPtr, int entity, struct pci_device*, intptr_t data); +#else static Bool NVProbe(DriverPtr drv, int flags); +#endif static Bool NVPreInit(ScrnInfoPtr pScrn, int flags); static Bool NVScreenInit(int Index, ScreenPtr pScreen, int argc, char **argv); @@ -72,6 +76,15 @@ static Bool NVModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static Bool NVSetModeVBE(ScrnInfoPtr pScrn, DisplayModePtr pMode); +#if XSERVER_LIBPCIACCESS +/* For now, just match any NVIDIA PCI device and sort through them in the probe + * routine */ +static const struct pci_id_match NVPciIdMatchList[] = { + { PCI_VENDOR_NVIDIA, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0 }, + { PCI_VENDOR_NVIDIA_SGS, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0}, + { 0, 0, 0 } +}; +#endif /* * This contains the functions needed by the server after loading the @@ -85,10 +98,19 @@ NV_VERSION, NV_DRIVER_NAME, NVIdentify, +#if XSERVER_LIBPCIACCESS + NULL, +#else NVProbe, +#endif NVAvailableOptions, NULL, - 0 + 0, + NULL, +#if XSERVER_LIBPCIACCESS + NVPciIdMatchList, + NVPciProbe, +#endif }; /* Known cards as of 2007/07/24 */ @@ -340,8 +362,15 @@ { 0x10DE019E, "Quadro FX 4600" }, { 0x10DE0400, "GeForce 8600 GTS" }, { 0x10DE0402, "GeForce 8600 GT" }, + { 0x10DE0404, "GeForce 8400 GS" }, { 0x10DE0407, "GeForce 8600M GT" }, + { 0x10DE0409, "GeForce 8700M GT" }, + { 0x10DE040A, "Quadro FX 370" }, { 0x10DE040B, "Quadro NVS 320M" }, + { 0x10DE040C, "Quadro FX 570M" }, + { 0x10DE040D, "Quadro FX 1600M" }, + { 0x10DE040E, "Quadro FX 570" }, + { 0x10DE040F, "Quadro FX 1700" }, { 0x10DE0421, "GeForce 8500 GT" }, { 0x10DE0422, "GeForce 8400 GS" }, { 0x10DE0423, "GeForce 8300 GS" }, @@ -352,6 +381,8 @@ { 0x10DE0429, "Quadro NVS 140M" }, { 0x10DE042A, "Quadro NVS 130M" }, { 0x10DE042B, "Quadro NVS 135M" }, + { 0x10DE042D, "Quadro FX 360M" }, + { 0x10DE042F, "Quadro NVS 290" }, {-1, NULL} }; @@ -574,7 +605,13 @@ if (!setupDone) { setupDone = TRUE; - xf86AddDriver(&NV, module, 0); + xf86AddDriver(&NV, module, +#if XSERVER_LIBPCIACCESS + HaveDriverFuncs +#else + 0 +#endif + ); /* * Modules that this driver always requires may be loaded here @@ -637,7 +674,9 @@ pScrn->driverName = NV_DRIVER_NAME; pScrn->name = NV_NAME; +#if !XSERVER_LIBPCIACCESS pScrn->Probe = NVProbe; +#endif pScrn->PreInit = NVPreInit; pScrn->ScreenInit = NVScreenInit; pScrn->SwitchMode = NVSwitchMode; @@ -654,9 +693,29 @@ static CARD32 +#if XSERVER_LIBPCIACCESS +NVGetPCIXpressChip (struct pci_device *dev) +#else NVGetPCIXpressChip (pciVideoPtr pVideo) +#endif { volatile CARD32 *regs; +#if XSERVER_LIBPCIACCESS + uint32_t pciid, pcicmd; + void *tmp; + + pci_device_cfg_read_u32(dev, &pcicmd, PCI_CMD_STAT_REG); + pci_device_cfg_write_u32(dev, pcicmd | PCI_CMD_MEM_ENABLE, + PCI_CMD_STAT_REG); + + pci_device_map_range(dev, dev->regions[0].base_addr, 0x2000, + PCI_DEV_MAP_FLAG_WRITABLE, &tmp); + regs = tmp; + pciid = regs[0x1800/4]; + pci_device_unmap_range(dev, tmp, 0x2000); + + pci_device_cfg_write_u32(dev, pcicmd, PCI_CMD_STAT_REG); +#else CARD32 pciid, pcicmd; PCITAG Tag = ((pciConfigPtr)(pVideo->thisCard))->tag; @@ -670,6 +729,7 @@ xf86UnMapVidMem(-1, (pointer)regs, 0x2000); pciWriteLong(Tag, PCI_CMD_STAT_REG, pcicmd); +#endif if((pciid & 0x0000ffff) == 0x000010DE) pciid = 0x10DE0000 | (pciid >> 16); @@ -694,7 +754,82 @@ return FALSE; } +static Bool +NVIsSupported(CARD32 id) +{ + /* look for a compatible devices which may be newer than + the NVKnownChipsets list above. */ + switch(id & 0xfff0) { + case 0x0170: + case 0x0180: + case 0x0250: + case 0x0280: + case 0x0300: + case 0x0310: + case 0x0320: + case 0x0330: + case 0x0340: + case 0x0040: + case 0x00C0: + case 0x0120: + case 0x0140: + case 0x0160: + case 0x01D0: + case 0x0090: + case 0x0210: + case 0x0220: + case 0x0240: + case 0x0290: + case 0x0390: + case 0x03D0: + return TRUE; + } + + return FALSE; +} + /* Mandatory */ +#if XSERVER_LIBPCIACCESS +static Bool +NVPciProbe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t data) +{ + const CARD32 id = ((dev->device_id & 0xfff0) == 0x00F0 || + (dev->device_id & 0xfff0) == 0x02E0) ? + NVGetPCIXpressChip(dev) : dev->vendor_id << 16 | dev->device_id; + const char *name = xf86TokenToString(NVKnownChipsets, id); + + if(dev->vendor_id == PCI_VENDOR_NVIDIA && !name && + !NVIsSupported(id) && !NVIsG80(id)) { + /* See if pci.ids knows what the heck this thing is */ + name = pci_device_get_device_name(dev); + if(name) + xf86DrvMsg(0, X_WARNING, + NV_NAME ": Ignoring unsupported device 0x%x (%s) at %2.2x@%2.2x:%2.2x:%1.1x\n", + id, name, dev->bus, dev->domain, dev->dev, dev->func); + else + xf86DrvMsg(0, X_WARNING, + NV_NAME ": Ignoring unsupported device 0x%x at %2.2x@%2.2x:%2.2x:%1.1x\n", + id, dev->bus, dev->domain, dev->dev, dev->func); + return FALSE; + } + + if(!name) + name = pci_device_get_device_name(dev); + if(!name) + name = "Unknown GPU"; + + xf86DrvMsg(0, X_PROBED, + NV_NAME ": Found NVIDIA %s at %2.2x@%2.2x:%2.2x:%1.1x\n", + name, dev->bus, dev->domain, dev->dev, dev->func); + + if(NVIsG80(id)) + return G80GetScrnInfoRec(NULL, entity); + else if(dev->vendor_id == PCI_VENDOR_NVIDIA_SGS) + return RivaGetScrnInfoRec(NULL, entity); + else + return NVGetScrnInfoRec(NULL, entity); +} +#else static Bool NVProbe(DriverPtr drv, int flags) { @@ -738,57 +873,15 @@ nvchips++; } - if(nvchips->name) { /* found one */ + if(nvchips->name || + ((*ppPci)->vendor == PCI_VENDOR_NVIDIA && + (NVIsSupported(token) || NVIsG80((*ppPci)->chipType)))) { NVChipsets[numUsed].token = pciid; - NVChipsets[numUsed].name = nvchips->name; - NVPciChipsets[numUsed].numChipset = pciid; + NVChipsets[numUsed].name = nvchips->name ? nvchips->name : "Unknown NVIDIA chip"; + NVPciChipsets[numUsed].numChipset = pciid; NVPciChipsets[numUsed].PCIid = pciid; NVPciChipsets[numUsed].resList = RES_SHARED_VGA; numUsed++; - } else if ((*ppPci)->vendor == PCI_VENDOR_NVIDIA) { - Bool canHandle = FALSE; - - /* look for a compatible devices which may be newer than - the NVKnownChipsets list above. */ - switch(token & 0xfff0) { - case 0x0170: - case 0x0180: - case 0x0250: - case 0x0280: - case 0x0300: - case 0x0310: - case 0x0320: - case 0x0330: - case 0x0340: - case 0x0040: - case 0x00C0: - case 0x0120: - case 0x0140: - case 0x0160: - case 0x01D0: - case 0x0090: - case 0x0210: - case 0x0220: - case 0x0240: - case 0x0290: - case 0x0390: - case 0x03D0: - canHandle = TRUE; - break; - default: break; /* we don't recognize it */ - } - - if(NVIsG80((*ppPci)->chipType)) - canHandle = TRUE; - - if(canHandle) { - NVChipsets[numUsed].token = pciid; - NVChipsets[numUsed].name = "Unknown NVIDIA chip"; - NVPciChipsets[numUsed].numChipset = pciid; - NVPciChipsets[numUsed].PCIid = pciid; - NVPciChipsets[numUsed].resList = RES_SHARED_VGA; - numUsed++; - } } } ppPci++; @@ -831,6 +924,7 @@ return foundScreen; } +#endif /* XSERVER_LIBPCIACCESS */ /* Usually mandatory */ Bool @@ -1175,8 +1269,10 @@ /* Find the PCI info for this screen */ pNv->PciInfo = xf86GetPciInfoForEntity(pNv->pEnt->index); +#if !XSERVER_LIBPCIACCESS pNv->PciTag = pciTag(pNv->PciInfo->bus, pNv->PciInfo->device, pNv->PciInfo->func); +#endif pNv->Primary = xf86IsPrimaryPci(pNv->PciInfo); @@ -1212,7 +1308,7 @@ pNv->Chipset); } else { from = X_PROBED; - pNv->Chipset = (pNv->PciInfo->vendor << 16) | pNv->PciInfo->chipType; + pNv->Chipset = VENDOR_ID(pNv->PciInfo) << 16 | DEVICE_ID(pNv->PciInfo); if(((pNv->Chipset & 0xfff0) == 0x00F0) || ((pNv->Chipset & 0xfff0) == 0x02E0)) @@ -1231,7 +1327,7 @@ xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", pNv->ChipRev); } else { - pNv->ChipRev = pNv->PciInfo->chipRev; + pNv->ChipRev = CHIP_REVISION(pNv->PciInfo); } /* @@ -1530,8 +1626,8 @@ pNv->FbAddress = pNv->pEnt->device->MemBase; from = X_CONFIG; } else { - if (pNv->PciInfo->memBase[1] != 0) { - pNv->FbAddress = pNv->PciInfo->memBase[1] & 0xff800000; + if (MEMBASE(pNv->PciInfo, 1) != 0) { + pNv->FbAddress = MEMBASE(pNv->PciInfo, 1) & 0xff800000; from = X_PROBED; } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1557,8 +1653,8 @@ pNv->IOAddress = pNv->pEnt->device->IOBase; from = X_CONFIG; } else { - if (pNv->PciInfo->memBase[0] != 0) { - pNv->IOAddress = pNv->PciInfo->memBase[0] & 0xffffc000; + if (MEMBASE(pNv->PciInfo, 0) != 0) { + pNv->IOAddress = MEMBASE(pNv->PciInfo, 0) & 0xffffc000; from = X_PROBED; } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1882,13 +1978,20 @@ static Bool NVMapMem(ScrnInfoPtr pScrn) { - NVPtr pNv; - - pNv = NVPTR(pScrn); + NVPtr pNv = NVPTR(pScrn); +#if XSERVER_LIBPCIACCESS + void *tmp; + + pci_device_map_range(pNv->PciInfo, pNv->FbAddress, pNv->FbMapSize, + PCI_DEV_MAP_FLAG_WRITABLE | + PCI_DEV_MAP_FLAG_WRITE_COMBINE, &tmp); + pNv->FbBase = tmp; +#else pNv->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, pNv->PciTag, pNv->FbAddress, pNv->FbMapSize); +#endif if (pNv->FbBase == NULL) return FALSE; @@ -1924,7 +2027,11 @@ pNv = NVPTR(pScrn); +#if XSERVER_LIBPCIACCESS + pci_device_unmap_range(pNv->PciInfo, pNv->FbBase, pNv->FbMapSize); +#else xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pNv->FbBase, pNv->FbMapSize); +#endif pNv->FbBase = NULL; pNv->FbStart = NULL; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_hw.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_hw.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_hw.c 2007-07-25 07:08:14.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_hw.c 2007-09-18 01:41:03.000000000 +0300 @@ -677,6 +677,16 @@ NVPtr pNv ) { +#if XSERVER_LIBPCIACCESS + struct pci_device *const dev1 = pci_device_find_by_slot(0, 0, 0, 1); + struct pci_device *const dev2 = pci_device_find_by_slot(0, 0, 0, 2); + struct pci_device *const dev3 = pci_device_find_by_slot(0, 0, 0, 3); + struct pci_device *const dev5 = pci_device_find_by_slot(0, 0, 0, 5); + uint32_t tmp; + #define READ_LONG(num, offset) ({ pci_device_cfg_read_u32(dev##num, &tmp, (offset)); tmp; }) +#else + #define READ_LONG(num, offset) pciReadLong(pciTag(0, 0, num), (offset)) +#endif nv10_fifo_info fifo_data; nv10_sim_state sim_data; unsigned int M, N, P, pll, MClk, NVClk, memctrl; @@ -684,11 +694,11 @@ if((pNv->Chipset & 0x0FF0) == 0x01A0) { unsigned int uMClkPostDiv; - uMClkPostDiv = (pciReadLong(pciTag(0, 0, 3), 0x6C) >> 8) & 0xf; + uMClkPostDiv = (READ_LONG(3, 0x6C) >> 8) & 0xf; if(!uMClkPostDiv) uMClkPostDiv = 4; MClk = 400000 / uMClkPostDiv; } else { - MClk = pciReadLong(pciTag(0, 0, 5), 0x4C) / 1000; + MClk = READ_LONG(5, 0x4C) / 1000; } pll = pNv->PRAMDAC0[0x0500/4]; @@ -697,17 +707,17 @@ sim_data.pix_bpp = (char)pixelDepth; sim_data.enable_video = 0; sim_data.enable_mp = 0; - sim_data.memory_type = (pciReadLong(pciTag(0, 0, 1), 0x7C) >> 12) & 1; + sim_data.memory_type = (READ_LONG(1, 0x7C) >> 12) & 1; sim_data.memory_width = 64; - memctrl = pciReadLong(pciTag(0, 0, 3), 0x00) >> 16; + memctrl = READ_LONG(3, 0x00) >> 16; if((memctrl == 0x1A9) || (memctrl == 0x1AB) || (memctrl == 0x1ED)) { int dimm[3]; - dimm[0] = (pciReadLong(pciTag(0, 0, 2), 0x40) >> 8) & 0x4F; - dimm[1] = (pciReadLong(pciTag(0, 0, 2), 0x44) >> 8) & 0x4F; - dimm[2] = (pciReadLong(pciTag(0, 0, 2), 0x48) >> 8) & 0x4F; + dimm[0] = (READ_LONG(2, 0x40) >> 8) & 0x4F; + dimm[1] = (READ_LONG(2, 0x44) >> 8) & 0x4F; + dimm[2] = (READ_LONG(2, 0x48) >> 8) & 0x4F; if((dimm[0] + dimm[1]) != dimm[2]) { ErrorF("WARNING: " @@ -730,6 +740,8 @@ while (b >>= 1) (*burst)++; *lwm = fifo_data.graphics_lwm >> 3; } + +#undef READ_LONG } diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_setup.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_setup.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_setup.c 2007-07-25 07:04:53.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_setup.c 2007-09-18 00:17:51.000000000 +0300 @@ -298,6 +298,24 @@ } #endif +#if XSERVER_LIBPCIACCESS + { + /* [AGP]: I don't know if this is correct */ + struct pci_device *dev = pci_device_find_by_slot(0, 0, 0, 1); + + if(implementation == 0x01a0) { + uint32_t amt; + pci_device_cfg_read_u32(dev, &amt, 0x7C); + pNv->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024; + } else if(implementation == 0x01f0) { + uint32_t amt; + pci_device_cfg_read_u32(dev, &amt, 0x84); + pNv->RamAmountKBytes = (((amt >> 4) & 127) + 1) * 1024; + } else { + pNv->RamAmountKBytes = (pNv->PFB[0x020C/4] & 0xFFF00000) >> 10; + } + } +#else if(implementation == 0x01a0) { int amt = pciReadLong(pciTag(0, 0, 1), 0x7C); pNv->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024; @@ -307,6 +325,7 @@ } else { pNv->RamAmountKBytes = (pNv->PFB[0x020C/4] & 0xFFF00000) >> 10; } +#endif if(pNv->RamAmountKBytes > 256*1024) pNv->RamAmountKBytes = 256*1024; @@ -337,6 +356,7 @@ Bool tvB = FALSE; int FlatPanel = -1; /* really means the CRTC is slaved */ Bool Television = FALSE; + void *tmp; /* * Override VGA I/O routines. @@ -365,10 +385,15 @@ */ pVga->MMIOBase = (CARD8 *)pNv; pVga->MMIOOffset = 0; - - pNv->REGS = xf86MapPciMem(pScrn->scrnIndex, - VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, - pNv->PciTag, pNv->IOAddress, 0x01000000); + +#if XSERVER_LIBPCIACCESS + pci_device_map_range(pNv->PciInfo, pNv->IOAddress, 0x01000000, + PCI_DEV_MAP_FLAG_WRITABLE, &tmp); +#else + tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, + pNv->PciTag, pNv->IOAddress, 0x01000000); +#endif + pNv->REGS = tmp; pNv->PRAMIN = pNv->REGS + (0x00710000/4); pNv->PCRTC0 = pNv->REGS + (0x00600000/4); diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_type.h /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_type.h --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/nv_type.h 2007-07-25 07:05:05.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/nv_type.h 2007-09-17 23:41:44.000000000 +0300 @@ -79,8 +79,12 @@ CARD32 Architecture; CARD32 CursorStart; EntityInfoPtr pEnt; +#if XSERVER_LIBPCIACCESS + struct pci_device *PciInfo; +#else pciVideoPtr PciInfo; PCITAG PciTag; +#endif int Chipset; int ChipRev; Bool Primary; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/riva_driver.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/riva_driver.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/riva_driver.c 2007-07-25 07:05:58.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/riva_driver.c 2007-09-18 01:38:27.000000000 +0300 @@ -27,6 +27,7 @@ #include "config.h" #endif +#include "nv_const.h" #include "riva_include.h" #include "xf86int10.h" @@ -479,8 +480,10 @@ /* Find the PCI info for this screen */ pRiva->PciInfo = xf86GetPciInfoForEntity(pRiva->pEnt->index); +#if !XSERVER_LIBPCIACCESS pRiva->PciTag = pciTag(pRiva->PciInfo->bus, pRiva->PciInfo->device, pRiva->PciInfo->func); +#endif pRiva->Primary = xf86IsPrimaryPci(pRiva->PciInfo); @@ -499,8 +502,9 @@ /* Set pScrn->monitor */ pScrn->monitor = pScrn->confScreen->monitor; - pRiva->ChipRev = pRiva->PciInfo->chipRev; - if((pRiva->PciInfo->vendor != 0x12D2) || (pRiva->PciInfo->chipType != 0x0018)) + pRiva->ChipRev = CHIP_REVISION(pRiva->PciInfo); + if(VENDOR_ID(pRiva->PciInfo) != PCI_VENDOR_NVIDIA_SGS || + DEVICE_ID(pRiva->PciInfo) != PCI_CHIP_RIVA128) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "This is not a RIVA 128\n"); xf86FreeInt10(pRiva->pInt); @@ -690,8 +694,8 @@ } else { int i = 1; pRiva->FbBaseReg = i; - if (pRiva->PciInfo->memBase[i] != 0) { - pRiva->FbAddress = pRiva->PciInfo->memBase[i] & 0xff800000; + if (MEMBASE(pRiva->PciInfo, i) != 0) { + pRiva->FbAddress = MEMBASE(pRiva->PciInfo, i) & 0xff800000; from = X_PROBED; } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -718,8 +722,8 @@ from = X_CONFIG; } else { int i = 0; - if (pRiva->PciInfo->memBase[i] != 0) { - pRiva->IOAddress = pRiva->PciInfo->memBase[i] & 0xffffc000; + if (MEMBASE(pRiva->PciInfo, i) != 0) { + pRiva->IOAddress = MEMBASE(pRiva->PciInfo, i) & 0xffffc000; from = X_PROBED; } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -916,22 +920,34 @@ static Bool RivaMapMem(ScrnInfoPtr pScrn) { - RivaPtr pRiva; - - pRiva = RivaPTR(pScrn); + RivaPtr pRiva = RivaPTR(pScrn); /* * Map IO registers to virtual address space */ +#if XSERVER_LIBPCIACCESS + void *tmp; + + pci_device_map_range(pRiva->PciInfo, pRiva->IOAddress, 0x1000000, + PCI_DEV_MAP_FLAG_WRITABLE, &tmp); + pRiva->IOBase = tmp; + pci_device_map_range(pRiva->PciInfo, pRiva->FbAddress, pRiva->FbMapSize, + PCI_DEV_MAP_FLAG_WRITABLE | + PCI_DEV_MAP_FLAG_WRITE_COMBINE, + &tmp); + pRiva->FbBase = tmp; +#else pRiva->IOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, pRiva->PciTag, pRiva->IOAddress, 0x1000000); - if (pRiva->IOBase == NULL) - return FALSE; - pRiva->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, pRiva->PciTag, pRiva->FbAddress, pRiva->FbMapSize); +#endif + + if (pRiva->IOBase == NULL) + return FALSE; + if (pRiva->FbBase == NULL) return FALSE; @@ -974,10 +990,15 @@ /* * Unmap IO registers to virtual address space */ +#if XSERVER_LIBPCIACCESS + pci_device_unmap_range(pRiva->PciInfo, pRiva->IOBase, 0x1000000); + pci_device_unmap_range(pRiva->PciInfo, pRiva->FbBase, pRiva->FbMapSize); +#else xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pRiva->IOBase, 0x1000000); - pRiva->IOBase = NULL; - xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pRiva->FbBase, pRiva->FbMapSize); +#endif + + pRiva->IOBase = NULL; pRiva->FbBase = NULL; pRiva->FbStart = NULL; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/riva_setup.c /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/riva_setup.c --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/riva_setup.c 2007-07-25 07:06:23.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/riva_setup.c 2007-09-18 01:40:31.000000000 +0300 @@ -187,7 +187,6 @@ CARD32 regBase = pRiva->IOAddress; CARD32 frameBase = pRiva->FbAddress; xf86MonPtr monitor; - int mmioFlags; pRiva->Save = RivaDACSave; pRiva->Restore = RivaDACRestore; @@ -229,40 +228,39 @@ pRiva->riva.EnableIRQ = 0; pRiva->riva.IO = VGA_IOBASE_COLOR; - mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT; - - pRiva->riva.PRAMDAC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, - regBase+0x00680000, 0x00003000); - pRiva->riva.PFB = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, - regBase+0x00100000, 0x00001000); - pRiva->riva.PFIFO = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, - regBase+0x00002000, 0x00002000); - pRiva->riva.PGRAPH = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, - regBase+0x00400000, 0x00002000); - pRiva->riva.PEXTDEV = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, - regBase+0x00101000, 0x00001000); - pRiva->riva.PTIMER = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, - regBase+0x00009000, 0x00001000); - pRiva->riva.PMC = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, - regBase+0x00000000, 0x00009000); - pRiva->riva.FIFO = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, - regBase+0x00800000, 0x00010000); - pRiva->riva.PRAMIN = xf86MapPciMem(pScrn->scrnIndex, mmioFlags, pRiva->PciTag, - frameBase+0x00C00000, 0x00008000); +#if XSERVER_LIBPCIACCESS +#define MAP(ptr, offset, size) { \ + void *tmp; \ + pci_device_map_range(pRiva->PciInfo, (offset), (size), \ + PCI_DEV_MAP_FLAG_WRITABLE, &tmp); \ + pRiva->riva.ptr = tmp; \ + } +#else +#define MAP(ptr, offset, size) \ + pRiva->riva.ptr = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | \ + VIDMEM_READSIDEEFFECT, pRiva->PciTag, \ + (offset), (size)); +#endif + + MAP(PRAMDAC, regBase + 0x00680000, 0x00003000); + MAP(PFB, regBase + 0x00100000, 0x00001000); + MAP(PFIFO, regBase + 0x00002000, 0x00002000); + MAP(PGRAPH, regBase + 0x00400000, 0x00002000); + MAP(PEXTDEV, regBase + 0x00101000, 0x00001000); + MAP(PTIMER, regBase + 0x00009000, 0x00001000); + MAP(PMC, regBase + 0x00000000, 0x00009000); + MAP(FIFO, regBase + 0x00800000, 0x00010000); + MAP(PRAMIN, frameBase+0x00C00000, 0x00008000); /* * These registers are read/write as 8 bit values. Probably have to map * sparse on alpha. */ - pRiva->riva.PCIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pRiva->PciTag, regBase+0x00601000, - 0x00003000); - pRiva->riva.PDIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pRiva->PciTag, regBase+0x00681000, - 0x00003000); - pRiva->riva.PVIO = (U008 *)xf86MapPciMem(pScrn->scrnIndex, mmioFlags, - pRiva->PciTag, regBase+0x000C0000, - 0x00001000); + MAP(PCIO, regBase + 0x00601000, 0x00003000); + MAP(PDIO, regBase + 0x00681000, 0x00003000); + MAP(PVIO, regBase + 0x000C0000, 0x00001000); + +#undef MAP pRiva->riva.PCRTC = pRiva->riva.PGRAPH; diff -Nru /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/riva_type.h /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/riva_type.h --- /tmp/1d4mXAb5xx/xserver-xorg-video-nv-2.1.3/src/riva_type.h 2007-07-25 07:06:34.000000000 +0300 +++ /tmp/U82fV7fbfg/xserver-xorg-video-nv-2.1.5/src/riva_type.h 2007-09-17 23:41:44.000000000 +0300 @@ -51,8 +51,12 @@ RIVA_HW_STATE SavedReg; RIVA_HW_STATE ModeReg; EntityInfoPtr pEnt; +#if XSERVER_LIBPCIACCESS + struct pci_device *PciInfo; +#else pciVideoPtr PciInfo; PCITAG PciTag; +#endif xf86AccessRec Access; int ChipRev; Bool Primary;