[Mesa-dev] u_blitter cpu/gpu stall

Marek Olšák maraeo at gmail.com
Tue Nov 23 05:46:24 PST 2010

Hi Dave,

I think Keith is right. It's very likely that some application will use the
same slow path u_blitter uses, so it makes sense to fix it in the driver
instead. I believe r300g has exactly the same problem, we just manage to
hide it for u_blitter by overriding the u_blitter::draw_rectangle callback
with very lightweight r300_blitter_draw_rectangle. That function 1) does not
care about vertex buffers at all, 2) uses immediate mode directly with the
position and coordinates (or color) passed as function parameters, and 3)
draws a rectangular point sprite, which is the most efficient way to draw a
quad on r300.

So for r600g, I see 3 options:
1) Overriding u_blitter::draw_rectangle and possibly implement the fastest,
hw-specific path.
2) Instead of creating a new vertex buffer for every draw operation in
u_blitter, I prefer using PIPE_TRANSFER_DISCARD, which should be equivalent
and is nicer. Please see the attached patch.
3) Fix it once and for all by implementing pipelined buffer transfers in
r600g (and possibly in r300g too).

(3) is inevitable if we ever want to compete with fglrx.
I'll probably commit (2) (the attached patch). Dave, does it fix the problem
for you?

Best regards

On Tue, Nov 23, 2010 at 5:06 AM, Dave Airlie <airlied at gmail.com> wrote:

> Hi Marek,
> So I was looking at some perf traces from r600g, and I see a stall on
> the blitter quad vbuf, every clear will cause the CPU to block on the
> mapping of the vbuf to upload the new coords. On r300g I can see this
> not mattering as the immediate upload path takes care of things,
> however I think we should probably do something like the attached and
> fire and forget the vertex buffer.
> Dave.
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20101123/42a77a7e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-u_blitter-use-PIPE_TRANSFER_DISCARD-to-prevent-cpu-g.patch
Type: application/pgp-keys
Size: 1355 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20101123/42a77a7e/attachment.key>

More information about the mesa-dev mailing list