[PATCH 0/6] handle detailed timing operation

2008-11-27 Thread Ma Ling
Hi All

I re-updated the patch, which handle all detailed timing operation, including 
EDID and EDID ext.
Currently it only implemented CEA extension,but the unified interface can 
accommodate 
other extension detailed timing operations such as VTB, DI, LS ... .  

[PATCH 1/6] Includes some new structures and defined MACRO in edid.h.
[PATCH 2/6] implement unified interface and detailed timing operation in 
interpret_edid.c
[PATCH 3/6] handle detailed timing operation in xf86EdidModes.c
[PATCH 4/6] handle detailed timing operation in xf86Crtc.c
[PATCH 5/6] handle detailed timing operation in xf86Configure.c
[PATCH 6/6] handle detailed timing operation in print_edid.c

Any comments are welcome !

Thanks
Ma Ling 

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 1/6] Includes some new structures and defined MACRO in edid.h

2008-11-27 Thread Ma Ling
defined corresponding structure and MACRO for detailed timing operation

---
 hw/xfree86/ddc/edid.h |   73 +
 1 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h
index 45caf6e..fde06d0 100644
--- a/hw/xfree86/ddc/edid.h
+++ b/hw/xfree86/ddc/edid.h
@@ -549,4 +549,77 @@ typedef struct {
 
 extern xf86MonPtr ConfiguredMonitor;
 
+#define CEA_EXT   0x02
+#define VTB_EXT   0x10
+#define DI_EXT0x40
+#define LS_EXT0x50
+#define MI_EXT0x60
+
+#define CEA_EXT_MIN_DATA_OFFSET 4
+#define CEA_EXT_MAX_DATA_OFFSET 127
+#define CEA_EXT_DET_TIMING_NUM 6
+
+#define EXT_TAG 0
+#define EXT_REV 1
+
+struct cea_video_blk {
+  Uchar video_code; 
+};
+
+struct cea_audio_blk {
+Uchar descs[3];
+};
+
+struct hdmi {
+  Uchar  support_flags;
+  Uchar  max_tmds_clock;
+  Uchar  latency_present;
+  Uchar  video_latency;
+  Uchar  audio_latency;
+  Uchar  interlaced_video_latency;
+  Uchar  interlaced_audio_latency;
+};
+
+struct cea_vendor_blk {
+  unsigned char ieee_id[3];
+  Uchar  port_addr[2];
+  struct hdmi hdmi;
+};
+
+struct cea_speaker_blk 
+{
+  Uchar FLR:1;
+  Uchar LFE:1;
+  Uchar FC:1;
+  Uchar RLR:1;
+  Uchar RC:1;
+  Uchar FLRC:1;
+  Uchar RLRC:1;
+  Uchar FLRW:1;
+  Uchar FLRH:1;
+  Uchar TC:1;
+  Uchar FCH:1;
+  Uchar Resv:5;
+  Uchar ResvByte;
+};
+
+struct cea_data_blk {
+  Uchar len:5;
+  Uchar tag:3;
+union{
+struct cea_video_blk video;
+struct cea_audio_blk audio;
+struct cea_vendor_blk vendor;
+struct cea_speaker_blk speaker;
+  }u;
+};
+
+struct cea_ext_body {
+  Uchar tag;
+  Uchar rev;
+  Uchar dt_offset;
+  Uchar flags;
+  struct cea_data_blk data_collection;
+};
+
 #endif /* _EDID_H_ */
-- 
1.5.4.4



___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

[PATCH 3/6] handle detailed timing operation in xf86EdidModes.c

2008-11-27 Thread Ma Ling
handled detailed timing operation .e.g extract detailed timing modes from EDID 
and cea ext, 
then insert mode list.

---
 hw/xfree86/ddc/xf86DDC.h |   38 +
 hw/xfree86/modes/xf86EdidModes.c |  277 --
 2 files changed, 182 insertions(+), 133 deletions(-)

diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h
index 3172b55..12d45e4 100644
--- a/hw/xfree86/ddc/xf86DDC.h
+++ b/hw/xfree86/ddc/xf86DDC.h
@@ -57,9 +57,47 @@ extern Bool xf86SetDDCproperties(
 xf86MonPtr DDC
 );
 
+/*
+ * Quirks to work around broken EDID data from various monitors.
+ */
+typedef enum {
+DDC_QUIRK_NONE = 0,
+/* First detailed mode is bogus, prefer largest mode at 60hz */
+DDC_QUIRK_PREFER_LARGE_60 = 1  0,
+/* 135MHz clock is too high, drop a bit */
+DDC_QUIRK_135_CLOCK_TOO_HIGH = 1  1,
+/* Prefer the largest mode at 75 Hz */
+DDC_QUIRK_PREFER_LARGE_75 = 1  2,
+/* Convert detailed timing's horizontal from units of cm to mm */
+DDC_QUIRK_DETAILED_H_IN_CM = 1  3,
+/* Convert detailed timing's vertical from units of cm to mm */
+DDC_QUIRK_DETAILED_V_IN_CM = 1  4,
+/* Detailed timing descriptors have bogus size values, so just take the
+ * maximum size and use that.
+ */
+DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1  5,
+/* Monitor forgot to set the first detailed is preferred bit. */
+DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1  6,
+/* use +hsync +vsync for detailed mode */
+DDC_QUIRK_DETAILED_SYNC_PP = 1  7,
+/* Force single-link DVI bandwidth limit */
+DDC_QUIRK_DVI_SINGLE_LINK = 1  8,
+} ddc_quirk_t;
+
 DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
 
 extern Bool
 xf86MonitorIsHDMI(xf86MonPtr mon);
 
+typedef void (* handle_detailed_fn)(struct detailed_monitor_section *,void *);
+
+void xf86ForEachDetailedBlock(xf86MonPtr mon,
+  handle_detailed_fn,
+  void *data);
+
+ddc_quirk_t
+xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose);
+
+void xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon,
+  ddc_quirk_t quirks, int hsize, int vsize);
 #endif
diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 5ed61c1..7049e2a 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -45,20 +45,24 @@
 #include string.h
 #include math.h
 
+void static handle_detailed_rblank(struct detailed_monitor_section *det_mon,
+   void *data)
+{
+
+if (det_mon-type == DS_RANGES)
+if (det_mon-section.ranges.supported_blanking  CVT_REDUCED)
+*(Bool*)data = TRUE;
+}
+
 static Bool
 xf86MonitorSupportsReducedBlanking(xf86MonPtr DDC)
 {
 /* EDID 1.4 explicitly defines RB support */
 if (DDC-ver.revision = 4) {
-   int i;
-   for (i = 0; i  DET_TIMINGS; i++) {
-   struct detailed_monitor_section *det_mon = DDC-det_mon[i];
-   if (det_mon-type == DS_RANGES)
-   if (det_mon-section.ranges.supported_blanking  CVT_REDUCED)
-   return TRUE;
-   }
-   
-   return FALSE;
+Bool ret = FALSE;
+ 
+xf86ForEachDetailedBlock(DDC, handle_detailed_rblank, ret);
+return ret;
 }
 
 /* For anything older, assume digital means RB support. Boo. */
@@ -68,34 +72,6 @@ xf86MonitorSupportsReducedBlanking(xf86MonPtr DDC)
 return FALSE;
 }
 
-/*
- * Quirks to work around broken EDID data from various monitors.
- */
-
-typedef enum {
-DDC_QUIRK_NONE = 0,
-/* First detailed mode is bogus, prefer largest mode at 60hz */
-DDC_QUIRK_PREFER_LARGE_60 = 1  0,
-/* 135MHz clock is too high, drop a bit */
-DDC_QUIRK_135_CLOCK_TOO_HIGH = 1  1,
-/* Prefer the largest mode at 75 Hz */
-DDC_QUIRK_PREFER_LARGE_75 = 1  2,
-/* Convert detailed timing's horizontal from units of cm to mm */
-DDC_QUIRK_DETAILED_H_IN_CM = 1  3,
-/* Convert detailed timing's vertical from units of cm to mm */
-DDC_QUIRK_DETAILED_V_IN_CM = 1  4,
-/* Detailed timing descriptors have bogus size values, so just take the
- * maximum size and use that.
- */
-DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1  5,
-/* Monitor forgot to set the first detailed is preferred bit. */
-DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1  6,
-/* use +hsync +vsync for detailed mode */
-DDC_QUIRK_DETAILED_SYNC_PP = 1  7,
-/* Force single-link DVI bandwidth limit */
-DDC_QUIRK_DVI_SINGLE_LINK = 1  8,
-} ddc_quirk_t;
-
 static Bool quirk_prefer_large_60 (int scrnIndex, xf86MonPtr DDC)
 {
 /* Belinea 10 15 55 */
@@ -667,7 +643,7 @@ DDCGuessRangesFromModes(int scrnIndex, MonPtr Monitor, 
DisplayModePtr Modes)
 }
 }
 
-static ddc_quirk_t
+ddc_quirk_t
 xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose)
 {
 ddc_quirk_tquirks;
@@ -687,6 +663,26 @@ 

[PATCH 5/6] handle detailed timing operation in xf86Configure.c

2008-11-27 Thread Ma Ling
handle detailed timing in xf86Configure.c

---
 hw/xfree86/common/xf86Configure.c |   56 
 1 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/hw/xfree86/common/xf86Configure.c 
b/hw/xfree86/common/xf86Configure.c
index 8700496..2b7f634 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -556,6 +556,35 @@ configureMonitorSection (int screennum)
 return ptr;
 }
 
+static void handle_detailed_input(struct detailed_monitor_section *det_mon,
+  void *data)
+{
+XF86ConfMonitorPtr ptr = (XF86ConfMonitorPtr) data; 
+
+switch (det_mon-type) {
+case DS_NAME:
+ptr-mon_modelname = xf86confrealloc(ptr-mon_modelname, 
+ 
strlen((char*)(det_mon-section.name)) +
+ 1);
+strcpy(ptr-mon_modelname,
+ (char*)(det_mon-section.name));
+break;
+case DS_RANGES:
+ptr-mon_hsync[ptr-mon_n_hsync].lo =
+det_mon-section.ranges.min_h;
+ptr-mon_hsync[ptr-mon_n_hsync].hi =
+det_mon-section.ranges.max_h;
+ptr-mon_n_vrefresh = 1;
+ptr-mon_vrefresh[ptr-mon_n_hsync].lo =
+det_mon-section.ranges.min_v;
+ptr-mon_vrefresh[ptr-mon_n_hsync].hi =
+det_mon-section.ranges.max_v;
+ptr-mon_n_hsync++;
+default:
+break;
+}
+}
+
 static XF86ConfMonitorPtr
 configureDDCMonitorSection (int screennum)
 {
@@ -603,31 +632,8 @@ configureDDCMonitorSection (int screennum)
 }
 #endif /* def CONFIGURE_DISPLAYSIZE */
 
