XGE protocol spec

Peter Hutterer peter.hutterer at who-t.net
Sat Dec 6 16:45:28 PST 2008


On Fri, Dec 05, 2008 at 04:22:40PM -0500, Jim Gettys wrote:
> A couple comments below.
> 
> On Mon, 2008-12-01 at 16:15 +1000, Peter Hutterer wrote:
> > Below is the protocol spec for the X Generic Event Extension (XGE). It'll be
> > shipped with 1.6 even though there won't be any consumers for it yet.
> > (This is the current proto/xextproto/geproto.txt file as valid in my tree. Will
> > be pushed pending no objections.)
> > 
> > Cheers,
> >   Peter
> > 
> >                          X Generic Event Extension
> >                               Peter Hutterer
> >                           peter.hutterer at who-t.net
> > 
> > 
> > 1. Introduction
> > 2. Extension Initialization
> > 3. Extension Events
> > 4. Notes
> > 
> > _____________________________________________________________________________
> > 1. Introduction
> > 
> > X was designed to provide 64 event opcodes for all extensions. These events
> > are limited to 32 bytes.
> > 
> > The Generic Event Extension is a template for extensions to re-use a single
> > event opcode. GE only provide headers and the most basic functionality,
> > leaving the extensions to interpret the events in their specific context.
> > 
> > GenericEvents may be longer than 32 bytes. If so, the number of 4 byte units
> > following the initial 32 bytes must be specified in the length field of the
> > event.
> 
> 1.1 History and Rationale
> 
> The original rationale for X11's fixed event size was that certain
> platforms (notably VAX/VMS) had very poor malloc and free C library
> implementations with terrible performance (both CPU and memory usage).
> Malloc's memory usage with the then common Berkeley 4.2 allocator tended
> to be profligate in space. By using a single event size both memory
> fragmentation and performance problems were avoided. Retaining this
> restriction on modern systems would continue to complicate X's evolution
> and implementation unnecessarily.

Is this necessary? While it may be interesting for someone researching the
history of X, for an extension specification it's probably better to just
state what is the current state and what the extension provides over the
current state.

> > _____________________________________________________________________________
> > 3. Extension Events
> > 
> > GE defines a single event, to be used by all extensions. The event's structure 
> > is similar to a request.
> > 
> > ┌───
> >     RRScreenChangeNotify
> > 	type: BYTE;			always GenericEvent
> > 	extension: CARD8;		extension offset
> > 	sequenceNumber: CARD16		low 16 bits of request seq. number
> > 	length: CARD32			time screen was changed
> > 	evtype: CARD16			event type
> > └───
> > 
> 
> Do you really want to leave this only 16 bit aligned?  Would two bytes
> of padding be wise here?  I suspect we do....

it's padded out to 32 bytes, just like replies. As replies, an event with
length 0 is 32 bytes.

Cheers,
  Peter



More information about the xorg mailing list