Commit Graph

4814 Commits

Author SHA1 Message Date
Chris Wilson a438e4ac9b sna: Revamp vmap support
Dust off the kernel patches and update to reflect the changes made to
support LLC CPU bo, in particular to support the unsynchronized shadow
buffers.

However, due to the forced synchronisation required for strict client
coherency we prefer not to use the vmap for shared pixmaps unless we are
already busy (i.e. sync afterwards rather than before in the hope that
we can squash a few operations into one). Being able to block the reply
to the client until the request is actually complete and so avoid the
sync remains a dream.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-01 21:19:22 +00:00
Chris Wilson 272f5d9f84 sna: Discard use of inplace GTT uploads on LLC architectures
As the buffer is cache-coherent, we can read as well as write to any
partial buffer so the distinction is irrelevant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-03-01 15:17:49 +00:00
Chris Wilson 43b1a717ba sna: Sort the partial buffers after stealing a write buffer
It will be decoupled and not used again, but this keeps the sanity
checks happy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 13:37:14 +00:00
Chris Wilson 8198e5872c sna/gen3: Tweak glyph rendering fast paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-28 10:51:49 +00:00
Chris Wilson 3c4f29820b uxa/gen3: Remove special casing of solid pictures
Fixes use of alpha-groups and opacity masks in cairo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 16:28:41 +00:00
Chris Wilson 8f3066f0c7 sna/gen2; Initialise channel.is-opaque for fills
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 15:32:09 +00:00
Chris Wilson 3640a0d4cb Revert "meh"
This reverts commit 4adb6967a8.

