Commit Graph

5268 Commits

Author SHA1 Message Date
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
Chris Wilson 4712a4008a shadow 2012-06-04 12:40:56 +01:00
Chris Wilson 63a55e9db9 uxa/shadow: Free the buffer along the unexpected failure to attach to the pixmap
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:36:11 +01:00
Chris Wilson c9bd4ed7d7 legacy/i810: Silence a compiler warning for missing 'const'
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:31:10 +01:00
Chris Wilson 6f8b411b8a uxa: Preferred order for calloc is (count, size)
And assert that the allocation succeeds for good measure. A great big
dollop of graceful failure is missing...

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:31:09 +01:00
Chris Wilson 72a29aa74a sna: Check that the buffer was allocated prior to caching it
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:31:09 +01:00
Chris Wilson 9bff89b189 legacy/i810: Be paranoid and guard against xf86GetPciInfoForEntity
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:31:09 +01:00
Chris Wilson ed6004f7ad uxa: Be paranoid and guard against xf86GetPciInfoForEntity
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:23:02 +01:00
Chris Wilson abb8d89374 sna: Be paranoid and guard against xf86GetPciInfoForEntity
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:21:27 +01:00
Chris Wilson 782cd6eafa uxa: check for failure to allocate drmModeCrtc
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:20:17 +01:00
Chris Wilson a99bf0125f uxa/i965: Drop superfluous 'state' variable
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:17:49 +01:00
Chris Wilson 15a00ba047 sna/gen2: Remove double 'const'
So constant, we const'ed it twice.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:09:52 +01:00
Chris Wilson 99129c369c sna/gen4+: Use an explicit invalid value for alu
Since the static analyser also doesn't like comparing a uint8_t against
~0.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:08:11 +01:00