Commit Graph

6500 Commits

Author SHA1 Message Date
Keith Packard
d6da9f23cc hw/xfree86: More const declarations for strings
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:49 -08:00
Keith Packard
644725ac5e Just remove dpms functsion from xf86.h
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:49 -08:00
Keith Packard
c85e26d599 Bunch of DMX warning fixes
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:49 -08:00
Keith Packard
493d992501 More warning fixes in hw/xfree86
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:49 -08:00
Keith Packard
c78be3a4b7 xfree86 warning reduction
This gets the easy warnings, mostly constant string problems.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:49 -08:00
Keith Packard
e1e01d2e33 xfree86/common: Warning fixes. Mostly const string handling.
Also removes DPMS functiosn from Xext/dpmsproc.h

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:48 -08:00
Keith Packard
27b44949a3 hw/xfree86: Lots of constant string support
Make lots of string pointers 'const char' so that we can use constant
strings with them without eliciting warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:48 -08:00
Keith Packard
6f77e2645e hw/xfree86: Make strings in DriverRec and ScrnInfoRec const
This avoids compiler warnings when initializing with string constants.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:48 -08:00
Peter Hutterer
e819028721 ephyr: don't allow a shift+ctrl keygrab if mod1 was enabled
Xephyr wants ctrl+shift to grab the window, but that conflicts with
ctrl+alt+shift key combos. Remember the modifier state on key presses and
releases, if mod1 is pressed, we need ctrl, shift and mod1 released
before we allow a shift-ctrl grab activation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-09 15:41:22 +10:00
Damien Lespiau
d6c8d75097 xfree86: Use the TMDS maximum frequency to prune modes
Instead of only relying on the Range section, we can do better on
HDMI to find out what is the max dot clock the monitor supports. The
HDMI CEA vendor block adds a TMDS max freq we can use.

This makes X not prune 4k resolutions on HDMI.

v2: Replace X_INFO by X_PROBED in the message that prints the max
    TMDS frequency (Chris Wilson)

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-01-07 17:24:57 +00:00
Damien Lespiau
95c2287465 xfree86: Refactor xf86MonitorIsHDMI() using xf86MonitorFindHDMIBlock()
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-01-07 17:24:51 +00:00
Damien Lespiau
a279fb3ff3 xfree86: Add a xf86MonitorFindHDMIBlock()
The HDMI CEA vendor specific block has some interesting information,
such as the maximum TMDS dot clock.

v2: Don't parse CEA blocks with invalid offsets, remove spurious
    brackets (Chris Wilson)

v3: Fix the looping through the CEA data blocks, it had a typo using the
    wrong variable coming from the code it was ported from.
    Replace x << 16 + y << 8 + z by x << 16 | y << 8 | z
    (Chris Wilson)

v4: Remove the stray ';' at the end of "if (*end == 0)".
    (Dominik Behr on IRC)

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-01-07 17:24:38 +00:00
Jeremy Huddleston Sequoia
d7c9235ee2 XQuartz: Use asl_log_descriptor to log stdout/stderr of child processes
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-12-12 01:30:04 -08:00
Jon TURNEY
9a4d7572fe hw/xwin/glx: Rewrite WGL wrappers after Xserver conversion to direct GL dispatch
v1: Rewrite by Marc Haesen of the WGL wrapper function generation script to use
Khronos group XML.

v2: Remove -dispatchheader option, since dispatch.h doesn't exist anymore, use
the private glapi interface to construct the GL dispatch table for the native
WGL thunks.

v3:
Rewrite to generate shims for the OpenGL 1.2.1 (GL 1.2 + GL_ARB_imaging
+GL_ARB_multitexture + GL_ARB_texture_compression(?)) functions the server links
directly with rather than libGL.

These shims dispatch to either the mesa GL DLL, or a thunking DLL containing
cdecl-to-stcall wrapper functions for the native GL DLL.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-10 17:00:06 +00:00
Jon TURNEY
1a021f57a1 ephyr: Fix compilation when ./configure'd with --enable-debug
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessMouseMotion’:
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:946:188: error: ‘ephyrCurScreen’ undeclared (first use in this function)
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessButtonPress’:
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:980:186: error: ‘ephyrCurScreen’ undeclared (first use in this function)
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c: In function ‘ephyrProcessButtonRelease’:
/jhbuild/checkout/xorg/xserver/hw/kdrive/ephyr/ephyr.c:1007:186: error: ‘ephyrCurScreen’ undeclared (first use in this function)

Fix ephyr compilation when ./configure'd with --enable-debug after commit
46cf6bf569, some instances of ephyrCurScreen were
not converted to screen->pScreen->myNum.

v2: Don't use a trivial local variable which will be unused when ./configure'd
with --disable-debug

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-10 16:59:40 +00:00
Adam Jackson
e61e19959d xquartz/glx: Convert to non-glapi dispatch
CGL doesn't have anything like glXGetProcAddress, and the old code just
called down to dlsym in any case.  It's a little mind-warping since
dlopening a framework actually loads multiple dylibs, but that's just
how OSX rolls.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-12-10 08:04:30 -08:00
Adam Jackson
c6d4c2a241 xfree86: Prefer fbdev to vesa
On UEFI machines you'd prefer fbdev to grab efifb instead of vesa trying
to initialize and failing in a way we can't unwind from.  On BIOS
machines this is harmless: either there is an fbdev driver and it'll
probably be more capable, or there's not and vesa will kick in anyway.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
a2b2c271e0 composite: Automatically enable backing store support on the screen
... unless you explicitly disabled it with -bs on the command line, or
with the corresponding thing in xorg.conf.

