Commit Graph

4876 Commits

Author SHA1 Message Date
Chris Wilson 79d468925b sna: Decrease latency for 1x1 GetImage by using an inplace mapping
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:30 +01:00
Chris Wilson 2c2a8d3780 sna: Allow reads to be performed inplace
If we can guess that we will only readback the data once, then we can
skip the copy into the shadow.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson bc6997f6f7 sna: Cleanup damage processing after operating inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson 937ca8a5d8 sna: Use memset for simple clears
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson de4572b0b5 sna: Inspect CPU damaged state when deciding upon Composite placement
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson b689cd924c sna: Composite traps inplace if the CPU is already all-damaged
One outcome is that inspecting the usage patterns afterwards indicated
that we were missing an opportunity to reduce unaligned boxes to an
inplace operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson ae3c096379 sna: Composite glyphs inplace if the CPU is already all-damaged
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson eaed58b2ba sna: Tweak placement of operations
Take in account busyness of the damaged GPU bo for considering placement
of the subsequent operations. In particular, note that is_cpu is only
used for when we feel like the following operation would be better on
the CPU and just want to confirm that doing so will not stall.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson 8eac098962 sna/gen3: Add another DBG for dropping vbo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-17 09:44:29 +01:00
Chris Wilson 515c8b19d6 sna: Prefer to operate inplace if already mapped of the GPU is wholly dirty
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 15:41:14 +01:00
Chris Wilson d1713941e9 sna: Tweaks for DBG missing glyphs through fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 15:41:08 +01:00
Chris Wilson 2b23605efb sna: Don't trim prepare for glyphs_via_mask
If we pass the expected width/height without passing the per-glyph
offset into the preparation function, we make the erroneous mistake of
analysing the glyph cache only for the mask extents and so will miss
glyphs that we need to upload for the operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 15:28:31 +01:00
Chris Wilson 9f66b27114 sna: Remove mark-as-cpu after gem_pread
The kernel no longer moves the read bo into the CPU domain, so remove
the last vestiges of that tracking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 13:47:33 +01:00
Chris Wilson bfd88d5429 sna: Silence a few compiler warnings
Nothing harmful, just noise.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 11:21:29 +01:00
Chris Wilson b3659beec8 sna: Check for zero-sized damage regions after trimming Windows to their pixmaps
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-15 11:21:25 +01:00
Chris Wilson 293a867ea5 sna: Specialise the self-copy blitter to handle vertically overlapping copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 23:21:59 +01:00
Chris Wilson 3b76ab995b sna: Add a little bit more DBG to migration IO paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 22:33:11 +01:00
Chris Wilson 49543522e7 sna: Fix reversed assertion
Darn the double negative! After adding damage we want to assert that
the region is not empty, not !not empty.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 20:25:21 +01:00
Chris Wilson 4e50467b4f uxa: Force the outputs to off for consistency with xf86DisableUnusedFunctions()
Upon a VT switch, we set the desired modes and turn off the DPMS on any
unused output. Make this explicit so that we always maintain consistency
between the kernel and X's list of enabled CRTCs.

