Commit Graph

14291 Commits

Author SHA1 Message Date
Eric Anholt
7b0965a826 modesetting: Drop use of compat-api.h
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-16 16:28:50 -07:00
Eric Anholt
2feda3b6b5 modesetting: Connect the driver to the build.
v2: Fix libdrm version check, and use XORG_VERSION_* instead of a
    static 1.0.0 version for the driver module.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-16 16:28:42 -07:00
Eric Anholt
6d6aa8ab6b modesetting: Update for the platform device API change.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:47:19 -07:00
Eric Anholt
9c080f4496 modesetting: Drop use of "pointer" for "void *"
The xserver doesn't have that typedef.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:47:12 -07:00
Eric Anholt
a10ea01475 modesetting: xserver already checks XEXTPROTO >= 7.2.99.901.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:47:06 -07:00
Eric Anholt
c7e8d4a6ee modesetting: unifdef MODESETTING_OUTPUT_SLAVE_SUPPORT
The server will always have it.

v2: Clean up some weird formatting from the unifdeffing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:46:43 -07:00
Eric Anholt
0c07bfb38e modesetting: Merge modesetting's COPYING into the xserver's.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-09-15 12:46:02 -07:00
Eric Anholt
35dc7c7515 Merge branch 'modesetting-import' into master
This reintroduces a "hardware" driver to the xfree86 directory.
Unlike the drivers that xorg used to include in the source tree, that
needed independent release schedules to get hardware support out the
door, the modesetting driver shouldn't change much as new hardware
gets released.  A lot of what this driver needs to do is just keep up
with server ABI changes.

This import was done by taking xf86-video-modesetting-0.9.0, and
running this script with 'git-filter-branch -f --tree-filter
~/bin/modesetting-filter':

mkdir -p hw/xfree86/drivers/modesetting

rm -f README autogen.sh configure.ac Makefile.am .gitignore
rm -f man/Makefile.am