-for (i=0;i4;i++) {
-   switch (ConfiguredMonitor-det_mon[i].type) {
-   case DS_NAME:
-   ptr-mon_modelname  = xf86confrealloc(ptr-mon_modelname, 
- strlen((char*)(ConfiguredMonitor-det_mon[i].section.name))
-   + 1);
-   strcpy(ptr-mon_modelname,
-  (char*)(ConfiguredMonitor-det_mon[i].section.name));
-   break;
-   case DS_RANGES:
-   ptr-mon_hsync[ptr-mon_n_hsync].lo =
-   ConfiguredMonitor-det_mon[i].section.ranges.min_h;
-   ptr-mon_hsync[ptr-mon_n_hsync].hi =
-   ConfiguredMonitor-det_mon[i].section.ranges.max_h;
-   ptr-mon_n_vrefresh = 1;
-   ptr-mon_vrefresh[ptr-mon_n_hsync].lo =
-   ConfiguredMonitor-det_mon[i].section.ranges.min_v;
-   ptr-mon_vrefresh[ptr-mon_n_hsync].hi =
-   ConfiguredMonitor-det_mon[i].section.ranges.max_v;
-   ptr-mon_n_hsync++;
-   default:
-   break;
-   }
-}
-
+xf86ForEachDetailedBlock(ConfiguredMonitor, handle_detailed_input,
+ ptr);
 if (ConfiguredMonitor-features.dpms) {
   ptr-mon_option_lst = xf86addNewOption(ptr-mon_option_lst, 
xstrdup(DPMS), NULL);
 }
-- 
1.5.4.4



___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 6/6] handle detailed timing operation in print_edid.c

2008-11-27 Thread Ma Ling
handle detailed timing to print edid.

---
 hw/xfree86/ddc/print_edid.c |  252 +++
 1 files changed, 136 insertions(+), 116 deletions(-)

diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c
index 7b6e298..af38856 100644
--- a/hw/xfree86/ddc/print_edid.c
+++ b/hw/xfree86/ddc/print_edid.c
@@ -333,123 +333,137 @@ print_detailed_timings(int scrnIndex, struct 
detailed_timings *t)
 }
 }
 
+struct det_print_parameter{
+  xf86MonPtr m;
+  int index;
+  ddc_quirk_t quirks;
+};
+
 static void