References: https://bugs.freedesktop.org/show_bug.cgi?id=50772
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 19:44:22 +01:00
Chris Wilson 3a56a0b10e sna: Make the disable-unused after vt switch distinct from DPMS off
So that we do not lose control over dpms on/off!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 19:26:42 +01:00
Chris Wilson b415ca05c2 sna: Reset damage extents after reduction goes to zero
If the reduction of the damage clears all of the boxes, we need to reset
the -infinite extents so that we continue to accumulate further damage.

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50744
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 17:08:03 +01:00
Chris Wilson 0df7c48864 sna: Supporting overlapping copies for fallback blits
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50393
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 16:48:52 +01:00
Chris Wilson d5b273b20b sna: Explicitly disable the CRTC so that xserver/kernel agree after VT switch
References: https://bugs.freedesktop.org/show_bug.cgi?id=50772
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-14 16:34:23 +01:00
Chris Wilson 221534abe2 sna: Only reduce damage addition to a region operation if clean
Some paths bypass operating upon the region as they do not have an
YX-banded set of boxes and so prefer to defer the costly construction of
the region till later. As a result, we have to be careful not to
overwrite any existing information if we do operate on the region after
setting the dirty boxes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50744
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 22:52:50 +01:00
Zdenek Kabelac 0db789e180 sna: Constification
Adding preserving const modifiers to decrease amount of const warnings

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Zdenek Kabelac 33998a7080 sna: Fix typo and compare y1 to y2
It seems 'y1' was meant to be compared here

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Chris Wilson 0ade32fbad sna: Fix operator preference around a | b & c | d
Tell the compiler what we really mean is a | (b & (c | d))

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Chris Wilson 20f3114ccd sna: Use long for simplicity when printing size_t values for debugging
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Zdenek Kabelac 6f75b8da6a sna: Valgrind updates
Add some mising initialization for unknown ioctl

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:22 +01:00
Zdenek Kabelac 70cf637ca4 legacy/i810: Fix declaration to match definition
Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:34:15 +01:00
Chris Wilson 5fea2478cd Lots of trivial semantic fixes
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 14:14:40 +01:00
Chris Wilson e499f207c1 sna: Fix memleak from sna_crtc_find_plane()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 13:11:37 +01:00
Chris Wilson 49da55da51 sna: Free the reversed glyph bits along with the font
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 12:33:37 +01:00
Chris Wilson 9f68c7fe6a sna: Free clip rectangles after intersection with PolyRectangle extents
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 12:33:37 +01:00
Chris Wilson ab3b7fe31b sna: Only reuse a write buffer if all external references have been dropped
This avoids the unhappy situation of overwriting an upload buffer that
we intend to use for a fallback.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 10:35:14 +01:00
Chris Wilson e8cb656dc4 sna: Free clip intersection with line extents after use
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-13 08:10:10 +01:00
Chris Wilson 572745eb24 sna/damage: Remove unused return value
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 22:53:48 +01:00
Chris Wilson aefc0417dd sna/damage: Simplify initialisation of damage extents
Just use the already computed region->extents when adding the first box.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 22:53:48 +01:00
Chris Wilson 78a96e812b sna: Refresh the damage self-tests
They had bitrotted with the revamp and needed some massaging to update
to the new interfaces.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 22:17:24 +01:00
Cyril Brulebois 6138f7434a Fix up braindamage in previous commit.
ickle: Fixing up my idiotic change, obviously too much birthday cake.
2012-06-12 21:19:14 +01:00
Cyril Brulebois 224d631a23 Avoid calling xf86nameCompare() with a NULL string
Device sections without a Driver property would lead to a server
segfault because of a NULL pointer's being passed as the second
argument of xf86nameCompare().

Debian bug #677206 <http://bugs.debian.org/677206>

Signed-off-by: Cyril Brulebois <kibi@debian.org>
2012-06-12 21:14:53 +01:00
Dave Airlie 3b9b64c7c9 uxa: do copy fb at startup.
Copy the current framebuffer for smooth wayland->gdm handoff.

This has been hanging around in Fedora for too long now, and we've
dropped the feature a few times, and yes I know the Simpsons did it^W^W^W
SNA does it.

I've updated the code to have some of the better fixes from nouveau.

I've no idea who wrote this code either, krh or ajax. [ickle: The
earliest version I've found had krh's fingerprints on it, though it may
still have been a joint effort.]

Signed-off-by: Dave Airlie <airlied@redhat.com>
[ickle: improve error handling, only copy the fb during initial takeover]
2012-06-12 15:09:05 +01:00
Chris Wilson b6525702b9 sna: Hook up AdjustFrame()
Looks to be unused by the core, just a solitary invocation in an obscure
extension it seems. However the implementation looks trivial so
incorporate it until it is finally removed, just in case.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 12:04:26 +01:00
Chris Wilson 7b281d1300 sna: Remove a pair of empty stub functions
The export wrappers for the glyph cache constructor/destructor existed
in case there was a need to add more routines. Since that never
happened, remove the extra step of indirection.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-12 10:37:04 +01:00
Chris Wilson 392e33a62d sna: Instrument memory/bo allocations for monitoring over time
Hide it behind --enable-debug=memory to avoid incurring the cost for
everybody.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-11 12:19:57 +01:00
Chris Wilson ea0209fbc1 sna: Remove option to disable vmap
It works everywhere, so when it is finally enabled, let it be.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 22:46:10 +01:00
Chris Wilson 18baa1428b Make the enum list of options consistent with the actual table.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 22:45:58 +01:00
Chris Wilson adc872a965 sna: Add DBG spew to flink()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-08 06:44:20 +01:00
Chris Wilson a62ad4e807 sna: Skip flushing the active queue if there is not a suitable bo pending
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-07 23:37:59 +01:00
Chris Wilson 318982566b sna/dri: Disable experimental code by default
Since these require non-upstream patches to other components, we don't
want it enabled by default and randomly breaking builds.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-07 23:12:21 +01:00