Commit Graph

5192 Commits

Author SHA1 Message Date
Chris Wilson ba0eb23083 uxa: Fix reallocation of XVAdaptors array
Prevent the leak and remove some unsightly code in the process.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 08:38:21 +01:00
Chris Wilson affb1f82c1 sna/gradient: Reuse old gradient bo if allocation of new fails
Prefer a stall to a crash.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 08:38:21 +01:00
Chris Wilson e51f984a4c sna: Check gradient allocations during init
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 08:24:19 +01:00
Chris Wilson 2c5647a18e sna: NameForAtom may return NULL
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 07:51:41 +01:00
Chris Wilson 7867bff00c sna: Replace invalid signed value with unsigned ~0 for uint8_t
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 23:25:31 +01:00
Chris Wilson ca72b37223 sna: Drop return value from 3D point transform
And just fixup the computed coordinates in the face of an invalid
matrix.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 23:22:31 +01:00
Chris Wilson b83e2a79f2 uxa: Static analysis warning fixes
A smattering of bugs and confusing code.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 17:30:38 +01:00
Chris Wilson 67e8ac365c sna/gen3+: Guard against a kgem_bo_destroy(NULL)
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 17:30:38 +01:00
Chris Wilson e91b27ae14 sna: Fix potential deference of NULL cpu_bo inside assertion
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 17:12:36 +01:00
Chris Wilson 048161e696 sna/trapezoids: Check for malloc failure
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 17:09:21 +01:00
Chris Wilson 2896aa7b46 sna/io: Free the heap clip boxes on error paths
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 17:08:01 +01:00
Chris Wilson 1ef00ff720 sna/dri: Fix typo, check for NULL after allocations to spot failure!
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 17:05:55 +01:00
Chris Wilson dc0fe44beb sna: Fix a smattering of static analysis warnings
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 16:54:41 +01:00
Chris Wilson 8eed569fb3 sna/trapezoids: Correct extents declaration for fallback
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 13:02:50 +01:00
Chris Wilson 91419576ee sna: Tiny DBG message tweak
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 12:09:19 +01:00
Chris Wilson 4bdecc5b07 test: Add a very basic test to exercise BLT text drawing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 11:06:21 +01:00
Chris Wilson ea0f326d80 sna: Debug XDrawRectangle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 10:27:34 +01:00
Chris Wilson 6a7efa991a test: Exercise basic rectangle drawing code
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-01 10:27:34 +01:00
Chris Wilson bc4323558b sna: Handle negative values when computing the stipple modulus
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 21:19:26 +01:00
Chris Wilson aca994e03e sna: Fill early break for clip process of spans
When on the same Y-band as the span, as soon as the clip boxes are too
far to the right, we can stop searching for more intersections.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 21:17:24 +01:00
Chris Wilson 0fe150f898 sna: Fix computation of box for clipped stippled rectangles
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 20:02:47 +01:00
Chris Wilson a65c3b7b45 sna: Add some more DBG for stippled blts
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 19:46:29 +01:00
Chris Wilson b2cc642532 sna: And combine the two migrate to CPU clauses
Just a small tidy up to remove a duplicated predicate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 19:46:29 +01:00
Chris Wilson bd1dd4cf66 sna: If the CPU damage already contains the migration region, we are done
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 19:16:46 +01:00
Chris Wilson a2d92ade39 sna: Prevent readback of 1x1 if it lies inside CPU damage
If the pixel exists only in the CPU damage, attempting to read it back
from the GPU only results in garbage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 19:16:46 +01:00
Chris Wilson a34a06c4ba sna/glyphs: Clip the damage to the drawable for unclipped glyphs-to-dst
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 20:14:38 +01:00
Chris Wilson dcc7ba8ccf sna/composite: Add debugging modes to disable acceleration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 17:48:40 +01:00
Chris Wilson 984400b95a sna/glyphs: Don't apply drawable offsets twice
The offsets from image_from_pict() already include the drawable offset
so we need not apply them twice.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 17:01:39 +01:00
Chris Wilson 7bbd445c8c sna/trapezoids: Apply the drawable offset for the CPU migration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 17:00:06 +01:00
Chris Wilson c5313620a2 sna: Suppress flushes once we have cleared the kernel dirtiness
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 15:06:16 +01:00
Chris Wilson 0347c8abec sna/glyphs: Fix upconverting of glyphs via gpu
When using the mask instead of the src for adding the glyphs we need to
pass the glyph coordinates through the mask coordinates rather than the
source.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 14:33:29 +01:00
Chris Wilson 90ae4f8532 sna: Avoid mixing signed/unsigned int/int16 arithmetric
Life becomes unpleasant with sign extension.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 14:33:26 +01:00
Chris Wilson 660c89e974 sna: Use full 16-bit unsigned values for absolute differences
Beware the overflow implicit in:
  adx = x2 >= x1 ? x2 - x1 : x1 - x2;