-print_detailed_monitor_section(int scrnIndex,
-  struct detailed_monitor_section *m)
+handle_detailed_print(struct detailed_monitor_section *det_mon,
+  void *data)
 {
-int i,j;
-  
-for (i=0;iDET_TIMINGS;i++) {
-   switch (m[i].type) {
-   case DT:
-   print_detailed_timings(scrnIndex,m[i].section.d_timings);
-   break;
-   case DS_SERIAL:
-   xf86DrvMsg(scrnIndex,X_INFO,Serial No: %s\n,m[i].section.serial);
-   break;
-   case DS_ASCII_STR:
-   xf86DrvMsg(scrnIndex,X_INFO, %s\n,m[i].section.ascii_data);
-   break;
-   case DS_NAME:
-   xf86DrvMsg(scrnIndex,X_INFO,Monitor name: %s\n,m[i].section.name);
-   break;
-   case DS_RANGES:
-   {
-   struct monitor_ranges *r = m[i].section.ranges;
-   xf86DrvMsg(scrnIndex,X_INFO,
-  Ranges: V min: %i V max: %i Hz, H min: %i H max: %i 
kHz,,
-  r-min_v, r-max_v, r-min_h, r-max_h);
-   if (r-max_clock_khz != 0) {
-   xf86ErrorF( PixClock max %i kHz\n, r-max_clock_khz);
-   if (r-maxwidth)
-   xf86DrvMsg(scrnIndex, X_INFO, Maximum pixel width: %d\n,
-  r-maxwidth);
-   xf86DrvMsg(scrnIndex, X_INFO, Supported aspect ratios:);
-   if (r-supported_aspect  SUPPORTED_ASPECT_4_3)
-   xf86ErrorF( 4:3%s,
-   r-preferred_aspect == PREFERRED_ASPECT_4_3?*:);
-   if (r-supported_aspect  SUPPORTED_ASPECT_16_9)
-   xf86ErrorF( 16:9%s,
-   r-preferred_aspect == PREFERRED_ASPECT_16_9?*:);
-   if (r-supported_aspect  SUPPORTED_ASPECT_16_10)
-   xf86ErrorF( 16:10%s,
-   r-preferred_aspect == PREFERRED_ASPECT_16_10?*:);
-   if (r-supported_aspect  SUPPORTED_ASPECT_5_4)
-   xf86ErrorF( 5:4%s,
-   r-preferred_aspect == PREFERRED_ASPECT_5_4?*:);
-   if (r-supported_aspect  SUPPORTED_ASPECT_15_9)
-   xf86ErrorF( 15:9%s,
-   r-preferred_aspect == PREFERRED_ASPECT_15_9?*:);
-   xf86ErrorF(\n);
-   xf86DrvMsg(scrnIndex, X_INFO, Supported blankings:);
-   if (r-supported_blanking  CVT_STANDARD)
-   xf86ErrorF( standard);
-   if (r-supported_blanking  CVT_REDUCED)
-   xf86ErrorF( reduced);
-   xf86ErrorF(\n);
-   xf86DrvMsg(scrnIndex, X_INFO, Supported scalings:);
-   if (r-supported_scaling  SCALING_HSHRINK)
-   xf86ErrorF( hshrink);
-   if (r-supported_scaling  SCALING_HSTRETCH)
-   xf86ErrorF( hstretch);
-   if (r-supported_scaling  SCALING_VSHRINK)
-   xf86ErrorF( vshrink);
-   if (r-supported_scaling  SCALING_VSTRETCH)
-   xf86ErrorF( vstretch);
-   xf86ErrorF(\n);
-   xf86DrvMsg(scrnIndex, X_INFO, Preferred refresh rate: %d\n,
-  r-preferred_refresh);
-   } else if (r-max_clock != 0) {
-   xf86ErrorF( PixClock max %i MHz\n, r-max_clock);
-   } else {
-   xf86ErrorF(\n);
-   }
-   if (r-gtf_2nd_f  0)
-   xf86DrvMsg(scrnIndex,X_INFO, 2nd GTF parameters: f: %i kHz 
-  c: %i m: %i k %i j %i\n, r-gtf_2nd_f,
-  r-gtf_2nd_c, r-gtf_2nd_m, r-gtf_2nd_k,
-  r-gtf_2nd_j);
-   break;
-   }
-   case DS_STD_TIMINGS:
-   for (j = 0; j5; j++) 
-   xf86DrvMsg(scrnIndex,X_INFO,#%i: hsize: %i  vsize %i  refresh: 
%i  
-  vid: %i\n,i,m[i].section.std_t[i].hsize,
-  
m[i].section.std_t[j].vsize,m[i].section.std_t[j].refresh,
-  m[i].section.std_t[j].id);
-   break;
-   case DS_WHITE_P:
-   for (j = 0; j2; j++)
-   if (m[i].section.wp[j].index != 0)
-   xf86DrvMsg(scrnIndex,X_INFO,
-  White point %i: whiteX: %f, whiteY: %f; gamma: 
%f\n,
-  
m[i].section.wp[j].index,m[i].section.wp[j].white_x,
-  

[PATCH 4/6] handle detailed timing operation in xf86Crtc.c

2008-11-27 Thread Ma Ling
handle detailed timing operation,e.g. set up Monitor from detailed timing block 
from EDID and cea ext

---
 hw/xfree86/modes/xf86Crtc.c |  120 ---
 1 files changed, 79 insertions(+), 41 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index fe9d7b0..dee95b0 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1433,6 +1433,41 @@ GuessRangeFromModes(MonPtr mon, DisplayModePtr mode)
mon-vrefresh[0].lo = 58.0;
 }
 
+struct det_monrec_parameter {
+MonRec *mon_rec;
+int *max_clock;
+int *sync_source; 
+};
+
+static void handle_detailed_monrec(struct detailed_monitor_section *det_mon,
+   void *data)
+{  
+enum { sync_config, sync_edid, sync_default };
+struct det_monrec_parameter *p; 
+p = (struct det_monrec_parameter *)data;
+
+if (det_mon-type == DS_RANGES) {
+   struct monitor_ranges   *ranges = det_mon-section.ranges;
+if (p-mon_rec-nHsync == 0  ranges-max_h) {
+p-mon_rec-hsync[p-mon_rec-nHsync].lo = ranges-min_h;
+p-mon_rec-hsync[p-mon_rec-nHsync].hi = ranges-max_h;
+p-mon_rec-nHsync++;
+if (*p-sync_source == sync_default)
+*p-sync_source = sync_edid;
+}
+if (p-mon_rec-nVrefresh == 0  ranges-max_v) {
+p-mon_rec-vrefresh[p-mon_rec-nVrefresh].lo = ranges-min_v;
+p-mon_rec-vrefresh[p-mon_rec-nVrefresh].hi = ranges-max_v;
+p-mon_rec-nVrefresh++;
+if (*p-sync_source == sync_default)
+*p-sync_source = sync_edid;
+}
+if (ranges-max_clock * 1000  *p-max_clock)
+*p-max_clock = ranges-max_clock * 1000;
+}
+}
+
+
 _X_EXPORT void
 xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
 {
@@ -1513,40 +1548,20 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int 
maxY)

if (edid_monitor)
{
-   int i;
-   Boolset_hsync = mon_rec.nHsync == 0;
-   Boolset_vrefresh = mon_rec.nVrefresh == 0;
+struct det_monrec_parameter p;
struct disp_features*features = edid_monitor-features;
 
/* if display is not continuous-frequency, don't add default modes 
*/
if (!GTF_SUPPORTED(features-msc))
add_default_modes = FALSE;
 
-   for (i = 0; i  sizeof (edid_monitor-det_mon) / sizeof 
(edid_monitor-det_mon[0]); i++)
-   {
-   if (edid_monitor-det_mon[i].type == DS_RANGES)
-   {
-   struct monitor_ranges   *ranges = 
edid_monitor-det_mon[i].section.ranges;
-   if (set_hsync  ranges-max_h)
-   {
-   mon_rec.hsync[mon_rec.nHsync].lo = ranges-min_h;
-   mon_rec.hsync[mon_rec.nHsync].hi = ranges-max_h;
-   mon_rec.nHsync++;
-   if (sync_source == sync_default)
-   sync_source = sync_edid;
-   }
-   if (set_vrefresh  ranges-max_v)
-   {
-   mon_rec.vrefresh[mon_rec.nVrefresh].lo = ranges-min_v;
-   mon_rec.vrefresh[mon_rec.nVrefresh].hi = ranges-max_v;
-   mon_rec.nVrefresh++;
-   if (sync_source == sync_default)
-   sync_source = sync_edid;
-   }
-   if (ranges-max_clock * 1000  max_clock)
-   max_clock = ranges-max_clock * 1000;
-   }
-   }
+p.mon_rec = mon_rec;
+p.max_clock = max_clock;
+p.sync_source = (int *)sync_source;
+
+xf86ForEachDetailedBlock(edid_monitor,
+handle_detailed_monrec,
+p);
}
 
if (xf86GetOptValFreq (output-options, OPTION_MIN_CLOCK,
@@ -2686,6 +2701,35 @@ xf86OutputSetEDIDProperty (xf86OutputPtr output, void 
*data, int data_len)
 
 #endif
 
+/* Pull out a phyiscal size from a detailed timing if available. */
+struct det_phySize_parameter {
+xf86OutputPtr output;
+ddc_quirk_t quirks;
+Bool ret;   
+};
+
+void static handle_detailed_physical_size(struct detailed_monitor_section 
+ *det_mon, void *data)
+{
+struct det_phySize_parameter *p;
+p = (struct det_phySize_parameter *)data;
+
+if (p-ret == TRUE )
+return ;
+
+xf86DetTimingApplyQuirks(det_mon, p-quirks,
+ p-output-MonInfo-features.hsize,
+ p-output-MonInfo-features.vsize);
+
+if (det_mon-type == DT 
+det_mon-section.d_timings.h_size != 0 
+det_mon-section.d_timings.v_size != 0) {
+
+p-output-mm_width = 

[PATCH] randr: add swapped dispatch for RR[GS]etCrtcTransform

2008-11-27 Thread Julien Cristau
Fix a memory leak in ProcRRGetCrtcTransform() while I'm at it.

Signed-off-by: Julien Cristau [EMAIL PROTECTED]
Cc: Keith Packard [EMAIL PROTECTED]
---
 randr/rrcrtc.c  |6 +++---
 randr/rrsdispatch.c |   29 ++---
 2 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 5d270ce..90d93b5 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1150,8 +1150,7 @@ transform_filter_encode (ClientPtr client, char *output,
 if (client-swapped) {
swaps (nbytesFilter, n);
swaps (nparamsFilter, n);
-   SwapLongs ((CARD32 *) (output + nbytes),
-  nparams * sizeof (xFixed));
+   SwapLongs ((CARD32 *) (output + nbytes), nparams);
 }
 nbytes += nparams * sizeof (xFixed);
 return nbytes;
@@ -1162,7 +1161,7 @@ transform_encode (ClientPtr client, xRenderTransform 
*wire, PictTransform *pict)
 {
 xRenderTransform_from_PictTransform (wire, pict);
 if (client-swapped)
-   SwapLongs ((CARD32 *) wire, sizeof (xRenderTransform));
+   SwapLongs ((CARD32 *) wire, sizeof (xRenderTransform)  2);
 }
 
 int
@@ -1214,5 +1213,6 @@ ProcRRGetCrtcTransform (ClientPtr client)
swapl (reply-length, n);
 }
 WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char 
*) reply);
+xfree(reply);
 return client-noClientException;
 }
diff --git a/randr/rrsdispatch.c b/randr/rrsdispatch.c
index 66a0e16..90216be 100644
--- a/randr/rrsdispatch.c
+++ b/randr/rrsdispatch.c
@@ -367,21 +367,36 @@ SProcRRSetCrtcGamma (ClientPtr client)
 static int
 SProcRRSetCrtcTransform (ClientPtr client)
 {
+int n, nparams;
+char *filter;
+CARD32 *params;
 REQUEST(xRRSetCrtcTransformReq);
-
-REQUEST_SIZE_MATCH(xRRSetCrtcTransformReq);
-(void) stuff;
-return BadImplementation; 
+
+REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
+swaps(stuff-length, n);
+swapl(stuff-crtc, n);
+SwapLongs((CARD32 *)stuff-transform, (sizeof xRenderTransform)  2);
+swaps(stuff-nbytesFilter);
+filter = (char *)(stuff + 1);
+params = (CARD32 *) (filter + ((stuff-nbytesFilter + 3)  ~3));
+nparams = ((CARD32 *) stuff + client-req_len) - params;
+if (nparams  0)
+   return BadLength;
+
+SwapLongs(params, nparams);
+return (*ProcRandrVector[stuff-randrReqType]) (client);
 }
 
 static int
 SProcRRGetCrtcTransform (ClientPtr client)
 {
+int n;
 REQUEST(xRRGetCrtcTransformReq);
-
+
 REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
-(void) stuff;
-return BadImplementation; 
+swaps(stuff-length, n);
+swapl(stuff-crtc, n);
+return (*ProcRandrVector[stuff-randrReqType]) (client);
 }
 
 int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {
-- 
1.5.6.5

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Red and Blue Swapped

2008-11-27 Thread Leandro Galvez
Hi there,

I have an xorg system running on linux virtual frame buffer. Images are 
extracted from the vfb and dumped into the real famebuffer. It is generating 
and responding already to inputs. But I have a problem with the color mapping, 
red and blue colors are swapped. Green is showing perfectly but all blue pixels 
are shown as red and vice versa. I've tried SubPixelOrder option in device 
section but it doesnt seem to affect the color mapping. Anybody knows how to 
fix it?

Thanks and best regards,
Andy___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: multiseat login problems: MDM?

2008-11-27 Thread Hugo Vanwoerkom
--- On Wed, 11/26/08, Kārlis Repsons [EMAIL PROTECTED] wrote:
From: Kārlis Repsons [EMAIL PROTECTED]
Subject: Re: multiseat login problems: MDM?
To: Paulo Zanoni [EMAIL PROTECTED]
Cc: xorg@lists.freedesktop.org
Date: Wednesday, November 26, 2008, 12:58 PM

On Wednesday 26 November 2008 19:49:12 you wrote:
 On Sun, Nov 23, 2008 at 4:37 PM, Kārlis Repsons

 [EMAIL PROTECTED] wrote:
  What should I do to get multiseat work in a case when
  * some user logs out
  * some seat doesn't receive login timely (and its X server gets
  terminated..) ?

 Are you using mdm?
Not yet.

 When a user logs out mdm should show the display manager's login
screen
 again.
Would be nice...

The thing is: I can't make it work on gentoo easily. My distro's devs
are not 
going to support it as well, because latest upgrade of mdm is 2+ years
old. 
(http://bugs.gentoo.org/45833)

Maybe I try dedicating a day just for MDM and succeed, but there are questions 
like:

1. should I patch libX11(-6)?
2. is /etc/init.d/mdm non-executable in debian?
3. ... others I can't think of right now. 

Well, let me know, what you think about those things first!

I run a multiseat on Debian Sid, just 2 seats. I guess MDM means 'mandrake 
display manager? I run either gdm or no display manager at all, but then 
monitor0 with the VT's has to log a user on and issue a startx.

Hugo Vanwoerkom





  
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

X input module binary compatibility across xorg 1.3, 1.4, or 1.5?

2008-11-27 Thread Chueh Steel
Hi, all,

1. Is it possible to compiler one X input module so that it could be
binary compatible across xorg 1.3, 1.4 or 1.5?
2. If not,, is there any good or easier way so that I could
cross-compiler my X input module at just one platform?
Any hint would be help and apprecitated!!
Thanks.

-chueh8
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: xinput test crashes server when touchpad clicked

2008-11-27 Thread Magnus Kessler
On Wednesday 26 November 2008, Peter Hutterer wrote:
 On Wed, Nov 19, 2008 at 10:07:59PM +, Magnus Kessler wrote:
  With the latest server and synaptics driver from git I can reliably
  crash the server by starting
 
  xinput test SynPS2/2 Synaptics Touchpad
 
  and then clicking the any of the physical buttons or tapping the pad to
  simulate a click.

 How about this one?

 From 87f5aa009d65e44f516bfc0168249ea29433b2b4 Mon Sep 17 00:00:00 2001

 From: Peter Hutterer [EMAIL PROTECTED]
 Date: Wed, 26 Nov 2008 12:20:00 +1000
 Subject: [PATCH] xkb: don't attempt to filter events for devices without
 key classes.

 Reported by Magnus Kessler.

 Signed-off-by: Peter Hutterer [EMAIL PROTECTED]
 ---
  xkb/xkbEvents.c |   10 +-
  1 files changed, 9 insertions(+), 1 deletions(-)

 diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
 index 151849c..02565a4 100644
 --- a/xkb/xkbEvents.c
 +++ b/xkb/xkbEvents.c
 @@ -819,7 +819,8 @@ XkbSrvInfoPtr xkbi;
  pXDev = inputInfo.keyboard;
  }

 -xkbi= pXDev-key-xkbInfo;
 +xkbi= (pXDev-key) ? pXDev-key-xkbInfo : NULL;
 +
  if ( pClient-xkbClientFlags  _XkbClientInitialized ) {
   if ((xkbDebugFlags0x10)
   ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease)||
 @@ -841,6 +842,10 @@ XkbSrvInfoPtrxkbi;
   (_XkbIsReleaseEvent(xE[0].u.u.type)) ) {
   return False;
   }
 +
 +if (!xkbi)
 +return True;
 +
   if ((pXDev-deviceGrab.grab != NullGrab)
   pXDev-deviceGrab.fromPassiveGrab 
   ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease)||
 @@ -884,6 +889,9 @@ XkbSrvInfoPtr xkbi;
  else {
   register CARD8  type;

 +if (!xkbi)
 +return True;
 +
   for (i=0;inEvents;i++) {
   type= xE[i].u.u.type;
   if ((xkbDebugFlags0x4)

Tested-by: Magnus Kessler [EMAIL PROTECTED]

That patch works fine for me. Thanks for fixing this.

However, I see that the same unchecked access to p-key-xkbInfo exists in 
other functions in xkbEvents.c as well, notably XkbSendStateNotify and 
XkbSendControlsNotify (where it might be guarded by the xkb_interest 
field?), XkbSendMapNotify, XkbHandleBell and XkbSendActionMessage.

It seems clear from the naming (kbd) of the DeviceIntPtr parameter in 
those cases that above functions are intended to be called only for regular 
keyboard devices? Is this guaranteed?

Cheers,

Magnus

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: multiseat login problems: MDM?

2008-11-27 Thread Paulo Zanoni
 I run a multiseat on Debian Sid, just 2 seats. I guess MDM means 'mandrake 
 display manager? I run either gdm or no display manager at all, but then 
 monitor0 with the VT's has to log a user on and issue a startx.


I was talking about the multiseat (pseudo-)display manager, not
mandrake display manager =)

If you're interested in making multiseat you could try it.

http://wiki.c3sl.ufpr.br/multiseat/index.php/Mdm
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: proto/randrproto: Branch 'master' - 8 commits

2008-11-27 Thread Julien Cristau
Hi Keith,

it seems like the length field in the RRGetCrtcTransform reply should be
24+(pn+pnp)/4+(cn+cnp)/4+pf+cf, not 16+...

Cheers,
Julien

On Wed, Nov 26, 2008 at 09:23:38 -0800, Keith Packard wrote:

 ++┌───
 ++RRGetCrtcTransform
 ++1   CARD8   major opcode
 ++1   27  RandR opcode
 ++2   2   length
 ++4   CRTCcrtc
 ++  ▶
 ++1   1   Reply
 ++1   unused
 ++2   CARD16  sequence number
 ++4   16+(pn+pnp)/4+(cn+cnp)/4+pf+cf  reply length
 ++36  TRANSFORM   pending transform
 ++1   BOOLhas transforms
 ++3   unused
 ++36  TRANSFORM   current transform
 ++4   unused
 ++2   pn  pending filter name length
 ++2   pf  pending filter num params
 ++2   cn  current filter name length
 ++2   cf  current filter num params
 ++pn  STRING8 pending filter name
 ++pnp unused, pnp=pad(pn)
 ++4*pfFIXED   pending filter params
 ++cn  STRING8 current filter name
 ++cnp unused, cnp=pad(cn)
 ++4*cfFIXED   current filter params
 ++└───
 ++
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: multiseat login problems: MDM?

2008-11-27 Thread Steven J Newbury
On Wed, 2008-11-26 at 19:58 +, Kārlis Repsons wrote:
 On Wednesday 26 November 2008 19:49:12 you wrote:
  On Sun, Nov 23, 2008 at 4:37 PM, Kārlis Repsons
 
  [EMAIL PROTECTED] wrote:
   What should I do to get multiseat work in a case when
   * some user logs out
   * some seat doesn't receive login timely (and its X server gets
   terminated..) ?
 
  Are you using mdm?
 Not yet.
 
  When a user logs out mdm should show the display manager's login screen
  again.
 Would be nice...
 
 The thing is: I can't make it work on gentoo easily. My distro's devs are not 
 going to support it as well, because latest upgrade of mdm is 2+ years old. 
 (http://bugs.gentoo.org/45833)
 

That bug about is the wrong MDM (Mandrake Display Manager).  If you want
to use MDM (Multiseat Display Manager) in gentoo, you should create an
ebuild for it.

 Maybe I try dedicating a day just for MDM and succeed, but there are 
 questions 
 like:
 
 1. should I patch libX11(-6)?
 2. is /etc/init.d/mdm non-executable in debian?
 3. ... others I can't think of right now. 
 
 Well, let me know, what you think about those things first!
You really don't want to be using the debian packaged version on Gentoo!


___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Intel G45: resolution on VGA port limited to 640x480

2008-11-27 Thread Frederik Himpe
I have a Dell Latitude E6400 with Intel Mobile 4 Series Chipset 
Integrated Graphics Controller [DISPLAY_VGA] (vendor:8086 device:2a42 
subv:1028 subd:0233) and I'm using Mandriva 2009.0 x86_64 and xserver 
1.4.2.

With both the Intel xorg driver version 1.4.2 and 1.5.1, the resolution 
on the VGA port, is limited to 640x480:
$ xrandr
Screen 0: minimum 320 x 200, current 1440 x 900, maximum 1440 x 1440
VGA connected (normal left inverted right x axis y axis)
   640x48060.0  
LVDS connected 1440x900+0+0 (normal left inverted right x axis y axis) 
303mm x 190mm
   1440x900   60.0*+   40.0  
   1024x768   60.0  
   800x60060.3  
   640x48059.9  
HDMI-1 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
TV disconnected (normal left inverted right x axis y axis)

My xorg.conf contains
Virtual 2720 1024
lines and according to the Xorg.0.log, it really detects that the monitor 
supports 1280x1024 with DCC.

Complete xorg.conf and Xorg.0.log can be found in this Mandriva bug 
report: https://qa.mandriva.com/show_bug.cgi?id=45586


Unrelated to that: EXA is unusably slow for compositing on this system: 
my GNOME desktop feels noticeably slower and when running dmesg in a 
transparent gnome-terminal, you see that the image is only refreshed a 
few times per second. Also in 1.5.1, these messages appear in dmesg:
[drm:i915_getparam] *ERROR* Unknown parameter 5
mtrr: type mismatch for e000,1000 old: write-back new: write-
combining
set status page addr 0x023c

-- 
Frederik Himpe

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: [PATCH] randr: add swapped dispatch for RR[GS]etCrtcTransform

2008-11-27 Thread Keith Packard
On Wed, 2008-11-26 at 22:14 +0100, Julien Cristau wrote:

 +SwapLongs((CARD32 *)stuff-transform, (sizeof xRenderTransform)  2);
 +swaps(stuff-nbytesFilter);

Please try compiling patches before submitting them. Testing would be a
nice bonus too.

-- 
[EMAIL PROTECTED]


signature.asc
Description: This is a digitally signed message part
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: proto/randrproto: Branch 'master' - 8 commits

2008-11-27 Thread Keith Packard
On Thu, 2008-11-27 at 15:24 +0100, Julien Cristau wrote:
 Hi Keith,
 
 it seems like the length field in the RRGetCrtcTransform reply should be
 24+(pn+pnp)/4+(cn+cnp)/4+pf+cf, not 16+...

The reply length doesn't include the first 32 bytes of the reply, so I
think 16 is the right value (unless I made some arithmetic blunder).

-- 
[EMAIL PROTECTED]


signature.asc
Description: This is a digitally signed message part
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Weird wm behavior with xeyes

2008-11-27 Thread Jeremy Huddleston
Someone discovered an odd bug that our wm exhibits with xeyes.  The  
black-lines are drawn at the right spot, but the ovals that select  
which region to view move down as quartz-wm starts and stops.   
ConfigureNotify is always returning the upper left of the inner  
window, and we are doing the correct reparenting offset...  anyone  
seen something like this before of have some guesses for me to persue?

I put together an animation of this happening here:

http://people.freedesktop.org/~jeremyhu/xeyesbug/xeyes.mov

If you don't like .mov, you can see the individual frames:
http://people.freedesktop.org/~jeremyhu/xeyesbug

Thanks,
Jeremy

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Eee Top, intel driver: backlight off

2008-11-27 Thread Uplink
Hello everyone,

I recently received two shiny Asus Eee Top ET1602 units to play with. I
am to run Linux on them, and pretend that the Windows XP Home that came
with them is not there. But I have a problem... the LCD backlight is
turned off when X starts with the intel driver.

I use Ubuntu 8.10 (intel driver 2.4.1, libdrm 2.3.1, kernel 2.6.27). As
soon as X starts, the backlight turns off and there's no way to turn it
back on while X is on display. Switching to a console turns the
backlight on, switching back to X turns it off again.

The display is connected on the LVDS connector (according to the Windows
video driver), but when I run xrandr --properties there's something
wrong there: the range for the BACKLIGHT priperty is (0,0). I tried
switching the BACKLIGHT_CONTROL property to different values (starts
with 'native'), but to no avail. I hacked the drivers so the range
matches that of my laptop, which is (0,10781) in combination mode, but
still no effect on the backlight.

The vesa driver works fine. Even more, the touch screen works with the
evtouch driver without much hassle:
http://wiki.linuxmce.org/index.php/Asus_Eee_Top . All that's missing is
the actual picture.

I tried the 2.5.1 driver from Debian experimental (without upgrading any
drm kernel modules though) and I got the same result.

At this point, I gave up on researching it on my own. Can someone help
me fix the backlight controls for this machine?

Thanks,
Radu C

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: xinput test crashes server when touchpad clicked

2008-11-27 Thread Peter Hutterer
On Thu, Nov 27, 2008 at 11:49:58AM +, Magnus Kessler wrote:
 Tested-by: Magnus Kessler [EMAIL PROTECTED]
 
 That patch works fine for me. Thanks for fixing this.
 
 However, I see that the same unchecked access to p-key-xkbInfo exists in 
 other functions in xkbEvents.c as well, notably XkbSendStateNotify and 
 XkbSendControlsNotify (where it might be guarded by the xkb_interest 
 field?), XkbSendMapNotify, XkbHandleBell and XkbSendActionMessage.
 
 It seems clear from the naming (kbd) of the DeviceIntPtr parameter in 
 those cases that above functions are intended to be called only for regular 
 keyboard devices? Is this guaranteed?

IIRC, these functions were always called with the VCK so that wouldn't cause
any problems. We can't easily do that anymore, so the bail out if it's not a
keyboard is the best approach.
I'll amend the patch to fix the other occurances, but it'll take me a few
days. If you get to it on the weekend, I'll be happy to review.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Xrandr does not support screen size across two screens

2008-11-27 Thread Tobias Kaminsky
On Thursday 27 November 2008 21:56:06 Daniil V. Kolpakov wrote:
 В сообщении от Четверг 27 ноября 2008 Tobias Kaminsky написал(a):
  Maybe someone could tell me how to adjust the maximum.
  Adding new modeline does not work.

 You propably need adjust Virtual size, like this:

 Section Screen
 Identifier screen1
 Device device1
 Monitor monitor1
 SubSection Display
 Virtual 2560 1024
 EndSubSection
 EndSection

 This should go to Xephyr's xorg.conf, I guess.

I added this to my two screen sections, it resulted in a 2x2560 screens 
where I could scroll with my mouse on both screens.
But just for testing it is okay.
The problem exists despite of that. 
1) Starting Xephyr :2
2) DISPLAY=:2 xrandr results in a maximum screen size of 1600x1200 again.

This must be wrong, or?

Thanks
Tobi

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: X input module binary compatibility across xorg 1.3, 1.4, or 1.5?

2008-11-27 Thread Peter Hutterer
On Thu, Nov 27, 2008 at 06:37:12PM +0800, Chueh Steel wrote:
 1. Is it possible to compiler one X input module so that it could be
 binary compatible across xorg 1.3, 1.4 or 1.5?

no, the ABI and API has changed a lot between all three.

 2. If not,, is there any good or easier way so that I could
 cross-compiler my X input module at just one platform?

Do you mean on just one platform? Sure, just make sure it picks up the right
headers during configure. You can install X headers in three different
locations and then build against the specific API by changing PKG_CONFIG_PATH.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: disable copy/paste feature in X Window

2008-11-27 Thread Peter Hutterer
On Wed, Nov 26, 2008 at 04:46:47PM +0200, Catalin wrote:
 Is there any way to disable copy/paste feature for X Window?

copy/paste is handled by the client, so you need to disable it in the client.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[ANNOUNCE] inputproto 1.5.0

2008-11-27 Thread Peter Hutterer
X Input Protocol 1.5.0

Additions over 1.4: input device properties support.

IDP are modelled after window properties and work much in the same manner.
Each X Input device can have multiple properties of arbitrary types at any
point in time. These properties can be interpreted by the server and/or the
driver and thus allow cheap, easily expandable ways of configuring devices.

IDP can also be read by other clients, allowing clients to label devices or
device specific features. Two of the more obvious cases are to label a device
as primary, or to label each axis to denote it's function (press, tilt,
rotation, etc.).

For those reading commit logs: IDP were originally added as XGE events as part
of XI2, then backported to traditional events.

Cheers,
  Peter


Peter Hutterer (10):
  Back out Device Properties from XI 2, push into XI 1.5.
  Protect against C++ includes.
  Add libXi's property interfaces.
  PropertyNotify, move deviceid back to last byte.
  Remove RCS tags, typo fix.
  Make sure Atoms are defined as CARD32.
  Undef Atom after we're done so we don't pollute users of XIproto.h
  Add XI_JOYSTICK type.
  Remove Configure/QueryDeviceProperty.
  inputproto 1.5.0

git tag: inputproto-1.5.0

http://xorg.freedesktop.org/archive/individual/proto/inputproto-1.5.0.tar.bz2
MD5: dcc36554aea1338b3813943daf1e9988  inputproto-1.5.0.tar.bz2
SHA1: c6514843f35e2591fadc13f3fc87bf3752b7197c  inputproto-1.5.0.tar.bz2

http://xorg.freedesktop.org/archive/individual/proto/inputproto-1.5.0.tar.gz
MD5: edab35e039779f7f967e4f29878c5421  inputproto-1.5.0.tar.gz
SHA1: c7dbcc6cd43086a03eb9462307df7186aad25acc  inputproto-1.5.0.tar.gz



pgpplQEOueolS.pgp
Description: PGP signature
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: Ansification of X.Org code other cleanup work

2008-11-27 Thread Paulo César Pereira de Andrade
 On Mon, 20 Oct 2008, Alan Coopersmith wrote:

 Hi Alan,

 in your mail starting this thread

 If someone wanted to organize a janitorial squad to tackle these and
 help
 new people work through them to get to the point where they were ready
 for
 commit access, we'd love you forever (or at least until you turn us down
 when we then volunteer you to be the next release manager).

 [3] 122 open bugs, though many patches aren't keyworded:
 http://bugs.freedesktop.org/buglist.cgi?keywords=patchproduct=Xorgbug_status=NEWbug_status=ASSIGNEDbug_status=REOPENED

 you suggested to have a look at these bugs and patches. In the meantime I
 have done just that.  There are quite a few easy ones (apply cleanly to
 current git and are obvious changes such as strict ANSI C function
 definitions, fixing some small bugs, and similar).

 Here my recommendations:

 

 app/viewres
   bugid=18479 patchid=20208   apply

 app/xf86dga
   bugid=15084 patchid=15215   apply

 app/xfd
   bugid=18479 patchid=20209   apply

 app/xfontsel
   bugid=15083 patchid=15214   apply

 app/xgc
   bugid=18479 patchid=20210   apply

 app/xkbprint
   bugid=12790 patchid=12008   apply, maybe without commented old code
   bugid=15078 patchid=15207   apply with --whitespace=fix

 app/xkbutils
   bugid=15077 patchid=15206   apply

 app/xload
   bugid=15075 patchid=15205   apply

 app/xlsfonts
   bugid=15073 patchid=15203   apply

 app/xmessage
   bugid=15072 patchid=15202   apply

 app/xmh
   bugid=15071 patchid=15201   apply
   bugid=18479 patchid=20211   apply

 app/xprop
   bugid=16154 patchid=16813   apply

 app/xsm
   bugid=15066 patchid=15196   apply
   bugid=18479 patchid=20212   apply

 

 where bugid= refers to
   http://bugs.freedesktop.org/show_bug.cgi?id=n
 and patchid=n to
   http://bugs.freedesktop.org/attachment.cgi?id=n

 

 Note: patches 20208-20212 have been submitted by me.  They correct an
 obvious build failure along the lines already applied to app/xedit, but
 nevertheless they need independent review and approval.

 Regards
 Peter Breitenlohner [EMAIL PROTECTED]

  Hi,

  I just applied all the patches. Thanks, and sorry for the delay.

Paulo

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Xrandr does not support screen size across two screens

2008-11-27 Thread Tino Keitel
On Thu, Nov 27, 2008 at 17:45:41 +, Tobias Kaminsky wrote:
 Hey,
 
 I am starting X across two screens using two graphic adapters. When I
 load Xephyr into it, I cannot adjust the size with xrandr to the
 maximum of 2560x1024 (2 tfts of 1280x1024).
 Xrandr's output says that the maximum is 1600x1200 (which could be
 the maximum of 1! tft, I guess).

I don't know any details about Xephyr, but the current stable release
of the Xserver doesn't allow multihead accross multiple graphic
adapters. This is a planned feature of Xserver 1.6.

Regards,
Tino
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Current tinderbox regression (xf86-input-aiptek)

2008-11-27 Thread Paulo César Pereira de Andrade
 http://tinderbox.x.org/builds/2008-11-28-0005/
 http://tinderbox.x.org/builds/2008-11-28-0005/logs/xf86-input-acecad/#build

 acecad.c:76:28: error: sysfs/libsysfs.h: No such file or directory
 acecad.c: In function 'AceCadAutoDevProbe':
 acecad.c:250: warning: assignment makes pointer from integer without a
 cast
 acecad.c:253: warning: assignment makes pointer from integer without a
 cast
 acecad.c:256: warning: assignment makes pointer from integer without a
 cast
 acecad.c:259: error: expected expression before 'struct'
 acecad.c:259: error: expected ';' before '{' token

  Thanks, and sorry for causing the build failure. I originally made
the patch I just committed to correct the problem, but then, I tried
to look cool and make a one line patch, and messed it by not
properly regenerating config.h, and adding a shell test where it
was not applicable :-)

 --
 Chris Ball   [EMAIL PROTECTED]

