Commit Graph

15171 Commits

Author SHA1 Message Date
Dave Airlie
8116fd8a76 glamor: store old fonts in double width textures.
There is a problem with some fonts that the height necessary
to store the font is greater than the max texture size, which
causes a fallback to occur. We can avoid this by storing two
macro columns side-by-side in the texture and adjusting
the calculations to suit.

This fixes
xfd -fn -*-*-*-*-*-*-*-*-*-*-*-*-*-*
falling back here, when it picks
-arabic-newspaper-medium-r-normal--32-246-100-100-p-137-iso10646-1

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-01-13 11:21:02 +10:00
Dave Airlie
64081d0eac glamor: fallback if font is too large for FBO size.
running xfontsel on haswell here, with a max texture size
of 8kx8k, one font wants 9711 height. This fallsback to
sw in this case.

A proper solution probably involves using an array texture.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-01-13 11:20:59 +10:00
Adam Jackson
6dcb73375e os: Failure to remove a non-existent log file is not an error
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-01-06 12:23:31 -05:00
Thomas Klausner
862cbf4c87 Fix build when XSERVER_PLATFORM_BUS is not defined.
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2016-01-06 10:10:14 -05:00
Thomas Klausner
63f83d1b7f Fix uninitialized variable warnings reported by clang
v2: Move initializing pos into the first clause of the for statement. We
have to keep this macro equivalent to a plain for statement from the
user's perspective, otherwise callers need to {} things to keep control
flow correct. [ajax]

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
2016-01-06 09:42:59 -05:00
Alan Coopersmith
ba71b69f94 Avoid segfault in CloseWellKnownConnections when using -displayfd
When -displayfd is looping through the possible display ids to use,
if it can't open all the listening sockets for one (say when :0 is
already in use), it calls CloseWellKnownConnections to close all
the ListenTransConns entries before the point that ListenTransFds
was allocated & initialized, so CloseWellKnownConnections would
segfault trying to read entries from a NULL ListenTransFds pointer.

Introduced by commit 7b02f0b8

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-01-05 12:09:18 -08:00
Alan Coopersmith
edcb6426f2 Use unique logfile names when starting server with -displayfd
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=93212

Previously all X servers started with -displayfd would overwrite
Xorg.0.log - now a temporary name of Xorg.pid-<pid>.log is used
until after -displayfd finds an open display - then it is renamed
to the traditional Xorg.<display>.log name.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-01-05 14:51:16 -05:00
Alan Coopersmith
fe8562f531 modesetting should not reference gbm when it's not defined
Fixes build errors of:
present.c: In function 'ms_do_pageflip':
present.c:410:17: error: 'drmmode_bo' has no member named 'gbm'
     new_front_bo.gbm = glamor_gbm_bo_from_pixmap(screen, new_front);
                 ^
present.c:412:22: error: 'drmmode_bo' has no member named 'gbm'
     if (!new_front_bo.gbm) {
                      ^
present.c: In function 'ms_present_check_flip':
present.c:536:36: error: 'drmmode_bo' has no member named 'gbm'
         if (drmmode_crtc->rotate_bo.gbm)
                                    ^
Introduced by commit 13c7d53d

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2016-01-05 13:23:56 -05:00
Adam Jackson
792176417f Revert "Fix uninitialized variable warnings reported by clang"
Crashes at startup:

dmt:~/git/xserver% ./hw/kdrive/ephyr/Xephyr :1
(EE) Backtrace:
(EE) 0: ./hw/kdrive/ephyr/Xephyr (OsSigHandler+0x29) [0x47c8f9]
(EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7f38d4de6b1f]
(EE) 2: ./hw/kdrive/ephyr/Xephyr (InitNotifyFds+0x17) [0x478697]
(EE) 3: ./hw/kdrive/ephyr/Xephyr (OsInit+0x1e) [0x47c99e]
(EE) 4: ./hw/kdrive/ephyr/Xephyr (dix_main+0x11c) [0x446efc]
(EE) 5: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7f38d4dd2580]
(EE) 6: ./hw/kdrive/ephyr/Xephyr (_start+0x29) [0x427099]
(EE) 7: ? (?+0x29) [0x29]
(EE)
(EE) Segmentation fault at address 0x0

