Commit Graph

4361 Commits

Author SHA1 Message Date
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
Zhigang Gong ce7a57994d uxa/dri: Refine the pageflip processing.
Add a new element back_name to intel structure to track
the back bo's name then avoid flink every time.
And at function I830DRI2ExchangeBuffers, after finish
the BO exchange between info's front and back pixmap,
it set the new front bo to the screen pixmap. But the
screen pixmap should be the same as front's pixmap,
so this is a duplicate operation and can be removed.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-02-21 08:40:10 +00:00
Chris Wilson 1a65e2b8a2 sna: Split up/down edge walking in order to handle endpoint clipping
In order to prevent walking upwards off the top of the pixmap when
rendering a clipped vertical edge, we need to tweak the boundary
conditions for the vertical edge walker.

Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=46261
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-21 08:13:25 +00:00
Chris Wilson 7ea4499755 sna: Restore the shadow pixels when reducing CPU damage to all
Reported-by: Joe Nahmias <joe@nahmias.net>
References: https://bugs.freedesktop.org/show_bug.cgi?id=46346
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-20 23:50:42 +00:00
Chris Wilson dbe0580e20 sna: gen4+ suffer no penalty for changing tiling
On gen4, the tiling/fence constraints are fairly lax, only requiring
page alignment of the object and its size, and so we can switch
tiling modes without incurring a GPU stall on active bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-20 16:30:53 +00:00
Chris Wilson b68b76cf54 sna: Move sync'ing of CPU bo after allocation to first write
The idea was that we could afford to allocate an active CPU bo for
copying to from using the GPU and later sync just before we need to
write to the shadow pixels. Having the sync inside the allocation
function potentially causes an unwanted stall.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-20 13:38:11 +00:00
Chris Wilson bbb6794a3b sna: Trim clipped lines to end within bounds
References: https://bugs.freedesktop.org/show_bug.cgi?id=46261
References: https://bugs.freedesktop.org/show_bug.cgi?id=45673
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-20 12:50:18 +00:00
Chris Wilson 805bc3310c sna: When reversing line-drawing direction, use the clipped endpoint
Make sure we take the clipping into account if we choose to reverse the
draw direction (to maintain left-to-right inside the box emission).

References: https://bugs.freedesktop.org/show_bug.cgi?id=46261
References: https://bugs.freedesktop.org/show_bug.cgi?id=45673
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-20 12:10:21 +00:00
Chris Wilson 7f0a4a5f72 sna/dri: Ensure the domain tracking is reset when releasing bo used for swaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-20 09:52:37 +00:00
Chris Wilson 7d147c7462 sna: Correct tile sizes for Y-tiling on i915g
128-byte Y-tiling wasn't introduced until the 945.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-19 17:50:56 +00:00
Chris Wilson 95391b7312 sna/trapezoids: Presume that Precise mono rasterisation adheres to the spec
References: https://bugs.freedesktop.org/show_bug.cgi?id=46156
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-16 22:03:50 +00:00
Chris Wilson 52b11f63d7 sna: Upconvert fallback trapezoids to a8
Since the hardware only handles a8 without tricky emulation and pixman
insists on using a1 for sharp trapezoids we need to ensure that we
convert the a1 to a8 for our trapezoidal mask.

More worryingly, this path should never be hit...

References: https://bugs.freedesktop.org/show_bug.cgi?id=46156
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-16 11:24:21 +00:00
Chris Wilson 8050ced620 sna/dri: Mark bo as reusable after completion of a flip-event
After the flip chain is completed, any residual buffers are no longer in
use and so available for reuse.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 23:40:02 +00:00
Chris Wilson fc046aabde sna/dri: Don't attempt to change tiling if it is a no-op
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 16:08:23 +00:00
Chris Wilson 66cc9c6965 Be paranoid about the definition of container_of
Replace any existing definition with a correct version, since there are
broken container_of macros floating around the xorg includes.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-15 11:58:42 +00:00
Chris Wilson c0376b7f7b Add a missing macro for old xorg/list.h
list_last_entry() needs to be defined if we are including the xorg
list.h as opposed to our standalone variant.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-13 00:48:15 +00:00
Chris Wilson 87bed52180 Include a local copy of list.h
In 1.11.903, the list.h was renamed to xorg-list.h with a corresponding
change to all structures. As we carried local fixes to list.h and
extended functionality, just create our own list.h with a bit of
handwaving to protect us for the brief existence of xorg/include/list.h.

