xf86-video-intel: 2 commits - src/sna/sna_dri.c src/sna/sna_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Jun 8 12:37:38 PDT 2011


 src/sna/sna_dri.c    |    1 +
 src/sna/sna_driver.c |    8 ++++++++
 2 files changed, 9 insertions(+)

New commits:
commit d0b09f10242e09adfddbbe6ee1ea39dbf5d1b32d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jun 8 20:34:57 2011 +0100

    sna: Make the device fd non-blocking
    
    So that we can simply query it from each of the Zaphod instances without
    blocking. Requires a fixed kernel...
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 9d8a067..ca1f32c 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -68,6 +68,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "intel_driver.h"
 
 #include <sys/ioctl.h>
+#include <sys/fcntl.h>
 #include "i915_drm.h"
 
 static OptionInfoRec sna_options[] = {
@@ -331,6 +332,13 @@ static int sna_open_drm_master(ScrnInfoPtr scrn)
 
 	dev = malloc(sizeof(*dev));
 	if (dev) {
+		int flags;
+
+		/* make the fd nonblocking to handle event loops */
+		flags = fcntl(fd, F_GETFL, 0);
+		if (flags != -1)
+			fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+
 		dev->fd = fd;
 		dev->open_count = 1;
 		sna_set_device(scrn, dev);
commit 67ed14c5369cfd967f90e5a3e6053c95a48dd16e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jun 8 19:42:02 2011 +0100

    sna/dri: Set bo=NULL to actually detect unknown dri attachment points.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 3b085b4..7fe9aff 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -156,6 +156,7 @@ sna_dri_create_buffer(DrawablePtr drawable, unsigned int attachment,
 	private = (struct sna_dri_private *)(buffer + 1);
 
 	pixmap = NULL;
+	bo = NULL;
 	usage = CREATE_PIXMAP_USAGE_SCRATCH;
 	switch (attachment) {
 	case DRI2BufferFrontLeft:


More information about the xorg-commit mailing list