Commit Graph

5280 Commits

Author SHA1 Message Date
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
Chris Wilson 1dafb4777f sna/damage: Add some assertions to validate that each damage box is non-empty
References: https://bugs.freedesktop.org/show_bug.cgi?id=50744
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-05 21:25:40 +01:00
Chris Wilson c4eb5528a4 uxa: Check for DPMS off before scheduling a WAIT_ON_EVENT
Regression from commit 3f3bde4f0c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu May 24 11:58:46 2012 +0100

    uxa: Only consider an output valid if the kernel reports it attached

When backporting from SNA, a key difference that UXA does not track DPMS
state in its enabled flag and that a DPMS off CRTC is still bound to the
fb. So we do need to rescan the outputs and check that we have a
connector enabled *and* the pipe is running prior to emitting a scanline
wait.

References: https://bugs.freedesktop.org/show_bug.cgi?id=50668
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-05 16:09:05 +01:00
Chris Wilson 7c51cabaec sna: Try to create Y-tiled pixmaps for initial source bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-05 13:16:24 +01:00
Chris Wilson a26c05cc89 sna/gen2+: Tweak placement of operations for CPU-bound large pixmaps
Try to avoid uncessary migration to the GPU of large pixmaps that are
wholly bound to the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-05 13:16:24 +01:00
Dave Airlie a21bdbe3e3 sna: port to compat api
This ports SNA to the new compat-api.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 11:31:45 +01:00
Dave Airlie 8f5001493e intel: port legacy and uxa to new API.
This ports the legacy and uxa driver to the new server API.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 11:31:45 +01:00
Dave Airlie c982482742 sna: drop using block/wakeup data.
These went away in the new server API, and really if this
made any measurable difference, I'd be impressed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 11:31:45 +01:00
Dave Airlie d9850a0500 uxa: drop enable disable access hook
This looks to be unused.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 11:31:45 +01:00
Chris Wilson 99df720216 sna: Add inline keyword in conjunction with attribute(always_inline)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-05 10:37:25 +01:00
Chris Wilson 47d7da5a98 sna: Maintain the operation on the CPU if not completely replacing all-damaged
We may as well continue the operation on the CPU if already bound to try to
reduce needless migrations (where the cost of the upload will outweigh
further use).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-05 10:36:36 +01:00
Chris Wilson 81f09347f2 uxa/i965: Silence static analyser by asserting the bo exists for the video
This is already checked at the beginning of PutImageTextured, so this
check upon the return value of intel_get_pixmap_bo() should only be
required to keep static analysers happy.

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 16:45:05 +01:00
Chris Wilson 1f43de322b sna: Exclude consideration of tiling flags from overwriting BLT commands
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 15:48:55 +01:00
Chris Wilson ebb1c9d5f8 sna: Make the bo-is-busy DBG more useful by saying which bo it is
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 15:28:31 +01:00
Chris Wilson 6dc5ddfe80 sna: Remove bogus check for color == 0
This was written when the RGBA color value was being passed around and
not the pointer to the xRenderColor. As such, the NULL deref check
doesn't gain much and the check for rgba==0 irrelevant in this scenario.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 13:53:30 +01:00
Chris Wilson 9b3937228c sna: Simplify selecting default tiling for framebuffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 13:47:58 +01:00
Chris Wilson ff91fd4a27 uxa: Check for failure from drmModeGetConnector()
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:41:05 +01:00