Am Mittwoch, den 16.03.2005, 16:26 +0100 schrieb Felix Kühling:
> Am Mittwoch, den 16.03.2005, 17:35 +0300 schrieb Sergey Zharkov:
[snip]
> > What I'am afraid of is that savage_dri or savage_drv drivers writhe
> > something into the chip hardware that is not loaded there by kernel
> > modules start - so if i do resume from ram the chip registers keep those
> > values and resume even if glx app was running in time of suspend. But if
> > i resume from disk kernel modules are loaded back with initial values -
> > but some commands or chip register values that were initialised by xorg
> > or dri drivers need to be restored on enterVT function. The same way as
> > radeon do.
> 
> As far as I can tell, the Savage hardware state is almost completely
> restored in enterVT. EnterVT doesn't care about 3D state though, that's
> why 3D windows that were running during suspend are black after resume.
> I think it would be easy to get it working with a running 3D application
> during suspension. The Xserver would have to invalidate the 3D hardware
> state in the sarea, so that the 3D driver restores it after resume. I'll
> send you a patch later tonight for testing this.

Please try the attached patch (apply in
xc/programs/Xserver/hw/xfree86/drivers/savage). Test with BusType "PCI",
with a 3D app running while suspending. On resume it should now display
correctly. If it works, I will commit this to Xorg CVS.

> 
[snip]

Thanks,
  Felix

-- 
| Felix Kühling <[EMAIL PROTECTED]>                     http://fxk.de.vu |
| PGP Fingerprint: 6A3C 9566 5B30 DDED 73C3  B152 151C 5CC1 D888 E595 |
--- ./savage_driver.c.~1.31.~	2005-03-03 17:33:26.000000000 +0100
+++ ./savage_driver.c	2005-03-17 00:16:33.933174152 +0100
@@ -31,6 +31,7 @@
 #ifdef XF86DRI
 #define _XF86DRI_SERVER_
 #include "savage_dri.h"
+#include "savage_sarea.h"
 #endif
 
 
@@ -2025,6 +2026,7 @@
 #ifdef XF86DRI
     SavagePtr psav= SAVPTR(pScrn);
     ScreenPtr pScreen;
+    SAVAGESAREAPrivPtr pSAREAPriv;
 #endif
 
     TRACE(("SavageEnterVT(%d)\n", flags));
@@ -2035,6 +2037,10 @@
 #ifdef XF86DRI
     if (psav->directRenderingEnabled) {
         pScreen = screenInfo.screens[scrnIndex];
+	pSAREAPriv = (SAVAGESAREAPrivPtr)DRIGetSAREAPrivate(pScreen);
+	/* Assume that 3D state was clobbered, invalidate it by
+	 * changing ctxOwner in the sarea. */
+	pSAREAPriv->ctxOwner = DRIGetContext(pScreen);
         DRIUnlock(pScreen);
         psav->LockHeld = 0;
     }

Reply via email to