mv man/modesetting.man hw/xfree86/drivers/modesetting/
mv COPYING hw/xfree86/drivers/modesetting/
mv src/* hw/xfree86/drivers/modesetting/
2014-08-26 11:07:55 -07:00
Laércio de Sousa
3a51418b2d ephyr: set screen size & origin from host X server output's CRTC geometry
If a given output is passed via new -output option, Xephyr will query
host X server for its info. If the following conditions are met:

 a. RandR extension is enabled in host X server;
 b. supported RandR version in host X server is 1.2 or newer;
 c. the given output name is valid;
 d. the given output is connected;

then Xephyr will get output's CRTC geometry and use it to set its own
screen size and origin. It's just like starting Xephyr in fullscreen mode,
but restricted to the given output's CRTC geometry (fake "Zaphod mode").

This is the main feature needed for Xephyr-based single-card multiseat
setups where we don't have separate screens to start Xephyr in fullscreen
mode safely.

Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-21 20:14:55 -05:00
Laércio de Sousa
84b02469ef ephyr: enable screen window placement following kdrive -screen option extended syntax
With this patch, one can launch Xephyr with option "-screen WxH+X+Y"
to place its window origin at (X,Y). This patch relies on a previous
one that extends kdrive -screen option syntax to parse +X+Y substring
as expected.

If +X+Y is not passed in -screen argument string, let the WM place
the window for us, as before.

Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-21 20:14:55 -05:00
Laércio de Sousa
376f4de8ae kdrive: add support to +X+Y syntax in -screen option parsing
This patch enhances current -screen option parsing for kdrive-based
applications. It can parse strings like
<WIDTH>x<HEIGHT>+<XOFFSET>+<YOFFSET>, storing X and Y offsets
in KdScreenInfo instances.

For negative values, this patch supports +-X+-Y (not -X-Y) syntax.

It will allow e.g. proper Xephyr window placement for multiseat
purposes.

Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-21 20:14:54 -05:00
Takashi Iwai
fe5018e056 fb: Fix invalid bpp for 24bit depth window
We have a hack in fb layer for a 24bpp screen to use 32bpp images, and
fbCreateWindow() replaces its drawable.bitsPerPixel field
appropriately.  But, the problem is that it always replaces when 32bpp
is passed.  If the depth is 32, this results in bpp < depth, which is
actually invalid.

Meanwhile, fbCreatePixmap() has a more check and it creates with 24bpp
only when the passed depth <= 24 for avoiding such a problem.

This oneliner patch just adds the similar check in fbCreateWindow().
This (hopefully) fixes the long-standing broken graphics mess of
cirrus KMS with 24bpp.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-21 20:10:41 -05:00
Thierry Reding
5d133276de xfree86: Allow non-PCI devices as primary
On platforms that don't support PCI or have no GPU attached to the PCI
bus, there can still be a primary device on a non-PCI bus.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-21 20:04:08 -05:00
Thierry Reding
2f0183222b xfree86: Fallback to first platform device as primary
When neither of the various bus implementations was able to find a
primary bus and device, fallback to using the platform bus as primary
bus and the first platform device as primary device.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-21 20:03:48 -05:00
Keith Packard
33aeec8a11 dri3: Don't enable the DRI3 extension unless some screen supports it
There's no reason to advertise this extension unless one of the
hardware drivers actually supports it. Not listing it means it's
slightly easier for users to tell what's going on.

On the other hand, not listing it means we may have applications that
only check for the extension and not for appropriate per-screen
support. I don't think that's a real risk as DRI3 is only useful for
systems with deep knowledge of the hardware.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-17 14:37:44 -07:00
Michel Dänzer
0d7306ffe2 glamor: Don't call glamor_copy_fbo_cpu() for GLAMOR_DRM_ONLY pixmaps
It results in a crash.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-17 14:20:57 -07:00
Joerg Sonnenberger
c2548d71f7 Fix format string.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-17 14:18:45 -07:00
Keith Packard
d4111239e6 glamor: Free Xv put image data immediately after use
The Xv StopVideo callback is not invoked on textured video ports, so
the temporary pixmaps allocated for the video planes are never freed.

Freeing the storage immediately after use is a simple solution to this
problem which doesn't appear to have any visible performance impact.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-08-17 14:17:30 -07:00
Eric Anholt
c47ee880e7 glamor: Don't try to set up core fonts textures when we won't use them.
This happens to avoid GL errors on hardware without
EXT_texture_integer (which implies < GLSL 130, and thus glamor_text.c
programs not compiling anyway).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-12 16:37:11 -07:00
Keith Packard
d09c9ddb86 Merge remote-tracking branch 'jeremyhu/master' 2014-08-12 16:34:24 -07:00
Michel Dänzer
606b701c56 glamor: Add glamor_copy_fbo_cpu() for CopyArea to non-GPU destination
This provides a speedup e.g. when the destination is an SHM pixmap.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76285
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-12 15:55:01 -07:00
Peter Hutterer
1e30fc1b99 xkb: ignore floating slave devices when updating from master (#81885)
Introduced in 45fb3a934d. When a device is
enabled, the master's locked state is pushed to the slave. If the device is
floating, no master exists and we triggered a NULL-pointer dereference
in XkbPushLockedStateToSlaves.

X.Org Bug 81885 <http://bugs.freedesktop.org/show_bug.cgi?id=81885>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-12 15:53:51 -07:00
Daphne Pfister
4599a4492c os: Regenerate os/oscolor.c from app/rgb #52289
Regenerate os/oscolor.c from rgb.txt. This adds the following
colors: aqua, lime, fuchsia, crimson, indigo, olive, rebecca
purple, silver and teal. It also adds versions of gray, grey,
green, maroon and purple prefixed with web and x11 for the
colors that are different between X11 and HTML/CSS web colors.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52289
Related: https://bugs.freedesktop.org/show_bug.cgi?id=80371

Signed-off-by: nobody
Tested-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-12 15:51:52 -07:00
Keith Packard
ee9f766abf xfree86: [v2] Remove duplicate InputInfoPtr typedef from xf86Xinput.h
GCC 4.2 doesn't accept 2 typedef declarations of the same type, so
remove the extra one from xf86Xinput.h and have xf86Xinput.h #include
xf86.h to make sure everyone using just that file gets the typedef.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
2014-08-12 15:36:57 -07:00
Jeremy Huddleston Sequoia
ab32ee3589 XQuartz: Better support turning off "Displays have separate Spaces" on OS X Mavericks
http://xquartz.macosforge.org/trac/ticket/1876

Follow-up to: 1c10b37380

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-08-11 13:18:51 -07:00
Jeremy Huddleston Sequoia
dfbc6a1a78 ListenOnOpenFD: Remove Resets since this is intended to be for hotplugging connections
pharris says that the resets should not be done in the hotplugging case.

This may fix a crash reported against XQuartz:
http://xquartz.macosforge.org/trac/ticket/869

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Peter Harris <pharris@opentext.com>
2014-08-11 12:49:54 -07:00
Eric Anholt
3714f54016 kdrive: Remove a dead struct.
It's never been used in the history of the tree.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-07 12:39:53 -07:00
Eric Anholt
ef258fa4fd xv: Drop the ClientPtr from the interface to the DDX.
Nobody was using it.

v2: Merge the hunk that was accidentally in the previous commit into
    this one.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-07 12:39:53 -07:00
Eric Anholt
850b268e2b xv: Remove the no-op AllocatePort/FreePort interfaces.
v2: Fix accidentally squashed-in change for dropping client from the
    arguments, which should have been in the next commit.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com> (v2)
2014-08-07 12:39:48 -07:00
Eric Anholt
41d4a626c6 kdrive: Don't bother explicitly clearing new window privates to NULL.
Privates are initially cleared to zero by dixInitPrivates().

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
e311318b35 kdrive: Remove dead KXVPaintRegion().
It's been unused since mach64 was deleted, and now there's a helper in
core XV.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
7eac142fb6 xv: Fix malloc-failure cases in the fill color key helper.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
ea3f3b0786 xv: Move xf86 XV color key helper to core.
Color key overlay implementations want to reuse this code, and XF86's
had bugs (to be fixed in the next commit).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
b01cfe5f23 xv: Move CloseScreen setup from a DIX hook to normal wrapping.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
6a71ee79aa xv: Drop unused XvdiVideoStopped().
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
4a095902a3 xv: Drop unused XvdiPreemptVideo().
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
e7dde86f23 xv: Move the DDX XV screen private allocation into the DDXes.
XV was going against convention by having the core infrastructure
allocate the private on behalf of the DDX.  I was interested in this
because I was trying to make multiple pieces of DDX be able to
allocate adaptors, and that wasn't going to work if DDX-specific code
was hung off of a single global screen private.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
a146c6d421 xv: Drop the ddQueryAdaptors() interface.
The core was passing pointers to pxvs's nAdaptors and pAdaptors, and
the two hardware implementations were copying pxvs's nAdaptors and
pAdaptors into those pointers.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
cb42805c66 xv: Move common code for adaptor cleanup to xvmain.c
Since any DDX XV screen cleanup would need this same code for freeing
the tree of pointers for xv adaptors, move it to the dix.

v2: Unconditionalize the pPorts freeing, to match the block above it.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com> (v1)
2014-08-06 20:12:20 -07:00
Eric Anholt
8cb0da2940 xv: Remove dead VIDEO_NO_CLIPPING from the xorg and kdrive DDXes.
As far as I can see, nothing has ever used this flag except possibly
the i.mx6 xorg ddx debug during bringup.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Eric Anholt
a6ec7d5278 xv: Remove dead VIDEO_INVERT_CLIPLIST from the xorg and kdrive DDXes.
As far as I can see (looking at trees on my disk, plus googling for
the term), nothing has ever used this flag

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-08-06 20:12:20 -07:00
Egbert Eich
e6c8c7e46c BellProc: Send bell event on core protocol bell when requested
XKB allows to override the BellProc() ringing the 'keyboard bell':
instead an event is sent to an X client which can perform an
appropriate action.
In most cases this effectively prevents the core protocol bell
from ringing: if no BellProc() is set for the device, no attempt
is made to ring a bell.
This patch ensures that an XKB bell event is sent also when
the core protocol bell is rung end thus an appropriate action
can be taken by a client.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-08-04 22:02:26 -07:00
Keith Packard
e8373e4b6a Add X_BYTE_ORDER to xorg-server.h
Drivers don't get to use dix-config.h, they use xorg-server.h
instead. Add X_BYTE_ORDER to that file so drivers can see the value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-31 21:42:04 -07:00
Michel Dänzer
e31564e1a2 Check for dix-config.h or xorg-server.h before using X_BYTE_ORDER
Now that servermd.h depends on X_BYTE_ORDER being defined in
dix-config.h or xorg-server.h, check to make sure one of those has
been included before using the value.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-07-31 08:35:13 -07:00
Keith Packard
61afe950e6 xfree86/modes: rotation damage is automatically destroyed on close
Don't try to destroy rotation_damage in the xf86RotateCloseScreen; it
will have been destroyed when the screen pixmap was destroyed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-07-31 00:03:58 -07:00
Keith Packard
40dc81154a present: Avoid crash at server shutdown
When a present flip operation is still in process during server reset,
the call to present_set_abort_flip may not happen until the screen is
being closed, at which point there is no root window to set pixmaps
for. Check to make sure there's a window before resetting window pixmaps.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-07-31 00:03:55 -07:00
Keith Packard
627bce8089 present: Make window MSC offset 0 initially
The MSC offset used by a window is adjusted as the window moves
between screens, and between shown/unshown. The value shouldn't
matter, but it's helpful for debugging to have window MSC values be
the same as the CRTC MSC at first.

This patch introduces a unique CRTC value so that Present can detect
the first time a window is a PresentPixmap destination and set the MSC
offset to zero, rather than using the fake MSC value as the previous
window MSC.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-07-31 00:03:53 -07:00
Keith Packard
bd4198b01f xfree86: Avoid compiler warning for unused vars without systemd
When systemd isn't being used, systemd_logind_release_fd is defined
as an empty macro, leaving the arguments unused. Fix the compiler
warnings by simply removing the local variables and referencing the
structure within the macro call.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-07-31 00:03:39 -07:00
David Ung
b063a185ab randr: Fix logic in RRPointerToNearestCrtc
RRPointerToNearestCrtc is suppose to snap to the nearest Crtc,
but best_x and best_y is always positive, hence when calling
SetCursorPosition it will make the cursor even further away.
Correct delta x/y to allow negative values and also use
"width/height -1" in the calculation.  Also choose the closest
Crtc by setting the "best" value.

Signed-off-by: David Ung <davidu@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-07-30 14:40:17 -07:00
Keith Packard
90803042bc Fix files including xorg-server.h by mistake
A few files in the server are including xorg-server.h, which is only
for use by Xorg server drivers. This fixes those errors and then adds
a check to make sure it doesn't happen again.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-07-30 12:17:27 -07:00