This reverts commit a221d4737c.
2016-01-05 12:03:54 -05:00
Thomas Klausner
a221d4737c Fix uninitialized variable warnings reported by clang
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
2016-01-05 11:18:48 -05:00
Peter Hutterer
f3593918a0 xfree86: move check for driver->PreInit up
No real change, but if the driver is broken and doesn't provide a PreInit
function, then we don't need to worry about logind.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2015-12-21 07:15:30 +10:00
Peter Hutterer
fc4fbe8224 xfree86: add NoMatchFoo directives for InputClass sections
InputClass sections use various MatchFoo directives to decide which device to
apply to. This usually works fine for specific snippets but has drawbacks for
snippets that apply more generally to a multitude of devices.

This patch adds a NoMatchFoo directive to negate a match, thus allowing
snippets that only apply if a given condition is not set. Specifically, this
allows for more flexible fallback driver matching, it is now possible to use a
snippet that says "assign driver foo, but only if driver bar wasn't already
assigned to it". For example:

Section "InputClass"
   Identifier "libinput for tablets"
   MatchIsTablet "true"
   NoMatchDriver "wacom"
   Driver "libinput"
EndSection

The above only assigns libinput to tablet devices if wacom isn't already
assigned to this device, making it possible to select a specific driver by
installing/uninstalling it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2015-12-18 11:56:46 +10:00
Peter Hutterer
eb671b804e xfree86: whitespace fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-12-18 11:56:46 +10:00
Siim Põder
3d68d1f267 vfb: add randr support (v2)
The motivation for getting this is chrome remote desktop that runs under
Xvfb and wants to use RANDR to adjust screen size according to the
remote desktop client screen size. Apparently there are other use cases
as well, the bug mentions gnome-settings-daemon testing.

[ajax: massaged commit message]

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=26391
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Lambros Lambrou <lambroslambrou@google.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Siim Põder <siim@p6drad-teel.net>
2015-12-09 10:09:21 -05:00
Adam Jackson
e98b36bc69 randr: Silence unused variable warning
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-12-09 09:33:56 -05:00
Adam Jackson
8c49c883dc sync: Don't allow creating a system counter before sync is initialized
It probably doesn't work very well since there's other extension setup
we're not doing on this path, and in any event it's not a thing that
happens currently.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:22:54 -05:00
Adam Jackson
b5f04a79df glxproxy: Silence shadowed-variable warnings
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:18 -05:00
Adam Jackson
18729a211a glxproxy: Silence set-but-unused-variable warnings
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:16 -05:00
Adam Jackson
bc996fa4e3 dmx: Run 'doxygen -u' to upgrade the doxygen config file
Also change the dot font setting back to the default of Helvetica as
doxygen no longer ships FreeSans.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:14 -05:00
Adam Jackson
a55e0bc56f dmx: Silence unused variable warning in dmxcompat
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:13 -05:00
Adam Jackson
2730ccb803 dmx: Silence lex/yacc-related config parser warnings
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-08 18:20:00 -05:00
Laércio de Sousa
718223d274 systemd-logind.c: don't parse VT settings for non-seat0 X servers
Since non-seat0 X servers no longer touch VTs, I believe these settings
are unnecessary.

Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2015-12-08 11:54:11 -05:00
Bob Ham
7c0ba32ddd xserver: Fix configure.ac check for libsystemd/-daemon
The configure script looks for the libsystemd-daemon pkg-config
module.  If the configure script finds it, the script will add
libsystemd-daemon to a list of modules which are used to consolidate
CFLAGS and LIBS.

The check for libsystemd-daemon was altered to fallback to libsystemd
if libsystemd-daemon was not found (libsystemd-daemon was brought into
libsystemd).  Unfortunately, the configure script still adds
"libsystemd-daemon" to the list of modules to consolidate, instead of
"libsystemd".  With this patch, we set a variable depending on which
pkg-config module is found and add that to the module list instead.

Changes since v1:
- Rearranged logic so that we do a versioned check for libsystemd
  first, then look for libsystemd-daemon.
- Cleaned up the check a bit, only performing the module checks if we
  don't have --with-systemd-daemon=no, in a similar style to
  --with-dtrace.
