summaryrefslogtreecommitdiff
path: root/src/sna/sna.h
AgeCommit message (Collapse)Author
2014-07-02sna: Limit the size of the tiling object to be smaller than either the originalsChris Wilson
When we tile, we do so in order to fit an operation involving two objects larger than the aperture. If we then choose an intermediate tiling object that is larger than either of those two, the error will persist and we will be forced to recuse. In the worst case, this will provide an upper bound to the recursion. Reported-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-01sna: Enforce LinearFramebuffer optionChris Wilson
This option should only be used for compatibility. Previously this was done at a high level, this changes it to enforce the tiling as we apply the CRTC. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-26sna/dri2: Hook into ClientGone callback to clear dangling referencesChris Wilson
As the Window may exist for multiple Clients, we cannot rely on the destruction of the Window decoupling all outstanding events and preventing chasing a stale Client pointer. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80157 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-23sna: Rename IGNORE_CPU to IGNORE_DAMAGE to better reflect its purposeChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-19sna: Always readback shadow damage after replacing the bufferChris Wilson
Instead track what we explicitly want to discard for the next operation, so that we don't have to copy back the whole buffer if we have to replace the shadow and intend to overwrite it all. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-16sna: Clear our private hints about front rendering exported boChris Wilson
Unlike GLXWindows, GLXPixmaps are rendered directly into, without a staging copy. Therefore we must treat those carefully when exported and clear our hints everytime control passes back to the Client. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79999 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-14sna: Enable TearFree by default for systems with PSRChris Wilson
Panel Self-Refresh requires us to avoid frontbuffer rendering in order to be power efficient. This is a job for TearFree! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13sna: Reorder ignore_cpu_damage() to avoid assertsChris Wilson
Tricksy asserts making sure that the correct arguments are passed around! Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: MST topologies may change on any hotplug eventChris Wilson
As the kernel does not send out an explicit DISCOVER event, we have to reinspect every connector after every hotplug event to detect topology changes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Discard TearFree damage before checking for an overwriting uploadChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Silence compiler warnings for discarding const Region pointsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-09sna/dri2: Allow TearFree flipping to individual CRTCChris Wilson
Baby step. We first take advantage of TearFree to allow us to redirect a single CRTC to the DRI2 frontbuffer and so allow a fullscreen game covering a single monitor to avoid expensive blits when running in a multi-monitor setup. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-07sna: Fix TearFree for non-compositorsChris Wilson
The tearfree code forgot to update the shadow bo, so after the first flip it would be rendering to the scanout anyway and flip to itself periodically. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-06sna: Hook up a backlight udev monitor for external changesChris Wilson
Changes to the backlights are notified through uevents. Hooking up a udev monitor to listen out for external changes to the backlight (e.g. through ACPI function keys, or by the user writing to /sys/class/backlight directly) is easier than enabling polling on the backlight sysfs file using X's select() mechanism. Since we listen to backlight changes, we have to be careful not to confuse the side-effects of disabling connectors (which may cause either ourselves or the kernel to turn off the backlight) with the user value. Many thanks to Alexander Mezin for the suggestion to use udev for tracking the notifications for external changes to the backlight. Reported-by: Alexander Mezin <mezin.alexander@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79699 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-05sna/dri2: Enable immediate buffer exchangesChris Wilson
The primary benefit of this is avoid the extra blit when using a compositor and instead propagate the compositor flip on the frontbuffer to the scanout, or equivalently allows a fullscreen game to flip onto the scanout without intervention by TearFree. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-02sna: Add support for PresentChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-02sna: Add support for DRI3Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-02sna: Enable kernel support for asynchronous flipsChris Wilson
If a flip fails, attempt to restore the previous working configuration (using a modeset) then disable further flipping. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-26sna/dri2: Move scanout processing from frame event to globalChris Wilson
The scanout is a global property, track it as so. The primary benefit to this is it strengthens our assertions that we never hand out an active scanout for use as a back buffer. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-22sna/dri2: Move fixed array allocations to per-crtcChris Wilson
Replace the fixed size MAX_PIPES array by moving the vblank handling to per-crtc. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-21sna/dri2: Apply a margin of error to the sequence wrap detectionChris Wilson
If we have a queue of events, we may set the msc from a recent vblank query only to then process an older vblank event and declare the counter wrapped. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-21sna/dri2: Tidy recording of the last swap sequence number and timeChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-21sna/dri2: Tidy computation of 64bit ustChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-20sna/dri2: Verify that the reference pipe is still active for flippingChris Wilson
We rely on the reference pipe to drive the event wake up. If we issue a deferred flip, there is a chance that the user could rearrange the screen on another crtc whilst otherwise preserving the screen geometry. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-14sna/dri2: Tighten reporting of faked flip eventsChris Wilson
GetDrawableMSC is specified as returning the frame counter and timestamp of the last flip event associated with the drawable, not the current hardware timestamp. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-14sna: Rename DRI2 files, functions and variablesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-08sna: Add an xorg.conf option for removing unused outputsChris Wilson
Clients are not yet ready for outputs that disappear at runtime, often unexpectedly dieing with asynchronous BadOutput errors. A simple workaround is to not remove any output just yet - but allow users to opt in via xorg.conf, i.e. Section "Device" Option "DeleteUnusedDP12Displays" "true" EndSection The name chosen is to be consistent with the nvidia driver, which did MST first and encountered all of these issues first, and has also been adopted for -modesetting. If this is combined with persistent output naming (i.e. based on DisplayPort branch topology), the number of outputs presented to the user should be static. Instead of removing the outputs, we have to mark them detached instead to avoid throwing errors from the kernel. Based on the patch for -modesetting by Dave Airlie. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-06sna: Treat encoder id array as invariantChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-04sna/dri: Report the last known MSC whilst the pipe is offChris Wilson
From OML_sync_control: "The graphics MSC value is incremented once for each screen refresh. For a non-interlaced display, this means that the graphics MSC value is incremented for each frame." When the pipe is disabled, return the last known MSC such that the reported value is always monotonic and consistent with the pipe when it is active again. That also is consistent with OML_sync_control which says that the MSC is a vertical refresh counter, and by implication does not increase whilst the pipe is off. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-02sna: Perform dynamic connector discoveryChris Wilson
One of the side-effects of MST is that we need to support dynamic attachment and removal of displays as the branch hierachy changes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-02sna: Do not stash drmModeResPtrChris Wilson
In the near future we will be dealing with dynamic discovery of connectors, and so we cannot assume that the mode resources will be static for our lifetime. The first step is to not keep that struct around, but pull out the useful information and discard it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-28sna: Factor in destination sizes for choosing intermediate tiling bo sizeChris Wilson
When tiling, factor in the destination usage of the aperture in case that reduces the available aperture for the intermediate bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-27sna: Preallocate cursorsChris Wilson
We need to avoid all allocations within the signal handlers, so preallocate the cursor structs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77975 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-27sna: Preallocate pwrite scratch buffer for old fashioned cursor updatesChris Wilson
We need to avoid all allocations within the signal handlers, so preallocate the transfer buffer. References: https://bugs.freedesktop.org/show_bug.cgi?id=77975 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-27sna: Replace cursor gen test with feature flagChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-15sna: Discard TearFree readback when overdrawingChris Wilson
References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-09sna: Tweak application of WHOLE hint for uploadsChris Wilson
This help with the continuing saga of commit 1de1104064b5898cbed37e836901694a381c1266 [2.99.911] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri Feb 21 22:43:04 2014 +0000 sna: Use a hint to do whole image uploads inplace References: https://bugs.freedesktop.org/show_bug.cgi?id=77178 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-02sna: Prevent signal re-entrancy into cursor update routinesChris Wilson
As we may need to allocate from within the cursor update, we are prone to re-entrancy issues within malloc()/free(). To avoid these we need to block SigIO (for pointer updates) whilst in the critical section. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-31sna: Promote to the GPU operations that cover the whole pixmapChris Wilson
If the pixmap is already partially on the GPU, and the next operation touches the entire pixmap, promote that operation back to the whole GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-28sna: Our cursors are always square.Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-27sna: Support variable sized cursorsChris Wilson
One of the downsides with supporting large cursors is that the full size is very rarely used leading to a waste of permanently allocated resources. Refactor our cursor handling so that we can allocate fresh cursors on the fly that are appropriately sized. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-14sna: Allow some leeway when deciding to discard common translationsChris Wilson
Under PictFilterNearest, we can ignore fractional translations (not all renderers discard those.) And if we are being approximate, we can loosen our tolerance as well. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-22sna: Allow SIGBUS/SEGV to kill the threadChris Wilson
To handle sigtrapping of the threads, we allow the threads to handle their async signals and upon hitting the trap, we kill the thread. All the rest of the threads are reaped by the main xserver thread afterwards. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-22sna: Assert that sigtrap is activeChris Wilson
Curiouser and curiouser. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-22sna: Handle asynchronous signals from threadsChris Wilson
By killing the threads and leaking their allocations - marginally preferrable to losing the entire Xserver. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-20sna: Query cursor size from the kernelChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13sna: Extend native rotation support to spritesChris Wilson
The sprite plane can be independently rotated to the CRTC primary plane. To rotate the sprite plane, we just set a property on the plane similar to how we rotate the CRTC, so we can refactor them together to use the same routines. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-01sna: Only discard CPU damage for an replacing regionChris Wilson
When considering move-region-to-cpu, we need to take into account that the region may not replace the whole drawable, in which case we cannot simply dispose of an active CPU bo. Reported-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reported-by: Conley Moorhous <conleymoorhous@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74327 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31sna: Tidy up pixmap header allocationsChris Wilson
Refactor some more of the common code, and add some debug tracking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-30sna: Constify GCFunc to quieten the compiler.Chris Wilson
We keep a pointer to the old funcs when wrapping, this now needs to be const. sna_accel.c: In function 'sna_gc_move_to_cpu': sna_accel.c:4008:17: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] sgc->old_funcs = gc->funcs; Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>