Commit Graph

6698 Commits

Author SHA1 Message Date
Chris Wilson 1bf0d869ae Prefer i830_dri.so for gen2 chipsets
Probe for i830_dri.so and, if it exists, use that driver in preference
to i915_dri.so for DRI (i.e. GL clients). This was suggested in the
context of distributions supplying i915g as the main DRI driver for
gen3, in which case we need to provide a separate DRI driver for gen2.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-17 15:28:13 +01:00
Chris Wilson ddd75d6539 xgvevent 2013-04-16 11:56:17 +01:00
Chris Wilson ddd3cc4ed6 sna: Add VALGRIND_CFLAGS whilst compiling with --enable-valgrind
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-16 11:56:17 +01:00
Chris Wilson f0b6ae2cfb sna: Only release the scanout cache whilst DRM_MASTER
If we try to release the framebuffers whilst not DRM_MASTER, the
operation will fail and we will leak the buffers. So do not bother
during the normal expiration to clean the scanout cache if vt switched
away.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-15 11:44:02 +01:00
Chris Wilson d68270ca84 sna/xvmc: silence a compiler warning
sna_video_hwmc.c: In function 'create_context':
sna_video_hwmc.c:95: warning: assignment from incompatible pointer type

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-12 14:48:38 +01:00
Chris Wilson a64490c794 sna: Add missing ';'
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-12 14:28:44 +01:00
Chris Wilson 9dae6f9f1f sna: Flush the scanout cache after resizing the display
And ensure that any new scanout allocations make the requested size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-12 11:39:11 +01:00
Chris Wilson 97fc1d4c5b sna/gen5: Force a MI_FLUSH between using the BLT and RENDER engines
There is a workaround that says the first RENDER command following use of
the BLT should be a non-pipelined command. To be safe, emit a MI_FLUSH
before setting up the invariants.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1168066
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-12 10:25:55 +01:00
Chris Wilson aff14a23f9 sna: Refine assertion about the existence of CPU damage when GPU damaged
One particular buffer type is quite cunning and simultaneously sets both
CPU/GPU as all damaged (the upload buffer) so be aware when making bold
assertions.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-12 09:56:33 +01:00
Chris Wilson afe61281d8 sna/gen7: Cache our kernels in L3
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-10 13:46:45 +01:00
Chris Wilson caf3118f90 sna: Align uploads to start on page boundaries
This reduces the number of loops and restarts required in the kernel.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-10 13:46:45 +01:00
Chris Wilson 092e30de8a sna/xvmc: Wrap each output adaptor
Each of the overlay, sprite and textured video can support XvMC
passthrough, so we need to setup an XvMC adaptor for each of our Xv
adaptors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-10 12:17:29 +01:00
Chris Wilson 540802595f sna: Suppress hotplug events whilst VT switched away
Whilst we are not DRM master, not only is another server in control of
the outputs and responding to the udev event, we ourselves cannot
change modes and just cause contention upon the DRM device. Instead
inform userspace of the change as soon as we are DRM master again and
back in control.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-10 10:38:30 +01:00
Chris Wilson 7afe2b4555 sna: Add a DBG option for testing userptr more thoroughly
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-10 10:35:58 +01:00
Chris Wilson fbe081061a sna: Document fence limits for gen4+
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-09 09:53:06 +01:00
Chris Wilson 5f1367d611 sna/video: Textured video passthrough no longer relies upon XvMC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-09 09:19:51 +01:00
Chris Wilson 21294eaaf1 sna/video: Expand passthrough support for overlay planes
The passthrough is actually a generic, albeit private, mechanism that
anything can use to pass along a GEM handle for use with Xv.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-09 09:10:33 +01:00
Chris Wilson 86efddd9e4 sna: Remove assertions for mapped GPU bo if priv->cpu after GPU bo creation
The condition that we have a mapped GPU bo iff priv->cpu is only true if
we have a GPU bo at the time of using the CPU -- if we create the GPU bo
during move_to_gpu, then that assertion is bogus.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-08 10:54:56 +01:00
Chris Wilson 678279eb37 2.21.6 release 2013-04-06 15:58:50 +01:00
Chris Wilson 5332d5a7e0 configure: Allow valgrind support to be manually enabled
Irrespective of the DDX debug settings, some people wish to run Xorg
under valgrind and so prefer to have the cleaner output by making the
DDX valgrind aware.

(Actually Maarten wants valgrind support enabled by default...)

Suggested-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-06 15:42:23 +01:00
Chris Wilson 091cf6f047 sna: Improve assertions to detect rogue priv->cpu status
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-06 09:30:57 +01:00
Chris Wilson 4a43aa81e2 sna: Restore bo->flush status for large bo
Since we started discarding the flush flags on cached bo (in order to
prevent DRI flush states leaking), we failed to preserve the flush flag
for large bo (which uses it to keep batches trim and other hints).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-04 10:53:55 +01:00
Chris Wilson ed3dab44a7 sna: Adjust userptr structure for implicit padding
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-02 15:21:17 +01:00
Chris Wilson 4e2fc5aee0 sna: Relax scanline waits on HSW to be emittable from either ring
My overzealous reading of the bspec lead me to the conclusion that the
MI_LOAD_SCANLINES command was only available on the blitter ring. This
is false, thankfully, and allows us to do vsync'ed Xv.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-02 14:29:29 +01:00
Chris Wilson 5a36fdcee7 sna/gen4: Kill stray debugging ErrorF from previous commit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-02 11:01:53 +01:00
Chris Wilson 3d7e16addb sna/gen4: Break the Video rendering loop into 16 rectangle chunks
If we feed more than 16 rectangles into the video rendering pipeline,
the GPU goes crazy and starts emitting corruption. Lalalala.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1162046
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-02 10:58:52 +01:00
Chris Wilson f09aa788d7 DRI2GetMSC: Do not send a bogus ust for when the drawable is not displayed
According to the opengl glx_sync_control spec, the Unadjusted System Time
(or UST) is a 64-bit monotonically increasing counter that is available
throughout the system:
http://www.opengl.org/registry/specs/OML/glx_sync_control.txt