Paulo

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 0/12] Input fixes for 1.6 - backing out XI2

2008-11-27 Thread Peter Hutterer

Keith:

Here's the patch series for backing out XI2 for server-1.6. 
git://people.freedesktop.org/whot/xserver server-1.6-branch

http://cgit.freedesktop.org/~whot/xserver/log/?h=server-1.6-branch

Note the last two patches are not server-1.6 specific, they should also apply
to master. I included them because without them, gimp will bring the server
down when xkb tries to access nonexistant structs.

== Summary: ==
 - All new XI2 requests have been removed.
 - All new XI2 events have been removed. This includes
   DeviceEnter/LeaveNotifies and the XGE events for hierarchy changes,
   etc.
 - No MD class switching anymore (see below).
 - No XI events from MDs anymore (see below).
 - No implicit detaching of SDs (see below). 
 - Dependency on inputproto 1.5 added.

== Details: ==
The XI 1.x input model allows one core pointer, one core keyboard and multiple
XI devices. The request handling to create new MDs has been removed, so we
only have VCP and VCK (which are hardcoded since 1.4).

CP and CK must not send XI events and therefore don't need to
switch classes either. The MD class switching present in master has been
removed. Not sending XI events from CP/CK means we don't have to worry about
supporting device grabs and core grabs on the same device either. And we don't
have to detach SD on grabs either.
 
