summaryrefslogtreecommitdiff
path: root/src/sna/sna_display.c
AgeCommit message (Collapse)Author
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: Track the pageflip bo's busynessChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-13sna: Try to reuse the current cursor if we fail to updateChris Wilson
As a last resort, continue to display the old cursor if we tried and failed to create a new cursor. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Support efficient cursor updates for old machinesChris Wilson
Given a kernel patch to fix coherency of physical objects, we can use a more efficient method for updating cursors. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-11sna: Create a stable output name based on MST topologyChris Wilson
In order to provide persistent names for MST devices, which may change topology dynamically, the kernel exports a PATH blob. We can then use this path to generate the output name, and so reuse existing XID when a monitor is plugged back in. Based on the patch for -modesetting by Dave Airlie. 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-10sna/dri2: Check that the window covers the whole CRTC before xchgChris Wilson
Fixes TearFre regression from commit 3932e97057fca16615adaefbc1eb25a0d51a1d8b [2.99.912] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Jun 9 08:58:15 2014 +0100 sna/dri2: Allow TearFree flipping to individual CRTC Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-10sna: Cast away compiler warningChris Wilson
sna_display.c: In function 'has_user_backlight_override': sna_display.c:595:3: warning: return discards 'const' qualifier from pointer target type [enabled by default] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-10sna: Fix arguments when flipping transformed TearFree outputsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-10sna: Tidy a few asserts on the state of crtc->flip_boChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-10sna: Handle the user passing "Backlight" ""Chris Wilson
Allow the user to disable the backlight control by passing the empty string in the xorg.conf. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-10sna: Queue a flip after fixing up a failed flipChris Wilson
After a flip fails, we try to update the CRTC manually to new fb. However, the caller is still expecting to receive an event though the drm device to notify when the flips are complete. In order to maintain that ABI, we need to queue another flip after the fixup (to the currently bound fb). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-09sna: Fix the typo in the last commitChris Wilson
Rewording the sentence and reordering the arguments was a mistake! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-09sna: Add an extra error message before disabling a CRTCChris Wilson
One of the error paths to disable a pipe was lacking a log message. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-09configure: Allow disabling control over the backlightChris Wilson
Some OS prefer to control the backlight themselves through another daemon and so do not want X interfering. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-09sna: Defer the copy back from the shadow CRTC bo until we allocate the targetChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-09sna: Fix cut'n'paste DBG errorChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-09sna: Fixup normal flips between different pitchesChris Wilson
Apply the manual CRTC fixup in case pageflipping fails. This can happen if the pitches between the front and back differ for example. 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-09sna: Do not rely on udev_monitor_receive_device() being non-blockingChris Wilson
The libudev documentation says that is it non-blocking by default, but experience shows otherwise. Reported-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-07sna: Restore backlight when switching to VTChris Wilson
fbcon doesn't adjust the backlight when it takes over. Therefore if X performs a VT switch whilst its outputs are off, fbcon wakes up with no backlight and users are unhappy. Make the assumption that whoever takes over the VT will set the outputs as it desires, and that the failsafe value is to then turn the backlight to full. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67025 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-07sna: Release CRTC on VT switchChris Wilson
In order to free up memory and improve our bookkeeping when the X server is switched away from the current VT, disable the CRTC. 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: When the output is off, report the cached backlight valueChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-05sna: Inline calls to save/restore backlight around output DPMSChris Wilson
The intertwined logic was a little confusing to read mixed between the functions, so inline it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-05sna: Set initial output DPMS state from kernelChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-05sna: Make sure we recompute the vblank interval after reconfiguring the CRTCChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-05sna: Skip marking the CRTC as damaged for TearFreeChris Wilson
As we have reorder the application of damage on a TearFree frontbuffer to before we attach the CRTC, we do not need to then schedule the update afterwards (until it gets drawn by the client). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-05sna: Curry parameters to sna_damage_all()Chris Wilson
It is far easily to pass the PixmapPtr into the function and have it pluck out the width and height than do so in all callers. 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-02Only enable the new Cursor API for the next pre-release of XorgChris Wilson
Make sure we can compile against the pre-release tarballs at the expense of an innocuous compile warning if compiled against xserver.git 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-06-02sna/dri2: Hide MSC reported as going backwardsChris Wilson
OML_sync_control mandates that MSC must be monotonic, so if the kernel reports that they go backwards, lie. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-30sna: Do not allow imported buffers to be cachedChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-27sna: Fix the depth/format on the temporary shadow PicturesChris Wilson
When scaling the output, we re-render onto the scanout using a call to Composite, for which we create temporary Pictures. In most cases, the mismatching depth/format goes unnoticed, but along one particular fallback path, we use those to create a new Picture but the mismatching format results in a segfault. Reported-by: Matti Hämäläinen <ccr@tnsp.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79320 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-26sna: Silence compiler for warnings in Cursor API changesChris Wilson
The API changed again in the RC, so update to keep the compiler quiet. At the same time, protect against the ARGB_CURSOR struct changes. 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: Fix attachment of the default monitor to the first outputChris Wilson
Broke during code motion in commit add84cd8a8dc6d285912d0ea3a3a3e7faa9e0942 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Fri May 2 13:21:02 2014 +0100 sna: Perform dynamic connector discovery Reported-and-tested-by: Jay Little <jaylittle@jaylittle.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79015 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-19sna: Fix assertions for combining shadow transforms and TearFreeChris Wilson
When the RandR shadow buffer is enabled we set the sna_crtc->transform flag. We set the crtc->transform_in_use only when coordinate transforms are required - i.e. we may enable the shadow buffer if a CRTC is out of bounds, but otherwise has no transformation. That confused the asserts. Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-18sna: Switch iterators over to real CRTCs onlyChris Wilson
Many loops only want to walk the real CRTCs, so update the loop bounds to be explicit and assert that they are the real ones. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-16sna: Mark the CHV vsync method as unknownChris Wilson
Similar to the story with Baytrail, vsync is a lost art. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-14sna: After disabling the TearFree shadow, flush any pending flipsChris Wilson
If we complete a flip after resizing and recreating the TearFree shadow, we may process the flip completion events whilst the output is only partially reconfigured. 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: Fix another assignment inside an assertChris Wilson
Another recent introduction, spotted by Rinat Ibragimov. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>