Hi all, There have been discussion on irc and elsewhere about the need or not of an object describing a render buffer (could be scan-out buffer or or other specialized card render buffer: color buffer, zbuffer, ...). This would mostly act as a wrapper around BO.
Here is what i can imagine as an interface for this: - RenderCreate(properties) - RenderMapLinear - RenderMap - RenderUnmap - Renderunreference Properties would be a set of common properties like: - width - height - bit per pixel - pitch - scan out buffer And also driver private properties like: - compressed in this weird specific format - ... At creation you give a set of properties and you can't change them afterward (well i think it's good enough rules). For what this could be use full ? Well first it would be very useful for mode setting as we can then just have a place where constraint on scan out buffer memory layout are properly checked. Right now we just blindly trust user space to provide a big enough buffer. This could also be use full for creating render buffer making cmd checking a lot easier (as we would have access to width, height, pitch or whatever information is needed to make sure that we have a proper target for our rendering command. Also we could offer common interface for scan out buffer where the driver should allocate a proper buffer using only default properties like (width, height, bit per pixel) and it would be up to driver to fill in other properties with good safe default value (alignment, pitch, compressed, ...) I believe having render buffer object concept in kernel make sense for the above mentioned reasons and because in graphics world render buffer are a key concept and every things in end have to deal with it. So to sum-up: - easy checking of proper render buffer in kernel - easy checking of proper scan out buffer in kernel - make user space easier and safer (others things than a dri driver will allocate proper buffer without having to duplicate code). Few more words on map i think it could be use full to provide two different map method one linear specifically means that you want a linear mapping of the buffer (according to width, height, pitch and bpp) the others just ask for mapping and driver could pass some informations on the layout of the mapped memory (tiled, compressed, ...). For implementation is see two possible way: - wrap render buffer around BO - make render buffer a specialized BO by adding a flag into BO and ptr to render buffer structure Second solution likely the easier one. Anyway what are people thought on all that ? Cheers, Jerome Glisse ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel