Commit Graph

14498 Commits

Author SHA1 Message Date
Peter Hutterer
adee4f239b xfree86: drop double-typedef of DBusConnection
Just include dbus.h, it's been typedef'd there since 2003.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Peter Hutterer
25315ee555 Xext: fix clang compiler warning
shm.c:1150:24: warning: equality comparison with extraneous parentheses
[-Wparentheses-equality]
    if ((shmdesc->addr == ((char *) -1))) {

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Peter Hutterer
995ecfb51d include: change RegionSize() to take a size_t
/usr/include/xorg/regionstr.h:130:36: warning: implicit conversion changes
signedness: 'int' to 'unsigned long' [-Wsign-conversion]
    return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)));
                                   ^  ~

Really only just pushes the problem to the caller, but maybe that motivates
someone to fix it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Peter Hutterer
3ccec1b5ba include: fix documentation for list.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-11-12 10:24:55 +10:00
Peter Hutterer
b227d97456 include: fix compiler warning about casting int to uint16_t
/usr/include/xorg/misc.h:141:30: warning: implicit conversion loses integer
precision: 'int' to 'uint16_t' (aka 'unsigned short') [-Wconversion]
    return ((x & 0xff) << 8) | ((x >> 8) & 0xff);
        ~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

Function sig is a uint16_t, so just force the cast.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-10-30 09:07:49 +10:00
Keith Packard
e9db768202 Update to version 1.16.99.901
1.17 RC1

Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-28 21:32:24 -07:00
Keith Packard
5ff74d68b0 xfree86: Include 'drivers' directory with distribution
Even if we don't build it locally, make sure it gets included with the release.

Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-28 21:31:40 -07:00
Keith Packard
f36f16f055 dri2: Distribute new pci_ids headers
Create hw/xfree86/dri2/pci_ids/Makefile.am which includes all of the new
pci id files in the tarballs. Build that from configure.ac, and run it
from dri2/Makefile.am

Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-28 21:30:23 -07:00
Keith Packard
65dd1ba7b3 dix: Untwist transformAbsolute logic, eliminate uninitialized value warnings
tranformAbsolute has a pretty simple job, that of running the X/Y
values from a device through the transformation matrix. The tricky bit
comes when the current device state doesn't include one of the
values. In that case, the last delivered value is back-converted to
device space and used instead.

The logic was twisted though, confusing GCC's uninitialized value
detection logic and emitting warnings.

This has been fixed by changing the code to:

 1) Detect whether the ValuatorMask includes X/Y values
 2) If either are missing, back-convert the current values into ox/oy
 3) When X/Y are present, set ox/oy to the current value
 4) Transform
 5) Store X/Y values if changed or if they were set before.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-10-28 20:56:37 -07:00
Adam Jackson
0fbbdb37c8 composite: Wrap GetSpans
GetSpans should flush composition from children to parent, just like
GetImage and SourceValidate.  Fortunately no one is likely to have
noticed, since to hit this you're already deep into failure town.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-28 11:29:48 -07:00
Keith Packard
da70c7d556 xkb: Initialize 'bad' Atom in _XkbSetNamesCheck
When _XkbCheckAtoms returns NULL for an error, it always sets the
error return code, but GCC can't figure that out, so just initialize
the local variable, 'bad', in _XkbSetNamesCheck to eliminate the warning.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-10-28 11:26:23 -07:00
Keith Packard
2566835b43 os: Eliminate uninitialized value warnings from access.c
The ConvertAddr function doesn't reliably set the 'addr' return value,
and so callers are getting flagged for using potentially uninitialized
values. Initialize the value in the callers to NULL and then go ahead
and check for NULL values before using them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-10-28 11:25:56 -07:00
Alex Orange
1b94fd7779 fb: Fix Bresenham algorithms for commonly used small segments.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54168

Fix errors introducted in 863d528a9f. Said
patch does indeed remove the problematic writes to bad memory, however
it also introduces errors in the algoritm. This patch has the effect of
reverting said patch and adding an if in the proper location to catch
the out of bounds memory write without causing problems to the overall
algorithm.

Signed-off-by: Alex Orange <crazycasta@gmail.com>
Reviewed-by: Peter Harris <pharris@opentext.com>
Tested-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-27 16:35:56 -07:00
Jon TURNEY
ea5b2b0a2e os: -displayfd should check ports up to 65535
-displayfd should check ports up to 65535

Noticed during https://cygwin.com/ml/cygwin-xfree/2014-07/msg00024.html

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-27 15:44:26 -07:00
Keith Packard
3a123fbdda Merge remote-tracking branch 'jturney/master'
Conflicts:
	hw/xwin/winpixmap.c

