Commit Graph

6738 Commits

Author SHA1 Message Date
Chris Wilson 2b97237676 sna: Do make a clone of a GPU bo that is itself a cache
As we do not attempt to undo the cache status upon the clone.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-24 12:57:19 +01:00
Chris Wilson dbe2b5896e sna: Correct assertion for reusing COW
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47597
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-24 12:05:00 +01:00
Chris Wilson 2005b273e1 sna: Check for NULL damage before dereferencing
Fixes regression from
commit 16a64649e9 [2.21.7]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri May 10 15:48:58 2013 +0100

    sna: Basic copy-on-write support for cloning pixmaps

Reported-by: Axel Rohde
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-24 11:03:42 +01:00
Chris Wilson ee7ea10148 sna: Only flags the PolyFillRect as REPLACES if it is unclipped
Otherwise we discard a fill operation that is required to initialise the
pixmap before drawing commences.

Fixes regression from
commit ef9dc6fae5 [2.21.7]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon May 20 11:08:51 2013 +0100

    sna: Undo a few more overwritten operations upon a bo

Reported-by: Matti Hamalainen <ccr@tnsp.org>
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64841
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-23 12:58:01 +01:00
Chris Wilson 87295b1ef8 sna: Remove the overzealous assert
IGNORE_CPU is sometimes only set when there is CPU damage to ignore...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-22 09:44:13 +01:00
Chris Wilson f2e0454f2d sna: Fix DBG typo and so fix build with --enable-debug
s/hint/flags/ -- used the wrong variable name in an assert and upset the
compiler.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-22 09:00:25 +01:00
Chris Wilson abe85adda5 sna: Warn about the consequences of disabling tiling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-21 13:40:09 +01:00
Chris Wilson 195a51353c sna/video: Convert to a pure Xv backend
This is to enable feature work which requires access to Client state.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-21 11:14:52 +01:00
Chris Wilson 8e42637050 sna: Re-enable read-read optimisations
Coacher is optimistic that the issue is no longer reproducible on his
machine - and whilst I do not understand the root cause, I am confident
that the kernel code is correct as is our use.

References: https://bugs.freedesktop.org/show_bug.cgi?id=61628
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-21 11:14:52 +01:00
Chris Wilson e65ee10dfd 2.21.7 release 2013-05-21 11:01:50 +01:00
Chris Wilson ef9dc6fae5 sna: Undo a few more overwritten operations upon a bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-21 09:31:55 +01:00
Chris Wilson d6c30d1d4d sna: Clear the cow_list when discarding the clone upon pixmap destroy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-17 12:12:07 +01:00
Chris Wilson 21f1745565 sna: Add the missing ref(bo) when undoing the source clone
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-05-17 12:12:07 +01:00
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
Rodrigo Vivi 3ee42de066 Adding more reserved PCI IDs for Haswell.
As Chris mentioned there is a tendency for us to find out more
PCI IDs only when users report. So let's add all new reserved Haswell IDs.
I didn't have better names for this reserved ids and didn't want to use rsvd1
and rsvd2 groups, so I decided to use "B" and "E" that stands for the last
id digit.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-05-14 09:34:58 +01:00
Rodrigo Vivi ee96de8b1e Fix Haswell GT3 names.
When publishing first HSW ids we weren't allowed to use "GT3" codname.
But this is the correct codname and Mesa is using it already.
So to avoid people getting confused why in Mesa it is called GT3 and here
it is called GT2_PLUS let's fix this name in a standard and correct way.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2013-05-14 09:34:42 +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 ab576a4265 Add all reserved PCI-IDs for Haswell
There is a tendency for a product to ship based on a 'reserved' PCI-ID
prior to us being notified about it. In other words, the first we find
out about such a product is when customers start complaining about their
shiny new hardware not being supported...

References: https://bugs.freedesktop.org/show_bug.cgi?id=63701
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-27 12:09:07 +01:00
Chris Wilson 7dfb359677 uxa/dri: Fix compile error for unknown 'bool'
It appears that it is only accidentally pulled in on some systems, but
not all.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63957
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-04-26 13:22:01 +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