v2: Drop a bogus hunk from compChangeWindowAttributes [vsyrjala]
v3: s/TRUE/WhenMapped/ [jcristau]

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
e0cac00560 bs: Set the screen's bs support level to WhenMapped
Since we're using RedirectAutomatic to do this, we don't actually
preserve contents when unmapped.

v2: Don't say WhenMapped if Composite didn't initialize [vsyrjala]

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Adam Jackson
793fd5eefb dri2: Disable when Xinerama is active
Would only work on ScreenRec 0, which means it's broken.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-12-09 13:20:36 -05:00
Alan Coopersmith
d695cb7fb6 Xdmx: Initialize DMX extension even if not built with GLX support
dmxAddExtensions takes an argument to determine if it should just
initialize the DMX extension, or both DMX & GLX, but if GLX wasn't
compiled in, the entire call was #ifdef'ed out, leaving the DMX
extension unavailable.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-26 22:39:01 -08:00
Keith Packard
6d5883bd7e xnest: Ignore GetImage() error in xnestGetImage() (v3)
(I found an amended version of this patch and applied the difference
here - keithp)

v3: Don't call Xsync before restoring error handler as any errors
    generated by XGetImage() should be processed when this call
    returns as suggested by Jamey Sharp <jamey@minilop.net>

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2013-11-23 16:19:46 -08:00
Keith Packard
29240e5cbf Merge remote-tracking branch 'whot/for-keith' 2013-11-14 17:02:04 +09:00
Dave Airlie
d1440783a7 xfree86: return NULL for compat output if no outputs.
With outputless GPUs showing up we crash here if there are not outputs
try and recover with a bit of grace.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-14 16:35:20 +09:00
Alan Coopersmith
0ba7fc8472 Stop including inline assembly .il file for Solaris Studio builds
Since all the inb/outb/etc. use in the X server itself (except for
xf86SlowBcopy) has been replaced by calls to libpciaccess, we no
longer need to pass inline assembly files to replace the gcc inline
assembly from hw/xfree86/common/compiler.h when building Xorg itself.

The .il files are still generated and installed in the SDK for the
benefit of drivers who may use them.

Binary diff of before and after showed that xf86SlowBcopy was the
only function changed across the Xorg binary and all modules built
in the Xserver build, it just calls the outb() function now instead
of having the outb instructions inlined, making it a slightly slower
bcopy.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-14 13:12:21 +09:00
Peter Hutterer
550baf38f6 kdrive: fix cursor jumps on CursorOffScreen behavior
This patch fixes cursor jumps when there is a grab on the Xephyr window and
the pointer moves outside the window.

So on two side-by-side 640x480 screens, a coordinate of 0/481
triggers KdCursorOffscreen.

If the delta between two screens is 0, they share the same offset for
that dimension. When searching for the new screen, the loop always rules out
the current screen. So we get to the second screen, trigger the conditions
where dy <= 0 and decide that this new screen is the correct one. The result
is that whenever KdCursorOffScreen is called, the pointer jumps to the other
screen.

Change to check for dy < 0 etc. so that the cursor stays on the same screen if
there is no other screen at the target location.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-11-14 13:34:36 +10:00
Peter Hutterer
a94d945065 kdrive: modify ephyr events to use POINTER_DESKTOP and scale them to that
A multi-head Xephyr instance has the pointer stuck on one screen
because of bad coordinate calculation. The coordinates passed to
GetPointerEvents are per-screen, so the cursor gets stuck on the left-most
screen by default.

Adjust and mark the events as POINTER_DESKTOP, so the DIX
can adjust them accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-11-14 13:34:23 +10:00
Keith Packard
d66832a3b8 kdrive: handle WxH as valid geometry spec
If a screen size was specified as WxH, the loop returned early and kdOrigin
was never advanced. Thus, screen->origin was always 0 (or whatever was given
at the -origin commandline flag).

If a screen size was given with a bit depth (WxHxD), kdOrigin would always
advance by the current screen, offsetting the next screen.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-11-14 13:34:18 +10:00
Peter Hutterer
c8c5105c1d ephyr: xcb_connect returns an error, not NULL
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-11-14 13:34:10 +10:00
Jeremy Huddleston Sequoia
4a251f5883 xfree86: Fix build without libpciaccess
Regression fix from commit 04ab07ca19

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Connor Behan <connor.behan@gmail.com>
2013-11-12 14:03:37 -08:00
Alan Coopersmith
c4c154d18e Avoid conflicts with Solaris <sys/regset.h> defines that clash with our names
When building on Solaris with _XOPEN_SOURCE set to a recent XPG release,
<stdlib.h> and other core headers start including <sys/regset.h>, which
has a bunch of unfortunately named macros such as "CS", "ES", etc. for
x86 & x64 registers which clash with existing variable & struct member
names in Xorg - so #undef these so they don't interfere with our use.

(Yes, have filed a bug against the system headers for exposing these,
 but this solves the problem for building on existing releases.)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-11-12 21:03:53 +09:00
