Commit Graph

5834 Commits

Author SHA1 Message Date
Dave Airlie d14ff42f2a intel: query kernel for caps to setup scrn capabilities.
This queries the kernel for prime support before advertising
the capabilities.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-03 12:28:29 +10:00
Dave Airlie 6705d8237a intel: add pixmap tracking and scanout support. (v2)
This adds support for pixmap tracking and scanout of
alternate pixmaps.

v2: do dirty updates after uxa block handler, check if kernel
can flush vmap for us so we don't have to.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-03 12:28:29 +10:00
Dave Airlie 69827126ab intel/uxa: add pixmap sharing support.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-03 12:25:07 +10:00
Dave Airlie 0768ac4d19 intel: add platform probing support.
This allows the driver to be loaded by the platform loading code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-03 12:25:07 +10:00
Chris Wilson 164ae7a4f9 man: Malformed "Backlight" section
Reported-by: Matthew Monaco <dgbaley27@0x01b.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54397
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-02 17:20:19 +01:00
Chris Wilson 67b4410416 sna: Cache the temporary upload buffer when copying boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-02 12:47:36 +01:00
Chris Wilson 4b558281e0 sna: Don't retire when searching for a snoopable buffer without hw support
If the hw/kernel doesn't support snoopable buffers, then it makes little
sense to search for one, and force a retire in the certainty of not
finding any.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-02 12:23:59 +01:00
Chris Wilson d933f3a796 2.20.6 release
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-02 10:30:13 +01:00
Chris Wilson 62e7e69d88 sna: Tweak placement rules if we already have a CPU bo
If we have a CPU bo, consider if it may be quicker to render to it then
create a GPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-02 09:53:55 +01:00
Chris Wilson f837807cc2 sna/dri: Remove busy-wait spin from vblank chaining of swapbuffers
The issue being that, due to the delay, the chained swap would miss its
intended vblank and so cause an unwanted reduction in frame throughput
and increase output latency even further. Since both client and server
have other rate-limiting processes in place, we can forgo the stall here
and still keep the clients in check.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54274
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-01 12:25:57 +01:00
Chris Wilson b56e8c5105 sna: Nullify gpu_bo after free in case final release is deferred in destroy
As we may defer the actual release of the pixmap until after completion
of the last shm operation, we need to make sure in that case we mark the
GPU bo as released to prevent a use-after-free.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-01 12:17:05 +01:00
Chris Wilson c4d9940141 sna/gen2+: Add the missing assertions in case the drawrect is invalid
Only the later gen had these useful assertions, add them to the rest
just in case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-01 10:44:50 +01:00
Chris Wilson 25c1b478a9 sna: Discard cached CPU upload early when clearing with a solid fill
Otherwise we end up considering the GPU bo as a real target, causing
confusion and failed asserts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-01 10:12:58 +01:00
Chris Wilson 530b1d1516 sna/dri: Use common routine for testing busyness after flush
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-30 22:21:57 +01:00
Chris Wilson 00d8c776b3 sna/dri: Hold a reference to the vsync blit
Fixes regression from

commit 96a921487e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Aug 27 21:50:32 2012 +0100

    sna: Track outstanding requests per-ring

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-30 21:47:17 +01:00
Chris Wilson b2a6c74c21 sna: Remove inconsistent assertion
As we now may not prefer to use the GPU even if all-damaged and clear,
asserting that if we choose to use the CPU if clear is now bogus.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-29 14:51:40 +01:00
Chris Wilson deaa1cac26 sna: Align active upload buffers to the next page for reuse
If we write to the same page as it already active on the GPU then
despite the invalidation performed at the beginning of each batch, we do
not seem to correctly sample the new data.

References: https://bugs.freedesktop.org/show_bug.cgi?id=51422
References: https://bugs.freedesktop.org/show_bug.cgi?id=52299
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-28 22:25:02 +01:00
Chris Wilson 9e0305a392 sna: Discard inplace flag if we create a CPU map for the upload buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-28 22:03:53 +01:00
Chris Wilson f3e122554e sna: Propagate the request to flush rather than directly submit the batch
The subtly is that we need to reset the mode correctly after
submitting the batch which was not handled by kgem_flush(). If we fail
to set the appropriate mode then the next operation will be on a random
ring, which can prove fatal with SandyBridge+.

Reported-by: Reinis Danne <reinis.danne@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-28 21:27:04 +01:00
Chris Wilson b5c8efe430 sna: Make sure we reset the domain tracking when exporting DRI bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-28 08:33:00 +01:00
Chris Wilson 96a921487e sna: Track outstanding requests per-ring
In order to properly track when the GPU is idle, we need to account for
the completion order that may differ on architectures like SandyBridge
with multiple mostly independent rings.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54127
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 22:12:01 +01:00
Chris Wilson 26c731efc2 sna: Ensure that we create a GTT mapping for the inplace upload buffer
As the code will optimistically convert a request for a GTT mapping into
a CPU mapping if the object is still in the CPU domain, we need to
overrule that in this case where we explicitly want to write directly
into the GTT and furthermore keep the buffer around in an upload cache.

