Commit Graph

4422 Commits

Author SHA1 Message Date
Chris Wilson fc79af7a4a sna: Only force a batch continuation if the scanout is written to
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 23:44:13 +00:00
Chris Wilson c16c16d255 sna/gen6: Enable reuse of source Picture
Check if the source and mask are identical pictures and just copy the
source channel to the mask in that case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 23:44:13 +00:00
Chris Wilson f642b08870 sna: Quickly handle the common case of using a CPU source pixmap
For the common case (at least with llc bo) where we are immediately
using an uploaded image from its linear buffer, check upfront before
computing the sampled region for transfer to the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 23:44:13 +00:00
Chris Wilson 8a9baa59e9 sna: Quickly handle the common case of using a GPU source pixmap
For the common case of glyphs, the pixmap is entirely on the GPU which
can be quickly tested before performing the more complex transformations
to determine how much pixel data we need to upload.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 23:44:13 +00:00
Chris Wilson d4dad6e372 sna: Check that the GTT is no longer mapped before ensuring the shadow pointer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 23:44:13 +00:00
Chris Wilson 352f0a3ffb sna: Only mark the pixmap as GTT mapped if the private owns the pixels
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 23:44:13 +00:00
Chris Wilson 3061382f98 sna: Make sure that we do not attach to SHM pixmaps in ignorance
Without xserver support for notification of when scratch pixmaps are
reused, we simply cannot attach our privates to them lest we cause
corruption with SHM pixmaps.

This is a recent regression back unto an old, old xserver issue.