Reported-by: Armin K <krejzi@email.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45938
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-11 21:02:22 +00:00
Chris Wilson c64ebee5fd sna/gen6: Prefer the render ring for copies
Slower for fills, but on the current stack faster for copies, both large
and small. Hopefully, when we write some good shaders for SNB, we will
not only improve performance for copies but also make fills faster on
the render ring than the blt?

As the BLT copy routine is GPU bound for copywinpix10, and the RENDER
copy routine is CPU bound and faster, I believe that we have reached the
potential of the BLT ring and not yet saturated the GPU using the render
copy.

Note that we still do not casually switch rings, so the actual routine
chosen will still be selected by the preceeding operations, so is
unlikely to have any effect in practice during, for example, cairo-traces.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-11 13:34:44 +00:00
Chris Wilson 6a9b501774 sna/gen6: Suppress the CS stall for the first command in the batch
The batch emission serves as a full stall, so we do not need to incur a
second before our first rendering.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-11 11:02:53 +00:00
Chris Wilson cbe8bed83f sna/gen7: Mention the depth-stall required before changing VS state
Because one day we may actually start using VS! Copied from the addition
of the w/a to Mesa by Kenneth Graunke.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-11 10:58:05 +00:00
Chris Wilson 6193f2f00f sna: Fix retire after readback
Upon reading, we encounter a serialisation point and so can retire all
requests. However, kgem_bo_retire() wasn't correctly detecting that
barrier and so we continued to using GPU detiling thinking the target
was still busy.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-09 14:16:17 +00:00
Chris Wilson 4d8369f8e6 sna/gen2+: Force upload rather than perform source transformations on the CPU
If both the source and destination is on the CPU, then the thinking was
it would be quicker to operate on those on the CPU rather than copy both
to the GPU and then perform the operation. This turns out to be a false
assumption if transformation is involved -- something to be reconsidered
if pixman should ever be improved.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-08 13:15:46 +00:00
Chris Wilson 8634d461bd sna: Limit max CPU bo size to prevent aperture thrashing on upload
Copying between two objects that consume more than the available GATT
space is a painful experience due to the forced use of an intermediatory
and eviction on every batch. The tiled upload paths are in comparison
remarkably efficient, so favour their use when handling extremely large
buffers.

This reverses the previous idea in that we now prefer large GPU bo
rather than large CPU bo, as the render pipeline is far more flexible
for handling those than the blitter is for handling the CPU bo (at least
for gen4+).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-08 09:30:12 +00:00
Chris Wilson 5b16972d78 sna: Check that we successfully retired an active linear buffer
If we go to the trouble of running retire before searching, we may as
well check that we retired something before proceeding to check all the
inactive lists.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-08 09:16:47 +00:00
Chris Wilson 207b4d4482 sna: Relax must-be-blittable rules for gen4+
The render pipeline is actually more flexible than the blitter for
dealing with large surfaces and so the BLT is no longer the limiting
factor on gen4+.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-08 09:16:47 +00:00
Zhigang Gong 13c960db9e uxa/glamor: Use a macro to specify module name.
This depends upon glamor commit b5f8d, just after the 0.3.0 tag.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-08 09:07:42 +00:00
Zhigang Gong 70092bfbc5 uxa/glamor: Refine CloseScreen and InitScreen process.
The previous version calls glamor_egl_close_screen and
glamor_egl_free_screen manually which is not align with
standard process. Now glamor change the way to follow
standard method:

glamor layer and glamor egl layer both have their internal
CloseScreens. The correct sequence is after the I830CloseScreen
is registered, then register glamor_egl_close_screen and
the last one is glamor_close_screen. So we move out the
intel_glamor_init from the intel_uxa_init to I830ScreenInit
and just after the registration of I830CloseScreen.

As the glamor interfaces changed, we need to check the
glamor version when load the glamor egl module to make
sure we are loading the right glamor module. If
failed, it will switch back to UXA path.

This depends upon glamor commit 1bc8bf tagged with version 0.3.0.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-08 09:07:42 +00:00
Chris Wilson 798aad6c95 sna/gen[4-7]: Fix erroneous scale factor for partial large bo render copies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-07 20:16:48 +00:00
Chris Wilson ea65887261 sna: Apply offsets correctly for partial src/dst in large copy boxes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-07 15:32:31 +00:00
Chris Wilson 14c91e1084 sna/tiling: Request Y-tiles if we know we cannot BLT to either the src or dst
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-07 15:32:31 +00:00
Chris Wilson 3131217e3e sna: Mark up the temporary allocations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-07 14:36:21 +00:00