- Changed the variable name to LIBSYSTEMD_DAEMON as per feedback.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Bob Ham <bob.ham@collabora.com>
2015-12-08 11:48:36 -05:00
Michel Dänzer
530d3e5ca0 prime: Damage full destination rectangle when we start dirty tracking
This makes sure that the destination pixmap contents will be fully
initialized. Without this, a PRIME output starts out with garbage.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-12-07 17:05:54 -05:00
Adam Jackson
2a52c06e23 x86emu: Squash a warning
Apologies, should have caught this one when applying the previous x86emu
patch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-12-07 17:05:39 -05:00
Julian Pidancet
59b618227e x86emu: Correctly handle 0x66 prefix for some instructions
(Sorry for double posting)

I repost this patch because I havn't got any replies from maintainers
since I posted the initial patch back in March.

Some instructions are not emulated correctly by x86emu when they
are prefixed by the 0x66 opcode.
I've identified problems in the emulation of these intructions: ret,
enter, leave, iret and some forms of call.

Most of the time, the problem is that these instructions should push or
pop 32-bit values to/from the stack, instead of 16bit, when they are
prefixed by the 0x66 special opcode.

The SeaBIOS project aims to produce a complete legacy BIOS
implementation as well as a VGA option ROM, entirely written in C and
using the GCC compiler.

In 16bit code produced by the GCC compiler, the 0x66 prefix is used
almost everywhere. This patch is necessary to allow the SeaBIOS VGA
option ROM to function with Xorg when using the vesa driver.

SeaBIOS currently use postprocessing on the ROM assembly output to
replace the affected instruction with alternative unaffected instructions.
This is obviously not very elegant, and this fix in x86emu would be
more appropriate.

v2: - Decrement BP instead of EBP in accordance with the Intel Manual
    - Assign EIP instead of IP when poping the return address from the
    stack in 32-bit operand size mode in ret_far_IMM, ret_far, and iret
    - When poping EFLAGS from the stack in iret in 32-bit operand size
    mode, apply some mask to preserve Read-only flags.

v3: - Rebase

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
2015-12-07 14:49:36 -05:00
Chris Wilson
72f0724cdc present: Do not replace Pixmaps on redirected Window on unflip
When unflipping, we may find that our flip window has been redirected.
If we replace the redirected Window with the Screen Pixmap we then have
mutliple fullscreen Windows believing that their own the Screen Pixmap -
multiple fullscreen Windows that are being flipped by Clients, and so
continue to flip causing popping between e.g. the compositor and the
game.

[ajax: Fix up present_execute() hunk to account for changes introduced
in fe07ec19e2]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-12-07 14:37:13 -05:00
Chris Wilson
180b09912c present: When cancelling a pending synchronous flip, requeue it
The vblank event request for a synchronous flip is scheduled for the
vblank before the target flip msc (so that the flip itself appears at
the right frame). If we cancel that flip and so wish to schedule a
copy instead, that copy needs to be postponed by a frame in order for it
be performed at the requested time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-12-07 14:25:43 -05:00
Chris Wilson
b2d55338f6 present: Requery pending flips with the right sync_flip mode
When verifying whether a pending flip is still valid, we need to pass
down the orignal sync_flip mode (e.g. if the driver only supports sync
flips, verifying a async flip will falsely fail).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-12-07 14:25:42 -05:00
Dave Airlie
548a3d5fd6 modesetting: create entities for pci and old probe. (v2)
This moves the code from the platform case into
a common function, and calls that from the
other two.

v2: Emil convinced me we don't need to lookup pEnt
here, so let's not bother.

Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-12-07 11:20:26 +10:00
Dave Airlie
771016f070 modesetting: drop platform_dev pointer.
This isn't used anywhere, so no point storing it until we need it.

Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-12-07 11:20:26 +10:00
Arkadiusz Miśkiewicz
19b0249a5e Xorg.wrap: activate libdrm based detection for KMS drivers
Xorg.wrap includes code guarded with WITH_LIBDRM for detecting KMS drivers.
Unfortunately it is never activated since code missed to include file
which defines WITH_LIBDRM.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92894
Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-12-03 11:05:37 -05:00
Michel Dänzer
5bccde749d randr: Stop dirty tracking for shared pixmap being destroyed
Otherwise, we leave a dangling reference to the destroyed pixmap in the
master screen's pixmap_dirty_list.

Fixes regression from commit cf5d6414 ("randr: Factor out shared pixmap
destruction").

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2015-12-02 10:56:56 -05:00
Adam Jackson
2e3d9623ae Revert "hw/xfree86: Use NotifyFd for device and other input fd wakeups"
Reported to break libinput:

http://lists.freedesktop.org/archives/xorg-devel/2015-December/048091.html

This reverts commit 1df07dc36c.
2015-12-02 10:42:36 -05:00
Keith Packard
7b02f0b87e os: Use NotifyFd interface for listen descriptors
Replace the custom path for dealing with new incoming connections with
the general-purpose NotifyFd API.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:56:15 -05:00
Keith Packard
1df07dc36c hw/xfree86: Use NotifyFd for device and other input fd wakeups
Remove code in xf86Wakeup for dealing with device and other input and
switch to using the new NotifyFd interface.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:56:13 -05:00
Keith Packard
e51ea53b26 render: Use OsTimer for animated cursor timing
This replaces the block/wakeup handlers with an OsTimer. This also
avoids problems with performing rendering during the wakeup handler.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:56:12 -05:00
Keith Packard
49c0f2413d os/xdmcp: Replace xdmcp block/wakeup handlers with timer and NotifyFd
This removes the block and wakeup handlers and replaces them with a
combination of a NotifyFd callback and timers.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:56:10 -05:00
Keith Packard
6a121f5538 Xext/xselinux: Use NotifyFd interface
Replace block/wakeup handlers with SetNotifyFd. Much nicer now.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:56 -05:00
Keith Packard
f933a1b38e hw/xwayland: Use NotifyFd handler to monitor wayland socket
Replace the block/wakeup handler with a NotifyFd callback instead.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:28 -05:00
Keith Packard
8543d4d8bc modesetting: Use NotifyFd for drm event monitoring
Replace the block/wakeup handlers with a NotifyFd callback.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:25 -05:00
Keith Packard
58354fcf47 kdrive/ephyr: Use NotifyFd for XCB connection input [v2]
Eliminates polling every 20ms for device input.

v2: rename ephyrPoll to ephyrXcbNotify and fix the API so it can be
    used directly for SetNotifyFd. Thanks to Daniel Martin
    <consume.noise@gmail.com>

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Cc: Daniel Martin <consume.noise@gmail.com>
2015-12-01 13:55:20 -05:00
Keith Packard
483c2a1adf hw/kdrive: Use NotifyFd for kdrive input devices
This switches the kdrive code to use FD notification for input
devices, rather than the block and wakeup handlers.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:18 -05:00
Keith Packard
21c1680e83 hw/kdrive: Use NotifyFd interface for kdrive/linux APM monitoring
Replace the block/wakeup handlers with a NotifyFd callback

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:16 -05:00
Keith Packard
8c8f3567fe config: Use NotifyFd interface for udev
This uses the NotifyFd interface to monitor the udev file descriptor
rather than adding another block/wakeup handler

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:15 -05:00
Keith Packard
bf920b2390 config: Use NotifyFd for dbus interface
This uses the NotifyFd interface to monitor the dbus socket rather
than a block/wakeup handler.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:13 -05:00
Keith Packard
91ea0965dd dix: Move InitFonts up above screen initialization
Font initialization was split into two stages, the first was to set up
font privates with a call to ResetFontPrivateIndex, then much later
the call to InitFonts to set up all of the FPEs. Doing the full font
initialization before initializing the video drivers means that we can
move the call to ResetFontPrivateIndex inside InitFonts.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:11 -05:00
Keith Packard
4020aacd1f os: Implement support for NotifyFd X_NOTIFY_WRITE
This adds the ability to be notified when a file descriptor is
available for writing.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:07 -05:00
Keith Packard
0c41b7af4a os: Add NotifyFd interfaces
This provides a callback-based interface to monitor file
descriptors beyond the usual client and device interfaces.

Modules within the server using file descriptors for reading and/or
writing can call

    Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data);

mask can be any combination of X_NOTIFY_READ and X_NOTIFY_WRITE.

When 'fd' becomes readable or writable, the notify_fd function will be
called with the 'fd', the ready conditions and 'data' values as arguments,

When the module no longer needs to monitor the fd, it will call

    void RemoveNotifyFd(int fd);

RemoveNotifyFd may be called from the notify function.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:55:03 -05:00
Keith Packard
e10ba9e4b5 Remove non-smart scheduler. Don't require setitimer.
This allows the server to call GetTimeInMillis() after each request is
processed to avoid needing setitimer. -dumbSched now turns off the
setitimer.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-12-01 13:54:54 -05:00