rpms/xorg-x11-drv-intel/devel abi.patch, NONE, 1.1 intel-2.7-dont-gtt-map-big-objects.patch, NONE, 1.1 intel-2.7-fixes.patch, NONE, 1.1 intel-2.7-glyph-copyarea-upload.patch, NONE, 1.1 intel-2.7.0-lvds-default-modes.patch, NONE, 1.1 sources, 1.3, 1.4 xorg-x11-drv-intel.spec, 1.12, 1.13

Adam Jackson ajax at fedoraproject.org
Mon Jun 22 21:31:45 UTC 2009


Author: ajax

Update of /cvs/pkgs/rpms/xorg-x11-drv-intel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26717

Modified Files:
	sources xorg-x11-drv-intel.spec 
Added Files:
	abi.patch intel-2.7-dont-gtt-map-big-objects.patch 
	intel-2.7-fixes.patch intel-2.7-glyph-copyarea-upload.patch 
	intel-2.7.0-lvds-default-modes.patch 
Log Message:
* Mon Jun 22 2009 Adam Jackson <ajax at redhat.com> 2.7.0-8
- Fix ABI for new server version


abi.patch:

--- NEW FILE abi.patch ---
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);
 

intel-2.7-dont-gtt-map-big-objects.patch:

--- NEW FILE intel-2.7-dont-gtt-map-big-objects.patch ---
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);
+    }
+}

intel-2.7-fixes.patch:

--- NEW FILE intel-2.7-fixes.patch ---
commit efda7c776b95f8634cd6a2fed88d526de80176bc
Author: Carl Worth <cworth at cworth.org>
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 <keithp at keithp.com>
    (cherry picked from commit 8255cca2c9092f7ecb798944aa8f03fa3efcfa6c)
    
    Conflicts:
    
    	src/i915_video.c

commit a066cfb0be6e6b20a27eb4ba17f503f13e65e082
Author: Carl Worth <cworth at cworth.org>
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 <keithp at keithp.com>
    (cherry picked from commit 11a853bd8e5d907fe7f5bd907453bcdac9032861)
    
    Conflicts:
    
    	src/i965_video.c

commit 115fc9a7d79da07301b96d9fc5c513d33734d273
Author: Keith Packard <keithp at keithp.com>
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 <keithp at keithp.com>
    (cherry picked from commit 1142353b487c155a31011923fbd08ec67e60f505)

commit 296a986e5258e2fd13ec494071b7063bd639cd68
Author: Zhenyu Wang <zhenyu.z.wang at intel.com>
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 <zhenyu.z.wang at intel.com>
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

intel-2.7-glyph-copyarea-upload.patch:

--- NEW FILE intel-2.7-glyph-copyarea-upload.patch ---
commit fe08b81d0f5d6f96e0124e6286bd24aba6e140ad
Author: Keith Packard <keithp at keithp.com>
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 <keithp at keithp.com>

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;
 }
 

intel-2.7.0-lvds-default-modes.patch:

--- NEW FILE intel-2.7.0-lvds-default-modes.patch ---
diff -up xf86-video-intel-2.7.0/src/drmmode_display.c.jx xf86-video-intel-2.7.0/src/drmmode_display.c
--- xf86-video-intel-2.7.0/src/drmmode_display.c.jx	2009-04-21 12:57:05.000000000 -0400
+++ xf86-video-intel-2.7.0/src/drmmode_display.c	2009-04-21 12:59:35.000000000 -0400
@@ -525,6 +525,41 @@ drmmode_output_get_modes(xf86OutputPtr o
 		Modes = xf86ModesAdd(Modes, Mode);
 
 	}
+
+	/*
+	 * LVDS can scale.  If there's no EDID, or if it claims not to be
+	 * continuous-freq, then add the default modes so we get 800x600
+	 * and friends.
+	 */
+	if (strstr(output->name, "LVDS")) {
+		xf86MonPtr mon = output->MonInfo;
+		if (!mon || !GTF_SUPPORTED(mon->features.msc)) {
+			DisplayModePtr m, i;
+			int max_x = 0, max_y = 0;
+			float max_vrefresh = 0.0;
+
+			for (m = Modes; m; m = m->next) {
+				max_x = max(max_x, m->HDisplay);
+				max_y = max(max_y, m->VDisplay);
+				max_vrefresh = max(max_vrefresh,
+						   xf86ModeVRefresh(m));
+			}
+
+			max_vrefresh *= (1 + SYNC_TOLERANCE);
+
+			m = xf86GetDefaultModes(FALSE, FALSE);
+
+			xf86ValidateModesSize(output->scrn, m, max_x, max_y, 0);
+			for (i = m; i; i = i->next)
+				if (xf86ModeVRefresh(i) > max_vrefresh)
+					i->status = MODE_VSYNC;
+
+			xf86PruneInvalidModes(output->scrn, &m, FALSE);
+
+			Modes = xf86ModesAdd(Modes, m);
+		}
+	}
+
 	return Modes;
 }
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-intel/devel/sources,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- sources	11 Mar 2009 15:44:41 -0000	1.3
+++ sources	22 Jun 2009 21:31:45 -0000	1.4
@@ -1 +1,2 @@
-b1869be6032c00654f562bd5d6ac9701  xf86-video-intel-2.6.99.902.tar.bz2
+5832172ac69b9a066a202e1578a5d3c8  xf86-video-intel-2.7.0.tar.bz2
+6f03b21b598ef1b3af5280c8f9e01fa1  intel-gpu-tools-20090507.tar.bz2


