xserver-multidpi/glamor
Zhigang Gong 430bc16ca0 GLX: Enable glx support.
If we are using MESA as our GL library, then both xserver's
GLX and glamor are link to the same library. As xserver's
GLX has its own _glapi_get/set_context/dispatch etc, and it
is a simplified version derived from mesa thus is not
sufficient for mesa/egl's dri loader which is used by glamor.

Then if glx module is loaded before glamoregl module, the
initialization of mesa/egl/opengl will not be correct, and
will fail at a very early stage, most likely fail to map
the element buffer.

Two methodis to fix this problem, first is to modify the xserver's
glx's glapi.c to fit mesa's requirement. The second is to put
a glamor.conf as below, to the system's xorg.conf path.

Section "Module"
        Load  "glamoregl"
EndSection

Then glamor will be loaded firstly, and the mesa's libglapi.so
will be used. As current xserver's dispatch table is the same
as mesa's, then the glx's dri loader can work without problem.

We took the second method as it don't need any change to xorg.:)
Although this is not a graceful implementation as it depends
on the xserver's dispatch table and the mesa's dispatch table
is the same and the context set and get is using the same method.
Anyway it works.

As by default, xserver will enable GLX_USE_TLS. But mesa will not
enable it, you may need to enable that when build mesa.

Three pre-requirements to make this glamor version work:

0. Make sure xserver has commit 66e603, if not please pull the latest
   master branch.
1. Rebuild mesa by enable GLX_USE_TLS.
2. Put the glamor.conf to your system's xorg.conf path and make sure
   it loaded prior to glx module.

Preliminary testing shows indirect glxgears works fine.

If user want to use GLES2 for glamor by using MESA, GLX will not
work correctly.

If you are not using normal MESA, for example PVR's private GLES
implementation, then it should be ok to use GLES2 glamor and the
GLX should work as expected. In this commit, I use gbm to check
whether we are using MESA or non-mesa. Maybe not the best way.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:48 -08:00
..
glamor_addtraps.c glamor-for-ddx: Exports all rendering/drawing functions. 2013-12-18 11:23:46 -08:00
glamor_copyarea.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_copyplane.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_copywindow.c Initial version. 2013-12-18 11:23:46 -08:00
glamor_core.c prepare_access: Don't use fbo after it was downloaded. 2013-12-18 11:23:48 -08:00
glamor_debug.h glamor_fbo: Introduce glamor fbo to manage all the fb/tex. 2013-12-18 11:23:47 -08:00
glamor_egl.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_eglmodule.c glamor_eglmodule: Change module name according to normalize naming rule. 2013-12-18 11:23:48 -08:00
glamor_fbo.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_fill.c glamor_fill/tile: Fixed a tileX/tileY calculation bug. 2013-12-18 11:23:48 -08:00
glamor_fillspans.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_getimage.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_getspans.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_gl_dispatch.c glamor_gl_dispatch: fix the dispatch initialization on GLES2. 2013-12-18 11:23:48 -08:00
glamor_gl_dispatch.h glamor-fbo-pool: Implement fbo cache mechanism. 2013-12-18 11:23:47 -08:00
glamor_glext.h glamor: Re-arrange some macros/definitions in header files. 2011-09-26 16:47:02 +08:00
glamor_glyphblt.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_glyphs.c glamor-for-ddx: Exports all rendering/drawing functions. 2013-12-18 11:23:46 -08:00
glamor_picture.c glamor_picture: Fix the wrong order of header file. 2013-12-18 11:23:48 -08:00
glamor_pixmap.c glamor_pixmap: Should bind unpack buffer to 0 after the uploading. 2013-12-18 11:23:48 -08:00
glamor_polyfillrect.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_polylines.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_polyops.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_priv.h GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_putimage.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_render.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_setspans.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_tile.c glamor_fill/tile: Fixed a tileX/tileY calculation bug. 2013-12-18 11:23:48 -08:00
glamor_triangles.c glamor-for-ddx: Exports all rendering/drawing functions. 2013-12-18 11:23:46 -08:00
glamor_utils.h GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor_window.c Initial version. 2013-12-18 11:23:46 -08:00
glamor.c GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glamor.h GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
glapi.h GLX: Enable glx support. 2013-12-18 11:23:48 -08:00
Makefile.am GLX: Enable glx support. 2013-12-18 11:23:48 -08:00