rpms/gnome-desktop/devel add-randr-12.patch, 1.14, 1.15 gnome-desktop.spec, 1.133, 1.134

Soren Sandmann Pedersen (ssp) fedora-extras-commits at redhat.com
Thu Mar 20 05:30:11 UTC 2008


Author: ssp

Update of /cvs/pkgs/rpms/gnome-desktop/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22348

Modified Files:
	add-randr-12.patch gnome-desktop.spec 
Log Message:
Update randr

add-randr-12.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.14 -r 1.15 add-randr-12.patch
Index: add-randr-12.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-desktop/devel/add-randr-12.patch,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- add-randr-12.patch	2 Mar 2008 22:18:50 -0000	1.14
+++ add-randr-12.patch	20 Mar 2008 05:29:39 -0000	1.15
@@ -1,1209 +1,1135 @@
-diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c
---- /dev/null	2008-02-19 17:35:05.543056439 -0500
-+++ gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c	2008-03-02 17:21:20.000000000 -0500
-@@ -0,0 +1,1198 @@
-+#include <stdlib.h>
-+#include <string.h>
-+#include <glib.h>
+diff -up /dev/null gnome-desktop-2.22.0/libgnome-desktop/randrwrap.c
+--- /dev/null	2008-03-16 00:14:46.954006998 -0400
++++ gnome-desktop-2.22.0/libgnome-desktop/randrwrap.c	2008-03-20 01:22:07.000000000 -0400
+@@ -0,0 +1,1124 @@
 +#define I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA
-+#include "libgnomeui/monitor-db.h"
-+#include "edid.h"
++#include "libgnomeui/randrwrap.h"
++#include <string.h>
++#include <X11/Xlib.h>
++#include <X11/extensions/Xrandr.h>
++#include <gtk/gtk.h>
++#include <gdk/gdkx.h>
++#include <X11/Xatom.h>
 +
-+/* A helper wrapper around the GMarkup parser stuff */
-+static gboolean parse_file_gmarkup (const gchar *file,
-+				    const GMarkupParser *parser,
-+				    gpointer data,
-+				    GError **err);
++#define DISPLAY(o) ((o)->info->screen->xdisplay)
 +
-+typedef struct CrtcAssignment CrtcAssignment;
++typedef struct ScreenInfo ScreenInfo;
 +
