intel: Compile fixes for base install of SLED11.sp3
Highlights of that distribution include xorg-xserver-1.6.5, kernel 3.0.76 and gcc-4.3. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
97b443f589
commit
dcf9b5ae18
86
configure.ac
86
configure.ac
|
|
@ -169,7 +169,43 @@ AM_CONDITIONAL(HAVE_X11, test "x$x11" = "xyes")
|
|||
PKG_CHECK_MODULES(TOOL, [xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1], [tools="yes"], [tools="no"])
|
||||
AM_CONDITIONAL(BUILD_TOOLS, test "x$tools" = "xyes")
|
||||
|
||||
AH_TOP([#include "xorg-server.h"])
|
||||
if test "x$tools" = "xyes"; then
|
||||
AC_CHECK_HEADER(sys/ipc.h)
|
||||
AC_CHECK_HEADER(sys/shm.h)
|
||||
|
||||
if test "$ac_cv_header_sys_ipc_h" = "yes" -a "$ac_cv_header_sys_shm_h" = "yes"; then
|
||||
AC_MSG_CHECKING(whether shmctl IPC_RMID allowes subsequent attaches)
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
int main()
|
||||
{
|
||||
char *shmaddr;
|
||||
int id = shmget (IPC_PRIVATE, 4, IPC_CREAT | 0600);
|
||||
if (id == -1) return 2;
|
||||
shmaddr = shmat (id, 0, 0);
|
||||
shmctl (id, IPC_RMID, 0);
|
||||
if ((char*) shmat (id, 0, 0) == (char*) -1) {
|
||||
shmdt (shmaddr);
|
||||
return 1;
|
||||
}
|
||||
shmdt (shmaddr);
|
||||
shmdt (shmaddr);
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
AC_DEFINE(IPC_RMID_DEFERRED_RELEASE, 1,
|
||||
[Define to 1 if shared memory segments are released deferred.])
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT(no),
|
||||
AC_MSG_RESULT(assuming no))
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS([X11/extensions/XShm.h X11/extensions/shmproto.h X11/extensions/shmstr.h], [], [],
|
||||
[#include <X11/Xlibint.h>
|
||||
#include <X11/Xproto.h>])
|
||||
fi
|
||||
|
||||
# Define a configure option for an alternate module directory
|
||||
AC_ARG_WITH(xorg-module-dir,
|
||||
|
|
@ -221,6 +257,16 @@ if pkg-config --exists 'pixman-1 >= 0.24.0'; then
|
|||
AC_DEFINE([HAS_PIXMAN_TRIANGLES], 1, [Enable pixman triangle rasterisation])
|
||||
fi
|
||||
|
||||
# Store the list of server defined optional extensions in REQUIRED_MODULES
|
||||
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
|
||||
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
|
||||
XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
|
||||
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
|
||||
|
||||
# Obtain compiler/linker options for the driver dependencies
|
||||
PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.20]) # libdrm_intel is checked separately
|
||||
PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
|
||||
|
||||
AC_ARG_ENABLE(sna,
|
||||
AS_HELP_STRING([--enable-sna],
|
||||
[Enable SandyBridge's New Acceleration (SNA) [default=auto]]),
|
||||
|
|
@ -231,9 +277,6 @@ if test "x$SNA" != "xno"; then
|
|||
AC_DEFINE(USE_SNA, 1, [Enable SNA support])
|
||||
AC_CHECK_HEADERS([sys/sysinfo.h], AC_CHECK_MEMBERS([struct sysinfo.totalram], [], [], [[#include <sys/sysinfo.h>]]))
|
||||
fi
|
||||
AC_MSG_CHECKING([whether to include SNA support])
|
||||
AM_CONDITIONAL(SNA, test "x$SNA" != "xno")
|
||||
AC_MSG_RESULT([$SNA])
|
||||
|
||||
AC_ARG_ENABLE(uxa,
|
||||
AS_HELP_STRING([--enable-uxa],
|
||||
|
|
@ -254,18 +297,12 @@ if test "x$UXA" != "xno"; then
|
|||
required_pixman_version=0.24
|
||||
UXA=yes
|
||||
fi
|
||||
AC_MSG_CHECKING([whether to include UXA support])
|
||||
AC_MSG_RESULT([$UXA])
|
||||
AM_CONDITIONAL(UXA, test "x$UXA" != "xno")
|
||||
|
||||
AC_MSG_CHECKING([whether to include GLAMOR support])
|
||||
AC_ARG_ENABLE(glamor,
|
||||
AS_HELP_STRING([--enable-glamor],
|
||||
[Enable glamor, a new GL-based acceleration [default=no]]),
|
||||
[GLAMOR="$enableval"],
|
||||
[GLAMOR="no"])
|
||||
AC_MSG_RESULT([$GLAMOR])
|
||||
AM_CONDITIONAL(GLAMOR, test "x$GLAMOR" != "xno")
|
||||
if test "x$GLAMOR" != "xno"; then
|
||||
PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.3.1])
|
||||
PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
|
||||
|
|
@ -387,7 +424,10 @@ if test "x$enable_dri" != "xno"; then
|
|||
if test "x$DRI2" != "xno"; then
|
||||
save_CFLAGS=$CFLAGS
|
||||
CFLAGS="$XORG_CFLAGS $DRM_CFLAGS $DRI_CFLAGS $DRI2_CFLAGS"
|
||||
AC_CHECK_HEADERS([dri2.h], DRI2="yes", DRI2="no", [#include <dixstruct.h>])
|
||||
AC_CHECK_HEADERS([dri2.h], DRI2="yes", DRI2="no", [
|
||||
#include <dixstruct.h>
|
||||
#include <drm.h>
|
||||
])
|
||||
CFLAGS=$save_CFLAGS
|
||||
fi
|
||||
fi
|
||||
|
|
@ -406,6 +446,20 @@ else
|
|||
UXA=no
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS([X11/extensions/dpmsconst.h])
|
||||
|
||||
AC_MSG_CHECKING([whether to include UXA support])
|
||||
AC_MSG_RESULT([$UXA])
|
||||
AM_CONDITIONAL(UXA, test "x$UXA" != "xno")
|
||||
|
||||
AC_MSG_CHECKING([whether to include GLAMOR support])
|
||||
AC_MSG_RESULT([$GLAMOR])
|
||||
AM_CONDITIONAL(GLAMOR, test "x$GLAMOR" != "xno")
|
||||
|
||||
AC_MSG_CHECKING([whether to include SNA support])
|
||||
AM_CONDITIONAL(SNA, test "x$SNA" != "xno")
|
||||
AC_MSG_RESULT([$SNA])
|
||||
|
||||
if test "$XVMC" = "yes"; then
|
||||
PKG_CHECK_MODULES(XVMCLIB, [xvmc dri2proto x11], [], [XVMC="no"])
|
||||
PKG_CHECK_MODULES(XCB, [x11-xcb xcb-dri2 xcb-aux], [], [XVMC="no"])
|
||||
|
|
@ -525,16 +579,6 @@ AC_ARG_ENABLE(valgrind,
|
|||
[VG="$enableval"],
|
||||
[VG="no"])
|
||||
|
||||
# Store the list of server defined optional extensions in REQUIRED_MODULES
|
||||
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
|
||||
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
|
||||
XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
|
||||
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
|
||||
|
||||
# Obtain compiler/linker options for the driver dependencies
|
||||
PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.20]) # libdrm_intel is checked separately
|
||||
PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
|
||||
|
||||
LIBS=""
|
||||
AC_SEARCH_LIBS(clock_gettime, rt, [CLOCK_GETTIME_LIBS=$LIBS])
|
||||
AC_SUBST(CLOCK_GETTIME_LIBS)
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@
|
|||
#include <sys/ioctl.h>
|
||||
|
||||
#include <pciaccess.h>
|
||||
|
||||
#include <xorg-server.h>
|
||||
#include <xf86.h>
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
|
|
|
|||
|
|
@ -28,9 +28,11 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <xorg-server.h>
|
||||
#include <xorgVersion.h>
|
||||
|
||||
#include <xf86.h>
|
||||
#include <xf86Parser.h>
|
||||
#include <xorgVersion.h>
|
||||
|
||||
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,6,99,0,0)
|
||||
#include <xf86Resources.h>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xaarop.h"
|
||||
#include "i810.h"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "compiler.h"
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86Pci.h"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
/*
|
||||
* These are X and server generic header files.
|
||||
*/
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86cmap.h"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "compiler.h"
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "compiler.h"
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "i810.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xaarop.h"
|
||||
#include "i810.h"
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <xorg-server.h>
|
||||
#include <picturestr.h>
|
||||
|
||||
#include "sfb.h"
|
||||
|
|
|
|||
|
|
@ -108,8 +108,10 @@ static const struct formatinfo {
|
|||
{PICT_x8r8g8b8, 0, MAPSURF_32BIT | MT_32BIT_XRGB8888, false},
|
||||
{PICT_a8b8g8r8, 0, MAPSURF_32BIT | MT_32BIT_ABGR8888, false},
|
||||
{PICT_x8b8g8r8, 0, MAPSURF_32BIT | MT_32BIT_XBGR8888, false},
|
||||
#ifdef PICT_a2r10g10b10
|
||||
{PICT_a2r10g10b10, PICT_x2r10g10b10, MAPSURF_32BIT | MT_32BIT_ARGB2101010, false},
|
||||
{PICT_a2b10g10r10, PICT_x2b10g10r10, MAPSURF_32BIT | MT_32BIT_ABGR2101010, false},
|
||||
#endif
|
||||
{PICT_r5g6b5, 0, MAPSURF_16BIT | MT_16BIT_RGB565, false},
|
||||
{PICT_b5g6r5, 0, MAPSURF_16BIT | MT_16BIT_RGB565, true},
|
||||
{PICT_a1r5g5b5, PICT_x1r5g5b5, MAPSURF_16BIT | MT_16BIT_ARGB1555, false},
|
||||
|
|
@ -206,10 +208,12 @@ static bool gen3_check_dst_format(uint32_t format)
|
|||
case PICT_x1r5g5b5:
|
||||
case PICT_a1b5g5r5:
|
||||
case PICT_x1b5g5r5:
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
case PICT_x2r10g10b10:
|
||||
case PICT_a2b10g10r10:
|
||||
case PICT_x2b10g10r10:
|
||||
#endif
|
||||
case PICT_a8:
|
||||
case PICT_a4r4g4b4:
|
||||
case PICT_x4r4g4b4:
|
||||
|
|
@ -229,8 +233,10 @@ static bool gen3_dst_rb_reversed(uint32_t format)
|
|||
case PICT_r5g6b5:
|
||||
case PICT_a1r5g5b5:
|
||||
case PICT_x1r5g5b5:
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
case PICT_x2r10g10b10:
|
||||
#endif
|
||||
case PICT_a8:
|
||||
case PICT_a4r4g4b4:
|
||||
case PICT_x4r4g4b4:
|
||||
|
|
@ -261,11 +267,13 @@ static uint32_t gen3_get_dst_format(uint32_t format)
|
|||
case PICT_a1b5g5r5:
|
||||
case PICT_x1b5g5r5:
|
||||
return BIAS | COLR_BUF_ARGB1555;
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
case PICT_x2r10g10b10:
|
||||
case PICT_a2b10g10r10:
|
||||
case PICT_x2b10g10r10:
|
||||
return BIAS | COLR_BUF_ARGB2AAA;
|
||||
#endif
|
||||
case PICT_a8:
|
||||
return BIAS | COLR_BUF_8BIT;
|
||||
case PICT_a4r4g4b4:
|
||||
|
|
@ -285,8 +293,10 @@ static bool gen3_check_format(PicturePtr p)
|
|||
case PICT_x8r8g8b8:
|
||||
case PICT_a8b8g8r8:
|
||||
case PICT_x8b8g8r8:
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
case PICT_a2b10g10r10:
|
||||
#endif
|
||||
case PICT_r5g6b5:
|
||||
case PICT_b5g6r5:
|
||||
case PICT_a1r5g5b5:
|
||||
|
|
@ -312,10 +322,12 @@ static bool gen3_check_xformat(PicturePtr p)
|
|||
case PICT_x1r5g5b5:
|
||||
case PICT_a1b5g5r5:
|
||||
case PICT_x1b5g5r5:
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
case PICT_x2r10g10b10:
|
||||
case PICT_a2b10g10r10:
|
||||
case PICT_x2b10g10r10:
|
||||
#endif
|
||||
case PICT_a8:
|
||||
case PICT_a4r4g4b4:
|
||||
case PICT_x4r4g4b4:
|
||||
|
|
|
|||
|
|
@ -293,10 +293,12 @@ static uint32_t gen4_get_card_format(PictFormat format)
|
|||
return GEN4_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
case PICT_x8b8g8r8:
|
||||
return GEN4_SURFACEFORMAT_R8G8B8X8_UNORM;
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
return GEN4_SURFACEFORMAT_B10G10R10A2_UNORM;
|
||||
case PICT_x2r10g10b10:
|
||||
return GEN4_SURFACEFORMAT_B10G10R10X2_UNORM;
|
||||
#endif
|
||||
case PICT_r8g8b8:
|
||||
return GEN4_SURFACEFORMAT_R8G8B8_UNORM;
|
||||
case PICT_r5g6b5:
|
||||
|
|
@ -321,9 +323,11 @@ static uint32_t gen4_get_dest_format(PictFormat format)
|
|||
case PICT_a8b8g8r8:
|
||||
case PICT_x8b8g8r8:
|
||||
return GEN4_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
case PICT_x2r10g10b10:
|
||||
return GEN4_SURFACEFORMAT_B10G10R10A2_UNORM;
|
||||
#endif
|
||||
case PICT_r5g6b5:
|
||||
return GEN4_SURFACEFORMAT_B5G6R5_UNORM;
|
||||
case PICT_x1r5g5b5:
|
||||
|
|
|
|||
|
|
@ -282,10 +282,12 @@ static uint32_t gen5_get_card_format(PictFormat format)
|
|||
return GEN5_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
case PICT_x8b8g8r8:
|
||||
return GEN5_SURFACEFORMAT_R8G8B8X8_UNORM;
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
return GEN5_SURFACEFORMAT_B10G10R10A2_UNORM;
|
||||
case PICT_x2r10g10b10:
|
||||
return GEN5_SURFACEFORMAT_B10G10R10X2_UNORM;
|
||||
#endif
|
||||
case PICT_r8g8b8:
|
||||
return GEN5_SURFACEFORMAT_R8G8B8_UNORM;
|
||||
case PICT_r5g6b5:
|
||||
|
|
@ -310,9 +312,11 @@ static uint32_t gen5_get_dest_format(PictFormat format)
|
|||
case PICT_a8b8g8r8:
|
||||
case PICT_x8b8g8r8:
|
||||
return GEN5_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
case PICT_x2r10g10b10:
|
||||
return GEN5_SURFACEFORMAT_B10G10R10A2_UNORM;
|
||||
#endif
|
||||
case PICT_r5g6b5:
|
||||
return GEN5_SURFACEFORMAT_B5G6R5_UNORM;
|
||||
case PICT_x1r5g5b5:
|
||||
|
|
|
|||
|
|
@ -258,10 +258,12 @@ static uint32_t gen6_get_card_format(PictFormat format)
|
|||
return GEN6_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
case PICT_x8b8g8r8:
|
||||
return GEN6_SURFACEFORMAT_R8G8B8X8_UNORM;
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
return GEN6_SURFACEFORMAT_B10G10R10A2_UNORM;
|
||||
case PICT_x2r10g10b10:
|
||||
return GEN6_SURFACEFORMAT_B10G10R10X2_UNORM;
|
||||
#endif
|
||||
case PICT_r8g8b8:
|
||||
return GEN6_SURFACEFORMAT_R8G8B8_UNORM;
|
||||
case PICT_r5g6b5:
|
||||
|
|
@ -286,9 +288,11 @@ static uint32_t gen6_get_dest_format(PictFormat format)
|
|||
case PICT_a8b8g8r8:
|
||||
case PICT_x8b8g8r8:
|
||||
return GEN6_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
case PICT_x2r10g10b10:
|
||||
return GEN6_SURFACEFORMAT_B10G10R10A2_UNORM;
|
||||
#endif
|
||||
case PICT_r5g6b5:
|
||||
return GEN6_SURFACEFORMAT_B5G6R5_UNORM;
|
||||
case PICT_x1r5g5b5:
|
||||
|
|
|
|||
|
|
@ -347,10 +347,12 @@ static uint32_t gen7_get_card_format(PictFormat format)
|
|||
return GEN7_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
case PICT_x8b8g8r8:
|
||||
return GEN7_SURFACEFORMAT_R8G8B8X8_UNORM;
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
return GEN7_SURFACEFORMAT_B10G10R10A2_UNORM;
|
||||
case PICT_x2r10g10b10:
|
||||
return GEN7_SURFACEFORMAT_B10G10R10X2_UNORM;
|
||||
#endif
|
||||
case PICT_r8g8b8:
|
||||
return GEN7_SURFACEFORMAT_R8G8B8_UNORM;
|
||||
case PICT_r5g6b5:
|
||||
|
|
@ -375,9 +377,11 @@ static uint32_t gen7_get_dest_format(PictFormat format)
|
|||
case PICT_a8b8g8r8:
|
||||
case PICT_x8b8g8r8:
|
||||
return GEN7_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
#ifdef PICT_a2r10g10b10
|
||||
case PICT_a2r10g10b10:
|
||||
case PICT_x2r10g10b10:
|
||||
return GEN7_SURFACEFORMAT_B10G10R10A2_UNORM;
|
||||
#endif
|
||||
case PICT_r5g6b5:
|
||||
return GEN7_SURFACEFORMAT_B5G6R5_UNORM;
|
||||
case PICT_x1r5g5b5:
|
||||
|
|
|
|||
|
|
@ -37,22 +37,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#ifndef _SNA_H_
|
||||
#define _SNA_H_
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "compiler.h"
|
||||
|
||||
#include <xorg-server.h>
|
||||
#include <xf86str.h>
|
||||
|
||||
#include <xf86Crtc.h>
|
||||
#if XF86_CRTC_VERSION >= 5
|
||||
#define HAS_PIXMAP_SHARING 1
|
||||
#endif
|
||||
|
||||
#include <xf86str.h>
|
||||
#include <windowstr.h>
|
||||
#include <glyphstr.h>
|
||||
#include <picturestr.h>
|
||||
|
|
@ -75,6 +69,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <libudev.h>
|
||||
#endif
|
||||
|
||||
#include "compiler.h"
|
||||
|
||||
#if HAS_DEBUG_FULL
|
||||
#define DBG(x) ErrorF x
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -29,12 +29,13 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "intel_options.h"
|
||||
#include "sna.h"
|
||||
#include "sna_reg.h"
|
||||
#include "sna_video.h"
|
||||
#include "rop.h"
|
||||
|
||||
#include "intel_options.h"
|
||||
|
||||
#include <X11/fonts/font.h>
|
||||
#include <X11/fonts/fontstruct.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@
|
|||
#define NO_BLT_FILL 0
|
||||
#define NO_BLT_FILL_BOXES 0
|
||||
|
||||
#ifndef PICT_TYPE_BGRA
|
||||
#define PICT_TYPE_BGRA 8
|
||||
#endif
|
||||
|
||||
static const uint8_t copy_ROP[] = {
|
||||
ROP_0, /* GXclear */
|
||||
ROP_DSa, /* GXand */
|
||||
|
|
|
|||
|
|
@ -39,21 +39,37 @@
|
|||
#include <poll.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <xorgVersion.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/extensions/dpmsconst.h>
|
||||
#include <xf86drm.h>
|
||||
#include <xf86DDC.h> /* for xf86InterpretEDID */
|
||||
#include <xf86Opt.h> /* for xf86OptionPtr */
|
||||
|
||||
#include "sna.h"
|
||||
#include "sna_reg.h"
|
||||
#include "fb/fbpict.h"
|
||||
|
||||
#include <xf86Crtc.h>
|
||||
|
||||
#if XF86_CRTC_VERSION >= 3
|
||||
#define HAS_GAMMA 1
|
||||
#else
|
||||
#define HAS_GAMMA 0
|
||||
#endif
|
||||
|
||||
#include <X11/Xatom.h>
|
||||
#if defined(HAVE_X11_EXTENSIONS_DPMSCONST_H)
|
||||
#include <X11/extensions/dpmsconst.h>
|
||||
#else
|
||||
#define DPMSModeOn 0
|
||||
#define DPMSModeOff 3
|
||||
#endif
|
||||
#include <xf86drm.h>
|
||||
#include <xf86DDC.h> /* for xf86InterpretEDID */
|
||||
#include <xf86Opt.h> /* for xf86OptionPtr */
|
||||
|
||||
#include "intel_options.h"
|
||||
|
||||
#define KNOWN_MODE_FLAGS ((1<<14)-1)
|
||||
|
||||
#ifndef MONITOR_EDID_COMPLETE_RAWDATA
|
||||
#define MONITOR_EDID_COMPLETE_RAWDATA 1
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_DPI
|
||||
#define DEFAULT_DPI 96
|
||||
#endif
|
||||
|
|
@ -1426,11 +1442,13 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
|
|||
assert(mode->HDisplay <= sna->mode.kmode->max_width &&
|
||||
mode->VDisplay <= sna->mode.kmode->max_height);
|
||||
|
||||
#if HAS_GAMMA
|
||||
drmModeCrtcSetGamma(sna->kgem.fd, sna_crtc->id,
|
||||
crtc->gamma_size,
|
||||
crtc->gamma_red,
|
||||
crtc->gamma_green,
|
||||
crtc->gamma_blue);
|
||||
#endif
|
||||
|
||||
saved_kmode = sna_crtc->kmode;
|
||||
saved_bo = sna_crtc->bo;
|
||||
|
|
@ -1634,7 +1652,9 @@ sna_crtc_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr pixmap)
|
|||
#endif
|
||||
|
||||
static const xf86CrtcFuncsRec sna_crtc_funcs = {
|
||||
#if XF86_CRTC_VERSION >= 1
|
||||
.dpms = sna_crtc_dpms,
|
||||
#endif
|
||||
.set_mode_major = sna_crtc_set_mode_major,
|
||||
.set_cursor_colors = sna_crtc_set_cursor_colors,
|
||||
.set_cursor_position = sna_crtc_set_cursor_position,
|
||||
|
|
@ -1944,6 +1964,16 @@ done:
|
|||
}
|
||||
}
|
||||
|
||||
static DisplayModePtr
|
||||
default_modes(void)
|
||||
{
|
||||
#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,6,99,900,0)
|
||||
return xf86GetDefaultModes();
|
||||
#else
|
||||
return xf86GetDefaultModes(0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static DisplayModePtr
|
||||
sna_output_panel_edid(xf86OutputPtr output, DisplayModePtr modes)
|
||||
{
|
||||
|
|
@ -1966,7 +1996,7 @@ sna_output_panel_edid(xf86OutputPtr output, DisplayModePtr modes)
|
|||
max_vrefresh = max(max_vrefresh, 60.0);
|
||||
max_vrefresh *= (1 + SYNC_TOLERANCE);
|
||||
|
||||
m = xf86GetDefaultModes();
|
||||
m = default_modes();
|
||||
xf86ValidateModesSize(output->scrn, m, max_x, max_y, 0);
|
||||
|
||||
for (i = m; i; i = i->next) {
|
||||
|
|
@ -2945,6 +2975,7 @@ enum { /* XXX copied from hw/xfree86/modes/xf86Crtc.c */
|
|||
OPTION_DEFAULT_MODES,
|
||||
};
|
||||
|
||||
#if HAS_GAMMA
|
||||
static void set_gamma(uint16_t *curve, int size, double value)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -2954,7 +2985,7 @@ static void set_gamma(uint16_t *curve, int size, double value)
|
|||
curve[i] = 256*(size-1)*pow(i/(double)(size-1), value);
|
||||
}
|
||||
|
||||
static void set_initial_gamma(xf86OutputPtr output, xf86CrtcPtr crtc)
|
||||
static void output_set_gamma(xf86OutputPtr output, xf86CrtcPtr crtc)
|
||||
{
|
||||
XF86ConfMonitorPtr mon = output->conf_monitor;
|
||||
|
||||
|
|
@ -2983,6 +3014,60 @@ static void set_initial_gamma(xf86OutputPtr output, xf86CrtcPtr crtc)
|
|||
mon->mon_gamma_blue);
|
||||
}
|
||||
|
||||
static void crtc_init_gamma(xf86CrtcPtr crtc)
|
||||
{
|
||||
uint16_t *gamma;
|
||||
|
||||
/* Initialize the gamma ramps */
|
||||
gamma = NULL;
|
||||
if (crtc->gamma_size == 256)
|
||||
gamma = crtc->gamma_red;
|
||||
if (gamma == NULL)
|
||||
gamma = malloc(3 * 256 * sizeof(uint16_t));
|
||||
if (gamma) {
|
||||
struct sna *sna = to_sna(crtc->scrn);
|
||||
struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
|
||||
struct drm_mode_crtc_lut lut;
|
||||
bool gamma_set = false;
|
||||
|
||||
lut.crtc_id = sna_crtc->id;
|
||||
lut.gamma_size = 256;
|
||||
lut.red = (uintptr_t)(gamma);
|
||||
lut.green = (uintptr_t)(gamma + 256);
|
||||
lut.blue = (uintptr_t)(gamma + 2 * 256);
|
||||
if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETGAMMA, &lut) == 0) {
|
||||
gamma_set =
|
||||
gamma[256 - 1] &&
|
||||
gamma[2*256 - 1] &&
|
||||
gamma[3*256 - 1];
|
||||
}
|
||||
|
||||
DBG(("%s: CRTC:%d, pipe=%d: gamma set?=%d\n",
|
||||
__FUNCTION__, sna_crtc->id, sna_crtc->pipe,
|
||||
gamma_set));
|
||||
if (!gamma_set) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
gamma[i] = i << 8;
|
||||
gamma[256 + i] = i << 8;
|
||||
gamma[2*256 + i] = i << 8;
|
||||
}
|
||||
}
|
||||
|
||||
if (gamma != crtc->gamma_red) {
|
||||
free(crtc->gamma_red);
|
||||
crtc->gamma_red = gamma;
|
||||
crtc->gamma_green = gamma + 256;
|
||||
crtc->gamma_blue = gamma + 2*256;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void output_set_gamma(xf86OutputPtr output, xf86CrtcPtr crtc) { }
|
||||
static void crtc_init_gamma(xf86CrtcPtr crtc) { }
|
||||
#endif
|
||||
|
||||
static bool sna_probe_initial_configuration(struct sna *sna)
|
||||
{
|
||||
ScrnInfoPtr scrn = sna->scrn;
|
||||
|
|
@ -3036,7 +3121,6 @@ static bool sna_probe_initial_configuration(struct sna *sna)
|
|||
xf86CrtcPtr crtc = config->crtc[i];
|
||||
struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
|
||||
struct drm_mode_crtc mode;
|
||||
uint16_t *gamma;
|
||||
|
||||
if (sna_crtc == NULL)
|
||||
continue;
|
||||
|
|
@ -3044,46 +3128,7 @@ static bool sna_probe_initial_configuration(struct sna *sna)
|
|||
crtc->enabled = FALSE;
|
||||
crtc->desiredMode.status = MODE_NOMODE;
|
||||
|
||||
/* Initialize the gamma ramps */
|
||||
gamma = NULL;
|
||||
if (crtc->gamma_size == 256)
|
||||
gamma = crtc->gamma_red;
|
||||
if (gamma == NULL)
|
||||
gamma = malloc(3 * 256 * sizeof(uint16_t));
|
||||
if (gamma) {
|
||||
struct drm_mode_crtc_lut lut;
|
||||
bool gamma_set = false;
|
||||
|
||||
lut.crtc_id = sna_crtc->id;
|
||||
lut.gamma_size = 256;
|
||||
lut.red = (uintptr_t)(gamma);
|
||||
lut.green = (uintptr_t)(gamma + 256);
|
||||
lut.blue = (uintptr_t)(gamma + 2 * 256);
|
||||
if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETGAMMA, &lut) == 0) {
|
||||
gamma_set =
|
||||
gamma[256 - 1] &&
|
||||
gamma[2*256 - 1] &&
|
||||
gamma[3*256 - 1];
|
||||
}
|
||||
|
||||
DBG(("%s: CRTC:%d, pipe=%d: gamma set?=%d\n",
|
||||
__FUNCTION__, sna_crtc->id, sna_crtc->pipe,
|
||||
gamma_set));
|
||||
if (!gamma_set) {
|
||||
for (j = 0; j < 256; j++) {
|
||||
gamma[j] = j << 8;
|
||||
gamma[256 + j] = j << 8;
|
||||
gamma[2*256 + j] = j << 8;
|
||||
}
|
||||
}
|
||||
|
||||
if (gamma != crtc->gamma_red) {
|
||||
free(crtc->gamma_red);
|
||||
crtc->gamma_red = gamma;
|
||||
crtc->gamma_green = gamma + 256;
|
||||
crtc->gamma_blue = gamma + 2*256;
|
||||
}
|
||||
}
|
||||
crtc_init_gamma(crtc);
|
||||
|
||||
/* Retrieve the current mode */
|
||||
VG_CLEAR(mode);
|
||||
|
|
@ -3145,7 +3190,7 @@ static bool sna_probe_initial_configuration(struct sna *sna)
|
|||
output->mm_width = (crtc->desiredMode.HDisplay * 254) / (10*DEFAULT_DPI);
|
||||
}
|
||||
|
||||
set_initial_gamma(output, crtc);
|
||||
output_set_gamma(output, crtc);
|
||||
|
||||
M = calloc(1, sizeof(DisplayModeRec));
|
||||
if (M) {
|
||||
|
|
@ -3700,7 +3745,9 @@ void sna_mode_update(struct sna *sna)
|
|||
if (sna_crtc == NULL)
|
||||
continue;
|
||||
|
||||
#if XF86_CRTC_VERSION >= 3
|
||||
assert(sna_crtc->bo == NULL || crtc->active);
|
||||
#endif
|
||||
expected = sna_crtc->bo ? fb_id(sna_crtc->bo) : 0;
|
||||
|
||||
VG_CLEAR(mode);
|
||||
|
|
|
|||
|
|
@ -48,9 +48,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <xf86drm.h>
|
||||
#include <i915_drm.h>
|
||||
#include <dri2.h>
|
||||
#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0)
|
||||
#include <compositeext.h>
|
||||
#endif
|
||||
|
||||
#if DRI2INFOREC_VERSION <= 2
|
||||
#if DRI2INFOREC_VERSION < 2
|
||||
#error DRI2 version supported by the Xserver is too old
|
||||
#endif
|
||||
|
||||
|
|
@ -70,34 +72,6 @@ enum frame_event_type {
|
|||
DRI2_FLIP_THROTTLE,
|
||||
};
|
||||
|
||||
struct sna_dri_frame_event {
|
||||
DrawablePtr draw;
|
||||
ClientPtr client;
|
||||
enum frame_event_type type;
|
||||
int pipe;
|
||||
int count;
|
||||
|
||||
/* for swaps & flips only */
|
||||
DRI2SwapEventPtr event_complete;
|
||||
void *event_data;
|
||||
DRI2BufferPtr front;
|
||||
DRI2BufferPtr back;
|
||||
struct kgem_bo *bo;
|
||||
|
||||
struct sna_dri_frame_event *chain;
|
||||
|
||||
unsigned int fe_frame;
|
||||
unsigned int fe_tv_sec;
|
||||
unsigned int fe_tv_usec;
|
||||
|
||||
struct dri_bo {
|
||||
struct kgem_bo *bo;
|
||||
uint32_t name;
|
||||
} scanout[2], cache;
|
||||
|
||||
int mode;
|
||||
};
|
||||
|
||||
struct sna_dri_private {
|
||||
PixmapPtr pixmap;
|
||||
struct kgem_bo *bo;
|
||||
|
|
@ -106,16 +80,10 @@ struct sna_dri_private {
|
|||
int refcnt;
|
||||
};
|
||||
|
||||
static inline struct sna_dri_frame_event *
|
||||
to_frame_event(uintptr_t data)
|
||||
{
|
||||
return (struct sna_dri_frame_event *)(data & ~1);
|
||||
}
|
||||
|
||||
static inline struct sna_dri_private *
|
||||
get_private(DRI2Buffer2Ptr buffer)
|
||||
get_private(void *buffer)
|
||||
{
|
||||
return (struct sna_dri_private *)(buffer+1);
|
||||
return (struct sna_dri_private *)((DRI2Buffer2Ptr)buffer+1);
|
||||
}
|
||||
|
||||
static inline struct kgem_bo *ref(struct kgem_bo *bo)
|
||||
|
|
@ -208,7 +176,7 @@ static inline void sna_pixmap_set_buffer(PixmapPtr pixmap, void *ptr)
|
|||
void
|
||||
sna_dri_pixmap_update_bo(struct sna *sna, PixmapPtr pixmap)
|
||||
{
|
||||
DRI2Buffer2Ptr buffer;
|
||||
DRI2BufferPtr buffer;
|
||||
struct sna_dri_private *private;
|
||||
struct kgem_bo *bo;
|
||||
|
||||
|
|
@ -481,7 +449,7 @@ static void sna_dri_destroy_buffer(DrawablePtr draw, DRI2Buffer2Ptr buffer)
|
|||
_sna_dri_destroy_buffer(to_sna_from_drawable(draw), buffer);
|
||||
}
|
||||
|
||||
static void sna_dri_reference_buffer(DRI2Buffer2Ptr buffer)
|
||||
static void sna_dri_reference_buffer(DRI2BufferPtr buffer)
|
||||
{
|
||||
get_private(buffer)->refcnt++;
|
||||
}
|
||||
|
|
@ -647,7 +615,7 @@ sna_dri_copy_fallback(struct sna *sna, int bpp,
|
|||
|
||||
static struct kgem_bo *
|
||||
__sna_dri_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region,
|
||||
DRI2Buffer2Ptr src, DRI2Buffer2Ptr dst,
|
||||
DRI2BufferPtr src, DRI2BufferPtr dst,
|
||||
bool sync)
|
||||
{
|
||||
PixmapPtr pixmap = get_drawable_pixmap(draw);
|
||||
|
|
@ -886,6 +854,41 @@ static inline int sna_wait_vblank(struct sna *sna, drmVBlank *vbl)
|
|||
|
||||
#if DRI2INFOREC_VERSION >= 4
|
||||
|
||||
struct sna_dri_frame_event {
|
||||
DrawablePtr draw;
|
||||
ClientPtr client;
|
||||
enum frame_event_type type;
|
||||
int pipe;
|
||||
int count;
|
||||
|
||||
/* for swaps & flips only */
|
||||
DRI2SwapEventPtr event_complete;
|
||||
void *event_data;
|
||||
DRI2BufferPtr front;
|
||||
DRI2BufferPtr back;
|
||||
struct kgem_bo *bo;
|
||||
|
||||
struct sna_dri_frame_event *chain;
|
||||
|
||||
unsigned int fe_frame;
|
||||
unsigned int fe_tv_sec;
|
||||
unsigned int fe_tv_usec;
|
||||
|
||||
struct dri_bo {
|
||||
struct kgem_bo *bo;
|
||||
uint32_t name;
|
||||
} scanout[2], cache;
|
||||
|
||||
int mode;
|
||||
};
|
||||
|
||||
|
||||
static inline struct sna_dri_frame_event *
|
||||
to_frame_event(uintptr_t data)
|
||||
{
|
||||
return (struct sna_dri_frame_event *)(data & ~1);
|
||||
}
|
||||
|
||||
static int
|
||||
sna_dri_get_pipe(DrawablePtr draw)
|
||||
{
|
||||
|
|
@ -2253,6 +2256,8 @@ out_complete:
|
|||
DRI2WaitMSCComplete(client, draw, target_msc, 0, 0);
|
||||
return TRUE;
|
||||
}
|
||||
#else
|
||||
void sna_dri_destroy_window(WindowPtr win) { }
|
||||
#endif
|
||||
|
||||
static bool has_i830_dri(void)
|
||||
|
|
@ -2260,12 +2265,79 @@ static bool has_i830_dri(void)
|
|||
return access(DRI_DRIVER_PATH "/i830_dri.so", R_OK) == 0;
|
||||
}
|
||||
|
||||
static int
|
||||
namecmp(const char *s1, const char *s2)
|
||||
{
|
||||
char c1, c2;
|
||||
|
||||
if (!s1 || *s1 == 0) {
|
||||
if (!s2 || *s2 == 0)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
|
||||
s1++;
|
||||
|
||||
while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
|
||||
s2++;
|
||||
|
||||
c1 = isupper(*s1) ? tolower(*s1) : *s1;
|
||||
c2 = isupper(*s2) ? tolower(*s2) : *s2;
|
||||
while (c1 == c2) {
|
||||
if (c1 == '\0')
|
||||
return 0;
|
||||
|
||||
s1++;
|
||||
while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
|
||||
s1++;
|
||||
|
||||
s2++;
|
||||
while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
|
||||
s2++;
|
||||
|
||||
c1 = isupper(*s1) ? tolower(*s1) : *s1;
|
||||
c2 = isupper(*s2) ? tolower(*s2) : *s2;
|
||||
}
|
||||
|
||||
return c1 - c2;
|
||||
}
|
||||
|
||||
static bool is_bool(const char *str)
|
||||
{
|
||||
if (str == NULL)
|
||||
return true;
|
||||
|
||||
if (*str == '\0')
|
||||
return true;
|
||||
|
||||
if (namecmp(str, "1") == 0)
|
||||
return true;
|
||||
if (namecmp(str, "on") == 0)
|
||||
return true;
|
||||
if (namecmp(str, "true") == 0)
|
||||
return true;
|
||||
if (namecmp(str, "yes") == 0)
|
||||
return true;
|
||||
|
||||
if (namecmp(str, "0") == 0)
|
||||
return true;
|
||||
if (namecmp(str, "off") == 0)
|
||||
return true;
|
||||
if (namecmp(str, "false") == 0)
|
||||
return true;
|
||||
if (namecmp(str, "no") == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static const char *dri_driver_name(struct sna *sna)
|
||||
{
|
||||
const char *s = xf86GetOptValString(sna->Options, OPTION_DRI);
|
||||
Bool dummy;
|
||||
|
||||
if (s == NULL || xf86getBoolValue(&dummy, s)) {
|
||||
if (is_bool(s)) {
|
||||
if (sna->kgem.gen < 030)
|
||||
return has_i830_dri() ? "i830" : "i915";
|
||||
else if (sna->kgem.gen < 040)
|
||||
|
|
@ -2309,7 +2381,14 @@ bool sna_dri_open(struct sna *sna, ScreenPtr screen)
|
|||
DBG(("%s: loading dri driver '%s' [gen=%d] for device '%s'\n",
|
||||
__FUNCTION__, info.driverName, sna->kgem.gen, info.deviceName));
|
||||
|
||||
#if DRI2INFOREC_VERSION == 2
|
||||
/* The ABI between 2 and 3 was broken so we could get rid of
|
||||
* the multi-buffer alloc functions. Make sure we indicate the
|
||||
* right version so DRI2 can reject us if it's version 3 or above. */
|
||||
info.version = 2;
|
||||
#else
|
||||
info.version = 3;
|
||||
#endif
|
||||
info.CreateBuffer = sna_dri_create_buffer;
|
||||
info.DestroyBuffer = sna_dri_destroy_buffer;
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,13 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "sna.h"
|
||||
#include "sna_module.h"
|
||||
#include "sna_video.h"
|
||||
|
||||
#include "intel_driver.h"
|
||||
#include "intel_options.h"
|
||||
|
||||
#include <xf86cmap.h>
|
||||
#include <xf86drm.h>
|
||||
#include <xf86RandR12.h>
|
||||
|
|
@ -52,13 +59,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <micmap.h>
|
||||
#include <mipict.h>
|
||||
|
||||
#include "compiler.h"
|
||||
#include "sna.h"
|
||||
#include "sna_module.h"
|
||||
#include "sna_video.h"
|
||||
|
||||
#include "intel_driver.h"
|
||||
#include "intel_options.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/fcntl.h>
|
||||
|
|
@ -338,9 +338,73 @@ static void sna_setup_capabilities(ScrnInfoPtr scrn, int fd)
|
|||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
namecmp(const char *s1, const char *s2)
|
||||
{
|
||||
char c1, c2;
|
||||
|
||||
if (!s1 || *s1 == 0) {
|
||||
if (!s2 || *s2 == 0)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
|
||||
s1++;
|
||||
|
||||
while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
|
||||
s2++;
|
||||
|
||||
c1 = isupper(*s1) ? tolower(*s1) : *s1;
|
||||
c2 = isupper(*s2) ? tolower(*s2) : *s2;
|
||||
while (c1 == c2) {
|
||||
if (c1 == '\0')
|
||||
return 0;
|
||||
|
||||
s1++;
|
||||
while (*s1 == '_' || *s1 == ' ' || *s1 == '\t')
|
||||
s1++;
|
||||
|
||||
s2++;
|
||||
while (*s2 == '_' || *s2 == ' ' || *s2 == '\t')
|
||||
s2++;
|
||||
|
||||
c1 = isupper(*s1) ? tolower(*s1) : *s1;
|
||||
c2 = isupper(*s2) ? tolower(*s2) : *s2;
|
||||
}
|
||||
|
||||
return c1 - c2;
|
||||
}
|
||||
|
||||
static Bool sna_option_cast_to_bool(struct sna *sna, int id, Bool val)
|
||||
{
|
||||
xf86getBoolValue(&val, xf86GetOptValString(sna->Options, id));
|
||||
const char *str = xf86GetOptValString(sna->Options, id);
|
||||
|
||||
if (str == NULL)
|
||||
return val;
|
||||
|
||||
if (*str == '\0')
|
||||
return TRUE;
|
||||
|
||||
if (namecmp(str, "1") == 0)
|
||||
return TRUE;
|
||||
if (namecmp(str, "on") == 0)
|
||||
return TRUE;
|
||||
if (namecmp(str, "true") == 0)
|
||||
return TRUE;
|
||||
if (namecmp(str, "yes") == 0)
|
||||
return TRUE;
|
||||
|
||||
if (namecmp(str, "0") == 0)
|
||||
return FALSE;
|
||||
if (namecmp(str, "off") == 0)
|
||||
return FALSE;
|
||||
if (namecmp(str, "false") == 0)
|
||||
return FALSE;
|
||||
if (namecmp(str, "no") == 0)
|
||||
return FALSE;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "sna.h"
|
||||
#include "sna_render.h"
|
||||
#include "sna_render_inline.h"
|
||||
|
|
@ -56,7 +60,9 @@ sna_format_for_depth(int depth)
|
|||
case 16: return PICT_r5g6b5;
|
||||
default: assert(0);
|
||||
case 24: return PICT_x8r8g8b8;
|
||||
#ifdef PICT_x2r10g10b10
|
||||
case 30: return PICT_x2r10g10b10;
|
||||
#endif
|
||||
case 32: return PICT_a8r8g8b8;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "sna.h"
|
||||
#include "sna_render.h"
|
||||
#include "brw/brw.h"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "sna.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "sna.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "intel.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "intel.h"
|
||||
#include "i830_reg.h"
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "intel.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "intel.h"
|
||||
#include "i915_reg.h"
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86xv.h"
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "intel.h"
|
||||
#include "i830_reg.h"
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86xv.h"
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#ifndef _I830_H_
|
||||
#define _I830_H_
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "compiler.h"
|
||||
#include "xf86Pci.h"
|
||||
|
|
@ -63,6 +64,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <pciaccess.h>
|
||||
|
||||
#define _XF86DRI_SERVER_
|
||||
#include "drm.h"
|
||||
#include "dri2.h"
|
||||
#include "intel_bufmgr.h"
|
||||
#include "i915_drm.h"
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "intel.h"
|
||||
#include "i830_reg.h"
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include <poll.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xorgVersion.h"
|
||||
|
||||
#include "intel.h"
|
||||
|
|
@ -46,7 +47,12 @@
|
|||
#include "xf86drm.h"
|
||||
#include "xf86drmMode.h"
|
||||
#include "X11/Xatom.h"
|
||||
#include "X11/extensions/dpmsconst.h"
|
||||
#if defined(HAVE_X11_EXTENSIONS_DPMSCONST_H)
|
||||
#include <X11/extensions/dpmsconst.h>
|
||||
#else
|
||||
#define DPMSModeOn 0
|
||||
#define DPMSModeOff 3
|
||||
#endif
|
||||
#include "xf86DDC.h"
|
||||
#include "fb.h"
|
||||
#include "uxa.h"
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
|
|
@ -1530,6 +1531,7 @@ static int has_i830_dri(void)
|
|||
|
||||
static const char *dri_driver_name(intel_screen_private *intel)
|
||||
{
|
||||
#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,7,99,901,0)
|
||||
const char *s = xf86GetOptValString(intel->Options, OPTION_DRI);
|
||||
Bool dummy;
|
||||
|
||||
|
|
@ -1543,6 +1545,14 @@ static const char *dri_driver_name(intel_screen_private *intel)
|
|||
}
|
||||
|
||||
return s;
|
||||
#else
|
||||
if (INTEL_INFO(intel)->gen < 030)
|
||||
return has_i830_dri() ? "i830" : "i915";
|
||||
else if (INTEL_INFO(intel)->gen < 040)
|
||||
return "i915";
|
||||
else
|
||||
return "i965";
|
||||
#endif
|
||||
}
|
||||
|
||||
Bool I830DRI2ScreenInit(ScreenPtr screen)
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "xf86cmap.h"
|
||||
|
|
@ -54,7 +55,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include "micmap.h"
|
||||
#include "shadowfb.h"
|
||||
#include <X11/extensions/randr.h>
|
||||
#include <X11/extensions/dpmsconst.h>
|
||||
#include "fb.h"
|
||||
#include "miscstruct.h"
|
||||
#include "dixstruct.h"
|
||||
|
|
@ -225,8 +225,12 @@ static Bool I830GetEarlyOptions(ScrnInfoPtr scrn)
|
|||
static Bool intel_option_cast_string_to_bool(intel_screen_private *intel,
|
||||
int id, Bool val)
|
||||
{
|
||||
#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,7,99,901,0)
|
||||
xf86getBoolValue(&val, xf86GetOptValString(intel->Options, id));
|
||||
return val;
|
||||
#else
|
||||
return val;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void intel_check_dri_option(ScrnInfoPtr scrn)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include <xf86.h>
|
||||
#define GLAMOR_FOR_XORG 1
|
||||
#include <glamor.h>
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include <xf86.h>
|
||||
#include <xf86drm.h>
|
||||
#include <xaarop.h>
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "xorg-server.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86_OSproc.h"
|
||||
#include "compiler.h"
|
||||
|
|
|
|||
|
|
@ -22,17 +22,25 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include <X11/Xlibint.h>
|
||||
#include <X11/extensions/record.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
#if HAVE_X11_EXTENSIONS_SHMPROTO_H
|
||||
#include <X11/extensions/shmproto.h>
|
||||
#elif HAVE_X11_EXTENSIONS_SHMSTR_H
|
||||
#include <X11/extensions/shmstr.h>
|
||||
#endif
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
#include <X11/extensions/Xinerama.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#include <X11/extensions/Xrender.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
#include <pixman.h>
|
||||
|
||||
|
|
@ -282,7 +290,10 @@ static int timerfd(int hz)
|
|||
struct itimerspec it;
|
||||
int fd;
|
||||
|
||||
fd = -1;
|
||||
#ifdef CLOCK_MONOTONIC_COARSE
|
||||
fd = timerfd_create(CLOCK_MONOTONIC_COARSE, TFD_NONBLOCK);
|
||||
#endif
|
||||
if (fd < 0)
|
||||
fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
|
||||
if (fd < 0)
|
||||
|
|
@ -399,8 +410,8 @@ static XRRModeInfo *lookup_mode(XRRScreenResources *res, int id)
|
|||
|
||||
static int clone_update_modes__randr(struct clone *clone)
|
||||
{
|
||||
XRRScreenResources *from_res, *to_res;
|
||||
XRROutputInfo *from_info, *to_info;
|
||||
XRRScreenResources *from_res = NULL, *to_res = NULL;
|
||||
XRROutputInfo *from_info = NULL, *to_info = NULL;
|
||||
int i, j, ret = ENOENT;
|
||||
|
||||
assert(clone->src.rr_output);
|
||||
|
|
@ -499,8 +510,8 @@ err:
|
|||
static int clone_update_modes__fixed(struct clone *clone)
|
||||
{
|
||||
char mode_name[80];
|
||||
XRRScreenResources *res;
|
||||
XRROutputInfo *info;
|
||||
XRRScreenResources *res = NULL;
|
||||
XRROutputInfo *info = NULL;
|
||||
XRRModeInfo mode;
|
||||
RRMode id;
|
||||
int i, j, ret = ENOENT;
|
||||
|
|
@ -1604,6 +1615,7 @@ static int clone_init_depth(struct clone *clone)
|
|||
DBG(("%s-%s wants depth %d\n",
|
||||
DisplayString(clone->dst.dpy), clone->dst.name, clone->depth));
|
||||
|
||||
ret = -1;
|
||||
for (depth = clone->depth; depth <= 24; depth += 8) {
|
||||
ret = display_init_render(clone->src.display, depth, &clone->src.use_render);
|
||||
if (ret)
|
||||
|
|
@ -1986,7 +1998,7 @@ static int last_display_add_clones__display(struct context *ctx)
|
|||
Display *dpy = display->dpy;
|
||||
Screen *scr;
|
||||
char buf[80];
|
||||
int n, ret;
|
||||
int ret;
|
||||
RROutput id;
|
||||
|
||||
DBG(("%s(%s)\n", __func__, DisplayString(display->dpy)));
|
||||
|
|
@ -2007,7 +2019,7 @@ static int last_display_add_clones__display(struct context *ctx)
|
|||
return ret;
|
||||
}
|
||||
|
||||
sprintf(buf, "WHOLE%d", n);
|
||||
sprintf(buf, "WHOLE");
|
||||
ret = clone_output_init(clone, &clone->dst, display, buf, 0);
|
||||
if (ret) {
|
||||
fprintf(stderr, "Failed to add display \"%s\"\n",
|
||||
|
|
|
|||
Loading…
Reference in New Issue