Require libdrm 2.4.0 always since we need the bufmgr code.
This lets us remove a lot of conditional compile stuff in the DRI case, as if we're doing DRI and have 2.4.0, we can rely on GEM ioctls existing.
This commit is contained in:
parent
754df0aa55
commit
f07acbdaac
25
configure.ac
25
configure.ac
|
|
@ -196,36 +196,15 @@ if test "x$GCC" = "xyes"; then
|
|||
-Wnested-externs -fno-strict-aliasing"
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.0])
|
||||
AM_CONDITIONAL(DRI, test x$DRI = xyes)
|
||||
if test "$DRI" = yes; then
|
||||
PKG_CHECK_MODULES(DRI, [libdrm xf86driproto glproto])
|
||||
PKG_CHECK_MODULES(DRI, [xf86driproto glproto])
|
||||
AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
|
||||
AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
|
||||
PKG_CHECK_MODULES(DRI_MM, [libdrm >= 2.3.1],[DRI_MM=yes], [DRI_MM=no])
|
||||
if test "x$DRI_MM" = xyes; then
|
||||
AC_DEFINE(XF86DRI_MM,1,[Extended DRI memory management])
|
||||
fi
|
||||
if test "$have_damage_h" = yes; then
|
||||
AC_DEFINE(DAMAGE,1,[Use Damage extension])
|
||||
fi
|
||||
|
||||
save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$XORG_CFLAGS $DRI_CFLAGS"
|
||||
AC_CHECK_TYPE(drm_i915_flip_t,
|
||||
[AC_DEFINE(HAVE_I915_FLIP, 1,
|
||||
[Have drm_i915_flip_t and related definitions])],
|
||||
[], [
|
||||
#include <inttypes.h>
|
||||
#include <i915_drm.h>
|
||||
])
|
||||
AC_CHECK_DECL(DRM_IOCTL_GEM_CREATE,
|
||||
[AC_DEFINE(HAVE_DRM_GEM, 1,
|
||||
[Have DRM Graphics Execution Manager])],
|
||||
[], [
|
||||
#include <inttypes.h>
|
||||
#include <drm.h>
|
||||
])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(VIDEO_DEBUG, test x$VIDEO_DEBUG = xyes)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ SUBDIRS = xvmc bios_reader ch7017 ch7xxx ivch sil164 tfp410 $(REGDUMPER)
|
|||
# _ladir passes a dummy rpath to libtool so the thing will actually link
|
||||
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
|
||||
|
||||
AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRI_CFLAGS@ @PCIACCESS_CFLAGS@ \
|
||||
AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
|
||||
@PCIACCESS_CFLAGS@ \
|
||||
@XMODES_CFLAGS@ -DI830_XV -DI830_USE_XAA -DI830_USE_EXA
|
||||
|
||||
intel_drv_la_LTLIBRARIES = intel_drv.la
|
||||
|
|
@ -151,7 +152,6 @@ INTEL_G4I = \
|
|||
exa_wm.g4i \
|
||||
exa_wm_affine.g4i \
|
||||
exa_wm_projective.g4i
|
||||
|
||||
|
||||
INTEL_G4B = \
|
||||
packed_yuv_sf.g4b \
|
||||
|
|
@ -173,7 +173,7 @@ INTEL_G4B = \
|
|||
exa_wm_ca_srcalpha.g4b \
|
||||
exa_wm_write.g4b \
|
||||
exa_wm_xy.g4b
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(XMODE_SRCS) \
|
||||
$(INTEL_G4A) \
|
||||
|
|
|
|||
|
|
@ -69,9 +69,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#ifdef XF86DRI
|
||||
#include "xf86drm.h"
|
||||
#ifdef XF86DRI_MM
|
||||
#include "xf86mm.h"
|
||||
#endif
|
||||
#include "sarea.h"
|
||||
#define _XF86DRI_SERVER_
|
||||
#include "dri.h"
|
||||
|
|
@ -195,12 +192,10 @@ struct _i830_memory {
|
|||
i830_memory *prev;
|
||||
/** @} */
|
||||
|
||||
#ifdef XF86DRI_MM
|
||||
uint32_t gem_handle;
|
||||
uint32_t alignment;
|
||||
uint32_t gem_name;
|
||||
Bool lifetime_fixed_offset;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
|
|
@ -86,23 +86,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include "i915_drm.h"
|
||||
|
||||
/* This block and the corresponding configure test can be removed when
|
||||
* libdrm >= 2.3.1 is required.
|
||||
*/
|
||||
#ifndef HAVE_I915_FLIP
|
||||
|
||||
#define DRM_VBLANK_FLIP 0x8000000
|
||||
|
||||
typedef struct drm_i915_flip {
|
||||
int pipes;
|
||||
} drm_i915_flip_t;
|
||||
|
||||
#undef DRM_IOCTL_I915_FLIP
|
||||
#define DRM_IOCTL_I915_FLIP DRM_IOW(DRM_COMMAND_BASE + DRM_I915_FLIP, \
|
||||
drm_i915_flip_t)
|
||||
|
||||
#endif
|
||||
|
||||
#include "dristruct.h"
|
||||
|
||||
static Bool I830InitVisualConfigs(ScreenPtr pScreen);
|
||||
|
|
|
|||
|
|
@ -209,11 +209,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#ifdef XF86DRI
|
||||
#include "dri.h"
|
||||
#include <sys/ioctl.h>
|
||||
#ifdef XF86DRI_MM
|
||||
#include "xf86mm.h"
|
||||
#include "i915_drm.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef I830_USE_EXA
|
||||
const char *I830exaSymbols[] = {
|
||||
|
|
@ -303,7 +300,7 @@ typedef enum {
|
|||
OPTION_LVDS24BITMODE,
|
||||
OPTION_FBC,
|
||||
OPTION_TILING,
|
||||
#ifdef XF86DRI_MM
|
||||
#ifdef XF86DRI
|
||||
OPTION_INTELTEXPOOL,
|
||||
#endif
|
||||
OPTION_LVDSFIXEDMODE,
|
||||
|
|
@ -331,7 +328,7 @@ static OptionInfoRec I830Options[] = {
|
|||
{OPTION_LVDS24BITMODE, "LVDS24Bit", OPTV_BOOLEAN, {0}, FALSE},
|
||||
{OPTION_FBC, "FramebufferCompression", OPTV_BOOLEAN, {0}, TRUE},
|
||||
{OPTION_TILING, "Tiling", OPTV_BOOLEAN, {0}, TRUE},
|
||||
#ifdef XF86DRI_MM
|
||||
#ifdef XF86DRI
|
||||
{OPTION_INTELTEXPOOL,"Legacy3D", OPTV_BOOLEAN, {0}, FALSE},
|
||||
#endif
|
||||
{OPTION_LVDSFIXEDMODE, "LVDSFixedMode", OPTV_BOOLEAN, {0}, FALSE},
|
||||
|
|
@ -1573,7 +1570,7 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
|
|||
|
||||
from = X_PROBED;
|
||||
|
||||
#ifdef XF86DRI_MM
|
||||
#ifdef XF86DRI
|
||||
if (!IS_I965G(pI830)) {
|
||||
Bool tmp;
|
||||
|
||||
|
|
@ -3369,7 +3366,7 @@ I830LeaveVT(int scrnIndex, int flags)
|
|||
if (I830IsPrimary(pScrn))
|
||||
i830_unbind_all_memory(pScrn);
|
||||
|
||||
#ifdef XF86DRI_MM
|
||||
#ifdef XF86DRI
|
||||
if (pI830->memory_manager) {
|
||||
int ret;
|
||||
|
||||
|
|
@ -3380,7 +3377,7 @@ I830LeaveVT(int scrnIndex, int flags)
|
|||
if (ret != 0)
|
||||
FatalError("DRM_I915_LEAVEVT failed: %s\n", strerror(ret));
|
||||
}
|
||||
#endif /* XF86DRI_MM */
|
||||
#endif /* XF86DRI */
|
||||
|
||||
if (IS_I965G(pI830))
|
||||
gen4_render_state_cleanup(pScrn);
|
||||
|
|
@ -3411,7 +3408,7 @@ I830EnterVT(int scrnIndex, int flags)
|
|||
|
||||
pI830->leaving = FALSE;
|
||||
|
||||
#ifdef XF86DRI_MM
|
||||
#ifdef XF86DRI
|
||||
if (pI830->memory_manager) {
|
||||
int ret;
|
||||
|
||||
|
|
@ -3422,7 +3419,7 @@ I830EnterVT(int scrnIndex, int flags)
|
|||
if (ret != 0)
|
||||
FatalError("DRM_I915_ENTERVT failed: %s\n", strerror(ret));
|
||||
}
|
||||
#endif /* XF86DRI_MM */
|
||||
#endif /* XF86DRI */
|
||||
|
||||
if (I830IsPrimary(pScrn))
|
||||
if (!i830_bind_all_memory(pScrn))
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include "i830.h"
|
||||
#include "i810_reg.h"
|
||||
#ifdef XF86DRI_MM
|
||||
#ifdef XF86DRI
|
||||
#include "i915_drm.h"
|
||||
#endif
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
|
|||
if (mem == NULL || mem->bound)
|
||||
return TRUE;
|
||||
|
||||
#if HAVE_DRM_GEM
|
||||
#ifdef XF86DRI
|
||||
if (mem->gem_handle != 0) {
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
struct drm_i915_gem_pin pin;
|
||||
|
|
@ -218,7 +218,7 @@ i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
|
|||
if (mem->tiling != TILE_NONE)
|
||||
i830_clear_tiling(pScrn, mem->fence_nr);
|
||||
|
||||
#if HAVE_DRM_GEM
|
||||
#ifdef XF86DRI
|
||||
if (mem->gem_handle != 0) {
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
struct drm_i915_gem_unpin unpin;
|
||||
|
|
@ -256,7 +256,7 @@ i830_free_memory(ScrnInfoPtr pScrn, i830_memory *mem)
|
|||
/* Free any AGP memory. */
|
||||
i830_unbind_memory(pScrn, mem);
|
||||
|
||||
#if HAVE_DRM_GEM
|
||||
#ifdef XF86DRI
|
||||
if (mem->gem_handle != 0) {
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
struct drm_gem_close close;
|
||||
|
|
@ -319,12 +319,10 @@ i830_reset_allocations(ScrnInfoPtr pScrn)
|
|||
}
|
||||
|
||||
/* Free any allocations in buffer objects */
|
||||
#ifdef XF86DRI_MM
|
||||
if (pI830->memory_manager) {
|
||||
while (pI830->bo_list != NULL)
|
||||
i830_free_memory(pScrn, pI830->bo_list);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Null out the pointers for all the allocations we just freed. This is
|
||||
* kind of gross, but at least it's just one place now.
|
||||
|
|
@ -375,7 +373,7 @@ i830_free_3d_memory(ScrnInfoPtr pScrn)
|
|||
* given range.
|
||||
*
|
||||
* This sets up the kernel memory manager to manage as much of the memory
|
||||
* as we think it can, while leaving enough to us to fulfill our non-TTM
|
||||
* as we think it can, while leaving enough to us to fulfill our non-GEM
|
||||
* static allocations. Some of these exist because of the need for physical
|
||||
* addresses to reference.
|
||||
*/
|
||||
|
|
@ -384,7 +382,7 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
|
|||
{
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
i830_memory *start, *end;
|
||||
#if HAVE_DRM_GEM
|
||||
#ifdef XF86DRI
|
||||
int dri_major, dri_minor, dri_patch;
|
||||
#endif
|
||||
|
||||
|
|
@ -423,7 +421,7 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
|
|||
|
||||
pI830->memory_list = start;
|
||||
|
||||
#if HAVE_DRM_GEM
|
||||
#ifdef XF86DRI
|
||||
DRIQueryVersion(&dri_major, &dri_minor, &dri_patch);
|
||||
|
||||
/* Now that we have our manager set up, initialize the kernel MM if
|
||||
|
|
@ -461,7 +459,7 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
|
|||
}
|
||||
if (pI830->fb_compression)
|
||||
mmsize -= MB(6) + ROUND_TO_PAGE(FBC_LL_SIZE + FBC_LL_PAD);
|
||||
/* Can't do TTM on stolen memory */
|
||||
/* Can't do GEM on stolen memory */
|
||||
mmsize -= pI830->stolen_size;
|
||||
|
||||
if (HWS_NEED_GFX(pI830) && IS_IGD_GM(pI830))
|
||||
|
|
@ -496,7 +494,7 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
|
|||
pI830->memory_manager = NULL;
|
||||
}
|
||||
}
|
||||
#endif /* XF86DRI_MM */
|
||||
#endif /* XF86DRI */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -509,14 +507,12 @@ i830_allocator_fini(ScrnInfoPtr pScrn)
|
|||
/* Free most of the allocations */
|
||||
i830_reset_allocations(pScrn);
|
||||
|
||||
#ifdef XF86DRI_MM
|
||||
/* The memory manager is more special */
|
||||
if (pI830->memory_manager) {
|
||||
/* XXX drmMMTakedown(pI830->drmSubFD, DRM_BO_MEM_TT);*/
|
||||
i830_free_memory(pScrn, pI830->memory_manager);
|
||||
pI830->memory_manager = NULL;
|
||||
}
|
||||
#endif /* XF86DRI_MM */
|
||||
|
||||
/* Free the start/end markers */
|
||||
free(pI830->memory_list->next);
|
||||
|
|
@ -726,7 +722,7 @@ i830_allocate_agp_memory(ScrnInfoPtr pScrn, i830_memory *mem, int flags)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
#if HAVE_DRM_GEM
|
||||
#ifdef XF86DRI
|
||||
static i830_memory *
|
||||
i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name,
|
||||
unsigned long size, unsigned long align, int flags)
|
||||
|
|
@ -794,7 +790,7 @@ i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name,
|
|||
|
||||
return mem;
|
||||
}
|
||||
#endif /* XF86DRI_MM */
|
||||
#endif /* XF86DRI */
|
||||
|
||||
/* Allocates video memory at the given size and alignment.
|
||||
*
|
||||
|
|
@ -820,7 +816,7 @@ i830_allocate_memory(ScrnInfoPtr pScrn, const char *name,
|
|||
{
|
||||
i830_memory *mem;
|
||||
|
||||
#if HAVE_DRM_GEM
|
||||
#ifdef XF86DRI
|
||||
I830Ptr pI830 = I830PTR(pScrn);
|
||||
|
||||
if (pI830->memory_manager && !(flags & NEED_PHYSICAL_ADDR) &&
|
||||
|
|
@ -828,7 +824,7 @@ i830_allocate_memory(ScrnInfoPtr pScrn, const char *name,
|
|||
{
|
||||
return i830_allocate_memory_bo(pScrn, name, size, alignment, flags);
|
||||
} else
|
||||
#endif
|
||||
#endif /* XF86DRI */
|
||||
{
|
||||
mem = i830_allocate_aperture(pScrn, name, size, alignment, flags);
|
||||
if (mem == NULL)
|
||||
|
|
@ -958,7 +954,6 @@ i830_describe_allocations(ScrnInfoPtr pScrn, int verbosity, const char *prefix)
|
|||
"%s0x%08lx: end of aperture\n",
|
||||
prefix, pI830->FbMapSize);
|
||||
|
||||
#ifdef XF86DRI_MM
|
||||
if (pI830->memory_manager) {
|
||||
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity,
|
||||
"%sBO memory allocation layout:\n", prefix);
|
||||
|
|
@ -988,7 +983,6 @@ i830_describe_allocations(ScrnInfoPtr pScrn, int verbosity, const char *prefix)
|
|||
"%s0x%08lx: end of memory manager\n",
|
||||
prefix, pI830->memory_manager->end);
|
||||
}
|
||||
#endif /* XF86DRI_MM */
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
|
@ -1455,7 +1449,7 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
|
|||
if (!pI830->noAccel && !pI830->useEXA) {
|
||||
/* The lifetime fixed offset of xaa scratch is probably not required,
|
||||
* but we do some setup using it at XAAInit() time. And XAA may not
|
||||
* end up being supported with TTM anyway.
|
||||
* end up being supported with GEM anyway.
|
||||
*/
|
||||
pI830->xaa_scratch =
|
||||
i830_allocate_memory(pScrn, "xaa scratch", MAX_SCRATCH_BUFFER_SIZE,
|
||||
|
|
@ -1967,12 +1961,10 @@ i830_bind_all_memory(ScrnInfoPtr pScrn)
|
|||
FatalError("Couldn't bind memory for %s\n", mem->name);
|
||||
}
|
||||
}
|
||||
#ifdef XF86DRI_MM
|
||||
for (mem = pI830->bo_list; mem != NULL; mem = mem->next) {
|
||||
if (!mem->lifetime_fixed_offset && !i830_bind_memory(pScrn, mem))
|
||||
FatalError("Couldn't bind memory for BO %s\n", mem->name);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (!pI830->SWCursor)
|
||||
i830_update_cursor_offsets(pScrn);
|
||||
|
|
@ -1997,7 +1989,6 @@ i830_unbind_all_memory(ScrnInfoPtr pScrn)
|
|||
{
|
||||
i830_unbind_memory(pScrn, mem);
|
||||
}
|
||||
#ifdef XF86DRI_MM
|
||||
for (mem = pI830->bo_list; mem != NULL; mem = mem->next) {
|
||||
/* Don't unpin objects which require that their offsets never
|
||||
* change.
|
||||
|
|
@ -2005,7 +1996,6 @@ i830_unbind_all_memory(ScrnInfoPtr pScrn)
|
|||
if (!mem->lifetime_fixed_offset)
|
||||
i830_unbind_memory(pScrn, mem);
|
||||
}
|
||||
#endif
|
||||
|
||||
pI830->gtt_acquired = FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ lib_LTLIBRARIES=libI810XvMC.la libIntelXvMC.la
|
|||
libI810XvMC_la_SOURCES = I810XvMC.c \
|
||||
I810XvMC.h
|
||||
|
||||
libI810XvMC_la_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRI_CFLAGS@ \
|
||||
libI810XvMC_la_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
|
||||
-I$(top_srcdir)/src -DTRUE=1 -DFALSE=0
|
||||
libI810XvMC_la_LDFLAGS = -version-number 1:0:0
|
||||
libI810XvMC_la_LIBADD = @DRI_LIBS@
|
||||
|
|
@ -22,7 +22,8 @@ libIntelXvMC_la_SOURCES = intel_xvmc.c \
|
|||
xf86dri.h \
|
||||
xf86dristr.h
|
||||
|
||||
libIntelXvMC_la_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ @XVMCLIB_CFLAGS@ -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0
|
||||
libIntelXvMC_la_CFLAGS = @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
|
||||
@XVMCLIB_CFLAGS@ -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0
|
||||
libIntelXvMC_la_LDFLAGS = -version-number 1:0:0
|
||||
libIntelXvMC_la_LIBADD = @DRI_LIBS@
|
||||
endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue