summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2013-09-07Revert "sna: Add XMir support"Chris Wilson
This reverts commit 42d94356f65972eb7fb8991234a4e9388c4c2031. Ordered-by: The Management.
2013-09-06sna: Search /sys/class/power_state for the AC adapterChris Wilson
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-06sna/dri: Only the BackLeft merits special allocation flagsChris Wilson
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-06sna/gen6+: Switch to using the BLT more often when off ACChris Wilson
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-06sna: Listen to ACPI events for power state notificationsChris Wilson
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-06sna: Prefer to reuse CPU bo if it was last active rather than inplace uploadsChris Wilson
This helps short-circuit writes followed by immediate reads. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-06sna: Keep the CPU bo around if it was recently activeChris Wilson
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-06sna: Try an inplace CopyArea fallback firstChris Wilson
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-06sna: Rechain up SetWindowPixmap upon ScreenPixmap changeChris Wilson
Fixes regression from commit d2f19d5a1f4d1c9521fb4801c9fb649d19746150 [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-06sna: Include some DBG for the virtual output detectionChris Wilson
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-05sna/gen6+: Don't request extra caching for use-once upload buffersChris Wilson
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-05sna: Add a DBG to track calls to SetScreenPixmapChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-04sna: Add XMir supportChris Wilson
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-04sna: WriteThrough support is now upstreamChris Wilson
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-04configure: Check for required UMS headers before enablingChris Wilson
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-04sna: Fix sna_pixmap_move_area_to_gpu() to return the sna_pixmapChris Wilson
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-04sna/dri: Refine proposed async swap interfaceChris Wilson
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-03sna: Tidy walking the window tree for updating our pixmapsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-03sna/dri: Handle failure to move the pixmap into the GPU for CopyRegionChris Wilson
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-03sna: Mark imported PRIME fd as starting in DOMAIN_NONEChris Wilson
Or rather, do not assume anything about the initial domains. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-03sna: Add some more DBGChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02sna: Check for output->randr_output before dereferencingChris Wilson
As we may call the ->detect() routines during the fallback initial probing, we need to handle the case where the output callbacks are called before RandR is setup. Regresion from commit 8ecb758697af42e8e68edee0d1945986470a9c04 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Sat Aug 31 19:44:50 2013 +0100 sna: Expand the array of fake outputs if the last is used Reported-by: Andreas Reis <andreas.reis@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68843 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02sna: Process winSize regionChris Wilson
Sometimes the window size is not a simple box, but a full region. In which case we do need to process it and not just assert that it is a box! Reported-by: Jiri Slaby <jirislaby@gmai.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=47597 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-31sna: Expand the array of fake outputs if the last is usedChris Wilson
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-31sna: Open the device non-blockingChris Wilson
This is essential to prevent deadlocks when running with ZaphodHeads. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-31sna: Mark fake outputs as disconnected until a user applies a modeChris Wilson
Hide the fake outputs until they are instantiated by a user. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-30sna: Protect against unattached pixmaps when peeking inside for a GPU boChris Wilson
Prevent a NULL dereference for the small system pixmaps. Introduced with commit f22d7f68b8b1bd5caf5ae831fca63eb1e6957520 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Wed Aug 28 14:24:33 2013 +0100 sna/gen6+: Improve ring stickyness for BLT composite ops Reported-by: Sami Farin <hvtaifwkbgefbaei@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68728 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-30sna/dri: Correct the target_msc for immediate double-bufferingChris Wilson
We also need to correctly offset the current_msc for the normal pageflip, so rearrange the code flow so that we only do the calculation of target_msc once. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-30sna: Allow user specification of number of VirtualHeadsChris Wilson
Previously, we instantiated a fake output in case we had a machine with no output. (For certain server-class products.) The Bumblee project were also doing something very similar in order to fake an extended desktop on the Intel igfx and copy portions onto a discrete GPU. (The preferred method for doing this upstream is through the use of PRIME). As the code is very similar, we can support both use-cases simultaneously. This adds the option: Section "Device" Driver "intel" Option "VirtualHeads" "<count>" EndSection to allow the user to specify an additional set of fake outputs, which can then be controlled using xrandr. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-28sna/gen6+: Don't force a ring switch for likely TLB misses if already busyChris Wilson
If the target is already on the render ring, don't force the switch away. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-28sna/gen6+: Improve ring stickyness for BLT composite opsChris Wilson
Rearrange the tests so that we check both src/dst for which rings they are currently on. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-27sna/video: Copy the ClipRegion for the spriteChris Wilson
A cut'n'paste error dropped the clip region copy, resulting in the port not being set on the window instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-27sna/video: Update sprite destination colorkey commandChris Wilson
The final version that was upstreamed differed from the original version we implemented. The final version allows for both destination/source colorkeying, but left the ddx out of date. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-26sna: Promote no COWs assertion to a condition check before operating inplaceChris Wilson
We can arrive there with a COW and wanting to a CPU mapping, which is unfortunate and requires the indirect path instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-26sna: Fix ordering of assert vs the state it checksChris Wilson
It helps to set the state we want to check before actually checking that we set it! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-25sna: Make sure we assert our Master status before copying the fbconChris Wilson
Being able to read back the fbcon handle as a non-Master process is an information leak that will be fixed. We should already be Master by this point by virtue of the sequence in which we obtain the device fd. However, to be pedagogically correct, call drmSetMaster() before the fbcon copy. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-25sna/gen7: Combine a couple of pipe-flushesChris Wilson
Reduce the number of pipe-controls we emit by combining one of the frequent flushes with a stall. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-25sna: Make SetScreenPixmap do as it saysChris Wilson
Make sna_set_screen_pixmap() a little more complete and remove the assertion that the caller manages sna->front. This should make the function easier to reuse. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-25sna: Add a few more checks for a hosted Xserver before walking CRTC listsChris Wilson
If we are hosted, we do not own the CRTC configuration, and deferencing the private data structures believing them to be ours, only leads to disaster. Based on patches by Christopher James Halse Rogers. Reported-by: Christopher James Halse Rogers <raof@ubuntu.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-25sna/dri: Prefer the source ringChris Wilson
When copying from the DRI client onto the scanout, we return the source buffer back to the client afterwards. Therefore if we force the source to switch rings, we incur a double ring switch from the client to us and back. If we force the dst to switch rings, it will likely be then correct for all subsequent copies as well. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-24sna: Fix reversed logic and loss of trust in the hostChris Wilson
The test for a hosted Xserver was backwards in commit 306c72cffbd8cd88e93871ee21fa85101198c1ac Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Sat Aug 24 14:02:23 2013 +0100 sna: Trust the preferred-depth returned by the host so we failed to load the driver instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-24sna: Don't restrict the frontbuffer to be scanout capable if hostedChris Wilson
Since we won't be binding it to a framebuffer, we don't care if it is incompatible. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-24sna: Trust the preferred-depth returned by the hostChris Wilson
As we are not master and will not be binding the fb, it is irrelevant as to whether our render buffer is actually bindable. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-24sna: Don't copy fbcon if hostedChris Wilson
When hosted, we have no idea what the right initial contents should be as we are independent of the CRTC and so the existing fb is irrelevant. Plus, not actually being master will cause the attempt to read back the bound framebuffer to fail... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23intel: Add experimental rendernode supportChris Wilson
Render nodes allow clients full access to off-screen rendering and GPU offload, without assuming any master responsiblities (for device and display management). As they have a more limited interface, they can be used in a more permissive manner. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23sna/dri: Make async blits async againChris Wilson
Fixes the regression introduced in commit 6f5fd772c7ca656b86394a0f036d4e0cf5b33d8e [2.21.13] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu Jul 25 08:29:55 2013 +0100 sna/dri: Discard the strict checking for stale bo before performing a blit which added the sync request flag along the explicit async blit path. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23sna/video: Disable the existing sprite when switching CRTCsChris Wilson
After starting a new video on another CRTC, disable the old one as we currently only track the single video port. However, showing a video split across multiple CRTCs would be a useful extension in the future. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23sna/gen7: Prefer the render ring for more operationsChris Wilson
As we get more well-endowed GPUs with ever more execution units, it becomes advantageous to do even basic copies through the render ring. However, the extra performance comes at a cost - higher power usage. To mitigate this, we apply a heuristic of only allowing a switch over to the render ring if the render ring is already active with an early request (in addition to the usual stall avoidance and general performance heuristics). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-18sna/gen6+: Tweak semaphore avoidance for composite operationsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-18sna: Do not force use of the CPU bo if replacing a busy GPU boChris Wilson
To minimise waiting for the SHM pixmap afterwards. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>