Commit Graph

7198 Commits

Author SHA1 Message Date
Chris Wilson 9fdaeec8f2 sna: Search /sys/class/power_state for the AC adapter
The adapter names are not uniform, so we need to scan the directory and
find the entry that corresponds to the Mains power supply. However, the
acpid does continue to report generic ac_adapter events.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 23:55:56 +01:00
Chris Wilson 0485cdfb6d sna/dri: Only the BackLeft merits special allocation flags
As the BackLeft is the only that couled be flipped, it is the only one
that may end up as the scanout and so is the only one that should be
allocated from the scanout cache.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 23:55:55 +01:00
Chris Wilson 489a93e4cc sna/gen6+: Switch to using the BLT more often when off AC
The BLT is more power-efficient for the operations it can handle, so use
it when possible (following the usual caveats) if we know we only have
battery power.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 16:06:06 +01:00
Chris Wilson f2ed1ac7b9 sna: Listen to ACPI events for power state notifications
When on-battery, we would prefer to use more power efficient operations.
For example, the BCS is far more economical to more data around with, but
it doesn't have quite the same throughput as the hungry RCS. (Not that
there is any reason why, the BCS is supposed to run at full memory
speed, unfortunately that is main memory speed and not the caches...)

Note: that X already listens to acpid for video switch notifications, it
would be useful if we could extend that interface to emit power
notifications as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 16:06:06 +01:00
Chris Wilson 56f532db2c sna: Prefer to reuse CPU bo if it was last active rather than inplace uploads
This helps short-circuit writes followed by immediate reads.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 13:06:48 +01:00
Chris Wilson 7656755c9d sna: Keep the CPU bo around if it was recently active
Rather than always switching over to using the GPU bo and immediately
discarding the CPU bo, keep it around as we may want to reuse the cached
data.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 13:06:48 +01:00
Chris Wilson 9a1f2ab84c sna: Try an inplace CopyArea fallback first
This applies the copy-from-tiled-X GetImage optimistion to the
ShmGetImage paths - when we don't have userptr available.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 13:06:48 +01:00
Chris Wilson 0b2e11ab3c sna: Rechain up SetWindowPixmap upon ScreenPixmap change
Fixes regression from
commit d2f19d5a1f [2.99.901]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Sep 3 19:05:41 2013 +0100

    sna: Tidy walking the window tree for updating our pixmaps

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 11:12:28 +01:00
Chris Wilson 1b1ac5193e sna: Include some DBG for the virtual output detection
So we can see it in the logs along with the regular outputs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06 11:11:47 +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 0baac6bba7 sna/gen6+: Don't request extra caching for use-once upload buffers
As we only use these buffers once, we should not benefit from requesting
them to be moved into L3/LLC cache - over and above the default
recommendations we make when creating the buffer. Indeed, this may even
lead to artefacts if we fail to invalidate those other caches when
reusing the buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 23:08:40 +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 e6bb553b74 sna: Add a DBG to track calls to SetScreenPixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-05 14:42:18 +01:00
Chris Wilson 94bc69d5b9 2.99.901 snapshot 2013-09-04 15:18:29 +01:00
Chris Wilson 4dfd7674d8 intel: Select SNA as the default acceleration method
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-04 15:18:29 +01:00
Chris Wilson 42d94356f6 sna: Add XMir support
With lots of updates by Christopher James Halse Rogers as he updated the
XMir API - but now supposedly frozen!

"<RAOF> ickle: I think the xmir api should be pretty much stable now,
barring people coming up with more awesome ways of doing things."

Signed-off-by: Christopher James Halse Rogers <raof@ubuntu.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-04 15:18:29 +01:00
Chris Wilson f906a4de62 sna: WriteThrough support is now upstream
Now that the WriteThrough ABI is upstream, we can rely on runtime
detection of the current interface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-04 15:18:29 +01:00
Chris Wilson 6f49a413aa configure: Check for required UMS headers before enabling
Prevents the build failing with i810 if we can not find vgaHW.h

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-04 15:18:28 +01:00
Chris Wilson ecb3c303f8 sna: Fix sna_pixmap_move_area_to_gpu() to return the sna_pixmap
Like it's sibling sna_pixmap_move_to_gpu(), it helps to know the private
sna_pixmap after the operation rather than just a boolean success/fail
result, and make it more robust in the process.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-04 12:25:47 +01:00
Chris Wilson ad774cf3a2 sna/dri: Refine proposed async swap interface
The latest proposal for passing swap_interval==0 is through the normal
ScheduleSwap() call, so we can remove the specialised function.

Link: http://lists.x.org/archives/xorg-devel/2013-September/037661.html
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-04 11:39:08 +01:00
Chris Wilson d2f19d5a1f sna: Tidy walking the window tree for updating our pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-03 19:37:29 +01:00
Chris Wilson 47e718bf32 sna/dri: Handle failure to move the pixmap into the GPU for CopyRegion
It should not fail, except in extreme cicumstances, and even then we shall
not crash.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-03 18:06:07 +01:00
Chris Wilson 5c51cd4e91 sna: Mark imported PRIME fd as starting in DOMAIN_NONE
Or rather, do not assume anything about the initial domains.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-03 18:06:07 +01:00
Chris Wilson 92b7500668 sna: Add some more DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-03 17:02:12 +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