xf86-video-intel: 2 commits - src/intel_display.c src/intel_driver.c src/intel.h

Chris Wilson ickle at kemper.freedesktop.org
Thu Aug 19 12:08:13 PDT 2010


 src/intel.h         |    1 +
 src/intel_display.c |   22 ++++++++++++++++++----
 src/intel_driver.c  |   27 +++++++++++----------------
 3 files changed, 30 insertions(+), 20 deletions(-)

New commits:
commit 8b04b350a983b89eb2d741f55baa297a933ac6ea
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Aug 19 20:05:08 2010 +0100

    Open-code DRICreatePCIBusID()
    
    During -configure we would attempt to query the availablility of KMS
    before the DRI module was loaded, thus we were unable to create a valid
    bus identifier and so the query failed and we disowned the device.
    
    Fixes:
    
      Bug 29611 - Xorg -configure fails
      https://bugs.freedesktop.org/show_bug.cgi?id=29611
    
    Reported-by: Sergey Samokhin <prikrutil at gmail.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_driver.c b/src/intel_driver.c
index 23df87b..9b2fdaf 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -266,32 +266,25 @@ static void PreInitCleanup(ScrnInfoPtr scrn)
  */
 static Bool intel_kernel_mode_enabled(ScrnInfoPtr scrn)
 {
-	struct pci_device *PciInfo;
-	EntityInfoPtr pEnt;
-	char *busIdString;
+	struct pci_device *dev;
+	char id[20];
 	int ret;
 
-	pEnt = xf86GetEntityInfo(scrn->entityList[0]);
-	PciInfo = xf86GetPciInfoForEntity(pEnt->index);
-
-	if (!xf86LoaderCheckSymbol("DRICreatePCIBusID"))
-		return FALSE;
-
-	busIdString = DRICreatePCIBusID(PciInfo);
+	dev = xf86GetPciInfoForEntity(xf86GetEntityInfo(scrn->entityList[0])->index);
+	snprintf(id, sizeof(id),
+		 "pci:%04x:%02x:%02x.%d",
+		 dev->domain, dev->bus, dev->dev, dev->func);
 
-	ret = drmCheckModesettingSupported(busIdString);
+	ret = drmCheckModesettingSupported(id);
 	if (ret) {
 		if (xf86LoadKernelModule("i915"))
-			ret = drmCheckModesettingSupported(busIdString);
+			ret = drmCheckModesettingSupported(id);
 	}
 	/* Be nice to the user and load fbcon too */
 	if (!ret)
 		(void)xf86LoadKernelModule("fbcon");
-	free(busIdString);
-	if (ret)
-		return FALSE;
 
-	return TRUE;
+	return ret == 0;
 }
 
 static void intel_check_chipset_option(ScrnInfoPtr scrn)
commit c882f6a22a862c1664c375e05e5e6fc4bdb04edb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Aug 18 10:21:22 2010 +0100

    Move registration of vsync fd from pre-init to screen-init
    
    Marty Jack reported an issue he found where the page-flipping handler
    was being lost on server reset. This results in the swap completion
    notification being lost, with the sporadic hang of full screen
    applications like Compiz, flash and even glxgears!
    
    Fixes:
    
      Bug 29584 - Server in compute loop
      https://bugs.freedesktop.org/show_bug.cgi?id=29584
    
    There are also several possibly related bugs with similar symptoms, i.e.
    OpenGL applications hanging on missed swap notifications.
    
    Reported-by: Marty Jack <martyj19 at comcast.net>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    Cc: Keith Packard <keithp at keithp.com>

diff --git a/src/intel.h b/src/intel.h
index 970e519..ba23ac1 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -439,6 +439,7 @@ enum {
 };
 
 extern Bool intel_mode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp);
+extern void intel_mode_init(struct intel_screen_private *intel);
 extern void intel_mode_remove_fb(intel_screen_private *intel);
 extern void intel_mode_fini(intel_screen_private *intel);
 
diff --git a/src/intel_display.c b/src/intel_display.c
index 6e7ec2a..3676d99 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -1515,13 +1515,10 @@ Bool intel_mode_pre_init(ScrnInfoPtr scrn, int fd, int cpp)
 		xf86DrvMsg(scrn->scrnIndex, X_INFO,
 			   "Kernel page flipping support detected, enabling\n");
 		intel->use_pageflipping = TRUE;
-		mode->flip_count = 0;
+
 		mode->event_context.version = DRM_EVENT_CONTEXT_VERSION;
 		mode->event_context.vblank_handler = intel_vblank_handler;
 		mode->event_context.page_flip_handler = intel_page_flip_handler;
-		AddGeneralSocket(fd);
-		RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
-					       drm_wakeup_handler, mode);
 	}
 
 	intel->modes = mode;
@@ -1529,6 +1526,23 @@ Bool intel_mode_pre_init(ScrnInfoPtr scrn, int fd, int cpp)
 }
 
 void
+intel_mode_init(struct intel_screen_private *intel)
+{
+	if (intel->use_pageflipping) {
+		struct intel_mode *mode = intel->modes;
+
+		/* We need to re-register the mode->fd for the synchronisation
+		 * feedback on every server generation, so perform the
+		 * registration within ScreenInit and not PreInit.
+		 */
+		mode->flip_count = 0;
+		AddGeneralSocket(mode->fd);
+		RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA,
+					       drm_wakeup_handler, mode);
+	}
+}
+
+void
 intel_mode_remove_fb(intel_screen_private *intel)
 {
 	struct intel_mode *mode = intel->modes;
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 1ef16ed..23df87b 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -1019,6 +1019,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
 	if (serverGeneration == 1)
 		xf86ShowUnusedOptions(scrn->scrnIndex, scrn->options);
 
+	intel_mode_init(intel);
+
 	intel->suspended = FALSE;
 
 	return uxa_resources_init(screen);


More information about the xorg-commit mailing list