summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Cardona <remi@gentoo.org>2009-05-05 07:44:14 +0000
committerRémi Cardona <remi@gentoo.org>2009-05-05 07:44:14 +0000
commitb1306094c734b3669c915d257be0f4701d493ecf (patch)
tree968ac0ce0465949bef0de5fa0bebdb332e92c2ce /x11-drivers/xf86-video-intel
parentrepoman warnings (diff)
downloadgentoo-2-b1306094c734b3669c915d257be0f4701d493ecf.tar.gz
gentoo-2-b1306094c734b3669c915d257be0f4701d493ecf.tar.bz2
gentoo-2-b1306094c734b3669c915d257be0f4701d493ecf.zip
x11-drivers/xf86-video-intel: bump to 2.7.0 with a patch from the 2.7 branch
(Portage version: 2.2_rc32/cvs/Linux i686)
Diffstat (limited to 'x11-drivers/xf86-video-intel')
-rw-r--r--x11-drivers/xf86-video-intel/ChangeLog9
-rw-r--r--x11-drivers/xf86-video-intel/files/2.7.0-0001-KMS-hook-up-output-properties-for-randr.patch229
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.7.0.ebuild36
3 files changed, 273 insertions, 1 deletions
diff --git a/x11-drivers/xf86-video-intel/ChangeLog b/x11-drivers/xf86-video-intel/ChangeLog
index 5baf063724a7..fcd4ee13a5a1 100644
--- a/x11-drivers/xf86-video-intel/ChangeLog
+++ b/x11-drivers/xf86-video-intel/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for x11-drivers/xf86-video-intel
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-drivers/xf86-video-intel/ChangeLog,v 1.22 2009/05/04 16:50:13 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/xf86-video-intel/ChangeLog,v 1.23 2009/05/05 07:44:14 remi Exp $
+
+*xf86-video-intel-2.7.0 (05 May 2009)
+
+ 05 May 2009; Rémi Cardona <remi@gentoo.org>
+ +files/2.7.0-0001-KMS-hook-up-output-properties-for-randr.patch,
+ +xf86-video-intel-2.7.0.ebuild:
+ bump to 2.7.0 with a patch from the 2.7 branch
04 May 2009; Samuli Suominen <ssuominen@gentoo.org>
xf86-video-intel-1.6.5.ebuild, xf86-video-intel-1.7.4.ebuild,
diff --git a/x11-drivers/xf86-video-intel/files/2.7.0-0001-KMS-hook-up-output-properties-for-randr.patch b/x11-drivers/xf86-video-intel/files/2.7.0-0001-KMS-hook-up-output-properties-for-randr.patch
new file mode 100644
index 000000000000..61727fbfc758
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/2.7.0-0001-KMS-hook-up-output-properties-for-randr.patch
@@ -0,0 +1,229 @@
+From 296a986e5258e2fd13ec494071b7063bd639cd68 Mon Sep 17 00:00:00 2001
+From: Zhenyu Wang <zhenyu.z.wang@intel.com>
+Date: Mon, 23 Mar 2009 19:19:58 +0800
+Subject: [PATCH 1/1] 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@intel.com>
+---
+ src/drmmode_display.c | 171 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 171 insertions(+), 0 deletions(-)
+
+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
+
+--
+1.6.2.3
+
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.7.0.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.7.0.ebuild
new file mode 100644
index 000000000000..10d5e3a8a092
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.7.0.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/xf86-video-intel/xf86-video-intel-2.7.0.ebuild,v 1.1 2009/05/05 07:44:14 remi Exp $
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~ia64 ~x86 ~x86-fbsd"
+IUSE="dri"
+
+RDEPEND=">=x11-base/xorg-server-1.5
+ x11-libs/libXvMC"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-1.99.3
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xineramaproto
+ x11-proto/glproto
+ x11-proto/xextproto
+ x11-proto/xproto
+ dri? ( x11-proto/xf86driproto
+ >=x11-libs/libdrm-2.4.5
+ x11-libs/libX11 )"
+
+PATCHES=(
+"${FILESDIR}/${PV}"-0001-KMS-hook-up-output-properties-for-randr.patch
+)
+
+pkg_setup() {
+ CONFIGURE_OPTIONS="$(use_enable dri)"
+}