Adam removed a pile of windows code, including this file.
2014-10-27 15:39:26 -07:00
Chris Wilson
9b29fa957a Xext/shm: Detach SHM segment after Pixmap is released
The GPU may still have a reference to the SHM segment which would only
be finally released when the Pixmap is destroy. So we can only detach
the SHM segment (and thereby making the memory unaccessible) after the
backend has had a chance to flush any remaining references.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85058
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reported-and-tested-by: gedgon@gmail.com
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-27 15:33:48 -07:00
Keith Packard
5adc20179e modesetting: Skip kernel work-around on error in crtc to kernel msc
ms_crtc_msc_to_kernel_msc attempts to work around kernel
inconsistencies in reporting msc values by comparing the expected
value with the reported value. If the kernel fails to
actually provide its current values, then just skip the work around
steps as there's really nothing better we can do.

Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-27 15:28:14 -07:00
Keith Packard
59b12c454d Merge remote-tracking branch 'anholt/modesetting-dri2-no-pageflip' 2014-10-27 14:48:55 -07:00
Keith Packard
5574a0a07e composite: Skip SetWindowPixmap when pixmap isn't changing
Check the current window pixmap to see if it matches the new pixmap
and avoid calling SetWindowPixmap in that case.

x11perf -ucreate highlights an instance where compCreateWindow reassigns
the same Pixmap to the Window. Currently this triggers an expensive
invalidation of the entire window hierachy, making sure that DRI2
clients are kept informed of the handle changes. However, as the backing
Pixmap for the Window is actually unchanged, there is no need to
do anything in this case.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-27 13:38:21 -07:00
Yogish Kulkarni
df6a3a07f6 Skip SetCursor when vtSema is FALSE.
Consider below sequence -
1) Cursor is removed : isUp will be FALSE if HW cursor is set.
2) VT switched away from X : vtSema becomes FALSE.
3) xf86CursorSetCursor is called with non-null CursorPtr :
Saves the passed in CursorPtr, fallbacks to SW cursor and invokes
spriteFuncs->SetCursor which saves the area under cursor and restores
the cursor. This sets isUp to TRUE and as vtSema is FALSE saved data
is garbage.
4) VT switched to X : vtSema becomes TRUE. xf86Cursor enable fb access
is called which will remove the SW cursor, i.e copies saved data in #3
to screen.

This results to momentary garbage data on screen. Hence when !vtSema
skip spriteFuncs->SetCursor.

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

Signed-off-by: Yogish Kulkarni <yogishk@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-27 13:36:20 -07:00
Eric Anholt
cac4b064f9 modesetting: Add support for DRI2 with glamor.
This is derived from the intel driver DRI2 code, with swapchain and
pageflipping dropped, functions renamed, and vblank event management
shared code moved to a vblank.c for reuse by Present.

This allows AIGLX to load, which means that you get appropriate
visuals exposed in GL, along with many extensions under
direct-rendering that require presence in GLX (which aren't supported
in glxdriswrast.c).

v2: Drop unused header includes in pageflip.c, wrap in #ifdef GLAMOR.
    Drop triple-buffering, which was totally broken in practice (I'll
    try to fix this later).  Fix up some style nits.  Document the
    general flow of pageflipping and why, rename the DRI2 frame event
    type enums to reflect what they're for, and handle them in a
    single switch statement so you can understand the state machine
    more easily.
v3: Drop pageflipping entirely -- it's unstable on my Intel laptop
    (not that the normal 2D driver is stable with pageflipping for
    me), and I won't get it fixed before the merge window.  It now
    passes all of the OML_sync_control tests from Jamey and Theo
    (except for occasional warns in timing -fullscreen -divisor 2).
v4: Fix doxygen at the top of vblank.c

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-10-27 13:16:43 -07:00
Eric Anholt
7064b00d47 modesetting: Export two functions I want to reuse from DRI2/Present.
This renames dumb_get_bo_from_handle(), since it wasn't using a handle
(GEM terminology) but a dmabuf fd.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-27 13:16:35 -07:00
Eric Anholt
34a98c8103 dri2: Automatically fill in the driver name if the DDX doesn't provide it.
This will be used by the modesetting driver to support DRI2 across all
hardware that can support glamor, and could potentially be used by
other drivers that have to support DRI2 on sets of hardware with
multiple Mesa drivers.

This logic is the same as what's present in the Mesa driver loader,
except for the lack of nouveau_vieux support (which requires a
predicate on the device).

v2: Fix duplicated assignment of info->driverName.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-10-27 13:16:23 -07:00
Eric Anholt
470d97e1d1 dri2: Import a copy of Mesa's PCI ID -> driver name mappings.
This comes from Mesa commit acdcef6788beaa2a1532e13ff84c3e246b8025ed

Previously, each driver had to tell DRI2 what GL driver object should
be loaded.  Originally for a 2D driver that was a matter of giving the
constant string for the vendor name, same as the driver's name.  For a
driver that's trying to handle multiple generations of hardware with
different Mesa driver filenames, the driver had to bake in a mapping
from PCI ID to the appropriate driver name in Mesa, which seems like a
pretty awful layering violation (and one that was fixed with DRI3)

