diff options
Diffstat (limited to 'driver/xf86-video-r128/src')
-rw-r--r-- | driver/xf86-video-r128/src/Makefile.am | 1 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/Makefile.in | 370 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/compat-api.h | 99 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128.h | 16 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128_accel.c | 17 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128_cursor.c | 4 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128_dga.c | 20 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128_dri.c | 40 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128_driver.c | 117 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128_misc.c | 3 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128_probe.c | 4 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128_probe.h | 14 | ||||
-rw-r--r-- | driver/xf86-video-r128/src/r128_video.c | 6 |
13 files changed, 489 insertions, 222 deletions
diff --git a/driver/xf86-video-r128/src/Makefile.am b/driver/xf86-video-r128/src/Makefile.am index df7c65c4d..f8bc8d1f7 100644 --- a/driver/xf86-video-r128/src/Makefile.am +++ b/driver/xf86-video-r128/src/Makefile.am @@ -40,6 +40,7 @@ r128_drv_la_SOURCES = \ r128_video.c r128_misc.c r128_probe.c $(R128_DRI_SRCS) EXTRA_DIST = \ + compat-api.h \ r128_common.h \ r128_dri.h \ r128_dripriv.h \ diff --git a/driver/xf86-video-r128/src/Makefile.in b/driver/xf86-video-r128/src/Makefile.in index 6443f7800..bbe7facc4 100644 --- a/driver/xf86-video-r128/src/Makefile.in +++ b/driver/xf86-video-r128/src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.12.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -41,18 +41,32 @@ # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 -install_sh_PROGRAM = ${SHELL} $(install_sh) -c -install_sh_SCRIPT = ${SHELL} $(install_sh) -c +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : @@ -64,22 +78,44 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(install_sh) -d +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(r128_drv_ladir)" -r128_drv_laLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(r128_drv_la_LTLIBRARIES) r128_drv_la_LIBADD = am__r128_drv_la_SOURCES_DIST = r128_accel.c r128_cursor.c r128_dga.c \ @@ -89,27 +125,60 @@ am_r128_drv_la_OBJECTS = r128_accel.lo r128_cursor.lo r128_dga.lo \ r128_driver.lo r128_video.lo r128_misc.lo r128_probe.lo \ $(am__objects_1) r128_drv_la_OBJECTS = $(am_r128_drv_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +r128_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(r128_drv_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles +am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(r128_drv_la_SOURCES) DIST_SOURCES = $(am__r128_drv_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ @@ -135,9 +204,7 @@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ DRI_CFLAGS = @DRI_CFLAGS@ -DRI_FALSE = @DRI_FALSE@ DRI_LIBS = @DRI_LIBS@ -DRI_TRUE = @DRI_TRUE@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -149,8 +216,7 @@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ -HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@ -HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@ +INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -167,13 +233,12 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ @@ -185,6 +250,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ @@ -196,21 +262,19 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -USE_EXA_FALSE = @USE_EXA_FALSE@ -USE_EXA_TRUE = @USE_EXA_TRUE@ VERSION = @VERSION@ XEXT_CFLAGS = @XEXT_CFLAGS@ XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ -XSERVER_LIBPCIACCESS_FALSE = @XSERVER_LIBPCIACCESS_FALSE@ -XSERVER_LIBPCIACCESS_TRUE = @XSERVER_LIBPCIACCESS_TRUE@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -222,6 +286,7 @@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -250,8 +315,12 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ @DRI_TRUE@R128_DRI_SRCS = r128_dri.c AM_CFLAGS = @XORG_CFLAGS@ @DRI_CFLAGS@ r128_drv_la_LTLIBRARIES = r128_drv.la @@ -262,6 +331,7 @@ r128_drv_la_SOURCES = \ r128_video.c r128_misc.c r128_probe.c $(R128_DRI_SRCS) EXTRA_DIST = \ + compat-api.h \ r128_common.h \ r128_dri.h \ r128_dripriv.h \ @@ -280,14 +350,14 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -305,35 +375,43 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): install-r128_drv_laLTLIBRARIES: $(r128_drv_la_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(r128_drv_ladir)" || $(mkdir_p) "$(DESTDIR)$(r128_drv_ladir)" - @list='$(r128_drv_la_LTLIBRARIES)'; for p in $$list; do \ + @list='$(r128_drv_la_LTLIBRARIES)'; test -n "$(r128_drv_ladir)" || list=; \ + list2=; for p in $$list; do \ if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(r128_drv_laLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(r128_drv_ladir)/$$f'"; \ - $(LIBTOOL) --mode=install $(r128_drv_laLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(r128_drv_ladir)/$$f"; \ + list2="$$list2 $$p"; \ else :; fi; \ - done + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(r128_drv_ladir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(r128_drv_ladir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(r128_drv_ladir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(r128_drv_ladir)"; \ + } uninstall-r128_drv_laLTLIBRARIES: @$(NORMAL_UNINSTALL) - @set -x; list='$(r128_drv_la_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(r128_drv_ladir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(r128_drv_ladir)/$$p"; \ + @list='$(r128_drv_la_LTLIBRARIES)'; test -n "$(r128_drv_ladir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(r128_drv_ladir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(r128_drv_ladir)/$$f"; \ done clean-r128_drv_laLTLIBRARIES: -test -z "$(r128_drv_la_LTLIBRARIES)" || rm -f $(r128_drv_la_LTLIBRARIES) - @list='$(r128_drv_la_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -r128_drv.la: $(r128_drv_la_OBJECTS) $(r128_drv_la_DEPENDENCIES) - $(LINK) -rpath $(r128_drv_ladir) $(r128_drv_la_LDFLAGS) $(r128_drv_la_OBJECTS) $(r128_drv_la_LIBADD) $(LIBS) + @list='$(r128_drv_la_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +r128_drv.la: $(r128_drv_la_OBJECTS) $(r128_drv_la_DEPENDENCIES) $(EXTRA_r128_drv_la_DEPENDENCIES) + $(AM_V_CCLD)$(r128_drv_la_LINK) -rpath $(r128_drv_ladir) $(r128_drv_la_OBJECTS) $(r128_drv_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -351,25 +429,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r128_video.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -377,82 +455,99 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -distclean-libtool: - -rm -f libtool -uninstall-info-am: - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @@ -461,7 +556,7 @@ check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(r128_drv_ladir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -473,16 +568,22 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -496,7 +597,7 @@ distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags + distclean-tags dvi: dvi-am @@ -504,18 +605,38 @@ dvi-am: html: html-am +html-am: + info: info-am info-am: install-data-am: install-r128_drv_laLTLIBRARIES +install-dvi: install-dvi-am + +install-dvi-am: + install-exec-am: +install-html: install-html-am + +install-html-am: + install-info: install-info-am +install-info-am: + install-man: +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-am @@ -536,21 +657,26 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-r128_drv_laLTLIBRARIES +uninstall-am: uninstall-r128_drv_laLTLIBRARIES + +.MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-r128_drv_laLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-r128_drv_laLTLIBRARIES install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ + clean-libtool clean-r128_drv_laLTLIBRARIES cscopelist ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-r128_drv_laLTLIBRARIES \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-r128_drv_laLTLIBRARIES + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/driver/xf86-video-r128/src/compat-api.h b/driver/xf86-video-r128/src/compat-api.h new file mode 100644 index 000000000..6bc946fd6 --- /dev/null +++ b/driver/xf86-video-r128/src/compat-api.h @@ -0,0 +1,99 @@ +/* + * Copyright 2012 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Dave Airlie <airlied@redhat.com> + */ + +/* this file provides API compat between server post 1.13 and pre it, + it should be reused inside as many drivers as possible */ +#ifndef COMPAT_API_H +#define COMPAT_API_H + +#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR +#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum] +#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p +#endif + +#ifndef XF86_HAS_SCRN_CONV +#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum] +#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex] +#endif + +#ifndef XF86_SCRN_INTERFACE + +#define SCRN_ARG_TYPE int +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)] + +#define SCREEN_ARG_TYPE int +#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)] + +#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv + +#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask +#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask + +#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen +#define CLOSE_SCREEN_ARGS scrnIndex, pScreen + +#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags +#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0 + +#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags +#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0 + +#define FREE_SCREEN_ARGS_DECL int arg, int flags + +#define VT_FUNC_ARGS_DECL int arg, int flags +#define VT_FUNC_ARGS pScrn->scrnIndex, 0 + +#define XF86_SCRN_ARG(x) ((x)->scrnIndex) +#else +#define SCRN_ARG_TYPE ScrnInfoPtr +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1) + +#define SCREEN_ARG_TYPE ScreenPtr +#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1) + +#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv + +#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask +#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask + +#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen +#define CLOSE_SCREEN_ARGS pScreen + +#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y +#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y + +#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode +#define SWITCH_MODE_ARGS(arg, m) arg, m + +#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg + +#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg +#define VT_FUNC_ARGS pScrn + +#define XF86_SCRN_ARG(x) (x) + +#endif + +#endif diff --git a/driver/xf86-video-r128/src/r128.h b/driver/xf86-video-r128/src/r128.h index fcef00c3d..bee156288 100644 --- a/driver/xf86-video-r128/src/r128.h +++ b/driver/xf86-video-r128/src/r128.h @@ -44,7 +44,10 @@ #include "xf86Pci.h" /* XAA and Cursor Support */ +#ifdef HAVE_XAA_H #include "xaa.h" +#endif +#include "xf86fbman.h" #include "xf86Cursor.h" /* DDC support */ @@ -53,8 +56,6 @@ /* Xv support */ #include "xf86xv.h" -#include "r128_probe.h" - /* DRI support */ #ifndef XF86DRI #undef R128DRI @@ -67,8 +68,13 @@ #include "GL/glxint.h" #endif +#include "fb.h" + +#include "compat-api.h" #include "atipcirename.h" +#include "r128_probe.h" + #define R128_DEBUG 0 /* Turn off debugging output */ #define R128_IDLE_RETRY 32 /* Fall out of idle loops after this count */ #define R128_TIMEOUT 2000000 /* Fall out of wait loops after this count */ @@ -270,12 +276,14 @@ typedef struct { R128SaveRec SavedReg; /* Original (text) mode */ R128SaveRec ModeReg; /* Current mode */ - Bool (*CloseScreen)(int, ScreenPtr); - void (*BlockHandler)(int, pointer, pointer, pointer); + Bool (*CloseScreen)(CLOSE_SCREEN_ARGS_DECL); + void (*BlockHandler)(BLOCKHANDLER_ARGS_DECL); Bool PaletteSavedOnVT; /* Palette saved on last VT switch */ +#ifdef HAVE_XAA_H XAAInfoRecPtr accel; +#endif Bool accelOn; xf86CursorInfoPtr cursor; unsigned long cursor_start; diff --git a/driver/xf86-video-r128/src/r128_accel.c b/driver/xf86-video-r128/src/r128_accel.c index 056b0b309..defc07637 100644 --- a/driver/xf86-video-r128/src/r128_accel.c +++ b/driver/xf86-video-r128/src/r128_accel.c @@ -101,6 +101,7 @@ /* X and server generic header files */ #include "xf86.h" +#ifdef HAVE_XAA_H static struct { int rop; int pattern; @@ -122,6 +123,7 @@ static struct { { R128_ROP3_DSan, R128_ROP3_DPan }, /* GXnand */ { R128_ROP3_ONE, R128_ROP3_ONE } /* GXset */ }; +#endif extern int getR128EntityIndex(void); @@ -317,6 +319,7 @@ int R128CCEStop(ScrnInfoPtr pScrn) #endif +#ifdef HAVE_XAA_H /* Setup for XAA SolidFill. */ static void R128SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, unsigned int planemask) @@ -1006,6 +1009,7 @@ static void R128SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno) } } } +#endif /* Initialize the acceleration hardware. */ void R128EngineInit(ScrnInfoPtr pScrn) @@ -1098,6 +1102,8 @@ void R128EngineInit(ScrnInfoPtr pScrn) #ifdef R128DRI +#ifdef HAVE_XAA_H + /* Setup for XAA SolidFill. */ static void R128CCESetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, @@ -1540,6 +1546,7 @@ static void R128CCESubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, ADVANCE_RING(); } +#endif /* Get an indirect buffer for the CCE 2D acceleration commands. */ @@ -1634,6 +1641,7 @@ void R128CCEFlushIndirect( ScrnInfoPtr pScrn, int discard ) info->indirectStart = buffer->used; } +#ifdef HAVE_XAA_H /* Flush and release the indirect buffer. */ void R128CCEReleaseIndirect( ScrnInfoPtr pScrn ) @@ -1743,7 +1751,9 @@ static void R128CCEAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a) } #endif +#endif +#ifdef HAVE_XAA_H /* This callback is required for multihead cards using XAA */ static void R128RestoreAccelState(ScrnInfoPtr pScrn) @@ -1857,12 +1867,16 @@ static void R128MMIOAccelInit(ScrnInfoPtr pScrn, XAAInfoRecPtr a) } } +#endif /* Initialize XAA for supported acceleration and also initialize the graphics hardware for acceleration. */ Bool R128AccelInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; +#ifndef HAVE_XAA_H + return FALSE; +#else + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); XAAInfoRecPtr a; @@ -1880,4 +1894,5 @@ Bool R128AccelInit(ScreenPtr pScreen) R128EngineInit(pScrn); return XAAInit(pScreen, a); +#endif } diff --git a/driver/xf86-video-r128/src/r128_cursor.c b/driver/xf86-video-r128/src/r128_cursor.c index 83212843b..62d277dfc 100644 --- a/driver/xf86-video-r128/src/r128_cursor.c +++ b/driver/xf86-video-r128/src/r128_cursor.c @@ -241,7 +241,7 @@ static void R128ShowCursor(ScrnInfoPtr pScrn) /* Determine if hardware cursor is in use. */ static Bool R128UseHWCursor(ScreenPtr pScreen, CursorPtr pCurs) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); return info->cursor_start ? TRUE : FALSE; @@ -250,7 +250,7 @@ static Bool R128UseHWCursor(ScreenPtr pScreen, CursorPtr pCurs) /* Initialize hardware cursor support. */ Bool R128CursorInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); xf86CursorInfoPtr cursor; FBAreaPtr fbarea; diff --git a/driver/xf86-video-r128/src/r128_dga.c b/driver/xf86-video-r128/src/r128_dga.c index 1c8a8ddf8..d7fee02d0 100644 --- a/driver/xf86-video-r128/src/r128_dga.c +++ b/driver/xf86-video-r128/src/r128_dga.c @@ -29,10 +29,12 @@ static Bool R128_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, static Bool R128_SetMode(ScrnInfoPtr, DGAModePtr); static int R128_GetViewport(ScrnInfoPtr); static void R128_SetViewport(ScrnInfoPtr, int, int, int); +#ifdef HAVE_XAA_H static void R128_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); static void R128_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); static void R128_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, unsigned long); +#endif static DGAModePtr R128SetupDGAMode(ScrnInfoPtr pScrn, DGAModePtr modes, @@ -81,6 +83,7 @@ SECOND_PASS: if (pixmap) currentMode->flags |= DGA_PIXMAP_AVAILABLE; +#ifdef HAVE_XAA_H if (info->accel) { if (info->accel->SetupForSolidFill && info->accel->SubsequentSolidFillRect) @@ -93,6 +96,7 @@ SECOND_PASS: DGA_BLIT_RECT | DGA_BLIT_RECT_TRANS)) currentMode->flags &= ~DGA_CONCURRENT_ACCESS; } +#endif if (pMode->Flags & V_DBLSCAN) currentMode->flags |= DGA_DOUBLESCAN; if (pMode->Flags & V_INTERLACE) @@ -142,7 +146,7 @@ SECOND_PASS: Bool R128DGAInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); DGAModePtr modes = NULL; int num = 0; @@ -211,6 +215,7 @@ R128DGAInit(ScreenPtr pScreen) info->DGAFuncs.BlitRect = NULL; info->DGAFuncs.BlitTransRect = NULL; +#ifdef HAVE_XAA_H if (info->accel) { info->DGAFuncs.Sync = info->accel->Sync; if (info->accel->SetupForSolidFill && @@ -222,6 +227,7 @@ R128DGAInit(ScreenPtr pScreen) info->DGAFuncs.BlitTransRect = R128_BlitTransRect; } } +#endif return DGAInit(pScreen, &(info->DGAFuncs), modes, num); } @@ -243,7 +249,7 @@ R128_SetMode( pScrn->currentMode = info->CurrentLayout.mode; - pScrn->SwitchMode(indx, pScrn->currentMode, 0); + pScrn->SwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)); #ifdef R128DRI if (info->directRenderingEnabled) { R128CCE_STOP(pScrn, info); @@ -256,7 +262,7 @@ R128_SetMode( R128CCE_START(pScrn, info); } #endif - pScrn->AdjustFrame(indx, 0, 0, 0); + pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, 0, 0)); info->DGAactive = FALSE; } else { if(!info->DGAactive) { /* save the old parameters */ @@ -274,7 +280,7 @@ R128_SetMode( : pMode->depth); /* R128ModeInit() will set the mode field */ - pScrn->SwitchMode(indx, pMode->mode, 0); + pScrn->SwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode)); #ifdef R128DRI if (info->directRenderingEnabled) { @@ -313,11 +319,11 @@ R128_SetViewport( ){ R128InfoPtr info = R128PTR(pScrn); - pScrn->AdjustFrame(pScrn->pScreen->myNum, x, y, flags); + pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y)); info->DGAViewportStatus = 0; /* FIXME */ } - +#ifdef HAVE_XAA_H static void R128_FillRect ( ScrnInfoPtr pScrn, @@ -379,7 +385,7 @@ R128_BlitTransRect( if (pScrn->bitsPerPixel == info->CurrentLayout.bitsPerPixel) SET_SYNC_FLAG(info->accel); } - +#endif static Bool R128_OpenFramebuffer( diff --git a/driver/xf86-video-r128/src/r128_dri.c b/driver/xf86-video-r128/src/r128_dri.c index 624e3a544..09b3cffde 100644 --- a/driver/xf86-video-r128/src/r128_dri.c +++ b/driver/xf86-video-r128/src/r128_dri.c @@ -77,7 +77,7 @@ static void R128DRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); client. */ static Bool R128InitVisualConfigs(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); int numConfigs = 0; __GLXvisualConfig *pConfigs = NULL; @@ -279,7 +279,7 @@ static Bool R128CreateContext(ScreenPtr pScreen, VisualPtr visual, drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); info->drmCtx = hwContext; @@ -301,10 +301,11 @@ static void R128DestroyContext(ScreenPtr pScreen, drm_context_t hwContext, can start/stop the engine. */ static void R128EnterServer(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; +#ifdef HAVE_XAA_H + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); - if (info->accel) info->accel->NeedToSync = TRUE; +#endif } /* Called when the X server goes to sleep to allow the X server's @@ -315,7 +316,7 @@ static void R128EnterServer(ScreenPtr pScreen) can start/stop the engine. */ static void R128LeaveServer(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); unsigned char *R128MMIO = info->MMIO; @@ -356,11 +357,13 @@ static void R128DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx) { /* FIXME: This routine needs to have acceleration turned on */ ScreenPtr pScreen = pWin->drawable.pScreen; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); +#ifdef HAVE_XAA_H BoxPtr pbox, pboxSave; int nbox, nboxSave; int depth; +#endif /* FIXME: Use accel when CCE 2D code is written * EA: What is this code kept for? Radeon doesn't have it and @@ -369,7 +372,7 @@ static void R128DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx) */ if (info->directRenderingEnabled) return; - +#ifdef HAVE_XAA_H /* FIXME: This should be based on the __GLXvisualConfig info */ switch (pScrn->bitsPerPixel) { case 8: depth = 0x000000ff; break; @@ -413,6 +416,7 @@ static void R128DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx) pbox->y2 - pbox->y1); info->accel->NeedToSync = TRUE; +#endif } /* Copy the back and depth buffers when the X server moves a window. */ @@ -420,7 +424,7 @@ static void R128DRIMoveBuffers(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 indx) { ScreenPtr pScreen = pWin->drawable.pScreen; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); /* FIXME: This routine needs to have acceleration turned on */ @@ -905,7 +909,7 @@ static Bool R128DRIBufInit(R128InfoPtr info, ScreenPtr pScreen) static void R128DRIIrqInit(R128InfoPtr info, ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (!info->irq) { info->irq = drmGetInterruptFromBusID( @@ -969,7 +973,7 @@ static void R128DRICCEInit(ScrnInfoPtr pScrn) create the DRI data structures and initialize the DRI state. */ Bool R128DRIScreenInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); DRIInfoPtr pDRIInfo; R128DRIPtr pR128DRI; @@ -1206,7 +1210,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) initialization. */ Bool R128DRIFinishScreenInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); R128SAREAPrivPtr pSAREAPriv; R128DRIPtr pR128DRI; @@ -1291,7 +1295,7 @@ Bool R128DRIFinishScreenInit(ScreenPtr pScreen) resources used by the DRI. */ void R128DRICloseScreen(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); drmR128Init drmInfo; @@ -1386,8 +1390,10 @@ void R128DRICloseScreen(ScreenPtr pScreen) static void R128DRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { +#ifdef HAVE_XAA_H R128InfoPtr info = R128PTR(pScrn); int i; +#endif R128SAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen); /* Don't want to do this when no 3d is active and pages are @@ -1396,6 +1402,7 @@ static void R128DRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) if (!pSAREAPriv->pfAllowPageFlip && pSAREAPriv->pfCurrentPage == 0) return; +#ifdef HAVE_XAA_H (*info->accel->SetupForScreenToScreenCopy)(pScrn, 1, 1, GXcopy, (CARD32)(-1), -1); @@ -1412,11 +1419,13 @@ static void R128DRIRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) yb - ya + 1); } } +#endif } static void R128EnablePageFlip(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; +#ifdef HAVE_XAA_H + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); R128SAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen); @@ -1436,6 +1445,7 @@ static void R128EnablePageFlip(ScreenPtr pScreen) pSAREAPriv->pfAllowPageFlip = 1; } +#endif } static void R128DisablePageFlip(ScreenPtr pScreen) @@ -1462,7 +1472,7 @@ static void R128DRITransitionMultiToSingle3d(ScreenPtr pScreen) static void R128DRITransitionTo3d(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); R128EnablePageFlip(pScreen); @@ -1475,7 +1485,7 @@ static void R128DRITransitionTo3d(ScreenPtr pScreen) static void R128DRITransitionTo2d(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); R128SAREAPrivPtr pSAREAPriv = DRIGetSAREAPrivate(pScreen); diff --git a/driver/xf86-video-r128/src/r128_driver.c b/driver/xf86-video-r128/src/r128_driver.c index 0ea87c682..25defe08e 100644 --- a/driver/xf86-video-r128/src/r128_driver.c +++ b/driver/xf86-video-r128/src/r128_driver.c @@ -78,8 +78,6 @@ #include "r128_sarea.h" #endif -#include "fb.h" - /* colormap initialization */ #include "micmap.h" @@ -118,7 +116,7 @@ #define USE_CRT_ONLY 0 /* Forward definitions for driver functions */ -static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen); +static Bool R128CloseScreen(CLOSE_SCREEN_ARGS_DECL); static Bool R128SaveScreen(ScreenPtr pScreen, int mode); static void R128Save(ScrnInfoPtr pScrn); static void R128Restore(ScrnInfoPtr pScrn); @@ -1357,7 +1355,7 @@ static Bool R128GetDFPInfo(ScrnInfoPtr pScrn) OUTREG(info->DDCReg, INREG(info->DDCReg) & ~(CARD32)(R128_GPIO_MONID_A_0 | R128_GPIO_MONID_A_3)); - MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, info->pI2CBus); + MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), info->pI2CBus); if(!MonInfo) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No DFP detected\n"); @@ -2165,10 +2163,10 @@ static void R128LoadPalette(ScrnInfoPtr pScrn, int numColors, } static void -R128BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) +R128BlockHandler(BLOCKHANDLER_ARGS_DECL) { - ScreenPtr pScreen = screenInfo.screens[i]; - ScrnInfoPtr pScrn = xf86Screens[i]; + SCREEN_PTR(arg); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); #ifdef R128DRI @@ -2177,7 +2175,7 @@ R128BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) #endif pScreen->BlockHandler = info->BlockHandler; - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS); pScreen->BlockHandler = R128BlockHandler; if(info->VideoTimerCallback) { @@ -2186,10 +2184,9 @@ R128BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) } /* Called at the start of each server generation. */ -Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, - int argc, char **argv) +Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); BoxRec MemBox; int y2; @@ -2223,7 +2220,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, } R128SaveScreen(pScreen, SCREEN_SAVER_ON); - pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); /* Visual setup */ miClearVisualTypes(); @@ -2250,11 +2247,11 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int maxy = info->FbMapSize / width_bytes; if (noAccel) { - xf86DrvMsg(scrnIndex, X_WARNING, + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Acceleration disabled, not initializing the DRI\n"); info->directRenderingEnabled = FALSE; } else if (maxy <= pScrn->virtualY * 3) { - xf86DrvMsg(scrnIndex, X_WARNING, + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Static buffer allocation failed -- " "need at least %d kB video memory\n", (pScrn->displayWidth * pScrn->virtualY * @@ -2269,7 +2266,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, if(xf86IsEntityShared(pScrn->entityList[0])) { info->directRenderingEnabled = FALSE; - xf86DrvMsg(scrnIndex, X_WARNING, + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Direct Rendering Disabled -- " "Dual-head configuration is not working with DRI " "at present.\nPlease use only one Device/Screen " @@ -2403,29 +2400,29 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, MemBox.y2 = scanlines; if (!xf86InitFBManager(pScreen, &MemBox)) { - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Memory manager initialization to (%d,%d) (%d,%d) failed\n", MemBox.x1, MemBox.y1, MemBox.x2, MemBox.y2); return FALSE; } else { int width, height; - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Memory manager initialized to (%d,%d) (%d,%d)\n", MemBox.x1, MemBox.y1, MemBox.x2, MemBox.y2); if ((fbarea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, 2, 0, NULL, NULL, NULL))) { - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reserved area from (%d,%d) to (%d,%d)\n", fbarea->box.x1, fbarea->box.y1, fbarea->box.x2, fbarea->box.y2); } else { - xf86DrvMsg(scrnIndex, X_ERROR, "Unable to reserve area\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to reserve area\n"); } if (xf86QueryLargestOffscreenArea(pScreen, &width, &height, 0, 0, 0)) { - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Largest offscreen area available: %d x %d\n", width, height); } @@ -2436,7 +2433,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, pScrn->virtualX, pScrn->virtualY, 32, NULL, NULL, NULL))) { - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reserved back buffer from (%d,%d) to (%d,%d)\n", fbarea->box.x1, fbarea->box.y1, fbarea->box.x2, fbarea->box.y2); @@ -2447,7 +2444,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, fbarea->box.x1 * cpp); info->backPitch = pScrn->displayWidth; } else { - xf86DrvMsg(scrnIndex, X_ERROR, "Unable to reserve back buffer\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to reserve back buffer\n"); info->backX = -1; info->backY = -1; info->backOffset = -1; @@ -2459,7 +2456,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, pScrn->virtualX, pScrn->virtualY + 1, 32, NULL, NULL, NULL))) { - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reserved depth buffer from (%d,%d) to (%d,%d)\n", fbarea->box.x1, fbarea->box.y1, fbarea->box.x2, fbarea->box.y2); @@ -2471,11 +2468,11 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, info->depthPitch = pScrn->displayWidth; info->spanOffset = ((fbarea->box.y2 - 1) * width_bytes + fbarea->box.x1 * cpp); - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reserved depth span from (%d,%d) offset 0x%x\n", fbarea->box.x1, fbarea->box.y2 - 1, info->spanOffset); } else { - xf86DrvMsg(scrnIndex, X_ERROR, "Unable to reserve depth buffer\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to reserve depth buffer\n"); info->depthX = -1; info->depthY = -1; info->depthOffset = -1; @@ -2483,7 +2480,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, info->spanOffset = -1; } - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reserved %d kb for textures at offset 0x%x\n", info->textureSize/1024, info->textureOffset); } @@ -2503,7 +2500,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, MemBox.y2 = y2; if (!xf86InitFBManager(pScreen, &MemBox)) { - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Memory manager initialization to (%d,%d) (%d,%d) failed\n", MemBox.x1, MemBox.y1, MemBox.x2, MemBox.y2); return FALSE; @@ -2511,21 +2508,21 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int width, height; FBAreaPtr fbarea; - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Memory manager initialized to (%d,%d) (%d,%d)\n", MemBox.x1, MemBox.y1, MemBox.x2, MemBox.y2); if ((fbarea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, 2, 0, NULL, NULL, NULL))) { - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reserved area from (%d,%d) to (%d,%d)\n", fbarea->box.x1, fbarea->box.y1, fbarea->box.x2, fbarea->box.y2); } else { - xf86DrvMsg(scrnIndex, X_ERROR, "Unable to reserve area\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to reserve area\n"); } if (xf86QueryLargestOffscreenArea(pScreen, &width, &height, 0, 0, 0)) { - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Largest offscreen area available: %d x %d\n", width, height); } @@ -2535,16 +2532,16 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, /* Acceleration setup */ if (!noAccel) { if (R128AccelInit(pScreen)) { - xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration enabled\n"); info->accelOn = TRUE; } else { - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Acceleration initialization failed\n"); - xf86DrvMsg(scrnIndex, X_INFO, "Acceleration disabled\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration disabled\n"); info->accelOn = FALSE; } } else { - xf86DrvMsg(scrnIndex, X_INFO, "Acceleration disabled\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Acceleration disabled\n"); info->accelOn = FALSE; } @@ -2571,18 +2568,18 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, info->cursor_start / pScrn->displayWidth); if (xf86QueryLargestOffscreenArea(pScreen, &width, &height, 0, 0, 0)) { - xf86DrvMsg(scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Largest offscreen area available: %d x %d\n", width, height); } } else { - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor initialization failed\n"); - xf86DrvMsg(scrnIndex, X_INFO, "Using software cursor\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using software cursor\n"); } } else { info->cursor_start = 0; - xf86DrvMsg(scrnIndex, X_INFO, "Using software cursor\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using software cursor\n"); } /* Colormap setup */ @@ -4073,7 +4070,7 @@ static Bool R128ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) static Bool R128SaveScreen(ScreenPtr pScreen, int mode) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); Bool unblank; unblank = xf86IsUnblank(mode); @@ -4094,23 +4091,23 @@ static Bool R128SaveScreen(ScreenPtr pScreen, int mode) * The workaround is to switch the mode, then switch to another VT, then * switch back. --AGD */ -Bool R128SwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +Bool R128SwitchMode(SWITCH_MODE_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); R128InfoPtr info = R128PTR(pScrn); Bool ret; info->SwitchingMode = TRUE; - ret = R128ModeInit(xf86Screens[scrnIndex], mode); + ret = R128ModeInit(pScrn, mode); info->SwitchingMode = FALSE; return ret; } /* Used to disallow modes that are not supported by the hardware. */ -ModeStatus R128ValidMode(int scrnIndex, DisplayModePtr mode, +ModeStatus R128ValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); R128InfoPtr info = R128PTR(pScrn); if (info->BIOSDisplay == R128_BIOS_DISPLAY_CRT) @@ -4186,9 +4183,9 @@ ModeStatus R128ValidMode(int scrnIndex, DisplayModePtr mode, /* Adjust viewport into virtual desktop such that (0,0) in viewport space is (x,y) in virtual space. */ -void R128AdjustFrame(int scrnIndex, int x, int y, int flags) +void R128AdjustFrame(ADJUST_FRAME_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); R128InfoPtr info = R128PTR(pScrn); unsigned char *R128MMIO = info->MMIO; int Base; @@ -4222,14 +4219,14 @@ void R128AdjustFrame(int scrnIndex, int x, int y, int flags) /* Called when VT switching back to the X server. Reinitialize the video mode. */ -Bool R128EnterVT(int scrnIndex, int flags) +Bool R128EnterVT(VT_FUNC_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); R128InfoPtr info = R128PTR(pScrn); R128TRACE(("R128EnterVT\n")); if (info->FBDev) { - if (!fbdevHWEnterVT(scrnIndex,flags)) return FALSE; + if (!fbdevHWEnterVT(VT_FUNC_ARGS)) return FALSE; } else if (!R128ModeInit(pScrn, pScrn->currentMode)) return FALSE; if (info->accelOn) @@ -4248,16 +4245,16 @@ Bool R128EnterVT(int scrnIndex, int flags) #endif info->PaletteSavedOnVT = FALSE; - pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); return TRUE; } /* Called when VT switching away from the X server. Restore the original text mode. */ -void R128LeaveVT(int scrnIndex, int flags) +void R128LeaveVT(VT_FUNC_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); R128InfoPtr info = R128PTR(pScrn); R128SavePtr save = &info->ModeReg; @@ -4271,7 +4268,7 @@ void R128LeaveVT(int scrnIndex, int flags) R128SavePalette(pScrn, save); info->PaletteSavedOnVT = TRUE; if (info->FBDev) - fbdevHWLeaveVT(scrnIndex,flags); + fbdevHWLeaveVT(VT_FUNC_ARGS); else R128Restore(pScrn); } @@ -4280,9 +4277,9 @@ void R128LeaveVT(int scrnIndex, int flags) /* Called at the end of each server generation. Restore the original text mode, unmap video memory, and unwrap and call the saved CloseScreen function. */ -static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen) +static Bool R128CloseScreen(CLOSE_SCREEN_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); R128TRACE(("R128CloseScreen\n")); @@ -4300,8 +4297,10 @@ static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen) R128UnmapMem(pScrn); } +#ifdef HAVE_XAA_H if (info->accel) XAADestroyInfoRec(info->accel); info->accel = NULL; +#endif if (info->scratch_save) free(info->scratch_save); info->scratch_save = NULL; @@ -4322,12 +4321,12 @@ static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen) pScreen->BlockHandler = info->BlockHandler; pScreen->CloseScreen = info->CloseScreen; - return (*pScreen->CloseScreen)(scrnIndex, pScreen); + return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS); } -void R128FreeScreen(int scrnIndex, int flags) +void R128FreeScreen(FREE_SCREEN_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); R128InfoPtr info = R128PTR(pScrn); R128TRACE(("R128FreeScreen\n")); diff --git a/driver/xf86-video-r128/src/r128_misc.c b/driver/xf86-video-r128/src/r128_misc.c index 990563d5a..5115cc0ca 100644 --- a/driver/xf86-video-r128/src/r128_misc.c +++ b/driver/xf86-video-r128/src/r128_misc.c @@ -24,10 +24,11 @@ #include "config.h" #endif -#include "r128_probe.h" #include "r128_version.h" #include "xf86.h" +#include "r128.h" +#include "r128_probe.h" /* Module loader interface for subsidiary driver module */ diff --git a/driver/xf86-video-r128/src/r128_probe.c b/driver/xf86-video-r128/src/r128_probe.c index 0477617e6..15e4a7785 100644 --- a/driver/xf86-video-r128/src/r128_probe.c +++ b/driver/xf86-video-r128/src/r128_probe.c @@ -39,7 +39,6 @@ * Kevin E. Martin <martin@valinux.com> */ -#include "r128_probe.h" #include "r128_version.h" #include "atipcirename.h" @@ -51,6 +50,9 @@ #include "xf86Resources.h" #endif +#include "compat-api.h" +#include "r128_probe.h" + #ifndef XSERVER_LIBPCIACCESS static Bool R128Probe(DriverPtr drv, int flags); #endif diff --git a/driver/xf86-video-r128/src/r128_probe.h b/driver/xf86-video-r128/src/r128_probe.h index 59c9a0060..41fc0e474 100644 --- a/driver/xf86-video-r128/src/r128_probe.h +++ b/driver/xf86-video-r128/src/r128_probe.h @@ -60,13 +60,13 @@ extern SymTabRec R128Chipsets[]; /* r128_driver.c */ extern Bool R128PreInit(ScrnInfoPtr, int); -extern Bool R128ScreenInit(int, ScreenPtr, int, char **); -extern Bool R128SwitchMode(int, DisplayModePtr, int); -extern void R128AdjustFrame(int, int, int, int); -extern Bool R128EnterVT(int, int); -extern void R128LeaveVT(int, int); -extern void R128FreeScreen(int, int); -extern ModeStatus R128ValidMode(int, DisplayModePtr, Bool, int); +extern Bool R128ScreenInit(SCREEN_INIT_ARGS_DECL); +extern Bool R128SwitchMode(SWITCH_MODE_ARGS_DECL); +extern void R128AdjustFrame(ADJUST_FRAME_ARGS_DECL); +extern Bool R128EnterVT(VT_FUNC_ARGS_DECL); +extern void R128LeaveVT(VT_FUNC_ARGS_DECL); +extern void R128FreeScreen(FREE_SCREEN_ARGS_DECL); +extern ModeStatus R128ValidMode(SCRN_ARG_TYPE, DisplayModePtr, Bool, int); extern const OptionInfoRec * R128OptionsWeak(void); diff --git a/driver/xf86-video-r128/src/r128_video.c b/driver/xf86-video-r128/src/r128_video.c index 11bb9bdc4..81b2ab68e 100644 --- a/driver/xf86-video-r128/src/r128_video.c +++ b/driver/xf86-video-r128/src/r128_video.c @@ -80,7 +80,7 @@ static void R128ECP(ScrnInfoPtr pScrn, R128PortPrivPtr pPriv) void R128InitVideo(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr newAdaptor = NULL; int num_adaptors; @@ -216,7 +216,7 @@ R128AllocAdaptor(ScrnInfoPtr pScrn) static XF86VideoAdaptorPtr R128SetupImageVideo(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); R128InfoPtr info = R128PTR(pScrn); R128PortPrivPtr pPriv; XF86VideoAdaptorPtr adapt; @@ -583,7 +583,7 @@ R128AllocateMemory( xf86FreeOffscreenLinear(linear); } - pScreen = screenInfo.screens[pScrn->scrnIndex]; + pScreen = xf86ScrnToScreen(pScrn); new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8, NULL, NULL, NULL); |