Commit Graph

5163 Commits

Author SHA1 Message Date
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
Chris Wilson 9d1a9e6667 sna: Bump experimental ioctl number for vmap
Gazumped!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 20:06:35 +01:00
Chris Wilson 55e6f5f220 sna: Use the local function for turning the cursor off prior to release
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 16:21:09 +01:00
Chris Wilson 77dd429222 sna/dri: Make WAIT_VBLANK valgrind clean
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 15:03:32 +01:00
Chris Wilson 8ebe84818a sna: Make sna_copy_fbcon() valgrind clean
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 15:03:32 +01:00
Chris Wilson f37dae734e sna: Just use the CRTC id from the array
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 14:20:54 +01:00
Chris Wilson b1f24a0eae sna: Make sna_crtc_apply() valgrind clean
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 14:17:15 +01:00
Chris Wilson 0ebfcdbb80 sna: Make AddFB valgrind clean
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 14:10:04 +01:00
Chris Wilson 32ca3c7b65 sna: Make sna_crtc_is_bound() valgrind clean
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 14:02:11 +01:00
Chris Wilson 7973f6751c sna: Add a little bit more verbosity to cursor routines for valgrind
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 14:00:55 +01:00
Chris Wilson 19c463e52d sna: Only wait if there is a suitable active buffer
There is not point repeating the search after retiring if we know that
there is no outstanding suitable active buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:54:35 +01:00
Chris Wilson 5b99c7cd34 uxa/dri: Enable vblank scheduling even with pageflipping disabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:48:25 +01:00
Chris Wilson 810357ad65 uxa/dri: Fix ordering of setting vs using swap members
Trivial readibility fix, as the actual ordering is serialised through
there being only a single thread.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:48:25 +01:00
Chris Wilson 2b56a188ef Mark another couple of options as being UXA only.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:48:25 +01:00
Chris Wilson b025f1a604 sna/dri: Tweak vblank_mode=n swapbuffers to account for throttle delay
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:48:25 +01:00
Chris Wilson 45148a714f sna/dri: Enable handling for Option "SwapBuffersWait"
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:48:25 +01:00
Chris Wilson c709f2447d sna/dri: Requeue vblank throttling until the vsync'ed copy completes
If the GPU is busy, then we may not actually schedule our copy for
several vblanks, resulting in us falsely reporting that the work
completed too early and allowing the client to continue scheduling more
work and racing ahead of the queued copies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:48:25 +01:00
Chris Wilson 7e73fa02ed sna: Add some debugging to show count of outstanding requests during retire
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:48:25 +01:00
Chris Wilson 62b557065e sna: Use magic upload buffers for video textures
So that we may benefit from the caching of buffers and the automatic
selection  of the preferred upload method.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:48:25 +01:00
Chris Wilson 35291d2db8 sna: Search the inactive bo cache for a mappable upload buffer
See if we have a bo that we can cheaply map to an inplace upload, rather
than rely on an existing GTT map.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-28 12:48:25 +01:00
Chris Wilson 36d53ff52b sna: Validate all CRTCs after updating one
Updating one CRTC may cause the kernel to turn off another, so be
paranoid and run the check in a loop after applying the CRTC set.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-27 17:02:06 +01:00
Johannes Obermayr 7fdd8bd6d2 glamor: Fix misspelled xf86GetOptValString and OPTION_ACCEL_METHOD introduced by commit e456291.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-27 11:54:00 +01:00
Chris Wilson 8ea4ba081d sna: Fix typo for debug compilation
s/ctrc/crtc/

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-26 21:48:16 +01:00
Chris Wilson 317bf05196 sna: Perform the selftest after probing
We do no want to slow down the detection phase by performing our
self-tests, so only running those before initialising the driver.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-25 14:34:16 +01:00
Chris Wilson a5fe863e3f sna: Check the bus type before declaring probe success
This should never fail, but still better to fail during detection rather
than pretend it works.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-25 14:28:56 +01:00
Chris Wilson 4094826aee sna: Trust the crtc-is-bound determination after modeset and hotplug
As these should be the only time that they change and we now have the
checks in place, we can drop the workaround of doing the check just
before emitting the wait.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-25 10:06:57 +01:00
Chris Wilson 8a9a585341 Only create a single instance of the intel_options array
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-25 10:06:57 +01:00
Chris Wilson e456291350 Allow runtime switching of AccelMethod between uxa/sna and even glamor
Section "Device"
  Option "AccelMethod" "uxa/glamor/sna"
EndSection

The appropriate backend must also be enabled at compile time for the
runtime option to be available (i.e. --enable-uxa (default) --enable-sna
--enable-glamor)

Demanded-by: Adam Jackson <ajax@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50290
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-24 19:01:22 +01:00
Eugeni Dodonov df6ab02c36 Unify options handling between UXA and SNA
Unifies available options for both UXA and SNA drivers, and
moves them into a common header file, intel_opts.h.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-05-24 18:47:41 +01:00
Chris Wilson ae2be7e25b sna/trapezoids: Correct rounding for downsampling onto sample grid
Reported-by: S. Christian Collins <s_chriscollins@hotmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49446
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-24 16:33:27 +01:00