when both x2 and x1 may be large signed 16-bit values

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50532
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 13:19:49 +01:00
Chris Wilson 035c295375 sna/glyphs: use add(WHITE, glyph, mask) for channel expansion
If the glyph format does not match the mask format we can not simply add
the two together, but must first perform a channel expansion (or
contraction) by multiplying the glyph against a WHITE source.

Normally the glyph and the mask are equivalent formats and so we hit the
fast path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-31 10:55:27 +01:00
Chris Wilson cf5b3e2ebf sna: Don't attempt to flush scanout if unattached
This was lost in the midst of the OSTimer overhaul.

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50393
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-30 14:44:59 +01:00
Chris Wilson 3a64ba0895 sna: Convert remaining drmCommands to drmIoctl
This helps to silence valgrind

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-30 13:51:07 +01:00
Chris Wilson 47e2db0ba8 sna: Replace FREELIKE_BLOCK with MAKE_MEM_NOACCESS
And similarly for MALLOCLIKE_BLOCK. The issue being that valgrind may
overwrite such blocks with alloc-fill and free-fill values, but when in
fact they are defined and still in use by the GPU. This can lead to the
GPU processing garbage, and GPU hangs.

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50393
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-30 10:37:22 +01:00
Chris Wilson 08a630dc5e sna: Ensure we flush scanout even when otherwise idle.
Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=50477
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-30 09:36:21 +01:00
Chris Wilson 10ca765ad3 Mark a few more options as being UXA specific
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-30 08:32:34 +01:00
Nick Bowler 740368c4c6 Include config.h in intel_options.c
Commit 8a9a585341 ("Only create a single instance of the intel_options
array") moved the definition of intel_options into a separate .c file.
Several of the defined options are #ifdef'd based on the configuration,
but since config.h is never included, the macros being tested are never
defined.  Therefore, none of the configuration-specific options will
ever be available at runtime, even if they should be.

Add an inclusion of config.h so that such configuration-specific options
work again.

Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-30 08:29:38 +01:00
Chris Wilson e1b720c40c sna/sprite: Restore another xf86drm.h
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-30 07:47:53 +01:00
Chris Wilson e986b06162 sna/overlay: Handle return from GETPARAM query correctly
drmIoctl() returns 0 on success, not a positive value.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-29 22:21:05 +01:00
Chris Wilson 68874e2d69 sna: Fix chunking for large stipples
Reported-and-tested-by: Matti Hamalainen <ccr@tnsp.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49510
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-29 22:11:50 +01:00
Chris Wilson 12af825811 sna/overlay: Replace drmCommand with direct invocations of drmIoctl
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-29 22:12:52 +01:00
Chris Wilson 3a1b6e57fb sna/overlay: Restore one xf86drm.h include
This was removed in haste, when it is required for drmIoctl and friends.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-29 22:12:52 +01:00
Chris Wilson 264d1b1e1f sna: Also check for a free exec slot for the upload buffers
As we check before allocating the upload buffer, we can not be certain
that we will allocate an already attached bo or that we have a free exec
slot. So always check that we have an extra exec slot available - the
false positive rate is going to be negligible.

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50457
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-29 13:10:34 +01:00
Chris Wilson c7bcca9a3f sna: Make finding DPMS property valgrind clean
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-29 12:49:12 +01:00
Chris Wilson 3c07479709 sna: Make GetEDID valgrind clean.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-29 12:46:11 +01:00
Chris Wilson 560e50c0a5 sna: Make GetEncoder() valgrind clean
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-29 12:46:11 +01:00
Chris Wilson b4b6fa7952 sna: Trim the set of includes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-29 12:46:11 +01:00