[Mesa-dev] [PATCH] glx/dri2: Respect --enable/disable-driglx-direct
Ian Romanick
idr at freedesktop.org
Thu Feb 13 08:29:59 PST 2014
On 02/13/2014 02:11 AM, Daniel Martin wrote:
> Encapsulate the code in src/glx/dri2_query_renderer.c within a
>
> #ifdef GLX_DIRECT_RENDERING
>
> as done in src/glx/dri2*.c.
I noticed a couple things, and I'm not sure what the right answer is.
First, dri2_glx.c and dri3_glx.c use:
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
but dri2.c uses
#ifdef GLX_DIRECT_RENDERING
I'm not sure why they're different or which is actually correct.
Second, couldn't we just not build the file at all when
GLX_DIRECT_RENDERING isn't selected? Do something like the following in
src/glx/Makefile.am:
if HAVE_DRI2 || HAVE_DRI3
libglx_la_SOURCES += \
dri2_glx.c
dri2.c
dri2_query_renderer.c
endif
(and remove those files from the default libglx_la_SOURCES list, of course).
> Signed-off-by: Daniel Martin <consume.noise at gmail.com>
> ---
> ... compile it, when enabled only.
>
> Cheers,
> Daniel
>
> src/glx/dri2_query_renderer.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/src/glx/dri2_query_renderer.c b/src/glx/dri2_query_renderer.c
> index b50a202..3bc90c7 100644
> --- a/src/glx/dri2_query_renderer.c
> +++ b/src/glx/dri2_query_renderer.c
> @@ -20,6 +20,9 @@
> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> * DEALINGS IN THE SOFTWARE.
> */
> +
> +#ifdef GLX_DIRECT_RENDERING
> +
> #include "glxclient.h"
> #include "glx_error.h"
> #include "xf86drm.h"
> @@ -95,3 +98,5 @@ dri2_query_renderer_string(struct glx_screen *base, int attribute,
>
> return psc->rendererQuery->queryString(psc->driScreen, dri_attribute, value);
> }
> +
> +#endif /* GLX_DIRECT_RENDERING */
>
More information about the mesa-dev
mailing list