== Log and stat : ==

Since f0e7a792bedbf9fe9844298ac74445a8116c52aa:

Peter Hutterer (12):
  Xi: remove all new XI2 protocol requests and their handling.
  Xi: remove the GetExtensionVersion hack - don't reply with supported 
version.
  Xi: don't list attachment in ListInputDevices, but list all SDs.
  Xi: don't allow VCP/VCK be OpenDevice'd, but allow all SDs.
  dix: No DeviceEnterLeave events in server 1.6
  input: don't switch MDs' classes around between SDs.
  Xi: Purge XGE remainders, we don't have any XGE events anymore.
  dix: Don't deliver XI events from MDs.
  dix: don't detach SDs during grabs.
  Require inputproto 1.5
  xkb: Extra sanity checks to prevent dev-key == NULL dereferencing.
  xkb: don't attempt to filter events for devices without key classes.

diffstat:
 Xi/chdevcur.c  |  111 ---
 Xi/chdevcur.h  |   39 --
 Xi/chdevhier.c |  305 -
 Xi/chdevhier.h |   42 ---
 Xi/extgrbdev.c |  216 -
 Xi/extgrbdev.h |   43 ---
 Xi/getcptr.c   |  108 --
 Xi/getcptr.h   |   43 ---
 Xi/querydp.c   |  168 -
 Xi/querydp.h   |   44 ---
 Xi/setcptr.c   |  103 -
 Xi/setcptr.h   |   36 --
 Xi/warpdevp.c  |  175 --
 Xi/warpdevp.h  |   39 --
 Xi/xiselev.c   |   81 --
 Xi/xiselev.h   |   40 --
 b/Xi/Makefile.am   |   18 ---
 b/Xi/exevents.c|   49 
 b/Xi/extinit.c |  171 -
 b/Xi/getvers.c |   13 --
 b/Xi/listdev.c |   34 -
 b/Xi/opendev.c |   11 -
 b/configure.ac |2 
 b/dix/devices.c|   20 ---
 b/dix/enterleave.c |   36 --
 b/dix/events.c |  202 +++
 b/dix/getevents.c  |   44 ---
 b/mi/mieq.c|   11 -
 b/xkb/xkbEvents.c  |   33 -
 29 files changed, 55 insertions(+), 2182 deletions(-)

