Commit Graph

4730 Commits

Author SHA1 Message Date
Dave Airlie
959a1eaf1c composite: use config notify hook to do pixmap resize.
Since reallocating the backing pixmap can fail, we need to try and do
it before any other side effects of reconfiguring the window happen.

This changes the ConfigNotify hook to return status, and moves the
composite window reconfiguration wrappers to ConfigNotify. They all
basically did the same thing, so we can drop the MoveWindow,
ResizeWindow, ChangeBorderWidth wrappers, and allow ConfigNotify to do
all the work. If reallocation fails we fail before we send any
confiureNotify events, or enter the area we can't recover from.

The only place we now enforce 32k limits are in EXA/UXA/fb, so drivers
that don't use this should probably deal with it in their pixmap
allocate if they don't already.

This also breaks ABI, so we need an alternate fix for older servers,
working on the X server makes me realise why I'm a kernel hacker.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-03 21:26:24 -07:00
Keith Packard
0f12e86e60 Merge remote branch 'jamey/for-keith' 2010-06-03 15:09:32 -07:00
Jamey Sharp
a7c7ebe4b3 Delete XineramaScreenRegions cache.
Every screen region consists of a single rectangle, so initializing a
stack-allocated region for each screen on-demand does no heap allocation
and is fast.

This eliminates a MAXSCREENS-sized array.

The REGION_UNINIT calls are no-ops since no boxes are actually allocated
for a single-rectangle region, but it seemed wiser to include them.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
a83cff9f4d Move each screen's x/y origin into ScreenRec.
Many references to the dixScreenOrigins array already had the
corresponding screen pointer handy, which meant they usually looked like
"dixScreenOrigins[pScreen->myNum]". Adding a field to ScreenRec instead
of keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix declared the dixScreenOrigins array, I figure allocating a
screen private for these values is overkill.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
217ccaa5a3 Delete panoramiXdataPtr: it's redundant.
This eliminates a dynamically-allocated MAXSCREENS-sized array.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
e7fae9ecc4 Move each screen's root-window pointer into ScreenRec.
Many references to the WindowTable array already had the corresponding
screen pointer handy, which meant they usually looked like
"WindowTable[pScreen->myNum]". Adding a field to ScreenRec instead of
keeping this information in a parallel array simplifies those
expressions, and eliminates a MAXSCREENS-sized array.

Since dix uses this data, a screen private entry isn't appropriate.

xf86-video-dummy currently uses WindowTable, so it needs to be updated
to reflect this change.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com> (i686 GNU/Linux)
2010-06-03 14:03:23 -07:00
Jamey Sharp
d1bad1b59f dmx: Fix XSetExtensionErrorHandler calls to agree on constness.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-03 14:03:22 -07:00
Alan Coopersmith
aa7c09f7d0 Install fbdevhw module in normal module directory instead of linux/
Since we no longer support OS-independent custom elfloader modules,
we don't need to put the OS-dependent modules into os-specific subdirs
any more.

We do however still need to install the stubs version of this module
on non-Linux platforms, since a number of drivers link to functions
in it, even when built on non-Linux platforms.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-03 07:29:50 -07:00
Pauli Nieminen
f0ab726d89 DRI2: Use single error path in initialization
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-06-03 11:56:56 +03:00
Tiago Vignatti
6eef70dc56 DRI2: Allow building without libdrm
Some drivers use DRI protocol but implement their own kernel rendering
manager. For these drivers, libdrm becomes useless. --disable-libdrm
configure parameter can be used to disable libdrm support in dri2.