Reported-by: Paul Neumann <paul104x@yahoo.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44503
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 23:43:05 +00:00
Chris Wilson f743172633 sna: Add more debugging to use-gpu-bo
To aide debugging in conjunction with compositors and their crazy
offsets.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 20:26:30 +00:00
Chris Wilson 53c943b551 sna: Check for usable pixmap before deference its private
Beware the NULL pointer and early deference.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 19:14:43 +00:00
Chris Wilson 307276d7da sna: Enable using the render pipeline for uploads to Y-tiled pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 14:26:05 +00:00
Chris Wilson f9451aaa39 sna: Mark the upload as having acquired the GTT mapping
In order for the entire PutImage to be performed inplace, we need to
maintain the tendency to keep doing inplace operations. This hint is
provided by tracking whether or not the last operation used the GTT
mapping. However, that hint was not being provided by zpixmap_blt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 14:24:21 +00:00
Chris Wilson ce93c00a33 sna: Avoid operating inplace if we have pending CPU damage
If the operation does not replace existing CPU damage, we are likely to
want to reuse the pixmap again on the CPU, so avoid mixing CPU/GPU
operations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 14:20:55 +00:00
Chris Wilson f5d02d90f3 sna: Avoid switching rings for uploading data
On systems that incur painful overhead for ring switches, it is usually
better to create a large buffer and perform a sparse copy on the same
ring than create a compact buffer and use the BLT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 13:02:04 +00:00
Chris Wilson a42111ff94 sna/trapezoids: Try creating the trapezoids mask inplace if not using spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 12:12:22 +00:00
Chris Wilson 4c6ccbd46a sna: Throttle, throttle, throttle.
This reverts 281425551b as it was causing
insufferable lag in firefox.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 11:50:26 +00:00
Chris Wilson dbb495c3ae sna: Attach to the pixmap for source counting when deferring uploads
If we decide to defer the upload for this instance of the source pixmap,
mark it so. Then if we do use it again we will upload it to a GPU bo and
hopefully reuse those pixels.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 11:50:26 +00:00
Chris Wilson 292097590b sna: Try doing a cheap is-contained check before reducing damage
If the pixmap is entirely within the current CPU damage, we can forgo
reducing either the GPU or CPU damage when checking whether we need to
upload dirty pixels for a source texture.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 11:50:26 +00:00
Chris Wilson 5ddae8bf21 sna: Check the composite-rectangles will be on the GPU before forcibly attaching
If we think that the operation is better performed on the CPU, avoid the
overhead of manipulating our privates.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 11:50:26 +00:00
Chris Wilson 6ffd360564 sna: Deferred attachment to a pixmap needs to mark the pixmap as entirely dirty
As demonstrated with oversized glyphs and a chain of catastrophy, when
attaching our private to a pixmap after creation we need to mark the
entire CPU pixmap as dirty as we never tracked exactly which bits were
dirtied.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 11:50:26 +00:00
Chris Wilson a09ebe0b6c sna: Immediately upload oversized glyphs
Glyphs, even large ones, we suspect will be reused and so the deferred
upload is counterproductive. Upload them immediately and mark them as
special creatures for later debugging.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 10:38:45 +00:00
Chris Wilson 797b27365d sna: Don't perform a deferred attachment for vmapping if not supported
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 10:38:45 +00:00
Chris Wilson 23e3959e1f sna: Use the created cpu-bo for upload and download
As we explicitly create CPU bo when wanted, we no longer desire to
spontaneously create vmaps for simply uploading to the GPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 10:38:45 +00:00
Chris Wilson 4530b87e44 sna: Fix assertion as we may want to create active bo with cpu mappings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 00:02:10 +00:00
Chris Wilson 4119e68fb1 sna/damage: Fix reduction to copy the boxes correctly
We need to be carefully to copy the boxes in a strict lifo order so as
to avoid overwritting the last boxes when reusing the array allocations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 19:40:47 +00:00
Chris Wilson 71b0924b58 sna: Mark tiny CPU pixmaps as completely dirty
Avoid the overhead of tracking damage on small pixmaps when using CPU
rasterisation; the extra cost of sending the whole pixmap compared to
the damage is negligble should it ever be required on the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 19:42:58 +00:00
Chris Wilson fc14e63256 sna: Only request page size allocations for the replacement buffer
A precondition on bo creation is that the size must be page aligned.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 19:33:30 +00:00
Chris Wilson 89739b711f sna: Expand small stipples into 8x8 patterns
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 17:41:16 +00:00
Chris Wilson 878fbfe509 sna: Align tiled stipple uploads with the stipple pixmap correctly
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 16:56:55 +00:00
Chris Wilson 28a222a66b sna: Always prefer to use cacheable operations after the GPU is wedged
As rasterisation will be performed upon the CPU we need to avoid the
readbacks form uncached memory and so we should restrict ourselves to
only create further damage within the CPU pixmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 12:48:25 +00:00
Chris Wilson 99ff83a3be sna: Prevent creation of bo purely for GTT mapping when wedged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 12:46:12 +00:00
Chris Wilson a7c35fa4c3 sna: Only allow mappable pixmaps to be mapped
If we did not allocate the pixel data, such as for wedged pixmaps or
scratch buffers, then we cannot perform the pointer dance nor do we want
to create the GPU buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 12:46:12 +00:00
Chris Wilson 2cbc97d28a sna: Force creation of ordinary pixmaps when wedged.
If the pixmap was intended for scanout, then the GPU bo will be created
upon attachment to the fb.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 12:46:12 +00:00
Chris Wilson f6cc73ba66 sna: The batch is counted in dwords, not bytes!
Yikes, I choose the wrong units for the max_batch_size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 12:56:31 +00:00
Chris Wilson 227fbb90c4 sna: Carefully free the freed_pixmap upon exit
As the contents of the pixmap are now rubbish, we need to manually
destroy it rather than pass it to the normal sna_pixmap_destroy()
routines.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 12:51:01 +00:00
Chris Wilson 0ed758cd21 sna: Limit batch to a single page on 865g
Verified on real hw, this undocumented (at least in the bspec before me)
bug truly exists.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 12:51:00 +00:00
Chris Wilson 3449f1cbe1 sna: Guard against NULL damage deref
The fast version of damage checking assumes that the damage has already
been determined to be non-NULL, so make sure it is.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 02:38:16 +00:00
Chris Wilson 04a6260016 sna: Fix typo during partial list deletion
And keep the asserts that lead to its discovery.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 01:35:24 +00:00
Chris Wilson f1dc1eadd8 sna/gen3: Remove incorrect premultiplication of solid component-alpha mask
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 00:18:47 +00:00
Chris Wilson 8cb9b8d7d7 sna: Discard mask and source for PictOpClear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-04 00:18:47 +00:00
Zhigang Gong feb75c55d6 uxa/glamor: Route some missing drawing function to glamor
We have to route all the drawing function to glamor first, when
glamor is enabled. This adds a few more functions that were previously
just falling back to swrast and passes them to glamor instead.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:04 +00:00
Zhigang Gong f4ea732d71 uxa/glamor: Let glamor do the GC validation
If we are using GLAMOR, then a tile pixmap or stipple pixmap
may be pure glamor pixmap and thus UXA will not know how to
render to them, and we need to let glamor do the validation.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:04 +00:00
Zhigang Gong e8aa9cedbf uxa/glamor: Remove extraneous flush
When glamor is enabled, a pixmap will not be accessed by UXA's
accelerated functions. Only unaccelerated functions may access those
pixmaps, and before each unaccelerated rendering, it calls
uxa_prepare_access which will do a glFlush. Combined with a flush before
sending to DRI clients, we no longer need to flush after every
operation.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:03 +00:00
Zhigang Gong 4ca94ed91f uxa/glamor: Remove dead code.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:03 +00:00
Chris Wilson 5576afc7d1 sna: Inline checks for over-sized buffers during pixmap creation
Make the tests for acceptable GPU pixmaps explicit and upfront.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:03 +00:00
Chris Wilson b2dc17678f sna: Always search for an exact active match first from the bo-cache
And accept second-best only if permitted by flags.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:03 +00:00
Chris Wilson caf41ae23d sna: Force tiling on medium pitches if not reduced for other reasons
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:03 +00:00
Chris Wilson 1b688ca0cf sna: Delete the last buffer if destroyed without being used on the GPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:03 +00:00
Chris Wilson 4a68e72771 sna/gen3: Prefer to use the blitter for solid fills
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:03 +00:00
Chris Wilson 199e357dc6 sna/trapezoids: Pass the sna pointer to the callees
Avoid the repeated multiple indirect dereferences.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:03 +00:00
Chris Wilson bd7aa1754d sna: Avoid unnecessary call overhead for read-only move-to-cpu
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-03 21:35:03 +00:00