Cheers,
   Peter

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 02/12] Xi: remove the GetExtensionVersion hack - don't reply with supported version.

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

XI2 abuses the GEV request to reply with the min/major version of the
supported extension if the length for the name is 0. Don't do that, yet.

Signed-off-by: Peter Hutterer [EMAIL PROTECTED]
---
 Xi/getvers.c |   13 -
 1 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/Xi/getvers.c b/Xi/getvers.c
index 43a1a4d..88ff199 100644
--- a/Xi/getvers.c
+++ b/Xi/getvers.c
@@ -105,19 +105,6 @@ ProcXGetExtensionVersion(ClientPtr client)
 
 pXIClient = dixLookupPrivate(client-devPrivates, XIClientPrivateKey);
 
-/* GetExtensionVersionReq before XI 2 didn't supply the client's
- * major/minor. So we don't actually have a clue what they support.
- * {major|minor}Version was added as part of XI, so if they are set, we
- * know we can trust it. In this case the client must set nbytes to 0
- * though, otherwise we have to assume that the version are padding
- * garbage.
- */
-if (!stuff-nbytes) /* Client using XQueryInputVersion(). */
-{
-pXIClient-major_version = stuff-majorVersion;
-pXIClient-minor_version = stuff-minorVersion;
-} /* else version unknown, leave it at 0.0 */
-
 rep.repType = X_Reply;
 rep.RepType = X_GetExtensionVersion;
 rep.length = 0;
-- 
1.6.0.3

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 03/12] Xi: don't list attachment in ListInputDevices, but list all SDs.

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

In XI2, we only list the VCP and the VCK as well as floating SDs to non-XI2
clients. This is not the case here, we just list all devices.

Signed-off-by: Peter Hutterer [EMAIL PROTECTED]
---
 Xi/listdev.c |   34 --
 1 files changed, 0 insertions(+), 34 deletions(-)

diff --git a/Xi/listdev.c b/Xi/listdev.c
index ce549da..56ba2f6 100644
--- a/Xi/listdev.c
+++ b/Xi/listdev.c
@@ -187,10 +187,6 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int 
num_classes,
 dev-use = IsXExtensionPointer;
 else
dev-use = IsXExtensionDevice;
-if (!d-isMaster)
-dev-attached = (d-u.master) ? d-u.master-id : IsFloating;
-else
-dev-attached = GetPairedDevice(d)-id;
 
 if (client-swapped) {
swapl(dev-type, n);   /* macro - braces are required */
@@ -348,16 +344,6 @@ ProcXListInputDevices(ClientPtr client)
 AddOtherInputDevices();
 
 for (d = inputInfo.devices; d; d = d-next) {
-if (pXIClient-major_version  XI_2_Major)
-{
-if (d-isMaster 
-d != inputInfo.pointer 
-d != inputInfo.keyboard)
-continue; /* don't send master devices other than VCP/VCK */
-
-if (!d-isMaster  d-u.master)
-continue; /* don't send attached SDs */
-}
 rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
 if (rc != Success)
 return rc;
@@ -366,11 +352,6 @@ ProcXListInputDevices(ClientPtr client)
 }
 
 for (d = inputInfo.off_devices; d; d = d-next) {
-if (pXIClient-major_version  XI_2_Major 
-!d-isMaster 
-d-u.master) /* XXX can off_devices be attached? */
-continue; /* don't send attached SDs */
-
 rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
 if (rc != Success)
 return rc;
@@ -387,26 +368,11 @@ ProcXListInputDevices(ClientPtr client)
 dev = (xDeviceInfoPtr) devbuf;
 for (d = inputInfo.devices; d; d = d-next)
 {
-if (pXIClient-major_version  XI_2_Major)
-{
-if (d-isMaster 
-d != inputInfo.pointer 
-d != inputInfo.keyboard)
-continue; /* don't count master devices other than VCP/VCK */
-
-if (!d-isMaster  d-u.master)
-continue; /* don't count attached SDs */
-}
 ListDeviceInfo(client, d, dev++, devbuf, classbuf, namebuf);
 }
 
 for (d = inputInfo.off_devices; d; d = d-next)
 {
-if (pXIClient-major_version  XI_2_Major 
-!d-isMaster 
-d-u.master) /* XXX can off_devices be attached? */
-continue; /* don't send attached SDs */
-
 ListDeviceInfo(client, d, dev++, devbuf, classbuf, namebuf);
 }
 rep.ndevices = numdevs;
-- 
1.6.0.3

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 05/12] dix: No DeviceEnterLeave events in server 1.6

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

---
 Xi/exevents.c|4 ---
 Xi/extinit.c |   41 --
 dix/enterleave.c |   36 --
 dix/events.c |   73 --
 xkb/xkbEvents.c  |4 ---
 5 files changed, 0 insertions(+), 158 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index c520c7d..fbd03aa 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -122,8 +122,6 @@ IsPointerEvent(xEvent* xE)
 if (xE-u.u.type == DeviceButtonPress ||
 xE-u.u.type == DeviceButtonRelease ||
 xE-u.u.type == DeviceMotionNotify ||
-xE-u.u.type == DeviceEnterNotify ||
-xE-u.u.type == DeviceLeaveNotify ||
 xE-u.u.type == ProximityIn ||
 xE-u.u.type == ProximityOut)
 {
@@ -145,8 +143,6 @@ XIGetDevice(xEvent* xE)
 if (xE-u.u.type == DeviceButtonPress ||
 xE-u.u.type == DeviceButtonRelease ||
 xE-u.u.type == DeviceMotionNotify ||
-xE-u.u.type == DeviceEnterNotify ||
-xE-u.u.type == DeviceLeaveNotify ||
 xE-u.u.type == ProximityIn ||
 xE-u.u.type == ProximityOut ||
 xE-u.u.type == DevicePropertyNotify)
diff --git a/Xi/extinit.c b/Xi/extinit.c
index d167b76..df71ae2 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -274,8 +274,6 @@ Mask DeviceButtonGrabMask;
 Mask DeviceButtonMotionMask;
 Mask DevicePresenceNotifyMask;
 Mask DevicePropertyNotifyMask;
-Mask DeviceEnterWindowMask;
-Mask DeviceLeaveWindowMask;
 
 int DeviceValuator;
 int DeviceKeyPress;
@@ -294,8 +292,6 @@ int DeviceMappingNotify;
 int ChangeDeviceNotify;
 int DevicePresenceNotify;
 int DevicePropertyNotify;
-int DeviceEnterNotify;
-int DeviceLeaveNotify;
 
 int RT_INPUTCLIENT;
 
@@ -563,23 +559,6 @@ SDevicePropertyNotifyEvent (devicePropertyNotify *from, 
devicePropertyNotify *to
 }
 
 static void
-SDeviceLeaveNotifyEvent (deviceLeaveNotify *from, deviceLeaveNotify *to)
-{
-char n;
-
-*to = *from;
-swaps(to-sequenceNumber,n);
-swapl(to-time, n);
-swapl(to-root, n);
-swapl(to-event, n);
-swapl(to-child, n);
-swaps(to-rootX, n);
-swaps(to-rootY, n);
-swaps(to-eventX, n);
-swaps(to-eventY, n);
-}
-
-static void
 SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
deviceClassesChangedEvent* to)
 {
@@ -750,8 +729,6 @@ FixExtensionEvents(ExtensionEntry * extEntry)
 DeviceButtonStateNotify = DeviceKeyStateNotify + 1;
 DevicePresenceNotify = DeviceButtonStateNotify + 1;
 DevicePropertyNotify = DevicePresenceNotify + 1;
-DeviceEnterNotify = DevicePropertyNotify + 1;
-DeviceLeaveNotify = DeviceEnterNotify + 1;
 
 event_base[KeyClass] = DeviceKeyPress;
 event_base[ButtonClass] = DeviceButtonPress;
@@ -843,14 +820,6 @@ FixExtensionEvents(ExtensionEntry * extEntry)
 DevicePropertyNotifyMask = GetNextExtEventMask();
 SetMaskForExtEvent(DevicePropertyNotifyMask, DevicePropertyNotify);
 
-DeviceEnterWindowMask = GetNextExtEventMask();
-SetMaskForExtEvent(DeviceEnterWindowMask, DeviceEnterNotify);
-AllowPropagateSuppress(DeviceEnterWindowMask);
-
-DeviceLeaveWindowMask = GetNextExtEventMask();
-SetMaskForExtEvent(DeviceLeaveWindowMask, DeviceLeaveNotify);
-AllowPropagateSuppress(DeviceLeaveWindowMask);
-
 SetEventInfo(0, _noExtensionEvent);
 }
 
@@ -897,8 +866,6 @@ RestoreExtensionEvents(void)
 DeviceButtonStateNotify = 13;
 DevicePresenceNotify = 14;
 DevicePropertyNotify = 15;
-DeviceEnterNotify = 16;
-DeviceLeaveNotify = 17;
 
 BadDevice = 0;
 BadEvent = 1;
@@ -938,8 +905,6 @@ IResetProc(ExtensionEntry * unused)
 EventSwapVector[ChangeDeviceNotify] = NotImplemented;
 EventSwapVector[DevicePresenceNotify] = NotImplemented;
 EventSwapVector[DevicePropertyNotify] = NotImplemented;
-EventSwapVector[DeviceEnterNotify] = NotImplemented;
-EventSwapVector[DeviceLeaveNotify] = NotImplemented;
 RestoreExtensionEvents();
 }
 
