glx: Fix build and warnings with -Dglx=dri -Dglx-direct=false
Acked-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5958>
This commit is contained in:
@@ -36,6 +36,8 @@
|
||||
#ifndef _DRI_COMMON_H
|
||||
#define _DRI_COMMON_H
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
|
||||
#include <GL/internal/dri_interface.h>
|
||||
#include <stdbool.h>
|
||||
#include "loader.h"
|
||||
@@ -83,4 +85,6 @@ dri2_check_no_error(uint32_t flags, struct glx_context *share_context,
|
||||
int major, unsigned *error);
|
||||
|
||||
|
||||
#endif /* GLX_DIRECT_RENDERING */
|
||||
|
||||
#endif /* _DRI_COMMON_H */
|
||||
|
||||
@@ -86,10 +86,10 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
||||
struct glx_display *priv = __glXInitialize(dpy);
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
__GLXDRIdrawable *pdraw;
|
||||
int i;
|
||||
#endif
|
||||
CARD32 *output;
|
||||
CARD8 opcode;
|
||||
int i;
|
||||
|
||||
if ((priv == NULL) || (dpy == NULL) || (drawable == 0)) {
|
||||
return;
|
||||
|
||||
+8
-16
@@ -1731,7 +1731,9 @@ __glXSwapIntervalSGI(int interval)
|
||||
{
|
||||
xGLXVendorPrivateReq *req;
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
struct glx_screen *psc;
|
||||
#endif
|
||||
Display *dpy;
|
||||
CARD32 *interval_ptr;
|
||||
CARD8 opcode;
|
||||
@@ -1744,9 +1746,9 @@ __glXSwapIntervalSGI(int interval)
|
||||
return GLX_BAD_VALUE;
|
||||
}
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (gc->isDirect && psc && psc->driScreen &&
|
||||
psc->driScreen->setSwapInterval) {
|
||||
__GLXDRIdrawable *pdraw =
|
||||
@@ -1846,32 +1848,26 @@ __glXGetSwapIntervalMESA(void)
|
||||
static int
|
||||
__glXGetVideoSyncSGI(unsigned int *count)
|
||||
{
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
int64_t ust, msc, sbc;
|
||||
int ret;
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
struct glx_screen *psc;
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
__GLXDRIdrawable *pdraw;
|
||||
#endif
|
||||
|
||||
if (gc == &dummyContext)
|
||||
return GLX_BAD_CONTEXT;
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (!gc->isDirect)
|
||||
return GLX_BAD_CONTEXT;
|
||||
#endif
|
||||
|
||||
psc = GetGLXScreenConfigs(gc->currentDpy, gc->screen);
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||
#endif
|
||||
|
||||
/* FIXME: Looking at the GLX_SGI_video_sync spec in the extension registry,
|
||||
* FIXME: there should be a GLX encoding for this call. I can find no
|
||||
* FIXME: documentation for the GLX encoding.
|
||||
*/
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (psc && psc->driScreen && psc->driScreen->getDrawableMSC) {
|
||||
ret = psc->driScreen->getDrawableMSC(psc, pdraw, &ust, &msc, &sbc);
|
||||
*count = (unsigned) msc;
|
||||
@@ -1886,12 +1882,12 @@ static int
|
||||
__glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
|
||||
{
|
||||
struct glx_context *gc = __glXGetCurrentContext();
|
||||
struct glx_screen *psc;
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
struct glx_screen *psc;
|
||||
__GLXDRIdrawable *pdraw;
|
||||
#endif
|
||||
int64_t ust, msc, sbc;
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
if (divisor <= 0 || remainder < 0)
|
||||
return GLX_BAD_VALUE;
|
||||
@@ -1902,14 +1898,10 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count)
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (!gc->isDirect)
|
||||
return GLX_BAD_CONTEXT;
|
||||
#endif
|
||||
|
||||
psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen);
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable);
|
||||
#endif
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (psc && psc->driScreen && psc->driScreen->waitForMSC) {
|
||||
ret = psc->driScreen->waitForMSC(pdraw, 0, divisor, remainder, &ust, &msc,
|
||||
&sbc);
|
||||
@@ -2048,11 +2040,11 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable,
|
||||
int64_t * ust, int64_t * msc, int64_t * sbc)
|
||||
{
|
||||
struct glx_display * const priv = __glXInitialize(dpy);
|
||||
int ret;
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
int ret;
|
||||
__GLXDRIdrawable *pdraw;
|
||||
#endif
|
||||
struct glx_screen *psc;
|
||||
#endif
|
||||
|
||||
if (!priv)
|
||||
return False;
|
||||
|
||||
@@ -441,10 +441,8 @@ __indirect_get_proc_address(const char *name)
|
||||
print('#define %s %d' % (func.opcode_vendor_name(name), func.glx_vendorpriv))
|
||||
print('%s gl%s(%s)' % (func.return_type, func_name, func.get_parameter_string()))
|
||||
print('{')
|
||||
print(' struct glx_context * const gc = __glXGetCurrentContext();')
|
||||
print('')
|
||||
print('#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)')
|
||||
print(' if (gc->isDirect) {')
|
||||
print(' if (((struct glx_context *)__glXGetCurrentContext())->isDirect) {')
|
||||
print(' const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();')
|
||||
print(' PFNGL%sPROC p =' % (name.upper()))
|
||||
print(' (PFNGL%sPROC) disp_table[%d];' % (name.upper(), func.offset))
|
||||
|
||||
Reference in New Issue
Block a user