Commit Graph

3205 Commits

Author SHA1 Message Date
Chris Wilson 33b2ea0392 sna: Avoid using the BLT to copy between mismatching depths
We either conflated bpp (which fails given a mixture of depth-24 and
depth-30 pixmaps) or neglected to check at all.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 11:46:36 +01:00
Chris Wilson 28f6dc24d3 sna: Support depth-30 and some more logging to show the depth
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 11:24:59 +01:00
Xiang, Haihao 312460ea69 Xv: set up pipeline for Xv on Ivybridge
The configuration is same as that on Sandybridge, but
many state commands are changed

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:19 +08:00
Xiang, Haihao 90a0800588 Xv: upload new shaders to GEM objects for Xv on Ivybridge
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:16 +08:00
Xiang, Haihao 00614f712b Xv: update SURFACE_STATE & SAMPLER_STATE for Xv on Ivybridge
SURFACE_STATE & SAMPLER_STATE are changed since Ivybridge

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:13 +08:00
Xiang, Haihao 70f884772a Xv: New shaders for Xv on Ivybridge
Redefine some M4 macros, also update the check for
intel-gen4asm to support Ivybridge

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:10 +08:00
Xiang, Haihao 3cf423bd3a Xv: separate fragments from M4 macros
It is to prepare for Xv on Ivybridge. The difference from Sandybridge
is that all message payload must be in GRF registers instead of MRF registers
on Ivybridge. We will only redefine some M4 macros for Ivybridge

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-06-24 09:42:07 +08:00
Chris Wilson 58d7a89b93 sna: Don't render to invalid surfaces
Fixes a regression from d0362a. In bypassing the is_wedged checked, we
also ended up bypassing the checks that we could indeed render to the
target bo. With the result that we were creating GPU buffers for SHM
surfaces, something that requires Xserver fixes before we can actually
enable...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 00:35:30 +01:00
Chris Wilson 3c1d5bc35e sna: Clip the fbcon to the frontbuffer
...both to correct the placement of the fbcon into the smaller scanout and
to ensure that we correctly clip the boxes to be copied.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-24 00:34:11 +01:00
Chris Wilson e3b4c10f23 sna: Relent and workaround the lack of O_NONBLOCK on /dev/dri/card0
So in order not to block server shutdown, check that the fd is readable
before attempting to read from it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-23 20:56:03 +01:00
Chris Wilson 33d3077266 sna: Debug compile fix, and some extra comments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-23 15:55:47 +01:00
Chris Wilson 03e6aee8fd sna: For an unbounded op, we need to convert the whole surface
Otherwise if we fail to check, then we create a 0x0 surface to sample
with the operation -- net result is that we end up using a clear source
instead of the desired mask.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-23 15:55:47 +01:00
Adam Jackson 356ded1308 Don't include xf86Priv.h
I'd like it to not be in the SDK anymore, and we're not using anything
from it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-22 22:39:37 +01:00
Chris Wilson ea71133da7 sna/video: Use pwrite for upload of unclipped, unrotated frames
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-22 11:04:56 +01:00
Chris Wilson 2f6afb5b1f sna: Only reduce gpu damage after migration
Otherwise we end up doing work for no reason, ala the regression in
grads-heat-map. However, it is important that the damage is reduced at
some point or else it may grow unbounded. Hopefully normal usage will
never hit the pathologocial case...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-20 17:31:23 +01:00
Chris Wilson 88d840b53d sna/gen4: Check for sufficient batch space before emitting pipelined pointers
For the broken shader workaround, we need to reset the pipeline state
before every blt as the state is changed by the magic CA pass. So we
need to check that we actually have sufficient space to emit the
pipelined pointers before doing so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-20 15:42:55 +01:00
Chris Wilson 84bd6e5119 sna/gen4: Correct the number of dwods required to emit the ca pass
We need 7 for pipelined pointers, 6 for the primitive and 1 for the
flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-20 15:22:00 +01:00
Chris Wilson 22255335e4 sna: Don't perform a GPU copy of the scanout if it is wedged.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-20 13:51:23 +01:00
Chris Wilson e2684498a4 sna: Add some debugging asserts for handling wedged GPUs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-20 13:51:22 +01:00
Chris Wilson d0362a20bb sna: Bypass the gpu-is-wedged? check for forced bo creation
In order to attach a scanout (and use swrast) on a wedged GPU, we need to
bypass the safety checks for normal pixmap creation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-20 13:49:16 +01:00
Chris Wilson de0286ed9f sna/display: After copying the fbcon, tell the server that we have a background
... so that the core knows to skip the clear.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-17 09:44:06 +01:00
Chris Wilson f3869d60cc sna/display: Apply damage for the fbcon copy
... so that any immediate shadow usage will read back the fbcon
contents.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-17 09:37:15 +01:00
Chris Wilson 39f0b0ae17 sna: Copy the fbcon contents onto the front buffer upon X startup
This patch has been carried by the distributions every since they
started doing graphical boot splashes. Time to integrate it and give it
some TLC.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-17 09:20:33 +01:00
Chris Wilson 37ba33f502 sna: Fix kgem_create_from_name error paths and to mark the bo as non-reusable
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-17 07:03:25 +01:00
Chris Wilson 665bc17357 sna/display: Remove the caching of the drmModeCrtc
We only use it for the id. Everything else stored on it, like the
buffer_id, is not permanent and we need to query the current status as
required.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-17 07:03:05 +01:00
Chris Wilson ad6235cfb1 sna/accel: convert BOX_ADD_RECT to an inline function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 19:25:41 +01:00
Chris Wilson a86f43988c sna/accel: convert BOX_ADD_PT to an inline function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 19:21:47 +01:00
Chris Wilson f67a26590a sna/accel: convert TRIM_AND_TRANSLATE_BOX to an inline function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 19:21:47 +01:00
Chris Wilson df1b117ded sna/accel: convert TRANSLATE_BOX to an inline function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 19:21:47 +01:00
Chris Wilson 76ff3c715c sna/accel: convert TRIM_BOX to an inline
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 19:21:47 +01:00
Chris Wilson e4a66368e7 sna/accel: convert CLIP_BOX to an inline function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 19:21:46 +01:00
Chris Wilson d7b51cc5d6 sna/accel: convert BOX_EMPTY macro to an inline function
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 19:18:19 +01:00
Chris Wilson 1c3c08e80f sna: Fix the typo in BOX_EMPTY
BOX_EMPTY(&box) surprisingly compiles and generates interesting code that
evaluates to if (0). Oops.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 18:38:51 +01:00
Chris Wilson 17bf0019b6 sna: Only retire requests after IO if the bo was active
We only want to process retirements if we know we caused a stall waiting
for the GPU to release the bo before performing IO.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 14:26:06 +01:00
Chris Wilson b707f18d17 sna: Purge the bo cache only if we detect aperture thrashing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 14:16:06 +01:00
Chris Wilson dd4ad11e0d sna: compile fix.
A pox on all those who write trivial patches, attempt to compile on a
system not having dri2proto and just assume that all is good.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 12:53:22 +01:00
Chris Wilson 2ff36af7e1 sna/accel: Prevent initialising a region with an invalid box
pixman complains if you attempt to use a region created with an invalid
box, so don't do that.

