summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2009-11-22 15:33:59 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2009-11-22 15:33:59 +0000
commit374766154eb1df8c1c012d3734c6eb915983fc90 (patch)
tree6eba6fb2c0252a6538b08c534498dddcd1e2d364 /driver
parentb28cf506940e0723c19a9b6452893f033d6d035b (diff)
Update to xf86-video-ast 0.89.9
Diffstat (limited to 'driver')
-rw-r--r--driver/xf86-video-ast/ChangeLog6
-rw-r--r--driver/xf86-video-ast/aclocal.m489
-rw-r--r--driver/xf86-video-ast/configure20
-rw-r--r--driver/xf86-video-ast/configure.ac2
-rw-r--r--driver/xf86-video-ast/src/ast.h6
-rw-r--r--driver/xf86-video-ast/src/ast_2dtool.c2
-rw-r--r--driver/xf86-video-ast/src/ast_accel.c109
-rw-r--r--driver/xf86-video-ast/src/ast_cursor.c23
-rw-r--r--driver/xf86-video-ast/src/ast_driver.c146
-rw-r--r--driver/xf86-video-ast/src/ast_mode.c2
-rw-r--r--driver/xf86-video-ast/src/ast_tool.c2
-rw-r--r--driver/xf86-video-ast/src/ast_vgatool.c162
-rw-r--r--driver/xf86-video-ast/src/ast_vgatool.h10
13 files changed, 381 insertions, 198 deletions
diff --git a/driver/xf86-video-ast/ChangeLog b/driver/xf86-video-ast/ChangeLog
index 3d05159a2..017583270 100644
--- a/driver/xf86-video-ast/ChangeLog
+++ b/driver/xf86-video-ast/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-03 Y.C. Chen <yc_chen@aspedtech.com>
+ * src/ast_driver.c, ast_vgatool.c
+ - Fixed the screen flashing issue while running x11perf
+ * src/ast.h, ast_driver.c, ast_vgatool.c/h
+ - Fixed Suspend can't resume issue
+
2009-04-13 Y.C. Chen <yc_chen@aspedtech.com>
* src/ast.h, ast_cursor.c
- Fixed xorg bugzilla #20606
diff --git a/driver/xf86-video-ast/aclocal.m4 b/driver/xf86-video-ast/aclocal.m4
index 3ec9c2c92..f5c20ec3e 100644
--- a/driver/xf86-video-ast/aclocal.m4
+++ b/driver/xf86-video-ast/aclocal.m4
@@ -7631,7 +7631,7 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
-dnl xorg-macros.m4. Generated from xorg-macros.m4.in:xorgversion.m4 by configure.
+dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
dnl
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
dnl
@@ -7668,27 +7668,24 @@ dnl of the copyright holder.
# your configure.ac with the minimum required version, such as:
# XORG_MACROS_VERSION(1.1)
#
-# To force at least a version with this macro defined, also add:
-# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
+# To ensure that this macro is defined, also add:
+# m4_ifndef([XORG_MACROS_VERSION],
+# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
#
#
# See the "minimum version" comment for each macro you use to see what
# version you require.
-AC_DEFUN([XORG_MACROS_VERSION],[
- [XORG_MACROS_needed_version=$1
- XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
- XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
- AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
- [XORG_MACROS_version=1.2.1
- XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
- XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
- if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
- AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
- fi
- if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
- AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
- fi
- AC_MSG_RESULT([yes, $XORG_MACROS_version])
+m4_defun([XORG_MACROS_VERSION],[
+m4_define([vers_have], [1.3.0])
+m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
+m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
+m4_if(m4_cmp(maj_have, maj_needed), 0,,
+ [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
+m4_if(m4_version_compare(vers_have, [$1]), -1,
+ [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
+m4_undefine([vers_have])
+m4_undefine([maj_have])
+m4_undefine([maj_needed])
]) # XORG_MACROS_VERSION
# XORG_PROG_RAWCPP()
@@ -7955,7 +7952,7 @@ AC_SUBST(MAKE_HTML)
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
AC_ARG_ENABLE(malloc0returnsnull,
- AC_HELP_STRING([--enable-malloc0returnsnull],
+ AS_HELP_STRING([--enable-malloc0returnsnull],
[malloc(0) returns NULL (default: auto)]),
[MALLOC_ZERO_RETURNS_NULL=$enableval],
[MALLOC_ZERO_RETURNS_NULL=auto])
@@ -8007,7 +8004,7 @@ AC_SUBST([XTMALLOC_ZERO_CFLAGS])
AC_DEFUN([XORG_WITH_LINT],[
# Allow checking code with lint, sparse, etc.
-AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
+AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
[Use a lint-style source code checker (default: disabled)])],
[use_lint=$withval], [use_lint=no])
if test "x$use_lint" = "xyes" ; then
@@ -8048,7 +8045,7 @@ AM_CONDITIONAL(LINT, [test x$LINT != xno])
AC_DEFUN([XORG_LINT_LIBRARY],[
AC_REQUIRE([XORG_WITH_LINT])
# Build lint "library" for more indepth checks of programs calling this library
-AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
+AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
[Create lint library (default: disabled)])],
[make_lint_lib=$enableval], [make_lint_lib=no])
if test "x$make_lint_lib" != "xno" ; then
@@ -8078,9 +8075,9 @@ if test "x$GCC" = xyes ; then
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
-Wbad-function-cast"
- case `gcc -dumpversion` in
+ case `$CC -dumpversion` in
3.4.* | 4.*)
- CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
+ CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
;;
esac
else
@@ -8090,7 +8087,51 @@ else
fi
fi
AC_SUBST(CWARNFLAGS)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
]) # XORG_CWARNFLAGS
+
+# XORG_STRICT_OPTION
+# -----------------------
+# Minimum version: 1.3.0
+#
+# Add configure option to enable strict compilation
+AC_DEFUN([XORG_STRICT_OPTION], [
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CC_C99])
+AC_REQUIRE([XORG_CWARNFLAGS])
+
+AC_ARG_ENABLE(strict-compilation,
+ AS_HELP_STRING([--enable-strict-compilation],
+ [Enable all warnings from compiler and make them errors (default: disabled)]),
+ [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
+if test "x$STRICT_COMPILE" = "xyes"; then
+ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+ AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
+ if test "x$GCC" = xyes ; then
+ STRICT_CFLAGS="-pedantic -Werror"
+ elif test "x$SUNCC" = "xyes"; then
+ STRICT_CFLAGS="-errwarn"
+ elif test "x$INTELCC" = "xyes"; then
+ STRICT_CFLAGS="-Werror"
+ fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+AC_SUBST([CWARNFLAGS])
+]) # XORG_STRICT_OPTION
+
+# XORG_DEFAULT_OPTIONS
+# --------------------
+# Minimum version: 1.3.0
+#
+# Defines default options for X.Org modules.
+#
+AC_DEFUN([XORG_DEFAULT_OPTIONS], [
+XORG_CWARNFLAGS
+XORG_STRICT_OPTION
+XORG_RELEASE_VERSION
+XORG_CHANGELOG
+XORG_MANPAGE_SECTIONS
+]) # XORG_DEFAULT_OPTIONS
dnl Copyright 2005 Red Hat, Inc
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
@@ -8125,7 +8166,7 @@ dnl
AC_DEFUN([XORG_RELEASE_VERSION],[
AC_ARG_WITH(release-version,
- AC_HELP_STRING([--with-release-version=STRING],
+ AS_HELP_STRING([--with-release-version=STRING],
[Use release version string in package name]),
[RELEASE_VERSION="$withval"],
[RELEASE_VERSION=""])
diff --git a/driver/xf86-video-ast/configure b/driver/xf86-video-ast/configure
index 782623562..f5ac7b9ea 100644
--- a/driver/xf86-video-ast/configure
+++ b/driver/xf86-video-ast/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for xf86-video-ast 0.89.0.
+# Generated by GNU Autoconf 2.62 for xf86-video-ast 0.89.9.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -750,8 +750,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='xf86-video-ast'
PACKAGE_TARNAME='xf86-video-ast'
-PACKAGE_VERSION='0.89.0'
-PACKAGE_STRING='xf86-video-ast 0.89.0'
+PACKAGE_VERSION='0.89.9'
+PACKAGE_STRING='xf86-video-ast 0.89.9'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
ac_unique_file="Makefile.am"
@@ -1507,7 +1507,7 @@ if test "$ac_init_help" = "long"; then
# 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-ast 0.89.0 to adapt to many kinds of systems.
+\`configure' configures xf86-video-ast 0.89.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1577,7 +1577,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-video-ast 0.89.0:";;
+ short | recursive ) echo "Configuration of xf86-video-ast 0.89.9:";;
esac
cat <<\_ACEOF
@@ -1696,7 +1696,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xf86-video-ast configure 0.89.0
+xf86-video-ast configure 0.89.9
generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1710,7 +1710,7 @@ cat >config.log <<_ACEOF
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-ast $as_me 0.89.0, which was
+It was created by xf86-video-ast $as_me 0.89.9, which was
generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@
@@ -2364,7 +2364,7 @@ fi
# Define the identity of the package.
PACKAGE='xf86-video-ast'
- VERSION='0.89.0'
+ VERSION='0.89.9'
cat >>confdefs.h <<_ACEOF
@@ -22152,7 +22152,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by xf86-video-ast $as_me 0.89.0, which was
+This file was extended by xf86-video-ast $as_me 0.89.9, which was
generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22205,7 +22205,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-xf86-video-ast config.status 0.89.0
+xf86-video-ast config.status 0.89.9
configured by $0, generated by GNU Autoconf 2.62,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/driver/xf86-video-ast/configure.ac b/driver/xf86-video-ast/configure.ac
index e34f736f6..8f43a5cb1 100644
--- a/driver/xf86-video-ast/configure.ac
+++ b/driver/xf86-video-ast/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-ast],
- 0.89.0,
+ 0.89.9,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-ast)
diff --git a/driver/xf86-video-ast/src/ast.h b/driver/xf86-video-ast/src/ast.h
index bafd29b15..0757e644e 100644
--- a/driver/xf86-video-ast/src/ast.h
+++ b/driver/xf86-video-ast/src/ast.h
@@ -158,6 +158,7 @@ typedef struct _ASTRec {
ScreenBlockHandlerProcPtr BlockHandler;
UCHAR jChipType;
+ UCHAR jDRAMType;
Bool noAccel;
Bool noHWC;
@@ -186,6 +187,11 @@ typedef struct _ASTRec {
HWCINFO HWCInfo;
ULONG ulCMDReg;
Bool EnableClip;
+
+ int clip_left;
+ int clip_top;
+ int clip_right;
+ int clip_bottom;
} ASTRec, *ASTRecPtr;
diff --git a/driver/xf86-video-ast/src/ast_2dtool.c b/driver/xf86-video-ast/src/ast_2dtool.c
index f9d6b97eb..63a059d25 100644
--- a/driver/xf86-video-ast/src/ast_2dtool.c
+++ b/driver/xf86-video-ast/src/ast_2dtool.c
@@ -25,8 +25,6 @@
#endif
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Resources.h"
-#include "xf86RAC.h"
#include "xf86cmap.h"
#include "compiler.h"
#include "mibstore.h"
diff --git a/driver/xf86-video-ast/src/ast_accel.c b/driver/xf86-video-ast/src/ast_accel.c
index ef214620c..b15da59eb 100644
--- a/driver/xf86-video-ast/src/ast_accel.c
+++ b/driver/xf86-video-ast/src/ast_accel.c
@@ -25,8 +25,6 @@
#endif
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Resources.h"
-#include "xf86RAC.h"
#include "xf86cmap.h"
#include "compiler.h"
#include "mibstore.h"
@@ -152,6 +150,7 @@ static void ASTSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
static void ASTSetClippingRectangle(ScrnInfoPtr pScrn,
int left, int top, int right, int bottom);
static void ASTDisableClipping(ScrnInfoPtr pScrn);
+static void ASTSetHWClipping(ScrnInfoPtr pScrn, int delta_y);
Bool
ASTAccelInit(ScreenPtr pScreen)
@@ -338,6 +337,7 @@ ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
PKT_SC *pSingleCMD;
int src_x, src_y, dst_x, dst_y;
ULONG srcbase, dstbase, cmdreg;
+ int delta_y = 0;
/*
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentScreenToScreenCopy\n");
*/
@@ -365,7 +365,8 @@ ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
}
if ((y2 + height) >= pScrn->virtualY)
- {
+ {
+ delta_y = y2;
dstbase=pAST->VideoModeInfo.ScreenPitch*y2;
y2 = 0;
}
@@ -391,6 +392,9 @@ ASTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, int x2,
src_y = y1;
dst_y = y2;
}
+
+ if (pAST->EnableClip)
+ ASTSetHWClipping(pScrn, delta_y);
if (!pAST->MMIO2D)
{
@@ -488,7 +492,9 @@ ASTSubsequentSolidFillRect(ScrnInfoPtr pScrn,
{
ASTRecPtr pAST = ASTPTR(pScrn);
PKT_SC *pSingleCMD;
- ULONG dstbase, cmdreg;
+ ULONG dstbase, cmdreg;
+ int delta_y = 0;
+
/*
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidFillRect\n");
*/
@@ -504,11 +510,15 @@ ASTSubsequentSolidFillRect(ScrnInfoPtr pScrn,
dstbase = 0;
if (dst_y >= pScrn->virtualY)
- {
+ {
+ delta_y = dst_y;
dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y;
dst_y=0;
}
-
+
+ if (pAST->EnableClip)
+ ASTSetHWClipping(pScrn, delta_y);
+
if (!pAST->MMIO2D)
{
/* Write to CMDQ */
@@ -606,6 +616,7 @@ static void ASTSubsequentSolidHorVertLine(ScrnInfoPtr pScrn,
PKT_SC *pSingleCMD;
ULONG dstbase, cmdreg;
int width, height;
+ int delta_y = 0;
/*
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidHorVertLine\n");
*/
@@ -629,12 +640,15 @@ static void ASTSubsequentSolidHorVertLine(ScrnInfoPtr pScrn,
}
if ((y + height) >= pScrn->virtualY)
- {
+ {
+ delta_y = y;
dstbase=pAST->VideoModeInfo.ScreenPitch*y;
y=0;
}
-
+ if (pAST->EnableClip)
+ ASTSetHWClipping(pScrn, delta_y);
+
if (!pAST->MMIO2D)
{
/* Write to CMDQ */
@@ -678,6 +692,8 @@ static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn,
ULONG dstbase, ulCommand;
ULONG miny, maxy;
USHORT usXM;
+ int delta_y = 0;
+
/*
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentSolidTwoPointLine\n");
*/
@@ -696,6 +712,7 @@ static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn,
miny = (y1 > y2) ? y2 : y1;
maxy = (y1 > y2) ? y1 : y2;
if(maxy >= pScrn->virtualY) {
+ delta_y = miny;
dstbase = pAST->VideoModeInfo.ScreenPitch * miny;
y1 -= miny;
y2 -= miny;
@@ -714,6 +731,9 @@ static void ASTSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn,
ulCommand |= CMD_Y_DEC;
usXM = (dsLineParam.dwLineAttributes & LINEPARAM_XM) ? 1:0;
+
+ if (pAST->EnableClip)
+ ASTSetHWClipping(pScrn, delta_y);
if (!pAST->MMIO2D)
{
@@ -841,6 +861,8 @@ ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn,
ULONG dstbase, ulCommand;
ULONG miny, maxy;
USHORT usXM;
+ int delta_y = 0;
+
/*
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentDashedTwoPointLine\n");
*/
@@ -859,6 +881,7 @@ ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn,
miny = (y1 > y2) ? y2 : y1;
maxy = (y1 > y2) ? y1 : y2;
if(maxy >= pScrn->virtualY) {
+ delta_y = miny;
dstbase = pAST->VideoModeInfo.ScreenPitch * miny;
y1 -= miny;
y2 -= miny;
@@ -877,6 +900,9 @@ ASTSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn,
ulCommand |= CMD_Y_DEC;
usXM = (dsLineParam.dwLineAttributes & LINEPARAM_XM) ? 1:0;
+
+ if (pAST->EnableClip)
+ ASTSetHWClipping(pScrn, delta_y);
if (!pAST->MMIO2D)
{
@@ -991,7 +1017,9 @@ ASTSubsequentMonoPatternFill(ScrnInfoPtr pScrn,
{
ASTRecPtr pAST = ASTPTR(pScrn);
PKT_SC *pSingleCMD;
- ULONG dstbase, cmdreg;
+ ULONG dstbase, cmdreg;
+ int delta_y = 0;
+
/*
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentMonoPatternFill\n");
*/
@@ -1006,10 +1034,14 @@ ASTSubsequentMonoPatternFill(ScrnInfoPtr pScrn,
if (dst_y >= pScrn->virtualY)
{
+ delta_y = dst_y;
dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y;
dst_y=0;
}
-
+
+ if (pAST->EnableClip)
+ ASTSetHWClipping(pScrn, delta_y);
+
if (!pAST->MMIO2D)
{
/* Write to CMDQ */
@@ -1116,7 +1148,9 @@ ASTSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty,
{
ASTRecPtr pAST = ASTPTR(pScrn);
PKT_SC *pSingleCMD;
- ULONG dstbase, cmdreg;
+ ULONG dstbase, cmdreg;
+ int delta_y = 0;
+
/*
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentColor8x8PatternFillRect\n");
*/
@@ -1131,9 +1165,13 @@ ASTSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, int patx, int paty,
if (dst_y >= pScrn->virtualY)
{
+ delta_y = dst_y;
dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y;
dst_y=0;
}
+
+ if (pAST->EnableClip)
+ ASTSetHWClipping(pScrn, delta_y);
if (!pAST->MMIO2D)
{
@@ -1235,6 +1273,7 @@ ASTSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
ASTRecPtr pAST = ASTPTR(pScrn);
PKT_SC *pSingleCMD;
ULONG dstbase, cmdreg;
+ int delta_y = 0;
/*
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentCPUToScreenColorExpandFill\n");
@@ -1250,10 +1289,14 @@ ASTSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
if (dst_y >= pScrn->virtualY)
{
+ delta_y = dst_y;
dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y;
dst_y=0;
}
-
+
+ if (pAST->EnableClip)
+ ASTSetHWClipping(pScrn, delta_y);
+
if (!pAST->MMIO2D)
{
/* Write to CMDQ */
@@ -1364,6 +1407,7 @@ ASTSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
PKT_SC *pSingleCMD;
ULONG srcbase, dstbase, cmdreg;
USHORT srcpitch;
+ int delta_y = 0;
/*
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSubsequentScreenToScreenColorExpandFill\n");
@@ -1378,11 +1422,15 @@ ASTSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
dstbase = 0;
if (dst_y >= pScrn->virtualY)
{
+ delta_y = dst_y;
dstbase=pAST->VideoModeInfo.ScreenPitch*dst_y;
dst_y=0;
}
srcbase = pAST->VideoModeInfo.ScreenPitch*src_y + ((pScrn->bitsPerPixel+1)/8)*src_x;
srcpitch = (pScrn->displayWidth+7)/8;
+
+ if (pAST->EnableClip)
+ ASTSetHWClipping(pScrn, delta_y);
if (!pAST->MMIO2D)
{
@@ -1423,25 +1471,19 @@ ASTSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn,
/* Clipping */
static void
-ASTSetClippingRectangle(ScrnInfoPtr pScrn,
- int left, int top, int right, int bottom)
+ASTSetHWClipping(ScrnInfoPtr pScrn, int delta_y)
{
-
ASTRecPtr pAST = ASTPTR(pScrn);
PKT_SC *pSingleCMD;
-/*
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetClippingRectangle\n");
-*/
- pAST->EnableClip = TRUE;
-
+
if (!pAST->MMIO2D)
{
/* Write to CMDQ */
pSingleCMD = (PKT_SC *) pjRequestCMDQ(pAST, PKT_SINGLE_LENGTH*2);
- ASTSetupCLIP1(pSingleCMD, left, top);
+ ASTSetupCLIP1(pSingleCMD, pAST->clip_left, pAST->clip_top - delta_y);
pSingleCMD++;
- ASTSetupCLIP2(pSingleCMD, right, bottom);
+ ASTSetupCLIP2(pSingleCMD, pAST->clip_right + 1, pAST->clip_bottom - delta_y + 1);
/* Update Write Pointer */
mUpdateWritePointer;
@@ -1449,9 +1491,28 @@ ASTSetClippingRectangle(ScrnInfoPtr pScrn,
}
else
{
- ASTSetupCLIP1_MMIO(left, top);
- ASTSetupCLIP2_MMIO(right, bottom);
+ ASTSetupCLIP1_MMIO(pAST->clip_left, pAST->clip_top - delta_y);
+ ASTSetupCLIP2_MMIO(pAST->clip_right + 1, pAST->clip_bottom - delta_y + 1);
}
+
+}
+
+static void
+ASTSetClippingRectangle(ScrnInfoPtr pScrn,
+ int left, int top, int right, int bottom)
+{
+
+ ASTRecPtr pAST = ASTPTR(pScrn);
+ PKT_SC *pSingleCMD;
+/*
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ASTSetClippingRectangle\n");
+*/
+ pAST->EnableClip = TRUE;
+
+ pAST->clip_left = left;
+ pAST->clip_top = top;
+ pAST->clip_right = right;
+ pAST->clip_bottom = bottom;
}
diff --git a/driver/xf86-video-ast/src/ast_cursor.c b/driver/xf86-video-ast/src/ast_cursor.c
index 8c9757ac2..9aa3e53a8 100644
--- a/driver/xf86-video-ast/src/ast_cursor.c
+++ b/driver/xf86-video-ast/src/ast_cursor.c
@@ -25,8 +25,6 @@
#endif
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Resources.h"
-#include "xf86RAC.h"
#include "xf86cmap.h"
#include "compiler.h"
#include "mibstore.h"
@@ -200,12 +198,18 @@ static void
ASTSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
{
ASTRecPtr pAST = ASTPTR(pScrn);
-
- pAST->HWCInfo.fg = (fg & 0x0F) | (((fg>>8) & 0x0F) << 4) | (((fg>>16) & 0x0F) << 8);
- pAST->HWCInfo.bg = (bg & 0x0F) | (((bg>>8) & 0x0F) << 4) | (((bg>>16) & 0x0F) << 8);
+ ULONG fg1, bg1;
+
+ fg1 = (fg & 0x0F) | (((fg>>8) & 0x0F) << 4) | (((fg>>16) & 0x0F) << 8);
+ bg1 = (bg & 0x0F) | (((bg>>8) & 0x0F) << 4) | (((bg>>16) & 0x0F) << 8);
- /* Fixed xorg bugzilla #20609, ycchen@031209 */
- ASTLoadCursorImage(pScrn, pAST->HWCInfo.cursorpattern);
+ /* Fixed xorg bugzilla #20609, ycchen@031209 */
+ if ( (fg1 != pAST->HWCInfo.fg) || (bg1 != pAST->HWCInfo.bg) )
+ {
+ pAST->HWCInfo.fg = fg1;
+ pAST->HWCInfo.bg = bg1;
+ ASTLoadCursorImage(pScrn, pAST->HWCInfo.cursorpattern);
+ }
}
@@ -230,7 +234,7 @@ ASTLoadCursorImage(ScrnInfoPtr pScrn, UCHAR *src)
/* copy to hwc info */
for (i=0; i< MAX_HWC_WIDTH*MAX_HWC_HEIGHT/4; i+=4)
*(ULONG *) (pAST->HWCInfo.cursorpattern + i) = *(ULONG *) (src + i);
-
+
/* copy cursor image to cache */
pjSrcXor = src;
pjSrcAnd = src + (MAX_HWC_WIDTH*MAX_HWC_HEIGHT/8);
@@ -250,12 +254,11 @@ ASTLoadCursorImage(ScrnInfoPtr pScrn, UCHAR *src)
ulTempDstAnd32[1] = ((jTempSrcAnd32 >> (k-1)) & 0x01) ? 0x80000000L:0x00L;
ulTempDstXor32[1] = ((jTempSrcXor32 >> (k-1)) & 0x01) ? 0x40000000L:0x00L;
ulTempDstData32[1] = ((jTempSrcXor32 >> (k-1)) & 0x01) ? (pAST->HWCInfo.fg << 16):(pAST->HWCInfo.bg << 16);
- ulTempDstData32[1] = ((jTempSrcXor32 >> (k-1)) & 0x01) ? (pAST->HWCInfo.fg << 16):(pAST->HWCInfo.bg << 16);
/* No inverse for X Window cursor, ycchen@111808 */
if (ulTempDstAnd32[0])
ulTempDstXor32[0] = 0;
if (ulTempDstAnd32[1])
- ulTempDstXor32[1] = 0;
+ ulTempDstXor32[1] = 0;
*((ULONG *) pjDstData) = ulTempDstAnd32[0] | ulTempDstXor32[0] | ulTempDstData32[0] | ulTempDstAnd32[1] | ulTempDstXor32[1] | ulTempDstData32[1];
ulCheckSum += *((ULONG *) pjDstData);
pjDstData += 4;
diff --git a/driver/xf86-video-ast/src/ast_driver.c b/driver/xf86-video-ast/src/ast_driver.c
index 927ad6a6a..4b1005580 100644
--- a/driver/xf86-video-ast/src/ast_driver.c
+++ b/driver/xf86-video-ast/src/ast_driver.c
@@ -25,8 +25,10 @@
#endif
#include "xf86.h"
#include "xf86_OSproc.h"
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
#include "xf86Resources.h"
#include "xf86RAC.h"
+#endif
#include "xf86cmap.h"
#include "compiler.h"
#include "mibstore.h"
@@ -64,6 +66,7 @@ extern void ASTUnmapMMIO(ScrnInfoPtr pScrn);
extern void vASTOpenKey(ScrnInfoPtr pScrn);
extern Bool bASTRegInit(ScrnInfoPtr pScrn);
+extern void GetDRAMInfo(ScrnInfoPtr pScrn);
extern ULONG GetVRAMInfo(ScrnInfoPtr pScrn);
extern ULONG GetMaxDCLK(ScrnInfoPtr pScrn);
extern void GetChipType(ScrnInfoPtr pScrn);
@@ -73,6 +76,9 @@ extern void vSetStartAddressCRT1(ASTRecPtr pAST, ULONG base);
extern Bool ASTSetMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
extern Bool GetVGA2EDID(ScrnInfoPtr pScrn, unsigned char *pEDIDBuffer);
extern void vInitDRAMReg(ScrnInfoPtr pScrn);
+extern Bool bIsVGAEnabled(ScrnInfoPtr pScrn);
+extern void ASTBlankScreen(ScrnInfoPtr pScreen, Bool unblack);
+extern Bool InitVGA(ScrnInfoPtr pScrn);
extern Bool bInitCMDQInfo(ScrnInfoPtr pScrn, ASTRecPtr pAST);
extern Bool bEnableCMDQ(ScrnInfoPtr pScrn, ASTRecPtr pAST);
@@ -158,93 +164,6 @@ static const OptionInfoRec ASTOptions[] = {
{-1, NULL, OPTV_NONE, {0}, FALSE}
};
-const char *vgahwSymbols[] = {
- "vgaHWFreeHWRec",
- "vgaHWGetHWRec",
- "vgaHWGetIOBase",
- "vgaHWGetIndex",
- "vgaHWInit",
- "vgaHWLock",
- "vgaHWMapMem",
- "vgaHWProtect",
- "vgaHWRestore",
- "vgaHWSave",
- "vgaHWSaveScreen",
- "vgaHWSetMmioFuncs",
- "vgaHWUnlock",
- "vgaHWUnmapMem",
- NULL
-};
-
-const char *fbSymbols[] = {
- "fbPictureInit",
- "fbScreenInit",
- NULL
-};
-
-const char *vbeSymbols[] = {
- "VBEInit",
- "VBEFreeModeInfo",
- "VBEFreeVBEInfo",
- "VBEGetModeInfo",
- "VBEGetModePool",
- "VBEGetVBEInfo",
- "VBEGetVBEMode",
- "VBEPrintModes",
- "VBESaveRestore",
- "VBESetDisplayStart",
- "VBESetGetDACPaletteFormat",
- "VBESetGetLogicalScanlineLength",
- "VBESetGetPaletteData",
- "VBESetModeNames",
- "VBESetModeParameters",
- "VBESetVBEMode",
- "VBEValidateModes",
- "vbeDoEDID",
- "vbeFree",
- NULL
-};
-
-#ifdef XFree86LOADER
-static const char *vbeOptionalSymbols[] = {
- "VBEDPMSSet",
- "VBEGetPixelClock",
- NULL
-};
-#endif
-
-const char *ddcSymbols[] = {
- "xf86PrintEDID",
- "xf86SetDDCproperties",
- NULL
-};
-
-const char *int10Symbols[] = {
- "xf86ExecX86int10",
- "xf86InitInt10",
- "xf86Int10AllocPages",
- "xf86int10Addr",
- "xf86FreeInt10",
- NULL
-};
-
-const char *xaaSymbols[] = {
- "XAACreateInfoRec",
- "XAADestroyInfoRec",
- "XAAInit",
- "XAACopyROP",
- "XAAPatternROP",
- NULL
-};
-
-const char *ramdacSymbols[] = {
- "xf86CreateCursorInfoRec",
- "xf86DestroyCursorInfoRec",
- "xf86InitCursor",
- NULL
-};
-
-
#ifdef XFree86LOADER
static MODULESETUPPROTO(astSetup);
@@ -280,15 +199,6 @@ astSetup(pointer module, pointer opts, int *errmaj, int *errmin)
xf86AddDriver(&AST, module, 0);
/*
- * Tell the loader about symbols from other modules that this module
- * might refer to.
- */
- LoaderRefSymLists(vgahwSymbols,
- fbSymbols, xaaSymbols, ramdacSymbols,
- vbeSymbols, vbeOptionalSymbols,
- ddcSymbols, int10Symbols, NULL);
-
- /*
* The return value must be non-NULL on success even though there
* is no TearDownProc.
*/
@@ -439,18 +349,18 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
if (pEnt->location.type != BUS_PCI)
return FALSE;
+#ifndef XSERVER_LIBPCIACCESS
if (xf86RegisterResources(pEnt->index, 0, ResExclusive))
return FALSE;
+#endif
/* The vgahw module should be loaded here when needed */
if (!xf86LoadSubModule(pScrn, "vgahw"))
return FALSE;
- xf86LoaderReqSymLists(vgahwSymbols, NULL);
/* The fb module should be loaded here when needed */
if (!xf86LoadSubModule(pScrn, "fb"))
return FALSE;
- xf86LoaderReqSymLists(fbSymbols, NULL);
/* Allocate a vgaHWRec */
if (!vgaHWGetHWRec(pScrn))
@@ -492,8 +402,10 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
pScrn->progClock = TRUE;
pScrn->rgbBits = 6;
pScrn->monitor = pScrn->confScreen->monitor; /* should be initialized before set gamma */
+#ifndef XSERVER_LIBPCIACCESS
pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
pScrn->racIoFlags = RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT;
+#endif
/*
* If the driver can do gamma correction, it should call xf86SetGamma()
@@ -624,13 +536,7 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
/* Init VGA Adapter */
if (!xf86IsPrimaryPci(pAST->PciInfo))
{
- if (xf86LoadSubModule(pScrn, "int10")) {
- xf86Int10InfoPtr pInt10;
- xf86LoaderReqSymLists(int10Symbols, NULL);
- xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n");
- pInt10 = xf86InitInt10(pAST->pEnt->index);
- xf86FreeInt10(pInt10);
- }
+ InitVGA(pScrn);
}
vASTOpenKey(pScrn);
@@ -642,10 +548,8 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
else
pAST->jChipType = AST2000;
- if (!xf86IsPrimaryPci(pAST->PciInfo))
- {
- vInitDRAMReg (pScrn);
- }
+ /* Get DRAM Info */
+ GetDRAMInfo(pScrn);
/* Map Framebuffer */
pScrn->videoRam = GetVRAMInfo(pScrn) / 1024;
@@ -731,7 +635,6 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
ASTFreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymLists(xaaSymbols, NULL);
pAST->noAccel = FALSE;
@@ -765,7 +668,6 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
ASTFreeRec(pScrn);
return FALSE;
}
- xf86LoaderReqSymLists(ramdacSymbols, NULL);
pAST->noHWC = FALSE;
pAST->HWCInfo.HWC_NUM = DEFAULT_HWC_NUM;
@@ -776,9 +678,11 @@ ASTPreInit(ScrnInfoPtr pScrn, int flags)
}
#endif
+#ifndef XSERVER_LIBPCIACCESS
/* We won't be using the VGA access after the probe */
xf86SetOperatingState(resVgaIo, pAST->pEnt->index, ResUnusedOpr);
xf86SetOperatingState(resVgaMem, pAST->pEnt->index, ResDisableOpr);
+#endif
return TRUE;
}
@@ -977,6 +881,13 @@ ASTEnterVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ /* Fixed suspend can't resume issue */
+ if (!bIsVGAEnabled(pScrn))
+ {
+ InitVGA(pScrn);
+ ASTRestore(pScrn);
+ }
+
if (!ASTModeInit(pScrn, pScrn->currentMode))
return FALSE;
ASTAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
@@ -1113,7 +1024,17 @@ ASTFreeRec(ScrnInfoPtr pScrn)
static Bool
ASTSaveScreen(ScreenPtr pScreen, Bool unblack)
{
- return vgaHWSaveScreen(pScreen, unblack);
+ /* replacement of vgaHWBlankScreen(pScrn, unblank) without seq reset */
+ /* return vgaHWSaveScreen(pScreen, unblack); */
+ ScrnInfoPtr pScrn = NULL;
+
+ if (pScreen != NULL)
+ pScrn = xf86Screens[pScreen->myNum];
+
+ if ((pScrn != NULL) && pScrn->vtSema) {
+ ASTBlankScreen(pScrn, unblack);
+ }
+ return (TRUE);
}
static Bool
@@ -1261,7 +1182,6 @@ ASTDoDDC(ScrnInfoPtr pScrn, int index)
}
if (xf86LoadSubModule(pScrn, "vbe") && (pVbe = VBEInit(NULL, index))) {
- xf86LoaderReqSymLists(vbeSymbols, NULL);
MonInfo1 = vbeDoEDID(pVbe, NULL);
MonInfo = MonInfo1;
diff --git a/driver/xf86-video-ast/src/ast_mode.c b/driver/xf86-video-ast/src/ast_mode.c
index 60cd1fd0c..b4ca02f86 100644
--- a/driver/xf86-video-ast/src/ast_mode.c
+++ b/driver/xf86-video-ast/src/ast_mode.c
@@ -25,8 +25,6 @@
#endif
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Resources.h"
-#include "xf86RAC.h"
#include "xf86cmap.h"
#include "compiler.h"
#include "mibstore.h"
diff --git a/driver/xf86-video-ast/src/ast_tool.c b/driver/xf86-video-ast/src/ast_tool.c
index 157a8692f..1dd87f0bf 100644
--- a/driver/xf86-video-ast/src/ast_tool.c
+++ b/driver/xf86-video-ast/src/ast_tool.c
@@ -25,8 +25,6 @@
#endif
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Resources.h"
-#include "xf86RAC.h"
#include "xf86cmap.h"
#include "compiler.h"
#include "mibstore.h"
diff --git a/driver/xf86-video-ast/src/ast_vgatool.c b/driver/xf86-video-ast/src/ast_vgatool.c
index 9990cdad9..c4975f43b 100644
--- a/driver/xf86-video-ast/src/ast_vgatool.c
+++ b/driver/xf86-video-ast/src/ast_vgatool.c
@@ -25,8 +25,6 @@
#endif
#include "xf86.h"
#include "xf86_OSproc.h"
-#include "xf86Resources.h"
-#include "xf86RAC.h"
#include "xf86cmap.h"
#include "compiler.h"
#include "mibstore.h"
@@ -59,16 +57,20 @@
/* Prototype type declaration*/
void vASTOpenKey(ScrnInfoPtr pScrn);
Bool bASTRegInit(ScrnInfoPtr pScrn);
+void GetDRAMInfo(ScrnInfoPtr pScrn);
ULONG GetVRAMInfo(ScrnInfoPtr pScrn);
ULONG GetMaxDCLK(ScrnInfoPtr pScrn);
void GetChipType(ScrnInfoPtr pScrn);
void vAST1000DisplayOn(ASTRecPtr pAST);
void vAST1000DisplayOff(ASTRecPtr pAST);
+void ASTBlankScreen(ScrnInfoPtr pScrn, Bool unblack);
void vSetStartAddressCRT1(ASTRecPtr pAST, ULONG base);
void vASTLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual);
void ASTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags);
Bool GetVGA2EDID(ScrnInfoPtr pScrn, unsigned char *pEDIDBuffer);
void vInitDRAMReg(ScrnInfoPtr pScrn);
+Bool bIsVGAEnabled(ScrnInfoPtr pScrn);
+Bool InitVGA(ScrnInfoPtr pScrn);
void
vASTOpenKey(ScrnInfoPtr pScrn)
@@ -91,6 +93,46 @@ bASTRegInit(ScrnInfoPtr pScrn)
}
+void
+GetDRAMInfo(ScrnInfoPtr pScrn)
+{
+ ASTRecPtr pAST = ASTPTR(pScrn);
+ ULONG ulData;
+
+ if ( (pAST->jChipType != AST2000) )
+ {
+ *(ULONG *) (pAST->MMIOVirtualAddr + 0xF004) = 0x1e6e0000;
+ *(ULONG *) (pAST->MMIOVirtualAddr + 0xF000) = 0x1;
+
+ *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000) = 0xFC600309;
+ do {
+ ;
+ } while (*(volatile ULONG *) (pAST->MMIOVirtualAddr + 0x10000) != 0x01);
+
+ ulData = *(volatile ULONG *) (pAST->MMIOVirtualAddr + 0x10004);
+
+ switch (ulData & 0x0C)
+ {
+ case 0x00:
+ case 0x04:
+ pAST->jDRAMType = DRAMTYPE_512Mx16;
+ break;
+
+ case 0x08:
+ if (ulData & 0x40) /* 16bits */
+ pAST->jDRAMType = DRAMTYPE_1Gx16;
+ else /* 32bits */
+ pAST->jDRAMType = DRAMTYPE_512Mx32;
+ break;
+
+ case 0x0C:
+ pAST->jDRAMType = DRAMTYPE_1Gx32;
+ break;
+ }
+ }
+
+} /* GetDRAMInfo */
+
ULONG
GetVRAMInfo(ScrnInfoPtr pScrn)
{
@@ -275,6 +317,17 @@ vAST1000DisplayOn(ASTRecPtr pAST)
}
+void ASTBlankScreen(ScrnInfoPtr pScrn, Bool unblack)
+{
+ ASTRecPtr pAST;
+
+ pAST = ASTPTR(pScrn);
+
+ if (unblack)
+ vAST1000DisplayOn(pAST);
+ else
+ vAST1000DisplayOff(pAST);
+}
void
vASTLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors,
@@ -474,6 +527,69 @@ GetVGA2EDID(ScrnInfoPtr pScrn, unsigned char *pEDIDBuffer)
} /* GetVGA2EDID */
+/* Init VGA */
+Bool bIsVGAEnabled(ScrnInfoPtr pScrn)
+{
+ ASTRecPtr pAST;
+ UCHAR ch;
+
+ pAST = ASTPTR(pScrn);
+
+ ch = GetReg(pAST->RelocateIO+0x43);
+
+ return (ch & 0x01);
+}
+
+void vEnableVGA(ScrnInfoPtr pScrn)
+{
+ ASTRecPtr pAST;
+
+ pAST = ASTPTR(pScrn);
+
+ SetReg(pAST->RelocateIO+0x43, 0x01);
+ SetReg(pAST->RelocateIO+0x42, 0x01);
+
+}
+
+UCHAR ExtRegInfo[] = {
+ 0x0F,
+ 0x07,
+ 0x1C,
+ 0xFF
+};
+
+void vSetDefExtReg(ScrnInfoPtr pScrn)
+{
+ ASTRecPtr pAST;
+ UCHAR i, jIndex, *pjExtRegInfo;
+
+ pAST = ASTPTR(pScrn);
+
+ /* Reset Scratch */
+ for (i=0x81; i<=0x8F; i++)
+ {
+ SetIndexReg(CRTC_PORT, i, 0x00);
+ }
+
+ /* Set Ext. Reg */
+ pjExtRegInfo = ExtRegInfo;
+ jIndex = 0xA0;
+ while (*(UCHAR *) (pjExtRegInfo) != 0xFF)
+ {
+ SetIndexRegMask(CRTC_PORT,jIndex, 0x00, *(UCHAR *) (pjExtRegInfo));
+ jIndex++;
+ pjExtRegInfo++;
+ }
+
+ /* Set Ext. Default */
+ SetIndexRegMask(CRTC_PORT,0x8C, 0x00, 0x01);
+ SetIndexRegMask(CRTC_PORT,0xB7, 0x00, 0x00);
+
+ /* Enable RAMDAC for A1, ycchen@113005 */
+ SetIndexRegMask(CRTC_PORT,0xB6, 0xFF, 0x04);
+
+}
+
typedef struct _AST_DRAMStruct {
USHORT Index;
@@ -619,7 +735,7 @@ void vInitDRAMReg(ScrnInfoPtr pScrn)
{
AST_DRAMStruct *pjDRAMRegInfo;
ASTRecPtr pAST = ASTPTR(pScrn);
- ULONG i, ulTemp;
+ ULONG i, ulTemp, ulData;
UCHAR jReg;
GetIndexRegMask(CRTC_PORT, 0xD0, 0xFF, jReg);
@@ -640,9 +756,7 @@ void vInitDRAMReg(ScrnInfoPtr pScrn)
}
else /* AST2100/1100 */
- {
- GetChipType(pScrn);
-
+ {
if ((pAST->jChipType == AST2100) || (pAST->jChipType == AST2200))
pjDRAMRegInfo = AST2100DRAMTableData;
else
@@ -672,9 +786,17 @@ void vInitDRAMReg(ScrnInfoPtr pScrn)
}
else if ( (pjDRAMRegInfo->Index == 0x0004) && (pAST->jChipType != AST2000) )
{
+ ulData = pjDRAMRegInfo->Data;
+
+ if (pAST->jDRAMType == DRAMTYPE_1Gx16)
+ ulData = 0x00000d89;
+ else if (pAST->jDRAMType == DRAMTYPE_1Gx32)
+ ulData = 0x00000c8d;
+
ulTemp = *(ULONG *) (pAST->MMIOVirtualAddr + 0x12070);
ulTemp &= 0x0000000C;
- *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000 + pjDRAMRegInfo->Index) = (pjDRAMRegInfo->Data | ulTemp);
+ ulTemp <<= 2;
+ *(ULONG *) (pAST->MMIOVirtualAddr + 0x10000 + pjDRAMRegInfo->Index) = (ulData | ulTemp);
}
else
{
@@ -708,3 +830,29 @@ void vInitDRAMReg(ScrnInfoPtr pScrn)
} while ((jReg & 0x40) == 0);
} /* vInitDRAMReg */
+
+Bool InitVGA(ScrnInfoPtr pScrn)
+{
+ ASTRecPtr pAST;
+ ULONG ulData;
+
+ pAST = ASTPTR(pScrn);
+
+ {
+ /* Enable PCI */
+ PCI_READ_LONG(pAST->PciInfo, &ulData, 0x04);
+ ulData |= 0x03;
+ PCI_WRITE_LONG(pAST->PciInfo, ulData, 0x04);
+
+ /* Enable VGA */
+ vEnableVGA(pScrn);
+
+ vASTOpenKey(pScrn);
+ vSetDefExtReg(pScrn);
+
+ vInitDRAMReg(pScrn);
+
+ }
+
+ return (TRUE);
+} /* Init VGA */
diff --git a/driver/xf86-video-ast/src/ast_vgatool.h b/driver/xf86-video-ast/src/ast_vgatool.h
index 9ce00fbf9..42c866a27 100644
--- a/driver/xf86-video-ast/src/ast_vgatool.h
+++ b/driver/xf86-video-ast/src/ast_vgatool.h
@@ -27,6 +27,11 @@
#define VIDEOMEM_SIZE_64M 0x04000000
#define VIDEOMEM_SIZE_128M 0x08000000
+#define DRAMTYPE_512Mx16 0
+#define DRAMTYPE_1Gx16 1
+#define DRAMTYPE_512Mx32 2
+#define DRAMTYPE_1Gx32 3
+
#define AR_PORT_WRITE (pAST->RelocateIO + 0x40)
#define MISC_PORT_WRITE (pAST->RelocateIO + 0x42)
#define SEQ_PORT (pAST->RelocateIO + 0x44)
@@ -44,9 +49,8 @@
val = inb(base+1); \
} while (0)
#define SetIndexReg(base,index, val) do { \
- outb(base,index); \
- outb(base+1,val); \
- } while (0)
+ outw(base, ((USHORT)(val) << 8) | index); \
+ } while (0)
#define GetIndexRegMask(base,index, and, val) do { \
outb(base,index); \
val = (inb(base+1) & and); \