Commit Graph

4464 Commits

Author SHA1 Message Date
Chris Wilson 8dd913fd3a sna: Add reminder about possible future tiling optimisations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-10 17:08:16 +00:00
Chris Wilson 21948578d0 sna: Disable the inline xRGB to ARGB upload conversion
As we have to upload the dirty data anyway, setting the
alpha-channel to 0xff should be free. Not so for firefox-asteroids on
Atom at least.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-10 17:08:16 +00:00
Chris Wilson 87f73b0434 sna/gen[23]: Tile render fill to oversized bo
If we are forced to perform a render operation to a bo too large to fit
in the pipeline, copy to an intermediate and split the operation into
tiles rather than fallback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-10 17:08:15 +00:00
Chris Wilson 2ccb31c5a4 sna: Shrink upoads buffers
If we do not fill the whole upload buffer, we may be able to reuse a
smaller buffer that is currently bound in the GTT. Ideally, this will
keep our RSS trim.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-10 17:08:15 +00:00
Chris Wilson 572cc76be5 sna: Destroy the counter damage after a reduction-to-all
If, for instance, we reduce the GPU damage to all we know that there can
be no CPU damage even though it may still have a region with a list of
subtractions. Take advantage of this knowledge and cheaply discard that
damage without having to evaluate it.

This should prevent a paranoid assertion that there is no cpu damage
when discarding the CPU bo for an active pixmap.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-10 17:08:15 +00:00
Chris Wilson 4a255e1316 sna: Replace the free-inactive-gpu-bo with the generic code
The function was semantically equivalent to moving the pixmap to the CPU
for writing, so replace it with a call to the generic function.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-10 17:08:10 +00:00
Chris Wilson c1d403266a sna: Allow for xRGB uploads to replace their target bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-10 00:41:05 +00:00
Chris Wilson 406776cd95 sna: Rearrange buffer allocation to prefer llc bo over vmaps
If we can create snoopable bo, we prefer to use those as creating a vmap
forces a new bo creation increasing GTT pressure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-10 00:25:14 +00:00
Chris Wilson b76865fa3d sna/gen2: Try to avoid creating a bo for solid colours
As we try to use the diffuse/specular and only resort to using a texture
operation for convenience in the rare case of a solid mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-09 23:24:18 +00:00
Chris Wilson 981aae104a sna/gen2: Eliminate some switching between logic op and blend
If the new mode can be done either using a logic op or with the blend
unit, prefer the currently enabled unit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-09 23:24:18 +00:00
Chris Wilson d65b7f9cf4 sna/blt: Rearrange to reduce a out-of-bounds copy to a clear
If we asked to use the BLT, try to avoid trigging a context switch for
a trivial case where we sample outside of a NONE source and so can
reduce the operation to a clear.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-09 23:24:18 +00:00
Chris Wilson 09e54c5536 sna/gen2: Add poor-man's linear gradient support
Convert the linear gradient to a texture ramp and compute the texture
coordinates in the standard manner.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-09 23:24:18 +00:00
Chris Wilson 6c70558ae7 sna: mark the cpu bo used for the upload buffer as in CPU domain
For correctness we need to inform GEM of the change of domain for the
buffer so that it knows to invalidate any caches when it is next used by
the GPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 22:48:11 +00:00
Chris Wilson 9ec31af029 sna/io: Combine small uploads into single writes
For a small update, try and amalgamate the upload buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 17:34:48 +00:00
Chris Wilson 4db1bb3fd8 Removed deprecated xf86PciInfo.h includes
The driver should and does provide its own PCI-IDs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 17:34:48 +00:00
Chris Wilson 54232d1a5d sna: Add ricer stripes to memcpy_xor
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 17:34:48 +00:00
Chris Wilson c037b4f542 sna: Tune cache size for cpu bo cache
This helps SNB on cairo-traces that utilize lots of temporary uploads
(rasterised sources and masks for instance), but comes at a cost of
regressing others...

In order to counter the regression from increasing the GTT cache size,
the CPU/GTT vma cache are split and accounted separately.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 17:34:48 +00:00
Chris Wilson 26042b2660 sna: Bubble sort the partial buffer list back into order after trimming padding
After reducing the used size in the partial buffer, we need to resort
the list to maintain the list in decreasing amount of available space.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 14:34:01 +00:00
Chris Wilson 3f7ea44bf1 sna/gen[67]: Hook into the clear operation for glyph masks
Allow SandyBridge to specialise its clear routine to reduce the number
of ring switches. It may be interesting to specialise the clear routines
even further and use the special render clear commands...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 14:34:01 +00:00
Chris Wilson 803ac5c6b9 sna/trapezoids: Don't risk stalling for inplace SRC trapezoids
Optimistically we would replace the GPU damage with the new set of
trapezoids. However, if any partial damage remains then the next
operation which is often to composite another layer of trapezoids (for
complex clipmasks) using IN will then stall.