To provide ABI/API compatibility for libdrm based drivers, libdrm call
is wrapped in ifdef.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-06-03 11:56:03 +03:00
Tiago Vignatti
cdcb575664 DRI2: add AuthMagic hook for driver side support
With this new hook, drmAuthMagic becomes useless and should be deprecated.
You might want to implement AuthMagic on driver side instead.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2010-06-03 11:55:05 +03:00
Pierre-Loup A. Griffais
643cb6e87c Only deal with input code when changing the input shape.
Propagate the shape kind all the way to SetShape to avoid performing non-input
operations such as revalidating the tree and generating exposures when only
changing a window's input shape.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Acked-by: Aaron Plattner<aplattner@nvidia.com>
Reviewed-by: Daniel Stone<daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-02 21:11:31 -07:00
Chris Wilson
d90f2cd98a xfree86: Unbreak autoconfig following 0abf065e38
The move of the PCI device id probing into a separate file neglected to
return the number of found devices, and so the PCI devices were being
overwritten by the default entries for vesa and fbdev.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tiago Vignatti <tiago.vignatti@nokia.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-02 21:09:44 -07:00
Peter Hutterer
108b766c31 xfree86: initialize InputAttributes to NULL in the autoconfig code.
Reported-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-05-28 16:49:30 +10:00
Peter Hutterer
e4582d9e5c xfree86: bump ABI_XINPUT_VERSION to 11.
commit c2d0b3b437
"xfree86: store the InputAttributes in the input device."
introduced the new API. Bump the input version so drivers can handle this
appropriately.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-26 19:34:22 -07:00
Jamey Sharp
cd0ef0b6a2 dmx: Delete unused ChangeKeyboardDevice/ChangePointerDevice.
Daniel Stone deleted the API for these in 2006, in commit
96e32805d1.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26 11:42:40 -07:00
Jamey Sharp
8bb88379d9 dmx: Remove dead __glXDispSwap_DrawArraysEXT definition.
Eric Anholt made the corresponding fix in glx/render2swap.c in commit
49d38ab232.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-26 11:17:23 -07:00
Jamey Sharp
c97a3ade5a dmx: Delete unused local variables.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26 11:16:51 -07:00
Jamey Sharp
3c3d099fc1 dmx: Xfree -> free
Mikhail fixed the corresponding Xallocs, but missed these uses of Xfree
in commit 3f3ff971ec.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26 11:13:13 -07:00
Jamey Sharp
01ca6400d9 Xephyr: Fix Xcalloc deprecation warnings.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-26 11:11:53 -07:00
Jamey Sharp
34df659687 xfree86/int10/helper_mem: Fix log message.
Three years ago in commit f62beb6f36 ajax
deleted the code that could have set this format string to anything
else, so just use the format string literal. This makes GCC happy since
it can check the argument types, which, by the way, weren't correct
since this format string doesn't need any arguments.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-05-26 11:10:55 -07:00
Keith Packard
4e9d3e4132 Revert "Add a "flags" field to DeleteInputDeviceRequest."
Peter wants to get a larger patch sequence put together and I didn't
read past the commit message to see the 'don't take this patch
please'.

This reverts commit 531ff40301.
2010-05-26 07:54:35 -07:00
Peter Hutterer
531ff40301 Add a "flags" field to DeleteInputDeviceRequest.
Some input drivers need to implement an internal hotplugging scheme for
dependent devices to provide multiple X devices off one kernel device file.
Such dependent devices can be added with NewInputDeviceRequest() but they are
not removed when the config backend calls DeleteInputDeviceRequest(),
leaving the original device to clean up.

Example of the wacom driver:

config/udev calls NewInputDeviceRequest("stylus")

wacom PreInit calls
        NewInputDeviceRequest("eraser")
        NewInputDeviceRequest("pad")
        NewInputDeviceRequest("cursor")
        PreInit finishes.

When the device is removed, the config backend only calls
DeleteInputDeviceRequest for "stylus". The driver needs to call
DeleteInputDeviceRequest for the dependent devices eraser, pad and cursor to
clean up properly.
However, when the server terminates, DeleteInputDeviceRequest is called for
all devices - the driver must not remove the dependent devices to avoid
double-frees. There is no method for the driver to detect why a device is
being removed, leading to elaborate guesswork and some amount of wishful
thinking.

Though the input driver's UnInit already supports flags, they are unused.
This patch uses the flags to supply information where the
DeleteInputDeviceRequest request originates from, allowing a driver to
selectively call DeleteInputDeviceRequest when necessary.

Also bumps XINPUT ABI.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-25 17:47:32 -07:00
Peter Hutterer
c2d0b3b437 xfree86: store the InputAttributes in the input device.
InputAttributes largely decide which configuration values get merged from
the xorg.conf.d snippets. While they are available in the config backend,
they are not available for any other callers of NewInputDeviceRequest().

Drivers implementing driver-side hotplugging do not have access to these
attributes and cannot have xorg.conf.d snippets specific to dependent
devices. For example, the following case cannot work right now:

Section "InputClass"
        MatchProduct "Wacom"
        Option "PressCurve" "0 0 100 100"
        ...
EndSection

Section "InputClass"
        MatchProduct "Wacom"
        MatchProduct "eraser"
        Option "PressCurve" "10 10 50 50"
        ...
EndSection

The second section is not triggered, as the wacom driver cannot supply the
InputAttributes to NewInputDeviceRequest().

Add the attributes to the IDevRec and merge them into the InputInfoRec to
make them accessible in the driver. This changes the ABI for input drivers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-25 10:06:50 -07:00
Jamey Sharp
bf9b64eefb xnest: Don't ignore errors from DeviceCursorInitialize.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2010-05-25 09:05:22 -07:00
Keith Packard
b11465a6ec Merge remote branch 'vignatti/bus-cleanup-take2' 2010-05-24 22:18:31 -07:00
Tiago Vignatti
0abf065e38 xfree86: move all pci code from auto configurator into a meaningful location
This patch creates the private xf86PciMatchDriver hook, which goes inside pci
code to match the drivers found in the system.