Oops, this debugging commit was not intended to be pushed along with the
bugfix. :(

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 12:29:15 +00:00
Chris Wilson 6fd8d74a6a sna: Upload the ordinary partial buffers!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 12:21:59 +00:00
Chris Wilson 4adb6967a8 meh 2012-02-27 11:36:35 +00:00
Chris Wilson 4fbb0baff5 sna: Avoid reusing mmapped partial write buffers for readback
An artefact of retaining the mmapped partial buffers is that it
magnified the effect of stealing those for readback, causing extra
writes on non-llc platforms.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-27 09:15:05 +00:00
Chris Wilson a3c398a673 sna: Retain unfinished partial buffers between batches
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-25 12:50:19 +00:00
Chris Wilson 8d773b88f4 sna/gen3+: Keep the vertex buffer resident between batches
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-25 12:50:19 +00:00
Chris Wilson 8cb773e7c8 sna: Ensure we trigger a retire for search_linear_cache
Bo used for batch buffers are handled differently and not tracked
through the active cache, so we failed to notice when we might be able
to run retire and recover a suitable buffer for reuse. So simply always
run retire when we might need to create a new linear buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-25 11:42:16 +00:00
Chris Wilson b1b4db8942 sna: Skip a tiled bo when searching the cache for a linear mmap
If we change tiling on a bo, we are effectively discarding the cached
mmap so it is preferable to look for another.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-25 00:43:30 +00:00
Chris Wilson 85e48d2e5e legacy: Rename XF86DRI to HAVE_DRI1 to avoid conflicts with xorg-server.h
We use the XF86DRI as a user configurable option to control whether to
build DRI support for i810, but it is also used internally within xorg
and there exists a public define in xorg-server.h which overrides our
configure option. So rename our define to HAVE_DRI1 to avoid the
conflict.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46590
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 21:40:44 +00:00
Chris Wilson 96db90e819 legacy: Delete unused XF86DRI_DEVEL #define
References: https://bugs.freedesktop.org/show_bug.cgi?id=46590
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 21:36:30 +00:00
Chris Wilson b870a3e5cd configure, NEWS: Bump version to 2.18.0 for release
Another quarter, a bit late as I was debugging a few regressions,
another release.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 11:27:01 +00:00
Chris Wilson 5b5cd6780e uxa: Add a option to disable the bo cache
If you are suffering from regular X crashes and rendering corruption
with a flood of ENOSPC or even EFILE reported in the Xorg.log, try
adding this snippet to your xorg.conf:

Section "Driver"
  Option "BufferCache" "False"
EndSection

References: https://bugs.freedesktop.org/show_bug.cgi?id=39552
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-24 11:19:58 +00:00
Gaetan Nadon f8ca50818c Revert "Update autotools configuration"
This reverts commit 9184af921b.

All X.Org modules must be able to be configured with autoconf 2.60.
In addition, version 2.63 has GPL licensing issues which prevents
some vendor to release software based on it.

The AM_SILENT_RULES are already handled by XORG_DEFAULT_OPTIONS.

All X.Org modules must be able to be configured with libtool 1.5.

AM_MAINTAINER_MODE default value is "enabled" already.

We use the same autogen script for all x.org modules.
There are proposals for changes which should be reviewed and eventually
applied to all modules together.

The lt*.m4 patterns are already included in the root .gitignore file.
This can be proposed as a change to all modules, but it invloves
changing the topvel .gitignore, the m4/.gitignore, the ACLOCAL_AMFLAGS
and the AC_CONFIG_MACRO_DIR together.

For more information on project wide configuration guidelines,
consult http://www.x.org/wiki/ModularDevelopersGuide
and http://www.x.org/wiki/NewModuleGuidelines.

Acked-by: Matthieu Herrb <matthieu.herrb@laas.fr>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2012-02-23 14:43:34 -05:00
Chris Wilson a647aff512 sna/gen3: Silence the compiler complaining with DBG enabled
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 12:04:09 +00:00
Chris Wilson cd3a618f58 sna/gen4 Refactor get_rectangles() to re-emit state after a flush
Condense the work performed by each caller into the callee.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 11:40:44 +00:00
Chris Wilson 6a3fa4d1b6 sna/gen7 Refactor get_rectangles() to re-emit state after a flush
Condense the work performed by each caller into the callee.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 11:36:48 +00:00
Chris Wilson fe914eaca4 sna/gen5 Refactor get_rectangles() to re-emit state after a flush
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 10:51:25 +00:00
Chris Wilson 4ecf882c83 sna/gen6: Refactor get_rectangles() to re-emit state after a flush
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 10:51:22 +00:00
Chris Wilson dfa21713c2 sna/gen3: Refactor get_rectangles() to emit composite state and retry
As gen3 only uses the single state emission block, and uniformly calls
get_rectangles(), we can move that caller protocol into the callee.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 10:28:47 +00:00
Chris Wilson a48e6e0db9 sna/gen3+: Force a batch flush when run out of CA vbo
As we prematurely end the batch if we bail on extending the vbo for CA
glyphs, we need to force the flush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 10:28:47 +00:00
Chris Wilson 57c19b10db sna: Use a CPU mapping if the bo is already in the CPU domain
The heuristic of using the mapping only before the first use in an
execbuffer was suboptimal and broken by the change in bo initialisation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-23 09:49:49 +00:00
Chris Wilson 510767e213 sna/gen4: Fix vertex flushing across batch flushing
Due to the w/a for its buggy shaders, gen4 is significantly different
that backporting the simple patch from gen5 was prone to failure. We
need to check that the vertices have not already been flushed prior to
flushing again.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 21:02:43 +00:00
Chris Wilson f6392048e3 sna/blt: Avoid clobbering the composite state if we fail to setup the BLT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 17:12:24 +00:00
Chris Wilson 4e86da64be sna/gen3+: Flush the vertices during vertex-finish
But only when finishing the vbo, which is the tricky part of the recent
CA glyph bugs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 16:41:36 +00:00
Chris Wilson 71512b2438 sna: Clear the flush flag on release of scanout/dri
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46445
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 13:44:41 +00:00
Chris Wilson 025d3d46dc sna/trapezoids: Only the inplace PictOpIn is unbounded
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 13:17:01 +00:00
Chris Wilson b02f866d67 sna: Ensure we restore the shadow pixels before uploading CPU data
Reported-by: Joe Nahmias <joe@nahmias.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46425
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 09:15:25 +00:00
Chris Wilson be5df7b5ab sna/gen5: Remove CA glyph workaround
The root cause has been found and destroyed, so the w/a is now
redundant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 23:27:33 +00:00
Chris Wilson 6038cede83 sna/gen3+: Re-emit composite state after flushing CA vertices
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42891
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 23:24:57 +00:00
Chris Wilson fe6602cbbc sna/gen3+: Only flush the vertices after checking for end-of-batch
Or upon actually closing the vertex buffer.

However, the underlying issue remains. That is we are failing to re-emit
the first-pass for CA text after flushing the vertex buffer (and so
emitting the second-pass for the flushed vertices).

Reported-by: lemens Eisserer <linuxhippy@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=42891
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 21:40:40 +00:00
Chris Wilson 168c87a340 sna: Clear the scanout flag after releasing the scanout pixmap
In the future, this will be a good place to restore the cache level of
the bo as well.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 16:41:53 +00:00
Chris Wilson d7415742a5 sna/dri: Queue a flush on the back DRI2 when enqueing a flip
As we may wait upon the bo having finished rendering before we can
execute the flip, flushing the render cache as early as possible is
beneficial

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 16:37:45 +00:00
Chris Wilson 2715a455f7 uxa: Prevent laggy applications by throttling after rendering
Before blocking and waiting for further input, we need to make sure that
we have not developed too large a queue of outstanding rendering. As we
rendering to the front-buffer with no natural throttling and allow X
clients to render as fast as they wish, it is entirely possible for a
large queue of outstanding rendering to develop. For such an example,
watch firefox rendering the fishietank demo and notice the delay that
can build up before the tooltips appear.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 14:49:30 +00:00
Chris Wilson 26721893cb sna: Mark the pixmap as active for the force-to-gpu short-circuit
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 13:31:16 +00:00
Chris Wilson 1541f1afca sna: Skip the CPU synchronization when marking a pixmap as inactive
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 13:17:35 +00:00
Chris Wilson 74fd55a96b sna/dri: Ensure that we reattach to the DRI2 front buffer after modeswitch
If we change the Screen pixmap due to a change of mode, we lose the
flag that we've attached a DRI2 buffer to it. So the next time we try to
copy from/to it, reassert its DRI2 status.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 13:11:32 +00:00
Chris Wilson d051793b91 sna/dri: Improve error handling of failing to create a DRI2 pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 11:48:04 +00:00
Chris Wilson 580ae520ca sna: Short-circuit repeated calls to force-to-gpu
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 11:29:42 +00:00
Chris Wilson f2aafb9802 uxa: Silence compiler warning for const arguments
i965_video.c: In function 'gen6_create_cc_state':
i965_video.c:1374:12: warning: passing argument 4 of
'intel_bo_alloc_for_data' discards 'const' qualifier from pointer target
type [enabled by default]

Repeated ad nauseam.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 11:29:42 +00:00
Chris Wilson 507f72d6d4 uxa: Remove DPRINTF stubs
It wasn't being used for anything non-trivial and was throwing compiler
warnings, so remove it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 11:29:41 +00:00
Chris Wilson c72a67390e sna/dri: Update for AsyncSwap interface changes
We now need to return TRUE/FALSE depending on whether we need to
invalidate the drawable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 11:29:41 +00:00
Chris Wilson 27bc2acf0e sna: Fix use of RegionInit() for singular regions
For a singular region, we want to use a value for nboxes of 0 not 1,
fortunately if you pass in a box, it ignores the value of nboxes.
RegionInit() is a most peculiar API!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 09:31:24 +00:00
Zhigang Gong d98b41ce43 uxa/glamor/dri: Should fixup the drawable pixmap.
Two fixes in this commit, first we only need to check the
front left buffer, for other attachment we don't need to
check them. The second is, we should fixup the pixmap's
drawable not the original drawable.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 08:42:54 +00:00
Zhigang Gong 1e0d702c3a uxa/glamor/dri: Enable the pageflip support on glamor.
To support easy buffer exchange at glamor layer, glamor
added a new API glamor_egl_exchange_buffers() to exchange
two pixmaps' EGL image and fbos and textures without
recreating any of them. But this simple method's requirement
is that there are two pixmaps. A exceptional case is:
If we are using triple buffer when do page flipping, we
will have an extra back_buffer which doesn't have a pixmap
attached to it. Then each time we set that buffer to a
pixmap, we will have to call the create_egl_textured_pixmap
to create the corresponding EGL image and fbo and texture
for it. This is not efficient.

To fix this issue, this commit introduces a new back_pixmap
to intel structure to hold the back buffer and corresponding
glamor resources. Then we will just need to do the light
weight buffer exchanging at both DDX and glamor layer.

As the new back pixmap is similar to the screen pixmap
and need to be handled carefully when close screen. As the
glamor data structure is a per screen data, and will be
released at its close screen method. The glamor's close
screen method must cleanup the screen pixmap and back
pixmap's glamor resources. screen pixmap is easy to get,
but there is no good way to store the back pixmap.

So the glamor add a new API glamor_egl_create_textured_screen_ext
function to pass the back pixmap's pointer to glamor layer.

This commit make us depend on glamor commit: 4e58c4f.
And we increased the required glamor version from 0.3.0 to 0.3.1

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 08:42:12 +00:00