As of January, Mesa now handles the mapping from a DRI fd to the
driver name on its own, but the AIGLX loader still relies on DRI2 for
choosing the filename.  Instead of propagating the PCI ID list from
each 2D driver to the modesetting driver, import a central copy of the
PCI ID list so that drivers can stop handling this themselves.  (Some
day, when AIGLX transitions to EGL, we can drop the DRI2 filename
setup entirely).

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-10-27 13:15:18 -07:00
Adam Jackson
839f05329d dix: Retype and repack GC
LP64: 160 bytes before, 128 after.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-10-27 13:01:43 -07:00
Adam Jackson
73e2383b73 dix: Always store GC client clip as a region (v2)
Again, this changes FixesCreateRegionFromGC to throw BadMatch when fed a
GC with no client clip.

v2: Fix Xnest and some variable names (Keith)

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:46:05 -04:00
Adam Jackson
e7b9295551 fb: Hide fbPush{Pattern,Fill}
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:57 -04:00
Adam Jackson
e31d16a82d fb: Hide fbDots
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:55 -04:00
Adam Jackson
5db0f067ed fb: Hide Bresenham line details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:53 -04:00
Adam Jackson
b184a863c1 fb: Hide some zero-width line details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:52 -04:00
Adam Jackson
266cd552bd fb: Hide glyph implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:48 -04:00
Adam Jackson
e572bcc7f4 fb: Remove even/odd tile slow-pathing
Again, clearly meant to be a fast path, but this turns out not to be the
case.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:46 -04:00
Adam Jackson
836bb27726 fb: Remove unused fbReduceRasterOp
Appears to have been cargo-culted in from cfb and then never used.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:44 -04:00
Adam Jackson
167ccd33e0 fb: Move fbStipple*Bits near their only consumer
And remove fbStippleTable since gcc can't figure that out itself.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:41 -04:00
Adam Jackson
7430fdb689 fb: Remove even/odd stipple slow-pathing
This is clearly meant to be a fast path, but it appears to be a net
loss at this point.

If you really wanted to ricer-tune here, note that the inner loop of
fbBltOne is a bit too complicated for gcc (at least 4.8.2), it doesn't
specialize the loop for the handful of legal values of bitsPerDst, which
means computing at runtime what could have been const-propped.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:38 -04:00
Adam Jackson
a198373685 fb: FB_SHIFT is 5 (and FB_UNIT is 32)
The other paths don't build or work, PCI and other buses are almost
always 32 bit data paths, and X doesn't really support pixels bigger
than that anyway.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:37 -04:00
Adam Jackson
3d35bd6b79 fb: Eliminate fbLaneTable, staticize fb{8,16,32}Lane
gcc doesn't appear to be smart enough to fold away the indirection here,
even if you make fbLaneTable const.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:30 -04:00
Adam Jackson
86ce626297 mi: Fold micursor.c into mipointer.c
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:29 -04:00
Adam Jackson
3b63900e90 mi: Fold mipolyutil.c into mipoly.c
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:28 -04:00
Adam Jackson
21b041ef48 mi: Fold mipoly{con,gen}.c into mipoly.c
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:26 -04:00
Adam Jackson
7679afd4da mi: Fold mifpolycon.c into miarc.c
Also put mifpoly.h on a diet, and stop including it from places that
don't need it.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:24 -04:00
Adam Jackson
f307ef10f4 mi: Fold mispans.c into miwideline.c
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:22 -04:00
Adam Jackson
707965407a mi: Unexport arc fill implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:21 -04:00
Adam Jackson
ce8fff5cd6 mi: Unexport subpixel polygon implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:19 -04:00
Adam Jackson
a085ba82bd mi: Unexport span group implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:18 -04:00
Adam Jackson
c15c886ee7 mi: Unexport polygon edge table implementation details
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:16 -04:00
Adam Jackson
9bdc9b0113 mi: Unexport wide line details
XAA wanted these, once upon a time, but that's gone now.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-27 15:45:01 -04:00
Keith Packard
d181e52ceb glamor: Free converted bits in _glamor_upload_bits_to_pixmap_texture fast path
When uploading bits to a texture which need reformatting to match a
supported GL format, a temporary buffer is allocated to hold the
reformatted bits. This gets freed in the general path, but is not
freed in the fast path because that includes an early return before
the call to free.

This patch removes the early return and places the general case under
an 'else' block, so that both paths reach the call to free.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-10-26 17:00:17 -07:00
Andreas Hartmetz
55b27ed70c glamor: Don't free memory we are going to use.
glamor_color_convert_to_bits() returns its second argument on
success, NULL on error, and need_free_bits already makes sure that
"bits" aliasing converted_bits is freed in the success case.
Looks like the memory leak that was supposed to be fixed in
6e50bfa706 only occurred in the error
case.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-26 17:00:17 -07:00
Alan Coopersmith
16a32c53f6 If fork fails in System(), don't fallthrough to exec()
In the unlikely event of a failure in creating processes, signal
masks will fall from the panels above you.  Secure your mask before
telling your child what to do, since it won't exist, and you will
instead cause the server itself to be replaced by a shell running
the target program.

Found by Coverity #53397: Missing break in switch
Execution falls through to the next case statement or default;
 this might indicate a common typo.
In System: Missing break statement between cases in switch statement (CWE-484)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-10-23 17:32:14 -07:00