rpms/gnome-desktop/F-12 randr-gamma.patch, NONE, 1.1 gnome-desktop.spec, 1.227, 1.228
Matthias Clasen
mclasen at fedoraproject.org
Thu Oct 22 23:43:27 UTC 2009
- Previous message (by thread): comps comps-f11.xml.in,1.316,1.317 comps-f12.xml.in,1.169,1.170
- Next message (by thread): rpms/gdb/F-12 gdb-bz528668-symfile-cleanup.patch, NONE, 1.1 gdb-bz528668-symfile-multi.patch, NONE, 1.1 gdb-bz528668-symfile-sepcrc.patch, NONE, 1.1 gdb-6.6-buildid-locate.patch, 1.27, 1.28 gdb.spec, 1.393, 1.394
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: mclasen
Update of /cvs/pkgs/rpms/gnome-desktop/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16729
Modified Files:
gnome-desktop.spec
Added Files:
randr-gamma.patch
Log Message:
add gamma api for gnome-screensaver
randr-gamma.patch:
gnome-rr.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++
libgnomeui/gnome-rr.h | 11 ++++++-
2 files changed, 85 insertions(+), 1 deletion(-)
--- NEW FILE randr-gamma.patch ---
>From 8c052c789b585f434da1e6b92b3f452412074361 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Thu, 8 Oct 2009 16:09:50 +1000
Subject: [PATCH] rrcrtc: add initial gamma interfaces (v3)
These are used by gnome-screensaver to do the fade in/out.
Reviewed by ssp: removed unneeded crtc interfaces,
made get gamma to the allocs, for caller to free
New interfaces:
Add gamma get/set functions per crtc.
v3: coding style cleanups from ssp
---
libgnome-desktop/gnome-rr.c | 75 ++++++++++++++++++++++++++++++++
libgnome-desktop/libgnomeui/gnome-rr.h | 10 ++++
2 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/libgnome-desktop/gnome-rr.c b/libgnome-desktop/gnome-rr.c
index a64f8ae..9a93573 100644
--- a/libgnome-desktop/gnome-rr.c
+++ b/libgnome-desktop/gnome-rr.c
@@ -74,6 +74,7 @@ struct GnomeRRCrtc
GnomeRRRotation current_rotation;
GnomeRRRotation rotations;
+ int gamma_size;
};
struct GnomeRRMode
@@ -1447,6 +1448,9 @@ crtc_initialize (GnomeRRCrtc *crtc,
XRRFreeCrtcInfo (info);
+ /* get an store gamma size */
+ crtc->gamma_size = XRRGetCrtcGammaSize (DISPLAY (crtc), crtc->id);
+
return TRUE;
}
@@ -1516,3 +1520,74 @@ mode_free (GnomeRRMode *mode)
g_free (mode->name);
g_free (mode);
}
+
+void
+gnome_rr_crtc_set_gamma (GnomeRRCrtc *crtc, int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue)
+{
+ int copy_size;
+ XRRCrtcGamma *gamma;
+
+ g_return_if_fail (crtc != NULL);
+ g_return_if_fail (red != NULL);
+ g_return_if_fail (green != NULL);
+ g_return_if_fail (blue != NULL);
+
+ if (size != crtc->gamma_size)
+ return;
+
+ gamma = XRRAllocGamma (crtc->gamma_size);
+
+ copy_size = crtc->gamma_size * sizeof (unsigned short);
+ memcpy (gamma->red, red, copy_size);
+ memcpy (gamma->green, green, copy_size);
+ memcpy (gamma->blue, blue, copy_size);
+
+ XRRSetCrtcGamma (DISPLAY (crtc), crtc->id, gamma);
+ XRRFreeGamma (gamma);
+}
+
+gboolean
+gnome_rr_crtc_get_gamma (GnomeRRCrtc *crtc, int *size,
+ unsigned short **red, unsigned short **green,
+ unsigned short **blue)
+{
+ int copy_size;
+ unsigned short *r, *g, *b;
+ XRRCrtcGamma *gamma;
+
+ g_return_val_if_fail (crtc != NULL, FALSE);
+
+ gamma = XRRGetCrtcGamma (DISPLAY (crtc), crtc->id);
+ if (!gamma)
+ return FALSE;
+
+ copy_size = crtc->gamma_size * sizeof (unsigned short);
+
+ if (red) {
+ r = g_new0 (unsigned short, crtc->gamma_size);
+ memcpy (r, gamma->red, copy_size);
+ *red = r;
+ }
+
+ if (green) {
+ g = g_new0 (unsigned short, crtc->gamma_size);
+ memcpy (g, gamma->green, copy_size);
+ *green = g;
+ }
+
+ if (blue) {
+ b = g_new0 (unsigned short, crtc->gamma_size);
+ memcpy (b, gamma->blue, copy_size);
+ *blue = b;
+ }
+
+ XRRFreeGamma (gamma);
+
+ if (size)
+ *size = crtc->gamma_size;
+ return TRUE;
+}
+
diff --git a/libgnome-desktop/libgnomeui/gnome-rr.h b/libgnome-desktop/libgnomeui/gnome-rr.h
index 6eae3d0..e149336 100644
--- a/libgnome-desktop/libgnomeui/gnome-rr.h
+++ b/libgnome-desktop/libgnomeui/gnome-rr.h
@@ -160,4 +160,14 @@ GnomeRRRotation gnome_rr_crtc_get_rotations (GnomeRRCrtc *crtc)
gboolean gnome_rr_crtc_supports_rotation (GnomeRRCrtc *crtc,
GnomeRRRotation rotation);
+gboolean gnome_rr_crtc_get_gamma (GnomeRRCrtc *crtc,
+ int *size,
+ unsigned short **red,
+ unsigned short **green,
+ unsigned short **blue);
+void gnome_rr_crtc_set_gamma (GnomeRRCrtc *crtc,
+ int size,
+ unsigned short *red,
+ unsigned short *green,
+ unsigned short *blue);
#endif
--
1.6.5.rc2
Index: gnome-desktop.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-desktop/F-12/gnome-desktop.spec,v
retrieving revision 1.227
retrieving revision 1.228
diff -u -p -r1.227 -r1.228
--- gnome-desktop.spec 22 Oct 2009 14:31:16 -0000 1.227
+++ gnome-desktop.spec 22 Oct 2009 23:43:25 -0000 1.228
@@ -12,10 +12,12 @@
Summary: Shared code among gnome-panel, gnome-session, nautilus, etc
Name: gnome-desktop
Version: 2.28.1
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://www.gnome.org
Source0: http://download.gnome.org/sources/gnome-desktop/2.28/%{name}-%{version}.tar.bz2
Patch1: concatenate-edid-descriptors.patch
+# https://bugzilla.gnome.org/show_bug.cgi?id=597874
+Patch2: randr-gamma.patch
License: GPLv2+ and LGPLv2+
Group: System Environment/Libraries
@@ -75,6 +77,7 @@ libgnomedesktop.
%prep
%setup -q
%patch1 -p1 -b .concatenate-edid-descriptors
+%patch2 -p1 -b .randr-gamma
%build
%configure --with-gnome-distributor="Red Hat, Inc" \
@@ -122,6 +125,9 @@ rm -rf $RPM_BUILD_ROOT
%doc %{_datadir}/gtk-doc/html/gnome-desktop/
%changelog
+* Thu Oct 22 2009 Matthias Clasen <mclasen at redhat.com> - 2.28.1-2
+- Support proper gamma setting in multihead setups
+
* Thu Oct 22 2009 Matthias Clasen <mclasen at redhat.com> - 2.28.1-1
- Update to 2.28.1, translation updates
- Previous message (by thread): comps comps-f11.xml.in,1.316,1.317 comps-f12.xml.in,1.169,1.170
- Next message (by thread): rpms/gdb/F-12 gdb-bz528668-symfile-cleanup.patch, NONE, 1.1 gdb-bz528668-symfile-multi.patch, NONE, 1.1 gdb-bz528668-symfile-sepcrc.patch, NONE, 1.1 gdb-6.6-buildid-locate.patch, 1.27, 1.28 gdb.spec, 1.393, 1.394
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the fedora-extras-commits
mailing list