summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-02-24Update for glamor in the 1.16 server.glamor-dri3Eric Anholt2-2/+8
2014-02-24legacy/i810: Eliminate a shadow declaration warningKeith Packard1-2/+2
Rename 'dp' as '_dp' to avoid a warning from the compiler. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24Fix compile on 64-bit systems.Kenneth Graunke1-1/+1
Without this extra cast, the driver fails to compile with: intel_display.c:1748:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24Include xorg-server.h from new DRI3/Present code.Kenneth Graunke2-0/+2
xorg-server.h defines _XSERVER64 and COMPOSITE, which affect the definition of various structures. Without the include, this code sees different definitions than the X server, and crashes. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24Bump vblank error check from 200 frames to 1000 framesKeith Packard1-2/+5
My little 'present' demo program uses MSCNotify with an interval of 5 seconds, which is more than 200 frames. Crank it up to 1000 frames so that the demo works. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24Check all of the flip preconditions in the actual flip caseKeith Packard1-1/+1
We've checked all of the preconditions when the flip was queued, now go back and re-check all of them when the flip is executed to make sure nothing has changed. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24The DRM fd isn't actually non-blocking; use poll to check for eventsKeith Packard1-2/+11
When going off to try to read the DRM fd for events, make sure there's something present before actually reading. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24Flip to rotate_fb if presentKeith Packard1-5/+9
When page flipping, if there is a rotate fb, use that instead of the provided fb. This occurs when 'unflipping' when a subset of the crtcs have shadow frame buffers. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24Add Present extension supportKeith Packard5-0/+445
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24Add DRI3 and miSyncShm supportKeith Packard7-0/+345
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24Restructure DRM event handling.Keith Packard3-56/+390
This refactors the drm interrupt handling logic quite a bit, both to allow for either DRI2 or Present handlers, but also to eliminate passing pointers through the kernel. Passing pointers left the kernel holding the only reference to some internal X server data structures. After a server reset, the X server would end up using stale pointers stored in those structures. Using simple integers makes it possible to empty the queue of pending interrupt data and then ignore the stale kernel data. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-02-24Support 64-bit MSC values. Handle kernel vageries about MSC reportingKeith Packard3-96/+156
The kernel sometimes reports bogus MSC values, especially when suspending and resuming the machine. Deal with this by tracking an offset to ensure that the MSC seen by applications increases monotonically, and at a reasonable pace. Also, provide a full 64 bits of MSC value by noticing wrapping and tracking the high 32-bits of MSC separately. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-30sna: Silence a compiler warning for mismatching const stringsChris Wilson1-1/+1
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 Wilson1-1/+1
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 Wilson1-4/+4
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-30sna: Constify GCFunc to quieten the compiler.Chris Wilson2-2/+2
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>
2014-01-29sna: Fix format specifier typo ('%D') in DBGChris Wilson1-1/+1
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna: Always clear the domain even only a potential syncChris Wilson1-6/+4
It helps to keep the domain-tracking bookkeeping consistent. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna: We can only retire a bo if is not referenced by the current batchChris Wilson1-2/+4
Fixes regression from commit 8b0ebebcab21647348f769c25ca0c1d81d169e75 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Jan 28 16:30:47 2014 +0000 sna: Be a little more assertive in retiring after set-domain Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74176 Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna: Add assertions for set/get bindingChris Wilson1-0/+4
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna/gen4+: Assert that the cached binding location is validChris Wilson5-0/+5
We can at least check that it is in the right region (i.e. not past where the current surface has been allocated from). References: https://bugs.freedesktop.org/show_bug.cgi?id=74176 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna: Do not use color corrected pixel values for comparing against gcChris Wilson1-26/+24
Dashed zero-width lines devolve into two passes (first to draw the foreground dashes, and then to draw the gaps). The code was using the pixel value to decide which phase was being drawn -- however the color on the gc is not always bit exact (e.g. alpha channel) with the pixel value. As a result, we would oft miss drawing anything when rendering into the scanout. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1059152 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna/gen6+: Encourage inplace uploads for CompositeChris Wilson3-3/+9
First try using the blt path for a potential inplace upload for a simple composite operation copying from a ShmPixmap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29sna: Skip undamaged TearFree redisplaysChris Wilson1-6/+30
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-28Allow selection of glamor as the default acceleration methodChris Wilson3-7/+23
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74162 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-28sna: Check for a hang after a spurious error return from set-domain-ioctlChris Wilson1-22/+31
set-domain-ioctl should only ever fail for invalid user input, beyond the normal signal handling. As such if we do find a spurious error return from the kernel, check for a GPU hang. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-28sna: Be a little more assertive in retiring after set-domainChris Wilson1-4/+39
After a successful set-domain for writing with the CPU, we know that the buffer is idle so remove it from our request tracking. (External clients complicate matters in that they may keep the bo active even after our set-domain.) On the contrary, because of read-read optimisations a bo may still be active after a set-domain for reading by the CPU, in which we need to remain conservative in retiring the bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-28sna: Cancel the backlight change if set-property(DPMS) failsChris Wilson1-5/+6
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-27sna: Rearrange damage allocation to handle malloc failure more gracefullyChris Wilson1-151/+201
If we fail to allocate new damage boxes, first try collescing the existing boxes to free up memory. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-27sna: Use signal-safe DBGChris Wilson1-1/+11
Otherwise we end up confusing the core Xserver functions when called from auxilliary threads. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-24sna/gen3+: Allow for spill when aligning verticesChris Wilson3-3/+3
We need to flush the batch if we run out of space aligning our vertex buffer - but the test must anticipate the space required for the new alignment. Reported-by: Arkadiusz Miskiewicz Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-24sna/gen2+: Inspect composite flags to discard unneeded CPU damageChris Wilson7-70/+97
We can now check whether the Composite operation will require existing CPU damage and if not discard it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-23sna/gen2,3: Don't set BLT_DST_TILEDChris Wilson1-4/+4
This bit only exists for gen4+ so avoid setting it on gen2 and gen3, whilst setting it doesn't seem to cause any harm, there is no reason to risk it... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-23sna: Protect against fake CRTCs during initial probeChris Wilson1-1/+3
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 Wilson16-75/+87
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-23glamor: Don't require the glamoregl module to be pre-loaded with xserver >= 1.15Chris Wilson1-0/+2
Inspired by (ok, copied from): xf86-video-ati commit f2a0a5cf6c5a21e2a02280e110a4eb8e6609dace Author: Michel Dänzer <michel.daenzer@amd.com> Date: Wed Jan 22 11:04:42 2014 +0900 Don't require the glamoregl module to be pre-loaded with xserver >= 1.15 The issues with loading it on demand have been fixed in xserver 1.15. Inspired by Jérôme Glisse on IRC. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-22sna: Assert that the fill box is within boundsChris Wilson1-3/+13
References: https://bugs.freedesktop.org/show_bug.cgi?id=73811 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-21sna: Restore gc->serialNumber correctly after falling backChris Wilson1-3/+4
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73856 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-21sna: Initialise the TearFree shadow output from the current front bufferChris Wilson1-0/+14
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-21sna/gen4: Add an ALWAYS_FLUSH debugging optionChris Wilson1-5/+7
Still gen4 is cursed. This should restore the plateau we reached with 2.99.907 by forcing a full GPU flush between every operation. References: https://bugs.freedesktop.org/show_bug.cgi?id=55500 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-21sna: Drop bogus assert added in recent patchesChris Wilson1-2/+0
The intention was to detect if the gc->pCompositeClip still pointed to the temporary region. However, the assert failed to accomplish that goal. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-21sna: Reduce zeal of new gc->pCompositeClipChris Wilson1-1/+1
gc->pCompositeClip starts off NULL, just like sna_gc->priv. Reported-by: Arkadiusz Miskiewicz Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-21sna: Fix typo in assertion from previous commitChris Wilson1-1/+1
Sigh. It helps to remember to do compile testing with the right configuration. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-21sna: More assertions for tracking gc->pCompositeClipChris Wilson2-6/+13
Tracking down who leaves it modified... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20sna: build fix for OpenBSDMark Kettenis1-0/+1
Commit 50a45a1cdd4d8319ba9358974d241069689591c5 introduced the use of "struct stat" but doesn't include <sys/stat.h>. Presumably that leaks in trough some other header on Linux, but on OpenBSD compilation fails because the struct isn't known.
2014-01-20sna: Include serial numbers in ValidateGC DBGChris Wilson1-1/+6
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20sna: Short-cut the fallback for XCopyArea with depth < 8Chris Wilson1-3/+3
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20sna: Add some more DBG output around the clipping in sna_do_copy()Chris Wilson1-4/+18
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20intel-virtual-output: Tidy some DBG for copying new modesChris Wilson1-4/+8
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-20sna: Increase limit on number of possible outputsChris Wilson1-2/+3
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>