summaryrefslogtreecommitdiff
path: root/src/sna/sna_display.c
AgeCommit message (Collapse)Author
2014-03-17sna: Improve guard against loading palettes whilst headlessChris Wilson
Whilst hosted, which is very similar to being headless, we do not even have the kmode pointer and so checking kmode->count_crtcs is fatal. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-21sna: Do not attempt fallback configuration without any CRTCsChris Wilson
The fallback xf86InitialConfiguration() is another function that may explode if called without any CRTCs attached. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-20backlight: Make search routine for device specific backlight commonChris Wilson
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-15backlight: Amalgamate hardcoded priority tablesChris Wilson
Our fallback path for finding the backlight interface uses a hardcoded table of known backlight controllers in proirity order. Rather than maintain this table twice in the midst of the KMS logic, push it to the new set of common backlight routines. This incorporates bugfixes from SNA to handle unknown backlights, but usable, gracefully. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-15intel: Add a helper for setting backlight without root rightsChris Wilson
Once the xserver stops running as root on kms capabable systems, we will need some other way to access the backlight. The approach taken in this patch moves most of the heavy lifting to a helper that runs with root privileges and pipes our requested brightness into the sysfs backlight interface. Where required, we use pkexec to launch the helper with the elevated privilege. v2: Amalgamate much more of the duplicate code. Keep the daemon and pipe alive for the lifetime of the backlight interface. Provide an alternative for systems without PolicyKit. Signed-off-by: Hans de Goede <hdegoede@redhat.com> [v1] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-14sna: Inherit the native rotation on initial output probingChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-14sna: Reorganise native rotation ioctls to compile on old LinuxChris Wilson
It is not just the BSDs that lack these ioctls in their userspace headers, but everything older than about a year... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-14sna: Guard use of DRM_MODE_OBJECT type idsChris Wilson
These are not currently exported on OpenBSD and cause the build to fail. Hide their use behind an ifdef guard for the time being. "I noticed the following when trying to compile xf86-video-intel git on OpenBSD: /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: 'DRM_MODE_OBJECT_CRTC' undeclared (first use in this function) /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: (Each undeclared identifier is reported only once /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: for each function it appears in.) /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2107: error: 'DRM_MODE_OBJECT_PLANE' undeclared (first use in this function)" Reported-by: Jonathan Gray Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-14sna: Check that the backlight interface is in sysfs before accessChris Wilson
Before we write values into the file, we want to be sure that it is our sysfs backlight interface, and not some ordinary file we are about to destroy. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13sna: Increase the acceptable screen size rangeChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13sna: Filter out requests to create a 0x0 frontbufferChris Wilson
Attempting to create a 0x0 frontbuffer results in erroneous pixmap generation, and is liable to explode at a random point in future, so just reject it outright. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13sna: Check for access to backlight interfaceChris Wilson
Before attaching properties to any connector, check that we can indeed control the backlight through the sysfs interface by doing an access check. If the xserver is started without root privileges, we cannot write through /sys/class/backlight and so should take care not to advertise that we can. Reported-by: Hans de Geode <hdegeode@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13sna: Clear DPMS tracking on VT switchChris Wilson
Assume the worst and force us to reset the property when we restore control. 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-13sna: Enable coordinate transforms for native CRTC rotationChris Wilson
Otherwise X tells Clients that the cursor is still in the unrotated location when it appears rotated on the display. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13sna: Always assign a name to the modesChris Wilson
In some cases, such as querying the mode from the CRTC, we may not have a name associated with the mode. However, RandR always expects a valid name. To satisfy this requirement, always generate the canonical mode name if no other is specified. References: https://bugs.freedesktop.org/show_bug.cgi?id=70132 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12sna: Support native primary plane rotationsChris Wilson
Use the display hardware for simple rotations, when exported through the rotation property on the CRTC. As the kernel support is not yet merged upstream, the feature is hidden behind --enable-rotation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-12Revert "sna/gen6: Serialise write to DERRMR register using STORE_REGISTER_MEM"Chris Wilson
This reverts commit 2a5ad9c015bbb41550536dd3cf4ad18b7f21fd80. Oops, pushed from the wrong machine and merged in a incomplete bugfix branch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-11sna/gen6: Serialise write to DERRMR register using STORE_REGISTER_MEMChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-30sna: Silence a compiler warning for mismatching const stringsChris Wilson
sna_display.c: In function 'preferred_mode': sna_display.c:3393:7: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] mode = xf86GetOptValString(output->options, OPTION_PREFERRED_MODE); Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-30sna: Suppress warning for freeing a "constant" stringChris Wilson
We allocated and own the string, so we can free it! sna_display.c: In function 'sna_output_get_modes': sna_display.c:2314:4: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default] free(current->name); Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-30sna: Handle char *backlight_ifaceChris Wilson
The backlight_iface is a freeable string, in places we were assigning a constant string and later freeing it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna: Fix format specifier typo ('%D') in DBGChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna: Skip undamaged TearFree redisplaysChris Wilson
If we have not had cause to flush the wait_for_shadow buffer during the course of the rendering, then we never wrote to the backbuffer and its contents are still identical to the current frontbuffer. So if the wait_for_shadow is still flagged as required on the scanout, we know we can safely discard the redisplay request. References: https://bugs.freedesktop.org/show_bug.cgi?id=70905 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-28sna: Cancel the backlight change if set-property(DPMS) failsChris Wilson
If the kernel reports an error from setting the DPMS property, we need to undo the local changes and propagate back the error to the caller. Although the latter is prevented by the RandR API, we can at least restore the backlight. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-23sna: Protect against fake CRTCs during initial probeChris Wilson
Reported-by: Nick Bowler <nbowler@draconx.ca> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73981 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-23sna: Avoid erroneous discarding operations for partial compositesChris Wilson
Composite operations were presumed to cover their entire width x height area. However, a few paths submit boxes that do not cover the clip region and so the optimisation made during prepare to discard completely overwritten data is incorrect (and leads to corruption - stale data is seen which the client expected to have been overdrawn). So along these more unusual paths, we must add a flag to prevent the overzealous discard. Notably, xfce4 triggers this as it uses a lot of unantialiased trapezoids in its theme drawing. References: https://bugs.freedesktop.org/show_bug.cgi?id=69528 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-21sna: Initialise the TearFree shadow output from the current front bufferChris Wilson
Otherwise we may end up in a sitation where we show stale contents for a (sometimes signification) fraction of a second before it is refreshed with the correct contents. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73842 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20sna: Increase limit on number of possible outputsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-19sna: Discard pending wait_for_shadow updates before the TearFree flipChris Wilson
Rather than just assert that we have used the pending update in wait_for_shadow, discard it first. Reported-by: Joe Peterson <joe@wildlava.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=70905 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-16sna: Avoid allocating temporary storage for TearFree rotationsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-10sna/dri: Handle TearFree vblanks whilst the pipe is offChris Wilson
As an extra complication for handling TearFree is that if we attempt to requeue a swap whilst the pipe is off, that fails. As we have recursed from the pixmap migration path, we have to abort the blit but still send the event back to the client so that they unblock. Reported-by: Harald Judt <h.judt@gmx.at> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73469 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-06sna: Always treat DPMSModeSuspend/Standby similar to DPMSModeOffChris Wilson
As we assume that Suspend, Standby alias to Off and disable the crtc when switching to any mode other than On, we need to also perform the backlight updates for Suspend,Standby prior to passing the DPMS value onto the kernel. Suggested-by: Alexander Monakov <amonakov@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-15sna: Remove stale assertionChris Wilson
Now that we do not remove the move-to-gpu for a plain read from the TearFree buffer, it is viable to use that buffer as source for cloning. So we need to kill the stale assertion. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-11sna: Remove unused variableChris Wilson
sna_display.c: In function 'sna_crtc_redisplay__fallback': sna_display.c:4104:19: warning: unused variable 'sna_crtc' [-Wunused-variable] struct sna_crtc *sna_crtc = to_sna_crtc(crtc); Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-11sna: Enable scanline waits for BroadwellChris Wilson
Broadwell uses the same mechanism as Haswell for vsync. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-09sna: Fallback gracefully when redisplaying after a GPU hangChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-05sna: Compilation fixes for squeezeChris Wilson
Older version of glibc and valgrind require a slight massage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-04sna: Update Baytrail VSync logicChris Wilson
My current best guess at the glaring hole in the spec that is synchronisation to vertical refresh. Note that this leaves VSync disabled for BYT for now as it is ineffective - but at least it now doesn't hang! Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69869 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-26sna: Update connector-type-to-string mappingChris Wilson
Add in a couple of newcomers to the connector type and make it easier to track updates in future. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-25sna: Correct plurization of axis for modesetting log messageChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-25sna: Include reflections when logging mode changesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-25sna: Log mode switches on virtual outputsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-18sna: Tell valgrind about the returned mode listChris Wilson
Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-11-07sna/gen7: Request secure batches for Haswell vsyncChris Wilson
Since commit 8ff8eb2b38dc705f5c86f524c1cd74a811a7b04c Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Sep 9 16:23:04 2013 +0100 sna/hsw: Scanline waits require both DERRMR and forcewake we have been emitting LRI to enable vsync on the render ring. This requires a privileged batch buffer, and whilst we were checking for kernel support, we forgot to actually tell the kernel to submit the batch with the right privileges. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71328 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-29sna/gen7: Refactor BYT vsync using IVB routinesChris Wilson
The BYT vsync is closer to the IVB vsync, and using gen6 is just erroneous. Apparently. At least that is what is in bspec today. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-28sna: Quieten a couple of valgrind warnings about unknown ioctlsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-27sna: Handle transient TearFree flip failuresChris Wilson
If we get a pageflip fail when trying to do a TearFree update, just fallback to a copy (before turning off the display for complete failure). The rare tearing copy should mar the user experience far less. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-24sna: Fix canonical mode name to correctly use asprintfChris Wilson
Whoops. Only the kernel sprintf() accepts NULL as a valid target string, not libc's. Reported-by: Jay Little <jaylittle@jaylittle.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70835 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>