summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-06-07Support RandR 1.4 interface changes for per-crtc pixmapsrandr-1.4Keith Packard3-78/+193
Export crtc setting and scanout buffer allocation functions. Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-07Use the direct dixGevPrivate() API when availableChris Wilson2-2/+9
This is quicker and smaller than the old indirect function call to dixLookupPrivate(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-07Adapt glyphs for changes in devPrivates APIChris Wilson2-10/+29
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-06Adapt to DevPrivate API changesKeith Packard4-0/+25
This allows the driver to be built against either the old or new DevPrivate API. Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-06Use libc instead of deprecated libc wrappers for malloc/calloc/free.Eric Anholt16-127/+127
2010-06-06uxa: Force fallback for copies.Chris Wilson1-2/+7
All but uxa_copy_window() perform the preliminary checks for whether acceleration is available. The simplest method for adding the fallback for uxa_copy_window() seems to be to add it in the core copy function, so be it. This allows X to survive a little longer once we encounter a GPU hang. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-02dri: Protect against NULL dereference following GPU hang.Chris Wilson1-3/+11
References: Bug 28361 - "glresize" causes server segfault with single buffering. https://bugs.freedesktop.org/show_bug.cgi?id=28361 [ 14528.767] (EE) intel(0): Failed to submit batch buffer, expect rendering corruption or even a frozen display: Input/output error. [ 14528.767] (EE) intel(0): Disabling acceleration. [ 14528.788] Backtrace: [ 14528.858] 0: /usr/bin/X (xorg_backtrace+0x28) [0x491818] [ 14528.858] 1: /usr/bin/X (0x400000+0x65ca9) [0x465ca9] [ 14528.858] 2: /lib/libpthread.so.0 (0x7f9df2dc9000+0xedf0) [0x7f9df2dd7df0] [ 14528.858] 3: /usr/local/lib/libdrm_intel.so.1 (drm_intel_bo_flink+0x0) [0x7f9defd60c60] [ 14528.858] 4: /usr/local/lib/xorg/modules/drivers/intel_drv.so (0x7f9deff6a000+0x2fdfd) [0x7f9deff99dfd] [ 14528.858] 5: /usr/lib/xorg/modules/extensions/libdri2.so (0x7f9df01b8000+0x19e7) [0x7f9df01b99e7] [ 14528.858] 6: /usr/lib/xorg/modules/extensions/libdri2.so (0x7f9df01b8000+0x1fdb) [0x7f9df01b9fdb] [ 14528.858] 7: /usr/lib/xorg/modules/extensions/libdri2.so (DRI2GetBuffersWithFormat+0x10) [0x7f9df01ba250] [ 14528.858] 8: /usr/lib/xorg/modules/extensions/libdri2.so (0x7f9df01b8000+0x3834) [0x7f9df01bb834] [ 14528.858] 9: /usr/bin/X (0x400000+0x2fc2c) [0x42fc2c] [ 14528.858] 10: /usr/bin/X (0x400000+0x24da5) [0x424da5] [ 14528.858] 11: /lib/libc.so.6 (__libc_start_main+0xe6) [0x7f9df1d60a26] [ 14528.858] 12: /usr/bin/X (0x400000+0x24959) [0x424959] [ 14528.858] Segmentation fault at address 0x20 [ 14528.858] Fatal server error: [ 14528.858] Caught signal 11 (Segmentation fault). Server aborting Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-01i830: Remove unused coord-adjust.Chris Wilson1-3/+0
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-01i915: Centre sampling.Chris Wilson1-145/+85
Use centre sampling of textures to match pixman, and remove numerous off-by-one and visual artefacts when rendering. The classic example for this is cairo/text/xcomposite-projection where the edge of the rotated rectangle is jaggy due to the incorrect sample position. Fixes: Bug 16917 - [i915] Blur on y-axis also when only x-axis is scaled billiear https://bugs.freedesktop.org/show_bug.cgi?id=16917 And about 15 tests from the Cairo test suite. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-01i915; Avoid the implicit flush on changing BUF_INFOChris Wilson3-31/+40
3DSTATE_BUF_INFO is an implicit flush of the piepline, so avoid emitting that and associated state unless the destination pixmap has actually changed. This is a win of around 3-5% for cairo-perf-trace, notably for firefox. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-01DRI2: fix new buffer exchange checkJesse Barnes1-31/+31
Chris's new buffer exchange check is a good one, but we don't want to hit the immediate blit fallback path if it fails. We still want to schedule a blit for sometime in the future, and we need to use it wherever an exchange might occur (like the secondary flip check or the currently disabled CanExchange check). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28252. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-05-31uxa: Spans, try again to get the early break correct.Chris Wilson1-1/+1
Trigger happy bug fixing. The sign *was* right, the endpoint was wrong. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31uxa: Sign reversal on early break from spans passing the YXbandChris Wilson1-1/+1
Introduced with e5c971e7639095d38da3518a5dc404b708d45cfb. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31Disable acceleration if we detect a hardware error.Chris Wilson9-13/+40
This is wildly optimistic, but it should work in a surprising number of error situations and some output in those cases will be hopefully be better than none... If we submit a batchbuffer and the kernel reports the GPU is hung (which will be caused by an earlier execbuffer, and so the kernel should have had enough time to determine whether or not it could reset the GPU) then disable any further attempt to accelerate gfx and force fallbacks to map the buffers and use the CPU. We cannot normally map any more buffers if the GPU is hung, so only those already mapped prior to the hang can be written to, or those allocated in system memory. However, we can expect that the framebuffer is already mapped, and so have a reasonable expectation to continue to see the display update. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31uxa: Mega-Glyphs!Chris Wilson4-840/+704
Rewrite glyph rendering to avoid the intermediate buffer, accumulating the glyph rectangles directly in the backend composite routines. And modify the glyph cache routines to fully utilise the allocated size of the tiled buffer on older hardware. To do this we alias all glyph sizes into the same texture using a technique suggested by Keith Packard. PineView: 885/856-> 1150/1110 kglyph/s (aa/rgb) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-31i915: Support textured video on an extended desktop.Chris Wilson1-35/+76
Handle rendering textured video onto an extended desktop (>2048) by using a temporary pixmap. Note that we still cannot handle rendering to a greater than 2048 destination region, for that we will need to tile. Hmm, time to request a 2560x1600, 10bpc monitor... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-29dri: Compilation fix.Chris Wilson1-1/+1
17:53 < arekm> ickle: i830_dri.c:630:28: error: ‘DrawableRec’ has no member named ‘bpp’ 17:53 < arekm> ickle: i830_dri.c:630:57: error: ‘DrawableRec’ has no member named ‘bpp’ * sigh. I need to fix this machine to have the right version of the * headers. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-29dri: Only flip if the front and back pixmaps match.Chris Wilson1-6/+38
An unredirected window (thanks Michel for the reminder) is backed by the Screen pixmap, and so uses a reference of that as its front buffer. The back buffer is a pixmap appropriately sized for the drawable. When the application requests to swap its buffers, obviously we cannot simply exchange the front and back buffer as they do not match, but need to copy the appropriate region from the back to the front. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-29Revert "dri: Use size from backing pixmap when creating buffers."Chris Wilson1-11/+11
This reverts commit 44d45d3fa56f121ce89ffe5b28beb48be01a95df. Michel Dänzer pointed out the flaw in using the pixmap size instead of the drawable size: Using the backing pixmap dimensions for this is not desirable. In particular, it means that the DRI2 buffers of non-redirected windows always have the same size as the screen. But even for redirected windows it wastes some graphics memory with a re-parenting window manager, that is if it doesn't break in various ways due to the top left corner of the DRI2 buffers no longer corresponding to the top left corner of the window.
2010-05-29dri: Use size from backing pixmap when creating buffers.Chris Wilson1-11/+11
This avoid using the garbage values stored in the Screen drawable, instead of the true values which are only maintained in its backing pixmap. The consequence of using the wrong size was to hand a 1x1 pixmap to metacity/mutter and have it believe it was a full screen drawable; GPU hangs ensued if using page flipping. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-28i915: Don't re-emit vertex size unless it has changed.Chris Wilson3-5/+7
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-28uxa: Fix prepare_solid being called without check_solid first.Eric Anholt1-0/+5
Fixes GPU hang on gen6.
2010-05-28uxa: Skip the redundant miComputeCompositeRects() when adding to the maskChris Wilson1-33/+20
As we are in full control of the destination (the temporary glyph mask) and the source (the glyph cache) we know that there are no clip regions on either and so can skip computing the composite rectangles. (We trust the device clipping to prevent compositing outside the target.) x11perf on PineView: 701/686 -> 881/856 kglyphs/s [aa/rgb] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-28uxa: Make the glyph caches' fixed size explicit.Chris Wilson2-9/+6
Until we actual resize the glyph cache dynamically, make it obvious to the reader and the compiler that the size is fixed. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-28uxa: Use a glyph private rather than a hash table.Chris Wilson3-196/+141
Store the cache position directly on the glyph using a devPrivate rather than an through auxiliary hash table. x11perf on PineView: 650/638 kglyphs/s -> 701/686 kglyphs/s [aa/rgb] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26Decouple non-reusuable pixmaps from batch lists on unref.Chris Wilson1-2/+5
==7596== Invalid write of size 4 ==7596== at 0x491ACA8: intel_batch_teardown (i830_batchbuffer.c:118) ==7596== by 0x491C9D6: I830CloseScreen (i830_driver.c:1419) ==7596== by 0x8103A9C: RRCloseScreen (randr.c:105) ==7596== by 0x80DE794: xf86CrtcCloseScreen (xf86Crtc.c:759) ==7596== by 0x80BEBA3: DGACloseScreen (xf86DGA.c:268) ==7596== by 0x80D044B: DPMSClose (xf86DPMS.c:134) ==7596== by 0x488B050: XvCloseScreen (xvmain.c:320) ==7596== by 0x81841B1: VidModeClose (xf86VidMode.c:110) ==7596== by 0x80EB12F: CursorCloseScreen (cursor.c:191) ==7596== by 0x810CA17: AnimCurCloseScreen (animcur.c:108) ==7596== by 0x816937E: compCloseScreen (compinit.c:86) ==7596== by 0x48D39B9: glxCloseScreen (glxscreens.c:221) ==7596== Address 0x49c1a50 is 24 bytes inside a block of size 52 free'd ==7596== at 0x4024866: free (vg_replace_malloc.c:325) ==7596== by 0x80B023C: Xfree (utils.c:1096) ==7596== by 0x4927CFD: i830_set_pixmap_bo (i830_uxa.c:647) ==7596== by 0x491C9B4: I830CloseScreen (i830_driver.c:1413) ==7596== by 0x8103A9C: RRCloseScreen (randr.c:105) ==7596== by 0x80DE794: xf86CrtcCloseScreen (xf86Crtc.c:759) ==7596== by 0x80BEBA3: DGACloseScreen (xf86DGA.c:268) ==7596== by 0x80D044B: DPMSClose (xf86DPMS.c:134) ==7596== by 0x488B050: XvCloseScreen (xvmain.c:320) ==7596== by 0x81841B1: VidModeClose (xf86VidMode.c:110) ==7596== by 0x80EB12F: CursorCloseScreen (cursor.c:191) ==7596== by 0x810CA17: AnimCurCloseScreen (animcur.c:108) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26Add vertex bo to the list of buffers to be torn down.Chris Wilson1-1/+8
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26i965: Remove ATOMIC_BATCH.Chris Wilson1-2/+0
This paranoid check is deceased; pining for the fjords. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26Add a workaround for Ironlake errata relating to disabling the clipper.Eric Anholt1-0/+9
2010-05-26Add a workaround for Ironlake errata regarding blits and other engines.Eric Anholt1-0/+24
2010-05-26Remove remaining REG_DUMPER build stuff.Eric Anholt1-2/+0
2010-05-26uxa: Perform manual damage for CompositeRectsChris Wilson1-0/+5
[xserver-1.8] The damage layer doesn't wrap CompositeRects, so we need to manually append the damaged region ourselves. This works for miCompsiteRects since that translates the call into multiple invocations of either PolyFillRectangle or Composite, which themselves cause damage. Fixes: Bug 28120 - Tint2's tooltip borders end up at 0,0 and do not disappear https://bugs.freedesktop.org/show_bug.cgi?id=28120 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26uxa: Force the alpha value to 0xffff when treating Over as SrcChris Wilson1-1/+3
Since we have at most 8 bits of alpha, we treat >= 0xff00 as opaque. However, being paranoid we should set the alpha value to 0xfff in case something unexpected happens when converting from the xRenderColor to the pixel value. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26uxa: Use Composite rather than solid blitter for PolyRectChris Wilson1-22/+105
Due to the relocation overhead, using a single composite with many rectangles outperforms many solid blits. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26uxa: Add PICT format mapping for depth 4 pixmaps.Chris Wilson1-0/+1
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-26i830: Skip an empty fill.Chris Wilson1-0/+3
In the extremely unlikely event that the higher layer erroneous gave us an empty fill, skip it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-25uxa: Apply the drawable offset to the solid rectsChris Wilson1-6/+9
Fixes: Bug 28120 - Tint2's tooltip borders end up at 0,0 and do not disappear https://bugs.freedesktop.org/show_bug.cgi?id=28120 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24Merge branch 'glyphs'Chris Wilson19-830/+1708
Tweak glyphs to improve x11perf on i915 by about 33%. PineView, aa10text: 460 -> 617 kglyphs/s. PineView, rgb10text: 434 -> 610 kglyphs/s. Speedups ======== xcb poppler 18.636 -> 13.958: 1.34x speedup xlib firefox-talos-gfx 71.905 -> 56.232: 1.28x speedup xcb firefox-talos-gfx 72.882 -> 57.969: 1.26x speedup xlib gnome-terminal-vim 38.126 -> 34.472: 1.11x speedup xcb gnome-terminal-vim 35.164 -> 32.573: 1.08x speedup xlib poppler 19.634 -> 18.246: 1.08x speedup Note the lack of significant improvement for firefox-planet-gnome.
2010-05-24i915: Emit CA over using OutReverse + Add passesChris Wilson4-132/+183
On PineView: 578/621 -> 610/617 kglyphs/sec [rgb/aa]
2010-05-24uxa: Use temporary dest when target is too large for compositorChris Wilson9-123/+431
If the destination cannot fit into the 3D pipeline when we need to composite, we fallback to doing the operation on the CPU. This is very slow, and quite easy to trigger on i915 by plugging in an external display. An alternative is to extract the extents of the operation from the destination using the blitter which can usually handle much larger operations. This gives us a temporary target that can fit into the 3D pipeline and thus be accelerated, before copying back into the larger real destination. For x11perf this boosts glyph rendering on PineView, from 38kglyphs/s to 480kglyphs/s. Just a little shy of the native performance of 601kglyphs/s Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24uxa: Composite glyphs directly onto dst when possible.Chris Wilson3-158/+324
Without using a mask and compositing directly onto the destination, takes us from 580 kglyphs/s to 850 kglyphs/s on i945 [x11perf -aa10text]. However, the extra intersection check almost entirely cancels out the speed up and we discover that the glyphs in x11perf are always overlapping. Nothing is ever easy. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24i915: compute normalized texcoords using a scale factor.Chris Wilson1-44/+44
500 -> 580kglyphs/s on i945. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24uxa: translate the region in line for compositesChris Wilson1-19/+14
When compositing, we need to convert the box into a rect and so the advantages of using REGION_TRANSLATE are lost. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24i915: Add special case primitive emitters for glyphs.Chris Wilson1-5/+83
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24i915: Move vertices into a vertex buffer object.Chris Wilson7-225/+298
In theory this should allow us to pack far more operations into a single batch buffer, and reduce our overheads. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24Use pwrite to upload the batch bufferChris Wilson5-42/+25
By using pwrite() instead of dri_bo_map() we can write to the batch buffer through the GTT and not be forced to map it back into the CPU domain and out again, eliminating a double clflush. Measing x11perf text performance on PineView: Before: 16000000 trep @ 0.0020 msec (511000.0/sec): Char in 80-char aa line (Charter 10) 16000000 trep @ 0.0021 msec (480000.0/sec): Char in 80-char rgb line (Charter 10) After: 16000000 trep @ 0.0019 msec (532000.0/sec): Char in 80-char aa line (Charter 10) 16000000 trep @ 0.0020 msec (496000.0/sec): Char in 80-char rgb line (Charter 10) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24Kill paranoid assertions on every write into the batchbuffer.Chris Wilson9-148/+23
On my PineView box these represent ~5% overhead on x11perf text: Before: 16000000 trep @ 0.0020 msec (495000.0/sec): Char in 80-char aa line (Charter 10) 12000000 trep @ 0.0022 msec (461000.0/sec): Char in 80-char rgb line (Charter 10) After: 16000000 trep @ 0.0020 msec (511000.0/sec): Char in 80-char aa line (Charter 10) 16000000 trep @ 0.0021 msec (480000.0/sec): Char in 80-char rgb line (Charter 10) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-24i915: Emit composite primitive with specialised functions.Chris Wilson2-206/+358
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-23i915: amalgamate composite into a single primitive listChris Wilson5-6/+43
Combine all the calls to composite between prepare_composite and done_composite into a single primitive list, rather than a primitive call per composite(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-05-23uxa: Spans! OMG!Chris Wilson3-27/+187
Use composite rather than solid blits in order to bring performance on a par with the CPU when using GEM and relocations. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>