-+static void            crtc_assignment_apply (CrtcAssignment *assign);
-+static CrtcAssignment *crtc_assignment_new   (RWScreen       *screen,
-+					      Output        **outputs);
-+static void            crtc_assignment_free  (CrtcAssignment *assign);
-+static void            output_free           (Output         *output);
++struct ScreenInfo
++{
++    int			min_width;
++    int			max_width;
++    int			min_height;
++    int			max_height;
 +
-+typedef struct Parser Parser;
++    XRRScreenResources *resources;
++    
++    RWOutput **		outputs;
++    RWCrtc **		crtcs;
++    RWMode **		modes;
 +
-+/* Parser for monitor configurations */
-+struct Parser
-+{
-+    Output *output;
-+    Configuration *configuration;
-+    GPtrArray *outputs;
-+    GPtrArray *configurations;
-+    GQueue *stack;
++    RWScreen *		screen;
 +};
 +
-+static int
-+parse_int (const char *text)
++struct RWScreen
 +{
-+    return strtol (text, NULL, 0);
-+}
++    GdkScreen *		gdk_screen;
++    GdkWindow *		gdk_root;
++    Display *		xdisplay;
++    Screen *		xscreen;
++    Window		xroot;
++    ScreenInfo *	info;
++   
++    int			randr_event_base;
 +
-+static gboolean
-+stack_is (Parser *parser,
-+	  const char *s1,
-+	  ...)
++    RWScreenChanged	callback;
++    gpointer		data;
++};
++
++struct RWOutput
 +{
-+    GList *stack = NULL;
-+    const char *s;
-+    GList *l1, *l2;
-+    va_list args;
++    ScreenInfo *	info;
++    RROutput		id;
 +    
-+    stack = g_list_prepend (stack, (gpointer)s1);
++    char *		name;
++    RWCrtc *		current_crtc;
++    gboolean		connected;
++    gulong		width_mm;
++    gulong		height_mm;
++    RWCrtc **		possible_crtcs;
++    RWOutput **		clones;
++    RWMode **		modes;
++    int			n_preferred;
++    guint8 *		edid_data;
++};
++
++struct RWOutputWrap
++{
++    RROutput		id;
++};
++
++struct RWCrtc
++{
++    ScreenInfo *	info;
++    RRCrtc		id;
 +    
-+    va_start (args, s1);
++    RWMode *		current_mode;
++    RWOutput **		current_outputs;
++    RWOutput **		possible_outputs;
++    int			x;
++    int			y;
++
++    RWRotation		current_rotation;
++    RWRotation		rotations;
++};
++
++struct RWMode
++{
++    ScreenInfo *	info;
++    RRMode		id;
++    char *		name;
++    int			width;
++    int			height;
++    int			freq;		/* in mHz */
++};
++
++/* RWCrtc */
++static RWCrtc *  crtc_new             (ScreenInfo         *info,
++				       RRCrtc              id);
++static void      crtc_free            (RWCrtc             *crtc);
++static void      crtc_initialize      (RWCrtc             *crtc,
++				       XRRScreenResources *res);
++
++
++/* RWOutput */
++static RWOutput *output_new           (ScreenInfo         *info,
++				       RROutput            id);
++static void      output_initialize    (RWOutput           *output,
++				       XRRScreenResources *res);
++static void      output_free          (RWOutput           *output);
++
++
++/* RWMode */
++static RWMode *  mode_new             (ScreenInfo         *info,
++				       RRMode              id);
++static void      mode_initialize      (RWMode             *mode,
++				       XRRModeInfo        *info);
++static void      mode_free            (RWMode             *mode);
++
++
++/* Screen */
++static RWOutput *
++rw_output_by_id (ScreenInfo *info, RROutput id)
++{
++    RWOutput **output;
 +    
-+    s = va_arg (args, const char *);
-+    while (s)
++    for (output = info->outputs; *output; ++output)
 +    {
-+	stack = g_list_prepend (stack, (gpointer)s);
-+	s = va_arg (args, const char *);
++	if ((*output)->id == id)
++	    return *output;
 +    }
-+	
-+    l1 = stack;
-+    l2 = parser->stack->head;
 +    
-+    while (l1 && l2)
++    return NULL;
++}
++
++static RWCrtc *
++crtc_by_id (ScreenInfo *info, RRCrtc id)
++{
++    RWCrtc **crtc;
++    
++    for (crtc = info->crtcs; *crtc; ++crtc)
[...5608 lines suppressed...]
++    detailed->right_border = timing[0x0f];
++    detailed->top_border = timing[0x10];
 +
-+    /* This is a bit of a hack - it would be better to have X
-+     * just report whether the output is a laptop panel
-+     */
-+    if (output_name)
++    detailed->interlaced = get_bit (timing[0x11], 7);
++
++    /* Stereo */
++    bits = get_bits (timing[0x11], 5, 6) << 1 | get_bit (timing[0x11], 0);
++    detailed->stereo = stereo[bits];
++
++    /* Sync */
++    bits = timing[0x11];
++
++    detailed->digital_sync = get_bit (bits, 4);
++    if (detailed->digital_sync)
 +    {
-+	if (strstr ("lvds", output_name)	||
-+	    strstr ("LVDS", output_name)	||
-+	    strstr ("Lvds", output_name))
++	detailed->digital.composite = !get_bit (bits, 3);
++
++	if (detailed->digital.composite)
 +	{
-+	    vendor = "Laptop";
++	    detailed->digital.serrations = get_bit (bits, 2);
++	    detailed->digital.negative_vsync = FALSE;
 +	}
-+    }
-+    
-+    if (info->width_mm != -1 && info->height_mm)
-+    {
-+	width_mm = info->width_mm;
-+	height_mm = info->height_mm;
-+    }
-+    else if (info->n_detailed_timings)
-+    {
-+	width_mm = info->detailed_timings[0].width_mm;
-+	height_mm = info->detailed_timings[0].height_mm;
++	else
++	{
++	    detailed->digital.serrations = FALSE;
++	    detailed->digital.negative_vsync = !get_bit (bits, 2);
++	}
++
++	detailed->digital.negative_hsync = !get_bit (bits, 0);
 +    }
 +    else
 +    {
-+	width_mm = -1;
-+	height_mm = -1;
++	detailed->analog.bipolar = get_bit (bits, 3);
++	detailed->analog.serrations = get_bit (bits, 2);
++	detailed->analog.sync_on_green = !get_bit (bits, 1);
 +    }
++}
 +