Reported-by: Reinhard Karcher <reinhard.karcher@gmx.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 11:24:39 +01:00
Chris Wilson 3c02110052 sna/dri: Add some comments to explain the choice of flags upon the bo
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-16 10:30:58 +01:00
Chris Wilson 881f961a1c sna: Clear the gpu flag once is not busy and no flush is pending
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-15 19:11:05 +01:00
Chris Wilson a1ee4b9308 sna/dri: And fix the blit swap paths
Following on the recent successes with the pageflip paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-14 23:46:15 +01:00
Chris Wilson 2f675cf402 sna: Split zaphod across the crtcs
Since we have no global resource allocator for zaphod mode, that's what
RandR-1.4 solves, we have to further constrain zaphod mode to only use
one crtc per screen. This also means that you must match the output
restrictions within the Screen definitions, noting that the crtc pipe id
corresponds with the screen number.

Reportede-by: Phillp Haddad <phillip.haddad@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-14 08:22:20 +01:00
Chris Wilson 49f265915a sna: Compile fix for debugging enabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-14 08:22:20 +01:00
Chris Wilson 4173ca344b sna: Invalidate the mode if the front pixmap was swapped whilst blanked
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-13 22:34:15 +01:00
Chris Wilson 2158534421 sna/dri: Accurately track front and pending front for async flips
By not tracking the front buffer correctly, i.e. performing the exchange
on every swap, GL_FRONT was no longer pointing at the updated buffer and
neither was the root pixmap. So both X and GL would read the wrong
buffer was the flip was pending.

The other issue was that we would feed the old front buffer back to the
application as a future back buffer (due to buffer caching) and so the
kernel would duly insert a WAIT_EVENT for the pending flip to complete
before allowing rendering to affect it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-13 22:02:08 +01:00
Chris Wilson 2facaa9107 sna/dri: Complete the pending async flip even after DrawableGone
If the client exits before the async page-flip completes then we still
need to decrement the pending flip count in order to correctly flip the
scanout next time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-13 11:46:04 +01:00
Chris Wilson 8688872390 sna: Just do a pointer exchange when flipping with no scanout
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-12 22:30:31 +01:00
Chris Wilson b881d1b16a sna: Check that the scanout is still attached before waiting for scanline
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-12 20:13:26 +01:00
Chris Wilson bb08e73c55 sna: Prevent tracking scratch pixmaps on older xservers
Before the xserver is patched to send notification of release of the
scratch pixmaps, we cannot associated GPU resources with them. In
practice, the only advantage for doing so is for SHM pixmaps...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-12 20:12:55 +01:00
Chris Wilson ff262aca9c sna/dri: Fix tripple-buffering for vblank_mode=0
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-12 10:44:18 +01:00
Chris Wilson b199bc2b41 sna/dri: Skip querying current msc for immediate swaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-11 10:01:13 +01:00