From 2c84d651f765b7032d2dc604921aaa5888ced4a6 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Jun 24 2009 18:31:04 +0000 Subject: - Today's git snapshots (driver and gpu tools) --- diff --git a/.cvsignore b/.cvsignore index b6c73f7..0a1d048 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1,3 @@ xf86-video-intel-2.6.99.902.tar.bz2 +intel-gpu-tools-20090624.tar.bz2 +xf86-video-intel-20090624.tar.bz2 diff --git a/abi.patch b/abi.patch deleted file mode 100644 index c574ef4..0000000 --- a/abi.patch +++ /dev/null @@ -1,149 +0,0 @@ -diff -up xf86-video-intel-2.7.0/src/i810_driver.c.jx xf86-video-intel-2.7.0/src/i810_driver.c ---- xf86-video-intel-2.7.0/src/i810_driver.c.jx 2009-04-08 19:59:47.000000000 -0400 -+++ xf86-video-intel-2.7.0/src/i810_driver.c 2009-06-22 17:27:06.000000000 -0400 -@@ -493,15 +493,6 @@ i810Setup(pointer module, pointer opts, - * Tell the loader about symbols from other modules that this module - * might refer to. - */ -- LoaderRefSymLists(I810vgahwSymbols, -- I810fbSymbols, I810xaaSymbols, I810ramdacSymbols, --#ifdef XF86DRI -- I810drmSymbols, -- I810driSymbols, --#endif -- I810shadowFBSymbols, -- I810vbeSymbols, vbeOptionalSymbols, -- I810ddcSymbols, NULL); - - /* - * The return value must be non-NULL on success even though there -@@ -809,7 +800,6 @@ I810DoDDC(ScrnInfoPtr pScrn, int index) - } - - if (xf86LoadSubModule(pScrn, "vbe") && (pVbe = VBEInit(NULL, index))) { -- xf86LoaderReqSymLists(I810vbeSymbols, NULL); - MonInfo = vbeDoEDID(pVbe, NULL); - xf86PrintEDID(MonInfo); - xf86SetDDCproperties(pScrn, MonInfo); -@@ -864,7 +854,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags - if (!xf86LoadSubModule(pScrn, "vgahw")) - return FALSE; - -- xf86LoaderReqSymLists(I810vgahwSymbols, NULL); - - /* Allocate a vgaHWRec */ - if (!vgaHWGetHWRec(pScrn)) -@@ -960,7 +949,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags - I810FreeRec(pScrn); - return FALSE; - } -- xf86LoaderReqSymLists(I810xaaSymbols, NULL); - } - - #ifdef XF86DRI -@@ -1244,14 +1232,12 @@ I810PreInit(ScrnInfoPtr pScrn, int flags - I810FreeRec(pScrn); - return FALSE; - } -- xf86LoaderReqSymLists(I810fbSymbols, NULL); - - if (!xf86ReturnOptValBool(pI810->Options, OPTION_SW_CURSOR, FALSE)) { - if (!xf86LoadSubModule(pScrn, "ramdac")) { - I810FreeRec(pScrn); - return FALSE; - } -- xf86LoaderReqSymLists(I810ramdacSymbols, NULL); - } - - if (xf86GetOptValInteger -@@ -1279,7 +1265,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags - "Couldn't load shadowfb module:\n"); - } - else { -- xf86LoaderReqSymLists(I810shadowFBSymbols, NULL); - } - } - -@@ -1313,7 +1298,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags - /* Load the dri module if requested. */ - if (xf86ReturnOptValBool(pI810->Options, OPTION_DRI, FALSE)) { - if (xf86LoadSubModule(pScrn, "dri")) { -- xf86LoaderReqSymLists(I810driSymbols, I810drmSymbols, NULL); - } - } - #endif -diff -up xf86-video-intel-2.7.0/src/i830_driver.c.jx xf86-video-intel-2.7.0/src/i830_driver.c ---- xf86-video-intel-2.7.0/src/i830_driver.c.jx 2009-06-22 17:26:05.000000000 -0400 -+++ xf86-video-intel-2.7.0/src/i830_driver.c 2009-06-22 17:27:06.000000000 -0400 -@@ -1050,7 +1050,6 @@ I830PreInitDDC(ScrnInfoPtr pScrn) - if (!xf86LoadSubModule(pScrn, "ddc")) { - pI830->ddc2 = FALSE; - } else { -- xf86LoaderReqSymLists(I810ddcSymbols, NULL); - pI830->ddc2 = TRUE; - } - -@@ -1058,7 +1057,6 @@ I830PreInitDDC(ScrnInfoPtr pScrn) - /* Load I2C if we have the code to use it */ - if (pI830->ddc2) { - if (xf86LoadSubModule(pScrn, "i2c")) { -- xf86LoaderReqSymLists(I810i2cSymbols, NULL); - - pI830->ddc2 = TRUE; - } else { -@@ -1511,11 +1509,9 @@ I830LoadSyms(ScrnInfoPtr pScrn) - /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) - return FALSE; -- xf86LoaderReqSymLists(I810vgahwSymbols, NULL); - - if (!xf86LoadSubModule(pScrn, "ramdac")) - return FALSE; -- xf86LoaderReqSymLists(I810ramdacSymbols, NULL); - - return TRUE; - } -@@ -1942,7 +1938,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags - return FALSE; - } - -- xf86LoaderReqSymLists(I810fbSymbols, NULL); - - switch (pI830->accel) { - #ifdef I830_USE_XAA -@@ -1951,7 +1946,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags - PreInitCleanup(pScrn); - return FALSE; - } -- xf86LoaderReqSymLists(I810xaaSymbols, NULL); - break; - #endif - -@@ -1973,7 +1967,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags - PreInitCleanup(pScrn); - return FALSE; - } -- xf86LoaderReqSymLists(I830exaSymbols, NULL); - break; - } - #endif -@@ -1997,7 +1990,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags - if (xf86ReturnOptValBool(pI830->Options, OPTION_DRI, FALSE) && - pI830->directRenderingType != DRI_DISABLED) { - if (xf86LoadSubModule(pScrn, "dri")) { -- xf86LoaderReqSymLists(I810driSymbols, I810drmSymbols, NULL); - } - } - #endif -diff -up xf86-video-intel-2.7.0/src/i830_dvo.c.jx xf86-video-intel-2.7.0/src/i830_dvo.c ---- xf86-video-intel-2.7.0/src/i830_dvo.c.jx 2009-04-08 19:59:48.000000000 -0400 -+++ xf86-video-intel-2.7.0/src/i830_dvo.c 2009-06-22 17:27:01.000000000 -0400 -@@ -447,8 +447,6 @@ i830_dvo_init(ScrnInfoPtr pScrn) - if (drv->modhandle == NULL) - continue; - -- xf86LoaderReqSymLists(drv->symbols, NULL); -- - ret_ptr = NULL; - drv->vid_rec = LoaderSymbol(drv->fntablename); - diff --git a/copy-fb.patch b/copy-fb.patch index eba7192..102aa1f 100644 --- a/copy-fb.patch +++ b/copy-fb.patch @@ -1,13 +1,6 @@ -commit b209cbc72f8d524b2c4c6d0e6e6acf8385e96062 -Author: Kristian Høgsberg -Date: Tue Feb 24 10:49:45 2009 -0500 - - Copy initial framebuffer contents when starting with -br. - -diff --git a/src/drmmode_display.c b/src/drmmode_display.c -index df0f1a2..35dc24c 100644 ---- a/src/drmmode_display.c -+++ b/src/drmmode_display.c +diff -up xf86-video-intel-20090624/src/drmmode_display.c.jx xf86-video-intel-20090624/src/drmmode_display.c +--- xf86-video-intel-20090624/src/drmmode_display.c.jx 2009-06-24 13:57:46.000000000 -0400 ++++ xf86-video-intel-20090624/src/drmmode_display.c 2009-06-24 13:59:20.000000000 -0400 @@ -29,6 +29,8 @@ #include "config.h" #endif @@ -16,8 +9,8 @@ index df0f1a2..35dc24c 100644 + #include "xorgVersion.h" - #ifdef XF86DRM_MODE -@@ -145,7 +147,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, + #include "i830.h" +@@ -163,7 +165,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, unsigned int pitch = pScrn->displayWidth * pI830->cpp; if (drmmode->fb_id == 0) { @@ -26,7 +19,7 @@ index df0f1a2..35dc24c 100644 pScrn->virtualX, pScrn->virtualY, pScrn->depth, pScrn->bitsPerPixel, pitch, pI830->front_buffer->bo->handle, -@@ -523,6 +525,13 @@ drmmode_output_dpms(xf86OutputPtr output, int mode) +@@ -728,6 +730,13 @@ drmmode_output_dpms(xf86OutputPtr output drmmode_ptr drmmode = drmmode_output->drmmode; int i; drmModePropertyPtr props; @@ -40,19 +33,20 @@ index df0f1a2..35dc24c 100644 for (i = 0; i < koutput->count_props; i++) { props = drmModeGetProperty(drmmode->fd, koutput->props[i]); -@@ -753,6 +762,8 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp) +@@ -1073,6 +1082,8 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scr + if (old_front) + i830_free_memory(scrn, old_front); - xf86InitialConfiguration(pScrn, pI830->can_resize); - -+ pScrn->canDoBGNoneRoot = TRUE; ++ scrn->canDoBGNoneRoot = TRUE; + return TRUE; - } -@@ -780,4 +791,97 @@ Bool drmmode_is_rotate_pixmap(ScrnInfoPtr pScrn, pointer pPixData, dri_bo **bo) - #endif - } + fail: +@@ -1129,3 +1140,98 @@ drmmode_get_pipe_from_crtc_id(drm_intel_ + return drm_intel_get_pipe_from_crtc_id (bufmgr, drmmode_crtc->mode_crtc->crtc_id); + } ++ +static PixmapPtr +drmmode_create_pixmap_for_fbcon(ScrnInfoPtr pScrn) +{ @@ -110,6 +104,7 @@ index df0f1a2..35dc24c 100644 + + return pixmap; +} ++ +void drmmode_copy_fb(ScrnInfoPtr pScrn) +{ + ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; @@ -146,24 +141,10 @@ index df0f1a2..35dc24c 100644 + (*pScreen->DestroyPixmap)(dst); +} + - #endif -diff --git a/src/i830.h b/src/i830.h -index cd9c38a..8651169 100644 ---- a/src/i830.h -+++ b/src/i830.h -@@ -835,6 +835,7 @@ void I830DRI2CloseScreen(ScreenPtr pScreen); - extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp); - extern Bool drmmode_is_rotate_pixmap(ScrnInfoPtr pScrn, pointer pPixData, - dri_bo **bo); -+extern void drmmode_copy_fb(ScrnInfoPtr pScrn); - #endif - - extern Bool I830AccelInit(ScreenPtr pScreen); -diff --git a/src/i830_driver.c b/src/i830_driver.c -index f80ca69..0591db9 100644 ---- a/src/i830_driver.c -+++ b/src/i830_driver.c -@@ -3725,6 +3725,8 @@ I830EnterVT(int scrnIndex, int flags) +diff -up xf86-video-intel-20090624/src/i830_driver.c.jx xf86-video-intel-20090624/src/i830_driver.c +--- xf86-video-intel-20090624/src/i830_driver.c.jx 2009-06-23 18:35:41.000000000 -0400 ++++ xf86-video-intel-20090624/src/i830_driver.c 2009-06-24 13:57:58.000000000 -0400 +@@ -3097,6 +3097,8 @@ I830EnterVT(int scrnIndex, int flags) /* Clear the framebuffer */ memset(pI830->FbBase + pScrn->fbOffset, 0, pScrn->virtualY * pScrn->displayWidth * pI830->cpp); @@ -172,3 +153,14 @@ index f80ca69..0591db9 100644 } if (!xf86SetDesiredModes (pScrn)) +diff -up xf86-video-intel-20090624/src/i830.h.jx xf86-video-intel-20090624/src/i830.h +--- xf86-video-intel-20090624/src/i830.h.jx 2009-06-23 18:35:41.000000000 -0400 ++++ xf86-video-intel-20090624/src/i830.h 2009-06-24 13:59:49.000000000 -0400 +@@ -691,6 +691,7 @@ void I830DRI2CloseScreen(ScreenPtr pScre + + extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp); + extern int drmmode_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc); ++extern void drmmode_copy_fb(ScrnInfoPtr pScrn); + + extern Bool I830AccelInit(ScreenPtr pScreen); + extern void I830SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, diff --git a/intel-2.6.99.902-to-git.patch b/intel-2.6.99.902-to-git.patch deleted file mode 100644 index 84a69c8..0000000 --- a/intel-2.6.99.902-to-git.patch +++ /dev/null @@ -1,3137 +0,0 @@ -053432991c812146f6e7c6f13c6ace55385c825f - -diff --git a/Makefile.am b/Makefile.am -index d1118fe..45b0c42 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -19,6 +19,7 @@ - # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - AUTOMAKE_OPTIONS = foreign -+ACLOCAL_AMFLAGS = -I m4 - - SUBDIRS = uxa src man - -diff --git a/RELEASING b/RELEASING -new file mode 100644 -index 0000000..c4006c3 ---- /dev/null -+++ b/RELEASING -@@ -0,0 +1,32 @@ -+The process for releasing a new tarball is as follows: -+ -+1. make sure you have the latest build requirements installed: -+ -+ git://git.freedesktop.org/git/util/macros -+ git://git.freedesktop.org/git/util/modular -+ -+2. update your module version (usually found in configure.ac) -+ -+ $ vi configure.ac # bump version -+ $ git push origin # make sure you're on the release branch -+ -+3. verify your module builds -+ -+ $ make distcheck -+ -+4. tag the release -+ -+ $ git tag -m "Intel release" xf86-video-intel- -+ -+5. run the release script (this should push the tag) -+ -+ $ /util/modular/release.sh driver xf86-video-intel- xf86-video-intel- -+ -+6. edit the generated release message as needed and send it out -+ -+ for major releases list added features and known limitations -+ -+ for minor releases indicate which bugs were fixed and which -+ are still present -+ -+7. throw a release party, you're done! :) -diff --git a/acinclude.m4 b/acinclude.m4 -deleted file mode 100644 -index 254b352..0000000 ---- a/acinclude.m4 -+++ /dev/null -@@ -1,140 +0,0 @@ --dnl dolt, a replacement for libtool --dnl Copyright © 2007-2008 Josh Triplett --dnl Copying and distribution of this file, with or without modification, --dnl are permitted in any medium without royalty provided the copyright --dnl notice and this notice are preserved. --dnl --dnl To use dolt, invoke the DOLT macro immediately after the libtool macros. --dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it --dnl installed when running autoconf on your project. --dnl --dnl git snapshot: d91f2b4e9041538400e2703a2a6fbeecdb8ee27d --AC_DEFUN([DOLT], [ --AC_REQUIRE([AC_CANONICAL_HOST]) --# dolt, a replacement for libtool --# Josh Triplett --AC_PATH_PROG(DOLT_BASH, bash) --AC_MSG_CHECKING([if libtool sucks]) --AC_MSG_RESULT([yup, it does]) --AC_MSG_CHECKING([if dolt supports this host]) --dolt_supported=yes --if test x$DOLT_BASH = x; then -- dolt_supported=no --fi --if test x$GCC != xyes; then -- dolt_supported=no --fi --case $host in --i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux*) ;; --amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*) ;; --*) dolt_supported=no ;; --esac --if test x$dolt_supported = xno ; then -- AC_MSG_RESULT([no, falling back to libtool]) -- LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)' -- LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)' --else -- AC_MSG_RESULT([yes, replacing libtool]) -- --dnl Start writing out doltcompile. -- cat <<__DOLTCOMPILE__EOF__ >doltcompile --#!$DOLT_BASH --__DOLTCOMPILE__EOF__ -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --args=("$[]@") --for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do -- if test x"${args@<:@$arg@:>@}" = x-o ; then -- objarg=$((arg+1)) -- break -- fi --done --if test x$objarg = x ; then -- echo 'Error: no -o on compiler command line' 1>&2 -- exit 1 --fi --lo="${args@<:@$objarg@:>@}" --obj="${lo%.lo}" --if test x"$lo" = x"$obj" ; then -- echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2 -- exit 1 --fi --objbase="${obj##*/}" --__DOLTCOMPILE__EOF__ -- --dnl Write out shared compilation code. -- if test x$enable_shared = xyes; then -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --libobjdir="${obj%$objbase}.libs" --if test ! -d "$libobjdir" ; then -- mkdir_out="$(mkdir "$libobjdir" 2>&1)" -- mkdir_ret=$? -- if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then -- echo "$mkdir_out" 1>&2 -- exit $mkdir_ret -- fi --fi --pic_object="$libobjdir/$objbase.o" --args@<:@$objarg@:>@="$pic_object" --"${args@<:@@@:>@}" -fPIC -DPIC || exit $? --__DOLTCOMPILE__EOF__ -- fi -- --dnl Write out static compilation code. --dnl Avoid duplicate compiler output if also building shared objects. -- if test x$enable_static = xyes; then -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --non_pic_object="$obj.o" --args@<:@$objarg@:>@="$non_pic_object" --__DOLTCOMPILE__EOF__ -- if test x$enable_shared = xyes; then -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $? --__DOLTCOMPILE__EOF__ -- else -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --"${args@<:@@@:>@}" || exit $? --__DOLTCOMPILE__EOF__ -- fi -- fi -- --dnl Write out the code to write the .lo file. --dnl The second line of the .lo file must match "^# Generated by .*libtool" -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --{ --echo "# $lo - a libtool object file" --echo "# Generated by doltcompile, not libtool" --__DOLTCOMPILE__EOF__ -- -- if test x$enable_shared = xyes; then -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --echo "pic_object='$pic_object'" --__DOLTCOMPILE__EOF__ -- else -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --echo pic_object=none --__DOLTCOMPILE__EOF__ -- fi -- -- if test x$enable_static = xyes; then -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --echo "non_pic_object='$non_pic_object'" --__DOLTCOMPILE__EOF__ -- else -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --echo non_pic_object=none --__DOLTCOMPILE__EOF__ -- fi -- -- cat <<'__DOLTCOMPILE__EOF__' >>doltcompile --} > "$lo" --__DOLTCOMPILE__EOF__ -- --dnl Done writing out doltcompile; substitute it for libtool compilation. -- chmod +x doltcompile -- LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)' -- LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)' --fi --AC_SUBST(LTCOMPILE) --AC_SUBST(LTCXXCOMPILE) --# end dolt --]) -diff --git a/configure.ac b/configure.ac -index aeb675c..ae134af 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -22,7 +22,7 @@ - - AC_PREREQ(2.57) - AC_INIT([xf86-video-intel], -- 2.6.99.902, -+ 2.6.99.1, - [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], - xf86-video-intel) - -@@ -34,6 +34,11 @@ AM_INIT_AUTOMAKE([dist-bzip2]) - - AM_MAINTAINER_MODE - -+AC_CONFIG_FILES([ -+ shave -+ shave-libtool -+]) -+ - # Checks for programs. - AC_DISABLE_STATIC - AC_PROG_LIBTOOL -@@ -206,7 +211,7 @@ if test "x$GCC" = "xyes"; then - -Wnested-externs -fno-strict-aliasing" - fi - --PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.5]) -+PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.6]) - AM_CONDITIONAL(DRI, test x$DRI = xyes) - if test "$DRI" = yes; then - PKG_CHECK_MODULES(DRI, [xf86driproto glproto]) -@@ -259,6 +264,8 @@ XORG_RELEASE_VERSION - - XORG_CHECK_LINUXDOC - -+SHAVE_INIT([.], [enable]) -+ - AC_OUTPUT([ - Makefile - uxa/Makefile -diff --git a/m4/dolt.m4 b/m4/dolt.m4 -new file mode 100644 -index 0000000..1109bdb ---- /dev/null -+++ b/m4/dolt.m4 -@@ -0,0 +1,178 @@ -+dnl dolt, a replacement for libtool -+dnl Copyright © 2007-2008 Josh Triplett -+dnl Copying and distribution of this file, with or without modification, -+dnl are permitted in any medium without royalty provided the copyright -+dnl notice and this notice are preserved. -+dnl -+dnl To use dolt, invoke the DOLT macro immediately after the libtool macros. -+dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it -+dnl installed when running autoconf on your project. -+ -+AC_DEFUN([DOLT], [ -+AC_REQUIRE([AC_CANONICAL_HOST]) -+# dolt, a replacement for libtool -+# Josh Triplett -+AC_PATH_PROG(DOLT_BASH, bash) -+AC_MSG_CHECKING([if dolt supports this host]) -+dolt_supported=yes -+if test x$DOLT_BASH = x; then -+ dolt_supported=no -+fi -+if test x$GCC != xyes; then -+ dolt_supported=no -+fi -+case $host in -+i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux* \ -+|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*) -+ pic_options='-fPIC' -+ ;; -+i?86-apple-darwin*) -+ pic_options='-fno-common' -+ ;; -+*) -+ dolt_supported=no -+ ;; -+esac -+if test x$dolt_supported = xno ; then -+ AC_MSG_RESULT([no, falling back to libtool]) -+ LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)' -+ LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)' -+else -+ AC_MSG_RESULT([yes, replacing libtool]) -+ -+dnl Start writing out doltcompile. -+ cat <<__DOLTCOMPILE__EOF__ >doltcompile -+#!$DOLT_BASH -+__DOLTCOMPILE__EOF__ -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+args=("$[]@") -+for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do -+ if test x"${args@<:@$arg@:>@}" = x-o ; then -+ objarg=$((arg+1)) -+ break -+ fi -+done -+if test x$objarg = x ; then -+ echo 'Error: no -o on compiler command line' 1>&2 -+ exit 1 -+fi -+lo="${args@<:@$objarg@:>@}" -+obj="${lo%.lo}" -+if test x"$lo" = x"$obj" ; then -+ echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2 -+ exit 1 -+fi -+objbase="${obj##*/}" -+__DOLTCOMPILE__EOF__ -+ -+dnl Write out shared compilation code. -+ if test x$enable_shared = xyes; then -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+libobjdir="${obj%$objbase}.libs" -+if test ! -d "$libobjdir" ; then -+ mkdir_out="$(mkdir "$libobjdir" 2>&1)" -+ mkdir_ret=$? -+ if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then -+ echo "$mkdir_out" 1>&2 -+ exit $mkdir_ret -+ fi -+fi -+pic_object="$libobjdir/$objbase.o" -+args@<:@$objarg@:>@="$pic_object" -+__DOLTCOMPILE__EOF__ -+ cat <<__DOLTCOMPILE__EOF__ >>doltcompile -+"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$? -+__DOLTCOMPILE__EOF__ -+ fi -+ -+dnl Write out static compilation code. -+dnl Avoid duplicate compiler output if also building shared objects. -+ if test x$enable_static = xyes; then -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+non_pic_object="$obj.o" -+args@<:@$objarg@:>@="$non_pic_object" -+__DOLTCOMPILE__EOF__ -+ if test x$enable_shared = xyes; then -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $? -+__DOLTCOMPILE__EOF__ -+ else -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+"${args@<:@@@:>@}" || exit $? -+__DOLTCOMPILE__EOF__ -+ fi -+ fi -+ -+dnl Write out the code to write the .lo file. -+dnl The second line of the .lo file must match "^# Generated by .*libtool" -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+{ -+echo "# $lo - a libtool object file" -+echo "# Generated by doltcompile, not libtool" -+__DOLTCOMPILE__EOF__ -+ -+ if test x$enable_shared = xyes; then -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+echo "pic_object='.libs/${objbase}.o'" -+__DOLTCOMPILE__EOF__ -+ else -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+echo pic_object=none -+__DOLTCOMPILE__EOF__ -+ fi -+ -+ if test x$enable_static = xyes; then -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+echo "non_pic_object='${objbase}.o'" -+__DOLTCOMPILE__EOF__ -+ else -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+echo non_pic_object=none -+__DOLTCOMPILE__EOF__ -+ fi -+ -+ cat <<'__DOLTCOMPILE__EOF__' >>doltcompile -+} > "$lo" -+__DOLTCOMPILE__EOF__ -+ -+dnl Done writing out doltcompile; substitute it for libtool compilation. -+ chmod +x doltcompile -+ LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)' -+ LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)' -+ -+dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for -+dnl a target, so write out a libtool wrapper to handle that case. -+dnl Note that doltlibtool does not handle inferred tags or option arguments -+dnl without '=', because automake does not use them. -+ cat <<__DOLTLIBTOOL__EOF__ > doltlibtool -+#!$DOLT_BASH -+__DOLTLIBTOOL__EOF__ -+ cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool -+top_builddir_slash="${0%%doltlibtool}" -+: ${top_builddir_slash:=./} -+args=() -+modeok=false -+tagok=false -+for arg in "$[]@"; do -+ case "$arg" in -+ --silent) ;; -+ --mode=compile) modeok=true ;; -+ --tag=CC|--tag=CXX) tagok=true ;; -+ *) args@<:@${#args[@]}@:>@="$arg" ;; -+ esac -+done -+if $modeok && $tagok ; then -+ . ${top_builddir_slash}doltcompile "${args@<:@@@:>@}" -+else -+ exec ${top_builddir_slash}libtool "$[]@" -+fi -+__DOLTLIBTOOL__EOF__ -+ -+dnl Done writing out doltlibtool; substitute it for libtool. -+ chmod +x doltlibtool -+ LIBTOOL='$(top_builddir)/doltlibtool' -+fi -+AC_SUBST(LTCOMPILE) -+AC_SUBST(LTCXXCOMPILE) -+# end dolt -+]) -diff --git a/m4/shave.m4 b/m4/shave.m4 -new file mode 100644 -index 0000000..0c2c9f5 ---- /dev/null -+++ b/m4/shave.m4 -@@ -0,0 +1,73 @@ -+dnl Make automake/libtool output more friendly to humans -+dnl -+dnl SHAVE_INIT([shavedir],[default_mode]) -+dnl -+dnl shavedir: the directory where the shave scripts are, it defaults to -+dnl $(top_builddir) -+dnl default_mode: (enable|disable) default shave mode. This parameter -+dnl controls shave's behaviour when no option has been -+dnl given to configure. It defaults to disable. -+dnl -+dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just -+dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and -+dnl LIBTOOL, you don't want the configure tests to have these variables -+dnl re-defined. -+dnl * This macro requires GNU make's -s option. -+ -+AC_DEFUN([_SHAVE_ARG_ENABLE], -+[ -+ AC_ARG_ENABLE([shave], -+ AS_HELP_STRING( -+ [--enable-shave], -+ [use shave to make the build pretty [[default=$1]]]),, -+ [enable_shave=$1] -+ ) -+]) -+ -+AC_DEFUN([SHAVE_INIT], -+[ -+ dnl you can tweak the default value of enable_shave -+ m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)]) -+ -+ if test x"$enable_shave" = xyes; then -+ dnl where can we find the shave scripts? -+ m4_if([$1],, -+ [shavedir="$ac_pwd"], -+ [shavedir="$ac_pwd/$1"]) -+ AC_SUBST(shavedir) -+ -+ dnl make is now quiet -+ AC_SUBST([MAKEFLAGS], [-s]) -+ AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`']) -+ -+ dnl we need sed -+ AC_CHECK_PROG(SED,sed,sed,false) -+ -+ dnl substitute libtool -+ SHAVE_SAVED_LIBTOOL=$LIBTOOL -+ LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'" -+ AC_SUBST(LIBTOOL) -+ -+ dnl substitute cc/cxx -+ SHAVE_SAVED_CC=$CC -+ SHAVE_SAVED_CXX=$CXX -+ SHAVE_SAVED_FC=$FC -+ SHAVE_SAVED_F77=$F77 -+ CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}" -+ CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}" -+ FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}" -+ F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}" -+ AC_SUBST(CC) -+ AC_SUBST(CXX) -+ AC_SUBST(FC) -+ AC_SUBST(F77) -+ -+ V=@ -+ else -+ V=1 -+ fi -+ Q='$(V:1=)' -+ AC_SUBST(V) -+ AC_SUBST(Q) -+]) -+ -diff --git a/man/Makefile.am b/man/Makefile.am -index 7432d5a..ac08621 100644 ---- a/man/Makefile.am -+++ b/man/Makefile.am -@@ -25,21 +25,12 @@ - # - - drivermandir = $(DRIVER_MAN_DIR) -+driverman_DATA = $(DRIVER_NAME).$(DRIVER_MAN_SUFFIX) - --DRIVER_MAN_DIR_SUFFIX = $(DRIVER_MAN_DIR:@mandir@/man%=%) -- --driverman_PRE = @DRIVER_NAME@.man -- --driverman_DATA = \ -- $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) \ -- i810.@DRIVER_MAN_SUFFIX@ -- --EXTRA_DIST = @DRIVER_NAME@.man -+EXTRA_DIST = $(DRIVER_NAME).man - - CLEANFILES = $(driverman_DATA) - --SED = sed -- - # Strings to replace in man pages - XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 -@@ -60,10 +51,3 @@ SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man - - .man.$(DRIVER_MAN_SUFFIX): - sed $(MAN_SUBSTS) < $< > $@ -- --BUILT_SOURCES = shadows.DONE -- --shadows.DONE: -- -rm -f i810.@DRIVER_MAN_SUFFIX@ -- echo .so man$(DRIVER_MAN_DIR_SUFFIX)/intel.$(DRIVER_MAN_SUFFIX) > \ -- i810.@DRIVER_MAN_SUFFIX@ -diff --git a/man/intel.man b/man/intel.man -index ee237f8..f85d3d1 100644 ---- a/man/intel.man -+++ b/man/intel.man -@@ -146,15 +146,6 @@ have options for selecting adaptors. - .IP - Default: Textured video adaptor is preferred. - .TP --.BI "Option \*qLegacy3D\*q \*q" boolean \*q --Enable support for the non-GEM mode of the 3D driver on i830 and newer. --This will allocate a large static area for older Mesa to use for its texture --pool. On systems with a working GEM environment, this can be disabled to --increase the memory pool available to other graphics tasks. --.IP --Default for i830 and newer: Enabled. --.IP --Default for i810: this option is not used. - .BI "Option \*qAccelMethod\*q \*q" string \*q - Choose acceleration architecture, either "XAA", "EXA", or "UXA". XAA is the old - XFree86 based acceleration architecture. EXA is a simpler -@@ -322,7 +313,7 @@ This property allows you to control the output standard used on your TV output p - .B TV_Connector - - connector type - .TP 2 --This config option should be added to xorg.conf TV monitor's section, it allows you to control the TV output connector type, which bypass load detect. You can select between S-Video, Composite and Component. -+This config option should be added to xorg.conf TV monitor's section, it allows you to force the TV output connector type, which bypass load detect and TV will always be taken as connected. You can select between S-Video, Composite and Component. - - .SS "TMDS-1" - First DVI SDVO output -@@ -330,6 +321,14 @@ First DVI SDVO output - .SS "TMDS-2" - Second DVI SDVO output - -+.SS "TMDS-1", "TMDS-2", "HDMI-1", "HDMI-2" -+DVI/HDMI outputs. Avaliable common properties include: -+.PP -+.B BROADCAST_RGB -+- method used to set RGB color range(full range 0-255, not full range 16-235) -+.TP 2 -+Adjusting this propertie allows you to set RGB color range on each channel in order to match HDTV requirment(default 0 for full range). Setting 1 means RGB color range is 16-235, 0 means RGB color range is 0-255 on each channel. -+ - .PP - SDVO and DVO TV outputs are not supported by the driver at this time. - -@@ -460,10 +459,11 @@ You can use the "xvattr" tool to query/set those attributes at runtime. - - .SS "XV_SYNC_TO_VBLANK" - XV_SYNC_TO_VBLANK is used to control whether textured adapter synchronizes --the screen update to the vblank to eliminate tearing. It has three --values 'auto'(-1), 'off'(0) and 'on(1). 'off' means never sync, 'on' means --always sync, no matter what size, and 'auto' means sync if the Xv image is --more than quarter of the pixels on the screen. The default is 'auto'(-1). -+the screen update to the vblank to eliminate tearing. It is a Boolean -+attribute with values of 0 (never sync) or 1 (always sync). An historic -+value of -1 (sync for large windows only) will now be interpreted as 1, -+(since the current approach for sync is not costly even with small -+video windows). - - .SS "XV_BRIGHTNESS" - -diff --git a/shave-libtool.in b/shave-libtool.in -new file mode 100644 -index 0000000..1f3a720 ---- /dev/null -+++ b/shave-libtool.in -@@ -0,0 +1,69 @@ -+#!/bin/sh -+ -+# we need sed -+SED=@SED@ -+if test -z "$SED" ; then -+SED=sed -+fi -+ -+lt_unmangle () -+{ -+ last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` -+} -+ -+# the real libtool to use -+LIBTOOL="$1" -+shift -+ -+# if 1, don't print anything, the underlaying wrapper will do it -+pass_though=0 -+ -+# scan the arguments, keep the right ones for libtool, and discover the mode -+preserved_args= -+while test "$#" -gt 0; do -+ opt="$1" -+ shift -+ -+ case $opt in -+ --mode=*) -+ mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` -+ preserved_args="$preserved_args $opt" -+ ;; -+ -o) -+ lt_output="$1" -+ preserved_args="$preserved_args $opt" -+ ;; -+ *) -+ preserved_args="$preserved_args $opt" -+ ;; -+ esac -+done -+ -+case "$mode" in -+compile) -+ # shave will be called and print the actual CC/CXX/LINK line -+ preserved_args="$preserved_args --shave-mode=$mode" -+ pass_though=1 -+ ;; -+link) -+ preserved_args="$preserved_args --shave-mode=$mode" -+ Q=" LINK " -+ ;; -+*) -+ # let's u -+ # echo "*** libtool: Unimplemented mode: $mode, fill a bug report" -+ ;; -+esac -+ -+lt_unmangle "$lt_output" -+output=$last_result -+ -+if test -z $V; then -+ if test $pass_though -eq 0; then -+ echo "$Q$output" -+ fi -+ $LIBTOOL --silent $preserved_args -+else -+ echo $LIBTOOL $preserved_args -+ $LIBTOOL $preserved_args -+fi -diff --git a/shave.in b/shave.in -new file mode 100644 -index 0000000..174641e ---- /dev/null -+++ b/shave.in -@@ -0,0 +1,76 @@ -+#!/bin/sh -+ -+# we need sed -+SED=@SED@ -+if test -z "$SED" ; then -+SED=sed -+fi -+ -+lt_unmangle () -+{ -+ last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` -+} -+ -+# the tool to wrap (cc, cxx, ar, ranlib, ..) -+tool="$1" -+shift -+ -+# the reel tool (to call) -+REEL_TOOL="$1" -+shift -+ -+pass_through=0 -+preserved_args= -+while test "$#" -gt 0; do -+ opt="$1" -+ shift -+ -+ case $opt in -+ --shave-mode=*) -+ mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'` -+ ;; -+ -o) -+ lt_output="$1" -+ preserved_args="$preserved_args $opt" -+ ;; -+ *) -+ preserved_args="$preserved_args $opt" -+ ;; -+ esac -+done -+ -+# mode=link is handled in the libtool wrapper -+case "$mode,$tool" in -+link,*) -+ pass_through=1 -+ ;; -+*,cxx) -+ Q=" CXX " -+ ;; -+*,cc) -+ Q=" CC " -+ ;; -+*,fc) -+ Q=" FC " -+ ;; -+*,f77) -+ Q=" F77 " -+ ;; -+*,*) -+ # should not happen -+ Q=" CC " -+ ;; -+esac -+ -+lt_unmangle "$lt_output" -+output=$last_result -+ -+if test -z $V; then -+ if test $pass_through -eq 0; then -+ echo "$Q$output" -+ fi -+ $REEL_TOOL $preserved_args -+else -+ echo $REEL_TOOL $preserved_args -+ $REEL_TOOL $preserved_args -+fi -diff --git a/src/Makefile.am b/src/Makefile.am -index e05dbab..ad87afc 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -220,9 +220,3 @@ if XVMC - intel_drv_la_SOURCES += \ - $(INTEL_XVMC_SRCS) - endif -- --install-data-local: install-intel_drv_laLTLIBRARIES -- (cd $(DESTDIR)$(intel_drv_ladir) && rm -f i810_drv.so && ln -s intel_drv.so i810_drv.so) -- --uninstall-local: -- (cd $(DESTDIR)$(intel_drv_ladir) && rm -f i810_drv.so) -diff --git a/src/drmmode_display.c b/src/drmmode_display.c -index 141c027..7b97a64 100644 ---- a/src/drmmode_display.c -+++ b/src/drmmode_display.c -@@ -35,6 +35,7 @@ - #include "i830.h" - #include "intel_bufmgr.h" - #include "xf86drmMode.h" -+#include "X11/Xatom.h" - - typedef struct { - int fd; -@@ -52,14 +53,26 @@ typedef struct { - } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; - - typedef struct { -+ drmModePropertyPtr mode_prop; -+ uint64_t value; -+ int num_atoms; /* if range prop, num_atoms == 1; if enum prop, num_atoms == num_enums + 1 */ -+ Atom *atoms; -+} drmmode_prop_rec, *drmmode_prop_ptr; -+ -+typedef struct { - drmmode_ptr drmmode; - int output_id; - drmModeConnectorPtr mode_output; - drmModeEncoderPtr mode_encoder; - drmModePropertyBlobPtr edid_blob; -+ int num_props; -+ drmmode_prop_ptr props; - } drmmode_output_private_rec, *drmmode_output_private_ptr; - - static void -+drmmode_output_dpms(xf86OutputPtr output, int mode); -+ -+static void - drmmode_ConvertFromKMode(ScrnInfoPtr scrn, - drmModeModeInfoPtr kmode, - DisplayModePtr mode) -@@ -210,6 +223,16 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, - else - ret = TRUE; - -+ /* Turn on any outputs on this crtc that may have been disabled */ -+ for (i = 0; i < xf86_config->num_output; i++) { -+ xf86OutputPtr output = xf86_config->output[i]; -+ -+ if (output->crtc != crtc) -+ continue; -+ -+ drmmode_output_dpms(output, DPMSModeOn); -+ } -+ - done: - if (!ret) { - crtc->x = saved_x; -@@ -359,7 +382,7 @@ drmmode_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *dat - * unbound. */ - drmModeRmFB(drmmode->fd, drmmode_crtc->rotate_fb_id); - drmmode_crtc->rotate_fb_id = 0; -- drm_intel_bo_unmap(drmmode_crtc->rotate_bo); -+ drm_intel_gem_bo_unmap_gtt(drmmode_crtc->rotate_bo); - dri_bo_unreference(drmmode_crtc->rotate_bo); - drmmode_crtc->rotate_bo = NULL; - } -@@ -495,9 +518,15 @@ static void - drmmode_output_destroy(xf86OutputPtr output) - { - drmmode_output_private_ptr drmmode_output = output->driver_private; -+ int i; - - if (drmmode_output->edid_blob) - drmModeFreePropertyBlob(drmmode_output->edid_blob); -+ for (i = 0; i < drmmode_output->num_props; i++) { -+ drmModeFreeProperty(drmmode_output->props[i].mode_prop); -+ xfree(drmmode_output->props[i].atoms); -+ } -+ xfree(drmmode_output->props); - drmModeFreeConnector(drmmode_output->mode_output); - xfree(drmmode_output); - output->driver_private = NULL; -@@ -529,7 +558,162 @@ drmmode_output_dpms(xf86OutputPtr output, int mode) - } - } - -+static Bool -+drmmode_property_ignore(drmModePropertyPtr prop) -+{ -+ if (!prop) -+ return TRUE; -+ /* ignore blob prop */ -+ if (prop->flags & DRM_MODE_PROP_BLOB) -+ return TRUE; -+ /* ignore standard property */ -+ if (!strcmp(prop->name, "EDID") || -+ !strcmp(prop->name, "DPMS")) -+ return TRUE; -+ -+ return FALSE; -+} -+ -+static void -+drmmode_output_create_resources(xf86OutputPtr output) -+{ -+ drmmode_output_private_ptr drmmode_output = output->driver_private; -+ drmModeConnectorPtr mode_output = drmmode_output->mode_output; -+ drmmode_ptr drmmode = drmmode_output->drmmode; -+ drmModePropertyPtr drmmode_prop; -+ int i, j, err; -+ -+ drmmode_output->props = xcalloc(mode_output->count_props, sizeof(drmmode_prop_rec)); -+ if (!drmmode_output->props) -+ return; -+ -+ drmmode_output->num_props = 0; -+ for (i = 0, j = 0; i < mode_output->count_props; i++) { -+ drmmode_prop = drmModeGetProperty(drmmode->fd, mode_output->props[i]); -+ if (drmmode_property_ignore(drmmode_prop)) { -+ drmModeFreeProperty(drmmode_prop); -+ continue; -+ } -+ drmmode_output->props[j].mode_prop = drmmode_prop; -+ drmmode_output->props[j].value = mode_output->prop_values[i]; -+ drmmode_output->num_props++; -+ j++; -+ } -+ -+ for (i = 0; i < drmmode_output->num_props; i++) { -+ drmmode_prop_ptr p = &drmmode_output->props[i]; -+ drmmode_prop = p->mode_prop; -+ -+ if (drmmode_prop->flags & DRM_MODE_PROP_RANGE) { -+ INT32 range[2]; -+ -+ p->num_atoms = 1; -+ p->atoms = xcalloc(p->num_atoms, sizeof(Atom)); -+ if (!p->atoms) -+ continue; -+ p->atoms[0] = MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); -+ range[0] = drmmode_prop->values[0]; -+ range[1] = drmmode_prop->values[1]; -+ err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], -+ FALSE, TRUE, -+ drmmode_prop->flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE, -+ 2, range); -+ if (err != 0) { -+ xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, -+ "RRConfigureOutputProperty error, %d\n", err); -+ } -+ err = RRChangeOutputProperty(output->randr_output, p->atoms[0], -+ XA_INTEGER, 32, PropModeReplace, 1, &p->value, FALSE, TRUE); -+ if (err != 0) { -+ xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, -+ "RRChangeOutputProperty error, %d\n", err); -+ } -+ } else if (drmmode_prop->flags & DRM_MODE_PROP_ENUM) { -+ p->num_atoms = drmmode_prop->count_enums + 1; -+ p->atoms = xcalloc(p->num_atoms, sizeof(Atom)); -+ if (!p->atoms) -+ continue; -+ p->atoms[0] = MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); -+ for (j = 1; j <= drmmode_prop->count_enums; j++) { -+ struct drm_mode_property_enum *e = &drmmode_prop->enums[j-1]; -+ p->atoms[j] = MakeAtom(e->name, strlen(e->name), TRUE); -+ } -+ err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], -+ FALSE, FALSE, -+ drmmode_prop->flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE, -+ p->num_atoms - 1, (INT32 *)&p->atoms[1]); -+ if (err != 0) { -+ xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, -+ "RRConfigureOutputProperty error, %d\n", err); -+ } -+ for (j = 0; j < drmmode_prop->count_enums; j++) -+ if (drmmode_prop->enums[j].value == p->value) -+ break; -+ /* there's always a matching value */ -+ err = RRChangeOutputProperty(output->randr_output, p->atoms[0], -+ XA_ATOM, 32, PropModeReplace, 1, &p->atoms[j+1], FALSE, TRUE); -+ if (err != 0) { -+ xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, -+ "RRChangeOutputProperty error, %d\n", err); -+ } -+ } -+ } -+} -+ -+static Bool -+drmmode_output_set_property(xf86OutputPtr output, Atom property, -+ RRPropertyValuePtr value) -+{ -+ drmmode_output_private_ptr drmmode_output = output->driver_private; -+ drmmode_ptr drmmode = drmmode_output->drmmode; -+ int i; -+ -+ for (i = 0; i < drmmode_output->num_props; i++) { -+ drmmode_prop_ptr p = &drmmode_output->props[i]; -+ -+ if (p->atoms[0] != property) -+ continue; -+ -+ if (p->mode_prop->flags & DRM_MODE_PROP_RANGE) { -+ uint32_t val; -+ -+ if (value->type != XA_INTEGER || value->format != 32 || -+ value->size != 1) -+ return FALSE; -+ val = *(uint32_t *)value->data; -+ -+ drmModeConnectorSetProperty(drmmode->fd, drmmode_output->output_id, -+ p->mode_prop->prop_id, (uint64_t)val); -+ return TRUE; -+ } else if (p->mode_prop->flags & DRM_MODE_PROP_ENUM) { -+ Atom atom; -+ const char *name; -+ int j; -+ -+ if (value->type != XA_ATOM || value->format != 32 || value->size != 1) -+ return FALSE; -+ memcpy(&atom, value->data, 4); -+ name = NameForAtom(atom); -+ -+ /* search for matching name string, then set its value down */ -+ for (j = 0; j < p->mode_prop->count_enums; j++) { -+ if (!strcmp(p->mode_prop->enums[j].name, name)) { -+ drmModeConnectorSetProperty(drmmode->fd, drmmode_output->output_id, -+ p->mode_prop->prop_id, p->mode_prop->enums[j].value); -+ return TRUE; -+ } -+ } -+ } -+ } -+ /* no property found? */ -+ return FALSE; -+} -+ - static const xf86OutputFuncsRec drmmode_output_funcs = { -+ .create_resources = drmmode_output_create_resources, -+#ifdef RANDR_12_INTERFACE -+ .set_property = drmmode_output_set_property, -+#endif - .dpms = drmmode_output_dpms, - #if 0 - -diff --git a/src/i810.h b/src/i810.h -index 7ea2043..c88771e 100644 ---- a/src/i810.h -+++ b/src/i810.h -@@ -70,7 +70,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #define I810_VERSION 4000 - #define I810_NAME "intel" - #define I810_DRIVER_NAME "intel" --#define I810_LEGACY_DRIVER_NAME "i810" - - #define INTEL_VERSION_MAJOR PACKAGE_VERSION_MAJOR - #define INTEL_VERSION_MINOR PACKAGE_VERSION_MINOR -diff --git a/src/i810_driver.c b/src/i810_driver.c -index 6ae388d..fe4bd62 100644 ---- a/src/i810_driver.c -+++ b/src/i810_driver.c -@@ -472,21 +472,6 @@ static XF86ModuleVersionInfo intelVersRec = { - - _X_EXPORT XF86ModuleData intelModuleData = { &intelVersRec, i810Setup, NULL }; - --static XF86ModuleVersionInfo i810VersRec = { -- "i810", -- MODULEVENDORSTRING, -- MODINFOSTRING1, -- MODINFOSTRING2, -- XORG_VERSION_CURRENT, -- INTEL_VERSION_MAJOR, INTEL_VERSION_MINOR, INTEL_VERSION_PATCH, -- ABI_CLASS_VIDEODRV, -- ABI_VIDEODRV_VERSION, -- MOD_CLASS_VIDEODRV, -- {0, 0, 0, 0} --}; -- --_X_EXPORT XF86ModuleData i810ModuleData = { &i810VersRec, i810Setup, NULL }; -- - static pointer - i810Setup(pointer module, pointer opts, int *errmaj, int *errmin) - { -@@ -681,9 +666,7 @@ I810Probe(DriverPtr drv, int flags) - * driver, and return if there are none. - */ - if ((numDevSections = -- xf86MatchDevice(I810_DRIVER_NAME, &devSections)) <= 0 && -- (numDevSections = -- xf86MatchDevice(I810_LEGACY_DRIVER_NAME, &devSections)) <= 0) { -+ xf86MatchDevice(I810_DRIVER_NAME, &devSections)) <= 0 ) { - return FALSE; - } - -diff --git a/src/i810_reg.h b/src/i810_reg.h -index 3114b42..d5d41b3 100644 ---- a/src/i810_reg.h -+++ b/src/i810_reg.h -@@ -114,6 +114,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #define BITBLT_STATUS 0x01 - - #define CHDECMISC 0x10111 -+#define DCC 0x10200 - #define C0DRB0 0x10200 - #define C0DRB1 0x10202 - #define C0DRB2 0x10204 -@@ -1299,6 +1300,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #define SDVO_ENCODING_HDMI (0x2 << 10) - /** Requird for HDMI operation */ - #define SDVO_NULL_PACKETS_DURING_VSYNC (1 << 9) -+#define SDVO_COLOR_NOT_FULL_RANGE (1 << 8) - #define SDVO_BORDER_ENABLE (1 << 7) - #define SDVO_AUDIO_ENABLE (1 << 6) - /** New with 965, default is to be set */ -@@ -2435,12 +2437,19 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #define MI_OVERLAY_FLIP_OFF (2<<21) - - /* Wait for Events */ --#define MI_WAIT_FOR_EVENT (0x03<<23) --#define MI_WAIT_FOR_PIPEB_SVBLANK (1<<18) --#define MI_WAIT_FOR_PIPEA_SVBLANK (1<<17) --#define MI_WAIT_FOR_OVERLAY_FLIP (1<<16) --#define MI_WAIT_FOR_PIPEB_VBLANK (1<<7) --#define MI_WAIT_FOR_PIPEA_VBLANK (1<<3) -+#define MI_WAIT_FOR_EVENT (0x03<<23) -+#define MI_WAIT_FOR_PIPEB_SVBLANK (1<<18) -+#define MI_WAIT_FOR_PIPEA_SVBLANK (1<<17) -+#define MI_WAIT_FOR_OVERLAY_FLIP (1<<16) -+#define MI_WAIT_FOR_PIPEB_VBLANK (1<<7) -+#define MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW (1<<5) -+#define MI_WAIT_FOR_PIPEA_VBLANK (1<<3) -+#define MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW (1<<1) -+ -+/* Set the scan line for MI_WAIT_FOR_PIPE?_SCAN_LINE_WINDOW */ -+#define MI_LOAD_SCAN_LINES_INCL (0x12<<23) -+#define MI_LOAD_SCAN_LINES_DISPLAY_PIPEA (0) -+#define MI_LOAD_SCAN_LINES_DISPLAY_PIPEB (0x1<<20) - - /* Flush */ - #define MI_FLUSH (0x04<<23) -diff --git a/src/i830_bios.c b/src/i830_bios.c -index 7f20553..4f2355d 100644 ---- a/src/i830_bios.c -+++ b/src/i830_bios.c -@@ -161,7 +161,7 @@ parse_general_features(I830Ptr pI830, struct bdb_header *bdb) - pI830->tv_present = general->int_tv_support; - pI830->lvds_use_ssc = general->enable_ssc; - if (pI830->lvds_use_ssc) { -- if (IS_I855(pI830)) -+ if (IS_I85X(pI830)) - pI830->lvds_ssc_freq = general->ssc_freq ? 66 : 48; - else - pI830->lvds_ssc_freq = general->ssc_freq ? 100 : 96; -@@ -181,6 +181,12 @@ parse_driver_feature(I830Ptr pI830, struct bdb_header *bdb) - if (!IS_I9XX(pI830)) - return; - -+ /* XXX Disable this parsing, as it looks doesn't work for all -+ VBIOS. Reenable it if we could find out the reliable VBT parsing -+ for LVDS config later. */ -+ if (1) -+ return; -+ - feature = find_section(bdb, BDB_DRIVER_FEATURES); - if (!feature) - return; -diff --git a/src/i830_debug.c b/src/i830_debug.c -index ed8843e..86f5f21 100644 ---- a/src/i830_debug.c -+++ b/src/i830_debug.c -@@ -53,6 +53,33 @@ DEBUGSTRING(i830_16bit_func) - return XNFprintf("0x%04x", (uint16_t)val); - } - -+DEBUGSTRING(i830_debug_dcc) -+{ -+ char *addressing = NULL; -+ -+ if (!IS_MOBILE(pI830)) -+ return NULL; -+ -+ if (IS_I965G(pI830)) { -+ if (val & (1 << 1)) -+ addressing = "dual channel interleaved"; -+ else -+ addressing = "single or dual channel asymmetric"; -+ } else { -+ switch (val & 3) { -+ case 0: addressing = "single channel"; break; -+ case 1: addressing = "dual channel asymmetric"; break; -+ case 2: addressing = "dual channel interleaved"; break; -+ case 3: addressing = "unknown channel layout"; break; -+ } -+ } -+ -+ return XNFprintf("%s, XOR randomization: %sabled, XOR bit: %d", -+ addressing, -+ (val & (1 << 10)) ? "dis" : "en", -+ (val & (1 << 9)) ? 17 : 11); -+} -+ - DEBUGSTRING(i830_debug_chdecmisc) - { - char *enhmodesel = NULL; -@@ -503,24 +530,48 @@ DEBUGSTRING(i830_debug_dspclk_gate_d) - OVLUNIT); - } - --#if 1 --DEBUGSTRING(i810_debug_fence_start) -+ -+DEBUGSTRING(i810_debug_915_fence) -+{ -+ char *enable = (val & 1) ? " enabled" : "disabled"; -+ char format = (val & 1 << 12) ? 'Y' : 'X'; -+ int pitch = 1 << (((val & 0x70) >> 4) - 1); -+ unsigned int offset = val & 0x0ff00000; -+ int size = (1024 * 1024) << (((val & 0x700) >> 8) - 1); -+ -+ if (IS_I965G(pI830) || ((IS_I915G(pI830) || IS_I915GM(pI830)) && reg >= FENCE_NEW)) -+ return NULL; -+ -+ if (format == 'X') -+ pitch *= 4; -+ -+ return XNFprintf("%s, %c tiled, %4d pitch, 0x%08x - 0x%08x (%dkb)", -+ enable, format, pitch, offset, offset + size, size / 1024); -+} -+ -+DEBUGSTRING(i810_debug_965_fence_start) - { - char *enable = (val & FENCE_VALID) ? " enabled" : "disabled"; - char format = (val & I965_FENCE_Y_MAJOR) ? 'Y' : 'X'; - int pitch = ((val & 0xffc) >> 2) * 128; - unsigned int offset = val & 0xfffff000; - -+ if (!IS_I965G(pI830)) -+ return NULL; -+ - return XNFprintf("%s, %c tile walk, %4d pitch, 0x%08x start", - enable, format, pitch, offset); - } --DEBUGSTRING(i810_debug_fence_end) -+ -+DEBUGSTRING(i810_debug_965_fence_end) - { - unsigned int end = val & 0xfffff000; - -+ if (!IS_I965G(pI830)) -+ return NULL; -+ - return XNFprintf(" 0x%08x end", end); - } --#endif - - #define DEFINEREG(reg) \ - { reg, #reg, NULL, 0 } -@@ -535,6 +586,7 @@ static struct i830SnapshotRec { - char *(*debug_output)(I830Ptr pI830, int reg, uint32_t val); - uint32_t val; - } i830_snapshot[] = { -+ DEFINEREG2(DCC, i830_debug_dcc), - DEFINEREG2(CHDECMISC, i830_debug_chdecmisc), - DEFINEREG_16BIT(C0DRB0), - DEFINEREG_16BIT(C0DRB1), -@@ -549,6 +601,8 @@ static struct i830SnapshotRec { - DEFINEREG_16BIT(C1DRA01), - DEFINEREG_16BIT(C1DRA23), - -+ DEFINEREG(PGETBL_CTL), -+ - DEFINEREG2(VCLK_DIVISOR_VGA0, i830_debug_fp), - DEFINEREG2(VCLK_DIVISOR_VGA1, i830_debug_fp), - DEFINEREG2(VCLK_POST_DIV, i830_debug_vga_pd), -@@ -715,27 +769,48 @@ static struct i830SnapshotRec { - DEFINEREG(DPD_AUX_CH_DATA4), - DEFINEREG(DPD_AUX_CH_DATA5), - --#define DEFINEFENCE(i) \ -- { FENCE_NEW+i*8, "FENCE START " #i, i810_debug_fence_start, 0 }, \ -- { FENCE_NEW+i*8+4, "FENCE END " #i, i810_debug_fence_end, 0 } --#if 1 -- DEFINEFENCE(0), -- DEFINEFENCE(1), -- DEFINEFENCE(2), -- DEFINEFENCE(3), -- DEFINEFENCE(4), -- DEFINEFENCE(5), -- DEFINEFENCE(6), -- DEFINEFENCE(7), -- DEFINEFENCE(8), -- DEFINEFENCE(9), -- DEFINEFENCE(10), -- DEFINEFENCE(11), -- DEFINEFENCE(12), -- DEFINEFENCE(13), -- DEFINEFENCE(14), -- DEFINEFENCE(15), --#endif -+#define DEFINEFENCE_915(i) \ -+ { FENCE+i*4, "FENCE " #i, i810_debug_915_fence, 0 } -+#define DEFINEFENCE_945(i) \ -+ { FENCE_NEW+(i - 8) * 4, "FENCE " #i, i810_debug_915_fence, 0 } -+ -+ DEFINEFENCE_915(0), -+ DEFINEFENCE_915(1), -+ DEFINEFENCE_915(2), -+ DEFINEFENCE_915(3), -+ DEFINEFENCE_915(4), -+ DEFINEFENCE_915(5), -+ DEFINEFENCE_915(6), -+ DEFINEFENCE_915(7), -+ DEFINEFENCE_945(8), -+ DEFINEFENCE_945(9), -+ DEFINEFENCE_945(10), -+ DEFINEFENCE_945(11), -+ DEFINEFENCE_945(12), -+ DEFINEFENCE_945(13), -+ DEFINEFENCE_945(14), -+ DEFINEFENCE_945(15), -+ -+#define DEFINEFENCE_965(i) \ -+ { FENCE_NEW+i*8, "FENCE START " #i, i810_debug_965_fence_start, 0 }, \ -+ { FENCE_NEW+i*8+4, "FENCE END " #i, i810_debug_965_fence_end, 0 } -+ -+ DEFINEFENCE_965(0), -+ DEFINEFENCE_965(1), -+ DEFINEFENCE_965(2), -+ DEFINEFENCE_965(3), -+ DEFINEFENCE_965(4), -+ DEFINEFENCE_965(5), -+ DEFINEFENCE_965(6), -+ DEFINEFENCE_965(7), -+ DEFINEFENCE_965(8), -+ DEFINEFENCE_965(9), -+ DEFINEFENCE_965(10), -+ DEFINEFENCE_965(11), -+ DEFINEFENCE_965(12), -+ DEFINEFENCE_965(13), -+ DEFINEFENCE_965(14), -+ DEFINEFENCE_965(15), - }; - #undef DEFINEREG - #define NUM_I830_SNAPSHOTREGS (sizeof(i830_snapshot) / sizeof(i830_snapshot[0])) -@@ -853,9 +928,11 @@ void i830DumpRegs (ScrnInfoPtr pScrn) - char *debug = i830_snapshot[i].debug_output(pI830, - i830_snapshot[i].reg, - val); -- xf86DrvMsg (pScrn->scrnIndex, X_INFO, "%20.20s: 0x%08x (%s)\n", -- i830_snapshot[i].name, (unsigned int)val, debug); -- xfree(debug); -+ if (debug != NULL) { -+ xf86DrvMsg (pScrn->scrnIndex, X_INFO, "%20.20s: 0x%08x (%s)\n", -+ i830_snapshot[i].name, (unsigned int)val, debug); -+ xfree(debug); -+ } - } else { - xf86DrvMsg (pScrn->scrnIndex, X_INFO, "%20.20s: 0x%08x\n", - i830_snapshot[i].name, (unsigned int)val); -diff --git a/src/i830_display.c b/src/i830_display.c -index ca55906..dd1310f 100644 ---- a/src/i830_display.c -+++ b/src/i830_display.c -@@ -67,10 +67,13 @@ typedef struct { - - #define INTEL_P2_NUM 2 - --typedef struct { -+typedef struct intel_limit intel_limit_t; -+struct intel_limit { - intel_range_t dot, vco, n, m, m1, m2, p, p1; - intel_p2_t p2; --} intel_limit_t; -+ Bool (* find_pll)(const intel_limit_t *, xf86CrtcPtr, -+ int, int, intel_clock_t *); -+}; - - #define I8XX_DOT_MIN 25000 - #define I8XX_DOT_MAX 350000 -@@ -153,6 +156,95 @@ typedef struct { - #define INTEL_LIMIT_I9XX_LVDS 3 - #define INTEL_LIMIT_IGD_SDVO_DAC 4 - #define INTEL_LIMIT_IGD_LVDS 5 -+#define INTEL_LIMIT_G4X_SDVO 6 -+#define INTEL_LIMIT_G4X_HDMI_DAC 7 -+#define INTEL_LIMIT_G4X_SINGLE_LVDS 8 -+#define INTEL_LIMIT_G4X_DUAL_LVDS 9 -+ -+/*The parameter is for SDVO on G4x platform*/ -+#define G4X_VCO_MIN 1750000 -+#define G4X_VCO_MAX 3500000 -+#define G4X_DOT_SDVO_MIN 25000 -+#define G4X_DOT_SDVO_MAX 270000 -+#define G4X_N_SDVO_MIN 1 -+#define G4X_N_SDVO_MAX 4 -+#define G4X_M_SDVO_MIN 104 -+#define G4X_M_SDVO_MAX 138 -+#define G4X_M1_SDVO_MIN 17 -+#define G4X_M1_SDVO_MAX 23 -+#define G4X_M2_SDVO_MIN 5 -+#define G4X_M2_SDVO_MAX 11 -+#define G4X_P_SDVO_MIN 10 -+#define G4X_P_SDVO_MAX 30 -+#define G4X_P1_SDVO_MIN 1 -+#define G4X_P1_SDVO_MAX 3 -+#define G4X_P2_SDVO_SLOW 10 -+#define G4X_P2_SDVO_FAST 10 -+#define G4X_P2_SDVO_LIMIT 270000 -+ -+/*The parameter is for HDMI_DAC on G4x platform*/ -+#define G4X_DOT_HDMI_DAC_MIN 22000 -+#define G4X_DOT_HDMI_DAC_MAX 400000 -+#define G4X_N_HDMI_DAC_MIN 1 -+#define G4X_N_HDMI_DAC_MAX 4 -+#define G4X_M_HDMI_DAC_MIN 104 -+#define G4X_M_HDMI_DAC_MAX 138 -+#define G4X_M1_HDMI_DAC_MIN 16 -+#define G4X_M1_HDMI_DAC_MAX 23 -+#define G4X_M2_HDMI_DAC_MIN 5 -+#define G4X_M2_HDMI_DAC_MAX 11 -+#define G4X_P_HDMI_DAC_MIN 5 -+#define G4X_P_HDMI_DAC_MAX 80 -+#define G4X_P1_HDMI_DAC_MIN 1 -+#define G4X_P1_HDMI_DAC_MAX 8 -+#define G4X_P2_HDMI_DAC_SLOW 10 -+#define G4X_P2_HDMI_DAC_FAST 5 -+#define G4X_P2_HDMI_DAC_LIMIT 165000 -+ -+/*The parameter is for SINGLE_LVDS on G4x platform*/ -+#define G4X_DOT_SINGLE_LVDS_MIN 20000 -+#define G4X_DOT_SINGLE_LVDS_MAX 115000 -+#define G4X_N_SINGLE_LVDS_MIN 1 -+#define G4X_N_SINGLE_LVDS_MAX 3 -+#define G4X_M_SINGLE_LVDS_MIN 104 -+#define G4X_M_SINGLE_LVDS_MAX 138 -+#define G4X_M1_SINGLE_LVDS_MIN 17 -+#define G4X_M1_SINGLE_LVDS_MAX 23 -+#define G4X_M2_SINGLE_LVDS_MIN 5 -+#define G4X_M2_SINGLE_LVDS_MAX 11 -+#define G4X_P_SINGLE_LVDS_MIN 28 -+#define G4X_P_SINGLE_LVDS_MAX 112 -+#define G4X_P1_SINGLE_LVDS_MIN 2 -+#define G4X_P1_SINGLE_LVDS_MAX 8 -+#define G4X_P2_SINGLE_LVDS_SLOW 14 -+#define G4X_P2_SINGLE_LVDS_FAST 14 -+#define G4X_P2_SINGLE_LVDS_LIMIT 0 -+ -+/*The parameter is for DUAL_LVDS on G4x platform*/ -+#define G4X_DOT_DUAL_LVDS_MIN 80000 -+#define G4X_DOT_DUAL_LVDS_MAX 224000 -+#define G4X_N_DUAL_LVDS_MIN 1 -+#define G4X_N_DUAL_LVDS_MAX 3 -+#define G4X_M_DUAL_LVDS_MIN 104 -+#define G4X_M_DUAL_LVDS_MAX 138 -+#define G4X_M1_DUAL_LVDS_MIN 17 -+#define G4X_M1_DUAL_LVDS_MAX 23 -+#define G4X_M2_DUAL_LVDS_MIN 5 -+#define G4X_M2_DUAL_LVDS_MAX 11 -+#define G4X_P_DUAL_LVDS_MIN 14 -+#define G4X_P_DUAL_LVDS_MAX 42 -+#define G4X_P1_DUAL_LVDS_MIN 2 -+#define G4X_P1_DUAL_LVDS_MAX 6 -+#define G4X_P2_DUAL_LVDS_SLOW 7 -+#define G4X_P2_DUAL_LVDS_FAST 7 -+#define G4X_P2_DUAL_LVDS_LIMIT 0 -+ -+static Bool -+intel_find_pll_i8xx_and_i9xx(const intel_limit_t *, xf86CrtcPtr, -+ int, int, intel_clock_t *); -+static Bool -+intel_find_pll_g4x(const intel_limit_t *, xf86CrtcPtr, -+ int, int, intel_clock_t *); - - static const intel_limit_t intel_limits[] = { - { /* INTEL_LIMIT_I8XX_DVO_DAC */ -@@ -166,6 +258,7 @@ static const intel_limit_t intel_limits[] = { - .p1 = { .min = I8XX_P1_MIN, .max = I8XX_P1_MAX }, - .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, - .p2_slow = I8XX_P2_SLOW, .p2_fast = I8XX_P2_FAST }, -+ .find_pll = intel_find_pll_i8xx_and_i9xx, - }, - { /* INTEL_LIMIT_I8XX_LVDS */ - .dot = { .min = I8XX_DOT_MIN, .max = I8XX_DOT_MAX }, -@@ -178,6 +271,7 @@ static const intel_limit_t intel_limits[] = { - .p1 = { .min = I8XX_P1_LVDS_MIN, .max = I8XX_P1_LVDS_MAX }, - .p2 = { .dot_limit = I8XX_P2_SLOW_LIMIT, - .p2_slow = I8XX_P2_LVDS_SLOW, .p2_fast = I8XX_P2_LVDS_FAST }, -+ .find_pll = intel_find_pll_i8xx_and_i9xx, - }, - { /* INTEL_LIMIT_I9XX_SDVO_DAC */ - .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX }, -@@ -190,6 +284,7 @@ static const intel_limit_t intel_limits[] = { - .p1 = { .min = I9XX_P1_MIN, .max = I9XX_P1_MAX }, - .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, - .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, -+ .find_pll = intel_find_pll_i8xx_and_i9xx, - }, - { /* INTEL_LIMIT_I9XX_LVDS */ - .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX }, -@@ -205,6 +300,7 @@ static const intel_limit_t intel_limits[] = { - */ - .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, - .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_FAST }, -+ .find_pll = intel_find_pll_i8xx_and_i9xx, - }, - { /* INTEL_LIMIT_IGD_SDVO */ - .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX}, -@@ -217,6 +313,7 @@ static const intel_limit_t intel_limits[] = { - .p1 = { .min = I9XX_P1_MIN, .max = I9XX_P1_MAX }, - .p2 = { .dot_limit = I9XX_P2_SDVO_DAC_SLOW_LIMIT, - .p2_slow = I9XX_P2_SDVO_DAC_SLOW, .p2_fast = I9XX_P2_SDVO_DAC_FAST }, -+ .find_pll = intel_find_pll_i8xx_and_i9xx, - }, - { /* INTEL_LIMIT_IGD_LVDS */ - .dot = { .min = I9XX_DOT_MIN, .max = I9XX_DOT_MAX }, -@@ -230,16 +327,114 @@ static const intel_limit_t intel_limits[] = { - /* IGD only supports single-channel mode. */ - .p2 = { .dot_limit = I9XX_P2_LVDS_SLOW_LIMIT, - .p2_slow = I9XX_P2_LVDS_SLOW, .p2_fast = I9XX_P2_LVDS_SLOW }, -+ .find_pll = intel_find_pll_i8xx_and_i9xx, -+ }, -+ /* below parameter and function is for G4X Chipset Family*/ -+ { /* INTEL_LIMIT_G4X_SDVO */ -+ .dot = { .min = G4X_DOT_SDVO_MIN, .max = G4X_DOT_SDVO_MAX }, -+ .vco = { .min = G4X_VCO_MIN, .max = G4X_VCO_MAX}, -+ .n = { .min = G4X_N_SDVO_MIN, .max = G4X_N_SDVO_MAX }, -+ .m = { .min = G4X_M_SDVO_MIN, .max = G4X_M_SDVO_MAX }, -+ .m1 = { .min = G4X_M1_SDVO_MIN, .max = G4X_M1_SDVO_MAX }, -+ .m2 = { .min = G4X_M2_SDVO_MIN, .max = G4X_M2_SDVO_MAX }, -+ .p = { .min = G4X_P_SDVO_MIN, .max = G4X_P_SDVO_MAX }, -+ .p1 = { .min = G4X_P1_SDVO_MIN, .max = G4X_P1_SDVO_MAX}, -+ .p2 = { .dot_limit = G4X_P2_SDVO_LIMIT, -+ .p2_slow = G4X_P2_SDVO_SLOW, -+ .p2_fast = G4X_P2_SDVO_FAST }, -+ .find_pll = intel_find_pll_g4x, -+ }, -+ { /* INTEL_LIMIT_G4X_HDMI_DAC */ -+ .dot = { .min = G4X_DOT_HDMI_DAC_MIN, .max = G4X_DOT_HDMI_DAC_MAX }, -+ .vco = { .min = G4X_VCO_MIN, .max = G4X_VCO_MAX}, -+ .n = { .min = G4X_N_HDMI_DAC_MIN, .max = G4X_N_HDMI_DAC_MAX }, -+ .m = { .min = G4X_M_HDMI_DAC_MIN, .max = G4X_M_HDMI_DAC_MAX }, -+ .m1 = { .min = G4X_M1_HDMI_DAC_MIN, .max = G4X_M1_HDMI_DAC_MAX }, -+ .m2 = { .min = G4X_M2_HDMI_DAC_MIN, .max = G4X_M2_HDMI_DAC_MAX }, -+ .p = { .min = G4X_P_HDMI_DAC_MIN, .max = G4X_P_HDMI_DAC_MAX }, -+ .p1 = { .min = G4X_P1_HDMI_DAC_MIN, .max = G4X_P1_HDMI_DAC_MAX}, -+ .p2 = { .dot_limit = G4X_P2_HDMI_DAC_LIMIT, -+ .p2_slow = G4X_P2_HDMI_DAC_SLOW, -+ .p2_fast = G4X_P2_HDMI_DAC_FAST }, -+ .find_pll = intel_find_pll_g4x, -+ }, -+ { /* INTEL_LIMIT_G4X_SINGLE_LVDS */ -+ .dot = { .min = G4X_DOT_SINGLE_LVDS_MIN, -+ .max = G4X_DOT_SINGLE_LVDS_MAX }, -+ .vco = { .min = G4X_VCO_MIN, -+ .max = G4X_VCO_MAX }, -+ .n = { .min = G4X_N_SINGLE_LVDS_MIN, -+ .max = G4X_N_SINGLE_LVDS_MAX }, -+ .m = { .min = G4X_M_SINGLE_LVDS_MIN, -+ .max = G4X_M_SINGLE_LVDS_MAX }, -+ .m1 = { .min = G4X_M1_SINGLE_LVDS_MIN, -+ .max = G4X_M1_SINGLE_LVDS_MAX }, -+ .m2 = { .min = G4X_M2_SINGLE_LVDS_MIN, -+ .max = G4X_M2_SINGLE_LVDS_MAX }, -+ .p = { .min = G4X_P_SINGLE_LVDS_MIN, -+ .max = G4X_P_SINGLE_LVDS_MAX }, -+ .p1 = { .min = G4X_P1_SINGLE_LVDS_MIN, -+ .max = G4X_P1_SINGLE_LVDS_MAX }, -+ .p2 = { .dot_limit = G4X_P2_SINGLE_LVDS_LIMIT, -+ .p2_slow = G4X_P2_SINGLE_LVDS_SLOW, -+ .p2_fast = G4X_P2_SINGLE_LVDS_FAST }, -+ .find_pll = intel_find_pll_g4x, -+ }, -+ { /* INTEL_LIMIT_G4X_DUAL_LVDS */ -+ .dot = { .min = G4X_DOT_DUAL_LVDS_MIN, -+ .max = G4X_DOT_DUAL_LVDS_MAX }, -+ .vco = { .min = G4X_VCO_MIN, -+ .max = G4X_VCO_MAX}, -+ .n = { .min = G4X_N_DUAL_LVDS_MIN, -+ .max = G4X_N_DUAL_LVDS_MAX }, -+ .m = { .min = G4X_M_DUAL_LVDS_MIN, -+ .max = G4X_M_DUAL_LVDS_MAX }, -+ .m1 = { .min = G4X_M1_DUAL_LVDS_MIN, -+ .max = G4X_M1_DUAL_LVDS_MAX }, -+ .m2 = { .min = G4X_M2_DUAL_LVDS_MIN, -+ .max = G4X_M2_DUAL_LVDS_MAX }, -+ .p = { .min = G4X_P_DUAL_LVDS_MIN, -+ .max = G4X_P_DUAL_LVDS_MAX }, -+ .p1 = { .min = G4X_P1_DUAL_LVDS_MIN, -+ .max = G4X_P1_DUAL_LVDS_MAX}, -+ .p2 = { .dot_limit = G4X_P2_DUAL_LVDS_LIMIT, -+ .p2_slow = G4X_P2_DUAL_LVDS_SLOW, -+ .p2_fast = G4X_P2_DUAL_LVDS_FAST }, -+ .find_pll = intel_find_pll_g4x, - }, - }; - -+static const intel_limit_t *intel_limit_g4x (xf86CrtcPtr crtc) -+{ -+ ScrnInfoPtr pScrn = crtc->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ const intel_limit_t *limit; -+ -+ if (i830PipeHasType (crtc, I830_OUTPUT_LVDS)) { -+ if ((INREG(LVDS) & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP) { -+ /* LVDS with dual channel */ -+ limit = &intel_limits[INTEL_LIMIT_G4X_DUAL_LVDS]; -+ } else /* LVDS with single channel */ -+ limit = &intel_limits[INTEL_LIMIT_G4X_SINGLE_LVDS]; -+ } else if (i830PipeHasType (crtc, I830_OUTPUT_HDMI) || -+ i830PipeHasType (crtc, I830_OUTPUT_ANALOG)) { -+ limit = &intel_limits[INTEL_LIMIT_G4X_HDMI_DAC]; -+ } else if (i830PipeHasType (crtc, I830_OUTPUT_SDVO)) { -+ limit = &intel_limits[INTEL_LIMIT_G4X_SDVO]; -+ } else /* The option is for other outputs */ -+ limit = &intel_limits[INTEL_LIMIT_I9XX_SDVO_DAC]; -+ return limit; -+} -+ - static const intel_limit_t *intel_limit (xf86CrtcPtr crtc) - { - ScrnInfoPtr pScrn = crtc->scrn; - I830Ptr pI830 = I830PTR(pScrn); - const intel_limit_t *limit; - -- if (IS_I9XX(pI830) && !IS_IGD(pI830)) { -+ if (IS_G4X(pI830)) { -+ limit = intel_limit_g4x(crtc); -+ } else if (IS_I9XX(pI830) && !IS_IGD(pI830)) { - if (i830PipeHasType (crtc, I830_OUTPUT_LVDS)) - limit = &intel_limits[INTEL_LIMIT_I9XX_LVDS]; - else -@@ -372,18 +567,13 @@ i830PllIsValid(xf86CrtcPtr crtc, intel_clock_t *clock) - return TRUE; - } - --/** -- * Returns a set of divisors for the desired target clock with the given -- * refclk, or FALSE. The returned values represent the clock equation: -- * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2. -- */ - static Bool --i830FindBestPLL(xf86CrtcPtr crtc, int target, int refclk, intel_clock_t *best_clock) -+intel_find_pll_i8xx_and_i9xx(const intel_limit_t * limit, xf86CrtcPtr crtc, -+ int target, int refclk, intel_clock_t *best_clock) - { - ScrnInfoPtr pScrn = crtc->scrn; - I830Ptr pI830 = I830PTR(pScrn); -- intel_clock_t clock; -- const intel_limit_t *limit = intel_limit (crtc); -+ intel_clock_t clock; - int err = target; - - if (i830PipeHasType(crtc, I830_OUTPUT_LVDS)) -@@ -435,6 +625,64 @@ i830FindBestPLL(xf86CrtcPtr crtc, int target, int refclk, intel_clock_t *best_cl - return (err != target); - } - -+static Bool -+intel_find_pll_g4x(const intel_limit_t * limit, xf86CrtcPtr crtc, -+ int target, int refclk, intel_clock_t *best_clock) -+{ -+ ScrnInfoPtr pScrn = crtc->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ intel_clock_t clock; -+ int max_n; -+ Bool found = FALSE; -+ int err_most = target * 0.0048; -+ -+ if (i830PipeHasType(crtc, I830_OUTPUT_LVDS)) -+ { -+ /* For LVDS, if the panel is on, just rely on its current settings for -+ * dual-channel. We haven't figured out how to reliably set up -+ * different single/dual channel state, if we even can. -+ */ -+ if ((INREG(LVDS) & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP) -+ clock.p2 = limit->p2.p2_fast; -+ else -+ clock.p2 = limit->p2.p2_slow; -+ } else { -+ if (target < limit->p2.dot_limit) -+ clock.p2 = limit->p2.p2_slow; -+ else -+ clock.p2 = limit->p2.p2_fast; -+ } -+ -+ max_n = limit->n.max; -+ /* based on hardware requirement prefer smaller n to precision */ -+ for (clock.n = limit->n.min; clock.n <= max_n; clock.n++) { -+ /* based on hardware requirement prefere larger m1,m2, p1*/ -+ for (clock.m1 = limit->m1.max; -+ clock.m1 >= limit->m1.min; clock.m1--) { -+ for (clock.m2 = limit->m2.max; -+ clock.m2 >= limit->m2.min; clock.m2--) { -+ for (clock.p1 = limit->p1.max; -+ clock.p1 >= limit->p1.min; clock.p1--) { -+ int this_err; -+ -+ intel_clock (pI830, refclk, &clock); -+ if (!i830PllIsValid(crtc, &clock)) -+ continue; -+ this_err = abs(clock.dot - target) ; -+ if (this_err < err_most) { -+ memcpy(best_clock, &clock, sizeof(intel_clock_t)); -+ err_most = this_err; -+ /* prefer smaller n to precision */ -+ max_n = clock.n; -+ found = TRUE; -+ } -+ } -+ } -+ } -+ } -+ return found; -+} -+ - void - i830WaitForVblank(ScrnInfoPtr pScreen) - { -@@ -865,6 +1113,9 @@ i830_disable_vga_plane (xf86CrtcPtr crtc) - sr01 = INREG8(SRX + 1); - OUTREG8(SRX + 1, sr01 | (1 << 5)); - usleep(30); -+ /* disable center mode on 965GM and G4X platform */ -+ if (IS_I965GM(pI830) || IS_G4X(pI830)) -+ vgacntrl &= ~(3 << 24); - - vgacntrl |= VGA_DISP_DISABLE; - -@@ -873,14 +1124,8 @@ i830_disable_vga_plane (xf86CrtcPtr crtc) - - } - --/** -- * Sets the power management mode of the pipe and plane. -- * -- * This code should probably grow support for turning the cursor off and back -- * on appropriately at the same time as we're turning the pipe off/on. -- */ --static void --i830_crtc_dpms(xf86CrtcPtr crtc, int mode) -+void -+i830_crtc_enable(xf86CrtcPtr crtc) - { - ScrnInfoPtr pScrn = crtc->scrn; - I830Ptr pI830 = I830PTR(pScrn); -@@ -893,112 +1138,148 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode) - int dspbase_reg = (plane == 0) ? DSPABASE : DSPBBASE; - uint32_t temp; - -- /* XXX: When our outputs are all unaware of DPMS modes other than off and -- * on, we should map those modes to DPMSModeOff in the CRTC. -- */ -- switch (mode) { -- case DPMSModeOn: -- case DPMSModeStandby: -- case DPMSModeSuspend: -- /* Enable the DPLL */ -- temp = INREG(dpll_reg); -- if ((temp & DPLL_VCO_ENABLE) == 0) -- { -- OUTREG(dpll_reg, temp); -- POSTING_READ(dpll_reg); -- /* Wait for the clocks to stabilize. */ -- usleep(150); -- OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE); -- POSTING_READ(dpll_reg); -- /* Wait for the clocks to stabilize. */ -- usleep(150); -- OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE); -- POSTING_READ(dpll_reg); -- /* Wait for the clocks to stabilize. */ -- usleep(150); -- } -+ /* Enable the DPLL */ -+ temp = INREG(dpll_reg); -+ if ((temp & DPLL_VCO_ENABLE) == 0) -+ { -+ OUTREG(dpll_reg, temp); -+ POSTING_READ(dpll_reg); -+ /* Wait for the clocks to stabilize. */ -+ usleep(150); -+ OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE); -+ POSTING_READ(dpll_reg); -+ /* Wait for the clocks to stabilize. */ -+ usleep(150); -+ OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE); -+ POSTING_READ(dpll_reg); -+ /* Wait for the clocks to stabilize. */ -+ usleep(150); -+ } - -- /* Enable the pipe */ -- temp = INREG(pipeconf_reg); -- if ((temp & PIPEACONF_ENABLE) == 0) -- OUTREG(pipeconf_reg, temp | PIPEACONF_ENABLE); -+ /* Enable the pipe */ -+ temp = INREG(pipeconf_reg); -+ if ((temp & PIPEACONF_ENABLE) == 0) -+ OUTREG(pipeconf_reg, temp | PIPEACONF_ENABLE); - -- /* Enable the plane */ -- temp = INREG(dspcntr_reg); -- if ((temp & DISPLAY_PLANE_ENABLE) == 0) -- { -- OUTREG(dspcntr_reg, temp | DISPLAY_PLANE_ENABLE); -- /* Flush the plane changes */ -- OUTREG(dspbase_reg, INREG(dspbase_reg)); -- } -+ /* Enable the plane */ -+ temp = INREG(dspcntr_reg); -+ if ((temp & DISPLAY_PLANE_ENABLE) == 0) -+ { -+ OUTREG(dspcntr_reg, temp | DISPLAY_PLANE_ENABLE); -+ /* Flush the plane changes */ -+ OUTREG(dspbase_reg, INREG(dspbase_reg)); -+ } - -- i830_crtc_load_lut(crtc); -+ i830_crtc_load_lut(crtc); - -- /* Give the overlay scaler a chance to enable if it's on this pipe */ -- i830_crtc_dpms_video(crtc, TRUE); -+ /* Give the overlay scaler a chance to enable if it's on this pipe */ -+ i830_crtc_dpms_video(crtc, TRUE); - -- /* Reenable compression if needed */ -- if (i830_use_fb_compression(crtc)) -- i830_enable_fb_compression(crtc); -- i830_modeset_ctl(crtc, 0); -- break; -- case DPMSModeOff: -- i830_modeset_ctl(crtc, 1); -- /* Shut off compression if in use */ -- if (i830_use_fb_compression(crtc)) -- i830_disable_fb_compression(crtc); -+ /* Reenable compression if needed */ -+ if (i830_use_fb_compression(crtc)) -+ i830_enable_fb_compression(crtc); -+ i830_modeset_ctl(crtc, 0); -+} - -- /* Give the overlay scaler a chance to disable if it's on this pipe */ -- i830_crtc_dpms_video(crtc, FALSE); -+void -+i830_crtc_disable(xf86CrtcPtr crtc, Bool disable_pipe) -+{ -+ ScrnInfoPtr pScrn = crtc->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ I830CrtcPrivatePtr intel_crtc = crtc->driver_private; -+ int pipe = intel_crtc->pipe; -+ int plane = intel_crtc->plane; -+ int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; -+ int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; -+ int dspcntr_reg = (plane == 0) ? DSPACNTR : DSPBCNTR; -+ int dspbase_reg = (plane == 0) ? DSPABASE : DSPBBASE; -+ uint32_t temp; - -- /* -- * The documentation says : -- * - Disable planes (VGA or hires) -- * - Disable pipe -- * - Disable VGA display -- */ -+ i830_modeset_ctl(crtc, 1); -+ /* Shut off compression if in use */ -+ if (i830_use_fb_compression(crtc)) -+ i830_disable_fb_compression(crtc); - -- /* Disable display plane */ -- temp = INREG(dspcntr_reg); -- if ((temp & DISPLAY_PLANE_ENABLE) != 0) -- { -- OUTREG(dspcntr_reg, temp & ~DISPLAY_PLANE_ENABLE); -- /* Flush the plane changes */ -- OUTREG(dspbase_reg, INREG(dspbase_reg)); -- POSTING_READ(dspbase_reg); -- } -+ /* Give the overlay scaler a chance to disable if it's on this pipe */ -+ i830_crtc_dpms_video(crtc, FALSE); - -- if (!IS_I9XX(pI830)) { -- /* Wait for vblank for the disable to take effect */ -- i830WaitForVblank(pScrn); -- } -+ /* -+ * The documentation says : -+ * - Disable planes (VGA or hires) -+ * - Disable pipe -+ * - Disable VGA display -+ */ - -- /* May need to leave pipe A on */ -- if ((pipe != 0) || !(pI830->quirk_flag & QUIRK_PIPEA_FORCE)) -- { -- /* Next, disable display pipes */ -- temp = INREG(pipeconf_reg); -- if ((temp & PIPEACONF_ENABLE) != 0) { -- OUTREG(pipeconf_reg, temp & ~PIPEACONF_ENABLE); -- POSTING_READ(pipeconf_reg); -- } -+ /* Disable display plane */ -+ temp = INREG(dspcntr_reg); -+ if ((temp & DISPLAY_PLANE_ENABLE) != 0) -+ { -+ OUTREG(dspcntr_reg, temp & ~DISPLAY_PLANE_ENABLE); -+ /* Flush the plane changes */ -+ OUTREG(dspbase_reg, INREG(dspbase_reg)); -+ POSTING_READ(dspbase_reg); -+ } - -- /* Wait for vblank for the disable to take effect. */ -- i830WaitForVblank(pScrn); -+ if (!IS_I9XX(pI830)) { -+ /* Wait for vblank for the disable to take effect */ -+ i830WaitForVblank(pScrn); -+ } - -- temp = INREG(dpll_reg); -- if ((temp & DPLL_VCO_ENABLE) != 0) { -- OUTREG(dpll_reg, temp & ~DPLL_VCO_ENABLE); -- POSTING_READ(dpll_reg); -- } -+ /* May need to leave pipe A on */ -+ if (disable_pipe) -+ { -+ /* Next, disable display pipes */ -+ temp = INREG(pipeconf_reg); -+ if ((temp & PIPEACONF_ENABLE) != 0) { -+ OUTREG(pipeconf_reg, temp & ~PIPEACONF_ENABLE); -+ POSTING_READ(pipeconf_reg); -+ } -+ -+ /* Wait for vblank for the disable to take effect. */ -+ i830WaitForVblank(pScrn); - -- /* Wait for the clocks to turn off. */ -- usleep(150); -+ temp = INREG(dpll_reg); -+ if ((temp & DPLL_VCO_ENABLE) != 0) { -+ OUTREG(dpll_reg, temp & ~DPLL_VCO_ENABLE); -+ POSTING_READ(dpll_reg); - } - -- /* Disable the VGA plane that we never use. */ -- i830_disable_vga_plane (crtc); -+ /* Wait for the clocks to turn off. */ -+ usleep(150); -+ } -+ -+ /* Disable the VGA plane that we never use. */ -+ i830_disable_vga_plane (crtc); -+} -+ -+/** -+ * Sets the power management mode of the pipe and plane. -+ * -+ * This code should probably grow support for turning the cursor off and back -+ * on appropriately at the same time as we're turning the pipe off/on. -+ */ -+static void -+i830_crtc_dpms(xf86CrtcPtr crtc, int mode) -+{ -+ ScrnInfoPtr pScrn = crtc->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ I830CrtcPrivatePtr intel_crtc = crtc->driver_private; -+ int pipe = intel_crtc->pipe; -+ Bool disable_pipe = TRUE; - -+ /* XXX: When our outputs are all unaware of DPMS modes other than off and -+ * on, we should map those modes to DPMSModeOff in the CRTC. -+ */ -+ switch (mode) { -+ case DPMSModeOn: -+ case DPMSModeStandby: -+ case DPMSModeSuspend: -+ i830_crtc_enable(crtc); -+ break; -+ case DPMSModeOff: -+ if ((pipe == 0) && (pI830->quirk_flag & QUIRK_PIPEA_FORCE)) -+ disable_pipe = FALSE; -+ i830_crtc_disable(crtc, disable_pipe); - break; - } - -@@ -1305,6 +1586,7 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, - uint32_t dpll = 0, fp = 0, dspcntr, pipeconf, lvds_bits = 0; - Bool ok, is_sdvo = FALSE, is_dvo = FALSE; - Bool is_crt = FALSE, is_lvds = FALSE, is_tv = FALSE; -+ const intel_limit_t *limit; - - /* Set up some convenient bools for what outputs are connected to - * our pipe, used in DPLL setup. -@@ -1357,7 +1639,13 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, - refclk = 48000; - } - -- ok = i830FindBestPLL(crtc, adjusted_mode->Clock, refclk, &clock); -+ /* -+ * Returns a set of divisors for the desired target clock with the given -+ * refclk, or FALSE. The returned values represent the clock equation: -+ * reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2. -+ */ -+ limit = intel_limit (crtc); -+ ok = limit->find_pll(limit, crtc, adjusted_mode->Clock, refclk, &clock); - if (!ok) - FatalError("Couldn't find PLL settings for mode!\n"); - -diff --git a/src/i830_display.h b/src/i830_display.h -index 8d767b1..0ba196d 100644 ---- a/src/i830_display.h -+++ b/src/i830_display.h -@@ -32,6 +32,8 @@ void i830PipeSetBase(xf86CrtcPtr crtc, int x, int y); - void i830WaitForVblank(ScrnInfoPtr pScrn); - void i830DescribeOutputConfiguration(ScrnInfoPtr pScrn); - void i830_set_new_crtc_bo(ScrnInfoPtr pScrn); -+void i830_crtc_disable(xf86CrtcPtr crtc, Bool disable_pipe); -+void i830_crtc_enable(xf86CrtcPtr crtc); - - xf86CrtcPtr i830GetLoadDetectPipe(xf86OutputPtr output, DisplayModePtr mode, int *dpms_mode); - void i830ReleaseLoadDetectPipe(xf86OutputPtr output, int dpms_mode); -diff --git a/src/i830_driver.c b/src/i830_driver.c -index 6ec1a48..32ca6c9 100644 ---- a/src/i830_driver.c -+++ b/src/i830_driver.c -@@ -311,7 +311,6 @@ typedef enum { - OPTION_LVDS24BITMODE, - OPTION_FBC, - OPTION_TILING, -- OPTION_LEGACY3D, - OPTION_LVDSFIXEDMODE, - OPTION_FORCEENABLEPIPEA, - #ifdef INTEL_XVMC -@@ -332,9 +331,6 @@ static OptionInfoRec I830Options[] = { - {OPTION_LVDS24BITMODE, "LVDS24Bit", OPTV_BOOLEAN, {0}, FALSE}, - {OPTION_FBC, "FramebufferCompression", OPTV_BOOLEAN, {0}, TRUE}, - {OPTION_TILING, "Tiling", OPTV_BOOLEAN, {0}, TRUE}, --#ifdef XF86DRI -- {OPTION_LEGACY3D, "Legacy3D", OPTV_BOOLEAN, {0}, FALSE}, --#endif - {OPTION_LVDSFIXEDMODE, "LVDSFixedMode", OPTV_BOOLEAN, {0}, FALSE}, - {OPTION_FORCEENABLEPIPEA, "ForceEnablePipeA", OPTV_BOOLEAN, {0}, FALSE}, - #ifdef INTEL_XVMC -@@ -827,22 +823,41 @@ i830_update_front_offset(ScrnInfoPtr pScrn) - ScreenPtr pScreen = pScrn->pScreen; - I830Ptr pI830 = I830PTR(pScrn); - int pitch = pScrn->displayWidth * pI830->cpp; -+ pointer data = NULL; - - /* Update buffer locations, which may have changed as a result of - * i830_bind_all_memory(). - */ - pScrn->fbOffset = pI830->front_buffer->offset; - -+ if (pI830->starting || pI830->accel == ACCEL_UXA) -+ return; -+ - /* If we are still in ScreenInit, there is no screen pixmap to be updated - * yet. We'll fix it up at CreateScreenResources. - */ -- if (!pI830->starting && pI830->accel != ACCEL_UXA) { -- if (!pScreen->ModifyPixmapHeader(pScreen->GetScreenPixmap(pScreen), -+ if (!pI830->memory_manager) { -+ data = pI830->FbBase + pScrn->fbOffset; /* default to legacy */ -+ } else { -+ dri_bo *bo = pI830->front_buffer->bo; -+ -+ if (bo) { -+ if (pI830->kernel_exec_fencing) { -+ if (drm_intel_gem_bo_map_gtt(bo)) -+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: bo map failed\n", -+ __FUNCTION__); -+ data = bo->virtual; -+ } else { -+ /* Will already be pinned by bind_all_memory in this case */ -+ drm_intel_gem_bo_start_gtt_access(bo, 1); -+ data = pI830->FbBase + bo->offset; -+ } -+ } -+ } -+ if (!pScreen->ModifyPixmapHeader(pScreen->GetScreenPixmap(pScreen), - pScrn->virtualX, pScrn->virtualY, -1, -1, -- pitch, (pointer)(pI830->FbBase + -- pScrn->fbOffset))) -+ pitch, data)) - FatalError("Couldn't adjust screen pixmap\n"); -- } - } - - /** -@@ -1707,12 +1722,8 @@ I830DrmModeInit(ScrnInfoPtr pScrn) - pI830->accel = ACCEL_UXA; - - if ((s = (char *)xf86GetOptValString(pI830->Options, OPTION_ACCELMETHOD))) { -- if (!xf86NameCmp(s, "EXA")) -- pI830->accel = ACCEL_EXA; -- else if (!xf86NameCmp(s, "UXA")) -- pI830->accel = ACCEL_UXA; -- else -- pI830->accel = ACCEL_UXA; -+ if (xf86NameCmp(s, "UXA")) -+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "kernel mode setting active,overridding accelmethod and using UXA\n"); - } - - pI830->can_resize = FALSE; -@@ -2283,7 +2294,7 @@ RestoreHWState(ScrnInfoPtr pScrn) - /* Disable pipes */ - for (i = 0; i < xf86_config->num_crtc; i++) { - xf86CrtcPtr crtc = xf86_config->crtc[i]; -- crtc->funcs->dpms(crtc, DPMSModeOff); -+ i830_crtc_disable(crtc, TRUE); - } - i830WaitForVblank(pScrn); - -@@ -3019,11 +3030,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) - */ - if (!pI830->can_resize && pI830->directRenderingType == DRI_NONE && I830DRIScreenInit(pScreen)) - pI830->directRenderingType = DRI_XF86DRI; -- -- if (pI830->directRenderingType == DRI_XF86DRI) { -- pI830->allocate_classic_textures = -- xf86ReturnOptValBool(pI830->Options, OPTION_LEGACY3D, TRUE); -- } - #endif - - /* Enable tiling by default */ -@@ -3473,8 +3479,9 @@ static Bool - I830EnterVT(int scrnIndex, int flags) - { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; -+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - I830Ptr pI830 = I830PTR(pScrn); -- int ret; -+ int i, ret; - - DPRINTF(PFX, "Enter VT\n"); - -@@ -3495,6 +3502,23 @@ I830EnterVT(int scrnIndex, int flags) - SaveHWState(pScrn); - } - -+ /* Get the hardware into a known state if needed */ -+ if (!pI830->use_drm_mode) { -+ /* Disable outputs */ -+ for (i = 0; i < xf86_config->num_output; i++) { -+ xf86OutputPtr output = xf86_config->output[i]; -+ output->funcs->dpms(output, DPMSModeOff); -+ } -+ i830WaitForVblank(pScrn); -+ -+ /* Disable pipes */ -+ for (i = 0; i < xf86_config->num_crtc; i++) { -+ xf86CrtcPtr crtc = xf86_config->crtc[i]; -+ i830_crtc_disable(crtc, TRUE); -+ } -+ i830WaitForVblank(pScrn); -+ } -+ - pI830->leaving = FALSE; - - if (!pI830->use_drm_mode) -diff --git a/src/i830_exa.c b/src/i830_exa.c -index 0a22486..39011bc 100644 ---- a/src/i830_exa.c -+++ b/src/i830_exa.c -@@ -37,6 +37,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "i810_reg.h" - #include "i915_drm.h" - #include -+#include - - #define ALWAYS_SYNC 0 - #define ALWAYS_FLUSH 0 -@@ -837,8 +838,6 @@ i830_uxa_set_pixmap_bo (PixmapPtr pixmap, dri_bo *bo) - static Bool - i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access) - { -- ScrnInfoPtr pScrn = xf86Screens[pixmap->drawable.pScreen->myNum]; -- I830Ptr pI830 = I830PTR(pScrn); - dri_bo *bo = i830_get_pixmap_bo (pixmap); - - if (bo) { -@@ -853,15 +852,27 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access) - i830->need_sync = FALSE; - } - -- if (pScrn->vtSema && !pI830->use_drm_mode && pI830->memory_manager) { -- if (drm_intel_bo_pin(bo, 4096) != 0) -- return FALSE; -- drm_intel_gem_bo_start_gtt_access(bo, access == UXA_ACCESS_RW); -- pixmap->devPrivate.ptr = pI830->FbBase + bo->offset; -- } else { -+ /* No VT sema or GEM? No GTT mapping. */ -+ if (!scrn->vtSema || !i830->memory_manager) { - if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0) - return FALSE; - pixmap->devPrivate.ptr = bo->virtual; -+ return TRUE; -+ } -+ -+ /* Kernel manages fences at GTT map/fault time */ -+ if (i830->kernel_exec_fencing) { -+ if (drm_intel_gem_bo_map_gtt(bo)) { -+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: bo map failed\n", -+ __FUNCTION__); -+ return FALSE; -+ } -+ pixmap->devPrivate.ptr = bo->virtual; -+ } else { /* or not... */ -+ if (drm_intel_bo_pin(bo, 4096) != 0) -+ return FALSE; -+ drm_intel_gem_bo_start_gtt_access(bo, access == UXA_ACCESS_RW); -+ pixmap->devPrivate.ptr = i830->FbBase + bo->offset; - } - } - return TRUE; -@@ -870,8 +881,6 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access) - static void - i830_uxa_finish_access (PixmapPtr pixmap) - { -- ScrnInfoPtr pScrn = xf86Screens[pixmap->drawable.pScreen->myNum]; -- I830Ptr pI830 = I830PTR(pScrn); - dri_bo *bo = i830_get_pixmap_bo (pixmap); - - if (bo) { -@@ -879,14 +888,20 @@ i830_uxa_finish_access (PixmapPtr pixmap) - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - I830Ptr i830 = I830PTR(scrn); - -- if (pScrn->vtSema && !pI830->use_drm_mode && pI830->memory_manager) -- drm_intel_bo_unpin(bo); -- else -+ if (bo == i830->front_buffer->bo) -+ i830->need_flush = TRUE; -+ -+ if (!scrn->vtSema || !i830->memory_manager) { - dri_bo_unmap(bo); -+ pixmap->devPrivate.ptr = NULL; -+ return; -+ } - -+ if (i830->kernel_exec_fencing) -+ drm_intel_gem_bo_unmap_gtt(bo); -+ else -+ drm_intel_bo_unpin(bo); - pixmap->devPrivate.ptr = NULL; -- if (bo == i830->front_buffer->bo) -- i830->need_flush = TRUE; - } - } - -diff --git a/src/i830_hdmi.c b/src/i830_hdmi.c -index 05aa9ac..0abb151 100644 ---- a/src/i830_hdmi.c -+++ b/src/i830_hdmi.c -@@ -33,6 +33,7 @@ - #include "i830.h" - #include "xf86Modes.h" - #include "i830_display.h" -+#include "X11/Xatom.h" - - struct i830_hdmi_priv { - uint32_t output_reg; -@@ -40,8 +41,12 @@ struct i830_hdmi_priv { - uint32_t save_SDVO; - - Bool has_hdmi_sink; -+ /* Default 0 for full RGB range 0-255, 1 is for RGB range 16-235 */ -+ uint32_t broadcast_rgb; - }; - -+static Atom broadcast_atom; -+ - static int - i830_hdmi_mode_valid(xf86OutputPtr output, DisplayModePtr mode) - { -@@ -214,7 +219,91 @@ i830_hdmi_destroy (xf86OutputPtr output) - } - } - -+static void -+i830_hdmi_create_resources(xf86OutputPtr output) -+{ -+ ScrnInfoPtr pScrn = output->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ I830OutputPrivatePtr intel_output = output->driver_private; -+ struct i830_hdmi_priv *dev_priv = intel_output->dev_priv; -+ INT32 broadcast_range[2]; -+ int err; -+ -+ /* only R G B are 8bit color mode */ -+ if (pScrn->depth != 24 || -+ /* only 965G and G4X platform */ -+ !(IS_I965G(pI830) || IS_G4X(pI830))) -+ return; -+ -+ broadcast_atom = -+ MakeAtom("BROADCAST_RGB", sizeof("BROADCAST_RGB") - 1, TRUE); -+ -+ broadcast_range[0] = 0; -+ broadcast_range[1] = 1; -+ err = RRConfigureOutputProperty(output->randr_output, -+ broadcast_atom, -+ FALSE, TRUE, FALSE, 2, broadcast_range); -+ if (err != 0) { -+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, -+ "RRConfigureOutputProperty error, %d\n", err); -+ return; -+ } -+ /* Set the current value of the broadcast property as full range */ -+ dev_priv->broadcast_rgb = 0; -+ err = RRChangeOutputProperty(output->randr_output, -+ broadcast_atom, -+ XA_INTEGER, 32, PropModeReplace, -+ 1, &dev_priv->broadcast_rgb, -+ FALSE, TRUE); -+ if (err != 0) { -+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, -+ "RRChangeOutputProperty error, %d\n", err); -+ return; -+ } -+} -+ -+static Bool -+i830_hdmi_set_property(xf86OutputPtr output, Atom property, -+ RRPropertyValuePtr value) -+{ -+ ScrnInfoPtr pScrn = output->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ I830OutputPrivatePtr intel_output = output->driver_private; -+ struct i830_hdmi_priv *dev_priv = intel_output->dev_priv; -+ uint32_t temp; -+ -+ if (property == broadcast_atom) { -+ uint32_t val; -+ -+ if (value->type != XA_INTEGER || value->format != 32 || -+ value->size != 1) -+ { -+ return FALSE; -+ } -+ -+ val = *(INT32 *)value->data; -+ if (val < 0 || val > 1) -+ { -+ return FALSE; -+ } -+ if (val == dev_priv->broadcast_rgb) -+ return TRUE; -+ -+ temp = INREG(dev_priv->output_reg); -+ -+ if (val == 1) -+ temp |= SDVO_COLOR_NOT_FULL_RANGE; -+ else if (val == 0) -+ temp &= ~SDVO_COLOR_NOT_FULL_RANGE; -+ -+ OUTREG(dev_priv->output_reg, temp); -+ dev_priv->broadcast_rgb = val; -+ } -+ return TRUE; -+} -+ - static const xf86OutputFuncsRec i830_hdmi_output_funcs = { -+ .create_resources = i830_hdmi_create_resources, - .dpms = i830_hdmi_dpms, - .save = i830_hdmi_save, - .restore = i830_hdmi_restore, -@@ -225,6 +314,7 @@ static const xf86OutputFuncsRec i830_hdmi_output_funcs = { - .commit = i830_output_commit, - .detect = i830_hdmi_detect, - .get_modes = i830_ddc_get_modes, -+ .set_property = i830_hdmi_set_property, - .destroy = i830_hdmi_destroy - }; - -diff --git a/src/i830_lvds.c b/src/i830_lvds.c -index 7569e99..7fc0bce 100644 ---- a/src/i830_lvds.c -+++ b/src/i830_lvds.c -@@ -881,6 +881,13 @@ i830_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode, - static xf86OutputStatus - i830_lvds_detect(xf86OutputPtr output) - { -+ /* Fallback to origin, mark LVDS always connected. -+ * From wider tests, we have seen both broken cases with -+ * ACPI lid and SWF bit. So disable them for now until we -+ * get a reliable way for LVDS detect. -+ */ -+ return XF86OutputStatusConnected; -+ - enum lid_status lid; - - lid = i830_lvds_acpi_lid_open(output); -diff --git a/src/i830_memory.c b/src/i830_memory.c -index 361fff7..0f8d90d 100644 ---- a/src/i830_memory.c -+++ b/src/i830_memory.c -@@ -253,7 +253,8 @@ i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem) - mem->bound = TRUE; - } - -- if (mem->tiling != TILE_NONE && !pI830->use_drm_mode) { -+ if (mem->tiling != TILE_NONE && !pI830->use_drm_mode && -+ !pI830->kernel_exec_fencing) { - mem->fence_nr = i830_set_tiling(pScrn, mem->offset, mem->pitch, - mem->allocated_size, mem->tiling); - } -@@ -269,7 +270,8 @@ i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem) - if (mem == NULL || !mem->bound) - return TRUE; - -- if (mem->tiling != TILE_NONE && !pI830->use_drm_mode) -+ if (mem->tiling != TILE_NONE && !pI830->use_drm_mode && -+ !pI830->kernel_exec_fencing) - i830_clear_tiling(pScrn, mem->fence_nr); - - #ifdef XF86DRI -@@ -504,9 +506,6 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size) - mmsize -= ROUND_TO_PAGE(3 * pScrn->displayWidth * pI830->cpp * - pScrn->virtualY); - } -- /* Classic textures are fixed. */ -- if (pI830->allocate_classic_textures) -- mmsize -= MB(32); - /* Overlay and cursors, if physical, need to be allocated outside - * of the kernel memory manager. - */ -@@ -534,18 +533,15 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size) - struct drm_i915_gem_init init; - int ret; - -- sp.param = I915_SETPARAM_NUM_USED_FENCES; -- if (pI830->use_drm_mode) -+ if (pI830->accel == ACCEL_UXA) { -+ sp.param = I915_SETPARAM_NUM_USED_FENCES; - sp.value = 0; /* kernel gets them all */ -- else if (pI830->directRenderingType == DRI_XF86DRI) -- sp.value = 3; /* front/back/depth */ -- else -- sp.value = 2; /* just front for DRI2 (both old & new though) */ -- ret = drmCommandWrite(pI830->drmSubFD, DRM_I915_SETPARAM, &sp, -- sizeof(sp)); -- if (ret == 0) -- pI830->kernel_exec_fencing = TRUE; - -+ ret = drmCommandWrite(pI830->drmSubFD, DRM_I915_SETPARAM, -+ &sp, sizeof(sp)); -+ if (ret == 0) -+ pI830->kernel_exec_fencing = TRUE; -+ } - init.gtt_start = pI830->memory_manager->offset; - init.gtt_end = pI830->memory_manager->offset + - pI830->memory_manager->size; -@@ -566,6 +562,8 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size) - i830_free_memory(pScrn, pI830->memory_manager); - pI830->memory_manager = NULL; - } -+ } else { -+ pI830->allocate_classic_textures = TRUE; - } - #endif /* XF86DRI */ - -@@ -961,8 +959,6 @@ i830_allocate_memory(ScrnInfoPtr pScrn, const char *name, - } - } - -- mem->tiling = TILE_NONE; -- - return mem; - } - -@@ -1445,7 +1441,7 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn) - - if (pI830->memory_manager == NULL) { - pI830->fake_bufmgr_mem = i830_allocate_memory(pScrn, "fake bufmgr", -- MB(1), PITCH_NONE, GTT_PAGE_SIZE, 0, -+ MB(8), PITCH_NONE, GTT_PAGE_SIZE, 0, - TILE_NONE); - if (pI830->fake_bufmgr_mem == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, -diff --git a/src/i830_quirks.c b/src/i830_quirks.c -index 8680baf..81ea3c2 100644 ---- a/src/i830_quirks.c -+++ b/src/i830_quirks.c -@@ -70,12 +70,13 @@ static char *i830_dmi_data[dmi_data_max]; - static void i830_dmi_store_##field(void) \ - {\ - FILE *f = NULL;\ -+ int ret;\ - f = fopen(DMIID_FILE(field), "r");\ - if (f == NULL) {\ - xfree(i830_dmi_data[field]); i830_dmi_data[field] = NULL;\ - return;\ - }\ -- fread(i830_dmi_data[field], 64, 1, f);\ -+ ret = fread(i830_dmi_data[field], 64, 1, f); \ - fclose(f);\ - } - -@@ -236,6 +237,17 @@ static void quirk_msi_lvds_dmi (I830Ptr pI830) - } - } - -+static void quirk_ibase_lvds (I830Ptr pI830) -+{ -+ if (!i830_dmi_data[board_name]) { -+ ErrorF("Failed to load DMI info, iBase LVDS quirk not applied.\n"); -+ return; -+ } -+ if (!strncmp(i830_dmi_data[board_name], "i855-W83627HF", 13)) { -+ pI830->quirk_flag |= QUIRK_IGNORE_LVDS; -+ } -+} -+ - static void quirk_ivch_dvob (I830Ptr pI830) - { - pI830->quirk_flag |= QUIRK_IVCH_NEED_DVOB; -@@ -379,6 +391,9 @@ static i830_quirk i830_quirk_list[] = { - /* #19239: Mirrus Centrino laptop */ - { PCI_CHIP_I915_GM, 0x1584, 0x9800, quirk_broken_acpi_lid }, - -+ /* #19529: iBase MB890 board */ -+ { PCI_CHIP_I855_GM, 0x8086, 0x3582, quirk_ibase_lvds }, -+ - { 0, 0, 0, NULL }, - }; - -diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c -index 1f2578e..29ccd4e 100644 ---- a/src/i830_sdvo.c -+++ b/src/i830_sdvo.c -@@ -49,6 +49,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "i830_display.h" - #include "i810_reg.h" - #include "i830_sdvo_regs.h" -+#include "X11/Xatom.h" - - /** SDVO driver private structure. */ - struct i830_sdvo_priv { -@@ -110,6 +111,8 @@ struct i830_sdvo_priv { - - /** DDC bus used by this SDVO output */ - uint8_t ddc_bus; -+ /* Default 0 for full RGB range 0-255, 1 is for RGB range 16-235 */ -+ uint32_t broadcast_rgb; - - /** State for save/restore */ - /** @{ */ -@@ -121,6 +124,8 @@ struct i830_sdvo_priv { - /** @} */ - }; - -+static Atom broadcast_atom; -+ - /** - * Writes the SDVOB or SDVOC with the given value, but always writes both - * SDVOB and SDVOC to work around apparent hardware issues (according to -@@ -1039,8 +1044,13 @@ i830_sdvo_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, - - ErrorF("input modeline:\n"); - xf86PrintModeline(0, adjusted_mode); -+ -+ /* adjust origin mode's clock for current input, -+ for correct pixel mulitiplier setting. */ -+ mode->Clock = adjusted_mode->Clock; -+ - /* Clock range is required to be in 100-200Mhz */ -- adjusted_mode->Clock *= i830_sdvo_get_pixel_multiplier(adjusted_mode); -+ adjusted_mode->Clock *= i830_sdvo_get_pixel_multiplier(mode); - } else { - return FALSE; - } -@@ -1385,7 +1395,9 @@ i830_sdvo_ddc_i2c_start(I2CBusPtr b, int timeout) - xf86OutputPtr output = b->DriverPrivate.ptr; - I830OutputPrivatePtr intel_output = output->driver_private; - I2CBusPtr i2cbus = intel_output->pI2CBus; -+ struct i830_sdvo_priv *dev_priv = intel_output->dev_priv; - -+ i830_sdvo_set_control_bus_switch(output, dev_priv->ddc_bus); - return i2cbus->I2CStart(i2cbus, timeout); - } - -@@ -1539,6 +1551,10 @@ i830_sdvo_output_setup (xf86OutputPtr output, uint16_t flag) - else - name_suffix = "-2"; - -+ /* clear up privates */ -+ dev_priv->is_tv = FALSE; -+ intel_output->needs_tv_clock = FALSE; -+ - if (flag & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) - { - if (flag & SDVO_OUTPUT_TMDS0) -@@ -1559,6 +1575,14 @@ i830_sdvo_output_setup (xf86OutputPtr output, uint16_t flag) - dev_priv->is_tv = TRUE; - intel_output->needs_tv_clock = TRUE; - } -+ else if (flag & SDVO_OUTPUT_CVBS0) -+ { -+ dev_priv->controlled_output = SDVO_OUTPUT_CVBS0; -+ output->subpixel_order = SubPixelHorizontalRGB; /* XXX */ -+ name_prefix="TV"; -+ dev_priv->is_tv = TRUE; -+ intel_output->needs_tv_clock = TRUE; -+ } - else if (flag & SDVO_OUTPUT_RGB0) - { - dev_priv->controlled_output = SDVO_OUTPUT_RGB0; -@@ -1586,7 +1610,7 @@ i830_sdvo_output_setup (xf86OutputPtr output, uint16_t flag) - xf86DrvMsg(intel_output->pI2CBus->scrnIndex, X_WARNING, - "%s: Unknown SDVO output type (0x%02x%02x)\n", - SDVO_NAME(dev_priv), -- bytes[0], bytes[1]); -+ bytes[1], bytes[0]); - name_prefix="Unknown"; - } - -@@ -1709,11 +1733,9 @@ i830_sdvo_get_ddc_modes(xf86OutputPtr output) - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - DisplayModePtr modes = NULL; - xf86OutputPtr crt; -- I830OutputPrivatePtr intel_output = output->driver_private; -+ I830OutputPrivatePtr intel_output; - xf86MonPtr edid_mon = NULL; -- struct i830_sdvo_priv *dev_priv = intel_output->dev_priv; -- -- i830_sdvo_set_control_bus_switch(output, dev_priv->ddc_bus); -+ struct i830_sdvo_priv *dev_priv; - - modes = i830_ddc_get_modes(output); - if (modes != NULL) -@@ -1910,7 +1932,94 @@ i830_sdvo_get_crtc(xf86OutputPtr output) - } - #endif - -+static void -+i830_sdvo_create_resources(xf86OutputPtr output) -+{ -+ ScrnInfoPtr pScrn = output->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ I830OutputPrivatePtr intel_output = output->driver_private; -+ struct i830_sdvo_priv *dev_priv = intel_output->dev_priv; -+ INT32 broadcast_range[2]; -+ int err; -+ -+ /* only R G B are 8bit color mode */ -+ if (pScrn->depth != 24 || -+ /* only 965G and G4X platform */ -+ !(IS_I965G(pI830) || IS_G4X(pI830)) || -+ /* only TMDS encoding */ -+ !(strstr(output->name, "TMDS") || strstr(output->name, "HDMI"))) -+ return; -+ -+ broadcast_atom = -+ MakeAtom("BROADCAST_RGB", sizeof("BROADCAST_RGB") - 1, TRUE); -+ -+ broadcast_range[0] = 0; -+ broadcast_range[1] = 1; -+ err = RRConfigureOutputProperty(output->randr_output, -+ broadcast_atom, -+ FALSE, TRUE, FALSE, 2, broadcast_range); -+ if (err != 0) { -+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, -+ "RRConfigureOutputProperty error, %d\n", err); -+ return; -+ } -+ /* Set the current value of the broadcast property as full range */ -+ dev_priv->broadcast_rgb = 0; -+ err = RRChangeOutputProperty(output->randr_output, -+ broadcast_atom, -+ XA_INTEGER, 32, PropModeReplace, -+ 1, &dev_priv->broadcast_rgb, -+ FALSE, TRUE); -+ if (err != 0) { -+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, -+ "RRChangeOutputProperty error, %d\n", err); -+ return; -+ } -+} -+ -+static Bool -+i830_sdvo_set_property(xf86OutputPtr output, Atom property, -+ RRPropertyValuePtr value) -+{ -+ ScrnInfoPtr pScrn = output->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ I830OutputPrivatePtr intel_output = output->driver_private; -+ struct i830_sdvo_priv *dev_priv = intel_output->dev_priv; -+ uint32_t temp; -+ -+ if (property == broadcast_atom) { -+ uint32_t val; -+ -+ if (value->type != XA_INTEGER || value->format != 32 || -+ value->size != 1) -+ { -+ return FALSE; -+ } -+ -+ val = *(INT32 *)value->data; -+ if (val < 0 || val > 1) -+ { -+ return FALSE; -+ } -+ if (val == dev_priv->broadcast_rgb) -+ return TRUE; -+ -+ temp = INREG(dev_priv->output_device); -+ -+ if (val == 1) -+ temp |= SDVO_COLOR_NOT_FULL_RANGE; -+ else if (val == 0) -+ temp &= ~SDVO_COLOR_NOT_FULL_RANGE; -+ -+ i830_sdvo_write_sdvox(output, temp); -+ -+ dev_priv->broadcast_rgb = val; -+ } -+ return TRUE; -+} -+ - static const xf86OutputFuncsRec i830_sdvo_output_funcs = { -+ .create_resources = i830_sdvo_create_resources, - .dpms = i830_sdvo_dpms, - .save = i830_sdvo_save, - .restore = i830_sdvo_restore, -@@ -1921,6 +2030,7 @@ static const xf86OutputFuncsRec i830_sdvo_output_funcs = { - .commit = i830_output_commit, - .detect = i830_sdvo_detect, - .get_modes = i830_sdvo_get_modes, -+ .set_property = i830_sdvo_set_property, - .destroy = i830_sdvo_destroy, - #ifdef RANDR_GET_CRTC_INTERFACE - .get_crtc = i830_sdvo_get_crtc, -diff --git a/src/i830_tv.c b/src/i830_tv.c -index 1e3cf7b..8eb3e26 100644 ---- a/src/i830_tv.c -+++ b/src/i830_tv.c -@@ -1079,7 +1079,7 @@ i830_tv_update_contrast(I830Ptr pI830, uint8_t contrast) - c = float_to_fix_2_6(con); - } else { - /* 2.6 floating point */ -- con = 8.875 * ((float) contrast / 255); -+ con = 2.65625 * ((float) contrast / 255); - c = float_to_float_2_6(con); - } - val |= (c << TV_CONTRAST_SHIFT) & TV_CONTRAST_MASK; -@@ -1098,7 +1098,7 @@ i830_tv_update_saturation(I830Ptr pI830, uint8_t saturation) - sat = 3.0 * ((float) saturation / 255); - s = float_to_fix_2_6(sat); - } else { -- sat = 8.875 * ((float) saturation / 255); -+ sat = 2.65625 * ((float) saturation / 255); - s = float_to_float_2_6(sat); - } - val |= (s << TV_SATURATION_SHIFT) & TV_SATURATION_MASK; -@@ -1458,6 +1458,10 @@ i830_tv_detect(xf86OutputPtr output) - int dpms_mode; - int type = dev_priv->type; - -+ /* If TV connector type set by user, always return connected */ -+ if (dev_priv->force_type) -+ return XF86OutputStatusConnected; -+ - mode = reported_modes[0]; - xf86SetModeCrtc (&mode, INTERLACE_HALVE_V); - crtc = i830GetLoadDetectPipe (output, &mode, &dpms_mode); -@@ -1467,13 +1471,6 @@ i830_tv_detect(xf86OutputPtr output) - i830ReleaseLoadDetectPipe (output, dpms_mode); - } - -- if (dev_priv->force_type) { -- if (type == TV_TYPE_NONE) -- return XF86OutputStatusDisconnected; -- else -- return XF86OutputStatusConnected; -- } -- - if (type != dev_priv->type) - { - dev_priv->type = type; -diff --git a/src/i830_video.c b/src/i830_video.c -index daa2411..4ed3047 100644 ---- a/src/i830_video.c -+++ b/src/i830_video.c -@@ -1019,7 +1019,7 @@ I830SetupImageVideoTextured(ScreenPtr pScreen) - pPriv->doubleBuffer = 0; - - pPriv->rotation = RR_Rotate_0; -- pPriv->SyncToVblank = -1; -+ pPriv->SyncToVblank = 1; - - /* gotta uninit this someplace, XXX: shouldn't be necessary for textured */ - REGION_NULL(pScreen, &pPriv->clip); -@@ -1048,11 +1048,14 @@ I830StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) - if (pPriv->videoStatus & CLIENT_VIDEO_ON) { - i830_overlay_off(pScrn); - } -- if (!pPriv->textured) -- drm_intel_bo_unpin(pPriv->buf); -- drm_intel_bo_unreference(pPriv->buf); -- pPriv->buf = NULL; -- pPriv->videoStatus = 0; -+ -+ if (pPriv->buf) { -+ if (!pPriv->textured) -+ drm_intel_bo_unpin(pPriv->buf); -+ drm_intel_bo_unreference(pPriv->buf); -+ pPriv->buf = NULL; -+ pPriv->videoStatus = 0; -+ } - } else { - if (pPriv->videoStatus & CLIENT_VIDEO_ON) { - pPriv->videoStatus |= OFF_TIMER; -@@ -1382,7 +1385,7 @@ I830CopyPlanarData(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, - dst_base = pPriv->buf->virtual; - } else { - drm_intel_gem_bo_start_gtt_access(pPriv->buf, TRUE); -- dst_base = pI830->FbBase + pPriv->buf->offset; -+ dst_base = pI830->FbBase; - } - - if (pPriv->currentBuf == 0) -@@ -2143,7 +2146,8 @@ i830_clip_video_helper (ScrnInfoPtr pScrn, - pPriv->desired_crtc, - &crtc_box); - -- if (crtc) -+ /* For textured video, we don't actually want to clip at all. */ -+ if (crtc && !pPriv->textured) - { - REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1); - crtc_region = &crtc_region_local; -@@ -2510,44 +2514,34 @@ I830PutImage(ScrnInfoPtr pScrn, - sync = FALSE; - } else if (pPriv->SyncToVblank == 0) { - sync = FALSE; -- } else if (pPriv->SyncToVblank == -1) { -- BoxRec crtc_box; -- BoxPtr pbox; -- int nbox, crtc_area, coverage = 0; -- -- i830_crtc_box(crtc, &crtc_box); -- crtc_area = i830_box_area(&crtc_box); -- pbox = REGION_RECTS(clipBoxes); -- nbox = REGION_NUM_RECTS(clipBoxes); -- -- while (nbox--) { -- coverage += i830_box_area(pbox); -- pbox++; -- } -- -- if ((coverage << 2) < crtc_area) -- sync = FALSE; - } - - if (sync) { -- I830CrtcPrivatePtr intel_crtc = crtc->driver_private; -- int event; -- -- if (IS_I965G(pI830)) { -- if (intel_crtc->pipe == 0) -- event = MI_WAIT_FOR_PIPEA_SVBLANK; -- else -- event = MI_WAIT_FOR_PIPEB_SVBLANK; -- } else { -- if (intel_crtc->pipe == 0) -- event = MI_WAIT_FOR_PIPEA_VBLANK; -- else -- event = MI_WAIT_FOR_PIPEB_VBLANK; -- } -+ BoxPtr box; -+ int y1, y2; -+ int event, pipe; -+ I830CrtcPrivatePtr intel_crtc = crtc->driver_private; -+ -+ if (intel_crtc->pipe == 0) { -+ event = MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW; -+ pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEA; -+ } else { -+ event = MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW; -+ pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEB; -+ } - -- BEGIN_BATCH(2); -+ box = REGION_EXTENTS(unused, clipBoxes); -+ y1 = box->y1 - crtc->y; -+ y2 = box->y2 - crtc->y; -+ -+ BEGIN_BATCH(5); -+ /* The documentation says that the LOAD_SCAN_LINES command -+ * always comes in pairs. Don't ask me why. */ -+ OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | pipe); -+ OUT_BATCH((y1 << 16) | y2); -+ OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | pipe); -+ OUT_BATCH((y1 << 16) | y2); - OUT_BATCH(MI_WAIT_FOR_EVENT | event); -- OUT_BATCH(MI_NOOP); - ADVANCE_BATCH(); - } - -diff --git a/src/reg_dumper/Makefile.am b/src/reg_dumper/Makefile.am -index b04395a..fa2defd 100644 ---- a/src/reg_dumper/Makefile.am -+++ b/src/reg_dumper/Makefile.am -@@ -3,7 +3,8 @@ noinst_PROGRAMS = intel_reg_dumper \ - intel_idle \ - intel_stepping \ - intel_statuspage \ -- intel_hotplug -+ intel_hotplug \ -+ intel_lid - - intel_reg_dumper_SOURCES = \ - main.c \ -@@ -36,12 +37,18 @@ intel_statuspage_SOURCES = \ - reg_dumper.h \ - util.c - -+intel_lid_SOURCES = \ -+ lid.c \ -+ reg_dumper.h \ -+ util.c -+ - intel_hotplug_LDADD = $(PCIACCESS_LIBS) - intel_reg_dumper_LDADD = $(PCIACCESS_LIBS) - intel_gtt_LDADD = $(PCIACCESS_LIBS) - intel_idle_LDADD = $(PCIACCESS_LIBS) - intel_stepping_LDADD = $(PCIACCESS_LIBS) - intel_statuspage_LDADD = $(PCIACCESS_LIBS) -+intel_lid_LDADD = $(PCIACCESS_LIBS) - - AM_CFLAGS = $(PCIACCESS_CFLAGS) $(WARN_CFLAGS) \ - -I$(srcdir)/.. -DREG_DUMPER -diff --git a/src/reg_dumper/lid.c b/src/reg_dumper/lid.c -new file mode 100644 -index 0000000..771d67d ---- /dev/null -+++ b/src/reg_dumper/lid.c -@@ -0,0 +1,146 @@ -+/* -+ * Copyright © 2009 Intel Corporation -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: -+ * Zhenyu Wang -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "reg_dumper.h" -+#include "../i810_reg.h" -+#include "../i830_bios.h" -+ -+enum lid_status { -+ LID_UNKNOWN = -1, -+ LID_OPEN, -+ LID_CLOSE, -+}; -+ -+#define ACPI_BUTTON "/proc/acpi/button/" -+#define ACPI_LID "/proc/acpi/button/lid/" -+ -+static int -+i830_lvds_acpi_lid_state(void) -+{ -+ int fd; -+ DIR *button_dir; -+ DIR *lid_dir; -+ struct dirent *lid_dent; -+ char *state_name; -+ char state[64]; -+ enum lid_status ret = LID_UNKNOWN; -+ -+ button_dir = opendir(ACPI_BUTTON); -+ /* If acpi button driver is not loaded, bypass ACPI check method */ -+ if (button_dir == NULL) -+ goto out; -+ closedir(button_dir); -+ -+ lid_dir = opendir(ACPI_LID); -+ -+ /* no acpi lid object found */ -+ if (lid_dir == NULL) -+ goto out; -+ -+ while (1) { -+ lid_dent = readdir(lid_dir); -+ if (lid_dent == NULL) { -+ /* no LID object */ -+ closedir(lid_dir); -+ goto out; -+ } -+ if (strcmp(lid_dent->d_name, ".") && -+ strcmp(lid_dent->d_name, "..")) { -+ break; -+ } -+ } -+ state_name = malloc(strlen(ACPI_LID) + strlen(lid_dent->d_name) + 7); -+ memset(state_name, 0, sizeof(state_name)); -+ strcat(state_name, ACPI_LID); -+ strcat(state_name, lid_dent->d_name); -+ strcat(state_name, "/state"); -+ -+ closedir(lid_dir); -+ -+ if ((fd = open(state_name, O_RDONLY)) == -1) { -+ free(state_name); -+ goto out; -+ } -+ free(state_name); -+ if (read(fd, state, 64) == -1) { -+ close(fd); -+ goto out; -+ } -+ close(fd); -+ if (strstr(state, "open")) -+ ret = LID_OPEN; -+ else if (strstr(state, "closed")) -+ ret = LID_CLOSE; -+ else /* "unsupported" */ -+ ret = LID_UNKNOWN; -+ -+out: -+ return ret; -+} -+ -+int main(int argc, char **argv) -+{ -+ I830Rec i830; -+ I830Ptr pI830 = &i830; -+ int swf14, acpi_lid; -+ -+ intel_i830rec_init(pI830); -+ -+ while (1) { -+ swf14 = INREG(SWF14); -+ -+ printf("Intel LVDS Lid status:\n"); -+ printf("\tSWF14(0x%x) : %s\n", swf14, swf14 & SWF14_LID_SWITCH_EN ? "close" : "open"); -+ -+ acpi_lid = i830_lvds_acpi_lid_state(); -+ switch (acpi_lid) { -+ case LID_UNKNOWN: -+ printf("\tACPI Lid state : unknown\n"); -+ break; -+ case LID_OPEN: -+ printf("\tACPI Lid state : open\n"); -+ break; -+ case LID_CLOSE: -+ printf("\tACPI Lid state : close\n"); -+ break; -+ } -+ sleep(2); -+ } -+ return 0; -+} -diff --git a/src/xvmc/Makefile.am b/src/xvmc/Makefile.am -index 9e62683..a376eb7 100644 ---- a/src/xvmc/Makefile.am -+++ b/src/xvmc/Makefile.am -@@ -1,5 +1,6 @@ - if XVMC - lib_LTLIBRARIES=libI810XvMC.la libIntelXvMC.la -+endif - - libI810XvMC_la_SOURCES = I810XvMC.c \ - I810XvMC.h -@@ -123,4 +124,3 @@ BUILT_SOURCES= $(INTEL_G4B) - clean-local: - -rm -f $(INTEL_G4B) - endif --endif -diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c -index 5abd001..3cb03f5 100644 ---- a/uxa/uxa-glyphs.c -+++ b/uxa/uxa-glyphs.c -@@ -353,9 +353,7 @@ uxa_glyph_cache_hash_remove(uxa_glyph_cache_t *cache, - #define CACHE_Y(pos) (cache->yOffset + ((pos) / cache->columns) * cache->glyphHeight) - - /* The most efficient thing to way to upload the glyph to the screen -- * is to use the UploadToScreen() driver hook; this allows us to -- * pipeline glyph uploads and to avoid creating offscreen pixmaps for -- * glyphs that we'll never use again. -+ * is to use CopyArea; uxa pixmaps are always offscreen. - */ - static Bool - uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, -@@ -363,37 +361,23 @@ uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, - int pos, - GlyphPtr pGlyph) - { -- uxa_screen_t *uxa_screen = uxa_get_screen(pScreen); - PicturePtr pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum]; - PixmapPtr pGlyphPixmap = (PixmapPtr)pGlyphPicture->pDrawable; - PixmapPtr pCachePixmap = (PixmapPtr)cache->picture->pDrawable; -- int cacheXoff, cacheYoff; -- -- if (!uxa_screen->info->put_image || uxa_screen->swappedOut) -- return FALSE; -- -- /* If the glyph pixmap is already uploaded, no point in doing -- * things this way */ -- if (uxa_pixmap_is_offscreen(pGlyphPixmap)) -- return FALSE; -+ GCPtr pGC; - - /* UploadToScreen only works if bpp match */ - if (pGlyphPixmap->drawable.bitsPerPixel != pCachePixmap->drawable.bitsPerPixel) - return FALSE; - -- pCachePixmap = uxa_get_offscreen_pixmap ((DrawablePtr)pCachePixmap, &cacheXoff, &cacheYoff); -- if (!pCachePixmap) -- return FALSE; -- -- if (!uxa_screen->info->put_image(pCachePixmap, -- CACHE_X(pos) + cacheXoff, -- CACHE_Y(pos) + cacheYoff, -- pGlyph->info.width, -- pGlyph->info.height, -- (char *)pGlyphPixmap->devPrivate.ptr, -- pGlyphPixmap->devKind)) -- return FALSE; -- -+ pGC = GetScratchGC(pCachePixmap->drawable.depth, pScreen); -+ ValidateGC(&pCachePixmap->drawable, pGC); -+ (void) uxa_copy_area (&pGlyphPixmap->drawable, -+ &pCachePixmap->drawable, -+ pGC, -+ 0, 0, pGlyph->info.width, pGlyph->info.height, -+ CACHE_X(pos), CACHE_Y(pos)); -+ FreeScratchGC (pGC); - return TRUE; - } - diff --git a/intel-2.7-dont-gtt-map-big-objects.patch b/intel-2.7-dont-gtt-map-big-objects.patch deleted file mode 100644 index 7965aba..0000000 --- a/intel-2.7-dont-gtt-map-big-objects.patch +++ /dev/null @@ -1,121 +0,0 @@ -diff -up xf86-video-intel-2.7.0/src/drmmode_display.c.big-objects xf86-video-intel-2.7.0/src/drmmode_display.c ---- xf86-video-intel-2.7.0/src/drmmode_display.c.big-objects 2009-05-20 11:21:22.000000000 -0400 -+++ xf86-video-intel-2.7.0/src/drmmode_display.c 2009-05-20 11:21:22.000000000 -0400 -@@ -235,6 +235,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, - drmmode_output_dpms(output, DPMSModeOn); - } - -+ i830_set_max_gtt_map_size(pScrn); -+ - done: - if (!ret) { - crtc->x = saved_x; -diff -up xf86-video-intel-2.7.0/src/i830_exa.c.big-objects xf86-video-intel-2.7.0/src/i830_exa.c ---- xf86-video-intel-2.7.0/src/i830_exa.c.big-objects 2009-04-08 19:59:48.000000000 -0400 -+++ xf86-video-intel-2.7.0/src/i830_exa.c 2009-05-20 12:27:35.000000000 -0400 -@@ -862,10 +862,20 @@ i830_uxa_prepare_access (PixmapPtr pixma - - /* Kernel manages fences at GTT map/fault time */ - if (i830->kernel_exec_fencing) { -- if (drm_intel_gem_bo_map_gtt(bo)) { -- xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: bo map failed\n", -- __FUNCTION__); -- return FALSE; -+ if (bo->size < i830->max_gtt_map_size) { -+ if (drm_intel_gem_bo_map_gtt(bo)) { -+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, -+ "%s: bo map failed\n", -+ __FUNCTION__); -+ return FALSE; -+ } -+ } else { -+ if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0) { -+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, -+ "%s: bo map failed\n", -+ __FUNCTION__); -+ return FALSE; -+ } - } - pixmap->devPrivate.ptr = bo->virtual; - } else { /* or not... */ -@@ -898,7 +908,10 @@ i830_uxa_finish_access (PixmapPtr pixmap - } - - if (i830->kernel_exec_fencing) -- drm_intel_gem_bo_unmap_gtt(bo); -+ if (bo->size < i830->max_gtt_map_size) -+ drm_intel_gem_bo_unmap_gtt(bo); -+ else -+ dri_bo_unmap(bo); - else - drm_intel_bo_unpin(bo); - pixmap->devPrivate.ptr = NULL; -diff -up xf86-video-intel-2.7.0/src/i830.h.big-objects xf86-video-intel-2.7.0/src/i830.h ---- xf86-video-intel-2.7.0/src/i830.h.big-objects 2009-05-20 11:21:22.000000000 -0400 -+++ xf86-video-intel-2.7.0/src/i830.h 2009-05-20 11:21:22.000000000 -0400 -@@ -530,6 +530,7 @@ typedef struct _I830Rec { - int accel_pixmap_offset_alignment; - int accel_max_x; - int accel_max_y; -+ int max_gtt_map_size; - - I830WriteIndexedByteFunc writeControl; - I830ReadIndexedByteFunc readControl; -@@ -895,6 +896,7 @@ Bool i830_unbind_all_memory(ScrnInfoPtr - unsigned long i830_get_fence_size(I830Ptr pI830, unsigned long size); - unsigned long i830_get_fence_pitch(I830Ptr pI830, unsigned long pitch, int format); - unsigned long i830_get_fence_alignment(I830Ptr pI830, unsigned long size); -+void i830_set_max_gtt_map_size(ScrnInfoPtr pScrn); - - Bool I830BindAGPMemory(ScrnInfoPtr pScrn); - Bool I830UnbindAGPMemory(ScrnInfoPtr pScrn); -diff -up xf86-video-intel-2.7.0/src/i830_memory.c.big-objects xf86-video-intel-2.7.0/src/i830_memory.c ---- xf86-video-intel-2.7.0/src/i830_memory.c.big-objects 2009-04-13 16:42:07.000000000 -0400 -+++ xf86-video-intel-2.7.0/src/i830_memory.c 2009-05-20 12:35:50.000000000 -0400 -@@ -1276,6 +1276,8 @@ i830_allocate_framebuffer(ScrnInfoPtr pS - if (!pI830->use_drm_mode && pI830->FbBase) - memset (pI830->FbBase + front_buffer->offset, 0, size); - -+ i830_set_max_gtt_map_size(pScrn); -+ - return front_buffer; - } - -@@ -1983,6 +1985,7 @@ i830_bind_all_memory(ScrnInfoPtr pScrn) - } - if (!pI830->use_drm_mode) - i830_update_cursor_offsets(pScrn); -+ i830_set_max_gtt_map_size(pScrn); - - return TRUE; - } -@@ -2067,3 +2070,29 @@ Bool i830_allocate_xvmc_buffer(ScrnInfoP - return TRUE; - } - #endif -+ -+void -+i830_set_max_gtt_map_size(ScrnInfoPtr pScrn) -+{ -+ I830Ptr pI830 = I830PTR(pScrn); -+ struct drm_i915_gem_get_aperture aperture; -+ int ret; -+ -+ /* Default low value in case it gets used during server init. */ -+ pI830->max_gtt_map_size = 16 * 1024 * 1024; -+ -+ if (!pI830->memory_manager) -+ return; -+ -+ ret = ioctl(pI830->drmSubFD, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture); -+ if (ret == 0) { -+ /* Let objects up get bound up to the size where only 2 would fit in -+ * the aperture, but then leave slop to account for alignment like -+ * libdrm does. -+ */ -+ pI830->max_gtt_map_size = aperture.aper_available_size / 4; -+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, -+ "max_gtt_map_size: %dkb.\n", -+ pI830->max_gtt_map_size / 1024); -+ } -+} diff --git a/intel-2.7-fixes.patch b/intel-2.7-fixes.patch deleted file mode 100644 index 254c379..0000000 --- a/intel-2.7-fixes.patch +++ /dev/null @@ -1,361 +0,0 @@ -commit efda7c776b95f8634cd6a2fed88d526de80176bc -Author: Carl Worth -Date: Wed May 6 09:37:34 2009 -0700 - - Split i915 textured video commands to fit into batch buffers. - - i915 textured video commands are quite long, but must be contained in the - same batch buffer as the 3D setup commands. When the number of clip rects - for the video becomes too large for the associated commands to fit in the - same batch buffer, this change breaks the sequence into pieces, ensuring - that each batch contains the necessary setup sequence. - - Signed-off-by: Keith Packard - (cherry picked from commit 8255cca2c9092f7ecb798944aa8f03fa3efcfa6c) - - Conflicts: - - src/i915_video.c - -commit a066cfb0be6e6b20a27eb4ba17f503f13e65e082 -Author: Carl Worth -Date: Wed May 6 09:17:46 2009 -0700 - - Hold reference to video binding table until all rects are painted. - - The optimization of unreferencing the binding table when the relocation is - posted causes the object to be dereferenced for each box in the clip list, - causing general chaos in the buffer manager. It's easier to just hold a - reference to the object until all of the boxes are painted and then drop it. - - Signed-off-by: Keith Packard - (cherry picked from commit 11a853bd8e5d907fe7f5bd907453bcdac9032861) - - Conflicts: - - src/i965_video.c - -commit 115fc9a7d79da07301b96d9fc5c513d33734d273 -Author: Keith Packard -Date: Fri May 1 11:44:13 2009 -0700 - - intel_batch_start_atomic: fix size passed to intel_batch_require_space (*4) - - intel_batch_start_atomic takes an argument in 32-bit units, and so it must - multiply that by 4 before passing it to intel_batch_require_space, which - takes an argument in bytes. - - We should figure out what units we want to use and use the same everywhere... - - Signed-off-by: Keith Packard - (cherry picked from commit 1142353b487c155a31011923fbd08ec67e60f505) - -commit 296a986e5258e2fd13ec494071b7063bd639cd68 -Author: Zhenyu Wang -Date: Mon Mar 23 19:19:58 2009 +0800 - - KMS: hook up output properties for randr - - This gets output properties from kernel, then hook them up - for randr. So we can control output properties through randr - like in UMS. - - Signed-off-by: Zhenyu Wang -diff --git a/src/drmmode_display.c b/src/drmmode_display.c -index a276ff7..7b97a64 100644 ---- a/src/drmmode_display.c -+++ b/src/drmmode_display.c -@@ -35,6 +35,7 @@ - #include "i830.h" - #include "intel_bufmgr.h" - #include "xf86drmMode.h" -+#include "X11/Xatom.h" - - typedef struct { - int fd; -@@ -52,11 +53,20 @@ typedef struct { - } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; - - typedef struct { -+ drmModePropertyPtr mode_prop; -+ uint64_t value; -+ int num_atoms; /* if range prop, num_atoms == 1; if enum prop, num_atoms == num_enums + 1 */ -+ Atom *atoms; -+} drmmode_prop_rec, *drmmode_prop_ptr; -+ -+typedef struct { - drmmode_ptr drmmode; - int output_id; - drmModeConnectorPtr mode_output; - drmModeEncoderPtr mode_encoder; - drmModePropertyBlobPtr edid_blob; -+ int num_props; -+ drmmode_prop_ptr props; - } drmmode_output_private_rec, *drmmode_output_private_ptr; - - static void -@@ -508,9 +518,15 @@ static void - drmmode_output_destroy(xf86OutputPtr output) - { - drmmode_output_private_ptr drmmode_output = output->driver_private; -+ int i; - - if (drmmode_output->edid_blob) - drmModeFreePropertyBlob(drmmode_output->edid_blob); -+ for (i = 0; i < drmmode_output->num_props; i++) { -+ drmModeFreeProperty(drmmode_output->props[i].mode_prop); -+ xfree(drmmode_output->props[i].atoms); -+ } -+ xfree(drmmode_output->props); - drmModeFreeConnector(drmmode_output->mode_output); - xfree(drmmode_output); - output->driver_private = NULL; -@@ -542,7 +558,162 @@ drmmode_output_dpms(xf86OutputPtr output, int mode) - } - } - -+static Bool -+drmmode_property_ignore(drmModePropertyPtr prop) -+{ -+ if (!prop) -+ return TRUE; -+ /* ignore blob prop */ -+ if (prop->flags & DRM_MODE_PROP_BLOB) -+ return TRUE; -+ /* ignore standard property */ -+ if (!strcmp(prop->name, "EDID") || -+ !strcmp(prop->name, "DPMS")) -+ return TRUE; -+ -+ return FALSE; -+} -+ -+static void -+drmmode_output_create_resources(xf86OutputPtr output) -+{ -+ drmmode_output_private_ptr drmmode_output = output->driver_private; -+ drmModeConnectorPtr mode_output = drmmode_output->mode_output; -+ drmmode_ptr drmmode = drmmode_output->drmmode; -+ drmModePropertyPtr drmmode_prop; -+ int i, j, err; -+ -+ drmmode_output->props = xcalloc(mode_output->count_props, sizeof(drmmode_prop_rec)); -+ if (!drmmode_output->props) -+ return; -+ -+ drmmode_output->num_props = 0; -+ for (i = 0, j = 0; i < mode_output->count_props; i++) { -+ drmmode_prop = drmModeGetProperty(drmmode->fd, mode_output->props[i]); -+ if (drmmode_property_ignore(drmmode_prop)) { -+ drmModeFreeProperty(drmmode_prop); -+ continue; -+ } -+ drmmode_output->props[j].mode_prop = drmmode_prop; -+ drmmode_output->props[j].value = mode_output->prop_values[i]; -+ drmmode_output->num_props++; -+ j++; -+ } -+ -+ for (i = 0; i < drmmode_output->num_props; i++) { -+ drmmode_prop_ptr p = &drmmode_output->props[i]; -+ drmmode_prop = p->mode_prop; -+ -+ if (drmmode_prop->flags & DRM_MODE_PROP_RANGE) { -+ INT32 range[2]; -+ -+ p->num_atoms = 1; -+ p->atoms = xcalloc(p->num_atoms, sizeof(Atom)); -+ if (!p->atoms) -+ continue; -+ p->atoms[0] = MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); -+ range[0] = drmmode_prop->values[0]; -+ range[1] = drmmode_prop->values[1]; -+ err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], -+ FALSE, TRUE, -+ drmmode_prop->flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE, -+ 2, range); -+ if (err != 0) { -+ xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, -+ "RRConfigureOutputProperty error, %d\n", err); -+ } -+ err = RRChangeOutputProperty(output->randr_output, p->atoms[0], -+ XA_INTEGER, 32, PropModeReplace, 1, &p->value, FALSE, TRUE); -+ if (err != 0) { -+ xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, -+ "RRChangeOutputProperty error, %d\n", err); -+ } -+ } else if (drmmode_prop->flags & DRM_MODE_PROP_ENUM) { -+ p->num_atoms = drmmode_prop->count_enums + 1; -+ p->atoms = xcalloc(p->num_atoms, sizeof(Atom)); -+ if (!p->atoms) -+ continue; -+ p->atoms[0] = MakeAtom(drmmode_prop->name, strlen(drmmode_prop->name), TRUE); -+ for (j = 1; j <= drmmode_prop->count_enums; j++) { -+ struct drm_mode_property_enum *e = &drmmode_prop->enums[j-1]; -+ p->atoms[j] = MakeAtom(e->name, strlen(e->name), TRUE); -+ } -+ err = RRConfigureOutputProperty(output->randr_output, p->atoms[0], -+ FALSE, FALSE, -+ drmmode_prop->flags & DRM_MODE_PROP_IMMUTABLE ? TRUE : FALSE, -+ p->num_atoms - 1, (INT32 *)&p->atoms[1]); -+ if (err != 0) { -+ xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, -+ "RRConfigureOutputProperty error, %d\n", err); -+ } -+ for (j = 0; j < drmmode_prop->count_enums; j++) -+ if (drmmode_prop->enums[j].value == p->value) -+ break; -+ /* there's always a matching value */ -+ err = RRChangeOutputProperty(output->randr_output, p->atoms[0], -+ XA_ATOM, 32, PropModeReplace, 1, &p->atoms[j+1], FALSE, TRUE); -+ if (err != 0) { -+ xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, -+ "RRChangeOutputProperty error, %d\n", err); -+ } -+ } -+ } -+} -+ -+static Bool -+drmmode_output_set_property(xf86OutputPtr output, Atom property, -+ RRPropertyValuePtr value) -+{ -+ drmmode_output_private_ptr drmmode_output = output->driver_private; -+ drmmode_ptr drmmode = drmmode_output->drmmode; -+ int i; -+ -+ for (i = 0; i < drmmode_output->num_props; i++) { -+ drmmode_prop_ptr p = &drmmode_output->props[i]; -+ -+ if (p->atoms[0] != property) -+ continue; -+ -+ if (p->mode_prop->flags & DRM_MODE_PROP_RANGE) { -+ uint32_t val; -+ -+ if (value->type != XA_INTEGER || value->format != 32 || -+ value->size != 1) -+ return FALSE; -+ val = *(uint32_t *)value->data; -+ -+ drmModeConnectorSetProperty(drmmode->fd, drmmode_output->output_id, -+ p->mode_prop->prop_id, (uint64_t)val); -+ return TRUE; -+ } else if (p->mode_prop->flags & DRM_MODE_PROP_ENUM) { -+ Atom atom; -+ const char *name; -+ int j; -+ -+ if (value->type != XA_ATOM || value->format != 32 || value->size != 1) -+ return FALSE; -+ memcpy(&atom, value->data, 4); -+ name = NameForAtom(atom); -+ -+ /* search for matching name string, then set its value down */ -+ for (j = 0; j < p->mode_prop->count_enums; j++) { -+ if (!strcmp(p->mode_prop->enums[j].name, name)) { -+ drmModeConnectorSetProperty(drmmode->fd, drmmode_output->output_id, -+ p->mode_prop->prop_id, p->mode_prop->enums[j].value); -+ return TRUE; -+ } -+ } -+ } -+ } -+ /* no property found? */ -+ return FALSE; -+} -+ - static const xf86OutputFuncsRec drmmode_output_funcs = { -+ .create_resources = drmmode_output_create_resources, -+#ifdef RANDR_12_INTERFACE -+ .set_property = drmmode_output_set_property, -+#endif - .dpms = drmmode_output_dpms, - #if 0 - -diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h -index a72786e..ec87084 100644 ---- a/src/i830_batchbuffer.h -+++ b/src/i830_batchbuffer.h -@@ -56,7 +56,7 @@ intel_batch_start_atomic(ScrnInfoPtr pScrn, unsigned int sz) - I830Ptr pI830 = I830PTR(pScrn); - - assert(!pI830->in_batch_atomic); -- intel_batch_require_space(pScrn, pI830, sz); -+ intel_batch_require_space(pScrn, pI830, sz * 4); - - pI830->in_batch_atomic = TRUE; - pI830->batch_atomic_limit = pI830->batch_used + sz * 4; -diff --git a/src/i915_video.c b/src/i915_video.c -index 93e0c86..afa1055 100644 ---- a/src/i915_video.c -+++ b/src/i915_video.c -@@ -50,7 +50,8 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, - I830Ptr pI830 = I830PTR(pScrn); - uint32_t format, ms3, s5; - BoxPtr pbox = REGION_RECTS(dstRegion); -- int nbox = REGION_NUM_RECTS(dstRegion); -+ int nbox_total = REGION_NUM_RECTS(dstRegion); -+ int nbox_this_time; - int dxo, dyo, pix_xoff, pix_yoff; - Bool planar; - -@@ -73,7 +74,17 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, - return; - } - -- intel_batch_start_atomic(pScrn, 200 + 20 * nbox); -+#define BYTES_FOR_BOXES(n) ((200 + (n) * 20) * 4) -+#define BOXES_IN_BYTES(s) ((((s)/4) - 200) / 20) -+#define BATCH_BYTES(p) ((p)->batch_bo->size - 16) -+ -+ while (nbox_total) { -+ nbox_this_time = nbox_total; -+ if (BYTES_FOR_BOXES(nbox_this_time) > BATCH_BYTES(pI830)) -+ nbox_this_time = BOXES_IN_BYTES(BATCH_BYTES(pI830)); -+ nbox_total -= nbox_this_time; -+ -+ intel_batch_start_atomic(pScrn, 200 + 20 * nbox_this_time); - - IntelEmitInvarientState(pScrn); - pI830->last_3d = LAST_3D_VIDEO; -@@ -366,7 +377,7 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, - dxo = dstRegion->extents.x1; - dyo = dstRegion->extents.y1; - -- while (nbox--) -+ while (nbox_this_time--) - { - int box_x1 = pbox->x1; - int box_y1 = pbox->y1; -@@ -415,6 +426,7 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, - } - - intel_batch_end_atomic(pScrn); -+ } - - i830MarkSync(pScrn); - } -diff --git a/src/i965_video.c b/src/i965_video.c -index f6020d4..c0a69fd 100644 ---- a/src/i965_video.c -+++ b/src/i965_video.c -@@ -795,7 +795,6 @@ i965_emit_video_setup(ScrnInfoPtr pScrn, drm_intel_bo *bind_bo, int n_src_surf) - OUT_BATCH(0); /* sf */ - /* Only the PS uses the binding table */ - OUT_RELOC(bind_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); -- drm_intel_bo_unreference(bind_bo); - - /* Blend constant color (magenta is fun) */ - OUT_BATCH(BRW_3DSTATE_CONSTANT_COLOR | 3); -@@ -1161,6 +1160,10 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id, - } - - i830MarkSync(pScrn); -+ -+ /* release reference once we're finished */ -+ drm_intel_bo_unreference(bind_bo); -+ - #if WATCH_STATS - i830_dump_error_state(pScrn); - #endif diff --git a/intel-2.7-glyph-copyarea-upload.patch b/intel-2.7-glyph-copyarea-upload.patch deleted file mode 100644 index 06cb463..0000000 --- a/intel-2.7-glyph-copyarea-upload.patch +++ /dev/null @@ -1,130 +0,0 @@ -commit fe08b81d0f5d6f96e0124e6286bd24aba6e140ad -Author: Keith Packard -Date: Mon Mar 2 07:39:41 2009 -0800 - - Use CopyArea to load glyphs from per-glyph pixmap to cache pixmap - - With glyphs sitting in per-glyph pixmaps, there's no reason to use the CPU - to move them to the cache pixmap, and lots of reasons to use the accelerator. - - Signed-off-by: Keith Packard - -diff --git a/src/i830.h b/src/i830.h -index f933917..b145edb 100644 ---- a/src/i830.h -+++ b/src/i830.h -@@ -77,6 +77,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "i915_drm.h" - - #ifdef I830_USE_EXA -+#define EXA_DRIVER_KNOWN_MAJOR 3 - #include "exa.h" - Bool I830EXAInit(ScreenPtr pScreen); - unsigned long long I830TexOffsetStart(PixmapPtr pPix); -diff --git a/src/i830_driver.c b/src/i830_driver.c -index c19fcc6..f104c5f 100644 ---- a/src/i830_driver.c -+++ b/src/i830_driver.c -@@ -1939,12 +1939,17 @@ I830PreInit(ScrnInfoPtr pScrn, int flags) - int errmaj, errmin; - - memset(&req, 0, sizeof(req)); -+#if EXA_VERSION_MAJOR == 3 -+ req.majorversion = 3; -+ req.minorversion = 0; -+#else - req.majorversion = 2; - #if EXA_VERSION_MINOR >= 2 - req.minorversion = 2; - #else - req.minorversion = 1; - #endif -+#endif - if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL, &req, - &errmaj, &errmin)) { - LoaderErrorMsg(NULL, "exa", errmaj, errmin); -diff --git a/src/i830_exa.c b/src/i830_exa.c -index 0a22486..18d8cde 100644 ---- a/src/i830_exa.c -+++ b/src/i830_exa.c -@@ -675,6 +675,10 @@ I830EXAInit(ScreenPtr pScreen) - memset(pI830->EXADriverPtr, 0, sizeof(*pI830->EXADriverPtr)); - - pI830->bufferOffset = 0; -+#if EXA_VERSION_MAJOR > 2 -+ pI830->EXADriverPtr->exa_major = 3; -+ pI830->EXADriverPtr->exa_minor = 0; -+#else - pI830->EXADriverPtr->exa_major = 2; - /* If compiled against EXA 2.2, require 2.2 so we can use the - * PixmapIsOffscreen hook. -@@ -687,6 +691,7 @@ I830EXAInit(ScreenPtr pScreen) - "EXA compatibility mode. Output rotation rendering " - "performance may suffer\n"); - #endif -+#endif - if (!pI830->use_drm_mode) { - pI830->EXADriverPtr->memoryBase = pI830->FbBase; - if (pI830->exa_offscreen) { -diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c -index 5abd001..3cb03f5 100644 ---- a/uxa/uxa-glyphs.c -+++ b/uxa/uxa-glyphs.c -@@ -353,9 +353,7 @@ uxa_glyph_cache_hash_remove(uxa_glyph_cache_t *cache, - #define CACHE_Y(pos) (cache->yOffset + ((pos) / cache->columns) * cache->glyphHeight) - - /* The most efficient thing to way to upload the glyph to the screen -- * is to use the UploadToScreen() driver hook; this allows us to -- * pipeline glyph uploads and to avoid creating offscreen pixmaps for -- * glyphs that we'll never use again. -+ * is to use CopyArea; uxa pixmaps are always offscreen. - */ - static Bool - uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, -@@ -363,37 +361,23 @@ uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, - int pos, - GlyphPtr pGlyph) - { -- uxa_screen_t *uxa_screen = uxa_get_screen(pScreen); - PicturePtr pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum]; - PixmapPtr pGlyphPixmap = (PixmapPtr)pGlyphPicture->pDrawable; - PixmapPtr pCachePixmap = (PixmapPtr)cache->picture->pDrawable; -- int cacheXoff, cacheYoff; -- -- if (!uxa_screen->info->put_image || uxa_screen->swappedOut) -- return FALSE; -- -- /* If the glyph pixmap is already uploaded, no point in doing -- * things this way */ -- if (uxa_pixmap_is_offscreen(pGlyphPixmap)) -- return FALSE; -+ GCPtr pGC; - - /* UploadToScreen only works if bpp match */ - if (pGlyphPixmap->drawable.bitsPerPixel != pCachePixmap->drawable.bitsPerPixel) - return FALSE; - -- pCachePixmap = uxa_get_offscreen_pixmap ((DrawablePtr)pCachePixmap, &cacheXoff, &cacheYoff); -- if (!pCachePixmap) -- return FALSE; -- -- if (!uxa_screen->info->put_image(pCachePixmap, -- CACHE_X(pos) + cacheXoff, -- CACHE_Y(pos) + cacheYoff, -- pGlyph->info.width, -- pGlyph->info.height, -- (char *)pGlyphPixmap->devPrivate.ptr, -- pGlyphPixmap->devKind)) -- return FALSE; -- -+ pGC = GetScratchGC(pCachePixmap->drawable.depth, pScreen); -+ ValidateGC(&pCachePixmap->drawable, pGC); -+ (void) uxa_copy_area (&pGlyphPixmap->drawable, -+ &pCachePixmap->drawable, -+ pGC, -+ 0, 0, pGlyph->info.width, pGlyph->info.height, -+ CACHE_X(pos), CACHE_Y(pos)); -+ FreeScratchGC (pGC); - return TRUE; - } - diff --git a/make-git-snapshot.sh b/make-git-snapshot.sh new file mode 100755 index 0000000..4d1ec9f --- /dev/null +++ b/make-git-snapshot.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# Usage: ./make-git-snapshot.sh [COMMIT] +# +# to make a snapshot of the given tag/branch. Defaults to HEAD. +# Point env var REF to a local mesa repo to reduce clone time. + +DIRNAME=xf86-video-intel-$( date +%Y%m%d ) + +echo REF ${REF:+--reference $REF} +echo DIRNAME $DIRNAME +echo HEAD ${1:-HEAD} + +rm -rf $DIRNAME + +git clone ${REF:+--reference $REF} \ + git://git.freedesktop.org/git/xorg/driver/xf86-video-intel $DIRNAME + +GIT_DIR=$DIRNAME/.git git archive --format=tar --prefix=$DIRNAME/ ${1:-HEAD} \ + | bzip2 > $DIRNAME.tar.bz2 + +# rm -rf $DIRNAME diff --git a/rc1-to-2.7.patch b/rc1-to-2.7.patch deleted file mode 100644 index 29645b6..0000000 --- a/rc1-to-2.7.patch +++ /dev/null @@ -1,1028 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index aeb675c..7d38cad 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -206,7 +206,7 @@ if test "x$GCC" = "xyes"; then - -Wnested-externs -fno-strict-aliasing" - fi - --PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.5]) -+PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.6]) - AM_CONDITIONAL(DRI, test x$DRI = xyes) - if test "$DRI" = yes; then - PKG_CHECK_MODULES(DRI, [xf86driproto glproto]) -diff --git a/man/Makefile.am b/man/Makefile.am -index 7432d5a..ac08621 100644 ---- a/man/Makefile.am -+++ b/man/Makefile.am -@@ -25,21 +25,12 @@ - # - - drivermandir = $(DRIVER_MAN_DIR) -+driverman_DATA = $(DRIVER_NAME).$(DRIVER_MAN_SUFFIX) - --DRIVER_MAN_DIR_SUFFIX = $(DRIVER_MAN_DIR:@mandir@/man%=%) -- --driverman_PRE = @DRIVER_NAME@.man -- --driverman_DATA = \ -- $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) \ -- i810.@DRIVER_MAN_SUFFIX@ -- --EXTRA_DIST = @DRIVER_NAME@.man -+EXTRA_DIST = $(DRIVER_NAME).man - - CLEANFILES = $(driverman_DATA) - --SED = sed -- - # Strings to replace in man pages - XORGRELSTRING = @PACKAGE_STRING@ - XORGMANNAME = X Version 11 -@@ -60,10 +51,3 @@ SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man - - .man.$(DRIVER_MAN_SUFFIX): - sed $(MAN_SUBSTS) < $< > $@ -- --BUILT_SOURCES = shadows.DONE -- --shadows.DONE: -- -rm -f i810.@DRIVER_MAN_SUFFIX@ -- echo .so man$(DRIVER_MAN_DIR_SUFFIX)/intel.$(DRIVER_MAN_SUFFIX) > \ -- i810.@DRIVER_MAN_SUFFIX@ -diff --git a/man/intel.man b/man/intel.man -index ee237f8..ffe69a1 100644 ---- a/man/intel.man -+++ b/man/intel.man -@@ -146,15 +146,6 @@ have options for selecting adaptors. - .IP - Default: Textured video adaptor is preferred. - .TP --.BI "Option \*qLegacy3D\*q \*q" boolean \*q --Enable support for the non-GEM mode of the 3D driver on i830 and newer. --This will allocate a large static area for older Mesa to use for its texture --pool. On systems with a working GEM environment, this can be disabled to --increase the memory pool available to other graphics tasks. --.IP --Default for i830 and newer: Enabled. --.IP --Default for i810: this option is not used. - .BI "Option \*qAccelMethod\*q \*q" string \*q - Choose acceleration architecture, either "XAA", "EXA", or "UXA". XAA is the old - XFree86 based acceleration architecture. EXA is a simpler -@@ -322,7 +313,7 @@ This property allows you to control the output standard used on your TV output p - .B TV_Connector - - connector type - .TP 2 --This config option should be added to xorg.conf TV monitor's section, it allows you to control the TV output connector type, which bypass load detect. You can select between S-Video, Composite and Component. -+This config option should be added to xorg.conf TV monitor's section, it allows you to force the TV output connector type, which bypass load detect and TV will always be taken as connected. You can select between S-Video, Composite and Component. - - .SS "TMDS-1" - First DVI SDVO output -diff --git a/src/Makefile.am b/src/Makefile.am -index e05dbab..ad87afc 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -220,9 +220,3 @@ if XVMC - intel_drv_la_SOURCES += \ - $(INTEL_XVMC_SRCS) - endif -- --install-data-local: install-intel_drv_laLTLIBRARIES -- (cd $(DESTDIR)$(intel_drv_ladir) && rm -f i810_drv.so && ln -s intel_drv.so i810_drv.so) -- --uninstall-local: -- (cd $(DESTDIR)$(intel_drv_ladir) && rm -f i810_drv.so) -diff --git a/src/drmmode_display.c b/src/drmmode_display.c -index 141c027..a276ff7 100644 ---- a/src/drmmode_display.c -+++ b/src/drmmode_display.c -@@ -60,6 +60,9 @@ typedef struct { - } drmmode_output_private_rec, *drmmode_output_private_ptr; - - static void -+drmmode_output_dpms(xf86OutputPtr output, int mode); -+ -+static void - drmmode_ConvertFromKMode(ScrnInfoPtr scrn, - drmModeModeInfoPtr kmode, - DisplayModePtr mode) -@@ -210,6 +213,16 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, - else - ret = TRUE; - -+ /* Turn on any outputs on this crtc that may have been disabled */ -+ for (i = 0; i < xf86_config->num_output; i++) { -+ xf86OutputPtr output = xf86_config->output[i]; -+ -+ if (output->crtc != crtc) -+ continue; -+ -+ drmmode_output_dpms(output, DPMSModeOn); -+ } -+ - done: - if (!ret) { - crtc->x = saved_x; -@@ -359,7 +372,7 @@ drmmode_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *dat - * unbound. */ - drmModeRmFB(drmmode->fd, drmmode_crtc->rotate_fb_id); - drmmode_crtc->rotate_fb_id = 0; -- drm_intel_bo_unmap(drmmode_crtc->rotate_bo); -+ drm_intel_gem_bo_unmap_gtt(drmmode_crtc->rotate_bo); - dri_bo_unreference(drmmode_crtc->rotate_bo); - drmmode_crtc->rotate_bo = NULL; - } -diff --git a/src/i810.h b/src/i810.h -index 7ea2043..c88771e 100644 ---- a/src/i810.h -+++ b/src/i810.h -@@ -70,7 +70,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #define I810_VERSION 4000 - #define I810_NAME "intel" - #define I810_DRIVER_NAME "intel" --#define I810_LEGACY_DRIVER_NAME "i810" - - #define INTEL_VERSION_MAJOR PACKAGE_VERSION_MAJOR - #define INTEL_VERSION_MINOR PACKAGE_VERSION_MINOR -diff --git a/src/i810_driver.c b/src/i810_driver.c -index 6ae388d..fe4bd62 100644 ---- a/src/i810_driver.c -+++ b/src/i810_driver.c -@@ -472,21 +472,6 @@ static XF86ModuleVersionInfo intelVersRec = { - - _X_EXPORT XF86ModuleData intelModuleData = { &intelVersRec, i810Setup, NULL }; - --static XF86ModuleVersionInfo i810VersRec = { -- "i810", -- MODULEVENDORSTRING, -- MODINFOSTRING1, -- MODINFOSTRING2, -- XORG_VERSION_CURRENT, -- INTEL_VERSION_MAJOR, INTEL_VERSION_MINOR, INTEL_VERSION_PATCH, -- ABI_CLASS_VIDEODRV, -- ABI_VIDEODRV_VERSION, -- MOD_CLASS_VIDEODRV, -- {0, 0, 0, 0} --}; -- --_X_EXPORT XF86ModuleData i810ModuleData = { &i810VersRec, i810Setup, NULL }; -- - static pointer - i810Setup(pointer module, pointer opts, int *errmaj, int *errmin) - { -@@ -681,9 +666,7 @@ I810Probe(DriverPtr drv, int flags) - * driver, and return if there are none. - */ - if ((numDevSections = -- xf86MatchDevice(I810_DRIVER_NAME, &devSections)) <= 0 && -- (numDevSections = -- xf86MatchDevice(I810_LEGACY_DRIVER_NAME, &devSections)) <= 0) { -+ xf86MatchDevice(I810_DRIVER_NAME, &devSections)) <= 0 ) { - return FALSE; - } - -diff --git a/src/i830_bios.c b/src/i830_bios.c -index 7f20553..4f2355d 100644 ---- a/src/i830_bios.c -+++ b/src/i830_bios.c -@@ -161,7 +161,7 @@ parse_general_features(I830Ptr pI830, struct bdb_header *bdb) - pI830->tv_present = general->int_tv_support; - pI830->lvds_use_ssc = general->enable_ssc; - if (pI830->lvds_use_ssc) { -- if (IS_I855(pI830)) -+ if (IS_I85X(pI830)) - pI830->lvds_ssc_freq = general->ssc_freq ? 66 : 48; - else - pI830->lvds_ssc_freq = general->ssc_freq ? 100 : 96; -@@ -181,6 +181,12 @@ parse_driver_feature(I830Ptr pI830, struct bdb_header *bdb) - if (!IS_I9XX(pI830)) - return; - -+ /* XXX Disable this parsing, as it looks doesn't work for all -+ VBIOS. Reenable it if we could find out the reliable VBT parsing -+ for LVDS config later. */ -+ if (1) -+ return; -+ - feature = find_section(bdb, BDB_DRIVER_FEATURES); - if (!feature) - return; -diff --git a/src/i830_display.c b/src/i830_display.c -index ca55906..43ea4d4 100644 ---- a/src/i830_display.c -+++ b/src/i830_display.c -@@ -865,6 +865,9 @@ i830_disable_vga_plane (xf86CrtcPtr crtc) - sr01 = INREG8(SRX + 1); - OUTREG8(SRX + 1, sr01 | (1 << 5)); - usleep(30); -+ /* disable center mode on 965GM and G4X platform */ -+ if (IS_I965GM(pI830) || IS_G4X(pI830)) -+ vgacntrl &= ~(3 << 24); - - vgacntrl |= VGA_DISP_DISABLE; - -@@ -873,14 +876,8 @@ i830_disable_vga_plane (xf86CrtcPtr crtc) - - } - --/** -- * Sets the power management mode of the pipe and plane. -- * -- * This code should probably grow support for turning the cursor off and back -- * on appropriately at the same time as we're turning the pipe off/on. -- */ --static void --i830_crtc_dpms(xf86CrtcPtr crtc, int mode) -+void -+i830_crtc_enable(xf86CrtcPtr crtc) - { - ScrnInfoPtr pScrn = crtc->scrn; - I830Ptr pI830 = I830PTR(pScrn); -@@ -893,112 +890,148 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode) - int dspbase_reg = (plane == 0) ? DSPABASE : DSPBBASE; - uint32_t temp; - -- /* XXX: When our outputs are all unaware of DPMS modes other than off and -- * on, we should map those modes to DPMSModeOff in the CRTC. -- */ -- switch (mode) { -- case DPMSModeOn: -- case DPMSModeStandby: -- case DPMSModeSuspend: -- /* Enable the DPLL */ -- temp = INREG(dpll_reg); -- if ((temp & DPLL_VCO_ENABLE) == 0) -- { -- OUTREG(dpll_reg, temp); -- POSTING_READ(dpll_reg); -- /* Wait for the clocks to stabilize. */ -- usleep(150); -- OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE); -- POSTING_READ(dpll_reg); -- /* Wait for the clocks to stabilize. */ -- usleep(150); -- OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE); -- POSTING_READ(dpll_reg); -- /* Wait for the clocks to stabilize. */ -- usleep(150); -- } -+ /* Enable the DPLL */ -+ temp = INREG(dpll_reg); -+ if ((temp & DPLL_VCO_ENABLE) == 0) -+ { -+ OUTREG(dpll_reg, temp); -+ POSTING_READ(dpll_reg); -+ /* Wait for the clocks to stabilize. */ -+ usleep(150); -+ OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE); -+ POSTING_READ(dpll_reg); -+ /* Wait for the clocks to stabilize. */ -+ usleep(150); -+ OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE); -+ POSTING_READ(dpll_reg); -+ /* Wait for the clocks to stabilize. */ -+ usleep(150); -+ } - -- /* Enable the pipe */ -- temp = INREG(pipeconf_reg); -- if ((temp & PIPEACONF_ENABLE) == 0) -- OUTREG(pipeconf_reg, temp | PIPEACONF_ENABLE); -+ /* Enable the pipe */ -+ temp = INREG(pipeconf_reg); -+ if ((temp & PIPEACONF_ENABLE) == 0) -+ OUTREG(pipeconf_reg, temp | PIPEACONF_ENABLE); - -- /* Enable the plane */ -- temp = INREG(dspcntr_reg); -- if ((temp & DISPLAY_PLANE_ENABLE) == 0) -- { -- OUTREG(dspcntr_reg, temp | DISPLAY_PLANE_ENABLE); -- /* Flush the plane changes */ -- OUTREG(dspbase_reg, INREG(dspbase_reg)); -- } -+ /* Enable the plane */ -+ temp = INREG(dspcntr_reg); -+ if ((temp & DISPLAY_PLANE_ENABLE) == 0) -+ { -+ OUTREG(dspcntr_reg, temp | DISPLAY_PLANE_ENABLE); -+ /* Flush the plane changes */ -+ OUTREG(dspbase_reg, INREG(dspbase_reg)); -+ } - -- i830_crtc_load_lut(crtc); -+ i830_crtc_load_lut(crtc); - -- /* Give the overlay scaler a chance to enable if it's on this pipe */ -- i830_crtc_dpms_video(crtc, TRUE); -+ /* Give the overlay scaler a chance to enable if it's on this pipe */ -+ i830_crtc_dpms_video(crtc, TRUE); - -- /* Reenable compression if needed */ -- if (i830_use_fb_compression(crtc)) -- i830_enable_fb_compression(crtc); -- i830_modeset_ctl(crtc, 0); -- break; -- case DPMSModeOff: -- i830_modeset_ctl(crtc, 1); -- /* Shut off compression if in use */ -- if (i830_use_fb_compression(crtc)) -- i830_disable_fb_compression(crtc); -+ /* Reenable compression if needed */ -+ if (i830_use_fb_compression(crtc)) -+ i830_enable_fb_compression(crtc); -+ i830_modeset_ctl(crtc, 0); -+} - -- /* Give the overlay scaler a chance to disable if it's on this pipe */ -- i830_crtc_dpms_video(crtc, FALSE); -+void -+i830_crtc_disable(xf86CrtcPtr crtc, Bool disable_pipe) -+{ -+ ScrnInfoPtr pScrn = crtc->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ I830CrtcPrivatePtr intel_crtc = crtc->driver_private; -+ int pipe = intel_crtc->pipe; -+ int plane = intel_crtc->plane; -+ int dpll_reg = (pipe == 0) ? DPLL_A : DPLL_B; -+ int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; -+ int dspcntr_reg = (plane == 0) ? DSPACNTR : DSPBCNTR; -+ int dspbase_reg = (plane == 0) ? DSPABASE : DSPBBASE; -+ uint32_t temp; - -- /* -- * The documentation says : -- * - Disable planes (VGA or hires) -- * - Disable pipe -- * - Disable VGA display -- */ -+ i830_modeset_ctl(crtc, 1); -+ /* Shut off compression if in use */ -+ if (i830_use_fb_compression(crtc)) -+ i830_disable_fb_compression(crtc); - -- /* Disable display plane */ -- temp = INREG(dspcntr_reg); -- if ((temp & DISPLAY_PLANE_ENABLE) != 0) -- { -- OUTREG(dspcntr_reg, temp & ~DISPLAY_PLANE_ENABLE); -- /* Flush the plane changes */ -- OUTREG(dspbase_reg, INREG(dspbase_reg)); -- POSTING_READ(dspbase_reg); -- } -+ /* Give the overlay scaler a chance to disable if it's on this pipe */ -+ i830_crtc_dpms_video(crtc, FALSE); - -- if (!IS_I9XX(pI830)) { -- /* Wait for vblank for the disable to take effect */ -- i830WaitForVblank(pScrn); -- } -+ /* -+ * The documentation says : -+ * - Disable planes (VGA or hires) -+ * - Disable pipe -+ * - Disable VGA display -+ */ - -- /* May need to leave pipe A on */ -- if ((pipe != 0) || !(pI830->quirk_flag & QUIRK_PIPEA_FORCE)) -- { -- /* Next, disable display pipes */ -- temp = INREG(pipeconf_reg); -- if ((temp & PIPEACONF_ENABLE) != 0) { -- OUTREG(pipeconf_reg, temp & ~PIPEACONF_ENABLE); -- POSTING_READ(pipeconf_reg); -- } -+ /* Disable display plane */ -+ temp = INREG(dspcntr_reg); -+ if ((temp & DISPLAY_PLANE_ENABLE) != 0) -+ { -+ OUTREG(dspcntr_reg, temp & ~DISPLAY_PLANE_ENABLE); -+ /* Flush the plane changes */ -+ OUTREG(dspbase_reg, INREG(dspbase_reg)); -+ POSTING_READ(dspbase_reg); -+ } - -- /* Wait for vblank for the disable to take effect. */ -- i830WaitForVblank(pScrn); -+ if (!IS_I9XX(pI830)) { -+ /* Wait for vblank for the disable to take effect */ -+ i830WaitForVblank(pScrn); -+ } - -- temp = INREG(dpll_reg); -- if ((temp & DPLL_VCO_ENABLE) != 0) { -- OUTREG(dpll_reg, temp & ~DPLL_VCO_ENABLE); -- POSTING_READ(dpll_reg); -- } -+ /* May need to leave pipe A on */ -+ if (disable_pipe) -+ { -+ /* Next, disable display pipes */ -+ temp = INREG(pipeconf_reg); -+ if ((temp & PIPEACONF_ENABLE) != 0) { -+ OUTREG(pipeconf_reg, temp & ~PIPEACONF_ENABLE); -+ POSTING_READ(pipeconf_reg); -+ } - -- /* Wait for the clocks to turn off. */ -- usleep(150); -+ /* Wait for vblank for the disable to take effect. */ -+ i830WaitForVblank(pScrn); -+ -+ temp = INREG(dpll_reg); -+ if ((temp & DPLL_VCO_ENABLE) != 0) { -+ OUTREG(dpll_reg, temp & ~DPLL_VCO_ENABLE); -+ POSTING_READ(dpll_reg); - } - -- /* Disable the VGA plane that we never use. */ -- i830_disable_vga_plane (crtc); -+ /* Wait for the clocks to turn off. */ -+ usleep(150); -+ } - -+ /* Disable the VGA plane that we never use. */ -+ i830_disable_vga_plane (crtc); -+} -+ -+/** -+ * Sets the power management mode of the pipe and plane. -+ * -+ * This code should probably grow support for turning the cursor off and back -+ * on appropriately at the same time as we're turning the pipe off/on. -+ */ -+static void -+i830_crtc_dpms(xf86CrtcPtr crtc, int mode) -+{ -+ ScrnInfoPtr pScrn = crtc->scrn; -+ I830Ptr pI830 = I830PTR(pScrn); -+ I830CrtcPrivatePtr intel_crtc = crtc->driver_private; -+ int pipe = intel_crtc->pipe; -+ Bool disable_pipe = TRUE; -+ -+ /* XXX: When our outputs are all unaware of DPMS modes other than off and -+ * on, we should map those modes to DPMSModeOff in the CRTC. -+ */ -+ switch (mode) { -+ case DPMSModeOn: -+ case DPMSModeStandby: -+ case DPMSModeSuspend: -+ i830_crtc_enable(crtc); -+ break; -+ case DPMSModeOff: -+ if ((pipe == 0) && (pI830->quirk_flag & QUIRK_PIPEA_FORCE)) -+ disable_pipe = FALSE; -+ i830_crtc_disable(crtc, disable_pipe); - break; - } - -diff --git a/src/i830_display.h b/src/i830_display.h -index 8d767b1..0ba196d 100644 ---- a/src/i830_display.h -+++ b/src/i830_display.h -@@ -32,6 +32,8 @@ void i830PipeSetBase(xf86CrtcPtr crtc, int x, int y); - void i830WaitForVblank(ScrnInfoPtr pScrn); - void i830DescribeOutputConfiguration(ScrnInfoPtr pScrn); - void i830_set_new_crtc_bo(ScrnInfoPtr pScrn); -+void i830_crtc_disable(xf86CrtcPtr crtc, Bool disable_pipe); -+void i830_crtc_enable(xf86CrtcPtr crtc); - - xf86CrtcPtr i830GetLoadDetectPipe(xf86OutputPtr output, DisplayModePtr mode, int *dpms_mode); - void i830ReleaseLoadDetectPipe(xf86OutputPtr output, int dpms_mode); -diff --git a/src/i830_driver.c b/src/i830_driver.c -index 6ec1a48..d7ee615 100644 ---- a/src/i830_driver.c -+++ b/src/i830_driver.c -@@ -311,7 +311,6 @@ typedef enum { - OPTION_LVDS24BITMODE, - OPTION_FBC, - OPTION_TILING, -- OPTION_LEGACY3D, - OPTION_LVDSFIXEDMODE, - OPTION_FORCEENABLEPIPEA, - #ifdef INTEL_XVMC -@@ -332,9 +331,6 @@ static OptionInfoRec I830Options[] = { - {OPTION_LVDS24BITMODE, "LVDS24Bit", OPTV_BOOLEAN, {0}, FALSE}, - {OPTION_FBC, "FramebufferCompression", OPTV_BOOLEAN, {0}, TRUE}, - {OPTION_TILING, "Tiling", OPTV_BOOLEAN, {0}, TRUE}, --#ifdef XF86DRI -- {OPTION_LEGACY3D, "Legacy3D", OPTV_BOOLEAN, {0}, FALSE}, --#endif - {OPTION_LVDSFIXEDMODE, "LVDSFixedMode", OPTV_BOOLEAN, {0}, FALSE}, - {OPTION_FORCEENABLEPIPEA, "ForceEnablePipeA", OPTV_BOOLEAN, {0}, FALSE}, - #ifdef INTEL_XVMC -@@ -827,22 +823,40 @@ i830_update_front_offset(ScrnInfoPtr pScrn) - ScreenPtr pScreen = pScrn->pScreen; - I830Ptr pI830 = I830PTR(pScrn); - int pitch = pScrn->displayWidth * pI830->cpp; -+ pointer data = NULL; - - /* Update buffer locations, which may have changed as a result of - * i830_bind_all_memory(). - */ - pScrn->fbOffset = pI830->front_buffer->offset; - -+ if (pI830->starting || pI830->accel == ACCEL_UXA) -+ return; -+ - /* If we are still in ScreenInit, there is no screen pixmap to be updated - * yet. We'll fix it up at CreateScreenResources. - */ -- if (!pI830->starting && pI830->accel != ACCEL_UXA) { -- if (!pScreen->ModifyPixmapHeader(pScreen->GetScreenPixmap(pScreen), -+ if (!pI830->memory_manager) { -+ data = pI830->FbBase + pScrn->fbOffset; /* default to legacy */ -+ } else { -+ dri_bo *bo = pI830->front_buffer->bo; -+ -+ if (bo) { -+ if (pI830->kernel_exec_fencing) { -+ if (drm_intel_gem_bo_map_gtt(bo)) -+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: bo map failed\n", -+ __FUNCTION__); -+ } else { -+ /* Will already be pinned by bind_all_memory in this case */ -+ drm_intel_gem_bo_start_gtt_access(bo, 1); -+ } -+ data = bo->virtual; -+ } -+ } -+ if (!pScreen->ModifyPixmapHeader(pScreen->GetScreenPixmap(pScreen), - pScrn->virtualX, pScrn->virtualY, -1, -1, -- pitch, (pointer)(pI830->FbBase + -- pScrn->fbOffset))) -+ pitch, data)) - FatalError("Couldn't adjust screen pixmap\n"); -- } - } - - /** -@@ -1707,12 +1721,8 @@ I830DrmModeInit(ScrnInfoPtr pScrn) - pI830->accel = ACCEL_UXA; - - if ((s = (char *)xf86GetOptValString(pI830->Options, OPTION_ACCELMETHOD))) { -- if (!xf86NameCmp(s, "EXA")) -- pI830->accel = ACCEL_EXA; -- else if (!xf86NameCmp(s, "UXA")) -- pI830->accel = ACCEL_UXA; -- else -- pI830->accel = ACCEL_UXA; -+ if (xf86NameCmp(s, "UXA")) -+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "kernel mode setting active,overridding accelmethod and using UXA\n"); - } - - pI830->can_resize = FALSE; -@@ -2283,7 +2293,7 @@ RestoreHWState(ScrnInfoPtr pScrn) - /* Disable pipes */ - for (i = 0; i < xf86_config->num_crtc; i++) { - xf86CrtcPtr crtc = xf86_config->crtc[i]; -- crtc->funcs->dpms(crtc, DPMSModeOff); -+ i830_crtc_disable(crtc, TRUE); - } - i830WaitForVblank(pScrn); - -@@ -3019,11 +3029,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) - */ - if (!pI830->can_resize && pI830->directRenderingType == DRI_NONE && I830DRIScreenInit(pScreen)) - pI830->directRenderingType = DRI_XF86DRI; -- -- if (pI830->directRenderingType == DRI_XF86DRI) { -- pI830->allocate_classic_textures = -- xf86ReturnOptValBool(pI830->Options, OPTION_LEGACY3D, TRUE); -- } - #endif - - /* Enable tiling by default */ -@@ -3473,8 +3478,9 @@ static Bool - I830EnterVT(int scrnIndex, int flags) - { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; -+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - I830Ptr pI830 = I830PTR(pScrn); -- int ret; -+ int i, ret; - - DPRINTF(PFX, "Enter VT\n"); - -@@ -3495,6 +3501,23 @@ I830EnterVT(int scrnIndex, int flags) - SaveHWState(pScrn); - } - -+ /* Get the hardware into a known state if needed */ -+ if (!pI830->use_drm_mode) { -+ /* Disable outputs */ -+ for (i = 0; i < xf86_config->num_output; i++) { -+ xf86OutputPtr output = xf86_config->output[i]; -+ output->funcs->dpms(output, DPMSModeOff); -+ } -+ i830WaitForVblank(pScrn); -+ -+ /* Disable pipes */ -+ for (i = 0; i < xf86_config->num_crtc; i++) { -+ xf86CrtcPtr crtc = xf86_config->crtc[i]; -+ i830_crtc_disable(crtc, TRUE); -+ } -+ i830WaitForVblank(pScrn); -+ } -+ - pI830->leaving = FALSE; - - if (!pI830->use_drm_mode) -diff --git a/src/i830_exa.c b/src/i830_exa.c -index 0a22486..fc4e66c 100644 ---- a/src/i830_exa.c -+++ b/src/i830_exa.c -@@ -37,6 +37,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "i810_reg.h" - #include "i915_drm.h" - #include -+#include - - #define ALWAYS_SYNC 0 - #define ALWAYS_FLUSH 0 -@@ -837,8 +838,6 @@ i830_uxa_set_pixmap_bo (PixmapPtr pixmap, dri_bo *bo) - static Bool - i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access) - { -- ScrnInfoPtr pScrn = xf86Screens[pixmap->drawable.pScreen->myNum]; -- I830Ptr pI830 = I830PTR(pScrn); - dri_bo *bo = i830_get_pixmap_bo (pixmap); - - if (bo) { -@@ -853,16 +852,27 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access) - i830->need_sync = FALSE; - } - -- if (pScrn->vtSema && !pI830->use_drm_mode && pI830->memory_manager) { -- if (drm_intel_bo_pin(bo, 4096) != 0) -- return FALSE; -- drm_intel_gem_bo_start_gtt_access(bo, access == UXA_ACCESS_RW); -- pixmap->devPrivate.ptr = pI830->FbBase + bo->offset; -- } else { -+ /* No VT sema or GEM? No GTT mapping. */ -+ if (!scrn->vtSema || !i830->memory_manager) { - if (dri_bo_map(bo, access == UXA_ACCESS_RW) != 0) - return FALSE; - pixmap->devPrivate.ptr = bo->virtual; -+ return TRUE; -+ } -+ -+ /* Kernel manages fences at GTT map/fault time */ -+ if (i830->kernel_exec_fencing) { -+ if (drm_intel_gem_bo_map_gtt(bo)) { -+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: bo map failed\n", -+ __FUNCTION__); -+ return FALSE; -+ } -+ } else { /* or not... */ -+ if (drm_intel_bo_pin(bo, 4096) != 0) -+ return FALSE; -+ drm_intel_gem_bo_start_gtt_access(bo, access == UXA_ACCESS_RW); - } -+ pixmap->devPrivate.ptr = bo->virtual; - } - return TRUE; - } -@@ -870,8 +880,6 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access) - static void - i830_uxa_finish_access (PixmapPtr pixmap) - { -- ScrnInfoPtr pScrn = xf86Screens[pixmap->drawable.pScreen->myNum]; -- I830Ptr pI830 = I830PTR(pScrn); - dri_bo *bo = i830_get_pixmap_bo (pixmap); - - if (bo) { -@@ -879,14 +887,20 @@ i830_uxa_finish_access (PixmapPtr pixmap) - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - I830Ptr i830 = I830PTR(scrn); - -- if (pScrn->vtSema && !pI830->use_drm_mode && pI830->memory_manager) -- drm_intel_bo_unpin(bo); -- else -+ if (bo == i830->front_buffer->bo) -+ i830->need_flush = TRUE; -+ -+ if (!scrn->vtSema || !i830->memory_manager) { - dri_bo_unmap(bo); -+ pixmap->devPrivate.ptr = NULL; -+ return; -+ } - -+ if (i830->kernel_exec_fencing) -+ drm_intel_gem_bo_unmap_gtt(bo); -+ else -+ drm_intel_bo_unpin(bo); - pixmap->devPrivate.ptr = NULL; -- if (bo == i830->front_buffer->bo) -- i830->need_flush = TRUE; - } - } - -diff --git a/src/i830_lvds.c b/src/i830_lvds.c -index 7569e99..7fc0bce 100644 ---- a/src/i830_lvds.c -+++ b/src/i830_lvds.c -@@ -881,6 +881,13 @@ i830_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode, - static xf86OutputStatus - i830_lvds_detect(xf86OutputPtr output) - { -+ /* Fallback to origin, mark LVDS always connected. -+ * From wider tests, we have seen both broken cases with -+ * ACPI lid and SWF bit. So disable them for now until we -+ * get a reliable way for LVDS detect. -+ */ -+ return XF86OutputStatusConnected; -+ - enum lid_status lid; - - lid = i830_lvds_acpi_lid_open(output); -diff --git a/src/i830_memory.c b/src/i830_memory.c -index 361fff7..e3314c5 100644 ---- a/src/i830_memory.c -+++ b/src/i830_memory.c -@@ -253,7 +253,8 @@ i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem) - mem->bound = TRUE; - } - -- if (mem->tiling != TILE_NONE && !pI830->use_drm_mode) { -+ if (mem->tiling != TILE_NONE && !pI830->use_drm_mode && -+ !pI830->kernel_exec_fencing) { - mem->fence_nr = i830_set_tiling(pScrn, mem->offset, mem->pitch, - mem->allocated_size, mem->tiling); - } -@@ -269,7 +270,8 @@ i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem) - if (mem == NULL || !mem->bound) - return TRUE; - -- if (mem->tiling != TILE_NONE && !pI830->use_drm_mode) -+ if (mem->tiling != TILE_NONE && !pI830->use_drm_mode && -+ !pI830->kernel_exec_fencing) - i830_clear_tiling(pScrn, mem->fence_nr); - - #ifdef XF86DRI -@@ -504,9 +506,6 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size) - mmsize -= ROUND_TO_PAGE(3 * pScrn->displayWidth * pI830->cpp * - pScrn->virtualY); - } -- /* Classic textures are fixed. */ -- if (pI830->allocate_classic_textures) -- mmsize -= MB(32); - /* Overlay and cursors, if physical, need to be allocated outside - * of the kernel memory manager. - */ -@@ -535,12 +534,8 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size) - int ret; - - sp.param = I915_SETPARAM_NUM_USED_FENCES; -- if (pI830->use_drm_mode) -- sp.value = 0; /* kernel gets them all */ -- else if (pI830->directRenderingType == DRI_XF86DRI) -- sp.value = 3; /* front/back/depth */ -- else -- sp.value = 2; /* just front for DRI2 (both old & new though) */ -+ sp.value = 0; /* kernel gets them all */ -+ - ret = drmCommandWrite(pI830->drmSubFD, DRM_I915_SETPARAM, &sp, - sizeof(sp)); - if (ret == 0) -@@ -566,6 +561,8 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size) - i830_free_memory(pScrn, pI830->memory_manager); - pI830->memory_manager = NULL; - } -+ } else { -+ pI830->allocate_classic_textures = TRUE; - } - #endif /* XF86DRI */ - -@@ -961,8 +958,6 @@ i830_allocate_memory(ScrnInfoPtr pScrn, const char *name, - } - } - -- mem->tiling = TILE_NONE; -- - return mem; - } - -@@ -1445,7 +1440,7 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn) - - if (pI830->memory_manager == NULL) { - pI830->fake_bufmgr_mem = i830_allocate_memory(pScrn, "fake bufmgr", -- MB(1), PITCH_NONE, GTT_PAGE_SIZE, 0, -+ MB(8), PITCH_NONE, GTT_PAGE_SIZE, 0, - TILE_NONE); - if (pI830->fake_bufmgr_mem == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, -diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c -index 1f2578e..254b866 100644 ---- a/src/i830_sdvo.c -+++ b/src/i830_sdvo.c -@@ -1039,8 +1039,13 @@ i830_sdvo_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, - - ErrorF("input modeline:\n"); - xf86PrintModeline(0, adjusted_mode); -+ -+ /* adjust origin mode's clock for current input, -+ for correct pixel mulitiplier setting. */ -+ mode->Clock = adjusted_mode->Clock; -+ - /* Clock range is required to be in 100-200Mhz */ -- adjusted_mode->Clock *= i830_sdvo_get_pixel_multiplier(adjusted_mode); -+ adjusted_mode->Clock *= i830_sdvo_get_pixel_multiplier(mode); - } else { - return FALSE; - } -@@ -1385,7 +1390,9 @@ i830_sdvo_ddc_i2c_start(I2CBusPtr b, int timeout) - xf86OutputPtr output = b->DriverPrivate.ptr; - I830OutputPrivatePtr intel_output = output->driver_private; - I2CBusPtr i2cbus = intel_output->pI2CBus; -+ struct i830_sdvo_priv *dev_priv = intel_output->dev_priv; - -+ i830_sdvo_set_control_bus_switch(output, dev_priv->ddc_bus); - return i2cbus->I2CStart(i2cbus, timeout); - } - -@@ -1539,6 +1546,10 @@ i830_sdvo_output_setup (xf86OutputPtr output, uint16_t flag) - else - name_suffix = "-2"; - -+ /* clear up privates */ -+ dev_priv->is_tv = FALSE; -+ intel_output->needs_tv_clock = FALSE; -+ - if (flag & (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) - { - if (flag & SDVO_OUTPUT_TMDS0) -@@ -1709,11 +1720,9 @@ i830_sdvo_get_ddc_modes(xf86OutputPtr output) - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - DisplayModePtr modes = NULL; - xf86OutputPtr crt; -- I830OutputPrivatePtr intel_output = output->driver_private; -+ I830OutputPrivatePtr intel_output; - xf86MonPtr edid_mon = NULL; -- struct i830_sdvo_priv *dev_priv = intel_output->dev_priv; -- -- i830_sdvo_set_control_bus_switch(output, dev_priv->ddc_bus); -+ struct i830_sdvo_priv *dev_priv; - - modes = i830_ddc_get_modes(output); - if (modes != NULL) -diff --git a/src/i830_tv.c b/src/i830_tv.c -index 1e3cf7b..8eb3e26 100644 ---- a/src/i830_tv.c -+++ b/src/i830_tv.c -@@ -1079,7 +1079,7 @@ i830_tv_update_contrast(I830Ptr pI830, uint8_t contrast) - c = float_to_fix_2_6(con); - } else { - /* 2.6 floating point */ -- con = 8.875 * ((float) contrast / 255); -+ con = 2.65625 * ((float) contrast / 255); - c = float_to_float_2_6(con); - } - val |= (c << TV_CONTRAST_SHIFT) & TV_CONTRAST_MASK; -@@ -1098,7 +1098,7 @@ i830_tv_update_saturation(I830Ptr pI830, uint8_t saturation) - sat = 3.0 * ((float) saturation / 255); - s = float_to_fix_2_6(sat); - } else { -- sat = 8.875 * ((float) saturation / 255); -+ sat = 2.65625 * ((float) saturation / 255); - s = float_to_float_2_6(sat); - } - val |= (s << TV_SATURATION_SHIFT) & TV_SATURATION_MASK; -@@ -1458,6 +1458,10 @@ i830_tv_detect(xf86OutputPtr output) - int dpms_mode; - int type = dev_priv->type; - -+ /* If TV connector type set by user, always return connected */ -+ if (dev_priv->force_type) -+ return XF86OutputStatusConnected; -+ - mode = reported_modes[0]; - xf86SetModeCrtc (&mode, INTERLACE_HALVE_V); - crtc = i830GetLoadDetectPipe (output, &mode, &dpms_mode); -@@ -1467,13 +1471,6 @@ i830_tv_detect(xf86OutputPtr output) - i830ReleaseLoadDetectPipe (output, dpms_mode); - } - -- if (dev_priv->force_type) { -- if (type == TV_TYPE_NONE) -- return XF86OutputStatusDisconnected; -- else -- return XF86OutputStatusConnected; -- } -- - if (type != dev_priv->type) - { - dev_priv->type = type; -diff --git a/src/i830_video.c b/src/i830_video.c -index daa2411..3f3aaac 100644 ---- a/src/i830_video.c -+++ b/src/i830_video.c -@@ -1048,11 +1048,14 @@ I830StopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) - if (pPriv->videoStatus & CLIENT_VIDEO_ON) { - i830_overlay_off(pScrn); - } -- if (!pPriv->textured) -- drm_intel_bo_unpin(pPriv->buf); -- drm_intel_bo_unreference(pPriv->buf); -- pPriv->buf = NULL; -- pPriv->videoStatus = 0; -+ -+ if (pPriv->buf) { -+ if (!pPriv->textured) -+ drm_intel_bo_unpin(pPriv->buf); -+ drm_intel_bo_unreference(pPriv->buf); -+ pPriv->buf = NULL; -+ pPriv->videoStatus = 0; -+ } - } else { - if (pPriv->videoStatus & CLIENT_VIDEO_ON) { - pPriv->videoStatus |= OFF_TIMER; -@@ -1382,7 +1385,7 @@ I830CopyPlanarData(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, - dst_base = pPriv->buf->virtual; - } else { - drm_intel_gem_bo_start_gtt_access(pPriv->buf, TRUE); -- dst_base = pI830->FbBase + pPriv->buf->offset; -+ dst_base = pI830->FbBase; - } - - if (pPriv->currentBuf == 0) -diff --git a/src/xvmc/Makefile.am b/src/xvmc/Makefile.am -index 9e62683..a376eb7 100644 ---- a/src/xvmc/Makefile.am -+++ b/src/xvmc/Makefile.am -@@ -1,5 +1,6 @@ - if XVMC - lib_LTLIBRARIES=libI810XvMC.la libIntelXvMC.la -+endif - - libI810XvMC_la_SOURCES = I810XvMC.c \ - I810XvMC.h -@@ -123,4 +124,3 @@ BUILT_SOURCES= $(INTEL_G4B) - clean-local: - -rm -f $(INTEL_G4B) - endif --endif -diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c -index 5abd001..3cb03f5 100644 ---- a/uxa/uxa-glyphs.c -+++ b/uxa/uxa-glyphs.c -@@ -353,9 +353,7 @@ uxa_glyph_cache_hash_remove(uxa_glyph_cache_t *cache, - #define CACHE_Y(pos) (cache->yOffset + ((pos) / cache->columns) * cache->glyphHeight) - - /* The most efficient thing to way to upload the glyph to the screen -- * is to use the UploadToScreen() driver hook; this allows us to -- * pipeline glyph uploads and to avoid creating offscreen pixmaps for -- * glyphs that we'll never use again. -+ * is to use CopyArea; uxa pixmaps are always offscreen. - */ - static Bool - uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, -@@ -363,37 +361,23 @@ uxa_glyph_cache_upload_glyph(ScreenPtr pScreen, - int pos, - GlyphPtr pGlyph) - { -- uxa_screen_t *uxa_screen = uxa_get_screen(pScreen); - PicturePtr pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum]; - PixmapPtr pGlyphPixmap = (PixmapPtr)pGlyphPicture->pDrawable; - PixmapPtr pCachePixmap = (PixmapPtr)cache->picture->pDrawable; -- int cacheXoff, cacheYoff; -- -- if (!uxa_screen->info->put_image || uxa_screen->swappedOut) -- return FALSE; -- -- /* If the glyph pixmap is already uploaded, no point in doing -- * things this way */ -- if (uxa_pixmap_is_offscreen(pGlyphPixmap)) -- return FALSE; -+ GCPtr pGC; - - /* UploadToScreen only works if bpp match */ - if (pGlyphPixmap->drawable.bitsPerPixel != pCachePixmap->drawable.bitsPerPixel) - return FALSE; - -- pCachePixmap = uxa_get_offscreen_pixmap ((DrawablePtr)pCachePixmap, &cacheXoff, &cacheYoff); -- if (!pCachePixmap) -- return FALSE; -- -- if (!uxa_screen->info->put_image(pCachePixmap, -- CACHE_X(pos) + cacheXoff, -- CACHE_Y(pos) + cacheYoff, -- pGlyph->info.width, -- pGlyph->info.height, -- (char *)pGlyphPixmap->devPrivate.ptr, -- pGlyphPixmap->devKind)) -- return FALSE; -- -+ pGC = GetScratchGC(pCachePixmap->drawable.depth, pScreen); -+ ValidateGC(&pCachePixmap->drawable, pGC); -+ (void) uxa_copy_area (&pGlyphPixmap->drawable, -+ &pCachePixmap->drawable, -+ pGC, -+ 0, 0, pGlyph->info.width, pGlyph->info.height, -+ CACHE_X(pos), CACHE_Y(pos)); -+ FreeScratchGC (pGC); - return TRUE; - } - diff --git a/sources b/sources index b952394..25bf573 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -5832172ac69b9a066a202e1578a5d3c8 xf86-video-intel-2.7.0.tar.bz2 -6f03b21b598ef1b3af5280c8f9e01fa1 intel-gpu-tools-20090507.tar.bz2 +df3d898b00c84228c37ecb454a6e63e7 intel-gpu-tools-20090624.tar.bz2 +2892648278871dad4d2d151534d4c596 xf86-video-intel-20090624.tar.bz2 diff --git a/xorg-x11-drv-intel.spec b/xorg-x11-drv-intel.spec index f6aebd4..7a220f8 100644 --- a/xorg-x11-drv-intel.spec +++ b/xorg-x11-drv-intel.spec @@ -2,29 +2,28 @@ %define legacyver 2.6.0-8 %define moduledir %(pkg-config xorg-server --variable=moduledir ) %define driverdir %{moduledir}/drivers -%define gputoolsdate 20090507 +%define gputoolsdate 20090624 +%define gitdate 20090624 Summary: Xorg X11 Intel video driver Name: xorg-x11-drv-intel -Version: 2.7.0 -Release: 8%{?dist} +Version: 2.8.0 +Release: 0.1%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X Hardware Support BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Source0: http://xorg.freedesktop.org/archive/individual/driver/xf86-video-intel-%{version}.tar.bz2 +#Source0: http://xorg.freedesktop.org/archive/individual/driver/xf86-video-intel-%{version}.tar.bz2 +Source0: xf86-video-intel-%{gitdate}.tar.bz2 Source1: make-intel-gpu-tools-snapshot.sh Source2: intel.xinf Source3: intel-gpu-tools-%{gputoolsdate}.tar.bz2 +Source4: make-git-snapshot.sh Patch1: kill-svideo.patch Patch2: copy-fb.patch -# patches from 2.7 branch -Patch10: intel-2.7-fixes.patch -Patch11: intel-2.7-dont-gtt-map-big-objects.patch - # needs to be upstreamed Patch20: intel-2.6.99.902-kms-get-crtc.patch Patch21: intel-2.7.0-lvds-default-modes.patch @@ -32,8 +31,6 @@ Patch21: intel-2.7.0-lvds-default-modes.patch # Disable xv vsync, it locks up the GPU Patch22: intel-2.7-dont-vsync-xv.patch -Patch23: abi.patch - ExclusiveArch: %{ix86} x86_64 ia64 BuildRequires: autoconf automake libtool @@ -72,14 +69,11 @@ Group: Development/Tools Debugging tools for Intel graphics chips %prep -%setup -q -n xf86-video-intel-%{version} -b3 +%setup -q -n xf86-video-intel-%{gitdate} -b3 %patch1 -p1 -b .svideo %patch2 -p1 -b .copy-fb -%patch10 -p1 -b .2.7-fixes %patch20 -p1 -b .get-crtc -%patch11 -p1 -b .big-objects - # notyet. we don't handle switching in and out of tiled front buffer # correctly yet, so let's not have people stumble into it more than # they have to. @@ -87,11 +81,11 @@ Debugging tools for Intel graphics chips %patch22 -p1 -b .xv-vsync -%patch23 -p1 -b .abi - %build - -# autoreconf -vi + +%if 0%{?gitdate} +autoreconf -vi +%endif %configure --disable-static --libdir=%{_libdir} --mandir=%{_mandir} --enable-dri --enable-kms make @@ -138,8 +132,12 @@ rm -rf $RPM_BUILD_ROOT %files -n intel-gpu-tools %defattr(-,root,root,-) %{_bindir}/intel_* +%{_mandir}/man1/intel_*.1* %changelog +* Wed Jun 24 2009 Adam Jackson 2.8.0-0.1 +- Today's git snapshots (driver and gpu tools) + * Mon Jun 22 2009 Adam Jackson 2.7.0-8 - Fix ABI for new server version