sna: Fix build without DRI2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
22be9988b9
commit
fd15ce65ab
16
configure.ac
16
configure.ac
|
|
@ -168,7 +168,7 @@ AC_ARG_ENABLE(xaa,
|
|||
[XAA=auto])
|
||||
if test "x$XAA" != xno; then
|
||||
save_CFLAGS=$CFLAGS
|
||||
CFLAGS=$XSERVER_CFLAGS
|
||||
CFLAGS=$XORG_CFLAGS
|
||||
AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no)
|
||||
CFLAGS=$save_CFLAGS
|
||||
fi
|
||||
|
|
@ -183,8 +183,8 @@ AC_ARG_ENABLE(dga,
|
|||
[DGA=auto])
|
||||
if test "x$DGA" != xno; then
|
||||
save_CFLAGS=$CFLAGS
|
||||
CFLAGS=$XSERVER_CFLAGS
|
||||
AC_CHECK_HEADERS([dgaproc.h], DGA=yes, DGA=no)
|
||||
CFLAGS=$XORG_CFLAGS
|
||||
AC_CHECK_HEADERS([dgaproc.h], DGA=yes, DGA=no, [#include <dixstruct.h>])
|
||||
CFLAGS=$save_CFLAGS
|
||||
fi
|
||||
AC_MSG_CHECKING([whether to include DGA support])
|
||||
|
|
@ -324,10 +324,16 @@ else
|
|||
AC_MSG_ERROR([DRI requested but prerequisites not found])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL(DRI2, test x$DRI2 != xno)
|
||||
|
||||
if test "x$DRI2" != "xno"; then
|
||||
AC_DEFINE(USE_DRI2,1,[Enable DRI2 driver support])
|
||||
save_CFLAGS=$CFLAGS
|
||||
CFLAGS="$XORG_CFLAGS $DRM_CFLAGS $DRI_CFLAGS $DRI2_CFLAGS"
|
||||
AC_CHECK_HEADERS([dri2.h], DRI2=yes, DRI2=no, [#include <dixstruct.h>])
|
||||
CFLAGS=$save_CFLAGS
|
||||
fi
|
||||
AC_MSG_CHECKING([whether to include DRI2 support])
|
||||
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
|
||||
AC_MSG_RESULT([$DRI2])
|
||||
|
||||
if test "$XVMC" = yes; then
|
||||
PKG_CHECK_MODULES(XVMCLIB,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ AM_CFLAGS = \
|
|||
@XORG_CFLAGS@ \
|
||||
@UDEV_CFLAGS@ \
|
||||
@DRM_CFLAGS@ \
|
||||
@DRI_CFLAGS@ \
|
||||
$(NULL)
|
||||
|
||||
if DEBUG
|
||||
|
|
@ -83,12 +82,9 @@ libsna_la_SOURCES = \
|
|||
$(NULL)
|
||||
|
||||
if DRI2
|
||||
libsna_la_SOURCES += \
|
||||
sna_dri.c \
|
||||
$(NULL)
|
||||
libsna_la_LIBADD += \
|
||||
$(DRI_LIBS) \
|
||||
$(NULL)
|
||||
AM_CFLAGS += @DRI_CFLAGS@
|
||||
libsna_la_SOURCES += sna_dri.c
|
||||
libsna_la_LIBADD += $(DRI_LIBS)
|
||||
endif
|
||||
|
||||
if XVMC
|
||||
|
|
|
|||
|
|
@ -58,11 +58,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <xf86drmMode.h>
|
||||
|
||||
#include "../compat-api.h"
|
||||
#define _XF86DRI_SERVER_
|
||||
#include <drm.h>
|
||||
#include <dri2.h>
|
||||
#include <i915_drm.h>
|
||||
|
||||
#ifdef HAVE_DRI2_H
|
||||
#include <dri2.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_UDEV
|
||||
#include <libudev.h>
|
||||
#endif
|
||||
|
|
@ -338,11 +340,19 @@ extern xf86CrtcPtr sna_covering_crtc(ScrnInfoPtr scrn,
|
|||
extern bool sna_wait_for_scanline(struct sna *sna, PixmapPtr pixmap,
|
||||
xf86CrtcPtr crtc, const BoxRec *clip);
|
||||
|
||||
#if HAVE_DRI2_H
|
||||
Bool sna_dri_open(struct sna *sna, ScreenPtr pScreen);
|
||||
void sna_dri_page_flip_handler(struct sna *sna, struct drm_event_vblank *event);
|
||||
void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event);
|
||||
void sna_dri_destroy_window(WindowPtr win);
|
||||
void sna_dri_close(struct sna *sna, ScreenPtr pScreen);
|
||||
#else
|
||||
static inline bool sna_dri_open(struct sna *sna, ScreenPtr pScreen) { return false; }
|
||||
static inline void sna_dri_page_flip_handler(struct sna *sna, struct drm_event_vblank *event) { }
|
||||
static inline void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event) { }
|
||||
static inline void sna_dri_destroy_window(WindowPtr win) { }
|
||||
static inline void sna_dri_close(struct sna *sna, ScreenPtr pScreen) { }
|
||||
#endif
|
||||
|
||||
extern bool sna_crtc_on(xf86CrtcPtr crtc);
|
||||
int sna_crtc_to_pipe(xf86CrtcPtr crtc);
|
||||
|
|
|
|||
|
|
@ -941,12 +941,10 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
|
|||
xf86DPMSInit(screen, xf86DPMSSet, 0);
|
||||
|
||||
sna_video_init(sna, screen);
|
||||
#if USE_DRI2
|
||||
sna->directRenderingOpen = sna_dri_open(sna, screen);
|
||||
if (sna->directRenderingOpen)
|
||||
xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
||||
"direct rendering: DRI2 Enabled\n");
|
||||
#endif
|
||||
|
||||
if (serverGeneration == 1)
|
||||
xf86ShowUnusedOptions(scrn->scrnIndex, scrn->options);
|
||||
|
|
|
|||
Loading…
Reference in New Issue