Jeremy Huddleston Sequoia
f70a8bf371 XQuartz: Don't sleep forever on exit if usleep() returns an error
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-11-10 11:40:27 -08:00
Jeremy Huddleston Sequoia
ebcc1c214c XQuartz: Update Info.plist copyright years
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-11-10 11:26:49 -08:00
Andreas Schwab
ab4b1fb38a ARM64: Add support for aarch64
Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-06 16:41:49 -08:00
Keith Packard
f348935e7d Link with xshmfence, reference miSyncShmScreenInit in sdksyms
This gets the server to link with xshmfence again, and also ensures
that the miSyncShm code is linked into the server with the reference
from sdksyms.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-05 18:37:12 -08:00
Keith Packard
903a058370 hw/xfree86: Link libdri3 only when DRI3 is defined
Don't attempt to link non-existant libraries...

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-04 19:01:26 -08:00
Egbert Eich
2aa5092b88 DDX/Randr: Avoid server crash when xrandr SetConfig is called while switched away
A call to Xrandr SetScreenConfig (for randr 1.1) causes the Xserver to
crash when xf86SetViewport() which does not check if the hardware is
accessible.
Wrap accesses to xf86SetViewport() with if (vtSema) { ... } to avoid that.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31 18:36:17 -07:00
Egbert Eich
508e05777a DDX/Events: Distinguish between Input- and GeneralHandlers in xf86VTSwitch()
When enabling/disabling input handlers in xf86VTSwitch() we treat Input-
and GeneralHandlers equally. The result is that after a VT switch the
masks for EnabledDevices and AllSockets are equal and the distiction
between both types is lost.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31 18:35:03 -07:00
Egbert Eich
0cb33ce340 DDX/modes: Add a sanity check when using screen sizes from EDID
EDID sometimes lies about screen sizes. Since the screen size is used
by clients to determine the DPI a wrong ration will lead to terrible
looking fonts.
Add a sanity check for the h/v ratio cutting off at 2.4. This would
still accept the cinemascope aspect ratio as valid.
Also add message suggesting to add a quirk table entry.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31 18:33:54 -07:00
Egbert Eich
41d4beb261 DDX/DPMS: Call dixSaveScreens() also when screen is turned on
DMPS calls dixSaveScreens() when turned off but not when turned
on. In most cases this is irrelevant as DPMS is done when a
key is hit in which case dixSaveScreens() will be called to
unblank anyhow. This isn't the case if we use xset (or the
DPMS extension directly) to unblank.
Check screenIsSaved to make sure the state needs to be changed
before calling dixSaveScreens().

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-31 18:31:18 -07:00
Søren Sandmann Pedersen
623c414765 ephyr: Ensure stride of private framebuffer is multiple of 4
The fb layer of X can't deal with strides that are not a multiple of
4, so when Xephyr allocates its own framebuffer it should make sure to
align it.

This fixes crashes and rendering corruption when Xephyr runs in a
depth that is different from the host X server and its screen size is
not a multiple of 4 / depth. (This is particularly easy to trigger if
you use the -resizeable option).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 18:24:33 -07:00
Søren Sandmann Pedersen
97cf53cc2a ephyr: hostx_screen_init(): Fix bits_per_pixel and bytes_per_line
When the depth of the Xephyr server matches that of the host X server,
Xephyr simply uses the buffer associated with the XImage as its
framebuffer. In this case, it is correct to get the bits_per_pixel and
bytes_per_line values returned from hostx_screen_init() from the XImage.

However, when the depth doesn't match the host, Xephyr uses a private
framebuffer that is periodically copied to the XImage. In this case,
the returned values of bits_per_pixel and bytes_per_line should be
those of the private framebuffer, not those of the XImage.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Soren Sandmann <ssp@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 18:24:27 -07:00
Søren Sandmann Pedersen
55246b67b7 xf86AddBusDeviceToConfigure(): Store device in DevToConfig[i].pVideo
After fc3ab84d the pVideo field in DevToConfig[i] is no longer
initialized, so it's always NULL. This causes the duplicate finding
algorithm in the beginning of the function to not work anymore as it
is based on this field.

The symptom of this bug is that X -configure reports

    Number of created screens does not match number of detected devices.
      Configuration failed.
    Server terminated with error (2). Closing log file.

rather than producing a working config file.

This patch fixes that bug by initializing the field before calling
xf86PciConfigureNewDev().