@@ -1043,10 +1008,6 @@ SEventIDispatch(xEvent * from, xEvent * to)
DO_SWAP(SDevicePresenceNotifyEvent, devicePresenceNotify);
 else if (type == DevicePropertyNotify)
DO_SWAP(SDevicePropertyNotifyEvent, devicePropertyNotify);
-else if (type == DeviceEnterNotify)
-DO_SWAP(SDeviceLeaveNotifyEvent, deviceEnterNotify);
-else if (type == DeviceLeaveNotify)
-DO_SWAP(SDeviceLeaveNotifyEvent, deviceLeaveNotify);
 else {
FatalError(XInputExtension: Impossible event!\n);
 }
@@ -1133,8 +1094,6 @@ XInputExtensionInit(void)
EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
EventSwapVector[DevicePresenceNotify] = SEventIDispatch;
-   EventSwapVector[DeviceEnterNotify] = SEventIDispatch;
-   EventSwapVector[DeviceLeaveNotify] = SEventIDispatch;
 
 /* init GE 

[PATCH 04/12] Xi: don't allow VCP/VCK be OpenDevice'd, but allow all SDs.

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

Reverting to traditional XI behaviour.
---
 Xi/opendev.c |   11 ++-
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/Xi/opendev.c b/Xi/opendev.c
index c51bb7e..8d24927 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -99,7 +99,6 @@ ProcXOpenDevice(ClientPtr client)
 int status = Success;
 xOpenDeviceReply rep;
 DeviceIntPtr dev;
-XIClientPtr pXIClient;
 
 REQUEST(xOpenDeviceReq);
 REQUEST_SIZE_MATCH(xOpenDeviceReq);
@@ -115,14 +114,8 @@ ProcXOpenDevice(ClientPtr client)
 } else if (status != Success)
return status;
 
-/* Don't let XI 1.x clients open devices other than floating SDs. */
-pXIClient = dixLookupPrivate(client-devPrivates, XIClientPrivateKey);
-if (pXIClient-major_version  XI_2_Major)
-{
-if (dev-isMaster || (!dev-isMaster  dev-u.master))
-return BadDevice;
-}
-
+if (dev-isMaster)
+return BadDevice;
 
 OpenInputDevice(dev, client, status);
 if (status != Success)
-- 
1.6.0.3

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 06/12] input: don't switch MDs' classes around between SDs.

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

Server 1.6 uses the X Input 1.x input model, where the core devices (VCP and
VCK) do not generate XI events. They don't have to swap device classes but
instead stay at the default number of classes at all times.
This means we can get rid of the DeviceClassesChangedEvents as well.
---
 Xi/exevents.c   |   45 -
 Xi/extinit.c|   52 
 dix/devices.c   |   20 
 dix/getevents.c |   44 
 mi/mieq.c   |   11 +++
 5 files changed, 3 insertions(+), 169 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index fbd03aa..00a6b21 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -738,41 +738,6 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
 }
 }
 
-/**
- * Change MD to look like SD by copying all classes over. An event is sent to
- * all interested clients.
- * @param device The slave device
- * @param dcce Pointer to the event struct.
- */
-static void
-ChangeMasterDeviceClasses(DeviceIntPtr device,
-  deviceClassesChangedEvent *dcce)
-{
-DeviceIntPtr master = device-u.master;
-char* classbuff;
-
-if (device-isMaster)
-return;
-
-if (!master) /* if device was set floating between SIGIO and now */
-return;
-
-dcce-deviceid = master-id;
-dcce-num_classes  = 0;
-
-master-public.devicePrivate = device-public.devicePrivate;
-
-DeepCopyDeviceClasses(device, master);
-
-/* event is already correct size, see comment in GetPointerEvents */
-classbuff = (char*)dcce[1];
-
-/* we don't actually swap if there's a NullClient, swapping is done
- * later when event is delivered. */
-CopySwapClasses(NullClient, master, dcce-num_classes, classbuff);
-SendEventToAllWindows(master, XI_DeviceClassesChangedMask,
-  (xEvent*)dcce, 1);
-}
 
 /**
  * Update the device state according to the data in the event.
@@ -800,16 +765,6 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int 
count)
 CARD16 modifiers= 0,
mask = 0;
 
-/* This event is always the first we get, before the actual events with
- * the data. However, the way how the DDX is set up, device will
- * actually be the slave device that caused the event.
- */
-if (GEIsType(xE, IReqCode, XI_DeviceClassesChangedNotify))
-{
-ChangeMasterDeviceClasses(device, (deviceClassesChangedEvent*)xE);
-return DONT_PROCESS; /* event has been sent already */
-}
-
 /* currently no other generic event modifies the device */
 if (xE-u.u.type == GenericEvent)
 return DEFAULT;
diff --git a/Xi/extinit.c b/Xi/extinit.c
index df71ae2..0ec5342 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -126,7 +126,6 @@ Mask ExtExclusiveMasks[EMASKSIZE];
  * Evtype is index, mask is value at index.
  */
 static Mask xi_filters[4] = {
-XI_DeviceClassesChangedMask
 };
 
 static struct dev_type
@@ -558,53 +557,6 @@ SDevicePropertyNotifyEvent (devicePropertyNotify *from, 
devicePropertyNotify *to
 swapl(to-atom, n);
 }
 
-static void
-SDeviceClassesChangedEvent(deviceClassesChangedEvent* from,
-   deviceClassesChangedEvent* to)
-{
-char n;
-int i, j;
-xAnyClassPtr any;
-
-*to = *from;
-memcpy(to[1], from[1], from-length * 4);
-
-swaps(to-sequenceNumber, n);
-swapl(to-length, n);
-swapl(to-time, n);
-   
-/* now swap the actual classes */
-any = (xAnyClassPtr)to[1];
-for (i = 0; i  to-num_classes; i++)
-{
-switch(any-class)
-{
-case KeyClass:
-swaps(((xKeyInfoPtr)any)-num_keys, n);
-break;
-case ButtonClass:
-swaps(((xButtonInfoPtr)any)-num_buttons, n);
-break;
-case ValuatorClass:
-{
-xValuatorInfoPtr v = (xValuatorInfoPtr)any;
-xAxisInfoPtr a = (xAxisInfoPtr)v[1];
-
-swapl(v-motion_buffer_size, n);
-for (j = 0; j  v-num_axes; j++)
-{
-swapl(a-min_value, n);
-swapl(a-max_value, n);
-swapl(a-resolution, n);
-a++;
-}
-}
-break;
-}
-any = (xAnyClassPtr)((char*)any + any-length);
-}
-}
-
 /**
  *
  * Allow the specified event to have its propagation suppressed.
@@ -1026,10 +978,6 @@ XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
 swaps(from-sequenceNumber, n);
 switch(from-evtype)
 {
-case XI_DeviceClassesChangedNotify:
-SDeviceClassesChangedEvent((deviceClassesChangedEvent*)from,
- 

[PATCH 08/12] dix: Don't deliver XI events from MDs.

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

Restore the XI 1.x event model: VCP/VCK deliver core events only, SDs device
events only.

Signed-off-by: Peter Hutterer [EMAIL PROTECTED]
---
 dix/events.c |   62 ++---
 1 files changed, 20 insertions(+), 42 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index d1dc8ed..b024d9e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2404,31 +2404,29 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr 
grab,
 
 while (pWin  type != GenericEvent)
 {
-/* First try XI event delivery */
-inputMasks = wOtherInputMasks(pWin);
-if (inputMasks  (filter  inputMasks-deliverableEvents[mskidx]))
+if (!dev-isMaster)
 {
-
-if (inputMasks  (inputMasks-inputEvents[mskidx]  filter))
+inputMasks = wOtherInputMasks(pWin);
+if (inputMasks  (filter  inputMasks-deliverableEvents[mskidx]))
 {
-FixUpEventFromWindow(dev, xE, pWin, child, FALSE);
-deliveries = DeliverEventsToWindow(dev, pWin, xE, count,
-   filter, grab, mskidx);
-if (deliveries  0)
-return deliveries;
-}
 
-if ((deliveries  0) ||
-(pWin == stopAt) ||
-(inputMasks 
- (filter  inputMasks-dontPropagateMask[mskidx])))
-return 0;
-}
+if (inputMasks  (inputMasks-inputEvents[mskidx]  filter))
+{
+FixUpEventFromWindow(dev, xE, pWin, child, FALSE);
+deliveries = DeliverEventsToWindow(dev, pWin, xE, count,
+filter, grab, mskidx);
+if (deliveries  0)
+return deliveries;
+}
 
-if (dev-isMaster  dev-coreEvents)
+if ((deliveries  0) ||
+(pWin == stopAt) ||
+(inputMasks 
+ (filter  inputMasks-dontPropagateMask[mskidx])))
+return 0;
+}
+} else
 {
-
-/* no XI event delivered. Try core event */
 core = *xE;
 core.u.u.type = XItoCoreType(xE-u.u.type);
 
@@ -3621,28 +3619,10 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
 }
 if (!deliveries)
 {
-if (xE-u.u.type == GenericEvent)
-{
-/* find evmask for event's extension */
-xGenericEvent* ge = ((xGenericEvent*)xE);
-GenericMaskPtrgemask = grab-genericMasks;
-
-if (!gemask || !gemask-eventMask[GEEXTIDX(ge)])
-return;
-
-if (GEEventFill(xE))
-GEEventFill(xE)(ge, thisDev, grab-window, grab);
-deliveries = TryClientEvents(rClient(grab), thisDev, xE,
-count, gemask-eventMask[GEEXTIDX(ge)],
-generic_filters[GEEXTIDX(ge)][ge-evtype],
-grab);
-} else
 {
 Mask mask = grab-eventMask;
 
-sendCore = (thisDev-isMaster  thisDev-coreEvents);
-/* try core event */
-if (sendCore  grab-coreGrab)
+if (thisDev-isMaster)
 {
 core = *xE;
 core.u.u.type = XItoCoreType(xE-u.u.type);
@@ -3663,9 +3643,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
 grab);
 }
 }
