Commit Graph

4936 Commits

Author SHA1 Message Date
Chris Wilson 52f39ae169 sna: Assert that the bo created is large enough
Double check that the maximum access size computed from the bo
parameters is within the allocated size for the bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 13:31:03 +00:00
Chris Wilson 2f23c660f5 sna: Assert that the tiled blt is correctly clipped
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 13:31:00 +00:00
Chris Wilson e0cd13e2af sna: Fallback to inplace upload if forced to tile the indirect replacement
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47629
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 09:06:10 +00:00
Chris Wilson 1db1eced54 sna: Tidy an assertion when handling tiled copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 09:05:58 +00:00
Chris Wilson 38b0cc24b4 sna: Remove the short-circuiting of move-to-cpu for read if no damage
The danger now is that we may have either discarded the shadow pixels or
have replaced them with a GTT mapping, either way undesirable and so we
should reconstruct the shadow mapping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-21 01:03:05 +00:00
Chris Wilson f49a6b1fd7 sna: Decouple the private data after UnrealizeFont
As the font is kept around and reused after UnrealizeFont, we need to
nullify the pointer to our private data in order to prevent the later
use-after-free.

Reported-by: Peter Jordan
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-20 21:36:26 +00:00
Chris Wilson 1bdd6461de sna/traps: Remove bogus assertion
As we only enter that path for singular unbounded boxes, we are
guaranteed to fill the entire trapezoid extents and so do not need the
unbounded fixup the assertion was fretting about.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-20 11:08:44 +00:00
Chris Wilson 1c2932e9cb uxa: Defer the call to EnterVT till after outputs are initialised
We need to do this apparently or else we never perform the VT switch.
However, we can not do it too early, especially not before we have
finished intialising the outputs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47395
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 16:12:37 +00:00
Chris Wilson 972e1108a5 sna: Declare videoRam correctly on gen2 devices
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 14:38:28 +00:00
Chris Wilson c0bab1df50 sna/dri: Make the drawable as damaged for the off-screen immediate exchange
In some cases off-screen is stil visible, for example under a rotation.
As such xrandr -o left; glxgears -fullscreen was broken.

Reported-by: Phillip Haddad <phillip.haddad@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-19 08:28:07 +00:00
Chris Wilson 17c19ea8e2 sna/traps: Remove separate edge->vertical flag
Mark vertical edges with dy==0 to reduce structure size and reduce
memory load during edge walking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-18 15:11:31 +00:00
Chris Wilson 82023397cd sna/gen3: Improve clear-to-solid reduction
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-18 15:11:31 +00:00
Chris Wilson 7ce5f4a113 sna/gen3: Do not force tiling for large pixmaps
As the extraction routine is now smarter and can construction
subsurfaces without copying we do not need to force tiling.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-18 15:11:31 +00:00
Chris Wilson 342dda3fe3 sna/gen3: Prevent copy-fallback if we cannot blit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-18 15:11:31 +00:00
Chris Wilson 28c089781f sna: Fixup the cpu shadow mappings before uploading the box
On the off-chance we arrive here with a pointer to the GTT mapping.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-18 15:11:30 +00:00
Chris Wilson 79258fe560 sna/traps: Apply some more operator and unbounded reductions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-18 15:11:30 +00:00
Chris Wilson fe8866d611 sna/gen[345]: Convert CPU mappings to GTT for vertices on submit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-18 15:11:30 +00:00
Chris Wilson 97cd0c7da5 sna/traps: Upon reducing an ADD to a SRC, we need to apply the pending clear
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47444
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-18 15:10:37 +00:00
Chris Wilson e31d9dacaf sna/traps: Align indices for unrolled memset in row_inplace()
The compiler presumes that the uint64_t write is naturally aligned and
so may emit code that crashes with an unaligned moved. To workaround
this, make sure the write is so aligned.

References: https://bugs.freedesktop.org/show_bug.cgi?id=47418
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-17 09:25:30 +00:00
Chris Wilson 2b4e11923d sna/traps: Tune inplace_end_subrows()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-17 00:13:35 +00:00
Chris Wilson d887f209f1 sna/dri: Mesa expects the 8-bit stencil buffer to have 2-bytes per pixel
The seperate stencil buffer is full of lies, why worry about one more?

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-16 17:19:11 +00:00
Chris Wilson 63c0d10fae sna/dri: Improve handling of non-front attachments for CopyRegion
Confusion reigns between using the backing pixmap for the drawable for
the front buffer, and a fake pixmap for the auxiliary buffers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-16 14:57:39 +00:00
Chris Wilson 324a1dffdc sna/gen3: Micro-optimise solid span emission
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-16 13:07:00 +00:00
Chris Wilson 47c47b85f6 sna/traps: Micro-optimise span emission
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-16 12:59:13 +00:00
Chris Wilson 3a26437f19 sna/traps: Tune nonzero_row
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-16 12:37:25 +00:00
Chris Wilson cb04cf9f43 sna/traps: Make the inline u8 arithmetic more robust
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-16 09:53:15 +00:00
Chris Wilson d55bbdf42c sna/traps: Remove the old paths for mono inplace traps
Dead code elimination.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-16 09:29:39 +00:00
Chris Wilson fe4ad66aad sna: Correct the order of screen private teardown
So that we do not keep a stale references of the last cached pixmap
across server regeneration (or shutdown).

