Commit Graph

3737 Commits

Author SHA1 Message Date
Chris Wilson 101942d41d uxa: Unmap the buffer after swrast
Otherwise we may exhaust the per-process vma limit and cause
applications to stop rendering and eventually crash the X server.

Will only work in conjunction with a new libdrm (2.4.28) and commit
  c549a77c (intel: Unmap buffers during drm_intel_gem_bo_unmap)
in particular.

Reported-by: nobled@dreamwidth.org
References: https://bugs.freedesktop.org/show_bug.cgi?id=43075
References: https://bugs.freedesktop.org/show_bug.cgi?id=40066
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 10:30:06 +00:00
Chris Wilson b424b10e77 sna: use tight pitches for a8
As we never use these with a depth nor attach them to scanout, we can
safely relax the multiple-of-64 byte pitch restriction. In the unlikely
event that we do need A8 surfaces with depthbuffers, this is broken...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-04 13:55:26 +00:00
Chris Wilson 46c7df8038 sna: Remove one redundant retire
There is no need to retire immediately after a batch and no indication
that it will be useful.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-03 22:59:28 +00:00
Chris Wilson b99c6b13eb sna: Pass the current value of the batch offset to the kernel relocator
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-03 22:59:28 +00:00
Chris Wilson 735219cd59 uxa: Ensure that we can fallback with all of (src, mask, dst) as GTT mappings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 10:42:00 +00:00
Chris Wilson f6c82c73b6 uxa: Fix runtime linking of previous commit
So much for relying on compiler warnings.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 10:34:10 +00:00
Chris Wilson 85d3dc5910 uxa: Reset size limits based on AGP size
The basis for the constraints are what we can map into the aperture for
direct writing with the CPU, so use the size of the mappable region as
opposed to the size of the total GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-02 10:22:51 +00:00
Chris Wilson e551987461 sna: Reuse the full size of an old handle for io
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-01 13:49:03 +00:00
Chris Wilson c5632369cb sna: Move the preservation of the io handle into the common destroy path
In order to capture and reuse all io buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-01 13:23:56 +00:00
Chris Wilson 95f4da647a sna: Align pwrite to transfer whole cachelines
Daniel claims that this is will be faster, or will be once he has
completed rewriting pwrite!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-30 12:08:39 +00:00
Chris Wilson ecd6cca617 sna/gen5: Handle cpu-bo for render targets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-29 19:27:46 +00:00
Chris Wilson d8f2e87473 sna/render: Fix check for "migrate whole pixmap"
The whole pixmap means the sample covers the full width and height, not
just either!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-29 14:14:23 +00:00
Chris Wilson 20e5791408 sna: Fix assertion around flushing of mmap(PROT_READ)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-29 10:59:20 +00:00
Chris Wilson 56155c91af sna/gen6: Set the batch mode prior to checking limits and flushing
If we change contexts, then we will submit the batch obsoleting the
earlier resource checks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-29 10:27:18 +00:00
Chris Wilson 5b1e9e1573 sna: Always reduce tiling for thin pixmaps
Benchmarking on the current code base, says this is now a win. A
reversal of older benchmarks, so expect further tuning.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-28 22:01:00 +00:00
Chris Wilson dacb301c05 sna: Use the correct pitch when creating an untiled active buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-28 20:39:51 +00:00
Chris Wilson 8657128fa7 sna: Pass the pixmap to sna_replace()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-28 18:59:50 +00:00
Chris Wilson 4e38d22105 sna: Tidy kgem_choose_tiling()
Reduce the calls to compute the surface size down to one.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-28 18:59:50 +00:00
Chris Wilson 04f47e52da sna: Don't try to guess when the kernel believes a buffer to be flushed
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-28 18:22:48 +00:00
Chris Wilson d87c332653 sna: Eliminate empty glyphs during format conversion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-27 10:18:35 +00:00
Chris Wilson 413776c79e sna: Use 64-bit mov (when available) for bitmap glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-27 10:18:35 +00:00
Chris Wilson 507f99eba2 sna/gen6+: Only use BLT if the untiled bo will cause per-pixel TLB misses
i.e. only force the BLT if using the sampler is going to be incredibly
slow.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-27 09:04:10 +00:00
Chris Wilson f11e9f1891 sna: Only check for all-damaged CPU bo if we may discard the GPU bo
The goal of the optimisation is to discard the GPU bo early, so we
can skip the extra damage reduction if there is no gpu bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-27 09:04:10 +00:00
Chris Wilson ccee730e45 sna: Discard the gpu-bo is the entire pixmap is written to by the CPU.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-27 09:04:10 +00:00
Chris Wilson df68b20a17 sna: Disabling tiling if the bo would be smaller than a page
Once again experiment with untiled smalled buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-27 09:04:10 +00:00
Chris Wilson d88ad2e60a sna: Round up stride to alignment for TLB miss checking
We want to avoid the condition of reducing the tiling mode (when reusing
an active untiled buffer in preference to creating a new) for a wide buffer
when doing will force a TLB miss on each sample.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-27 09:04:09 +00:00
Chris Wilson 16f5e224dc sna: Avoid the double application of drawable offsets for tiled spans
As we handle tiled spans indirectly, we need to avoid applying the
drawable offsets twice (once in the mi layer generating the spans, and
then once more in the tiled rect renderer).

