Commit Graph

5205 Commits

Author SHA1 Message Date
Chris Wilson ce85cd1a36 sna: Add some DBG to retreiving EDID
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 11:46:06 +01:00
Chris Wilson e8eb273bd6 sna/gen7: Add DBG for ring switching
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 10:43:03 +01:00
Chris Wilson 722afa6bc9 sna: Remove some unused members from the KMS state tracking
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 10:04:02 +01:00
Chris Wilson 26e7bb3f25 sna: Add a DBG message to indicate flushing for GPU idle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 09:16:51 +01:00
Chris Wilson 58fc03b8c3 sna: Prevent NULL deref with early termination and DBG enabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 08:54:57 +01:00
Chris Wilson 1be2afb81d legacy/i810/video: Release memory after creating adaptors
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 08:38:21 +01:00
Chris Wilson 261d086265 legacy/i810/dri: Propagate failure from allocating texture memory
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 2ea12b56d4 legacy/i810: Fix memset(sizeof(*ptr)) rather than memset(sizeof(ptr))
Clear the entire structure and not the first 4 bytes...

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 d3e15d1460 uxa/i965: Make the unhandled allocation failures explicit
Add assertions to the point of allocation and write failures.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-06-02 08:38:21 +01:00
Chris Wilson 46fbb3d31b uxa: NameForAtom may return NULL
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 8451d5dd3c uxa: Use unsigned bitfields for single bits
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 d66ca06865 uxa: Intialize is_glamor_pixmap
It is not clear whether is_glamor_pixmap is always initialized prior to
use, so set it to a safe^W likely value.

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 25a17b2ca5 uxa: Remove 'render_source_is_solid' dead code
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 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