Therefore, sending 0, even in this corner case, is out of spec. However,
we cannot just return FALSE here as that triggers a BadDrawable error to
be sent, and as is often the case mishandled, to the client. This results
in a certain compositor terminating, for example.

As an alternative we can use the monotonic system timestamp which in
theory should also be monotonic with the previous and subsequent vblank
times.

Based on a patch by Daniel Kurtz.

Reported-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-02 10:06:55 +01:00
Chris Wilson 4af622edfc sna: Try to eliminate pending operations to the bo being replaced
When we are replacing a bo with fresh data, we can drop pending
operations to it and thereby reduce the complexity of the replacement.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-01 23:04:29 +01:00
Chris Wilson ef0038d358 sna: Allow the compiler to inline memcpy for the bitblt routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-01 23:04:29 +01:00
Chris Wilson 43181692f7 sna/gen7: Refine is_gt2() for Haswell versus Ivybridge
The two similar chipsets do not use the same PCI-ID encoding schema.

Fixes regression from
commit 235a3981ea
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Mar 26 20:37:14 2013 +0000

    sna/gen7: Use GT2 values for GT2 variants

Reported-by: zaverel@free.fr
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-28 15:44:01 +00:00
Chris Wilson 96c10bdff9 sna/gen7: Resist the temptation to overprogram the number of PS threads for HSW
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-27 22:10:37 +00:00
Chris Wilson 19dfa72c28 sna/gen4+: Set read-write allocation mode for the target render cache
As we often first clear the destination before performing a blend, we
get a performance boost if that first write populates the render cache.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-27 16:58:41 +00:00
Chris Wilson d9b8c2039d sna/gen7: Fix MOCS for Haswell
The memory attributes changed slightly, and in particular there is now
an explicit uncached setting - which of course happened to be the value
currently selected.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-27 16:58:41 +00:00
Chris Wilson 04b2802140 sna/gen7: Restore render acceleration for VLV power-on board
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-27 11:57:18 +00:00
Chris Wilson 2054f43e43 sna/gen7: Prefer spans for GT2 desktop variants
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-27 11:57:18 +00:00
Chris Wilson 235a3981ea sna/gen7: Use GT2 values for GT2 variants
The check was only testing for GT2+ and excluding the normal GT2
devices. See also

commit ce9f044836
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Feb 8 16:01:54 2013 +0000

    sna/gen6: Use GT2 settings for both GT2 and GT2+

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-27 11:57:10 +00:00
Mark Kettenis 3dddb01005 sna: Use a more portable way to determine total RAM size
The sysinfo function is Linux-specific.  sysconf(_SC_PHYS_PAGES), while
not truly portable, is available on many more systems, including Linux,
Solaris, NetBSD, FreeBSD and OpenBSD.  So use that instead.  Verified
that this results in the same value as the sysinfo call on a handful of
Linux systems.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2013-03-26 20:18:10 +00:00
Chris Wilson e63390df52 sna: Add extra '()' around bitwise &/&& for CPU feature detection
By popular demand.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-26 16:32:13 +00:00
Chris Wilson 1d6f4078c1 sna/gen4+: Reorder code to compile on squeeze
Remember to only use sse4_2, avx2 in their restricted sections that
check for compiler support.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-26 16:28:26 +00:00
Chris Wilson 0b479504c8 sna: Check for OS support of AVX/AVX2 before use
If the OS has not initialised support for the extended instructions,
then their use may result in general protection faults.

Based on code by Thiago Macieira.

Reported-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-26 16:17:34 +00:00
Chris Wilson 9620f41907 sna: Fix AVX2 detection
It requires use of the cpuid feature eax=7:ecx=0, so it requires the
extended version of __cpuid  to pass in the subfeature.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-26 15:44:42 +00:00
Chris Wilson da2bd82b0e sna/gen4+: Add a couple more advanced SSE variants for composite vertices
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-26 15:13:32 +00:00
Chris Wilson 86bcf4a9f5 sna: AVX2 is in the ebx result of cpuid
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-26 15:13:28 +00:00
Chris Wilson a5be4210b7 sna: Trim removed fields from execbuffer2 for OpenBSD support
Reported-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-26 09:05:48 +00:00
Mark Kettenis 761ab4124e sna: Fix OpenBSD backlight control implementation
Fix cut'n'paste error such that this actually compiles.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2013-03-26 09:03:58 +00:00
Chris Wilson 0a9b136ec4 Remove the GeneralSocket upon CloseScreen
Be neat and tidy in case we are shutdown but the server is not
regenerated (e.g. a hot-unplug).

Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-25 15:38:58 +00:00
Chris Wilson 6b20924f22 sna: Convert out-of-bounds sample to CLEAR
If asked to perform pixelformat conversion of a sample that resides
outside the valid area, we can simply substitute CLEAR.

Bugzila: http://bugs.freedesktop.org/show_bug.cgi?id=62681
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-23 23:10:50 +00:00
Chris Wilson f6582387e7 sna: Fix an assertion to check the correct bo
After syncing the GPU bo for use, that's what we should test as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-23 10:22:41 +00:00
Chris Wilson 88b6b80c2a sna: Fix assertions that the pixmap points into the CPU bo for fallbacks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-03-22 13:36:16 +00:00
Chris Wilson ccd6b7e402 sna: Add backlight control implementation
Based on the previous patch by Mark Kettenis <kettenis@openbsd.org>
2013-03-22 11:29:53 +00:00