summaryrefslogtreecommitdiff
path: root/src/intel_display.c
AgeCommit message (Collapse)Author
2012-10-20uxa: Disable bo reuse after binding to a scanoutChris Wilson
On gen6+, bo are expected to be LLC by default. However, as using the bo for the scanout causes it to be moved into the uncached domain, this assumption is then false and we should release the bo back to the system rather than spread the uncached buffers around. The most common allocator of scanouts is for pageflipping which are already non-reusable due to the DRI2 export, so there should actually be little impact. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-12Fix possible_clones computation for shared encoders between outputsPaulo Zanoni
Libdrm's possible_clones is a mask of encoders. Xorg's possible_clones is a mask of outputs, so we just can't do the following: output->possible_clones = kencoder->possible_clones; This is a problem on Haswell because, at least with the current patches floating on the mailing list, there is more than one connector per encoder. This patch writes the code to properly translate libdrm's encoder mask into Xorg's output mask. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27uxa: Update mode->fb_id after completing pageflipsChris Wilson
As intel_crtc_on() depends upon the current value for determining if the pipe is active, we can only change the value afterwards. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-27uxa: Confirm the pipe is alive before flippingChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-26uxa: Prevent attempting to call intel_mode_fini() before PreInit runsChris Wilson
In the Ubuntu xserver it is apparently possible for the Screen to be deleted prior to being fully initialised. Make sure we don't crash in that situation! Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55346 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-23Silence a couple of potential compiler warningsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-14Skip adding unknown special modesChris Wilson
In light of the discussion on how to add stereo modes it was revealed that we would happily add modes with unknown and unhandled strange flags. Adam Jackson mentioned that he has plans to fix that with some upcoming work, but as a first step we can simply eradicate them whilst pondering how to support the stereoscopic vision of the future. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-05uxa: Fix cut'n'paste error in Option "Backlight"Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-03uxa: Fix Backlight option support.Сковорода Никита Андреевич
Signed-off-by: Сковорода Никита Андреевич <chalkerx@gmail.com>
2012-09-03intel: add pixmap tracking and scanout support. (v2)Dave Airlie
This adds support for pixmap tracking and scanout of alternate pixmaps. v2: do dirty updates after uxa block handler, check if kernel can flush vmap for us so we don't have to. Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-08-26Add Option "Backlight" to override the probed backlight control interfaceChris Wilson
The automatic selection may not correspond with the correct backlight (such as in a multi-gpu, multi-panel device) or the user may simply prefer another control interface. This allows them to override the chosen interface using Option "Backlight" "my-backlight" to specify '/sys/class/backlight/my-backlight' as the interface to use instead. Suggested-by: Alon Levy <alevy@redhat.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=29273 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-25uxa: Add Apple's gmux to the list of known preferred backlightsChris Wilson
Reported-by: Austin Lund <austin.lund@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52423 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-15uxa: Remove Shadow hackChris Wilson
This was an incomplete hack so deprecate in favour of Shadow-on-Steriods, SNA. References: https://bugs.freedesktop.org/show_bug.cgi?id=47324 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-14Drop some unused includesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04uxa: Install the drm_wakeup_handler for vblank events in !use_page_flippingChris Wilson
Even if page-flipping itself is disabled, we still want to allow the client to schedule wakeups for some future vblank which requires listening to the kernel vblank notifications. Reported-by: Eric Anholt <eric@anholt.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51699 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-02Add asus-nb-wmi backlight controlTom Hughes
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51593
2012-06-14uxa: Force the outputs to off for consistency with xf86DisableUnusedFunctions()Chris Wilson
Upon a VT switch, we set the desired modes and turn off the DPMS on any unused output. Make this explicit so that we always maintain consistency between the kernel and X's list of enabled CRTCs. References: https://bugs.freedesktop.org/show_bug.cgi?id=50772 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12uxa: do copy fb at startup.Dave Airlie
Copy the current framebuffer for smooth wayland->gdm handoff. This has been hanging around in Fedora for too long now, and we've dropped the feature a few times, and yes I know the Simpsons did it^W^W^W SNA does it. I've updated the code to have some of the better fixes from nouveau. I've no idea who wrote this code either, krh or ajax. [ickle: The earliest version I've found had krh's fingerprints on it, though it may still have been a joint effort.] Signed-off-by: Dave Airlie <airlied@redhat.com> [ickle: improve error handling, only copy the fb during initial takeover]
2012-06-05uxa: Check for DPMS off before scheduling a WAIT_ON_EVENTChris Wilson
Regression from commit 3f3bde4f0c72f6f31aae322bcdc20b95eade6631 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu May 24 11:58:46 2012 +0100 uxa: Only consider an output valid if the kernel reports it attached When backporting from SNA, a key difference that UXA does not track DPMS state in its enabled flag and that a DPMS off CRTC is still bound to the fb. So we do need to rescan the outputs and check that we have a connector enabled *and* the pipe is running prior to emitting a scanline wait. References: https://bugs.freedesktop.org/show_bug.cgi?id=50668 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04uxa: Check for failure from drmModeGetConnector()Chris Wilson
Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04uxa: check for failure to allocate drmModeCrtcChris Wilson
Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02uxa: NameForAtom may return NULLChris Wilson
Reported-by: Zdenek Kabelac <zkabelac@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-24Unify options handling between UXA and SNAEugeni Dodonov
Unifies available options for both UXA and SNA drivers, and moves them into a common header file, intel_opts.h. Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-05-24uxa: Only consider an output valid if the kernel reports it attachedChris Wilson
Reported-by: Kyle Hill <kyle.hill@tacomafia.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50078 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-26Avoid duplicated code with intel_output_create_ranged_atomPaulo Zanoni
Same change for intel_display.c and sna_display.c. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21uxa/glamor/dri: Enable the pageflip support on glamor.Zhigang Gong
To support easy buffer exchange at glamor layer, glamor added a new API glamor_egl_exchange_buffers() to exchange two pixmaps' EGL image and fbos and textures without recreating any of them. But this simple method's requirement is that there are two pixmaps. A exceptional case is: If we are using triple buffer when do page flipping, we will have an extra back_buffer which doesn't have a pixmap attached to it. Then each time we set that buffer to a pixmap, we will have to call the create_egl_textured_pixmap to create the corresponding EGL image and fbo and texture for it. This is not efficient. To fix this issue, this commit introduces a new back_pixmap to intel structure to hold the back buffer and corresponding glamor resources. Then we will just need to do the light weight buffer exchanging at both DDX and glamor layer. As the new back pixmap is similar to the screen pixmap and need to be handled carefully when close screen. As the glamor data structure is a per screen data, and will be released at its close screen method. The glamor's close screen method must cleanup the screen pixmap and back pixmap's glamor resources. screen pixmap is easy to get, but there is no good way to store the back pixmap. So the glamor add a new API glamor_egl_create_textured_screen_ext function to pass the back pixmap's pointer to glamor layer. This commit make us depend on glamor commit: 4e58c4f. And we increased the required glamor version from 0.3.0 to 0.3.1 Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-17uxa: Explicitly check for libdrm_intel in configureChris Wilson
And remove the excess dependencies from the common files. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-08xf86-video-intel: change order of DPMS operationsSimon Que
The operations when setting dpms on should be in the order opposite of what's done when setting dpms off. This is because of potentially conflicting effects: ~ drmModeConnectoSetProperty() enables/disables the backlight driver. Some backlight drivers such as intel_backlight set the backlight to 0 when disabled and to max when enabled. ~ intel_output_dpms_backlight() saves the backlight value when turning DPMS off and restores it when turning DPMS on. Here's the current order of operations: xset dpms force off (backlight is nonzero) drmModeConnectoSetProperty(DPMSModeOff) kernel: disable backlight, backlight=0 intel_output_dpms_backlight(DPMSModeOff) save backlight value (0) <-- it has been set to 0 by kernel set backlight to 0 xset dpms force on drmModeConnectoSetProperty(DPMSModeOn) kernel: enable backlight, backlight=max intel_output_dpms_backlight(DPMSModeOn) set backlight to saved value (0) The correct way to do this would be to reverse the operations during xset dpms force off: intel_output_dpms_backlight(DPMSModeOff) save backlight value (nonzero) set backlight to 0 drmModeConnectoSetProperty(DPMSModeOff) kernel: enable backlight, backlight=0 This restores the saved nonzero backlight value during the force on. Signed-off-by: Simon Que <sque@chromium.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02uxa: Fix runtime linking of previous commitChris Wilson
So much for relying on compiler warnings. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-17glamor: Initial commit to introduce glamor acceleration.Zhigang Gong
Added one configuration option --enable-glamor to control whether use glamor. Added one new file intel_glamor.c to wrap glamor egl API for intel driver's usage. This commit doesn't really change the driver's control path. It just adds necessary files for glamor and change some configuration. Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-16Revert "Disable adding normal RTF modes for an eDP"Chris Wilson
This reverts commit 212fa9868767637e8f430485eeb522c99e63fd16. The underlying register programming for eDP is now believed to be fixed as of linux-3.1. References: https://bugs.freedesktop.org/show_bug.cgi?id=38012 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41070 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-16sna: Reduce and clarify dependenciesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-13Disable adding normal RTF modes for an eDPChris Wilson
This is causing a hard hang with 2.6.39+, we don't know why so play safe and disable for the time being. References: https://bugs.freedesktop.org/show_bug.cgi?id=38012 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-11dri: Enable triple-bufferred pageflipsChris Wilson
By popular demand. Triple-buffering trade-offs output latency versus jitter. By having a pre-rendered frame ready to swap in following a pageflip, we avoid the scenario where the latency between receiving the flip complete signal from the kernel, waking up the vsynced application, it render the new frame and then for the server to process the swap request is greater than the frame interval, causing us to miss the vblank. The result is that application can become frame-locked to 30fps. Instead, we report to the application that the first frame swap is immediately completed, supply a new back buffer (or else the rendering would be blocked on waiting for the front-buffer to be swapped away from the scanout) and let them proceed to render the second frame. The second frame is added to the swap queue, and the client throttled to vrefresh. (If the client missed the vblank, the swap queue is empty and the client is immediately woken again, whilst the pageflip is pending.) Note, for practical reasons this only applies to page-flipping, for example, calls to glXSwapBuffer() on fullscreen applications. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-04-20Use SwapbuffersWait config option to control waiting on fullscreen swapsChris Wilson
As fullscreen swaps were going via a different path to the swapping of ordinary windows, we were no longer honouring the xorg.conf option to disable swapbuffer waiting. This changes the code to only use pageflipping if the Option "SwapbuffersWait" is set to "TRUE" (default). Jesse's comment was that this should be superseded by actually supporting asynchronous page flips. As we are missing kernel and dix level support for that, in the meantime honour the config option. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Kristian Høgsberg <krh@bitplanet.net>
2011-04-04Take advantage of the kernel flush for dirty bo in the busy ioctlChris Wilson
Rather than just creating and submitting a batch that simply contains a flush in order to periodically ensure that rendering reaches the scanout, we can simply ask the kernel whether the scanout is busy. The kernel will then submit a flush on our behalf if it is dirty, which takes advantage of the kernel's dirty state tracking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-23Handle drawable/client destruction in pending swaps/flipsKeith Packard
A pending swap or flip holds references to drawables and clients which become invalid when destroyed. Add suitable resources to the database to track those lifetimes and clean up the pending data structure then. Later, when the pending swap or flip occurs, handle a missing drawable by just discarding the flip or swap. Handle a missing client by not sending an event or reply. Signed-off-by: Keith Packard <keithp@keithp.com>
2011-03-23dri2: Make DRI2FrameEvent public and use instead of void *Keith Packard
Instead of using void * for all of the flip_info and swap_info pointers, just make the underlying structure a public data type and use that. Signed-off-by: Keith Packard <keithp@keithp.com>
2011-01-31Rename 'intel' backlight to match upstream name in 2.6.38Chris Wilson
(Just waiting for libbacklight to bring sanity...) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-01-08Cache the fixed crtc<->pipe relationshipChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-16Fix reporting of pageflip completion events on multi-head.Mario Kleiner
When a drawable is page-flipped on multiple crtc's (fullscreen drawable on mirror-mode or multi-head x-screen), only one pageflip event is finally delivered, after the last participating crtc signals flip completion, this to avoid visual corruption. Old code returned vblank count and timestamps of flip completion of this last crtc, instead of the values of the "master crtc", the one that was used for initially scheduling/triggering the pagflip via vblank events. (master = I830DRI2DrawablePipe(drawable)) This patch makes sure that the pageflip completion values of the "master" crtc are returned, otherwise client applications will get confused by the random (msc, ust) values returned by whichever crtc was the last to complete its flip. Without this, the returned values change randomly and jump forward and backward in time and count. Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-05display: Flush any pending batches before changing modes.Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-03Wait on the current buffer to complete when running synchronously.Chris Wilson
And remove the vestigal wait upon changing crtc as this is more properly done in the kernel. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-11-17Mark outputs as DPMSModeOn and restore backlight at mode setKeith Packard
The kernel always turns monitors on when doing mode setting, and so no further DPMS action is required. Note this in the mode setting code by marking the updated DPMS mode and restoring any saved backlight level. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2010-11-05Wait for any pending rendering before switching modes.Chris Wilson
A perennial problem we have is the accursed WAIT_FOR_EVENT hangs, which occur when we switch the framebuffer before the WAIT_FOR_EVENT completes and upsets the GPU. We have tried more subtle approaches to detected these and fix them up in the kernel, to no avail. What we need to do is to delay the framebuffer flip until the WAIT completes, which is quite tricky in the kernel without new ioctls and round-trips. Instead, apply the big hammer from userspace and synchronise all rendering before changing the framebuffer. I expect this not to cause noticeable latency on switching modes (far less than the actual modeswitch) and should stop these hangs once and for all. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31401 (...) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-17display: do not report failure for setting unrecognised propertiesChris Wilson
We need to accept any changes to properties not handled by ourselves -- we can't validate the changes ourselves. Denying those changes breaks EDID reporting, for example. Reported-by: Elvis Pranskevichus <el@prans.net> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-22display: Refactor is_panel()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-21Allow interlaced modes.Krzysztof Halasa
This may not the best method, but it should be a good base on which to build... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-10display: Free the EDID blob after we copy it to the output, not before.Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-09-08Enable a shadow buffer and disable GPU acceleration.Chris Wilson
An attempt to workaround the incoherency in gen2 chipsets, we avoid using dynamic reallocation as much as possible. The first step is to disable allocation of pixmaps using GEM and simply create them in system memory without a backing buffer object. This forces all rendering to use S/W fallbacks. The second step is to allocate a shadow front buffer and assign that to the Screen pixmap. This ensure that the front buffer remains in the GTT and pinned for scanout. The shadow buffer will be rendered to in the normal fashion via the Screen pixmap, and be marked dirty. In the block handler, the dirty shadow buffer is then blitted (using the GPU) over the front buffer. This should completely avoid having to move pages around in the GTT and avoid incurring the wrath of those early chipsets. Secondly, performance should be reasonable as we avoid the ping-pong caused by the small aperture and weak GPU forcing software fallbacks. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>