Commit Graph

2879 Commits

Author SHA1 Message Date
Chris Wilson ee166ca856 sna: Undo the clone when replacing the DRI pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-17 11:30:46 +01:00
Chris Wilson 8d31fe771b sna: Transfer ownership of the cloned bo to the pixmaps
Fix the leak from the previous commit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-17 11:15:05 +01:00
Chris Wilson 5d9315873e sna: Avoid replacing pinned bo when undoing a clone
Otherwise we end up cloning the scanout only to leave it dangling if the
client copies the from the front-buffer and then writes to it.

Reported-by: Nick Bowler <nbowler@draconx.ca>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64675
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-17 11:06:10 +01:00
Chris Wilson 3efe143e36 sna: Clear mapped hints upon cloning a pair of pixmaps
Once cloned, we do not want to use inplace operations and instead force
a copy. However, if we do not relinquish the hints when copying across
the bo, then those hints become stale and lead to corruption.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-17 11:06:09 +01:00
Chris Wilson f57a65c352 sna: Correct assertions to allow discarding of cpu hint for inplace ops
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-14 16:19:45 +01:00
Chris Wilson bb0969e6a5 sna: Assert that the mapping is released before closing the GEM handle
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-14 16:19:45 +01:00
Chris Wilson 16a64649e9 sna: Basic copy-on-write support for cloning pixmaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-14 14:29:32 +01:00
Chris Wilson d89b2647dc sna: Propagate clears when using the BLT composite routines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-14 11:09:19 +01:00
Chris Wilson 810a0ce2f8 sna: Propagate clear color when replacing by a CopyArea
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-14 09:37:26 +01:00
Chris Wilson 07a4400fff sna: Attempt to discard overwritten operations before CopyArea
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-14 09:37:26 +01:00
Chris Wilson 979d2f8d00 sna/gen4: Tidy testing for an active vertex buffer id
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-14 09:23:31 +01:00
Chris Wilson 7ba6330705 sna/gen4: Drop unused gen parameter to SF state setup
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-14 09:23:31 +01:00
Chris Wilson 2217f6356b sna/trapezoids: Fix the determination of the trapezoid origin
"src-x and src-y register the pattern to
the floor of the top x and y coordinate of the left edge of the
first trapezoid,"

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1178020
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-09 13:49:56 +01:00
Chris Wilson 6e98df06fa sna: Add more debugging to unaligned trapezoids
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-09 13:49:56 +01:00
Chris Wilson 5d62ec2593 sna/gen7: Add DBG for channel setup for render source
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-09 13:49:56 +01:00
Chris Wilson debdcd6a09 sna: Add DBG statements for choice of spans vertex emitter
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-09 13:49:56 +01:00
Chris Wilson c6e4088dcb sna: Handle cached upload buffers for partial migration to GPU
Since the extended use of move_area_to_gpu for partial migration of
render sources, we exposed the lack of handling of upload caches along
that path.

Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-09 11:32:07 +01:00
Chris Wilson 262ee1ef1e sna: Do not attempt to clean an active scanout
For simplicity, skip buffers that are still in use by the batch - they
will be removed later.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-07 10:38:12 +01:00
Chris Wilson 5637c173f8 sna: Be careful not to preemptively upload portions of a SHM pixmap
Only upload the portion of the pixmap being used for this rendering
operation, as outside of that may remain undefined and to be written by
the client before a future operation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-01 16:14:09 +01:00
Chris Wilson ca4a32c20d sna: Page align requests to userptr
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-01 16:14:09 +01:00
Chris Wilson 8eaafdb439 sna: Prevent accessing an uninitialised region in move_area_to_gpu()
If we skip the migration, we need to avoid using the unitialiased
region. There is no bad consequence as both branches of the if are
no-ops, but it does silence the static checkers and should make the
predicate cheaper.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-24 16:06:36 +01:00
Chris Wilson b4871f1dac sna: Rephrase initialisation without a specific backend
"generic" sounds more impressive than "no"

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-18 09:51:39 +01:00
Chris Wilson 6668f68054 Revert "xgvevent"
This reverts commit ddd75d6539.

This is a WIP patch, not ready for upstream. The danger of mixing topic
branches.
2013-04-17 15:32:58 +01:00
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 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