References: https://bugs.freedesktop.org/show_bug.cgi?id=51422
References: https://bugs.freedesktop.org/show_bug.cgi?id=52299
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 20:51:35 +01:00
Chris Wilson 2cbf88980e sna: Force the stall if using a busy ShmPixmap bo with PutImage
As we will stall in the near future to serialise access with the
ShmPixmap, we may as well stall first and do a simple copy using the
CPU in this highly unlikely scenario.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 20:51:35 +01:00
Chris Wilson 705103d77e sna: Add a modicum of DBG to kgem_is_idle()
Print out the handle of the bo we just checked.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 20:51:35 +01:00
Chris Wilson 8218e5da2b sna: Fix crash with broken DBG missing one of its arguments
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54127
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 19:36:03 +01:00
Chris Wilson 593f549b45 sna: A little more DBG to try and identify ratelimiting ops
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 16:43:19 +01:00
Chris Wilson 71ac12e9b6 sna: Assert that the bo is marked as 'flush' when exported to DRI clients
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 15:55:24 +01:00
Chris Wilson cf64c8ce75 sna: Upload PutImage inplace to a fresh GPU bo if the device doesn't snoop
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 15:55:24 +01:00
Chris Wilson 3c6758fc4a sna: Flush the batch if it references a ShmPixmap and the GPU is idle
This helps minimise the stall when syncing with the GPU before sending
the next reply to the Client.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-27 11:58:05 +01:00
Chris Wilson f21079bad6 Revert "sna: Cleanup composite redirection after substituting the BLT"
This reverts commit 5a5212117e.

The clean up is in effect too early, as this is during preparation and
the actual work is already being correctly done at the end.
2012-08-27 11:26:58 +01:00
Chris Wilson 414e87255c Add Option "Backlight" to override the probed backlight control interface
The automatic selection may not correspond with the correct backlight
(such as in a multi-gpu, multi-panel device) or the user may simply
prefer another control interface. This allows them to override the
chosen interface using

  Option "Backlight" "my-backlight"

to specify '/sys/class/backlight/my-backlight' as the interface to use
instead.

Suggested-by: Alon Levy <alevy@redhat.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=29273
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 19:47:31 +01:00
Chris Wilson d4f7c58186 sna/gen5+: Use the common methods for choosing the render targets
This should afford us much more flexibility in where we render.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 17:06:08 +01:00
Chris Wilson 3c88b5f693 sna: Use a fast span emitter for mono trapezoids without damage or clipping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 16:54:37 +01:00
Chris Wilson 8e10a5b348 sna/gen6+: Do not call sna_blt_composite() after prepping the composite op
As sna_blt_composite() will overwrite parts of the composite op as it
checks whether or not it can execute that operation, it will lead to a
crash as the normal render path finds the op corrupt. (The BLT
conversion functions cater for the cases where we may wish to switch
pipelines after choosing src/dst bo.)

Reported-by: rei4dan@gmail.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 14:56:22 +01:00
Chris Wilson cbbe7727e7 sna/gen6+: Simplify prefer_blt_bo
As we already check the tiling state, so all we need to then check is
that the pitch is within the BLT constraint.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 14:43:47 +01:00
Chris Wilson 0c15824a81 sna: Add some DBG to kgem_is_idle()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 14:29:41 +01:00
Chris Wilson d432983421 sna: Add some DBG to BLT composite substitute to show if redirection is used
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 13:43:35 +01:00
Chris Wilson 5a5212117e sna: Cleanup composite redirection after substituting the BLT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 13:38:23 +01:00
Chris Wilson 335821d588 sna/gen4+: Check for allocation failure for the clear solid bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 13:29:04 +01:00
Chris Wilson b5c77a6aaf 2.20.5 release
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-26 12:48:18 +01:00
Chris Wilson 454cc8453a sna: Submit the partial batch before throttling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-24 09:46:27 +01:00
Chris Wilson 0e1e83ed49 sna: Allow the batch to be flushed if the GPU is idle upon a context switch
Submit early, submit often in order to keep the GPU busy. As always we
trade off CPU overhead versus concurrency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-24 09:46:26 +01:00
Chris Wilson 5059db0697 sna: Correct a pair of DBG messages
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-24 00:21:07 +01:00
Chris Wilson c5b46e411a sna: Tidy up users of __kgem_bo_is_busy()
A lot of callsites had not been converted to the common function.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-23 17:47:20 +01:00
Chris Wilson 82e91327d5 sna: Use a temporary userptr mapping for a large upload into a busy target
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-23 17:47:20 +01:00
Eric S. Raymond b286ffa6be Fix seriously malformed list syntax on intel(4).
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
2012-08-23 12:42:18 -04:00
Chris Wilson fc6b7f564d sna: Flush the batch if it contains any DRI pixmaps
This fixes a regression from

commit 02963f489b
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sun Aug 19 15:45:35 2012 +0100

    sna: Only submit the batch if flushing a DRI client bo

which made the presumption that we called sna_add_flush_pixmap() for
every DRI pixmap that we used. However, that is only called for the
dirty pixmaps, any native exported pixmap only marks the batch as
requiring a flush. So in those cases we always need to submit the batch
if it contains an exported DRI pixmap.

Reported-by: chr.ohm@gmx.net
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53967
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-23 15:13:14 +01:00
Chris Wilson fd38f45ec5 sna: Mark the CPU damage as needing flushing for DRI buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-23 12:11:48 +01:00
Chris Wilson ac6cb66754 sna: Flush before adding any SHM pixmap into the batch
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-22 12:59:02 +01:00
Chris Wilson 785c1046b9 sna: Only use the GPU for an active CPU bo unless forced
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-22 12:59:02 +01:00