[Xcb] mesa and xcb (vendor ops)

Jeremy Kolb jkolb at brandeis.edu
Fri Jul 22 22:21:21 EST 2005

Quoting Jamey Sharp <jamey at minilop.net>:

> On Thu, 2005-07-14 at 22:37 -0400, Jeremy A. Kolb wrote:
>> I'm looking into getting more of mesa moved onto xcb.  There are quite a
>> few functions I need to do but one thing we need is the iovec (I think
>> that's what it was) stuff for transporting.  There's an entry on the TODO
>> page on the wiki for it, but I'm stuck until it's done ...
> You don't need to be stuck: the iovec interface is only an optimization.
> Of course folks doing OpenGL care about performance, but for a proof of
> concept you can use the current interface.
> The general pattern that the iovec interface is supposed to help with is
> this: you have some XCB request that contains a list, and you have a
> small header and a giant array of data that you need to pack into that
> list. You can accomplish this basically the same way Mesa does now: grab
> a chunk of memory as big as the header plus the data, and copy. For
> example, this should basically work for some hypothetical request with
> an CARD32 for the header:
>        char *buf = malloc(4 + data_len);
>        memcpy(buf, &header, 4);
>        memcpy(buf + 4, data, data_len);
> There's code that looks just like this all over indirect.c, except that
> code allocates space out of a giant buffer that I think is basically
> global to the application.
> The iovec interface should actually be a performance improvement over
> Xlib-based Mesa for large arrays since it has the potential to avoid all
> data copies right down to the kernel. But don't bother worrying about it
> right now: the lack of iovec support shouldn't stop your porting
> efforts. I think I can implement it if Josh doesn't beat me to it, but I
> sure hope he will. :-)
> --Jamey

Thanks Jamey.  I'll play with it this weekend and see if I can work something


More information about the xcb mailing list