Now there's no direct references to PCI inside xf86AutoConfig.c anymore.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-24 19:31:57 +03:00
Tiago Vignatti
0ceac6f64f xfree86: no need to check for the configuration case when matching devices
xf86MatchDevice will never be called in configuration time.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-24 19:31:57 +03:00
Tiago Vignatti
b0eef11018 xfree86: organize and group all pci related stuff inside xf86.h
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-24 19:31:57 +03:00
Tiago Vignatti
47df5a489e xfree86: remove BUS_ISA type given we don't support anymore
Should go together within commit df14682a.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-24 19:31:57 +03:00
Tiago Vignatti
9d000a5509 xfree86: remove all kind of bus and PCI dependency from the common helper file
Move all PCI procedures from xf86Helper.c to a more meaningful place (namely
xf86pciBus.c). xf86Helper.c is free of PCI code now.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-24 19:31:50 +03:00
Tiago Vignatti
610009cf39 xfree86: bus: remove useless field from EntityRec
RAC is the champion of remaining trash for sure!

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-24 19:17:04 +03:00
Tiago Vignatti
95889a569f xfree86: bus: delete useless xf86FindPrimaryDevice
This function had a wrong name and was just logging the primary device. No one
cares about it honestly.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-24 19:16:02 +03:00
Tiago Vignatti
f686590948 xfree86: bus: remove unused headers
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-24 19:10:51 +03:00
Tiago Vignatti
111b1fff1c xfree86: bus: remove unused pci macros
Should be gone in commits 3c03d9f1 and a9d7d659a respectively.

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-24 19:10:07 +03:00
Keith Packard
2ffffb4daf Merge remote branch 'alanc/docs' 2010-05-23 23:22:08 -07:00
Peter Hutterer
b5e0f6d8f4 xfree86: fix multiple InputAttributes tag matching.
attr->tags is an array of strings (null-terminated). When matching, match
against each string instead of each [i,end] substring in the first tag.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-23 23:20:23 -07:00
Brice Goglin
d5306084b5 Remove obsolete reference to README.DRI in xorg.conf.man
Signed-off-by: Brice Goglin <Brice.Goglin@ens-lyon.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-05-23 21:20:29 -07:00
Alan Coopersmith
89dd7d2b6f Remove ancient documentation of IBM RapidAccess keyboard hack
Keyboard setup belongs in drivers, not in a document no one sees
because we don't even install it.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2010-05-23 21:17:55 -07:00
Alan Coopersmith
480fcdf033 Remove completely out-of-date README.DRI
The license only allows distribution of verbatim copies, so we can't
update it, even to correct the incorrect address to send updates to.

The Mesa & DRI web pages are much better sources of current information
anyway.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-05-23 21:17:06 -07:00
Alan Coopersmith
1805c74d9b Add RandR 1.2 README.modes doc to EXTRA_DIST
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-05-23 21:16:16 -07:00
Dave Airlie
5939e39a64 xf86: allow for no outputs connected at startup operation.
When nothing is connected at startup and we canGrow, allow the server to start with a 1024x768 framebuffer, and when the drivers send hotplug events this will expand to the correct size dynamically.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-23 17:30:09 -07:00
Adam Jackson
9d31d5b639 vfb: Remove dead variable and header file
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-21 12:49:46 -07:00
Aaron Zang
989db930d7 Solaris: Use VT_SET_CONSUSER ioctl to set Console User rights profile
When Xorg is started on display :0, this ioctl is called to grant the
user the rights traditionally associated with /dev/console (before VT
support was added), such as access to local peripheral devices.

Also adds a Solaris-specific -C flag to force starting on /dev/console
instead of /dev/vt*, allowing programs like xterm -C to access the
console device.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-21 09:45:42 -07:00
Alan Coopersmith
98553e52a1 vbe.h: Use __attribute__((packed)) on Sun cc 5.9 & later as well as gcc
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-21 09:45:06 -07:00
Jamey Sharp
5754e66044 Replace screen->rgf scratch GC flags with a bit in each GC.
This eliminates a poorly-named, poorly-documented field from the
ScreenRec, using a previously-unused flag bit in each GC instead.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Cc: Keith Packard <keithp@keithp.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-20 14:36:29 -07:00
Keith Packard
5a7275d78a Find windows GL wrapper files in $(srcdir) instead of .
This fixes 'make distcheck' for me.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-05-20 14:35:14 -07:00
Keith Packard
1197a87b56 winpriv.h was moved from hw/xwin to hw/xwin/glx in November
hw/xwin/Makefile.am was referencing this instead of hw/xwin/glx/Makefile.am

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
2010-05-20 14:34:53 -07:00
Alan Coopersmith
1cad520f3f XFree86 Design doc: Convert LinuxDoc ``quotes'' to DocBook <quote> tags
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Tested-by: Gaetan Nadon <memsize@videotron.ca>
2010-05-20 11:31:40 -07:00
Alan Coopersmith
8367913be3 XFree86 Design doc: Explain this version covers the current Xorg release
Update the title & preface to explain that while this was originally
the XFree86 4.0 design, we've changed a lot since forking.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Tested-by: Gaetan Nadon <memsize@videotron.ca>
2010-05-20 11:31:24 -07:00