This fixes a regression in firefox-fishbowl (and lesser regressions
throughout the cairo-traces).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 01:48:40 +00:00
Chris Wilson 0229841c0d sna: Do not upload an untiled GPU bo if we already have a CPU bo
Continuing the tuning for sna_copy_boxes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 01:48:20 +00:00
Chris Wilson 42eb9b7c4b sna: Trim usage of vmapping
The first, and likely only, goal is to support SHMPixmap efficiently
(and without compromising SHMImage!) which we want to preserve as vmaps
and never create a GPU bo. For all other use cases, we will want to
create snoopable CPU bo ala the LLC buffers on SandyBridge.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 01:08:48 +00:00
Chris Wilson e52f020493 sna: Do not move-to-gpu for sna_copy_boxes if we have a cpu bo
We trade-off the extra copy in the hope that as we haven't used the GPU
bo before then, we won't need it again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-08 01:08:47 +00:00
Chris Wilson c05e90aa99 sna: Missing chunks from last commit
And update the check for reusing the blit!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-07 18:23:43 +00:00
Chris Wilson 292aebfcdc sna: Prevent reuse of scanlines after the buffer is destroyed
Once the buffer is destroyed, it may be reallocated with a new pitch. We
could track handle and pitch, but it is easier to simply restart the
blit after the buffer is freed.

References: https://bugs.freedesktop.org/show_bug.cgi?id=44277
References: https://bugs.freedesktop.org/show_bug.cgi?id=44555
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-07 18:13:56 +00:00
Chris Wilson d7d07d1df3 sna: Pad upload buffers to ensure there are an even number of rows
One restriction common to all generations is that samplers access pairs
of rows and so we need to pad the buffer to accommodate access to that
second row. Do so unconditionally along paths that may be used by the
render pipeline.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-07 18:11:35 +00:00
Chris Wilson e2ad0f6272 sna/blt: Amalgamate many PolyFillRect of single boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 18:08:35 +00:00
Chris Wilson c085de905c sna: Also mark a bo created by force-to-gpu as being all-damaged
Similar to the action taken into move-to-gpu so that we forgo the
overhead of damage tracking when the initial act of creation is on the
render paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 17:50:01 +00:00
Chris Wilson 9f1935bb4e sna: Support performing alpha-fixup on the source
By inlining the swizzling of the alpha-channel we can support BLT copies
from an alpha-less pixmap to an alpha-destination.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 17:50:01 +00:00
Chris Wilson 141001df6c sna: always skip active search when requested for find an inactive bo
References: https://bugs.freedesktop.org/show_bug.cgi?id=44504
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 13:48:14 +00:00
Chris Wilson eac0d9652b sna: Optimise sna_poly_segment() for the frequent no-op case
Strange as it may seem... But the principle of doing less work with
greater locality should help everywhere, just not as noticeable when
real work is performed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 12:39:49 +00:00
Chris Wilson a3699fff5a sna: Only force a pipeline flush for a change of destination, not sources
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 12:15:46 +00:00
Chris Wilson 2fefee6015 sna/gen6: Reuse current no-blending setup for PictOpClear
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 12:10:27 +00:00
Chris Wilson 800ca0b4d1 sna/gen6: Tidy emission of CC state (blending)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 12:02:19 +00:00
Chris Wilson b9c9e9970c sna/trapezoids: Add debug markers for move-to-cpu
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 11:38:31 +00:00
Chris Wilson 2841c5fee7 sna: fast path move-to-cpu of an all-damaged CPU bo
When the bo is already completely damaged on the CPU, all we need to do
is to sync with the CPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 11:35:32 +00:00
Chris Wilson 07f1724ba5 sna: Pass the real destination pixmap to sna_write_boxes()
Faking it for the render upload simply isn't good enough, since we need
the correct drawrect.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 11:00:38 +00:00
Chris Wilson 5c2e9a9871 sna/trapezoids: Use a slightly faster miTrapezoidBounds()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 02:47:45 +00:00
Chris Wilson 75f6167824 sna: Only need to remove the pixmap from the dirty CPU list when clearing damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 01:40:12 +00:00
Chris Wilson 86cc2cd334 sna: The condition for automatically using the GPU source is no CPU damage
With no CPU damage to upload, we know that there is no reason not to use
the GPU bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 01:31:15 +00:00
Chris Wilson 69c556c310 sna: Rearrange use-cpu-bo to avoid reducing GPU damage
If we spot that the region is wholly contained within the CPU damage
initially, we can conclude that is not in the GPU damage without
reduction.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-06 00:21:29 +00:00
Chris Wilson 34c4dbe825 sna/gen6: Only force BLT if the src and dst overlaps for self-copy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-01-05 23:44:13 +00:00
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