-+    if (width_mm != -1 && height_mm != -1)
++static int
++decode_descriptors (const uchar *edid, MonitorInfo *info)
++{
++    int i;
++    int timing_idx;
++    
++    timing_idx = 0;
++    
++    for (i = 0; i < 4; ++i)
 +    {
-+	double d = sqrt (width_mm * width_mm + height_mm * height_mm);
++	int index = 0x36 + i * 18;
 +
-+	inches = (int)(d / 25.4 + 0.5);
-+    }
-+    else
-+    {
-+	inches = -1;
++	if (edid[index + 0] == 0x00 && edid[index + 1] == 0x00)
++	{
++	    decode_display_descriptor (edid + index, info);
++	}
++	else
++	{
++	    decode_detailed_timing (
++		edid + index, &(info->detailed_timings[timing_idx++]));
++	}
 +    }
 +
-+    if (inches > 0)
-+	return g_strdup_printf ("%s %d\"", vendor, inches);
-+    else
-+	return g_strdup_printf ("%s\n", vendor);
++    info->n_detailed_timings = timing_idx;
++
++    return TRUE;
++}
++
++static void
++decode_check_sum (const uchar *edid,
++		  MonitorInfo *info)
++{
++    int i;
++    uchar check = 0;
++
++    for (i = 0; i < 128; ++i)
++	check += edid[i];
++
++    info->checksum = check;
++}
++
++MonitorInfo *
++decode_edid (const uchar *edid)
++{
++    MonitorInfo *info = calloc (1, sizeof (MonitorInfo));
++
++    decode_check_sum (edid, info);
++    
++    if (!decode_header (edid))
++	return NULL;
++
++    if (!decode_vendor_and_product_identification (edid, info))
++	return NULL;
++
++    if (!decode_edid_version (edid, info))
++	return NULL;
++
++    if (!decode_display_parameters (edid, info))
++	return NULL;
++
++    if (!decode_color_characteristics (edid, info))
++	return NULL;
++
++    if (!decode_established_timings (edid, info))
++	return NULL;
++
++    if (!decode_standard_timings (edid, info))
++	return NULL;
++    
++    if (!decode_descriptors (edid, info))
++	return NULL;
++    
++    return info;
 +}
-diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/edid.h
---- /dev/null	2008-02-19 17:35:05.543056439 -0500
-+++ gnome-desktop-2.21.91/libgnome-desktop/edid.h	2008-03-02 17:21:21.000000000 -0500
+diff -up gnome-desktop-2.22.0/libgnome-desktop/Makefile.am.add-randr-12 gnome-desktop-2.22.0/libgnome-desktop/Makefile.am
+--- gnome-desktop-2.22.0/libgnome-desktop/Makefile.am.add-randr-12	2008-03-10 16:44:42.000000000 -0400
++++ gnome-desktop-2.22.0/libgnome-desktop/Makefile.am	2008-03-20 01:19:38.000000000 -0400
+@@ -20,7 +20,12 @@ libgnome_desktop_2_la_SOURCES = \
+ 	gnome-desktop-item.c	\
+ 	gnome-ditem-edit.c	\
+ 	gnome-hint.c		\
+-	gnome-bg.c
++	gnome-bg.c		\
++	display-name.c		\
++	randrwrap.c		\
++	monitor-db.c		\
++	edid-parse.c		\
++	edid.h
+ 
+ libgnome_desktop_2_la_LIBADD =	\
+ 	$(XLIB_LIBS)		\
+diff -up /dev/null gnome-desktop-2.22.0/libgnome-desktop/edid.h
+--- /dev/null	2008-03-16 00:14:46.954006998 -0400
++++ gnome-desktop-2.22.0/libgnome-desktop/edid.h	2008-03-20 01:22:07.000000000 -0400
 @@ -0,0 +1,170 @@
 +typedef unsigned char uchar;
 +typedef struct MonitorInfo MonitorInfo;