Cc: tvignatti@gmail.com
Signed-off-by: Soren Sandmann <ssp@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 18:23:03 -07:00
Keith Packard
95bf478b78 Merge remote-tracking branch 'jeremyhu/master' 2013-10-31 18:18:19 -07:00
Keith Packard
5c5c1b7798 present: Add Present extension
Provides both a software implementation using timers and driver hooks
to base everything on vblank intervals.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:59:18 -07:00
Keith Packard
5631382988 dri3: Add DRI3 extension
Adds DRM compatible fences using futexes.
Uses FD passing to get pixmaps from DRM applications.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-31 16:58:30 -07:00
Jeremy Huddleston Sequoia
bb745f2b45 XQuartz: Bump bundle version to 2.7.6
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-10-31 08:50:57 -07:00
Adam Jackson
902ff0b349 xfree86: Bump video/input/extension ABIs for 1.15
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-30 14:02:59 -07:00
Keith Packard
899451ae59 kdrive/ephyr: Don't discard one-time driver structure at server reset
KdScreenInfo is constructed at server startup time, and not
re-generated at server reset time. Freeing the 'driver' element at
reset time means this information is lost, and the server crashes
pretty quickly afterwards.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-30 09:11:56 -07:00
Michal Srb
a9ca93dcf9 randr: send RRResourceChangeNotify event
Send RRResourceChangeNotify event when provider, output or crtc was created or
destroyed. I.e. when the list of resources returned by RRGetScreenResources and
RRGetProviders changes.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-30 08:09:27 -07:00
Keith Packard
1470c0a132 Merge remote-tracking branch 'whot/for-keith' 2013-10-29 21:00:13 -07:00
Peter Hutterer
e16dea72d6 dmx: queue button events with a flags of 0
Setting POINTER_SCREEN with a unset valuator mask causes a jump to 0/0. Set
the flags to 0 so we don't generate any motion on a button event.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-10-30 07:41:20 +10:00
Connor Behan
04ab07ca19 xfree86: Find primary entity when bus types are nominally different
As of server 1.13, systems with DRM and Udev will have BUS_PLATFORM as
their primary bus type. However, drivers not implementing a
platformProbe function will still create entities of type BUS_PCI. We
need to account for this when checking for the primary entity.

Signed-off-by: Connor Behan <connor.behan@gmail.com>
Acked-by: Tormod Volden <debian.tormod@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-29 09:49:01 -07:00
Keith Packard
b32a4c91cc Merge remote-tracking branch 'idr/glx-float-fbconfig' 2013-10-29 09:37:30 -07:00
Adam Jackson
8aacf47e17 glx: Remove DRI1 AIGLX (v2)
Mesa doesn't ship DRI1 drivers as of 8.0, which is about 18 months and
three releases ago.  The main reason to have wanted DRI1 AIGLX was to
get a GLX compositor working, but DRI1's (lack of) memory management API
meant that the cost of a GLX compositor was breaking direct GLX apps,
which isn't a great tradeoff.

Of the DRI1 drivers Mesa has dropped, I believe only mga stands to lose
some functionality here, since it and only it has support for
NV_texture_rectangle.  Since that's required for every extant GLX
compositor I know of, I conclude that anybody with a savage, say, would
probably not notice AIGLX going away, since they wouldn't be running a
GLX compositor in the first place.

