rpms/xorg-x11-drv-intel/F-11 intel-2.7-kms-output-properties.patch, NONE, 1.1 .cvsignore, 1.3, 1.4 import.log, 1.1, 1.2 sources, 1.3, 1.4 xorg-x11-drv-intel.spec, 1.12, 1.13 intel-2.6.99.902-to-git.patch, 1.1, NONE rc1-to-2.7.patch, 1.1, NONE

Adam Jackson ajax at fedoraproject.org
Fri Apr 17 17:52:38 UTC 2009


Author: ajax

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

Modified Files:
	.cvsignore import.log sources xorg-x11-drv-intel.spec 
Added Files:
	intel-2.7-kms-output-properties.patch 
Removed Files:
	intel-2.6.99.902-to-git.patch rc1-to-2.7.patch 
Log Message:
intel 2.7.0


intel-2.7-kms-output-properties.patch:

--- NEW FILE intel-2.7-kms-output-properties.patch ---
commit e6af995b24767815ab30364385768867e80605c2
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 e485256..0cbcde7 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
 


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-intel/F-11/.cvsignore,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- .cvsignore	11 Mar 2009 15:44:40 -0000	1.3
+++ .cvsignore	17 Apr 2009 17:52:07 -0000	1.4
@@ -1 +1 @@
-xf86-video-intel-2.6.99.902.tar.bz2
+xf86-video-intel-2.7.0.tar.bz2


Index: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-intel/F-11/import.log,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- import.log	24 Feb 2009 20:51:11 -0000	1.1
+++ import.log	17 Apr 2009 17:52:07 -0000	1.2
@@ -1 +1,2 @@
 xorg-x11-drv-intel-2_6_0-8_fc11:HEAD:xorg-x11-drv-intel-2.6.0-8.fc11.src.rpm:1235508628
+xorg-x11-drv-intel-2_7_0-1_fc11:F-11:xorg-x11-drv-intel-2.7.0-1.fc11.src.rpm:1239990702


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-intel/F-11/sources,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sources	11 Mar 2009 15:44:41 -0000	1.3
+++ sources	17 Apr 2009 17:52:07 -0000	1.4
@@ -1 +1 @@
-b1869be6032c00654f562bd5d6ac9701  xf86-video-intel-2.6.99.902.tar.bz2
+5832172ac69b9a066a202e1578a5d3c8  xf86-video-intel-2.7.0.tar.bz2


Index: xorg-x11-drv-intel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-intel/F-11/xorg-x11-drv-intel.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- xorg-x11-drv-intel.spec	13 Apr 2009 15:45:53 -0000	1.12
+++ xorg-x11-drv-intel.spec	17 Apr 2009 17:52:07 -0000	1.13
@@ -5,8 +5,8 @@
 
 Summary:   Xorg X11 Intel video driver(s)
 Name:      xorg-x11-drv-intel
-Version:   2.6.99.902
-Release:   3%{?dist}
+Version:   2.7.0
+Release:   1%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -16,11 +16,14 @@
 
 Source2:   intel.xinf
 
-# 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
+Patch1: kill-svideo.patch
+Patch2: copy-fb.patch
+
+# not in 2.7 but in master, http://bugs.freedesktop.org/21254
+Patch10: intel-2.7-kms-output-properties.patch
+
+# needs to be upstreamed
+Patch20: intel-2.6.99.902-kms-get-crtc.patch
 
 ExclusiveArch: %{ix86} x86_64 ia64
 
@@ -54,14 +57,14 @@
 
 %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
+%patch1 -p1 -b .svideo
+%patch2 -p1 -b .copy-fb
+%patch10 -p1 -b .kms-props
+%patch20 -p1 -b .get-crtc
 
 %build
 
-autoreconf -vi
+# autoreconf -vi
 %configure --disable-static --libdir=%{_libdir} --mandir=%{_mandir} --enable-dri --enable-kms
 make
 
@@ -96,6 +99,9 @@
 %{_libdir}/libIntelXvMC.so
 
 %changelog
+* 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.
 


--- intel-2.6.99.902-to-git.patch DELETED ---


--- rc1-to-2.7.patch DELETED ---




More information about the fedora-extras-commits mailing list