[Mesa-dev] decoupling XCB from Mesa

Jerome Glisse j.glisse at gmail.com
Wed Mar 30 06:48:28 PDT 2011

On Wed, Mar 30, 2011 at 2:30 AM, Srini <srini_rajini at yahoo.com> wrote:
> Hi Jerome,
>     Thanks for Reply, what you said is right for my attempt on software
> acceleration. I added a folder called "flip" in
> mesa/src/gallium/state_tracker/egl/ and created the egl software driver
> called "egl_flip_swrast.so" its working fine.
> My current attempt is to enable the hardware acceleration, I choose
> Mesa-7.9,and the configuration i used is
> "./configure --enable-gles2 --enable-egl --with-egl-platforms=x11
> --with-dri-drivers=i965 --with-state-trackers=egl,dri --disable-gallium
> --disable-glw"
> This configuration totally disable the gallium driver this means I am using
> Classic mesa driver, I used the small GLES application to read the flow of
> the Hardware rendering path, accordingly I mocked the entire flow for my
> windowing system by faking the egl_dri2.c file, where actually the
> initialization for x11 and drm are happening, I added the new API
> "dri2_initialize_flip".
> The difference between dri2_initialize_flip and dri2_initialize_x11 is, all
> the calls to XCB are removed, and rather I am using my local library by this
> way, whole initialization is successful, I have touch few thing in
> libdrm_intel.so to fake the xcb connection.
> How I am telling the initialization is successful is because, my gles
> application returns success in creating shader and vertex program.the final
> call to glDrawaArray is also success. after glDrawaArray application calls
> eglSwapBuffers. If I see the eglSwapBuffers implementation it boils to
> "dri2_copy_region" where they directly delegates to libXCb.
> From dri2_copy_region the call to "xcb_dri2_copy_region_unchecked" has the
> source and destination as XCB_DRI2_ATTACHMENT_BUFFER_FAKE_FRONT_LEFT and
> What I believe is, final GLES created scene is available in
> "FAKE_FRONT_LEFT" if by any chance I happen to get the pointer to
> FAKE_FRONT_LEFT, I can copy the content  to my window surface and validate
> the scene.
> Sorry for the big mail, i want to put in detail.
> Happy to hear back.
> Regards,
> Srini.

Easiest solution is to record in egl the drm handle of the buffer when
GetBuffer is call (after egl surface creation) and in the elg swap
buffer call back you call your window system to blit from this handle
to your front buffer and do nothing else. That means that the dri
driver will keep rendering to the same buffer.


More information about the mesa-dev mailing list