Commit Graph

5416 Commits

Author SHA1 Message Date
Chris Wilson aeeed323f9 sna/dri: Select the appropriate copy engine based on the current src ring
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 11:52:27 +01:00
Chris Wilson 5026b6a147 uxa: Install the drm_wakeup_handler for vblank events in !use_page_flipping
Even if page-flipping itself is disabled, we still want to allow the
client to schedule wakeups for some future vblank which requires
listening to the kernel vblank notifications.

Reported-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-04 09:55:10 +01:00
Chris Wilson 79309dd55f sna: check for failure to change cache level on the bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 22:27:39 +01:00
Chris Wilson 9e2ac8a413 sna: Use set-cache-level ioctl to create CPU bo
As an alternative to vmap, we can use the kernel for all memory
management through bo, which is much preferred for its simplicity (i.e.
avoiding introducing even more vm complexity).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 20:08:02 +01:00
Chris Wilson f26163e916 sna: Guess when the client is attempting to read back the whole pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 18:51:46 +01:00
Chris Wilson c597e6cd4c sna: Fix iterator typo
Increment the iterator, not the end-stop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 13:26:33 +01:00
Chris Wilson 2d087eadd9 sna: Also prefer to use the dst GPU bo if CopyArea reduces to an inplace upload
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 12:02:45 +01:00
Chris Wilson dbe3a5ca1e sna: Attempt to reduce all-damage on the CPU
As we now treat CPU all-damaged as a special case for deciding when and
where to migrate, look out for that condition after adding damage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 11:48:15 +01:00
Chris Wilson 3a41248195 sna: Operate on the original boxes for CopyArea
Be consistent and avoid the confusion when mixing operations on the
region boxes and the original boxes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 11:26:52 +01:00
Chris Wilson e3bc91842b sna: Allow booting on older kernels by disabling HW acceleration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-03 10:23:31 +01:00
Chris Wilson affdebcb2d sna: And free the DIR after use
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-02 18:50:26 +01:00
Chris Wilson e7b31b6d0a sna: Consolidate CopyArea with the aim of reducing migration ping-pong
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-02 17:51:46 +01:00
Chris Wilson ce27a81ac5 sna: Clear cpu flag after deciding to use gpu bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-02 17:51:46 +01:00
Chris Wilson 2f1b7e8a23 sna: Check for non-existent /sys/class/backlight directory
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-02 17:51:46 +01:00
Chris Wilson d12d50d107 sna: Skip hidden and special entries inside /sys/class/backlight
Just to avoid the warnings after fallback to comparing the d_name to
the list of known interfaces.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-02 14:10:41 +01:00
Chris Wilson e80f9c4670 sna: Prefer backlight iface based on /sys/class/backlight/*/type
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-02 10:25:39 +01:00
Tom Hughes 61e16dc567 Add asus-nb-wmi backlight control
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51593
2012-07-02 10:25:08 +01:00
Chris Wilson 543816011d sna/gen7: Correct two minor misues of equivalent GEN6 constants
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-01 18:36:55 +01:00
Chris Wilson 839fea7f77 sna/gen6: Boost VS entries to maximum
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-01 18:23:38 +01:00
Chris Wilson fbd114507d sna/dri: Assert that the replacement bo is large enough for the pixmap
Just another paranoid sanity check.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-01 14:03:31 +01:00
Chris Wilson 675cbd5fad sna/trapezoids: Skip the division when converting coverage to floating point
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-01 13:25:00 +01:00
Chris Wilson 182c3637cc sna: If the pixmap is marked for flushing, prefer to use the GPU
Again, to avoid the forced ping-pong as we upload the damage after
nearly every operation, simply prefer to use the GPU in such cases.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-01 13:25:00 +01:00
Chris Wilson 35b1ac1380 sna: After an operation on the CPU, prefer not to use the GPU
A nasty habit of applications is to fill an area, only to read it back
with GetImage, render locally and replace with PutImage. This causes a
readback of an active bo everytime, so let's try to mitigate that by
preferring not to use the GPU after a forced readback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-07-01 11:07:50 +01:00
Chris Wilson e625c02e62 sna/damage: Early check for contains-box? if subtract and box outside region
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-30 09:34:21 +01:00
Chris Wilson abd7be1cee sna/dri: Prefer GPU rendering if no more CPU damage on a DRI bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 16:12:19 +01:00
Chris Wilson 67b87e4f7c sna/dri: Optimise clip reduction with copy-to-front to an unclipped Window
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 15:15:21 +01:00
Chris Wilson eae5e1275c sna: Install the ModeSet handler as the base handler
This way we can safely ignore it across server regen.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 13:12:52 +01:00
Chris Wilson 15a0761cad sna: Only consider the request list when deciding whether the GPU is busy
Micro-optimisation to overhead extra checks and to make sure an
unflushed bo doesn't prevent us from submitting more work before
sleeping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 12:22:55 +01:00
Chris Wilson 4061f05dd6 sna/trapezoids: Write unaligned fallback boxes inplace
As this is a pure write operation (though we will write the edge pixels
twice) we can perform this operation inplace and incur a slightly slower
trap creation at the benefit of avoiding the later copy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 11:40:18 +01:00
Chris Wilson 44e41536b7 sna/trapezoids: Render the partial left-edge of fallback unaligned boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 11:39:47 +01:00
Chris Wilson e6f9bfe1e2 sna: Use currentTime rather than GetTimeInMillis()
The overhead of reading the hpet() on every block handler (more or less)
is exorbitant, so trust that we update currentTime frequently enough to
be a good approximation - the side effect is that we will wakeup
slightly to earlier from using an old value for the current time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 11:06:33 +01:00
Chris Wilson c6c4f30e19 sna: Add assertions to check that we do install the timers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 10:14:52 +01:00
Chris Wilson 87c8f5a47e sna: Make the post-flip delay explictit
As the kernel is inconsistent in enforcing this across generations,
handle the synchronisation of the pageflip explicity. Ultimately this
should be replaced with a tripple buffer mechanism.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-29 09:33:09 +01:00
Chris Wilson 31caa43a21 sna/gen5: Check harder for need_upload() fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-28 17:05:46 +01:00
Chris Wilson 7c3eb1fda9 sna: Correct inverted logic for checking xrgb drawables
Reported-by: Christoph Reiter <reiter.christoph@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51472
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-28 17:04:26 +01:00
Chris Wilson c3e2c1332d sna: Fix the application of the crtc offset for posting damage
The damage boxes are in framebuffer (source) space, so we need to apply
the offset for the boxes in crtc (destination) space.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-28 12:40:59 +01:00
Chris Wilson 47e6bfa4f4 sna: Force use of per-crtc scanout if the offset is too large
On gen4+, the scanout offset into a tiled surface is specified through
the DSPTILEOFF register and limited to 12bits of precision. So if we
have a CRTC positioned in that nether-region, we need to allocate a
separate per-crtc pixmap for it and perform shadowing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-28 12:37:35 +01:00
Chris Wilson 93e77ee019 sna: Quieten kernel debug complaints when disabling crtc
Even if we are obviously turning the crtc off, it still complains if the
number of connectors is non-zero. So make it so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-28 12:02:32 +01:00
Chris Wilson 85e4f48a87 sna: Add a DBG to the periodic flush mechanism
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-28 11:57:53 +01:00
Chris Wilson 87dd6408a5 sna: Correct the reversal of the periodic flushing semantics
Regression from 1e9319d (sna: extend RandR to support super sized
monitor configurations) which tried to take into account the need to
flush the shadow CRTC bo in addition to the normal scanout bo. In the
refactoring of the need_flush(), the double negative was missed.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-28 10:58:55 +01:00
Chris Wilson 05f486f64b sna: Flush the per-crtc render caches for rotated scanouts
We need to manually flush the render cache in order for results to be
visible on the scanout.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-28 10:42:21 +01:00
Chris Wilson db79799810 sna: s/width/height/ cut'n'paste typo
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-27 09:36:58 +01:00
Chris Wilson fcbbe1664a sna: Remove a trailing ';'
The unwanted ';' caused is_cpu() to always return false if a GPU bo was
attached. Not necessary a bad thing, just misses the potential
optimisation where having chosen to prefer to use the CPU path we then
have to migrate to the GPU even though the bo is undamaged or idle.

Spotted-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-27 09:30:44 +01:00
Chris Wilson a072ab5065 test: Add client side copy to FakeFront for emulating CopyBuffer correctly
The server manages FakeFront following a flip, but it the client
optimises a swap by replacing it with a CopyRegion, it is expected to
also update the FakeFront itself. Replicate that behaviour so that the
timings for the test case are consistent with mesa.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-26 17:24:37 +01:00
Chris Wilson 96804c74f8 test: FakeFront rules
Oh my, I just once again rediscovered the copy on every flip due to the
requirement for keeping FakeFront uptodate for reads after a SwapBuffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-26 17:19:06 +01:00
Chris Wilson f306cd557e sna/dri: Hold a reference to the cached DRI2 buffer on the front buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-26 16:03:43 +01:00
Chris Wilson a87f2b9325 sna/gen4: Check for peculiar initial values for the surface offset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-26 16:03:43 +01:00
Chris Wilson 8f4221a252 test: Add a simple exercise for DRI2 swap paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-26 16:03:16 +01:00
Chris Wilson a505015a25 sna: Force DPMS to be on following a modeset
Similarly to UXA, this papers over inconsistent behaviour in the kernel
in handling the DPMS upon a modeswitch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-25 22:50:47 +01:00
Chris Wilson b7a8c94cdb sna: remove the assert(0)s along error paths
This were there as a debugging aide to see if we ever hit unreachable
code paths - mainly along corruption inducing GPU wedged recovery paths.
They are superfluous and just scare the reader.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-25 20:52:51 +01:00