Commit graph

12581 commits

Author SHA1 Message Date
Jeremy Huddleston Sequoia
daaada9113 XQuartz: Mark applicationWillTerminate: noreturn
X11Controller.m:938:1: warning: method 'applicationWillTerminate:' could be declared with attribute 'noreturn'
      [-Wmissing-noreturn,Semantic Issue]
{
^

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit f79af19417)
2014-01-22 15:17:00 -08:00
Jeremy Huddleston Sequoia
9ec1c29d75 XQuartz: Fix darwinfb.h header guard
./darwinfb.h:28:9: warning: '_DARWIN_FB_H' is used as a header guard here, followed by #define of a different macro
      [-Wheader-guard,Lexical or Preprocessor Issue]
        ^~~~~~~~~~~~
./darwinfb.h:29:9: note: '_DARWIN_DB_H' is defined here; did you mean '_DARWIN_FB_H'? [Lexical or Preprocessor Issue]
        ^~~~~~~~~~~~
        _DARWIN_FB_H

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 2e3ebec952)
2014-01-22 15:16:36 -08:00
Jeremy Huddleston Sequoia
af520d6710 XQuartz: Silence some static analyzer warnings by annotating referencing counts
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 9da6c0918f)
2014-01-22 15:16:09 -08:00
Jeremy Huddleston Sequoia
de32ca3f24 XQuartz: Use asl_log_descriptor to log stdout/stderr of child processes
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit d7c9235ee2)
2014-01-12 23:10:24 -08:00
Jeremy Huddleston Sequoia
3218c1433f darwin: Don't leave stdin/stdout closed
<rdar://problem/15609419>

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit ad8111d7c9)
2014-01-12 23:10:18 -08:00
Matt Dew
200f98894a bump version from 1.14.4.901 to 1.14.5 2013-12-12 20:51:27 -07:00
Matt Dew
c30db601a6 bump version to 1.14.4.901 2013-11-21 21:55:35 -07:00
Matt Dew
384588bd84 Merge commit '7ddc6f7f1ed0e0f85b2d617c59d75d5de1cd2d5a' into server-1.14-branch 2013-11-16 15:27:35 -07:00
Peter Hutterer
6cc5efa68e sync: fix corner-case in triggering idle alarms
ProcessInputEvent() resets the device idle times. If idle time was higher than
the lower bracket, this should trigger an event in the idle time wakeup
handler.

If processing is slow, the idle time may advance past the lower bracket
between the reset and the time the BlockHandler is called. In that case, we'd
never schedule a wakeup to handle the event, causing us to randomly miss
events.

Ran tests with a neg transition trigger on 5ms with 200 repeats of the test
and it succeeded. Anything below that gets a bit tricky to make sure the
server sees the same idle time as the client usleeps for.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f36f5a65f6)
2013-11-16 15:15:05 -07:00
Jeremy Huddleston Sequoia
7ddc6f7f1e 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>
(cherry picked from commit 4a251f5883)
2013-11-13 08:55:49 -08:00
Jeremy Huddleston Sequoia
c6fd9c11f7 XQuartz: Don't sleep forever on exit if usleep() returns an error
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit f70a8bf371)
2013-11-13 08:55:49 -08:00
Jeremy Huddleston Sequoia
c82a90815c XQuartz: Update Info.plist copyright years
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit ebcc1c214c)
2013-11-13 08:55:49 -08:00
Eric Anholt
339af2ae94 glx: Add support for the new DRI loader entrypoint.
This is going to be exposed (and not the old entrypoint) for some DRI
drivers once the megadrivers series lands, and the plan is to
eventually transition all drivers to that.  Hopefully this is
unobtrusive enough to merge to stable X servers so that they can be
compatible with new Mesa versions.

v2: typo fix in the comment

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-06 19:52:01 -07:00
Matt Dew
833639d265 Merge commit '94b7f26aeda31cf55ff9b7c04f390ba6d35977e4' into server-1.14-branch 2013-11-05 20:06:28 -07:00
Michal Srb
cf684f0518 randr: deliver Output and Crtc events of attached output providers.
Consider all attached output providers when looking for changed outputs and
crtcs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 85ae44f07f)
2013-11-05 13:28:21 +10:00
Michal Srb
87d66ccfec randr: send RRResourceChangeNotify event (abi unbreak)
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.

