Commit Graph

6698 Commits

Author SHA1 Message Date
Mark Kettenis 364e02c799 uxa: Add OpenBSD backlight control implementation
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2013-03-22 11:27:43 +00:00
Chris Wilson 8d75b2ece1 sna: Fix computation of clip extents for stippling
The clip extents for the stippled BLT missed applying the drawable
offset to the lower-right corner, so inevitably every operation ended up
being clipped.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62618
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-22 09:51:46 +00:00
Chris Wilson 9f8e868003 sna/dri: Disable assertion and associated bookkeeping
Due to long standing ignored bugs in DRI2, we have to accept breakage
in the driver.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62614
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-21 22:54:02 +00:00
Chris Wilson 4adebfed41 2.21.5 release 2013-03-21 08:54:15 +00:00
Chris Wilson 1aca872ee5 sna: Haswell reintroduces MI_LOAD_SCAN_LINES
Better late than never? Interestingly only available from the BLT ring,
which makes accurate waiting for XVideo (which must use the render ring)
impossible in the current form - we need to render to a temporary then
do a vsynced blit in this case.

References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156679
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-19 08:26:01 +00:00
Chris Wilson f132452da1 sna: Ignore vsync waits on tiny scanline ranges
If the update is only a couple of lines tall, any tear will not be
visible - so just ignore programming the wait into the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-19 07:57:30 +00:00
Chris Wilson 308f0208de sna: Reset operation state between glyphs
We are not resetting sufficient state between operations as we presume
that all callers of Composite() currently pass in a blank state. In the
long run, we want to remove that burden and do a minimal initialisation.

References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1156387
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-18 15:11:24 +00:00
Chris Wilson 4a37d57f96 sna: Add a pair of sanity checks before creating the redirection target
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-18 15:11:24 +00:00
Chris Wilson 28371a34fa sna: Skip processing an all-clipped-out glyph
Along the slow path, skip all processing of glyphs that are not visible.
This is important as the slow path handles the per-glyph redirection
case, which is much more expensive.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-18 15:11:24 +00:00
Chris Wilson 16dac417c8 sna/dri: Fix stale Pixmap detection
NB the back buffer is not associated with the Drawable and so has no
pixmap field set. Hence comparing the front->pixmap against the
back->pixmap was always rejecting the blit. All we can check is that
front->pixmap corresponds with the current Drawable and so reject stale
configuration.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-17 21:56:56 +00:00
Chris Wilson 85213d5d45 sna: Don't remove the flush flag for userptr bo
This flag is far too overload with meaning, but for now this prevents us
attempting to call free() on a SHM segment.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-17 21:42:48 +00:00
Chris Wilson c5b901a635 sna/dri: Clear flush flag upon bo destroy
Fixes sanity checks that we do not leak the flushing status, nor
invoke an operation upon an unflushed bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-16 10:54:51 +00:00
Chris Wilson 45d20e9a65 sna: Add an LLC path for creating snoopable buffers
As with LLC we do not actually need to track snoopable as a separate
cache state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-14 22:12:56 +00:00
Chris Wilson 94cb10c3f2 sna/gen5+: Add missing float casts in computation of scaled src offsets
Without the casts, the division ends up as 0 rather than the fractional
offset into the texture.

The casts were missed in the claimed fix:

commit 89038ddb96
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Feb 28 14:35:54 2013 +0000

    sna/video: Correct scaling of source offsets

Reported-by: Roman Elshin <roman.elshin@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62343
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-14 22:03:58 +00:00
Chris Wilson dad50881d5 sna: Consider placement hints when choosing userptr read path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-14 15:17:35 +00:00
Chris Wilson 11e2802528 sna: Add handle info to sync DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-14 14:42:25 +00:00
Chris Wilson 20832494be sna: Use userptr downloads for incomplete GPU damaged pixmaps
If the pixmap is not wholly damaged, but still contains the region to be
read, then use userptr (if available).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-14 14:20:15 +00:00
Chris Wilson 92023f39a9 sna: Add a few more assertions to track userptr through the caches
i.e. make sure they don't end up in any caches.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-14 10:12:46 +00:00
Chris Wilson 80401f4fe5 sna/trapezoids: Minimally replace points for TriFan
The realisation dawns that it wasn't the ordering of points within the
triangle, but simply that I was replacing the wrong one.
2013-03-13 11:02:30 +00:00
Chris Wilson 716723d655 sna/trapezoids: Correct ordering of points within TriFran
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-13 10:51:03 +00:00
Chris Wilson 49374f2155 sna/gen4: Tweak compilation flags to avoid mixed settings across functions
Confusing gcc with different flags for supposedly inlined functions is
not a good idea.

References: https://bugs.freedesktop.org/show_bug.cgi?id=62198
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12 20:23:02 +00:00
Aaron Plattner ee0ed88a09 uxa: don't crash when freeing an uninitialized screen
When intel_scrn_create creates a screen, it sets scrn->driverPrivate to
(void *)(match_data | 1).  Normally, this is read by I830PreInit and then
replaced with a pointer to the intel_screen_private structure.  However, it's
possible for the server to delete the screen before initializing it, which leads
to a crash in I830FreeScreen when it tries to interpret the unaligned match_data
pointer as a pointer to a intel_screen_private.

