Commit Graph

4819 Commits

Author SHA1 Message Date
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
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
Chris Wilson fae9c054d4 legacy/i810: Remove unused variable
In order to reduce the volumes of output from static analysers.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:05:46 +01:00
Chris Wilson 880ec2c9a5 legacy/i810: Reorder DRI teardown code to avoid potential NULL derefs
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 12:04:30 +01:00
Chris Wilson 7424ea7dd0 uxa/dri: Free wait_info along DRI2WaitMSC error paths
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 11:59:24 +01:00
Chris Wilson ebd6dea009 uxa/dri: Make sure is_glamor_pixmap is always initialised
The code paths are too twisty to be sure otherwise.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 11:56:11 +01:00
Chris Wilson 33f0b4b966 legacy/i810: Free offscreen image info struct on failure
Impossible with the current code, the server aborts on failure. However,
this looks to be the simple answer to keep static analysers quiet.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 11:54:28 +01:00
Chris Wilson d243407473 sna: Free clip boxes (if allocated) along error path
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 11:53:26 +01:00
Chris Wilson 1215abc5c3 sna: Make the ignored return value explicit
The return from __kgem_throttle_retire() is just a hint as to whether
any forward progress was made. In the case of the error path, though it
is a last ditch effort before aborting, so we do not really care whether
or not it succeeds, we must try again.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 11:49:51 +01:00
Chris Wilson e230b46051 ux/i965: create_sampler_state_bo() expects enums, so feed it the right types
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 11:48:23 +01:00
Chris Wilson 072d7a8b42 sna/debug: Assert the non-existence of the relocation handle at source
This should help the static analyzer pinpoint the blame and make it
quieter.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 11:40:01 +01:00
Chris Wilson 4a3c355e05 sna: Silence a compiler warning for loss of 'const' qualifier
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-04 11:32:42 +01:00
Chris Wilson 791029cc16 sna/trapezoids: Implement trapezoidal opaque fills inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 23:50:59 +01:00
Chris Wilson 1f78a934a4 sna: Clear the counters prior to querying the property
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 13:28:34 +01:00
Chris Wilson a1953f1d4a sna: Prefer to use memset() for extremely large clears
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 12:02:55 +01:00
Chris Wilson ce85cd1a36 sna: Add some DBG to retreiving EDID
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 11:46:06 +01:00