Commit Graph

3636 Commits

Author SHA1 Message Date
Chris Wilson fd3bc2af47 sna: Clamp object size to the min of 1/4 of the whole GTT or 1/2 the mappable
... for those pesky early devices whose GTT was no larger than the AGP
aperture.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 17:13:57 +01:00
Chris Wilson d294e41a6a sna: Update flush/retirement lists after a implicit flush for mmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 17:13:57 +01:00
Chris Wilson 3e53b0f3a3 sna: Enable relaxed-fencing for gen2 devices
(Just as dependent upon non-buggy kernels as gen3...)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 17:13:57 +01:00
Chris Wilson 33ddaf5429 sna: Fix gen2 tiled surface sizes
Actually use the gen2 path for gen2 devices!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 17:13:57 +01:00
Chris Wilson 9eceddf69f sna/gen2: fix batch buffer acounting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 17:13:57 +01:00
Chris Wilson 3f80f7edb8 sna: Manually set to the GTT domain for mmap
...since the kernel no longer does strict coherency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 17:13:47 +01:00
Chris Wilson f91ee24b2d sna: Trim number of downsample passes
If we can fit the entire width or the entire height into the pipeline
when downsampling, do so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 15:27:54 +01:00
Chris Wilson 6db93720a7 sna: Don't change tiling modes on replace
This was trying to workaround a kernel bug, and instead causes a
performance cliff for textures that *need* to be tiled.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 15:27:54 +01:00
Chris Wilson 430c905ef3 sna: Force tiled modes for large pitches
If the surface is so big that the 2x2 texel sampling will cause a TLB
miss everytime, i.e. the row pitch exceeeds 4096, then we need to
encourage tiling to prevent attrocious performance.

For example, try downscaling a 2560x1600 background image on a gen3
device using I915_TILING_NONE...

Using slideshow-demo /usr/share/backgrounds/cosmos/whirlpool.jpg, on a
PineView netbook, fps goes from under 4 to over 40.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 15:27:40 +01:00
Chris Wilson ae567b783e sna: Finer-grained debugging for trapezoids
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-04 14:45:00 +01:00
Chris Wilson 98f2e3855d sna/video: Downgrade severity of "overlay not found" message
We don't need to warn the user that their hardware does not support the
video overlay plane (but Jesse is working on it!), but merely inform
them that its presence is lacking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-02 09:53:11 +01:00
Chris Wilson 01c258718e sna/gen2: Add missing stub debug files
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-02 07:51:15 +01:00
Chris Wilson 5c8a108d2c sna/gen2: Recompute blend pipeline for component-alpha pass
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-01 21:41:23 +01:00
Chris Wilson 121511d3bd sna/gen2: Pack solid sources into the default diffuse component
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-01 21:41:23 +01:00
Chris Wilson a303f85c16 sna/gen2: Remove unused state from invariant setup
... and also some state that gets clobbered when we install the
composite pipelines.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-01 21:41:23 +01:00
Chris Wilson 120c98ac10 sna: Downsample sources 2x too large to fit in the 3D pipeline
This is quite trivial to hit given the 2k limits on gen2/gen3. We
compromise on image quality by pre-downscaling the source by a fixed
factor to make it fit into the pipeline in preference to performing the
entire operation on the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-01 21:41:23 +01:00
Chris Wilson f6c8c3bb6f sna/gen2: Use specular component for solid spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-01 21:41:23 +01:00
Chris Wilson de14e3c859 sna/gen2: Add missing render fallbacks for blt ops
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-01 21:41:23 +01:00
Chris Wilson ecbf6bbd27 sna/gen2: Implement composite-spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-01 21:41:23 +01:00
Chris Wilson c89b37d7b4 sna: Mappable aperture is region 0 on gen2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-30 17:53:49 +01:00
Chris Wilson c0434ab490 sna: Distinguish 830/845 vs 855/865 using the generation id
Remove the PCI ID device checks by using the simpler check on the
generation id for errata pertaining to 830/845.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-30 16:31:28 +01:00
Chris Wilson 18d08e49d2 uxa/glyphs: Fallback instead of crashing on large strings
Not ideal, but being slow is a major improvement over losing data.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36860
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-28 20:26:48 +01:00
Chris Wilson 95866bd6bd sna/video: Use EXTEND_PAD to avoid mixing in the border color
...which is 0 and appears green around an unaligned YUV-video.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38723
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-27 21:08:52 +01:00
Chris Wilson 7446b39f04 sna: Disable XVideo using the TexturedAdapter if the GPU is wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-27 15:26:49 +01:00
Chris Wilson 44cd6ebf43 sna: Typo in debug assertion.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-26 18:41:20 +01:00
Chris Wilson 5cd7f5b598 sna/dri: Mark the GPU bo as damaged upon a page-flip
...so that CPU pixmap is correctly invalidated for the next readback.
For instance, if you were to take a screenshot on a composited destkop.