@@ -3479,26 +3537,9 @@
 +MonitorInfo *decode_edid (const uchar *data);
 +char *       make_display_name (const char        *output_name,
 +				const MonitorInfo *info);
-diff -up gnome-desktop-2.21.91/libgnome-desktop/Makefile.am.add-randr-12 gnome-desktop-2.21.91/libgnome-desktop/Makefile.am
---- gnome-desktop-2.21.91/libgnome-desktop/Makefile.am.add-randr-12	2008-02-11 13:35:11.000000000 -0500
-+++ gnome-desktop-2.21.91/libgnome-desktop/Makefile.am	2008-02-13 10:51:26.000000000 -0500
-@@ -20,7 +20,12 @@ libgnome_desktop_2_la_SOURCES = \
- 	gnome-desktop-item.c	\
- 	gnome-ditem-edit.c	\
- 	gnome-hint.c		\
--	gnome-bg.c
-+	gnome-bg.c		\
-+	display-name.c		\
-+	randrwrap.c		\
-+	monitor-db.c		\
-+	edid-parse.c		\
-+	edid.h
- 
- libgnome_desktop_2_la_LIBADD =	\
- 	$(XLIB_LIBS)		\
-diff -up gnome-desktop-2.21.91/configure.in.add-randr-12 gnome-desktop-2.21.91/configure.in
---- gnome-desktop-2.21.91/configure.in.add-randr-12	2008-02-11 13:38:20.000000000 -0500
-+++ gnome-desktop-2.21.91/configure.in	2008-02-13 10:51:26.000000000 -0500
+diff -up gnome-desktop-2.22.0/configure.in.add-randr-12 gnome-desktop-2.22.0/configure.in
+--- gnome-desktop-2.22.0/configure.in.add-randr-12	2008-03-10 17:02:23.000000000 -0400
++++ gnome-desktop-2.22.0/configure.in	2008-03-20 01:19:38.000000000 -0400
 @@ -51,10 +51,10 @@ AC_SUBST(GNOME_MICRO)
  AC_SUBST(GNOME_DISTRIBUTOR)
  AC_SUBST(GNOME_DATE)


Index: gnome-desktop.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-desktop/devel/gnome-desktop.spec,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -r1.133 -r1.134
--- gnome-desktop.spec	11 Mar 2008 02:51:55 -0000	1.133
+++ gnome-desktop.spec	20 Mar 2008 05:29:39 -0000	1.134
@@ -12,7 +12,7 @@
 Summary: Package containing code shared among gnome-panel, gnome-session, nautilus, etc
 Name: gnome-desktop
 Version: 2.22.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 URL: http://www.gnome.org
 Source0: http://download.gnome.org/sources/gnome-desktop/2.22/%{name}-%{version}.tar.bz2
 License: GPLv2+ and LGPLv2+
@@ -121,6 +121,9 @@
 %doc %{_datadir}/gtk-doc/html/gnome-desktop/
 
 %changelog
+* Tue Mar 20 2008 Soren Sandmann <sandmann at redhat.com> - 2.22.0-2
+- Update randr code
+
 * Mon Mar 10 2008 Matthias Clasen <mclasen at redhat.com> - 2.22.0-1
 - Update to 2.22.0
 




More information about the fedora-extras-commits mailing list