Fix this by checking the low bit of the pointer and skipping the teardown code
if it's set.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
2013-03-12 20:20:51 +00:00
Chris Wilson b1952e7902 sna/gen3: Tweak code generation for gen3_emit_composite_primitive_constant__sse2
References: https://bugs.freedesktop.org/show_bug.cgi?id=62198
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12 19:58:28 +00:00
Chris Wilson f320e6908f sna/gen3: Tweak code generation for gen3_emit_composite_primitive_identity_gradient__sse2
References: https://bugs.freedesktop.org/show_bug.cgi?id=62198
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12 19:53:20 +00:00
Chris Wilson b1d0ca266c sna/gen3: Reduce another use of transforms
Prefer the slightly cheaper _sna_get_transformed_scaled().

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12 19:03:44 +00:00
Chris Wilson 50374fb494 uxa/glamor: Prevent a crash when trying to load a misconfigured glamor
Glamor requires that glamoregl is explicitly loaded via Section "Module"
or else it currently crashes.

Based on a patch by Michel Dänzer for xf86-video-ati.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12 18:43:32 +00:00
Chris Wilson c79a189b6f sna: Missing git-add for 09862a85eb
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12 15:57:17 +00:00
Chris Wilson a31831bce8 sna: Improve asserts that the CPU bo is not busy after synchronisation
Taking into account that we may not do a full synchronisation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12 15:27:16 +00:00
Chris Wilson 09862a85eb sna: Mark redirect proxies with a unique id
This helps gen3 in particular as it uses the unique_id field of a bo to
detect changes in render target.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12 15:12:59 +00:00
Chris Wilson 4f8fba31d7 sna: Apply the source offset to the transform when fixing up gradients
Otherwise pixman will apply the source transform to the offsets.

Reported-by: Ognian Tenchev <drJeckyll@Jeckyll.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62198
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-12 10:12:12 +00:00
Chris Wilson 0b143fcb2b sna: Improve sna_copy_boxes DBG by printing the bo handles
The handles of the bo are easier to track through the DBG as they are
more often printed than then their addresses.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-11 18:16:34 +00:00
Chris Wilson 44d3ffdf53 sna: Only allocate addition space if we need pixel data
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-11 18:16:34 +00:00
Chris Wilson b500e30d5d sna: Mark the userptr as a CPU mapping
This helps clarify some recent asserts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-11 18:16:34 +00:00
Chris Wilson 17a99f0743 sna/dri: Free the event on the impossible error path
Just in case we end up with bogus data, don't leak.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-11 16:41:16 +00:00
Chris Wilson 9d097d5140 sna/dri: Free chained swaps upon CloseWindow
The assumption that the chained swaps are freed after the next vblank
turns out to be wrong, and in effect we would leak the bo if we
happened to submit the final swap faster than vrefresh and close the
window before the vblank.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-11 16:41:13 +00:00
Chris Wilson 2f6a992795 sna/dri: Reorder assert to avoid NULL dereference
Only try to dereference chain->draw after the check to see if it was
already destroyed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-11 16:41:13 +00:00
Chris Wilson cffdd1eed0 test: Try to exercise races between DRI2SwapBuffers and CloseWindow
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-11 16:41:13 +00:00
Chris Wilson 4fb7be0a0d 2.21.4 release 2013-03-11 13:20:50 +00:00
Chris Wilson 25a63b32c7 sna: Tighten checking for coherent maps
Remember all the special cases where we can use a CPU mmap as a
temporary substitute for a GTT mapping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-11 10:42:51 +00:00
Chris Wilson 210d474a96 sna: Tweak CPU mappings to be only used if a read is required
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-10 18:51:39 +00:00
Chris Wilson 35f50a98fd sna/dri: Flatten _sna_dri_destroy_buffer()
One level of indentation can be trivially removed with an earlier return.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-10 15:52:29 +00:00
Chris Wilson b81ee116d3 sna/dri: Add a couple more basic assertions
To catch bad reference counting and loss of flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-10 14:15:46 +00:00
Chris Wilson 93ecd5606e sna: Only shrink the maximum GPU size to fit into cache
That is be very careful that we do not enlarge it past the aperture size
on early gen.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-08 23:38:12 +00:00
Chris Wilson 78c756120d sna/gen4: Initialise a pair of unimportant variables
Should never actually affect any results.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-08 16:44:47 +00:00
Chris Wilson dcd52d0c18 sna: Fallback if we cannot fit the tiling copy into the aperture
If we cannot fit the source/destination and a tile into the aperture,
then we cannot perform the copy and must do it using the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-07 23:04:54 +00:00
Chris Wilson 50d0ea02b3 sna: Trim tile sizes to fit aperture constraints
This is especially important with gen2 where we have no unmappable GTT
to utilise.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-07 22:58:38 +00:00
Chris Wilson cd1c14b172 sna: Remove the unused output and crtc lists
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-07 10:16:19 +00:00
Chris Wilson 1b8fc87155 sna: Disambiguate sna_crtc_resize()
sna_crtc_resize() operates upon the whole configuration rather than a
single crtc like the other sna_crtc_* so rename it to make it distinct.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-07 10:12:14 +00:00
Chris Wilson 5f1c2b3b8b sna: Supply a fake pipe to run completely headless
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-07 10:03:46 +00:00
Chris Wilson 2aacfbaa51 sna: Return early if there are no outputs to setup
Instead of reporting failure, just try to run headless.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-07 09:10:32 +00:00