Index: xorg-x11-drv-intel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-intel/devel/xorg-x11-drv-intel.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- xorg-x11-drv-intel.spec	13 Apr 2009 15:45:53 -0000	1.12
+++ xorg-x11-drv-intel.spec	22 Jun 2009 21:31:45 -0000	1.13
@@ -2,25 +2,37 @@
 %define legacyver   2.6.0-8
 %define moduledir %(pkg-config xorg-server --variable=moduledir )
 %define driverdir	%{moduledir}/drivers
+%define gputoolsdate 20090507
 
-Summary:   Xorg X11 Intel video driver(s)
+Summary:   Xorg X11 Intel video driver
 Name:      xorg-x11-drv-intel
-Version:   2.6.99.902
-Release:   3%{?dist}
+Version:   2.7.0
+Release:   8%{?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 
+Source1:    make-intel-gpu-tools-snapshot.sh
+Source2:    intel.xinf
+Source3:    intel-gpu-tools-%{gputoolsdate}.tar.bz2
+
+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
 
-Source2:   intel.xinf
+# Disable xv vsync, it locks up the GPU
+Patch22: intel-2.7-dont-vsync-xv.patch
 
-# 053432991c812146f6e7c6f13c6ace55385c825f 
-Patch1: intel-2.6.99.902-to-git.patch
-Patch2: kill-svideo.patch
-Patch3: copy-fb.patch
-Patch4: intel-2.6.99.902-kms-get-crtc.patch
+Patch23: abi.patch
 
 ExclusiveArch: %{ix86} x86_64 ia64
 
@@ -52,19 +64,43 @@ Obsoletes:  %{legacyname}-devel < %{lega
 %description devel
 X.Org X11 Intel video driver XvMC development package.
 
+%package -n intel-gpu-tools
+Summary:    Debugging tools for Intel graphics chips
+Group:	    Development/Tools
+
+%description -n intel-gpu-tools
+Debugging tools for Intel graphics chips
+
 %prep
-%setup -q -n xf86-video-intel-%{version}
-%patch1 -p1 -b .to-git
-%patch2 -p1 -b .svideo
-%patch3 -p1 -b .copy-fb
-%patch4 -p1 -b .get-crtc
+%setup -q -n xf86-video-intel-%{version} -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.
+#patch21 -p1 -b .jx
+
+%patch22 -p1 -b .xv-vsync
+
+%patch23 -p1 -b .abi
 
 %build
 
-autoreconf -vi
+# autoreconf -vi
 %configure --disable-static --libdir=%{_libdir} --mandir=%{_mandir} --enable-dri --enable-kms
 make
 
+pushd ../intel-gpu-tools-%{gputoolsdate}
+autoreconf -v --install
+%configure
+make
+popd
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
@@ -72,6 +108,10 @@ make install DESTDIR=$RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT%{_datadir}/hwdata/videoaliases
 install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/hwdata/videoaliases/
 
+pushd ../intel-gpu-tools-%{gputoolsdate}
+make install DESTDIR=$RPM_BUILD_ROOT
+popd
+
 find $RPM_BUILD_ROOT -regex ".*\.la$" | xargs rm -f --
 
 %clean
@@ -95,7 +135,34 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/libI810XvMC.so
 %{_libdir}/libIntelXvMC.so
 
+%files -n intel-gpu-tools
+%defattr(-,root,root,-)
+%{_bindir}/intel_*
+
 %changelog
+* Mon Jun 22 2009 Adam Jackson <ajax at redhat.com> 2.7.0-8
+- Fix ABI for new server version
+
+* Thu May 28 2009  <krh at redhat.com> - 2.7.0-7
+- Add intel-2.7-dont-vsync-xv.patch to disable Xv vsync, fixes hw
+  lockup for full screen Xv (#499895)
+
+* Wed May 20 2009  <krh at madara.bos.redhat.com> - 2.7.0-6
+- Add intel-2.7-dont-gtt-map-big-objects.patch to avoid mapping big
+  gem objects through the GTT (#498131).
+
+* Thu May 07 2009 Adam Jackson <ajax at redhat.com> 2.7.0-5
+- Update intel-gpu-tools
+
+* Wed May  6 2009  <krh at madara.bos.redhat.com> - 2.7.0-4
+- Pull in fixes from the 2.7 branch.
+
+* Thu Apr 23 2009 Adam Jackson <ajax at redhat.com> 2.7.0-2
+- Add intel-gpu-tools subpackage
+
+* Fri Apr 17 2009 Adam Jackson <ajax at redhat.com> 2.7.0-1
+- intel 2.7.0
+
 * Mon Apr 13 2009 Adam Jackson <ajax at redhat.com> 2.6.99.902-3
 - Update to today's git snapshot.
 




More information about the fedora-extras-commits mailing list