-}
-
-if (!deliveries)
+} else
 {
 /* try XI event */
 if (grabinfo-fromPassiveGrab  
-- 
1.6.0.3

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 07/12] Xi: Purge XGE remainders, we don't have any XGE events anymore.

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

---
 Xi/extinit.c |   37 -
 1 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 0ec5342..51e0200 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -120,14 +120,6 @@ int ExtEventIndex;
 Mask ExtValidMasks[EMASKSIZE];
 Mask ExtExclusiveMasks[EMASKSIZE];
 
-
-/**
- * Filters for various generic events.
- * Evtype is index, mask is value at index.
- */
-static Mask xi_filters[4] = {
-};
-
 static struct dev_type
 {
 Atom type;
@@ -965,32 +957,6 @@ SEventIDispatch(xEvent * from, xEvent * to)
 }
 }
 
-/
- *
- * EventSwap for generic events coming from the GE extension.
- */
-
-static void
-XIGEEventSwap(xGenericEvent* from, xGenericEvent* to)
-{
-int n;
-
-swaps(from-sequenceNumber, n);
-switch(from-evtype)
-{
-}
-}
-
-/**
- * EventFill to fill various fields for events before they are delivered to
- * the client.
- */
-static void
-XIGEEventFill(xGenericEvent* ev, DeviceIntPtr pDev,
-  WindowPtr pWin, GrabPtr grab)
-{
-}
-
 /**
  *
  * IExtensionInit - initialize the input extension.
@@ -1043,9 +1009,6 @@ XInputExtensionInit(void)
EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
EventSwapVector[DevicePresenceNotify] = SEventIDispatch;
 
-/* init GE events */
-GERegisterExtension(IReqCode, XIGEEventSwap, XIGEEventFill);
-SetGenericFilter(IReqCode, xi_filters);
 } else {
FatalError(IExtensionInit: AddExtensions failed\n);
 }
-- 
1.6.0.3

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 09/12] dix: don't detach SDs during grabs.

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

---
 dix/events.c |   67 --
 1 files changed, 0 insertions(+), 67 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index b024d9e..d7618c2 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1466,51 +1466,6 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, 
Bool otherMode)
 ComputeFreezes();
 }
 
-/* Only ever used if a grab is called on an attached slave device. */
-static int GrabPrivateKeyIndex;
-static DevPrivateKey GrabPrivateKey = GrabPrivateKeyIndex;
-typedef struct _GrabMemoryRec {
-DeviceIntPtr oldmaster;
-} GrabMemoryRec, *GrabMemoryPtr;
-
-/**
- * Save the device's master device in the devPrivates. This needs to be done
- * if a client directly grabs a slave device that is attached to a master. For
- * the duration of the grab, the device is detached, ungrabbing re-attaches it
- * though.
- */
-static void
-SaveOldMaster(DeviceIntPtr dev)
-{
-GrabMemoryPtr gm;
-
-if (!(gm = xalloc(sizeof(GrabMemoryRec
-{
-ErrorF([dix] Cannot allocate grab private. Grab not 
-possible on device.\n);
-return;
-}
-gm-oldmaster = dev-u.master;
-dixSetPrivate(dev-devPrivates, GrabPrivateKey, gm);
-}
-
-static void
-RestoreOldMaster(DeviceIntPtr dev)
-{
-GrabMemoryPtr gm;
-
-if (dev-isMaster)
-return;
-
-gm = (GrabMemoryPtr)dixLookupPrivate(dev-devPrivates, GrabPrivateKey);
-if (gm)
-{
-dev-u.master = gm-oldmaster;
-xfree(gm);
-dixSetPrivate(dev-devPrivates, GrabPrivateKey, NULL);
-}
-}
-
 /**
  * Activate a pointer grab on the given device. A pointer grab will cause all
  * core pointer events of this device to be delivered to the grabbing client 
only.
@@ -1536,13 +1491,6 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
 : mouse-spriteInfo-sprite-win;
 Bool isPassive = autoGrab  ~ImplicitGrabMask;
 
-/* slave devices need to float for the duration of the grab. */
-if (!isPassive  !mouse-isMaster)
-{
-SaveOldMaster(mouse);
-AttachDevice(NULL, mouse, NULL);
-}
-
 if (grab-confineTo)
 {
if (grab-confineTo-drawable.pScreen
@@ -1577,7 +1525,6 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
 {
 GrabPtr grab = mouse-deviceGrab.grab;
 DeviceIntPtr dev;
-Bool  wasPassive= mouse-deviceGrab.fromPassiveGrab;
 
 mouse-valuator-motionHintWindow = NullWindow;
 mouse-deviceGrab.grab = NullGrab;
@@ -1604,9 +1551,6 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
 if (grab-cursor)
FreeCursor(grab-cursor, (Cursor)0);
 
-if (!wasPassive)
-RestoreOldMaster(mouse);
-
 ComputeFreezes();
 }
 
@@ -1621,13 +1565,6 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, 
TimeStamp time, Bool pass
 GrabInfoPtr grabinfo = keybd-deviceGrab;
 WindowPtr oldWin;
 
-/* slave devices need to float for the duration of the grab. */
-if (!passive  !keybd-isMaster)
-{
-SaveOldMaster(keybd);
-AttachDevice(NULL, keybd, NULL);
-}
-
 if (grabinfo-grab)
oldWin = grabinfo-grab-window;
 else if (keybd-focus)
@@ -1659,7 +1596,6 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
 DeviceIntPtr dev;
 WindowPtr focusWin = keybd-focus ? keybd-focus-win
: keybd-spriteInfo-sprite-win;
-Bool wasPassive = keybd-deviceGrab.fromPassiveGrab;
 
 if (focusWin == FollowKeyboardWin)
focusWin = inputInfo.keyboard-focus-win;
@@ -1681,9 +1617,6 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
 }
 DoFocusEvents(keybd, grab-window, focusWin, NotifyUngrab);
 
-if (!wasPassive)
-RestoreOldMaster(keybd);
-
 ComputeFreezes();
 }
 
-- 
1.6.0.3

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 11/12] xkb: Extra sanity checks to prevent dev-key == NULL dereferencing.

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

---
 xkb/xkbEvents.c |   19 +++
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/xkb/xkbEvents.c b/xkb/xkbEvents.c
index 67bd674..9d8ec0d 100644
--- a/xkb/xkbEvents.c
+++ b/xkb/xkbEvents.c
@@ -110,7 +110,7 @@ Timetime;
 register CARD16changed,bState;
 
 interest = kbd-xkb_interest;
-if (!interest)
+if (!interest || !kbd-key || !kbd-key-xkbInfo)
return;
 xkbi = kbd-key-xkbInfo;
 state= xkbi-state;
@@ -169,6 +169,9 @@ XkbSrvInfoPtr   xkbi;
 unsigned   time = 0,initialized;
 CARD16 changed;
 
+if (!kbd-key || !kbd-key-xkbInfo)
+return;
+
 xkbi = kbd-key-xkbInfo;
 initialized= 0;
 
@@ -292,7 +295,7 @@ XkbInterestPtr  interest;
 Time   time = 0;
 
 interest = kbd-xkb_interest;
-if (!interest)
+if (!interest || !kbd-key || !kbd-key-xkbInfo)
return;
 xkbi = kbd-key-xkbInfo;
  
@@ -402,6 +405,9 @@ CARD16  pitch,duration;
 Time   time = 0;
 XIDwinID = 0;
 
+if (!kbd-key || !kbd-key-xkbInfo)
+return;
+
 xkbi = kbd-key-xkbInfo;
 
 if ((force||(xkbi-desc-ctrls-enabled_ctrlsXkbAudibleBellMask))
@@ -617,11 +623,12 @@ XkbSrvInfoPtr  xkbi;
 XkbInterestPtr  interest;
 Timetime = 0;
 
-xkbi = kbd-key-xkbInfo;
 interest = kbd-xkb_interest;
-if (!interest)
+if (!interest || !kbd-key || !kbd-key-xkbInfo)
return;
  
+xkbi = kbd-key-xkbInfo;
+
 initialized = 0;
 pEv-mods= xkbi-state.mods;
 pEv-group= xkbi-state.group;
@@ -1004,6 +1011,10 @@ unsigned longautoCtrls,autoValues;
 ClientPtr  client = NULL;
 
 found= False;
+
+if (!dev-key || !dev-key-xkbInfo)
+return found;
+
 autoCtrls= autoValues= 0;
 if ( dev-xkb_interest ) {
interest = dev-xkb_interest;
-- 
1.6.0.3

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


[PATCH 10/12] Require inputproto 1.5

2008-11-27 Thread Peter Hutterer
From: Peter Hutterer [EMAIL PROTECTED]

Also claim to now support XI 1.5.

Signed-off-by: Peter Hutterer [EMAIL PROTECTED]
---
 Xi/extinit.c |4 ++--
 configure.ac |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 51e0200..14eb3cb 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -307,8 +307,8 @@ static int XIClientPrivateKeyIndex;
 DevPrivateKey XIClientPrivateKey = XIClientPrivateKeyIndex;
 
 static XExtensionVersion thisversion = { XI_Present,
-XI_2_Major,
-XI_2_Minor
+XI_Add_DeviceProperties_Major,
+XI_Add_DeviceProperties_Minor
 };
 
 
diff --git a/configure.ac b/configure.ac
index cfc0d42..8a02f27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -664,7 +664,7 @@ XEXT_LIB='$(top_builddir)/Xext/libXext.la'
 XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
 
 dnl Core modules for most extensions, et al.
-REQUIRED_MODULES=[randrproto = 1.2.99.1] [renderproto = 0.9.3] [fixesproto 
= 4.0] [damageproto = 1.1] xcmiscproto [xextproto = 7.0.3] [xproto = 
7.0.13] [xtrans = 1.2.2] bigreqsproto resourceproto fontsproto [inputproto = 
1.9.99.6] [kbproto = 1.0.3]
+REQUIRED_MODULES=[randrproto = 1.2.99.1] [renderproto = 0.9.3] [fixesproto 
= 4.0] [damageproto = 1.1] xcmiscproto [xextproto = 7.0.3] [xproto = 
7.0.13] [xtrans = 1.2.2] bigreqsproto resourceproto fontsproto [inputproto = 
1.5] [kbproto = 1.0.3]
 REQUIRED_LIBS=xfont xau fontenc [pixman-1 = 0.13.2]
 
 dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
-- 
1.6.0.3

___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg