Commit Graph

55 Commits

Author SHA1 Message Date
Chris Wilson be17746549 intel-virtual-overlay: Error out if no X11 SHM header is defined
Make the error explicit rather than dieing later with unknown constants.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-04 08:40:49 +01:00
Chris Wilson dd130d1b06 intel-virtual-overlay: Grab the server around mode manipulations
Prevent other clients from seeing the intermediate states.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-23 10:48:52 +01:00
Chris Wilson 011636d25b intel-virtual-output: Hide the remote cursor on initial connection
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-20 18:57:11 +01:00
Chris Wilson dcf9b5ae18 intel: Compile fixes for base install of SLED11.sp3
Highlights of that distribution include xorg-xserver-1.6.5, kernel
3.0.76 and gcc-4.3.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-18 12:49:41 +01:00
Chris Wilson 0ceba64821 intel-virtual-output: Debug option for forcing full redraws
References: https://bugs.freedesktop.org/show_bug.cgi?id=68987
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-08 13:51:14 +01:00
Chris Wilson ccd605c492 intel-virtual-output: Unregister our singleton on a clean shutdown
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 00:34:07 +01:00
Chris Wilson 3c5caaf0a9 intel-virtual-output: Only wake up for a change in a visible cursor
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 00:30:53 +01:00
Chris Wilson 91b1f77da5 intel-virtual-output: Make the flush for recreating Damage explicit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 00:23:37 +01:00
Chris Wilson 3979d11677 intel-virtual-output: Just request Damage BBox
As we ourselves only track the BBox of damage on the virtual outputs, we
can ask X to amalgamate the damage events as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 23:28:16 +01:00
Chris Wilson 2263f8f26f intel-virtual-overlay: Reset damage across modesets
Some versions of the Xserver lose Damage tracking across the modeset,
causing a loss of damage notifications and repainting to cease on the
virtual outputs. We can workaround this by reattaching the damage every
time we receive notification that the local Screen configuration
changes.

Reported-and-tested-by: Severin Strobl <fd@severin-strobl.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68987
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 22:29:55 +01:00
Chris Wilson 5dea07c31d intel-virtual-output: Reset the damage just prior to reading it back
Slightly more efficient command packing and reduces a damage race
slightly...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 21:25:00 +01:00
Chris Wilson bae4162487 intel-virtual-output: We don't need to enable the timer for reconfigure
The timer will be enabled if a reconfiguration actually takes place and
we mark the damaged region to be redrawn.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 21:23:56 +01:00
Chris Wilson d9a48bd0a3 intel-virtual-output: Just walk the list of clones attached to the display
Rather searching the entire array of all clones, just walk the presorted
list from the display.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 20:52:11 +01:00
Chris Wilson b57dfc5331 intel-virtual-output: Defer reenabling damage events until after we draw
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 19:40:07 +01:00
Chris Wilson 12de799598 intel-virtual-output: Flush the damage received message back to the local display
After processing the Damage notification, we need to send a message back
to the Xserver to clear the pending damage before we will be sent more
events. To make sure that message is sent we need to flush the output,
as we may never flush the output queue otherwise.

Reported-by: Severin Strobl <fd@severin-strobl.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68987
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 19:36:13 +01:00
Chris Wilson 1ce52e9331 intel-virtual-output: Track active clones
For the frequent operations, such as moving the cursor or updating
damage, it is more efficient to walk the list of active outputs (as the
discrete GPUs support lots of outputs!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 18:13:27 +01:00
Chris Wilson f01c5eae2a intel-virtual-output: Reserve space for the '\0' in the sprintf
Even though we don't use the trailing NUL byte for our comparisons,
sprintf will write it, so we need make space for it.

Reported-by: Severin Strobl <fd@severin-strobl.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68987
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 17:48:20 +01:00
Chris Wilson efc960b135 intel-virtual-output: Clear send flags when doing XSync
When falling back to using XSync rather than XSendEvent it is imperative
that we remember to clear the flag so that we don't keep on performing
the synchronous RTT every time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-03 01:00:23 +01:00
Chris Wilson 6f090044d1 intel-virtual-output: Remember to mark the timer as active when moving the mouse
Otherwise we throttle mouse updates to the next display update...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 23:52:52 +01:00
Chris Wilson 91aca61c83 intel-virtual-output: Don't clobber the XID inside the ShmSegmentInfo
As there is an XID inside the ShmSegmentInfo we cannot share one between
both endpoints, or else it gets clobbered and rendering is lost (unless
by happy coincidence the last XID is available in both Xservers).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 23:44:23 +01:00
Chris Wilson d54f0fa16d intel-virtual-output: Remove the stray 1
The 'output-is-changed' flags was accidentally initialised to 01 rather
than 0, causing all attached outputs to be considered to have changed
everytime.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 22:56:03 +01:00
Chris Wilson 84b66849fc intel-virtual-output: Don't set the SHM active flag along !SHM composite paths
Otherwise we may end up waiting for an event that will never be sent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 22:55:17 +01:00
Chris Wilson 13a28f607f intel-virtual-overlay: Try to shutdown gracefully
Attempt to clean up the VIRTUAL mess when we exit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 22:42:48 +01:00
Chris Wilson e6e6572ac8 intel-virtual-output: Fallback to probing GetScreenResources
If the Display doesn't support the more recent non-forced-detection
GetScreenResources, use the older version instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 22:27:42 +01:00
Chris Wilson 7c5d269f25 intel-virtual-overlay: Keep bumblebeed awake
bumbledeed will shutdown its Xserver when the last connection to it
closes. For the moment, leak the control socket so that the display
stays alive. However, we will want to attach to any Xservers created by
bumblebee as opposed to creating them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 22:07:46 +01:00
Chris Wilson c8dc27e00e intel-virtual-overlay: Disable the timer after flushing
As the flush may queue work that causes the timer to be reactivated
prior to draining the queue, we need to flush first then turn off the
timer if idle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 21:54:42 +01:00
Chris Wilson d355825177 intel-virtual-overlay: Don't do a sibling search if bumblebee is explicitly requested
If either all or bumblee is explicitly requested, don't automatically
perform the other search.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 21:46:35 +01:00
Chris Wilson d2f7f85cd2 intel-virtual-overlay: Fix the bumblebee query parsing
It supplies both a trailing newline, NUL byte and length.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 21:42:50 +01:00
Chris Wilson 5fed6e2499 intel-virtual-output: Perform pixel type conversion from XfixesCursorImage
For whatever reason, Xfixes uses "unsigned long" in its protocol
definition for the cursor pixels.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 21:19:24 +01:00
Chris Wilson b955622cc2 intel-virtual-ouptput: Filter and rate-limit cursor events
Make sure we are not responding to cursor motion on other screens, by
checking for our root window.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 20:45:12 +01:00
Chris Wilson 5af9d69485 intel-virtual-output: Reorder the fds
We can't place the record fd at after the displays as we may wish to
clone more displays later and use the simplification that they are in a
linear, contiguous block at the end of the fd array.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 19:50:17 +01:00
Chris Wilson 88d43dc2ae intel-virtual-output: Refactor the image resizing code
And add lots of debug and robustness.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 19:50:11 +01:00
Chris Wilson 1b07f16ffe intel-virtual-overlay: Fix logic inversion from previous commit
"if (!active == 0)"

Whoops, but keep the debugging that highlighted the error.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 19:49:35 +01:00
Chris Wilson 088ff35b39 intel-virtual-output: Don't forget to name the mode
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 16:51:57 +01:00
Chris Wilson 4b3669548a intel-virtual-output: Fallback to Xinerama if RandR is not supported by the target
With Xinerama, we do not support reconfiguration of the target's CRTCs
but we can still paint!

This will require some more work to try and minimise the incompatibility
between configuring Randr displays locally and the static arrangement
remotely. But you can paint!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 16:39:17 +01:00
Chris Wilson 0ee287af22 intel-virtual-overlay: Prevent buffer overrun reading the XEvent
When calling XNextEvent() you must provide it with space for any event,
i.e. XEvent, and not be tempted to pass in the specific type you are
waiting for!

Reported-by: Philipp Adolf
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 15:44:04 +01:00
Chris Wilson dd5f17ed3a intel-virtual-output: Decouple the fake mode before deleting
When we install a fake mode on the output, we have to perform a
round-trip for a reprobe. During that time, some other client (such as
gnome-shell) will be notify of the change in output status and may
attempt to configure it. This leaves us unable to delete the mode as it
is currently active - so first disable the new head and then delete the
mode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 15:13:44 +01:00
Chris Wilson 962460c0e1 intel-virtual-output: Probe and automatically enable sibling screens
Look for screens on the same display that we can enable automatically.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 12:33:55 +01:00
Chris Wilson f5fdbf6f23 intel-virtual-output: Add missing whitespace, s/while(1)/while (1)/
No functional changes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-01 17:12:20 +01:00
Chris Wilson 8654bd7f66 intel-virtual-output: Restore the lost POLLIN on the timerfd
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-01 17:07:49 +01:00
Chris Wilson 3f03cafcb5 intel-virtual-output: Refer to the new memory block after realloc
When updating pointers to point into the new memory block after a
realloc, it helps to pass the new locations around rather than the old.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-01 16:51:27 +01:00
Chris Wilson 7e6472cfcc intel-virtual-output: Rebuild pointers after realloc
If reallocs gives us a new memory block, we need to update everything
that pointed into the old blocks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-01 16:45:32 +01:00
Chris Wilson a41acee728 intel-virtual-output: Register as a singleton
If the user tries to use multiple commands to combine multiple displays,
reroute those to the first instance.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-01 16:07:03 +01:00
Chris Wilson 3f75e95f26 intel-virtual-output: Fix overun with the record Display connection
When converting to the auto-extending arrays, I forgot to include room
for the extra connection for the recording Display. By using an
explicit variable within the global state it is a little more clear.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-01 11:49:18 +01:00
Chris Wilson 89dc44ae45 intel-virtual-output: Prevent cloning the same output twice
And prevent cloning the localhost! The caveat is that the transport
string (Display name) must match, so it still would be possible to
connect to the same display with different transports (local sockets and
TCP sockets for socket) and so cause confusion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-01 11:46:26 +01:00
Chris Wilson d1d277db9b intel-virtual-output: Manage multiple destination CRTCs
Don't try to assign all the remote outputs to the same crtc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-01 11:38:49 +01:00
Chris Wilson 47b7e334c1 intel-virtual-output: Try to hide races with gnome-shell
As we try to create VirtualHeads, gnome-shell tries to enable them.
Leading to a lot of flashing and extraneous modes appearing. Without
being able to grab the screen configuration for the duration of our
pruning, there does not seem much we can do other than try and squelch
the worst of the errors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-31 22:40:48 +01:00
Chris Wilson 7228bd3910 intel-virtual-output: Clone all outputs on the remote display
Now that we allocate VirtualHeads on the fly, we can query the list of
available outputs on the target display and clone them all, rather than
manually passingthe  list of outputs to clone.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-31 22:10:56 +01:00
Chris Wilson 028412faa7 intel-virtual-output: Third time lucky for computing the correct stride?
Aligning a 16-bpp image to a 32-byte boundary is tricky, apparently. Or
at least I make it look so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-31 20:58:48 +01:00
Chris Wilson 8ecb758697 sna: Expand the array of fake outputs if the last is used
Always maintain one spare so that we can reconfigure for any number of
desired outputs on the fly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-31 20:48:24 +01:00