diff -u -r xf86-video-intel-2.2.99.901/aclocal.m4 xf86-video-intel-2.2.99.902/aclocal.m4 --- xf86-video-intel-2.2.99.901/aclocal.m4 2008-03-20 09:54:19.000000000 +0100 +++ xf86-video-intel-2.2.99.902/aclocal.m4 2008-03-31 04:03:59.000000000 +0200 @@ -21,7 +21,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# serial 52 Debian 1.5.26-1 AC_PROG_LIBTOOL +# serial 52 Debian 1.5.26-2 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) diff -u -r xf86-video-intel-2.2.99.901/configure xf86-video-intel-2.2.99.902/configure --- xf86-video-intel-2.2.99.901/configure 2008-03-21 06:37:20.000000000 +0100 +++ xf86-video-intel-2.2.99.902/configure 2008-03-31 04:04:04.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for xf86-video-intel 2.2.99.901. +# Generated by GNU Autoconf 2.61 for xf86-video-intel 2.2.99.902. # # Report bugs to . # @@ -728,8 +728,8 @@ # Identity of this package. PACKAGE_NAME='xf86-video-intel' PACKAGE_TARNAME='xf86-video-intel' -PACKAGE_VERSION='2.2.99.901' -PACKAGE_STRING='xf86-video-intel 2.2.99.901' +PACKAGE_VERSION='2.2.99.902' +PACKAGE_STRING='xf86-video-intel 2.2.99.902' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' ac_unique_file="Makefile.am" @@ -1455,7 +1455,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xf86-video-intel 2.2.99.901 to adapt to many kinds of systems. +\`configure' configures xf86-video-intel 2.2.99.902 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1525,7 +1525,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-video-intel 2.2.99.901:";; + short | recursive ) echo "Configuration of xf86-video-intel 2.2.99.902:";; esac cat <<\_ACEOF @@ -1543,7 +1543,7 @@ --disable-libtool-lock avoid locking (might break parallel builds) --disable-dri Disable DRI support [default=auto] --enable-video-debug Enable video debugging support [default=no] - --disable-xvmc Disable XvMC support [default=yes] + --disable-xvmc Disable XvMC support [default=auto] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1651,7 +1651,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-video-intel configure 2.2.99.901 +xf86-video-intel configure 2.2.99.902 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1665,7 +1665,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xf86-video-intel $as_me 2.2.99.901, which was +It was created by xf86-video-intel $as_me 2.2.99.902, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2360,7 +2360,7 @@ # Define the identity of the package. PACKAGE='xf86-video-intel' - VERSION='2.2.99.901' + VERSION='2.2.99.902' cat >>confdefs.h <<_ACEOF @@ -20867,7 +20867,7 @@ if test "${enable_xvmc+set}" = set; then enableval=$enable_xvmc; XVMC="$enableval" else - XVMC=yes + XVMC=auto fi @@ -21575,7 +21575,9 @@ fi -if test "$DRI" != no; then +{ echo "$as_me:$LINENO: checking whether to include DRI support" >&5 +echo $ECHO_N "checking whether to include DRI support... $ECHO_C" >&6; } +if test x$DRI = xauto; then as_ac_File=`echo "ac_cv_file_${sdkdir}/dri.h" | $as_tr_sh` { echo "$as_me:$LINENO: checking for ${sdkdir}/dri.h" >&5 echo $ECHO_N "checking for ${sdkdir}/dri.h... $ECHO_C" >&6; } @@ -21676,11 +21678,7 @@ have_damage_h="no" fi -fi -{ echo "$as_me:$LINENO: checking whether to include DRI support" >&5 -echo $ECHO_N "checking whether to include DRI support... $ECHO_C" >&6; } -if test x$DRI = xauto; then if test "$have_dri_h" = yes -a \ "$have_sarea_h" = yes -a \ "$have_dristruct_h" = yes; then @@ -22379,6 +22377,14 @@ { echo "$as_me:$LINENO: checking whether to include XvMC support" >&5 echo $ECHO_N "checking whether to include XvMC support... $ECHO_C" >&6; } +if test "$XVMC" = auto; then + XVMC="$DRI" +fi +if test "$XVMC" = yes && test "$DRI" = no; then + { { echo "$as_me:$LINENO: error: XvMC can't be enabled without DRI" >&5 +echo "$as_me: error: XvMC can't be enabled without DRI" >&2;} + { (exit 1); exit 1; }; } +fi { echo "$as_me:$LINENO: result: $XVMC" >&5 echo "${ECHO_T}$XVMC" >&6; } if test x$XVMC = xyes; then @@ -23202,7 +23208,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-video-intel $as_me 2.2.99.901, which was +This file was extended by xf86-video-intel $as_me 2.2.99.902, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23255,7 +23261,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xf86-video-intel config.status 2.2.99.901 +xf86-video-intel config.status 2.2.99.902 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -u -r xf86-video-intel-2.2.99.901/configure.ac xf86-video-intel-2.2.99.902/configure.ac --- xf86-video-intel-2.2.99.901/configure.ac 2008-03-20 09:45:33.000000000 +0100 +++ xf86-video-intel-2.2.99.902/configure.ac 2008-03-31 04:03:18.000000000 +0200 @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-intel], - 2.2.99.901, + 2.2.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-intel) @@ -67,9 +67,9 @@ [ XSERVER_SOURCE="" ]) AC_ARG_ENABLE(xvmc, AC_HELP_STRING([--disable-xvmc], - [Disable XvMC support [[default=yes]]]), + [Disable XvMC support [[default=auto]]]), [XVMC="$enableval"], - [XVMC=yes]) + [XVMC=auto]) # Checks for extensions XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto) @@ -87,7 +87,8 @@ # Checks for header files. AC_HEADER_STDC -if test "$DRI" != no; then +AC_MSG_CHECKING([whether to include DRI support]) +if test x$DRI = xauto; then AC_CHECK_FILE([${sdkdir}/dri.h], [have_dri_h="yes"], [have_dri_h="no"]) AC_CHECK_FILE([${sdkdir}/sarea.h], @@ -96,10 +97,7 @@ [have_dristruct_h="yes"], [have_dristruct_h="no"]) AC_CHECK_FILE([${sdkdir}/damage.h], [have_damage_h="yes"], [have_damage_h="no"]) -fi -AC_MSG_CHECKING([whether to include DRI support]) -if test x$DRI = xauto; then if test "$have_dri_h" = yes -a \ "$have_sarea_h" = yes -a \ "$have_dristruct_h" = yes; then @@ -213,6 +211,12 @@ fi AC_MSG_CHECKING([whether to include XvMC support]) +if test "$XVMC" = auto; then + XVMC="$DRI" +fi +if test "$XVMC" = yes && test "$DRI" = no; then + AC_MSG_ERROR([XvMC can't be enabled without DRI]) +fi AC_MSG_RESULT([$XVMC]) AM_CONDITIONAL(XVMC, test x$XVMC = xyes) if test "$XVMC" = yes; then diff -u -r xf86-video-intel-2.2.99.901/man/intel.man xf86-video-intel-2.2.99.902/man/intel.man --- xf86-video-intel-2.2.99.901/man/intel.man 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/man/intel.man 2008-03-27 02:25:50.000000000 +0100 @@ -214,22 +214,40 @@ .TP 2 The driver will attempt to automatically detect the backlight control method for your platform. If this fails however, you can select another method which may allow you to control your backlight. Available methods include: .PP -.B NATIVE +.B native .TP 4 Intel chipsets include backlight control registers, which on some platforms may be wired to control the backlight directly. This method uses those registers. .PP -.B LEGACY +.B legacy .TP 4 The legacy backlight control registers exist in PCI configuration space, and have fewer available backlight levels than the native registers. However, some platforms are wired this way and so need to use this method. .PP -.B COMBO +.B combo .TP 4 This method attempts to use the native registers where possible, resorting to the legacy, configuration space registers only to enable the backlight if needed. On platforms that have both wired this can be a good choice as it allows the fine grained backlight control of the native interface. .PP -.B KERNEL +.B kernel .TP 4 On some system, the kernel may provide a backlight control driver. In that case, using the kernel interfaces is preferable, as the same driver may respond to hotkey events or external APIs. +.PP +.B PANEL_FITTING +- control LCD panel fitting +.TP 2 +By default, the driver will attempt to upscale resolutions smaller than the LCD's native size while preserving the aspect ratio. Other modes are available however: +.PP +.B center +.TP 4 +Simply center the image on-screen, without scaling. +.PP +.B full_aspect +.TP 4 +The default mode. Try to upscale the image to the screen size, while preserving aspect ratio. May result in letterboxing or pillar-boxing with some resolutions. +.PP +.B full +.TP 4 +Upscale the image to the native screen size without regard to aspect ratio. In this mode, the full screen image may appear distorted in some resolutions. + .SS "TV" Integrated TV output. Available properties include: diff -u -r xf86-video-intel-2.2.99.901/src/i810_reg.h xf86-video-intel-2.2.99.902/src/i810_reg.h --- xf86-video-intel-2.2.99.901/src/i810_reg.h 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i810_reg.h 2008-03-27 02:25:37.000000000 +0100 @@ -871,8 +871,7 @@ #define PFIT_CONTROL 0x61230 # define PFIT_ENABLE (1 << 31) -# define PFIT_PIPE_MASK (3 << 29) -# define PFIT_PIPE_SHIFT 29 +/* Pre-965 */ # define VERT_INTERP_DISABLE (0 << 10) # define VERT_INTERP_BILINEAR (1 << 10) # define VERT_INTERP_MASK (3 << 10) @@ -882,12 +881,30 @@ # define HORIZ_INTERP_MASK (3 << 6) # define HORIZ_AUTO_SCALE (1 << 5) # define PANEL_8TO6_DITHER_ENABLE (1 << 3) +/* 965+ */ +# define PFIT_PIPE_MASK (3 << 29) +# define PFIT_PIPE_SHIFT 29 +# define PFIT_SCALING_MODE_MASK (7 << 26) +# define PFIT_SCALING_AUTO (0 << 26) +# define PFIT_SCALING_PROGRAMMED (1 << 26) +# define PFIT_SCALING_PILLAR (2 << 26) +# define PFIT_SCALING_LETTER (3 << 26) +# define PFIT_FILTER_SELECT_MASK (3 << 24) +# define PFIT_FILTER_FUZZY (0 << 24) +# define PFIT_FILTER_CRISP (1 << 24) +# define PFIT_FILTER_MEDIAN (2 << 24) #define PFIT_PGM_RATIOS 0x61234 +/* Pre-965 */ +# define PFIT_VERT_SCALE_SHIFT 20 # define PFIT_VERT_SCALE_MASK 0xfff00000 +# define PFIT_HORIZ_SCALE_SHIFT 4 # define PFIT_HORIZ_SCALE_MASK 0x0000fff0 - -#define PFIT_AUTO_RATIOS 0x61238 +/* 965+ */ +# define PFIT_VERT_SCALE_SHIFT_965 16 +# define PFIT_VERT_SCALE_MASK_965 0x1fff0000 +# define PFIT_HORIZ_SCALE_SHIFT_965 0 +# define PFIT_HORIZ_SCALE_MASK_965 0x00001fff #define DPLL_A 0x06014 #define DPLL_B 0x06018 diff -u -r xf86-video-intel-2.2.99.901/src/i830_bios.c xf86-video-intel-2.2.99.902/src/i830_bios.c --- xf86-video-intel-2.2.99.901/src/i830_bios.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_bios.c 2008-03-31 04:01:34.000000000 +0200 @@ -270,7 +270,7 @@ aim_off = vbt->aim_offset[aim]; if (!aim_off) { - free (bios); + xfree (bios); return NULL; } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "aim_off %d\n", aim_off); @@ -284,15 +284,15 @@ unsigned char *aim = malloc (aimdb_block->aimdb_size + sizeof (struct aimdb_block)); if (!aim) { - free (bios); + xfree (bios); return NULL; } memcpy (aim, aimdb_block, aimdb_block->aimdb_size + sizeof (struct aimdb_block)); - free (bios); + xfree (bios); return aim; } bdb_off += aimdb_block->aimdb_size + sizeof (struct aimdb_block); } - free (bios); + xfree (bios); return NULL; } diff -u -r xf86-video-intel-2.2.99.901/src/i830_crt.c xf86-video-intel-2.2.99.902/src/i830_crt.c --- xf86-video-intel-2.2.99.901/src/i830_crt.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_crt.c 2008-03-26 03:15:53.000000000 +0100 @@ -391,6 +391,7 @@ xfree (output->driver_private); } +#ifdef RANDR_GET_CRTC_INTERFACE static xf86CrtcPtr i830_crt_get_crtc(xf86OutputPtr output) { @@ -400,6 +401,7 @@ return i830_pipe_to_crtc(pScrn, pipe); } +#endif static const xf86OutputFuncsRec i830_crt_output_funcs = { .dpms = i830_crt_dpms, diff -u -r xf86-video-intel-2.2.99.901/src/i830_display.c xf86-video-intel-2.2.99.902/src/i830_display.c --- xf86-video-intel-2.2.99.901/src/i830_display.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_display.c 2008-03-31 04:00:37.000000000 +0200 @@ -901,9 +901,12 @@ static void i830_crtc_prepare (xf86CrtcPtr crtc) { + I830CrtcPrivatePtr intel_crtc = crtc->driver_private; /* Temporarily turn off FB compression during modeset */ if (i830_use_fb_compression(crtc)) i830_disable_fb_compression(crtc); + if (intel_crtc->enabled) + crtc->funcs->hide_cursor (crtc); crtc->funcs->dpms (crtc, DPMSModeOff); } diff -u -r xf86-video-intel-2.2.99.901/src/i830_dri.c xf86-video-intel-2.2.99.902/src/i830_dri.c --- xf86-video-intel-2.2.99.901/src/i830_dri.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_dri.c 2008-03-31 04:00:10.000000000 +0200 @@ -135,7 +135,7 @@ #define DRI_DRIVER_FRAMEBUFFER_MAP 0 #endif -#ifdef DRI_SUPPORTS_CLIP_NOTIFY +#if DRI_SUPPORTS_CLIP_NOTIFY static void I830DRIClipNotify(ScreenPtr pScreen, WindowPtr *ppWin, int num); #endif diff -u -r xf86-video-intel-2.2.99.901/src/i830_driver.c xf86-video-intel-2.2.99.902/src/i830_driver.c --- xf86-video-intel-2.2.99.901/src/i830_driver.c 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_driver.c 2008-03-31 03:59:41.000000000 +0200 @@ -171,7 +171,6 @@ #include #include #include -#include #include #include "xf86.h" @@ -697,15 +696,6 @@ pI830->FbBase + pI830->LpRing->mem->offset; } - /* Mark the pages we haven't yet bound into AGP as inaccessible. */ - if (pI830->FbMapSize > pI830->stolen_size) { - if (mprotect(pI830->FbBase + pI830->stolen_size, - pI830->FbMapSize - pI830->stolen_size, PROT_NONE) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Failed to mprotect unbound AGP: %s\n", strerror(errno)); - } - } - return TRUE; } @@ -2393,6 +2383,15 @@ pI830->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = I830BlockHandler; + /* Emit a flush of the rendering cache, or on the 965 and beyond + * rendering results may not hit the framebuffer until significantly + * later. In the direct rendering case this is already done just + * after the page flipping updates, so there's no need to duplicate + * the effort here. + */ + if (!pI830->noAccel && !pI830->directRenderingEnabled) + I830EmitFlush(pScrn); + I830VideoBlockHandler(i, blockData, pTimeout, pReadmask); } @@ -2682,6 +2681,12 @@ pScrn->videoRam &= ~3; } + if (!IS_I965G(pI830) && pScrn->displayWidth > 2048) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Cannot support DRI with frame buffer width > 2048.\n"); + pI830->directRenderingDisabled = TRUE; + } + #ifdef XF86DRI /* If DRI hasn't been explicitly disabled, try to initialize it. * It will be used by the memory allocator. @@ -2759,12 +2764,6 @@ pI830->XvEnabled = !pI830->XvDisabled; #endif - if (!IS_I965G(pI830) && pScrn->displayWidth > 2048) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Cannot support DRI with frame buffer width > 2048.\n"); - pI830->tiling = FALSE; - pI830->directRenderingEnabled = FALSE; - } /* Need MMIO mapped to do GTT lookups during memory allocation. */ I830MapMMIO(pScrn); @@ -2824,7 +2823,7 @@ "needs 2D acceleration.\n"); pI830->XvEnabled = FALSE; } - if (!IS_I9XX(pI830) && pI830->overlay_regs == NULL) { + if (!IS_IGD_GM(pI830) && pI830->overlay_regs == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Disabling Xv because the overlay register buffer " "allocation failed.\n"); diff -u -r xf86-video-intel-2.2.99.901/src/i830_dvo.c xf86-video-intel-2.2.99.902/src/i830_dvo.c --- xf86-video-intel-2.2.99.901/src/i830_dvo.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_dvo.c 2008-03-26 03:15:53.000000000 +0100 @@ -330,6 +330,7 @@ } } +#ifdef RANDR_GET_CRTC_INTERFACE static xf86CrtcPtr i830_dvo_get_crtc(xf86OutputPtr output) { @@ -341,6 +342,7 @@ return i830_pipe_to_crtc(pScrn, pipe); } +#endif static const xf86OutputFuncsRec i830_dvo_output_funcs = { .dpms = i830_dvo_dpms, diff -u -r xf86-video-intel-2.2.99.901/src/i830_exa.c xf86-video-intel-2.2.99.902/src/i830_exa.c --- xf86-video-intel-2.2.99.901/src/i830_exa.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_exa.c 2008-03-26 02:15:45.000000000 +0100 @@ -339,12 +339,31 @@ #define xFixedToFloat(val) \ ((float)xFixedToInt(val) + ((float)xFixedFrac(val) / 65536.0)) +static Bool +_i830_transform_point (PictTransformPtr transform, + float x, + float y, + float result[3]) +{ + int j; + + for (j = 0; j < 3; j++) + { + result[j] = (xFixedToFloat (transform->matrix[j][0]) * x + + xFixedToFloat (transform->matrix[j][1]) * y + + xFixedToFloat (transform->matrix[j][2])); + } + if (!result[2]) + return FALSE; + return TRUE; +} + /** * Returns the floating-point coordinates transformed by the given transform. * * transform may be null. */ -void +Bool i830_get_transformed_coordinates(int x, int y, PictTransformPtr transform, float *x_out, float *y_out) { @@ -352,15 +371,14 @@ *x_out = x; *y_out = y; } else { - PictVector v; + float result[3]; - v.vector[0] = IntToxFixed(x); - v.vector[1] = IntToxFixed(y); - v.vector[2] = xFixed1; - PictureTransformPoint(transform, &v); - *x_out = xFixedToFloat(v.vector[0]); - *y_out = xFixedToFloat(v.vector[1]); + if (!_i830_transform_point (transform, (float) x, (float) y, result)) + return FALSE; + *x_out = result[0] / result[2]; + *y_out = result[1] / result[2]; } + return TRUE; } /** @@ -368,7 +386,7 @@ * * transform may be null. */ -void +Bool i830_get_transformed_coordinates_3d(int x, int y, PictTransformPtr transform, float *x_out, float *y_out, float *w_out) { @@ -377,16 +395,15 @@ *y_out = y; *w_out = 1; } else { - PictVector v; + float result[3]; - v.vector[0] = IntToxFixed(x); - v.vector[1] = IntToxFixed(y); - v.vector[2] = xFixed1; - PictureTransformPoint3d(transform, &v); - *x_out = xFixedToFloat(v.vector[0]); - *y_out = xFixedToFloat(v.vector[1]); - *w_out = xFixedToFloat(v.vector[2]); + if (!_i830_transform_point (transform, (float) x, (float) y, result)) + return FALSE; + *x_out = result[0]; + *y_out = result[1]; + *w_out = result[2]; } + return TRUE; } /** diff -u -r xf86-video-intel-2.2.99.901/src/i830.h xf86-video-intel-2.2.99.902/src/i830.h --- xf86-video-intel-2.2.99.901/src/i830.h 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830.h 2008-03-26 02:15:45.000000000 +0100 @@ -524,6 +524,7 @@ float scale_units[2][2]; /** Transform pointers for src/mask, or NULL if identity */ PictTransform *transform[2]; + float coord_adjust; /* i915 EXA render state */ uint32_t mapstate[6]; uint32_t samplerstate[6]; @@ -827,11 +828,11 @@ void i965_composite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h); -void +Bool i830_get_transformed_coordinates(int x, int y, PictTransformPtr transform, float *x_out, float *y_out); -void +Bool i830_get_transformed_coordinates_3d(int x, int y, PictTransformPtr transform, float *x_out, float *y_out, float *z_out); diff -u -r xf86-video-intel-2.2.99.901/src/i830_lvds.c xf86-video-intel-2.2.99.902/src/i830_lvds.c --- xf86-video-intel-2.2.99.901/src/i830_lvds.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_lvds.c 2008-03-31 04:00:10.000000000 +0200 @@ -44,12 +44,25 @@ #include "i830_display.h" #include "X11/Xatom.h" +/* + * Three panel fitting modes: + * CENTER - center image on screen, don't scale + * FULL_ASPECT - scale image to fit screen, but preserve aspect ratio + * FULL - scale image to fit screen without regard to aspect ratio + */ +enum pfit_mode { + CENTER = 0, + FULL_ASPECT, + FULL, +}; + struct i830_lvds_priv { /* The BIOS's fixed timings for the LVDS */ DisplayModePtr panel_fixed_mode; /* The panel needs dithering enabled */ Bool panel_wants_dither; + Bool need_border; /* restore backlight to this value */ int backlight_duty_cycle; @@ -57,6 +70,9 @@ void (*set_backlight)(xf86OutputPtr output, int level); int (*get_backlight)(xf86OutputPtr output); int backlight_max; + enum pfit_mode fitting_mode; + uint32_t pfit_control; + uint32_t pfit_pgm_ratios; }; #define BACKLIGHT_CLASS "/sys/class/backlight" @@ -117,11 +133,11 @@ } else if (IS_I965GM(pI830) || IS_IGD_GM(pI830)) { blc_pwm_ctl2 = INREG(BLC_PWM_CTL2); if (blc_pwm_ctl2 & BLM_LEGACY_MODE2) - method = BCM_LEGACY; + method = BCM_COMBO; } else { blc_pwm_ctl = INREG(BLC_PWM_CTL); if (blc_pwm_ctl & BLM_LEGACY_MODE) - method = BCM_LEGACY; + method = BCM_COMBO; } pI830->backlight_control_method = method; @@ -481,7 +497,13 @@ ScrnInfoPtr pScrn = output->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); I830CrtcPrivatePtr intel_crtc = output->crtc->driver_private; + I830Ptr pI830 = I830PTR(pScrn); + uint32_t pfit_control = 0, pfit_pgm_ratios = 0; + float panel_ratio, desired_ratio, vert_scale, horiz_scale; + float horiz_ratio, vert_ratio; + int left_border = 0, right_border = 0, top_border = 0, bottom_border = 0; int i; + Bool border = 0; for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr other_output = xf86_config->output[i]; @@ -500,24 +522,207 @@ return FALSE; } + /* If we don't have a panel mode there's not much we can do */ + if (dev_priv->panel_fixed_mode == NULL) + return TRUE; + /* If we have timings from the BIOS for the panel, put them in * to the adjusted mode. The CRTC will be set up for this mode, * with the panel scaling set up to source from the H/VDisplay * of the original mode. */ - if (dev_priv->panel_fixed_mode != NULL) { - adjusted_mode->HDisplay = dev_priv->panel_fixed_mode->HDisplay; - adjusted_mode->HSyncStart = dev_priv->panel_fixed_mode->HSyncStart; - adjusted_mode->HSyncEnd = dev_priv->panel_fixed_mode->HSyncEnd; - adjusted_mode->HTotal = dev_priv->panel_fixed_mode->HTotal; - adjusted_mode->VDisplay = dev_priv->panel_fixed_mode->VDisplay; - adjusted_mode->VSyncStart = dev_priv->panel_fixed_mode->VSyncStart; - adjusted_mode->VSyncEnd = dev_priv->panel_fixed_mode->VSyncEnd; - adjusted_mode->VTotal = dev_priv->panel_fixed_mode->VTotal; - adjusted_mode->Clock = dev_priv->panel_fixed_mode->Clock; - xf86SetModeCrtc(adjusted_mode, INTERLACE_HALVE_V); + adjusted_mode->HDisplay = dev_priv->panel_fixed_mode->HDisplay; + adjusted_mode->HSyncStart = dev_priv->panel_fixed_mode->HSyncStart; + adjusted_mode->HSyncEnd = dev_priv->panel_fixed_mode->HSyncEnd; + adjusted_mode->HTotal = dev_priv->panel_fixed_mode->HTotal; + adjusted_mode->VDisplay = dev_priv->panel_fixed_mode->VDisplay; + adjusted_mode->VSyncStart = dev_priv->panel_fixed_mode->VSyncStart; + adjusted_mode->VSyncEnd = dev_priv->panel_fixed_mode->VSyncEnd; + adjusted_mode->VTotal = dev_priv->panel_fixed_mode->VTotal; + adjusted_mode->Clock = dev_priv->panel_fixed_mode->Clock; + xf86SetModeCrtc(adjusted_mode, INTERLACE_HALVE_V); + + /* Native modes don't need fitting */ + if (adjusted_mode->HDisplay == mode->HDisplay && + adjusted_mode->VDisplay == mode->VDisplay) { + pfit_control = 0; + pfit_pgm_ratios = 0; + border = 0; + goto out; } + /* Basic panel fitting options */ + if (!IS_I965G(pI830)) { + if (dev_priv->panel_wants_dither) + pfit_control |= PANEL_8TO6_DITHER_ENABLE; + } else { + pfit_control |= (intel_crtc->pipe << PFIT_PIPE_SHIFT) | + PFIT_FILTER_FUZZY; + } + + /* + * Deal with panel fitting options. Figure out how to stretch the image + * based on its aspect ratio & the current panel fitting mode. + */ + panel_ratio = (float)adjusted_mode->HDisplay / + (float)adjusted_mode->VDisplay; + desired_ratio = (float)mode->HDisplay / + (float)mode->VDisplay; + + /* + * Enable automatic panel scaling for non-native modes so that they fill + * the screen. Should be enabled before the pipe is enabled, according to + * register description and PRM. + */ + /* Change the value here to see the borders for debugging */ + OUTREG(BCLRPAT_A, 0); + OUTREG(BCLRPAT_B, 0); + switch (dev_priv->fitting_mode) { + case CENTER: + /* + * For centered modes, we have to calculate border widths & heights and + * modify the values programmed into the CRTC. Also need to make sure + * LVDS borders are enabled (see i830_display.c). + */ + left_border = + (dev_priv->panel_fixed_mode->HDisplay - mode->HDisplay) / 2; + right_border = left_border; + if (mode->HDisplay & 1) + right_border++; + top_border = + (dev_priv->panel_fixed_mode->VDisplay - mode->VDisplay) / 2; + bottom_border = top_border; + if (mode->VDisplay & 1) + bottom_border++; + + /* Set active & border values */ + adjusted_mode->CrtcHDisplay = mode->HDisplay; + adjusted_mode->CrtcHBlankStart = mode->HDisplay + right_border - 1; + adjusted_mode->CrtcHBlankEnd = adjusted_mode->CrtcHTotal - + left_border - 1; + adjusted_mode->CrtcHSyncStart = adjusted_mode->CrtcHBlankStart; + adjusted_mode->CrtcHSyncEnd = adjusted_mode->CrtcHBlankEnd; + adjusted_mode->CrtcVDisplay = mode->VDisplay; + adjusted_mode->CrtcVBlankStart = mode->VDisplay + bottom_border - 1; + adjusted_mode->CrtcVBlankEnd = adjusted_mode->CrtcVTotal - + top_border - 1; + adjusted_mode->CrtcVSyncStart = adjusted_mode->CrtcVBlankStart; + adjusted_mode->CrtcVSyncEnd = adjusted_mode->CrtcVBlankEnd; + border = 1; + break; + case FULL_ASPECT: + /* Scale but preserve aspect ratio */ + pfit_control |= PFIT_ENABLE; + if (IS_I965G(pI830)) { + /* + * 965+ is easy, it does everything in hw + */ + if (panel_ratio > desired_ratio) + pfit_control |= PFIT_SCALING_PILLAR; + else if (panel_ratio < desired_ratio) + pfit_control |= PFIT_SCALING_LETTER; + else + pfit_control |= PFIT_SCALING_AUTO; + } else { + /* + * For earlier chips we have to calculate the scaling ratio + * by hand and program it into the PFIT_PGM_RATIOS reg. + */ + uint32_t horiz_bits, vert_bits, bits = 12; + + horiz_ratio = ((float)mode->HDisplay) / + ((float)adjusted_mode->HDisplay); + vert_ratio = ((float)mode->VDisplay) / + ((float)adjusted_mode->VDisplay); + + horiz_scale = ((float)adjusted_mode->HDisplay) / + ((float)mode->HDisplay); + vert_scale = ((float)adjusted_mode->VDisplay) / + ((float)mode->VDisplay); + + /* Retain aspect ratio */ + if (panel_ratio > desired_ratio) { /* Pillar */ + unsigned long scaled_width = (float)mode->HDisplay * vert_scale; + + horiz_ratio = vert_ratio; + pfit_control |= VERT_AUTO_SCALE | VERT_INTERP_BILINEAR | + HORIZ_INTERP_BILINEAR; + + /* Pillar will have left/right borders */ + left_border = (dev_priv->panel_fixed_mode->HDisplay - + scaled_width) / 2; + right_border = left_border; + if (mode->HDisplay & 1) /* odd resolutions */ + right_border++; + + adjusted_mode->CrtcHDisplay = scaled_width; + adjusted_mode->CrtcHBlankStart = scaled_width + + right_border - 1; + adjusted_mode->CrtcHBlankEnd = adjusted_mode->CrtcHTotal - + left_border - 1; + adjusted_mode->CrtcHSyncStart = adjusted_mode->CrtcHBlankStart; + adjusted_mode->CrtcHSyncEnd = adjusted_mode->CrtcHBlankEnd; + border = 1; + } else if (panel_ratio < desired_ratio) { /* Letter */ + unsigned long scaled_height = (float)mode->VDisplay * + horiz_scale; + + vert_ratio = horiz_ratio; + pfit_control |= HORIZ_AUTO_SCALE | VERT_INTERP_BILINEAR | + HORIZ_INTERP_BILINEAR; + + /* Letterbox will have top/bottom borders */ + top_border = (dev_priv->panel_fixed_mode->VDisplay - + mode->VDisplay) / 2; + bottom_border = top_border; + if (mode->VDisplay & 1) + bottom_border++; + + adjusted_mode->CrtcVDisplay = scaled_height; + adjusted_mode->CrtcVBlankStart = scaled_height + + bottom_border - 1; + adjusted_mode->CrtcVBlankEnd = adjusted_mode->CrtcVTotal - + top_border - 1; + adjusted_mode->CrtcVSyncStart = adjusted_mode->CrtcVBlankStart; + adjusted_mode->CrtcVSyncEnd = adjusted_mode->CrtcVBlankEnd; + border = 1; + } else { /* Aspects match, let hw scale both directions */ + pfit_control |= VERT_AUTO_SCALE | HORIZ_AUTO_SCALE | + VERT_INTERP_BILINEAR | HORIZ_INTERP_BILINEAR; + } + + horiz_bits = 0.5 + (1 << bits) * horiz_ratio; + vert_bits = 0.5 + (1 << bits) * vert_ratio; + + pfit_pgm_ratios = (((vert_bits << PFIT_VERT_SCALE_SHIFT) & + PFIT_VERT_SCALE_MASK) | + ((horiz_bits << PFIT_HORIZ_SCALE_SHIFT) & + PFIT_HORIZ_SCALE_MASK)); + } + break; + case FULL: + /* + * Full scaling, even if it changes the aspect ratio. Fortunately + * this is all done for us in hw. + */ + pfit_control |= PFIT_ENABLE; + if (IS_I965G(pI830)) + pfit_control |= PFIT_SCALING_AUTO; + else + pfit_control |= VERT_AUTO_SCALE | HORIZ_AUTO_SCALE | + VERT_INTERP_BILINEAR | HORIZ_INTERP_BILINEAR; + break; + default: + /* shouldn't happen */ + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "error: bad fitting mode\n"); + break; + } + +out: + dev_priv->pfit_control = pfit_control; + dev_priv->pfit_pgm_ratios = pfit_pgm_ratios; + dev_priv->need_border = border; + /* XXX: It would be nice to support lower refresh rates on the * panels to reduce power consumption, and perhaps match the * user's requested refresh rate. @@ -527,42 +732,43 @@ } static void -i830_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode, - DisplayModePtr adjusted_mode) +i830_lvds_prepare(xf86OutputPtr output) { I830OutputPrivatePtr intel_output = output->driver_private; struct i830_lvds_priv *dev_priv = intel_output->dev_priv; ScrnInfoPtr pScrn = output->scrn; I830Ptr pI830 = I830PTR(pScrn); - I830CrtcPrivatePtr intel_crtc = output->crtc->driver_private; - uint32_t pfit_control; + uint32_t lvds; - /* The LVDS pin pair will already have been turned on in - * i830_crtc_mode_set since it has a large impact on the DPLL settings. - */ + lvds = INREG(LVDS); - /* Enable automatic panel scaling for non-native modes so that they fill - * the screen. Should be enabled before the pipe is enabled, according to - * register description and PRM. + i830_lvds_dpms(output, DPMSModeOff); + /* + * ->prepare will be called after the CRTC is off but before + * we set the mode, so program the PFIT regs here. */ - if (mode->HDisplay != adjusted_mode->HDisplay || - mode->VDisplay != adjusted_mode->VDisplay) - { - pfit_control = PFIT_ENABLE | - VERT_AUTO_SCALE | HORIZ_AUTO_SCALE | - VERT_INTERP_BILINEAR | HORIZ_INTERP_BILINEAR; - } else { - pfit_control = 0; - } + if (dev_priv->need_border) + OUTREG(LVDS, lvds | LVDS_BORDER_ENABLE); + else + OUTREG(LVDS, lvds & (~LVDS_BORDER_ENABLE)); +} - if (!IS_I965G(pI830)) { - if (dev_priv->panel_wants_dither) - pfit_control |= PANEL_8TO6_DITHER_ENABLE; - } else { - pfit_control |= intel_crtc->pipe << PFIT_PIPE_SHIFT; - } +static void +i830_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode, + DisplayModePtr adjusted_mode) +{ + I830OutputPrivatePtr intel_output = output->driver_private; + struct i830_lvds_priv *dev_priv = intel_output->dev_priv; + ScrnInfoPtr pScrn = output->scrn; + I830Ptr pI830 = I830PTR(pScrn); - OUTREG(PFIT_CONTROL, pfit_control); + /* + * PFIT must be enabled/disabled while LVDS is on but pipes are still off + */ + OUTREG(PFIT_PGM_RATIOS, dev_priv->pfit_pgm_ratios); + OUTREG(PFIT_CONTROL, dev_priv->pfit_control); + /* It's harmless to turn on the LVDS if it's already on */ + i830_lvds_dpms(output, DPMSModeOn); } /** @@ -653,6 +859,17 @@ static Atom backlight_control_atom; static Atom backlight_control_name_atoms[NUM_BACKLIGHT_CONTROL_METHODS]; +#define PANEL_FITTING_NAME "PANEL_FITTING" +#define NUM_PANEL_FITTING_TYPES 3 +static char *panel_fitting_names[] = { + "center", + "full_aspect", + "full", +}; +static Atom panel_fitting_atom; +static Atom panel_fitting_name_atoms[NUM_PANEL_FITTING_TYPES]; + + static int i830_backlight_control_lookup(char *name) { @@ -709,6 +926,18 @@ return Success; } + +static int +i830_panel_fitting_lookup(char *name) +{ + int i; + + for (i = 0; i < NUM_PANEL_FITTING_TYPES; i++) + if (!strcmp(name, panel_fitting_names[i])) + return i; + + return -1; +} #endif /* RANDR_12_INTERFACE */ static void @@ -775,6 +1004,33 @@ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "failed to set backlight control, %d\n", err); } + + /* + * Panel fitting control + */ + panel_fitting_atom = MakeAtom(PANEL_FITTING_NAME, + sizeof(PANEL_FITTING_NAME) - 1, TRUE); + for (i = 0; i < NUM_PANEL_FITTING_TYPES; i++) { + panel_fitting_name_atoms[i] = MakeAtom(panel_fitting_names[i], + strlen(panel_fitting_names[i]), + TRUE); + } + err = RRConfigureOutputProperty(output->randr_output, + panel_fitting_atom, TRUE, FALSE, FALSE, + NUM_PANEL_FITTING_TYPES, + (INT32 *)panel_fitting_name_atoms); + if (err != 0) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "RRConfigureOutputProperty error, %d\n", err); + } + err = RRChangeOutputProperty(output->randr_output, panel_fitting_atom, + XA_ATOM, 32, PropModeReplace, 1, + &panel_fitting_name_atoms[dev_priv->fitting_mode], + FALSE, TRUE); + if (err != 0) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "failed to set panel fitting mode, %d\n", err); + } #endif /* RANDR_12_INTERFACE */ } @@ -846,6 +1102,36 @@ "RRChangeOutputProperty error, %d\n", ret); } return TRUE; + } else if (property == panel_fitting_atom) { + Atom atom; + char *name; + int ret; + + if (value->type != XA_ATOM || value->format != 32 || value->size != 1) + return FALSE; + + memcpy(&atom, value->data, 4); + name = NameForAtom(atom); + + ret = i830_panel_fitting_lookup(name); + if (ret < 0) + return FALSE; + + dev_priv->fitting_mode = ret; + + if (output->crtc) { + xf86CrtcPtr crtc = output->crtc; + if (crtc->enabled) { + if (!xf86CrtcSetMode(crtc, &crtc->desiredMode, + crtc->desiredRotation, + crtc->desiredX, crtc->desiredY)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to set mode after panel fitting change!\n"); + return FALSE; + } + } + } + return TRUE; } return TRUE; @@ -879,6 +1165,7 @@ } #endif /* RANDR_13_INTERFACE */ +#ifdef RANDR_GET_CRTC_INTERFACE static xf86CrtcPtr i830_lvds_get_crtc(xf86OutputPtr output) { @@ -888,6 +1175,7 @@ return i830_pipe_to_crtc(pScrn, pipe); } +#endif static const xf86OutputFuncsRec i830_lvds_output_funcs = { .create_resources = i830_lvds_create_resources, @@ -896,7 +1184,7 @@ .restore = i830_lvds_restore, .mode_valid = i830_lvds_mode_valid, .mode_fixup = i830_lvds_mode_fixup, - .prepare = i830_output_prepare, + .prepare = i830_lvds_prepare, .mode_set = i830_lvds_mode_set, .commit = i830_output_commit, .detect = i830_lvds_detect, @@ -1088,6 +1376,12 @@ dev_priv->backlight_duty_cycle = dev_priv->get_backlight(output); + /* + * Default to filling the whole screen if the mode is less than the + * native size, without breaking aspect ratio. + */ + dev_priv->fitting_mode = FULL_ASPECT; + return; disable_exit: diff -u -r xf86-video-intel-2.2.99.901/src/i830_memory.c xf86-video-intel-2.2.99.902/src/i830_memory.c --- xf86-video-intel-2.2.99.901/src/i830_memory.c 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_memory.c 2008-03-28 08:02:24.000000000 +0100 @@ -101,7 +101,6 @@ #include #include #include -#include #include "xf86.h" #include "xf86_OSproc.h" @@ -204,31 +203,15 @@ mem->allocated_size, mem->tiling); } - /* Mark the pages accessible now that they're bound. */ - if (mprotect(pI830->FbBase + mem->offset, ALIGN(mem->size, GTT_PAGE_SIZE), - PROT_READ | PROT_WRITE) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Failed to mprotect %s: %s\n", mem->name, strerror(errno)); - } - return TRUE; } static Bool i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem) { - I830Ptr pI830 = I830PTR(pScrn); - if (mem == NULL || !mem->bound) return TRUE; - /* Mark the pages accessible now that they're bound. */ - if (mprotect(pI830->FbBase + mem->offset, ALIGN(mem->size, GTT_PAGE_SIZE), - PROT_NONE) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Failed to mprotect %s: %s\n", mem->name, strerror(errno)); - } - if (mem->tiling != TILE_NONE) i830_clear_tiling(pScrn, mem->fence_nr); @@ -462,7 +445,7 @@ /* Overlay and cursors, if physical, need to be allocated outside * of the kernel memory manager. */ - if (!OVERLAY_NOPHYSICAL(pI830) && !IS_I965G(pI830)) { + if (!OVERLAY_NOPHYSICAL(pI830) && !IS_IGD_GM(pI830)) { mmsize -= ROUND_TO(OVERLAY_SIZE, GTT_PAGE_SIZE); } if (pI830->CursorNeedsPhysical) { @@ -1042,6 +1025,9 @@ if (!pI830->XvEnabled) return TRUE; + if (IS_IGD_GM(pI830)) + return TRUE; + if (!OVERLAY_NOPHYSICAL(pI830)) flags |= NEED_PHYSICAL_ADDR; diff -u -r xf86-video-intel-2.2.99.901/src/i830_render.c xf86-video-intel-2.2.99.902/src/i830_render.c --- xf86-video-intel-2.2.99.901/src/i830_render.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_render.c 2008-03-26 02:15:45.000000000 +0100 @@ -396,6 +396,7 @@ I830Ptr pI830 = I830PTR(pScrn); uint32_t dst_format, dst_offset, dst_pitch; Bool is_affine_src, is_affine_mask; + Bool is_nearest = FALSE; IntelEmitInvarientState(pScrn); *pI830->last_3d = LAST_3D_RENDER; @@ -407,9 +408,13 @@ if (!i830_texture_setup(pSrcPicture, pSrc, 0)) I830FALLBACK("fail to setup src texture\n"); + if (pSrcPicture->filter == PictFilterNearest) + is_nearest = TRUE; if (pMask != NULL) { if (!i830_texture_setup(pMaskPicture, pMask, 1)) I830FALLBACK("fail to setup mask texture\n"); + if (pMaskPicture->filter == PictFilterNearest) + is_nearest = TRUE; } else { pI830->transform[1] = NULL; pI830->scale_units[1][0] = -1; @@ -419,6 +424,11 @@ is_affine_src = i830_transform_is_affine (pI830->transform[0]); is_affine_mask = i830_transform_is_affine (pI830->transform[1]); + if (is_nearest) + pI830->coord_adjust = -0.125; + else + pI830->coord_adjust = 0; + if (!is_affine_src || !is_affine_mask) I830FALLBACK("non-affine transform unsupported on 8xx hardware\n"); @@ -591,56 +601,68 @@ per_vertex = 2; /* dest x/y */ if (is_affine_src) { - i830_get_transformed_coordinates(srcX, srcY, - pI830->transform[0], - &src_x[0], &src_y[0]); - i830_get_transformed_coordinates(srcX, srcY + h, - pI830->transform[0], - &src_x[1], &src_y[1]); - i830_get_transformed_coordinates(srcX + w, srcY + h, - pI830->transform[0], - &src_x[2], &src_y[2]); + if (!i830_get_transformed_coordinates(srcX, srcY, + pI830->transform[0], + &src_x[0], &src_y[0])) + return; + if (!i830_get_transformed_coordinates(srcX, srcY + h, + pI830->transform[0], + &src_x[1], &src_y[1])) + return; + if (!i830_get_transformed_coordinates(srcX + w, srcY + h, + pI830->transform[0], + &src_x[2], &src_y[2])) + return; per_vertex += 2; /* src x/y */ } else { - i830_get_transformed_coordinates_3d(srcX, srcY, - pI830->transform[0], - &src_x[0], &src_y[0], - &src_w[0]); - i830_get_transformed_coordinates_3d(srcX, srcY + h, - pI830->transform[0], - &src_x[1], &src_y[1], - &src_w[1]); - i830_get_transformed_coordinates_3d(srcX + w, srcY + h, - pI830->transform[0], - &src_x[2], &src_y[2], - &src_w[2]); + if (!i830_get_transformed_coordinates_3d(srcX, srcY, + pI830->transform[0], + &src_x[0], &src_y[0], + &src_w[0])) + return; + if (!i830_get_transformed_coordinates_3d(srcX, srcY + h, + pI830->transform[0], + &src_x[1], &src_y[1], + &src_w[1])) + return; + if (!i830_get_transformed_coordinates_3d(srcX + w, srcY + h, + pI830->transform[0], + &src_x[2], &src_y[2], + &src_w[2])) + return; per_vertex += 4; /* src x/y/z/w */ } if (has_mask) { if (is_affine_mask) { - i830_get_transformed_coordinates(maskX, maskY, - pI830->transform[1], - &mask_x[0], &mask_y[0]); - i830_get_transformed_coordinates(maskX, maskY + h, - pI830->transform[1], - &mask_x[1], &mask_y[1]); - i830_get_transformed_coordinates(maskX + w, maskY + h, - pI830->transform[1], - &mask_x[2], &mask_y[2]); + if (!i830_get_transformed_coordinates(maskX, maskY, + pI830->transform[1], + &mask_x[0], &mask_y[0])) + return; + if (!i830_get_transformed_coordinates(maskX, maskY + h, + pI830->transform[1], + &mask_x[1], &mask_y[1])) + return; + if (!i830_get_transformed_coordinates(maskX + w, maskY + h, + pI830->transform[1], + &mask_x[2], &mask_y[2])) + return; per_vertex += 2; /* mask x/y */ } else { - i830_get_transformed_coordinates_3d(maskX, maskY, - pI830->transform[1], - &mask_x[0], &mask_y[0], - &mask_w[0]); - i830_get_transformed_coordinates_3d(maskX, maskY + h, - pI830->transform[1], - &mask_x[1], &mask_y[1], - &mask_w[1]); - i830_get_transformed_coordinates_3d(maskX + w, maskY + h, - pI830->transform[1], - &mask_x[2], &mask_y[2], - &mask_w[2]); + if (!i830_get_transformed_coordinates_3d(maskX, maskY, + pI830->transform[1], + &mask_x[0], &mask_y[0], + &mask_w[0])) + return; + if (!i830_get_transformed_coordinates_3d(maskX, maskY + h, + pI830->transform[1], + &mask_x[1], &mask_y[1], + &mask_w[1])) + return; + if (!i830_get_transformed_coordinates_3d(maskX + w, maskY + h, + pI830->transform[1], + &mask_x[2], &mask_y[2], + &mask_w[2])) + return; per_vertex += 4; /* mask x/y/z/w */ } } @@ -655,8 +677,8 @@ OUT_BATCH(MI_NOOP); OUT_BATCH(PRIM3D_INLINE | PRIM3D_RECTLIST | (num_floats-1)); - OUT_BATCH_F(-0.125 + dstX + w); - OUT_BATCH_F(-0.125 + dstY + h); + OUT_BATCH_F(pI830->coord_adjust + dstX + w); + OUT_BATCH_F(pI830->coord_adjust + dstY + h); OUT_BATCH_F(src_x[2] / pI830->scale_units[0][0]); OUT_BATCH_F(src_y[2] / pI830->scale_units[0][1]); if (!is_affine_src) { @@ -672,8 +694,8 @@ } } - OUT_BATCH_F(-0.125 + dstX); - OUT_BATCH_F(-0.125 + dstY + h); + OUT_BATCH_F(pI830->coord_adjust + dstX); + OUT_BATCH_F(pI830->coord_adjust + dstY + h); OUT_BATCH_F(src_x[1] / pI830->scale_units[0][0]); OUT_BATCH_F(src_y[1] / pI830->scale_units[0][1]); if (!is_affine_src) { @@ -689,8 +711,8 @@ } } - OUT_BATCH_F(-0.125 + dstX); - OUT_BATCH_F(-0.125 + dstY); + OUT_BATCH_F(pI830->coord_adjust + dstX); + OUT_BATCH_F(pI830->coord_adjust + dstY); OUT_BATCH_F(src_x[0] / pI830->scale_units[0][0]); OUT_BATCH_F(src_y[0] / pI830->scale_units[0][1]); if (!is_affine_src) { diff -u -r xf86-video-intel-2.2.99.901/src/i830_sdvo.c xf86-video-intel-2.2.99.902/src/i830_sdvo.c --- xf86-video-intel-2.2.99.901/src/i830_sdvo.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_sdvo.c 2008-03-26 03:15:53.000000000 +0100 @@ -1146,6 +1146,7 @@ } } +#ifdef RANDR_GET_CRTC_INTERFACE static xf86CrtcPtr i830_sdvo_get_crtc(xf86OutputPtr output) { @@ -1157,6 +1158,7 @@ return i830_pipe_to_crtc(pScrn, pipe); } +#endif static const xf86OutputFuncsRec i830_sdvo_output_funcs = { .dpms = i830_sdvo_dpms, diff -u -r xf86-video-intel-2.2.99.901/src/i830_tv.c xf86-video-intel-2.2.99.902/src/i830_tv.c --- xf86-video-intel-2.2.99.901/src/i830_tv.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_tv.c 2008-03-26 03:15:53.000000000 +0100 @@ -1640,6 +1640,7 @@ } #endif /* RANDR_12_INTERFACE */ +#ifdef RANDR_GET_CRTC_INTERFACE static xf86CrtcPtr i830_tv_get_crtc(xf86OutputPtr output) { @@ -1649,6 +1650,7 @@ return i830_pipe_to_crtc(pScrn, pipe); } +#endif static const xf86OutputFuncsRec i830_tv_output_funcs = { .create_resources = i830_tv_create_resources, diff -u -r xf86-video-intel-2.2.99.901/src/i830_video.c xf86-video-intel-2.2.99.902/src/i830_video.c --- xf86-video-intel-2.2.99.901/src/i830_video.c 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_video.c 2008-03-28 08:02:24.000000000 +0100 @@ -385,11 +385,13 @@ I830CrtcPrivatePtr intel_crtc = crtc->driver_private; int pipeconf_reg = intel_crtc->pipe == 0 ? PIPEACONF : PIPEBCONF; - if (!IS_I965G(pI830) && (INREG(pipeconf_reg) & PIPEACONF_DOUBLE_WIDE)) + /* overlay can't be used on pipe with double wide, and pipe must be enabled. */ + if ((!IS_I965G(pI830) && (INREG(pipeconf_reg) & PIPEACONF_DOUBLE_WIDE)) + || (intel_crtc->dpms_mode == DPMSModeOff)) pPriv->overlayOK = FALSE; else pPriv->overlayOK = TRUE; - + if (!pPriv->overlayOK) return; @@ -563,6 +565,9 @@ XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr overlayAdaptor = NULL, texturedAdaptor = NULL; int num_adaptors; +#ifdef INTEL_XVMC + Bool xvmc_status = FALSE; +#endif #if 0 { @@ -612,7 +617,8 @@ } /* Set up overlay video if we can do it at this depth. */ - if (pScrn->bitsPerPixel != 8 && pI830->overlay_regs != NULL) + if (!IS_IGD_GM(pI830) && pScrn->bitsPerPixel != 8 && + pI830->overlay_regs != NULL) { overlayAdaptor = I830SetupImageVideoOverlay(pScreen); if (overlayAdaptor != NULL) { @@ -625,10 +631,9 @@ I830InitOffscreenImages(pScreen); } #ifdef INTEL_XVMC - Bool ret = FALSE; if (intel_xvmc_probe(pScrn)) { if (texturedAdaptor) - ret = intel_xvmc_driver_init(pScreen, texturedAdaptor); + xvmc_status = intel_xvmc_driver_init(pScreen, texturedAdaptor); } #endif @@ -636,7 +641,7 @@ xf86XVScreenInit(pScreen, adaptors, num_adaptors); #ifdef INTEL_XVMC - if (ret) + if (xvmc_status) intel_xvmc_screen_init(pScreen); #endif xfree(adaptors); @@ -1829,10 +1834,11 @@ if (crtc != pPriv->current_crtc) { - pPriv->current_crtc = crtc; i830_overlay_switch_to_crtc (pScrn, crtc); - if (pPriv->overlayOK) + if (pPriv->overlayOK) { + pPriv->current_crtc = crtc; I830ResetVideo (pScrn); + } } if (!pPriv->overlayOK) @@ -2629,6 +2635,7 @@ I830Ptr pI830 = I830PTR(pScrn); I830PortPrivPtr pPriv; + /* no overlay */ if (pI830->adaptor == NULL) return; @@ -2908,6 +2915,7 @@ I830Ptr pI830 = I830PTR(pScrn); I830PortPrivPtr pPriv; + /* no overlay */ if (pI830->adaptor == NULL) return; diff -u -r xf86-video-intel-2.2.99.901/src/i830_xaa.c xf86-video-intel-2.2.99.902/src/i830_xaa.c --- xf86-video-intel-2.2.99.901/src/i830_xaa.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i830_xaa.c 2008-03-31 04:00:10.000000000 +0200 @@ -326,7 +326,7 @@ */ pI830->BR[13] |= (I830PatternROP[rop] << 16); #else - pI830->BR[13] |= ((XAAGetPatternROP(rop) << 16); + pI830->BR[13] |= (XAAGetPatternROP(rop) << 16); #endif pI830->BR[16] = color; diff -u -r xf86-video-intel-2.2.99.901/src/i915_hwmc.c xf86-video-intel-2.2.99.902/src/i915_hwmc.c --- xf86-video-intel-2.2.99.901/src/i915_hwmc.c 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i915_hwmc.c 2008-03-26 03:15:53.000000000 +0100 @@ -97,6 +97,7 @@ #define ARRARY_SIZE(a) (sizeof(a) / sizeof(a[0])) +/* static int yv12_subpicture_index_list[2] = { FOURCC_IA44, @@ -108,6 +109,7 @@ ARRARY_SIZE(yv12_subpicture_index_list), yv12_subpicture_index_list }; + */ static XF86MCSurfaceInfoRec i915_YV12_mpg2_surface = { @@ -147,6 +149,7 @@ (XF86MCSurfaceInfoPtr)&i915_YV12_mpg1_surface }; +#if 0 /* List of subpicture types that we support */ static XF86ImageRec ia44_subpicture = XVIMAGE_IA44; static XF86ImageRec ai44_subpicture = XVIMAGE_AI44; @@ -156,7 +159,7 @@ (XF86ImagePtr)&ia44_subpicture, (XF86ImagePtr)&ai44_subpicture }; - +#endif /* * Init and clean up the screen private parts of XvMC. diff -u -r xf86-video-intel-2.2.99.901/src/i915_render.c xf86-video-intel-2.2.99.902/src/i915_render.c --- xf86-video-intel-2.2.99.901/src/i915_render.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i915_render.c 2008-03-26 02:15:45.000000000 +0100 @@ -321,6 +321,7 @@ int out_reg = FS_OC; FS_LOCALS(20); Bool is_affine_src, is_affine_mask; + Bool is_nearest = FALSE; IntelEmitInvarientState(pScrn); *pI830->last_3d = LAST_3D_RENDER; @@ -332,9 +333,13 @@ if (!i915_texture_setup(pSrcPicture, pSrc, 0)) I830FALLBACK("fail to setup src texture\n"); + if (pSrcPicture->filter == PictFilterNearest) + is_nearest = TRUE; if (pMask != NULL) { if (!i915_texture_setup(pMaskPicture, pMask, 1)) I830FALLBACK("fail to setup mask texture\n"); + if (pMaskPicture->filter == PictFilterNearest) + is_nearest = TRUE; } else { pI830->transform[1] = NULL; pI830->scale_units[1][0] = -1; @@ -343,6 +348,11 @@ is_affine_src = i830_transform_is_affine (pI830->transform[0]); is_affine_mask = i830_transform_is_affine (pI830->transform[1]); + if (is_nearest) + pI830->coord_adjust = -0.125; + else + pI830->coord_adjust = 0; + if (pMask == NULL) { BEGIN_BATCH(10); OUT_BATCH(_3DSTATE_MAP_STATE | 3); diff -u -r xf86-video-intel-2.2.99.901/src/i965_render.c xf86-video-intel-2.2.99.902/src/i965_render.c --- xf86-video-intel-2.2.99.901/src/i965_render.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/i965_render.c 2008-03-26 02:15:45.000000000 +0100 @@ -1093,29 +1093,35 @@ float src_x[3], src_y[3], mask_x[3], mask_y[3]; int i; - i830_get_transformed_coordinates(srcX, srcY, - pI830->transform[0], - &src_x[0], &src_y[0]); - i830_get_transformed_coordinates(srcX, srcY + h, - pI830->transform[0], - &src_x[1], &src_y[1]); - i830_get_transformed_coordinates(srcX + w, srcY + h, - pI830->transform[0], - &src_x[2], &src_y[2]); + if (!i830_get_transformed_coordinates(srcX, srcY, + pI830->transform[0], + &src_x[0], &src_y[0])) + return; + if (!i830_get_transformed_coordinates(srcX, srcY + h, + pI830->transform[0], + &src_x[1], &src_y[1])) + return; + if (!i830_get_transformed_coordinates(srcX + w, srcY + h, + pI830->transform[0], + &src_x[2], &src_y[2])) + return; if (pI830->scale_units[1][0] == -1 || pI830->scale_units[1][1] == -1) { has_mask = FALSE; } else { has_mask = TRUE; - i830_get_transformed_coordinates(maskX, maskY, - pI830->transform[1], - &mask_x[0], &mask_y[0]); - i830_get_transformed_coordinates(maskX, maskY + h, - pI830->transform[1], - &mask_x[1], &mask_y[1]); - i830_get_transformed_coordinates(maskX + w, maskY + h, - pI830->transform[1], - &mask_x[2], &mask_y[2]); + if (!i830_get_transformed_coordinates(maskX, maskY, + pI830->transform[1], + &mask_x[0], &mask_y[0])) + return; + if (!i830_get_transformed_coordinates(maskX, maskY + h, + pI830->transform[1], + &mask_x[1], &mask_y[1])) + return; + if (!i830_get_transformed_coordinates(maskX + w, maskY + h, + pI830->transform[1], + &mask_x[2], &mask_y[2])) + return; } /* Wait for any existing composite rectangles to land before we overwrite diff -u -r xf86-video-intel-2.2.99.901/src/modes/xf86EdidModes.c xf86-video-intel-2.2.99.902/src/modes/xf86EdidModes.c --- xf86-video-intel-2.2.99.901/src/modes/xf86EdidModes.c 2008-03-21 04:52:37.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/modes/xf86EdidModes.c 2008-03-28 10:05:08.000000000 +0100 @@ -108,13 +108,6 @@ static Bool quirk_detailed_h_in_cm (int scrnIndex, xf86MonPtr DDC) { - /* Bug #10304: "LGPhilipsLCD LP154W01-A5" */ - /* Bug #12784: "LGPhilipsLCD LP154W01-TLA2" */ - /* Red Hat #435216 "LGPhilipsLCD LP154W01-TLAE" */ - if (memcmp (DDC->vendor.name, "LPL", 4) == 0 && - (DDC->vendor.prod_id == 0 || DDC->vendor.prod_id == 0x2a00)) - return TRUE; - /* Bug #11603: Funai Electronics PM36B */ if (memcmp (DDC->vendor.name, "FCM", 4) == 0 && DDC->vendor.prod_id == 13600) @@ -137,7 +130,7 @@ { /* Bug #10304: LGPhilipsLCD LP154W01-A5 */ if (memcmp (DDC->vendor.name, "LPL", 4) == 0 && - DDC->vendor.prod_id == 0) + (DDC->vendor.prod_id == 0 || DDC->vendor.prod_id == 0x2a00)) return TRUE; return FALSE; diff -u -r xf86-video-intel-2.2.99.901/src/reg_dumper/idle.c xf86-video-intel-2.2.99.902/src/reg_dumper/idle.c --- xf86-video-intel-2.2.99.901/src/reg_dumper/idle.c 2008-03-20 03:31:25.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/reg_dumper/idle.c 2008-03-31 04:00:10.000000000 +0200 @@ -54,22 +54,24 @@ {I965_MAP_FILTER_DONE, "map filter"}, {I965_MAP_L2_IDLE, "map L2"}, {I965_CP_DONE, "CP"}, + {0, "total"}, {0, "other"}, }; -/* Fills in the "other" field's idle flags */ +/* Fills in the "other" and "total" fields' idle flags */ static void setup_other_flags(struct idle_flags *idle_flags, int idle_flag_count) { - uint32_t other_idle_flags; + uint32_t other_idle_flags, total_idle_flags = 0; int i; other_idle_flags = ~(I965_RING_0_ENABLE); - for (i = 0; i < idle_flag_count - 1; i++) { + for (i = 0; i < idle_flag_count - 2; i++) { other_idle_flags &= ~idle_flags[i].instdone_flag; + total_idle_flags |= idle_flags[i].instdone_flag; } + idle_flags[i - 1].instdone_flag = total_idle_flags; idle_flags[i].instdone_flag = other_idle_flags; - } int main(int argc, char **argv) @@ -138,7 +140,8 @@ uint32_t instdone = INREG(INST_DONE_I965); for (j = 0; j < idle_flag_count; j++) { - if ((instdone & idle_flags[j].instdone_flag) == 0) + if ((instdone & idle_flags[j].instdone_flag) != + idle_flags[j].instdone_flag) idle_flags[j].count++; } diff -u -r xf86-video-intel-2.2.99.901/src/xvmc/i915_xvmc.c xf86-video-intel-2.2.99.902/src/xvmc/i915_xvmc.c --- xf86-video-intel-2.2.99.901/src/xvmc/i915_xvmc.c 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/xvmc/i915_xvmc.c 2008-03-26 03:15:53.000000000 +0100 @@ -25,7 +25,6 @@ * */ -#include #include #include "i915_xvmc.h" @@ -56,6 +55,7 @@ uint u[2]; } su_t; +#if 0 static int findOverlap(unsigned int width, unsigned int height, short *dstX, short *dstY, short *srcX, short *srcY, @@ -91,6 +91,7 @@ *areaH = (h <= mHeight) ? h : mHeight; return 0; } +#endif static void i915_flush(int map, int render) { @@ -117,7 +118,7 @@ struct i915_3dstate_dest_buffer_variables_mpeg *dest_buffer_variables_mpeg; i915XvMCSurface *pI915Surface = (i915XvMCSurface *)surface->privData; i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; - unsigned int w = surface->width, h = surface->height; + unsigned int w = surface->width; /* 3DSTATE_BUFFER_INFO */ /* DEST Y */ @@ -459,7 +460,7 @@ intelBatchbufferData(¯oblock_ipicture, sizeof(macroblock_ipicture), 0); } - +#if 0 static void i915_mc_mpeg_macroblock_0mv(XvMCContext *context, XvMCMacroBlock *mb) { struct i915_3dmpeg_macroblock_0mv macroblock_0mv; @@ -487,6 +488,7 @@ intelBatchbufferData(¯oblock_0mv, sizeof(macroblock_0mv), 0); } +#endif static void i915_mc_mpeg_macroblock_1fbmv(XvMCContext *context, XvMCMacroBlock *mb) { @@ -529,7 +531,6 @@ static void i915_mc_mpeg_macroblock_2fbmv(XvMCContext *context, XvMCMacroBlock *mb, unsigned int ps) { struct i915_3dmpeg_macroblock_2fbmv macroblock_2fbmv; - i915XvMCContext *pI915XvMC = (i915XvMCContext *)context->privData; /* Motion Vectors */ su_t fmv; @@ -979,6 +980,7 @@ free(base); } +#if 0 static void i915_mc_invalidate_subcontext_buffers(XvMCContext *context, unsigned int mask) { struct i915_3dstate_load_indirect *load_indirect = NULL; @@ -1086,6 +1088,7 @@ intelBatchbufferData(base, size, 0); free(base); } +#endif static int i915_xvmc_map_buffers(i915XvMCContext *pI915XvMC) { @@ -1167,6 +1170,7 @@ } } +#if 0 /* * Video post processing */ @@ -1243,7 +1247,9 @@ tm->tm2.cube_face = 0; tm->tm2.pitch = (privTarget->uvStride >> 2) - 1; /* in DWords - 1 */ } +#endif +#if 0 static void i915_yuv2rgb_sampler_state_buffer(XvMCSurface *surface) { struct i915_3dstate_sampler_state *sampler_state; @@ -1340,7 +1346,9 @@ ts->ts1.east_deinterlacer = 0; ts->ts2.default_color = 0; } +#endif +#if 0 static void i915_yuv2rgb_static_indirect_state_buffer(XvMCSurface *surface, unsigned int dstaddr, int dstpitch) @@ -1374,7 +1382,9 @@ dest_buffer_variables->dw1.dest_h_bias = 8; dest_buffer_variables->dw1.color_fmt = COLORBUFFER_A8R8G8B8; /* FIXME */ } +#endif +#if 0 static void i915_yuv2rgb_pixel_shader_program_buffer(XvMCSurface *surface) { struct i915_3dstate_pixel_shader_program *pixel_shader_program; @@ -1424,7 +1434,9 @@ src1 = UREG(REG_TYPE_S, 2); /* SAMPLER */ i915_inst_texld(inst, T0_TEXLD, dest, src0, src1); } +#endif +#if 0 static void i915_yuv2rgb_proc(XvMCSurface *surface) { i915XvMCSurface *privSurface = (i915XvMCSurface *)surface->privData; @@ -1581,6 +1593,7 @@ intelBatchbufferData(base, size, 0); free(base); } +#endif /* * Function: i915_release_resource @@ -1588,7 +1601,6 @@ static void i915_release_resource(Display *display, XvMCContext *context) { i915XvMCContext *pI915XvMC; - int screen = DefaultScreen(display); if (!(pI915XvMC = context->privData)) return; @@ -1608,13 +1620,7 @@ { i915XvMCContext *pI915XvMC = NULL; I915XvMCCreateContextRec *tmpComm = NULL; - Status ret; drm_sarea_t *pSAREA; - char *curBusID; - uint magic; - int major, minor; - int isCapable; - int screen = DefaultScreen(display); XVMC_DBG("%s\n", __FUNCTION__); @@ -1718,7 +1724,6 @@ XvMCContext *context, XvMCSurface *surface, int priv_count, CARD32 *priv_data) { - Status ret; i915XvMCContext *pI915XvMC; i915XvMCSurface *pI915Surface; I915XvMCCreateSurfaceRec *tmpComm = NULL; diff -u -r xf86-video-intel-2.2.99.901/src/xvmc/intel_batchbuffer.c xf86-video-intel-2.2.99.902/src/xvmc/intel_batchbuffer.c --- xf86-video-intel-2.2.99.901/src/xvmc/intel_batchbuffer.c 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/xvmc/intel_batchbuffer.c 2008-03-26 03:15:53.000000000 +0100 @@ -48,7 +48,7 @@ #define MI_BATCH_BUFFER_END (0xA << 23) -int intelEmitIrqLocked(void) +static int intelEmitIrqLocked(void) { drmI830IrqEmit ie; int ret, seq; @@ -65,7 +65,7 @@ return seq; } -void intelWaitIrq(int seq) +static void intelWaitIrq(int seq) { int ret; drmI830IrqWait iw; @@ -118,6 +118,7 @@ xvmc_driver->alloc.active_buf = 0; assert(xvmc_driver->alloc.ptr); + return True; } void intelFiniBatchBuffer(void) @@ -129,7 +130,7 @@ intelDestroyBatchBuffer(); } -void intelBatchbufferRequireSpace(unsigned int sz) +static void intelBatchbufferRequireSpace(unsigned int sz) { if (xvmc_driver->batch.space < sz) intelFlushBatch(TRUE); @@ -152,7 +153,7 @@ #define FLUSH_RENDER_CACHE (0 << 2) #define FLUSH_WRITE_DIRTY_STATE (1 << 4) -void intelRefillBatchLocked(Bool allow_unlock ) +static void intelRefillBatchLocked(Bool allow_unlock) { unsigned half = xvmc_driver->alloc.size >> 1; unsigned buf = (xvmc_driver->alloc.active_buf ^= 1); @@ -175,9 +176,9 @@ } -void intelFlushBatchLocked(Bool ignore_cliprects, - Bool refill, - Bool allow_unlock) +static void intelFlushBatchLocked(Bool ignore_cliprects, + Bool refill, + Bool allow_unlock) { drmI830BatchBuffer batch; diff -u -r xf86-video-intel-2.2.99.901/src/xvmc/intel_xvmc.c xf86-video-intel-2.2.99.902/src/xvmc/intel_xvmc.c --- xf86-video-intel-2.2.99.901/src/xvmc/intel_xvmc.c 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/xvmc/intel_xvmc.c 2008-03-26 03:15:53.000000000 +0100 @@ -250,7 +250,7 @@ XVMC_ERR("Unable to create XvMC Context."); return ret; } - XVMC_DBG("new context %d created\n", context->context_id); + XVMC_DBG("new context %d created\n", (int)context->context_id); comm = (struct _intel_xvmc_common *)priv_data; @@ -341,7 +341,7 @@ context->context_id, &intel_ctx->hw_context)) { XVMC_ERR("Could not create DRI context for xvmc ctx %d.", - context->context_id); + (int)context->context_id); XFree(priv_data); context->privData = NULL; drmUnmap(xvmc_driver->sarea_address, xvmc_driver->sarea_size); diff -u -r xf86-video-intel-2.2.99.901/src/xvmc/intel_xvmc.h xf86-video-intel-2.2.99.902/src/xvmc/intel_xvmc.h --- xf86-video-intel-2.2.99.901/src/xvmc/intel_xvmc.h 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/xvmc/intel_xvmc.h 2008-03-26 03:15:53.000000000 +0100 @@ -27,6 +27,7 @@ #ifndef INTEL_XVMC_H #define INTEL_XVMC_H +#include #include #include #include diff -u -r xf86-video-intel-2.2.99.901/src/xvmc/xf86dri.c xf86-video-intel-2.2.99.902/src/xvmc/xf86dri.c --- xf86-video-intel-2.2.99.901/src/xvmc/xf86dri.c 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/xvmc/xf86dri.c 2008-03-26 03:15:53.000000000 +0100 @@ -88,9 +88,8 @@ #else #define TRACE(msg, arg...) #endif - Bool uniDRIQueryExtension(dpy, event_basep, error_basep) - Display *dpy; - int *event_basep, *error_basep; +Bool +uniDRIQueryExtension(Display *dpy, int *event_basep, int *error_basep) { XExtDisplayInfo *info = find_display(dpy); @@ -107,11 +106,8 @@ } Bool -uniDRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion) - Display *dpy; - int *majorVersion; - int *minorVersion; - int *patchVersion; +uniDRIQueryVersion(Display *dpy, int *majorVersion, int *minorVersion, + int *patchVersion) { XExtDisplayInfo *info = find_display(dpy); xXF86DRIQueryVersionReply rep; @@ -141,10 +137,7 @@ } Bool -uniDRIQueryDirectRenderingCapable(dpy, screen, isCapable) - Display *dpy; - int screen; - Bool *isCapable; +uniDRIQueryDirectRenderingCapable(Display *dpy, int screen, Bool *isCapable) { XExtDisplayInfo *info = find_display(dpy); xXF86DRIQueryDirectRenderingCapableReply rep; @@ -173,11 +166,8 @@ } Bool -uniDRIOpenConnection(dpy, screen, hSAREA, busIdString) - Display *dpy; - int screen; - drm_handle_t *hSAREA; - char **busIdString; +uniDRIOpenConnection(Display *dpy, int screen, + drm_handle_t *hSAREA, char **busIdString) { XExtDisplayInfo *info = find_display(dpy); xXF86DRIOpenConnectionReply rep; @@ -224,10 +214,7 @@ } Bool -uniDRIAuthConnection(dpy, screen, magic) - Display *dpy; - int screen; - drm_magic_t magic; +uniDRIAuthConnection(Display *dpy, int screen, drm_magic_t magic) { XExtDisplayInfo *info = find_display(dpy); xXF86DRIAuthConnectionReq *req; @@ -256,9 +243,7 @@ } Bool -uniDRICloseConnection(dpy, screen) - Display *dpy; - int screen; +uniDRICloseConnection(Display *dpy, int screen) { XExtDisplayInfo *info = find_display(dpy); xXF86DRICloseConnectionReq *req; @@ -279,14 +264,9 @@ } Bool -uniDRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion, - ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName) - Display *dpy; - int screen; - int *ddxDriverMajorVersion; - int *ddxDriverMinorVersion; - int *ddxDriverPatchVersion; - char **clientDriverName; +uniDRIGetClientDriverName(Display *dpy, int screen, int *ddxDriverMajorVersion, + int *ddxDriverMinorVersion, int *ddxDriverPatchVersion, + char **clientDriverName) { XExtDisplayInfo *info = find_display(dpy); xXF86DRIGetClientDriverNameReply rep; @@ -331,12 +311,8 @@ } Bool -uniDRICreateContextWithConfig(dpy, screen, configID, context, hHWContext) - Display *dpy; - int screen; - int configID; - XID context; - drm_context_t *hHWContext; +uniDRICreateContextWithConfig(Display *dpy, int screen, int configID, + XID context, drm_context_t *hHWContext) { XExtDisplayInfo *info = find_display(dpy); xXF86DRICreateContextReply rep; @@ -366,12 +342,8 @@ } Bool -uniDRICreateContext(dpy, screen, visual, context, hHWContext) - Display *dpy; - int screen; - Visual *visual; - XID context; - drm_context_t *hHWContext; +uniDRICreateContext(Display *dpy, int screen, Visual *visual, + XID context, drm_context_t *hHWContext) { return uniDRICreateContextWithConfig(dpy, screen, visual->visualid, context, hHWContext); @@ -539,16 +511,9 @@ } Bool -uniDRIGetDeviceInfo(dpy, screen, hFrameBuffer, - fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate) - Display *dpy; - int screen; - drm_handle_t *hFrameBuffer; - int *fbOrigin; - int *fbSize; - int *fbStride; - int *devPrivateSize; - void **pDevPrivate; +uniDRIGetDeviceInfo(Display *dpy, int screen, drm_handle_t *hFrameBuffer, + int *fbOrigin, int *fbSize, int *fbStride, + int *devPrivateSize, void **pDevPrivate) { XExtDisplayInfo *info = find_display(dpy); xXF86DRIGetDeviceInfoReply rep; diff -u -r xf86-video-intel-2.2.99.901/src/xvmc/xf86dri.h xf86-video-intel-2.2.99.902/src/xvmc/xf86dri.h --- xf86-video-intel-2.2.99.901/src/xvmc/xf86dri.h 2008-03-20 03:31:57.000000000 +0100 +++ xf86-video-intel-2.2.99.902/src/xvmc/xf86dri.h 2008-03-26 03:15:53.000000000 +0100 @@ -66,33 +66,33 @@ #ifndef _XF86DRI_SERVER_ _XFUNCPROTOBEGIN - Bool uniDRIQueryExtension(Display * dpy, int *event_base, +extern Bool uniDRIQueryExtension(Display * dpy, int *event_base, int *error_base); -Bool uniDRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion, - int *patchVersion); +extern Bool uniDRIQueryVersion(Display * dpy, int *majorVersion, + int *minorVersion, int *patchVersion); -Bool uniDRIQueryDirectRenderingCapable(Display * dpy, int screen, +extern Bool uniDRIQueryDirectRenderingCapable(Display * dpy, int screen, Bool * isCapable); -Bool uniDRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA, +extern Bool uniDRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA, char **busIDString); -Bool uniDRIAuthConnection(Display * dpy, int screen, drm_magic_t magic); +extern Bool uniDRIAuthConnection(Display * dpy, int screen, drm_magic_t magic); -Bool uniDRICloseConnection(Display * dpy, int screen); +extern Bool uniDRICloseConnection(Display * dpy, int screen); -Bool uniDRIGetClientDriverName(Display * dpy, int screen, +extern Bool uniDRIGetClientDriverName(Display * dpy, int screen, int *ddxDriverMajorVersion, int *ddxDriverMinorVersion, int *ddxDriverPatchVersion, char **clientDriverName); /* XvMC context XID is alloced in _xvmc_create_context, so * don't recreate here */ -Bool uniDRICreateContext(Display * dpy, int screen, Visual * visual, +extern Bool uniDRICreateContext(Display * dpy, int screen, Visual * visual, XID context_id, drm_context_t * hHWContext); -Bool uniDRICreateContextWithConfig(Display * dpy, int screen, int configID, - XID context_id, drm_context_t * hHWContext); +extern Bool uniDRICreateContextWithConfig(Display * dpy, int screen, + int configID, XID context_id, drm_context_t * hHWContext); extern Bool uniDRIDestroyContext(Display * dpy, int screen, XID context_id); @@ -102,10 +102,17 @@ extern Bool uniDRIDestroyDrawable(Display * dpy, int screen, Drawable drawable); -Bool uniDRIGetDeviceInfo(Display * dpy, int screen, +extern Bool uniDRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer, int *fbOrigin, int *fbSize, int *fbStride, int *devPrivateSize, void **pDevPrivate); +extern Bool uniDRIGetDrawableInfo(Display * dpy, int screen, + Drawable drawable, unsigned int *index, unsigned int *stamp, + int *X, int *Y, int *W, int *H, + int *numClipRects, drm_clip_rect_t ** pClipRects, + int *backX, int *backY, + int *numBackClipRects, drm_clip_rect_t ** pBackClipRects); + _XFUNCPROTOEND #endif /* _XF86DRI_SERVER_ */ #endif /* _XF86DRI_H_ */