Skip to content
Snippets Groups Projects
  1. Aug 01, 2014
  2. Jul 28, 2014
  3. Jul 12, 2014
  4. Jun 14, 2014
  5. Jun 10, 2014
  6. Apr 10, 2014
  7. Mar 30, 2014
    • Keith Packard's avatar
      Ensure xcb owns socket and no other threads are writing before send_request · be0fe56c
      Keith Packard authored and Uli Schlachter's avatar Uli Schlachter committed
      
      send_request may only write to out.queue if no other thread is busy
      writing to the network (as that thread may be writing from out.queue).
      
      send_request may only allocate request sequence numbers if XCB owns
      the socket.
      
      Therefore, send_request must make sure that both conditions are true
      when it holds iolock, which can only be done by looping until both
      conditions are true without having dropped the lock waiting for the
      second condition.
      
      We choose to get the socket back from Xlib first as get_socket_back
      has a complicated test and checking for other threads writing is a
      simple in-lined check.
      
      This also changes the sequence number checks (64k requests with no
      reply, 4M request wrapping) to ensure that both conditions are true
      before queueing the request.
      
      Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: default avatarUli Schlachter <psychon@znc.in>
      be0fe56c
  8. Mar 22, 2014
  9. Mar 21, 2014
  10. Feb 19, 2014
    • Ran Benita's avatar
      Add comments about how _xcb_conn_ret_error() works · 4ffa6f83
      Ran Benita authored and Uli Schlachter's avatar Uli Schlachter committed
      
      If xcb_connect() fails, it doesn't return NULL. Instead, it always
      returns an xcb_connection_t*, and the user should check for errors with
      the xcb_connection_has_error() function. What this function does is
      check if conn->has_error contains a non-zero error code, and returns it.
      
      If an error did occur, xcb doesn't actually return a full
      xcb_connection_t though, it just returns (xcb_connection_t *)
      error_code. Since the 'has_error' field is the first, it is still
      possible to check conn->has_error.
      
      That last trick was not immediately obvious to me, so add some guiding
      comments. This also ensures no one obliviously rearranges the struct.
      
      Signed-off-by: default avatarRan Benita <ran234@gmail.com>
      Signed-off-by: default avatarUli Schlachter <psychon@znc.in>
      4ffa6f83
  11. Jan 30, 2014
  12. Jan 21, 2014
  13. Jan 03, 2014
    • Kenneth Graunke's avatar
      Force XCB event structures with 64-bit extended fields to be packed. · 3b72a2c9
      Kenneth Graunke authored and Alan Coopersmith's avatar Alan Coopersmith committed
      
      With the advent of the Present extension, some events (such as
      PresentCompleteNotify) now use native 64-bit types on the wire.
      
      For XGE events, we insert an extra "uint32_t full_sequence" field
      immediately after the first 32 bytes of data.  Normally, this causes
      the subsequent fields to be shifted over by 4 bytes, and the structure
      to grow in size by 4 bytes.  Everything works fine.
      
      However, if event contains 64-bit extended fields, this may result in
      the compiler adding an extra 4 bytes of padding so that those fields
      remain aligned on 64-bit boundaries.  This causes the structure to grow
      by 8 bytes, not 4.  Unfortunately, XCB doesn't realize this, and
      always believes that the length only increased by 4.  read_packet()
      then fails to malloc enough memory to hold the event, and the event
      processing code uses the wrong offsets.
      
      To fix this, mark any event structures containing 64-bit extended
      fields with __attribute__((__packed__)).
      
      v2: Use any(...) instead of True in (...), as suggested by
          Daniel Martin.
      
      v3 (Alan Coopersmith): Fix build with Solaris Studio 12.3 by moving the
      attribute to after the structure definition.
      
      Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
      Reviewed-by: Keith Packard <keithp@keithp.com> [v1]
      Reviewed-by: Josh Triplett <josh@joshtriplett.org> [v1]
      Reviewed-by: default avatarDaniel Martin <consume.noise@gmail.com>
      Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      3b72a2c9
  14. Dec 22, 2013
  15. Dec 14, 2013
Loading