Commit Graph

5296 Commits

Author SHA1 Message Date
Chris Wilson 3a56a0b10e sna: Make the disable-unused after vt switch distinct from DPMS off
So that we do not lose control over dpms on/off!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 19:26:42 +01:00
Chris Wilson b415ca05c2 sna: Reset damage extents after reduction goes to zero
If the reduction of the damage clears all of the boxes, we need to reset
the -infinite extents so that we continue to accumulate further damage.

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50744
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 17:08:03 +01:00
Chris Wilson 0df7c48864 sna: Supporting overlapping copies for fallback blits
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50393
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 16:48:52 +01:00
Chris Wilson d5b273b20b sna: Explicitly disable the CRTC so that xserver/kernel agree after VT switch
References: https://bugs.freedesktop.org/show_bug.cgi?id=50772
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 16:34:23 +01:00
Chris Wilson 221534abe2 sna: Only reduce damage addition to a region operation if clean
Some paths bypass operating upon the region as they do not have an
YX-banded set of boxes and so prefer to defer the costly construction of
the region till later. As a result, we have to be careful not to
overwrite any existing information if we do operate on the region after
setting the dirty boxes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50744
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 22:52:50 +01:00
Zdenek Kabelac 0db789e180 sna: Constification
Adding preserving const modifiers to decrease amount of const warnings

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Zdenek Kabelac 33998a7080 sna: Fix typo and compare y1 to y2
It seems 'y1' was meant to be compared here

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Chris Wilson 0ade32fbad sna: Fix operator preference around a | b & c | d
Tell the compiler what we really mean is a | (b & (c | d))

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Chris Wilson 20f3114ccd sna: Use long for simplicity when printing size_t values for debugging
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Zdenek Kabelac 6f75b8da6a sna: Valgrind updates
Add some mising initialization for unknown ioctl

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Zdenek Kabelac 70cf637ca4 legacy/i810: Fix declaration to match definition
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:15 +01:00
Chris Wilson 5fea2478cd Lots of trivial semantic fixes
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:14:40 +01:00
Chris Wilson e499f207c1 sna: Fix memleak from sna_crtc_find_plane()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 13:11:37 +01:00
Chris Wilson 49da55da51 sna: Free the reversed glyph bits along with the font
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 12:33:37 +01:00
Chris Wilson 9f68c7fe6a sna: Free clip rectangles after intersection with PolyRectangle extents
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 12:33:37 +01:00
Chris Wilson ab3b7fe31b sna: Only reuse a write buffer if all external references have been dropped
This avoids the unhappy situation of overwriting an upload buffer that
we intend to use for a fallback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 10:35:14 +01:00
Chris Wilson e8cb656dc4 sna: Free clip intersection with line extents after use
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 08:10:10 +01:00
Chris Wilson 572745eb24 sna/damage: Remove unused return value
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 22:53:48 +01:00
Chris Wilson aefc0417dd sna/damage: Simplify initialisation of damage extents
Just use the already computed region->extents when adding the first box.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 22:53:48 +01:00
Chris Wilson 78a96e812b sna: Refresh the damage self-tests
They had bitrotted with the revamp and needed some massaging to update
to the new interfaces.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 22:17:24 +01:00
Cyril Brulebois 6138f7434a Fix up braindamage in previous commit.
ickle: Fixing up my idiotic change, obviously too much birthday cake.
2012-06-12 21:19:14 +01:00
Cyril Brulebois 224d631a23 Avoid calling xf86nameCompare() with a NULL string
Device sections without a Driver property would lead to a server
segfault because of a NULL pointer's being passed as the second
argument of xf86nameCompare().