Reported-by: Thierry Reding <thierry.reding@avionic-design.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47357
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 21:34:01 +00:00
Chris Wilson 0a8218a535 sna: Prefer the CPU bo for uploads if last access was not through the shadow
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 13:32:35 +00:00
Chris Wilson 77c9c03b10 sna: Fixup the shadow pixmap pointer for move-to-gpu
If we choose not to use the CPU bo for the upload (because we fear the
subsequent synchronisation cost), we need to fixup the shadow pointer
before dereferencing it.

On the move-to-cpu side, the fixup is already performed as we will need
to access the shadow pixels for the subsequent drawing operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 13:32:02 +00:00
Chris Wilson 0e2fbb6a1c uxa: Merge 'remove complicated second level caching'
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47345
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 12:44:37 +00:00
Chris Wilson 84d7a82122 uxa: Simplify allocation of backing pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 12:43:12 +00:00
Chris Wilson 1b1016624a uxa/i915: Remove broken CA pass, fallback to magic 2-pass composite helper
The backend failed to handle all the corner cases, so remove the
complication.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 12:43:12 +00:00
Chris Wilson 895a56a553 uxa: Remove unused render_mask_solid members
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 12:43:12 +00:00
Chris Wilson 9c6f79440e uxa: Remove unused tracking of the current render target
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 12:43:12 +00:00
Chris Wilson 219467ac8b uxa: Simplify flush tracking
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 12:43:12 +00:00
Chris Wilson bd8fafe0c4 uxa: Kill the complicated in-flight tracking
Reference leak hunting.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 12:43:11 +00:00
Thierry Reding 64ccc6698d configure: Keep passed-in CFLAGS for DRI tests
When the user passes extra CFLAGS and CPPFLAGS to the configure script,
they should be kept when performing subsequent checks with additional
flags. This is required to properly build in cross-compilation setups
where the user may pass in flags like --sysroot in order to pick up the
cross-built dependencies.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
2012-03-15 12:42:46 +00:00
Chris Wilson c5c61ef378 sna/traps: dst IN WHITE does not reduce to SRC!
I was getting too carried with my reductions. However, IN over a
clear surface is a no-op, though unlikely!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 12:39:43 +00:00
Chris Wilson fba49e1bb8 sna/traps: Fix off-by-one for filling vertical segments in tor_inplace
If the last solid portion was exactly 4-pixels wide, we would miss
filling in the mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-15 10:31:51 +00:00
Chris Wilson 27f8f121b3 sna/damage: Handle a reduced damage rather than assert
As we may reduce a damage to empty along the migration paths and not
detect that reduced damage till later, handle those scenarios rather
asserting.

References: https://bugs.freedesktop.org/show_bug.cgi?42426
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 23:43:20 +00:00
Chris Wilson abd1046002 sna: Treat unmapped but CPU-mappable bo as available for mapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 23:08:31 +00:00
Chris Wilson 2c492c0064 sna: Disable tiling for single row pixmaps (unless required for hw limits)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 23:06:17 +00:00
Chris Wilson 6890592cd2 sna/traps: Explicitly create an unattach pixmap for fallback
References: https://bugs.freedesktop.org/show_bug.cgi?id=42426
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 21:30:33 +00:00
Chris Wilson 23b5640a0f sna: Avoid using kgem_bo_reference() internally
So that we can keep the assertion to track the refcnt elsewhere.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 20:50:52 +00:00
Chris Wilson 03731b4e37 sna: Ellide no-op image glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 20:50:52 +00:00
Chris Wilson d0e05b4294 sna: Don't mark cached upload buffers for inactivity expiration
As these do not follow the normal rules of damage tracking, we have to
be careful not to force migration.

References: https://bugs.freedesktop.org/show_bug.cgi?id=42426
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 20:21:26 +00:00
Chris Wilson 96ead26c4d sna: Add a couple of asserts for inactive_partial reference counting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 19:56:42 +00:00
Chris Wilson 6a4ac18e37 sna/traps: Use a more direct fallback path for the CPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 11:55:45 +00:00
Chris Wilson 8580677ee6 sna/traps: Rasterise using pixman inplace where appropriate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-14 11:51:34 +00:00