[airlied: move structure member to avoid ABI breakage]

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit a9ca93dcf9)
2013-11-05 13:26:33 +10:00
Michal Srb
9cc5d700b1 randr: send RRProviderChangeNotify event (abi unbreak)
Send RRProviderChangeNotify event when a provider becomes output source or
offload sink.

[airlied: unbreak the ABI for 1.14 backport.]

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 4b39ea8a91)
2013-11-05 13:25:48 +10:00
Dave Airlie
4cd0af4bb2 randr: report changes when we disconnect a GPU slave
When we disconnect an output/offload slave set the changed bits,
so a later TellChanged can do something.

Then when we remove a GPU slave device, sent change notification
to the protocol screen.

This allows hot unplugged USB devices to disappear in clients.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 9d26e8eaf5)
2013-11-05 13:24:40 +10:00
Dave Airlie
33b110d2dd randr: only respected changed on the protocol screen
We don't want to know about changes on the non-protocol screen,
we will fix up setchanged to make sure non-protocol screens update
the protocol screens when they have a change.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit e233bda3e7)
2013-11-05 13:24:11 +10:00
Dave Airlie
8d923f090f randr: make SetChanged modify the main protocol screen not the gpu screen
When SetChanged is called we now modify the main protocol screen,
not the the gpu screen. Since changed stuff should work at the protocol level.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit b3f70f38ed)
2013-11-05 13:23:50 +10:00
Dave Airlie
cc9579aee3 randr: don't directly set changed bits in randr screen
Introduce a wrapper interface so we can fix things up for multi-gpu
situations later.

This just introduces the API for now.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit f9c8248b83)
2013-11-05 13:23:21 +10:00
Adam Jackson
98ef5bc9aa randr: Fix a copypasta bug in CRTC confinement
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 1c8beedfe4)
2013-11-05 13:22:55 +10:00
Aaron Plattner
2bea21ea7e xfree86: detach scanout pixmaps when detaching output GPUs
Commit 8f4640bdb9 fixed a bit of a
chicken-and-egg problem by detaching GPU screens when their providers
are destroyed, which happens before CloseScreen is called.  However,
this created a new problem: the GPU screen tears down its RandR crtc
objects during CloseScreen and if one of them is active, it tries to
detach the scanout pixmap then.  This crashes because
RRCrtcDetachScanoutPixmap tries to get the master screen's screen
pixmap, but crtc->pScreen->current_master is already NULL at that
point.

It doesn't make sense for an unbound GPU screen to still be scanning
out its former master screen's pixmap, so detach them first when the
provider is destroyed.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit bdd1e22cbd)
2013-11-05 13:22:16 +10:00
Dave Airlie
9fbbea8cda Revert "Merge commit 'f98d6cfa0de41cf33e7555342753897c07af84ef' into server-1.14-branch"
This reverts commit ad2fa50b53, reversing
changes made to bab4908579.

oops i broke ABI.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-05 13:19:41 +10:00
Jeremy Huddleston Sequoia
94b7f26aed miext/damage: Partial revert of "Only wrap into the GC ops chain if there's a listener (v3)"
Fixes regression from: 4dc2a76740

http://lists.x.org/archives/xorg-devel/2013-May/036241.html
https://trac.macports.org/ticket/38993

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit abf5d5ac12)
2013-11-02 09:28:47 -07:00
Jeremy Huddleston Sequoia
0a1628bca7 XQuartz: Bump bundle version to 2.7.5
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2013-11-02 09:28:28 -07:00
Matt Dew
ad2fa50b53 Merge commit 'f98d6cfa0de41cf33e7555342753897c07af84ef' into server-1.14-branch 2013-10-31 23:53:04 -06:00
Connor Behan
bab4908579 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-31 23:43:17 -06:00
Matt Dew
4c40d9c4e4 bump version from 1.14.3.901, to 1.14.4 2013-10-31 23:09:03 -06:00
Michal Srb
f98d6cfa0d randr: deliver Output and Crtc events of attached output providers.
Consider all attached output providers when looking for changed outputs and
crtcs.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-01 10:18:31 +10:00
Michal Srb
14f89fb291 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-11-01 10:18:23 +10:00
Michal Srb
4c79ea71a1 randr: send RRProviderChangeNotify event
Send RRProviderChangeNotify event when a provider becomes output source or
offload sink.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Michal Srb <msrb@suse.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-01 10:18:17 +10:00
Dave Airlie
d94e40f049 randr: report changes when we disconnect a GPU slave
When we disconnect an output/offload slave set the changed bits,
so a later TellChanged can do something.

Then when we remove a GPU slave device, sent change notification
to the protocol screen.

This allows hot unplugged USB devices to disappear in clients.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-01 10:17:47 +10:00
Dave Airlie
e233bda3e7 randr: only respected changed on the protocol screen
We don't want to know about changes on the non-protocol screen,
we will fix up setchanged to make sure non-protocol screens update
the protocol screens when they have a change.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-01 10:17:39 +10:00
Dave Airlie
61df3350d0 randr: make SetChanged modify the main protocol screen not the gpu screen
When SetChanged is called we now modify the main protocol screen,
not the the gpu screen. Since changed stuff should work at the protocol level.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-01 10:17:31 +10:00
Dave Airlie
0454e44851 randr: don't directly set changed bits in randr screen
Introduce a wrapper interface so we can fix things up for multi-gpu
situations later.

This just introduces the API for now.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-11-01 10:17:23 +10:00
Adam Jackson
c635df3a7d randr: Fix a copypasta bug in CRTC confinement
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-11-01 10:16:46 +10:00
Aaron Plattner
c856013cd2 xfree86: detach scanout pixmaps when detaching output GPUs
Commit 8f4640bdb9 fixed a bit of a
chicken-and-egg problem by detaching GPU screens when their providers
are destroyed, which happens before CloseScreen is called.  However,
this created a new problem: the GPU screen tears down its RandR crtc
objects during CloseScreen and if one of them is active, it tries to
detach the scanout pixmap then.  This crashes because
RRCrtcDetachScanoutPixmap tries to get the master screen's screen
pixmap, but crtc->pScreen->current_master is already NULL at that
point.

It doesn't make sense for an unbound GPU screen to still be scanning
out its former master screen's pixmap, so detach them first when the
provider is destroyed.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-11-01 10:16:30 +10:00
Matt Dew
ca11bdc890 Bump version from 1.14.3 to 1.14.3.901. 2013-10-26 13:51:05 -06:00
Peter Hutterer
07069f5d71 sync: split updating and triggering a counter up
Now that the brackets are always the nearest change points (regardless of
transition) we need to update the counters whenever we check for any updates.

Otherwise we end up with a situation where counter->value is out of date and
an alarm doesn't trigger because we're still using the value from last time
something actually triggered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 2523a445a0)
2013-10-22 15:44:02 +10:00
Peter Hutterer
fa5e4dcfb6 sync: always set the brackets (#59644)
The current code sets bracket_greater to the first trigger after the current
value, and bracket_less to the last trigger before the current value.

For example, the idle timer with three negative and three positive transitions
would set this:

         nt1       nt2                 nt3
|--------|------|--|------- idle --|---|--|-----> t
               pt1                pt2    pt3
bracket_less == nt2
bracket_greater == pt2

This is an optimization so we can skip code paths in the block/wakeup handlers
if the current value doesn't meet any of the trigger requirements. Those
handlers largely do a
   if (bracket_less is less than current value &&
       bracket_greater is greater than current value)
        return, nothing to do

However, unless the bracket values are updated at the correct time, the
following may happen:

                                      nt
|--------------|---------- idle ------|--------> t
               pt

In this case, neither bracket is set, we're past the pos transition and not
yet at the neg transition. idle may now go past nt, but the brackets are not
updated. If idle is then reset to 0, no alarm is triggered for nt. Likewise,
idle may now go past pt and no alarm is triggered.

Changing an alarm or triggering an alarm will re-calculate the brackets, so
this bug is somewhat random. If any other client triggers an alarm when the
brackets are wrongly NULL, the recalculation will set them this bug may not
appear.

This patch changes the behavior, so that the brackets are always the nearest
positive or negative transitions to the current counter value. In the example
above, nt will trigger a wakeup and a re-calculation of the brackets, so that
going past it in the negative direction will then cause the proper alarm
triggers.

Or, in Keith's words:

  Timer currently past a positive trigger
      No bracket values, because no trigger in range

  Timer moves backwards before the positive trigger
      Brackets not reset, even though there is now a trigger in range

  Timer moves forward past the positive trigger
      Trigger doesn't fire because brackets not set

Setting the LT bracket in this case will cause everything to get
re-evaluated when the sync value moves backwards before the trigger
value.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit e57ec99b03)
2013-10-22 15:44:00 +10:00
Peter Hutterer
7b7753e97f sync: if the idle time was reset, force alarms to trigger (#70476)
The time between the idle reset and the IdleTimeWakeupHandler to be called is
indeterminate. Clients with an PositiveTransition or NegativeTransition alarm
on a low threshold may miss an alarm.

Work around this by keeping a reset flag for each device. When the
WakeupHandler triggers and the reset flag is set, we force a re-calculation of
everything and pretend the current idle time is zero. Immediately after is the
next calculation with the real idle time.

Relatively reproducible test case: Set up a XSyncNegativeTransition alarm for
a threshold of 1 ms. May trigger, may not.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 06b87aa528)
2013-10-22 15:43:59 +10:00
Peter Hutterer
3866624a45 dix: provide accessor methods for the last device event time
And now that we have the accessors, localize it. No functional changes, just
preparing for a future change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit efc1035ca9)
2013-10-22 15:43:58 +10:00
Peter Hutterer
47e30b3649 sync: supply the counter from IdleTimeBlockHandler
The main idletime counter has an initialized deviceid, might as well be
supplying it properly. Without this, we'd only ever check the XIAllDevices
counter, so the wait would never be adjusted for the device-specific triggers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit b7c9bd9cf2)
2013-10-22 15:43:57 +10:00
Peter Hutterer
b47c02f216 sync: always call BracketValues when recalculating upper/lower brackets
Both ServertimeBracketValues and IdleTimeBracketValues copy the value into
there SysCounter privates. Call it for a NULL set as well, so we don't end up
with stale pointers and we can remove the block/wakeup handlers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 2efe49c102)
2013-10-22 15:43:56 +10:00
Peter Hutterer
0033e969f4 sync: compress two if statements
No functional changes, just merges a > and == condition into a >= condition.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 5c7cfd4c69)
2013-10-22 15:43:55 +10:00
Peter Hutterer
0c809f459c dix: only deliver for the current grab type
Use the grabtype to determine which type of event to send - all other events
are pointless and may result in erroneous events being delivered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 7cf1b595c8)
2013-10-22 15:43:49 +10:00
Peter Hutterer
acb447ef69 dix: don't attempt to deliver an event for a different grabtype
For an active grab, grab->eventMask can be either the core or the XI1 mask.
With the overlap of event filters, calling DeliverOneGrabbedEvent(XI1) for a
ProximityOut event will trigger if the client has selected for enter events -
the filter is the same for both.

Thus, we end up delivering a proximity event to a client not expecting one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 78944d62ff)
2013-10-22 15:43:44 +10:00
Peter Hutterer
f5b22ee8ba include: change grabtypes to start at 1
Avoid erroneous detection of an unset grabtype as CORE

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 6159811a1a)
2013-10-22 15:43:41 +10:00
Peter Hutterer
d409cc884c dix: only allow button and key events to freeze a sync'd pointer
If a client calls XAllowEvents(SyncPointer) it expects events as normal until
the next button press or release event - that freezes the device. An e.g.
proximity event must thus not freeze the pointer.

As per the spec, only button and key events may do so, so narrow it to these
cases.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit be6ea80b79)
2013-10-22 15:43:39 +10:00