Debian bug #677206 <http://bugs.debian.org/677206>

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2012-06-12 21:14:53 +01:00
Dave Airlie 3b9b64c7c9 uxa: do copy fb at startup.
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-12 15:09:05 +01:00
Chris Wilson b6525702b9 sna: Hook up AdjustFrame()
Looks to be unused by the core, just a solitary invocation in an obscure
extension it seems. However the implementation looks trivial so
incorporate it until it is finally removed, just in case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 12:04:26 +01:00
Chris Wilson 7b281d1300 sna: Remove a pair of empty stub functions
The export wrappers for the glyph cache constructor/destructor existed
in case there was a need to add more routines. Since that never
happened, remove the extra step of indirection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 10:37:04 +01:00
Chris Wilson 392e33a62d sna: Instrument memory/bo allocations for monitoring over time
Hide it behind --enable-debug=memory to avoid incurring the cost for
everybody.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-11 12:19:57 +01:00
Chris Wilson 4e984b79cc configure: Correct the help string for --with-default-accel
Prior to finalizing the defaults I changed my mind and realised that the
default had to reflect the current behaviour of someone enabling SNA for
the first time, and not the previous behaviour of --enable-sna to
override UXA. This is so that distro's could offer an SNA enabled DDX
for the brave whilst not affecting their typical no-xorg.conf users.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-11 09:02:03 +01:00
Chris Wilson 7614a54188 configure: Harden --with-default-accel against simple mistakes
If the user specifies no options, assume automatic selection. Then
double check we found a valid backend and so avoid later breaking the
build.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-10 09:38:32 +01:00
Chris Wilson ea0209fbc1 sna: Remove option to disable vmap
It works everywhere, so when it is finally enabled, let it be.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 22:46:10 +01:00
Chris Wilson 18baa1428b Make the enum list of options consistent with the actual table.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 22:45:58 +01:00
Chris Wilson adc872a965 sna: Add DBG spew to flink()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 06:44:20 +01:00
Chris Wilson a62ad4e807 sna: Skip flushing the active queue if there is not a suitable bo pending
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-07 23:37:59 +01:00
Chris Wilson 318982566b sna/dri: Disable experimental code by default
Since these require non-upstream patches to other components, we don't
want it enabled by default and randomly breaking builds.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-07 23:12:21 +01:00
Chris Wilson ebf84b8e57 sna/trapezoids: Micro-optimise cell allocation
The pool is a fixed size so we can delete the generic code to handle
variable sizes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-07 23:12:21 +01:00
Chris Wilson 0a25fc68c5 sna: Actually create Y-tiled source pixmaps
An inconsistency highlighted by 7c51cabaec revealed that we had a
mismatch between the check in move_to_gpu() and how we created the
pixmap. This mismatch resulted in us creating and uploading tiled
pixmaps for single shot textures, and the increase aperture pressure was
causing a regression in firefox-fishbowl on pnv, for example.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-07 19:13:09 +01:00
Chris Wilson c58d137d3e sna: Suppress DBG prints along potential SIGIO paths
As ErrorF/fprintf is not re-entrant due to its mutex we can not use DBG
from code that could be called by a signal handler. X's SIGIO handler
attempts to move the cursor from within the handler (eek!) and so we
need to be careful not to take any locks, such in as the aforementioned
fprintf, along the cursor paths.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50744
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-07 11:18:27 +01:00
Chris Wilson 3f5b94f3d1 sna: Check against integer overflows when computing cache size
Even with a 1nm process, I doubt we will see 4+GiB cache sizes ;-)

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 17:24:07 +01:00
Chris Wilson 902391bd79 uxa: Remove dead-code for SourcePictures
All SourcePictures are now converted into Drawables, which had been
assumed by the driver backend. However, the code still existed to
attempt to pass procedural pictures onwards and so set pSrcPix to NULL
which was being flagged by the static analyser as a potential NULL
dereference.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 17:20:39 +01:00
Chris Wilson 3d8a1f7176 sna/gen4+: Add missing "fall through" comments
Reported-by: <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 17:15:42 +01:00
Chris Wilson 8ae4407c43 sna: Silence static analyser complaining about potential NULL pointer
Add an assert to prove that is not.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 17:13:05 +01:00
Chris Wilson 08010b23a3 uxa/dri: Silence static analyser for potential NULL intel_pixmap
If the intel_pixmap was NULL we should have failed to create the DRI2
buffer, so we can safely assert here to keep the analyser quiet.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 17:10:35 +01:00
Chris Wilson 06b1b875ba uxa/i915: check for failure to allocate temporary destination
If the target drawable is too large for the render pipeline, we need to
create a temporary surface. This may fail, so abort if it does.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 17:05:13 +01:00
Chris Wilson c553dcae2d sna: Silence a few unused function warnings
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 17:04:01 +01:00
Chris Wilson 536033b4ed legacy/i810/dri: Check for malloc failure for BusIdString
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 16:02:47 +01:00
Chris Wilson b2da80c1d1 sna: Add some missing 'fall through' comments
Static analysers are dumb and presume readers are too.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 15:59:54 +01:00
Chris Wilson c433fb4521 uxa/dri: Fix up typo from f2513cb0f
s/true/FALSE/? Wrong.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 15:17:30 +01:00
Chris Wilson 1675f44104 uxa/dri: Transfer reference of the new_back buffer to the flip_chain
In order to prevent a leak of the bo when the chain is eventually
torn-down when the client exits.

Reported-by: Andreas Lampersperger <lampersperger.andreas@heidenhain.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50670
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 12:55:13 +01:00
Chris Wilson 18726a4975 sna: Perform CopyArea directly onto a CPU bo if available
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 10:59:58 +01:00
Chris Wilson 57d7d5de78 sna: Use GPU for readback onto CPU bo
Time to blt from GTT to LLC 16384 bytes:	 125.000µs (snb)
Time to blt from GTT to LLC 16384 bytes:	  71.000µs (ivb)
Time to blt from GTT to LLC 1048576 bytes:	1400.000µs (snb)
Time to blt from GTT to LLC 1048576 bytes:	 938.000µs (ivb)

Time to copy from GTT to LLC 16384 bytes:	 118.000µs (snb)
Time to copy from GTT to LLC 16384 bytes:	 134.000µs (ivb)
Time to copy from GTT to LLC 1048576 bytes:	6723.000µs (snb)
Time to copy from GTT to LLC 1048576 bytes:	7424.000µs (ivb)

And conversely,

Time to blt from LLC to GTT 16384 bytes:	 10.000µs (snb)
Time to blt from LLC to GTT 16384 bytes:	  8.000µs (ivb)
Time to blt from LLC to GTT 1048576 bytes:	217.000µs (snb)
Time to blt from LLC to GTT 1048576 bytes:	135.000µs (ivb)

Time to copy from LLC to GTT 16384 bytes:	  4.000µs (snb)
Time to copy from LLC to GTT 16384 bytes:	  4.000µs (ivb)
Time to copy from LLC to GTT 1048576 bytes:	270.000µs (snb)
Time to copy from LLC to GTT 1048576 bytes:	179.500µs (ivb)

It seems clear then that even with the extra synchronisation cost
copying from the GTT is much preferable with the GPU than using the
uncached reads by the CPU. Streaming write-combines from the CPU into
the GTT seem about as efficient as we can manage, so continue to use the
mapping unless busy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 10:59:58 +01:00
Chris Wilson f2513cb0fd uxa/dri: Do not use undeclared stdbool features
The header isn't pulled in, so stop using the undefined values of
true/false.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-06 10:41:35 +01:00