Reported-by: Sitosfe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-26 18:41:01 +01:00
Chris Wilson c4f7959266 sna: Only create bo up to half the size of the mappable aperture
As we use GTT mappings if writing directly into the tiled buffer and the
available aperture is reported by the kernel as the total GTT and not
limited to the fenceable/mappable region, we need to manually probe this
value and ensure that our creation and fenced routines observe this
distinct limit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-26 16:56:55 +01:00
Chris Wilson 1303501117 sna/dri: Reorganise schedule_swap to not confuse immediate and wait paths
Eeek, the wait-for-target-msc was using the immediate swap path, meaning
that for copy-swaps the copy was submitting immediately but the client
throttled waiting upon the target vblank. What is actually intended is
for the presentation to be delayed until the target_msc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-26 12:09:31 +01:00
Chris Wilson b460b96454 sna/dri: Fix composited copy-swaps
The secret is not to cheat and render directly to the front buffer, but
remember to mark the Window as damaged.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-25 16:34:15 +01:00
Chris Wilson 28fffbd1d0 sna/display: Protect against drmModeGetCrtc returning NULL
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-25 16:33:31 +01:00
Chris Wilson 2c73b4651a sna/gen4+: Use the drawable rectangle offset for copy boxes
Saves a little bit of work whilst emitting the rectangles.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-25 16:32:30 +01:00
Chris Wilson 3833ff9677 sna: Correct typo in computing damage of PolyPoint
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38614
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-25 14:04:37 +01:00
Chris Wilson 471115a980 sna: Also allow BLT copies to discard the alpha channel
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 13:35:22 +01:00
Chris Wilson c3b1a0d704 sna/dri: Copy to real front upon swap
The front-buffer of a DRI2 drawable, may not in fact be pointing to the
scanout pixmap. So override the destination for swapbuffers to update
the scanout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 12:48:48 +01:00
Chris Wilson 669378cd8d sna: Wrap the fbcon in a scratch pixmap for render-copy across depth changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 11:53:17 +01:00
Chris Wilson 33b2ea0392 sna: Avoid using the BLT to copy between mismatching depths
We either conflated bpp (which fails given a mixture of depth-24 and
depth-30 pixmaps) or neglected to check at all.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 11:46:36 +01:00
Chris Wilson 28f6dc24d3 sna: Support depth-30 and some more logging to show the depth
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 11:24:59 +01:00
Xiang, Haihao 312460ea69 Xv: set up pipeline for Xv on Ivybridge
The configuration is same as that on Sandybridge, but
many state commands are changed

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:19 +08:00
Xiang, Haihao 90a0800588 Xv: upload new shaders to GEM objects for Xv on Ivybridge
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:16 +08:00
Xiang, Haihao 00614f712b Xv: update SURFACE_STATE & SAMPLER_STATE for Xv on Ivybridge
SURFACE_STATE & SAMPLER_STATE are changed since Ivybridge

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:13 +08:00
Xiang, Haihao 70f884772a Xv: New shaders for Xv on Ivybridge
Redefine some M4 macros, also update the check for
intel-gen4asm to support Ivybridge

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:10 +08:00
Xiang, Haihao 3cf423bd3a Xv: separate fragments from M4 macros
It is to prepare for Xv on Ivybridge. The difference from Sandybridge
is that all message payload must be in GRF registers instead of MRF registers
on Ivybridge. We will only redefine some M4 macros for Ivybridge

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:07 +08:00
Chris Wilson 58d7a89b93 sna: Don't render to invalid surfaces
Fixes a regression from d0362a. In bypassing the is_wedged checked, we
also ended up bypassing the checks that we could indeed render to the
target bo. With the result that we were creating GPU buffers for SHM
surfaces, something that requires Xserver fixes before we can actually
enable...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 00:35:30 +01:00
Chris Wilson 3c1d5bc35e sna: Clip the fbcon to the frontbuffer
...both to correct the placement of the fbcon into the smaller scanout and
to ensure that we correctly clip the boxes to be copied.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 00:34:11 +01:00
Chris Wilson e3b4c10f23 sna: Relent and workaround the lack of O_NONBLOCK on /dev/dri/card0
So in order not to block server shutdown, check that the fd is readable
before attempting to read from it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-23 20:56:03 +01:00
Chris Wilson 33d3077266 sna: Debug compile fix, and some extra comments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-23 15:55:47 +01:00
Chris Wilson 03e6aee8fd sna: For an unbounded op, we need to convert the whole surface
Otherwise if we fail to check, then we create a 0x0 surface to sample
with the operation -- net result is that we end up using a clear source
instead of the desired mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-23 15:55:47 +01:00
Adam Jackson 356ded1308 Don't include xf86Priv.h
I'd like it to not be in the SDK anymore, and we're not using anything
from it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-22 22:39:37 +01:00
Jian Zhao 8fb98e22a6 configure: Define required_xorg_xserver_version later so it can make successfully. 2011-06-22 11:07:08 +01:00
Chris Wilson ea71133da7 sna/video: Use pwrite for upload of unclipped, unrotated frames
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-22 11:04:56 +01:00