In the future we'd like to use GL in the server in a more natural way,
as just another EGL client, including in the GLX implementation itself.
Since there's no EGL implemented for DRI1 drivers, this would already
doom AIGLX on DRI1 (short of entirely forking the GLX implementation,
which I'm not enthusiastic about).

v2: Remove DRI1 from AIGLX conditionals in configure.ac [anholt]

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-10-29 10:30:43 -04:00
Daniel Czarnowski
ccc8bb1153 glx: Handle float config types in glxConvertConfigs
Replaces old use of floatMode attribute with new, extended range of
values in __DRI_ATTRIB_RENDER_TYPE. Also adds new conditions, where the
float modes support requires it. Enables support for not only float
configs, but packed float configs as well.

v2 (idr): Whitespace and formatting fixes.  Refactor render type
vs. pbuffer checking to a separate function that includes a quote from
the spec.  Re-write commit message.  Fix compiler warnings:

glxdricommon.c: In function 'glxConvertConfigs':
glxdricommon.c:212:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:212:35: note: expected 'unsigned int *' but argument is of type 'int *'
glxdricommon.c:230:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:230:35: note: expected 'unsigned int *' but argument is of type 'int *'

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-24 11:47:42 -07:00
Daniel Czarnowski
4e5eb15b4c glx: Correctly set render type enum
The type specified is bits, but the context wants an enum.

v2 (idr): Fix various whitespace and formatting problems.  Rename
convFBconfRenderTypeBits2CtxRenderType to
renderTypeBitsToRenderTypeEnum.  Re-write commit message.

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-24 11:16:30 -07:00
Strake
83bb366e71 unbreak KdEnableInput
pi = ki = 0 here, so not follow them.

Signed-off-by: Strake <strake888@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-21 14:08:06 +10:00
Alan Coopersmith
8afe20d4e3 Update GLX dependencies now that DRI & DRI2 are builtins, not modules
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-10-14 17:56:44 -07:00
Alan Coopersmith
2704bdb24a DMX glxproxy: Don't allocate & copy data just to free it unused
Two functions in the DMX glxproxy code loop over all the backend
screens, starting at the highest numbered and counting down to
the lowest.

Previously, for each screen, the code would allocate a buffer
large enough to read the reply from the backend, copy that reply
into the buffer, and then if it wasn't the final screen, free it.
Only the buffer from the final screen is used, to pass on to the
client in the reply.

This modifies it to just immediately discard the responses from
the screens as we loop through it, only doing the allocate & copy
work for the one buffer we pass back to the client.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Alex Deucher <aleander.deucher@amd.com>
2013-10-14 17:56:44 -07:00
Michele Baldessari
93a27b2dd0 Xephyr: restore cursor visibility
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=69388

Commit c100211034 (dix: only show the cursor
if a window defines one (#58398)) broke the default cursor behaviour in
Xephyr (unless run with -retro). Restore the default cursor visibility
so that '-retro' or '-host-cursor' are not needed to have a visible
cursor.

Signed-off-by: Michele Baldessari <michele@acksyn.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>

as of ba387cf21f "ephyr: Use host (HW) cursors
by default." this only applies if -sw-cursor is given on the cmdline.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-14 11:07:37 +10:00
Michele Baldessari
70efc799cb Fix Xephyr compilation when DEBUG is enabled
When DEBUG is enabled Xephyr compilation fails:
ephyrdriext.c:343:133: error: 'is_ok' undeclared (first use in this
function)
     EPHYR_LOG("leave. is_ok:%d\n", is_ok);

Just reemove bogus is_ok variable.

Signed-off-by: Michele Baldessari <michele@acksyn.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-14 11:07:37 +10:00
Jon TURNEY
44d502c6f1 hw/xwin: Fix for "glx: Remove screen number from __GLXconfig"
Fix compilation after commit c3c976f54c "glx:
Remove screen number from __GLXconfig"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-09 14:51:53 +01:00
Jeremy Huddleston Sequoia
8aae28e3cb XQuartz: Dont't set screen on __GLXConfig
Fixes regression introduced by c3c976f54c

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-10-06 09:20:45 -07:00
Pino Toscano
c079b8e675 xfree86/hurd: include <hurd.h>
Needed for using get_privileged_port.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-10-05 15:26:21 +02:00
Keith Packard
f2d149b6d1 kdrive/ephyr: Remove duplicate ephyrExtensions and ephyrExtensionInit decls
These were duplicated when GLX support was re-added on two different branches.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-04 16:43:41 -07:00
Gaetan Nadon
e0a678f059 xfree86: add a comment as to why the logdir is created
Without the logdir, the xserver will write the content of the log file on the
terminal stating that it cannot be written and will stop.

Refer to https://bugs.freedesktop.org/show_bug.cgi?id=3889

Reviewed-By:  Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-04 14:09:39 -07:00
Gaetan Nadon
5bdbf2dba3 xfree86: Use $(MKDIR_P) for better code portability
Still true that we should not use the lower case $(mkdir_p) version.
However, remove the 2005 comment as the MKDIR_P is widely used now.

Reviewed-By:  Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-04 14:09:37 -07:00
Gaetan Nadon
b8cfb0dc84 Uninstall X link and CYGWIN libXorg.exe.a in local install targets
It is our duty to uninstall any files and/or directories that we installed
through install-data-local and install-exec-hook.

Currently the X symbolic link to Xorg remains on disk after running
make uninstall.

Note the exception for logdir which is usually shared by other modules.

Reviewed-By:  Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-04 14:09:35 -07:00
Gaetan Nadon
35a528e492 Xorg binary: use install-exec-hook rather than install-exec-local
The former was explicitly designed to execute additional code after the binary
has been installed. The latter can be executed in any order, hence it's
current dependency on install-binPROGRAMS as a workaround.

The CYGWIN libXorg.exe.a target is an installation target rather than
a post-installation one, so it should not be done as a hook. It does not depend
on the Xorg executable being installed.

Automake:
"These hooks are run after all other install rules of the appropriate type,
exec or data, have completed. So, for instance, it is possible to perform
post-installation modifications using an install hook".

"With the -local targets, there is no particular guarantee of execution order;
typically, they are run early, but with parallel make, there is no way
to be sure of that".

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-04 14:09:33 -07:00
Gaetan Nadon
a1d87576a3 Use $(LN_S) provided by AC_PROG_LN_S macro to create links
For better code portability.

Reviewed-By:  Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-04 14:09:30 -07:00
Gaetan Nadon
28c8e19107 The Xorg binary is missing the extension $(EXEEXT) in the makefile
This is not a problem on UNIX platforms, but on CYGWIN it creates a broken
link to Xorg rather than a link to Xorg.exe.

From the CYGWIN log on tinderbox, we can see that the executable Xorg.exe is
installed correctly. We can see the command used to create the link:

(cd /jhbuild/install/[...]/install/bin && rm -f X && ln -s Xorg X)

Note that the "relink" makefile target correctly appends $(EXEEXT) to Xorg.

Reviewed-By:  Matt Dew <marcoz@osource.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-10-04 14:09:26 -07:00
Keith Packard
f3b529bf25 Merge remote-tracking branch 'anholt/ephyr-fixes' 2013-10-04 14:04:48 -07:00
Keith Packard
9ccb4a6398 Merge remote-tracking branch 'whot/for-keith' 2013-10-04 13:54:55 -07:00
Keith Packard
5d2ec6933f Merge remote-tracking branch 'ajax/xserver-next' 2013-10-04 13:50:04 -07:00
Peter Hutterer
160c2db32d dmx: provide enough space for axis mappings
relmap/absmap is used as a evdev-axis-to-x-axis mapping. ABS_X maps to
axis 0, ABS_Y to 1, etc. skipping over non-existing axes so that the third bit
set in the ABS_* range is axis 2, and so on. This requires us to actually have
enough space to have all the ABS_*/REL_* range.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-09-25 03:52:54 +10:00
Jeremy Huddleston Sequoia
8010d3a48b XQuartz: pbproxy: Fix build with -DDEBUG
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-09-16 07:06:57 -07:00
Jeremy Huddleston Sequoia
39c548da0c XQuartz: Fix build with moved pseudoramiX
Regression from: e716baedc4

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-09-16 07:06:48 -07:00
Adam Jackson
1d1484e9bd glx: Remove pixmapMode from __GLXconfig
This has never been filled in with anything meaningful afaict, and you
can't get to it from the client in any event.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:32 -04:00
Adam Jackson
f579cc85c2 glxproxy: Don't track GLCLientm{aj,in}orVersion
Basically just a port of 62f06b0d to glxproxy.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:31 -04:00
Adam Jackson
e549ffb5f1 dmx/glx: Remove unused __glXNop
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:31 -04:00
Adam Jackson
d08966227e damage: Simplify DamageUnregister
You can only register one drawable on a given damage, so there's no
reason to require the caller to specify the drawable, the damage is
enough.  The implementation would do something fairly horrible if you
_did_ pass mismatched drawable and damage, so let's avoid the problem
entirely.

v2: Simplify xf86RotateDestroy even more [anholt]

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 14:28:35 -04:00
Adam Jackson
28708a045d damage: Implicitly unregister on destroy
There's no reason not to, and it simplifies quite a few callers.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 14:28:09 -04:00
Adam Jackson
e4b15125bb mipointer: Remove deprecated miPointerCurrentScreen
The only remaining use was in some debugging code in DMX.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:29:21 -04:00
Adam Jackson
b5d66b9513 xfree86: Remove deprecated unimplemented xf86MapReadSideEffects
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:24 -04:00
Adam Jackson
dff81687f5 vbe: Don't try to load the ddc submodule
DDC is built into the server now.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:24 -04:00
Adam Jackson
e674815e0a dmx: Remove ShadowFB support
This has been listed as deprecated ever since DMX was merged.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:23 -04:00
Adam Jackson
4dca026880 mipointer: Remove EnqueueEvent from miPointerScreenFuncRec
No DDX overrode this, and we never actually called through that slot
anyway.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:23 -04:00
Adam Jackson
ad076dc6e8 mipointer: Flatten calls to mieqSwitchScreen
No DDX was overriding this.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:28:23 -04:00
Radek Doulik
65fca55884 xnest: Ignore GetImage() error in xnestGetImage()
When an Xnest instance is not viewable it will crash when a client in
that instance calls GetImage. This is because the Xnest server will
itself receives a BadMatch error.
This patch ignores the error. The application which has requested the
image will receive garbage - this however is fully legal according
to the specs as obscured areas will always contain garbage if there
isn't some sort of backing store as discussed in
https://bugs.freedesktop.org/show_bug.cgi?id=9488
The applied patch is a version from Dadek Doulik.

v2: Call XSync() before changing error handlers as suggested by
    Daniel Stone <daniel@fooishbar.org>.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Egbert Eich <eich@freedesktop.org>
2013-09-10 13:26:26 -04:00
Michal Srb
b902c8abb6 Xnest: Implement xnestModifyPixmapHeader
Xnest variant of ModifyPixmapHeader that creates new Pixmap in parent X
server if it's size is modified from 0x0 to anything bigger.

xnestCreatePixmap doesn't create pixmap in parent X server if it has
dimensions 0x0. If it is later resized and accessed, Xnest will be
aborted with BadDrawable error from parent X server because it will
use XID 0. This happens with ScratchPixmap, for example as used from
XaceCensorImage. Applications using XACE crash Xnest.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-09-10 13:26:26 -04:00
Laurent Carlier
ceffb34774 ephyr: restore GLX support
It was removed since version 1.13

Signed-off-by: Sebastien Bacher <seb128@ubuntu.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2013-09-10 13:26:25 -04:00
Keith Packard
47ff382d1f Merge remote-tracking branch 'jturney/master' 2013-09-09 15:13:42 -07:00
Chris Clayton
1110b71e36 kdrive: fix build error on gcc 4.8 for out-of-bounds array access
I'm getting a error building xorg-server-1.14.1.902 with thelatest snapshot
of gcc-4.8:

input.c:225:43: error: array subscript is above array bounds
[-Werror=array-bounds]

This is because kdNumInputFds can become equal to KD_MAX_INPUT_FDS in
KdRegisterFd(). This means that in KdUnregisterFd(), kdInputFds[j + 1] can
be beyond the end of the array.

Signed-off-by: Chris Clayton <chris2553@googlemail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-06 07:04:17 +10:00
Sebastien Bacher
abc2bfca16 kdrive: initialize GLX for xephyr
Like commit ac1a60e7b6, re-add
initialization of GLX after it was accidentally dropped from non-Xorg
servers in 5f5bbbe543.

Signed-off-by: Sebastien Bacher <seb128@ubuntu.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62346
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 14:35:39 -07:00
Eric Anholt
aa5534ec69 ephyr: Do grab/ungrab for ctrl+shift, not just shift+ctrl.
Given that the window title says "ctrl+shift", having pressing those
keys in that order not ungrab you is fairly mean.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:39 -07:00
Eric Anholt
5cc15e1c42 ephyr: Flush the X connection when updating the window title.
Otherwise when you're doing the ctrl-shift mouse grab thing, you
don't know what state you're in until the next rendering occurs.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:39 -07:00
Eric Anholt
ba387cf21f ephyr: Use host (HW) cursors by default.
Unless you're working on the sw cursor rendering code, you surely want
to have real hardware cursors.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:38 -07:00
Eric Anholt
0f5a2f13dc ephyr: Garbage collect some DOA host window clipping code.
Introduced in 7978272661 but never used.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:24 -07:00
Eric Anholt
090de17d36 ephyr: Garbage collect some dead XV clipping code.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:21 -07:00
Eric Anholt
347d0fa696 ephyr: Remove the helper libs for each of the optional components.
Note that EXTRA_DIST was always unnecessary, because automake notices
conditional compile of source files and includes them.

Copyright header is added because git noted that this was a 61%
rewrite.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:18 -07:00
Eric Anholt
74dff87790 ephyr: Remove the remaining bits of host/server XV split.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:14 -07:00
Eric Anholt
2f994dfe9d ephyr: Remove the host/server split of the actual XV video operations.
I suspect there's more cleanup possible in ephyrHostXVPutImage() by
sticking a bunch of the args in the port priv earlier.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:11 -07:00
Eric Anholt
0b7ce74315 ephyr: Remove another host/server split for XV image formats.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:09 -07:00
Eric Anholt
1dcc28bcb4 ephyr: Remove the host/server split for video encodings.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:06 -07:00
Eric Anholt
28a37757e1 ephyr: Remove the host/server split for XV formats.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:04 -07:00
Eric Anholt
41134d393a ephyr: Remove the host/server split for XV attributes.
v2: Fix leaks of xcb replies (caught by Julien)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:35:01 -07:00
Eric Anholt
1342a93c49 ephyr: Remove the host/server split for XV adaptors.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:59 -07:00
Eric Anholt
fad79d2e3e ephyr: Refactor XV adaptor feature detection.
This obviously wanted a helper function beforehand, but even more so
now that we have XCB.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:56 -07:00
Eric Anholt
7a9c311add ephyr: Remove some pointless indirection in the XV code.
Now that we have XCB on the server side, we don't need to split these
functions out.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:53 -07:00
Eric Anholt
46cf6bf569 ephyr: Move event processing into ephyr.c.
No more extra event structure to translate between hostx.c and
ephyr.c!

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:51 -07:00
Eric Anholt
847c856eff ephyr: Move the host screen info into the kdrive screen private.
We can include xcb bits from the same place as server headers, so
there's no need to hide them any more.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:48 -07:00
Eric Anholt
8dadc78e23 ephyr: Rename and use the proper type for what was host_screen->info.
Now that we can include server headers in talking to host X, we don't
need to hide any more.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:46 -07:00
Eric Anholt
18d836f6dd ephyr: Expose a single function for detecting extensions.
v2: Fix trying to include xcb-dri in the non-dri-build case (Noted by
    Julien)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:41 -07:00
Eric Anholt
3aacb22d64 ephyr: Drop dead ephyrHostAtomToLocal code.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-09-03 14:34:32 -07:00
Julien Cristau
4aaad0bfbc Xephyr: we're not using Xlib anymore, no need to undef _XSERVER64
Drop obsolete comments about interaction between Xlib code and that
macro, and stop undefining it.

Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:02:03 -07:00
Julien Cristau
0fc2f9f04a Xephyr: handle errors in event loop
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2013-09-03 11:02:03 -07:00
Julien Cristau
3309a73c82 Xephyr: drop remaining Xlib dependency
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:02:03 -07:00
Julien Cristau
7da2174cf9 Xephyr: move glx code to xcb
v2: Rebase on master, notably adding XCB for
    X_GLXvop_MakeCurrentReadSGI (anholt).
v3: Fix use-after-free (caught by Julien).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:01:40 -07:00
Julien Cristau
19c2699b95 Xephyr: remove unused DRI1 code
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:01:00 -07:00
Julien Cristau
68b7db19e8 Xephyr: move ephyrdri over to xcb
Require new xcb-xf86dri to get fixed GetDrawableInfo.

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:01:00 -07:00
Julien Cristau
aea119cd05 Xephyr: use xcb-xv instead of libXv
v2: Massive, conflict-filled rebase.  I think I resolved everything
    right, but this host xv code makes my eyes bleed.  Touch-tested XV
    after the rebase (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Julien Cristau
3ea75a59d5 Xephyr: use xcb for event handling
v2: Rebase on indentation changes, squash in a simpler variant of the
    later event compression patch, fix server hang or segfault on
    window close by reimplementing the x_io_error_handler in the new
    XCB event loop (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Julien Cristau
ff26845252 Xephyr: some more hostx.c xcb-ification
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
9b55f76a26 Xephyr: move HostX.visual to xcb
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
126312fb4a Xephyr: replace XKeycodeToKeysym with xcb-keysyms
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
8543d3fdfd Xephyr: delete unused hostx_get_extension_info function
v2: Also remove the prototype (anholt)

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Julien Cristau
d72c11b9df Xephyr: delete unused proxy code
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
a71ea3f967 Xephyr: xcb-ify visual list construction
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
ac2b0348c0 Xephyr: xcb-ify pointer/keyboard grab
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
1f93e6b350 Xephyr: no need for XDisplayKeycodes
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
73398e5bf6 Xephyr: use xcb-shape instead of XShape*
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-09-03 11:00:59 -07:00
Julien Cristau
a2b73da78d Xephyr: start converting hostx.c over to xcb
v2: Dropped the hostx_load_keymap changes, now that that function is
    gutted (anholt).

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Julien Cristau
762606b4cd Xephyr: stop loading the host's keymap
This isn't used anywhere.

v2: Rebase to the top of the patch series (anholt)

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2013-09-03 11:00:59 -07:00
Marc Haesen
3752a81580 hw/xwin: Remove unnecessary and incorrect HWND casts
Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-08-30 14:22:22 +01:00
Jon TURNEY
34932cef6c hw/xwin: Fix compilation of winauth.c with -Werror=implicit-function-declaration
/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c: In function ‘MitGenerateCookie’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c:87:5: error: implicit declaration of function ‘MitAddCookie’ [-Werror=implicit-function-declaration]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:08 +01:00
Jon TURNEY
2a08554a0b hw/xwin: Remove unused extern g_fUseUnicode from winclipboardwndproc.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:06 +01:00
Jon TURNEY
69401f38a6 hw/xwin: Remove unneeded forward declaration of winProcessXEventsTimeout()
Remove unneeded forward declaration of winProcessXEventsTimeout(), the actual
definition immediately follows.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:03 +01:00
Jon TURNEY
9c45a1ad44 hw/xwin: Remove prototype for non-existent winDeinitClipboard()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:00 +01:00
Jon TURNEY
acc46fc217 hw/xwin: Remove unused externs from winclipboardwrappers.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:58 +01:00
Jon TURNEY
fcc7767f8c hw/xwin: Remove unused winProcQueryTreeOrig variable
Unused since 47c7b6d3e6 "Remove no-longer needed
tricks used to prevent the clipboard client from being killed"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:56 +01:00
Jon TURNEY
8fa882a980 hw/xwin: Fix ARGB cursor conversion on x86_64
Fix erroneous use of unsigned long * for lpBits in winXCursorToHCURSOR() which
leads to ARGB cursors being vertically streched on x86_64 by interleaving blank
rows of pixels.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:54 +01:00
Jon TURNEY
4bfb2dce5e hw/xwin: Fix an issue in winSetSpansNativeGDI() identifed by -Warray-bounds
The BITMAPINFO local only has room for a single RBGQUAD in bmiColors, but we
access two (black and white for a mono-color DIB).  Fix by changing to a dynamic
allocation big enough for a BITMAPINFO and a RGBQUAD.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:51 +01:00
Jon TURNEY
784c006adb hw/xwin: Fix -Warray-bounds warning in winXCursorToHCURSOR()
Rewrite winXCursorToHCURSOR() so access to BITMAPINFO bmiColors member doesn't
trigger an -Warray-bounds warning.

Note that the underlying storage is allocated as a BITMAPV4HEADER, so has
sufficent room for the extra RGBQUADs bmiColors after the BITMAPINFO bmiHeader.

wincursor.c: In function 'winSetCursor':
wincursor.c:293:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:294:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:295:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:296:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:297:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:298:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:299:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:300:24: error: array subscript is above array bounds [-Werror=array-bounds]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:49 +01:00
Marc Haesen
41d03c9ccc hw/xwin: Correct size of _WINDOWSWM_NATIVE_HWND property on x86_64
Use the correct size of a HWND on x86_64 in XChangeProperty() and
XGetWindowProperty() calls for the _WINDOWSWM_NATIVE_HWND property.

Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-08-30 12:58:15 +01:00
Colin Harrison
390cfec10e hw/xwin: Correct winprefs.c function signatures for x64.
Correct SetupRootMenu(), SetupSysMenu(), HandleCustomWM_INITMENU() and
HandleCustomWM_COMMAND() function signatures which use unsigned long parameters,
where just a specific HWND or HMENU handle type should have been used.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:56:35 +01:00
Jon TURNEY
e716baedc4 Move pseudoramiX code where it can be shared between Xwin and Xquartz
Move pseudoramiX code to a separate top-level directory.  Link Xwin and Xquartz
with libPseudoramiX

I'm not sure moving this to a top-level directory is appropriate, but I'm not
sure where else it fits.

Future work: pseudoramiX can probably be consolidated with the rrxinerama code
(which I think provides fake xinerama data when real XINERAMA is disabled and we
only have one screen)

v2: fix distcheck

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:30 +01:00
Jon TURNEY
ce0217b982 hw/xwin: Fix winglobals.h for MinGW64 build
Include pthread.h in winglobals.h to fix build with latest MinGW64 headers

In file included from
winmultiwindowicons.c:47:0:
winglobals.h:92:1: error: unknown type name ‘pthread_mutex_t’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:27 +01:00
Jon TURNEY
b27756dbe6 hw/xwin: Fix inclusion of shlobj.h in MinGW64 build
Fix build with latest MinGW64 headers by wrapping Status type in shlobj.h as well

In file included from InitOutput.c:51:0:
/usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1231:44: error: expected identifier or ‘(’ before ‘int’
/usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1248:44: error: expected identifier or ‘(’ before ‘int’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:24 +01:00
Eric Anholt
e01a3f65d3 ephyr: Fix warning about XID vs unsigned long * by changing function args
There's no reason to pass the data back out to the caller, since the
caller was dropping it on the floor.  The original data is a CARD32,
so no need to mess with weird unsigned longs.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2013-08-21 09:10:49 -07:00