Reported-by: Ulrich Müller <ulm@gentoo.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43245
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 16:21:41 +00:00
Chris Wilson e06789871b sna/gen5+: Prefer using the BLT when either src or dst is untiled
The cost of the TLB miss on every sample far outweighs the impact of the
context (and ring) switch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 15:53:29 +00:00
Chris Wilson d0cce0da71 sna/gen5: Use the same prefer_blt_fill() switch for fill-one
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 13:16:37 +00:00
Chris Wilson 7ad2d3b695 sna/gen2: Wire up NO_COMPOSITE for debugging
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-25 09:44:21 +00:00
Chris Wilson 394ad51c42 sna/video: Check for Xv presence in the server before initialising
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 22:04:50 +00:00
Chris Wilson a2fab9560e sna: Downgrade Y-tiling if we must use the BLT
There are many operations, usually the core drawing acceleration, where
the BLT is much more preferable than using the CPU. However, the BLT is
limited to only using X-tiling, so if we encounter a Y-tiled pixmap
target we need to recreate it as X-tiling before proceeding. Hopefully,
the pixmap is then kept around and rendered multiple times to amoritize
the cost of the copy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 22:04:50 +00:00
Chris Wilson e0a4492c8b sna: Use Y-tiling for source pixmaps
Y-tiling is slightly faster with RENDER operations, so attempt to
allocate source-only pixmaps using this tiling mode. Actually using
Y-tiling is a delicate balance because it then prevents the use of the
BLT. For instance, enabling Y-tiling by default gives a 30% performance
improvement on the fish-demo (compositing benchmark) at 2560x1440 on
Ironlake but regresses tiger-demo by 2x (spans benchmark).

So experiment with this compromise and allow for changing the default
tiling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 22:04:48 +00:00
Chris Wilson 7e4a1b7ed2 src/sna/gen5: Replace the precompiled shaders
Take advantage of a couple of new instructions introduced with Cantiga
to reduce the instruction count inside the shaders and improve
performance by around 10% in the fish-demo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 18:24:37 +00:00
Chris Wilson 67ea8808d7 sna/gen5: Remove the unused SIP
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 12:57:36 +00:00
Chris Wilson 499ed74e97 sna: Tweak cancellation of deferred flush
The goal is to keep running until the tick after every stops,
irrespective of forced flushes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 11:02:01 +00:00
Chris Wilson 35239d207c sna: Always call retire following a mmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:40:33 +00:00
Chris Wilson 11e0b456de sna/gen5: Use the BLT rather than flush when copying
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 10:40:33 +00:00
Chris Wilson a44663af93 sna/gen4,gen5: Fix typo and only emit a flush if the video source is dirty
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-24 03:04:53 +00:00
Chris Wilson 4a27dd287c uxa: Make the glamor/uxa transition more verbose
And so hopefully make it clearer. In the process we restore the flushing
behaviour for UXA back to before the glamor intervention.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-21 13:02:34 +00:00
Chris Wilson b0d64a9567 sna: Correct end-point adjustment for stippling PolySegment
Reported-by: Roman Jarosz <kedgedev@gmail.com>
Reported-by: da_fox@mad.scientist.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43134
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-21 11:54:59 +00:00
Chris Wilson a5353a7c1d sna/gen4: Use the special composite rect emission for fill_one()
In order to workaround a bug in the shaders on gen4, we need to flush
the pipeline after every rectangle. The recently introduced fill-one
mechanism for gen4, missed this vital step triggering a random hang with
an otherwise sane batchbuffer (the missing flush is hard to spot!).

Fixes regression from 86f99379ee (sna/gen4: Add fill-one).

Reported-by: Albert Damen <albrt@gmx.net>
Reported-by: Fryderyk Dziarmagowski <fdziarmagowski@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43083
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-21 10:58:17 +00:00
Chris Wilson 3b9479dc39 sna: Micro-optimise sna_push_pixels_solid_blt()
Unroll the byte reversal as we know the row length is word aligned.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-19 19:12:31 +00:00
Chris Wilson 297f7680cf sna: Avoid the NULL damage deref
Fixes x11perf -wdcircle100 -time 1 -repeat 1 -rop GXxor

Reported-by: Fryderyk Dziarmagowski <fdziarmagowski@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43084
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-19 16:11:42 +00:00
Chris Wilson 4a86ec5ddb sna/gen7: Apply recent SNB tuning as applicable
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-19 08:34:59 +00:00
Chris Wilson fe944d61d5 sna/gen7: Correct shifts for surface state
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-19 08:34:59 +00:00
Chris Wilson 70042400fd sna/gen7: minor tidy of redundant defines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-18 23:47:10 +00:00
Chris Wilson f938cd1599 glamor: Include glamor cflags and libs for atypical builds
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-11-17 13:43:37 +00:00
Zhigang Gong fbabe60f48 glamor: Initial commit to introduce glamor acceleration.
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-17 01:10:21 +00:00
Chris Wilson ac7df2919b Revert "Disable adding normal RTF modes for an eDP"
This reverts commit 212fa98687.

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-16 23:29:39 +00:00