diff options
Diffstat (limited to 'Source/DirectFB/gfxdrivers/nsc')
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/Makefile.am | 40 | ||||
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/Makefile.in | 714 | ||||
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/include/Makefile.am | 5 | ||||
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/include/Makefile.in | 403 | ||||
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/include/gfx_regs.h | 1733 | ||||
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/include/gfx_type.h | 426 | ||||
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/include/nsc_galproto.h | 1987 | ||||
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/include/pnl_defs.h | 201 | ||||
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/nsc.c | 592 | ||||
-rwxr-xr-x | Source/DirectFB/gfxdrivers/nsc/nsc_galfns.c | 4905 |
10 files changed, 11006 insertions, 0 deletions
diff --git a/Source/DirectFB/gfxdrivers/nsc/Makefile.am b/Source/DirectFB/gfxdrivers/nsc/Makefile.am new file mode 100755 index 0000000..95b0d7d --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/Makefile.am @@ -0,0 +1,40 @@ +## Makefile.am for DirectFB/gfxdrivers/nsc + +SUBDIRS = include + +INCLUDES = \ + -I/usr/src/linux/drivers/video/nsc \ + -I/usr/src/linux/drivers/video/nsc/gfx \ + -I/usr/src/linux/drivers/video/nsc/panel \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/systems \ + -I$(top_srcdir)/gfxdrivers/nsc/include + +nsc_LTLIBRARIES = libdirectfb_nsc.la + +if BUILD_STATIC +nsc_DATA = $(nsc_LTLIBRARIES:.la=.o) +endif + +nscdir = $(MODULEDIR)/gfxdrivers + +libdirectfb_nsc_la_SOURCES = \ + nsc.c \ + nsc_galfns.c + +libdirectfb_nsc_la_LDFLAGS = \ + -module \ + -avoid-version \ + $(DFB_LDFLAGS) + +libdirectfb_nsc_la_LIBADD = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la + + +include $(top_srcdir)/rules/libobject.make + diff --git a/Source/DirectFB/gfxdrivers/nsc/Makefile.in b/Source/DirectFB/gfxdrivers/nsc/Makefile.in new file mode 100755 index 0000000..c4ab622 --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/Makefile.in @@ -0,0 +1,714 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/rules/libobject.make +subdir = gfxdrivers/nsc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_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__installdirs = "$(DESTDIR)$(nscdir)" "$(DESTDIR)$(nscdir)" +nscLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(nsc_LTLIBRARIES) +libdirectfb_nsc_la_DEPENDENCIES = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la +am_libdirectfb_nsc_la_OBJECTS = nsc.lo nsc_galfns.lo +libdirectfb_nsc_la_OBJECTS = $(am_libdirectfb_nsc_la_OBJECTS) +libdirectfb_nsc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdirectfb_nsc_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libdirectfb_nsc_la_SOURCES) +DIST_SOURCES = $(libdirectfb_nsc_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +nscDATA_INSTALL = $(INSTALL_DATA) +DATA = $(nsc_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +ASFLAGS = @ASFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIR = @DATADIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ +DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ +DFB_LDFLAGS = @DFB_LDFLAGS@ +DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ +DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ +DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ +DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ +DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ +DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ +DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ +DIRECTFB_VERSION = @DIRECTFB_VERSION@ +DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ +DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ +DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ +DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ +DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ +DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ +DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ +DSYMUTIL = @DSYMUTIL@ +DYNLIB = @DYNLIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ +FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ +FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ +FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ +GIF_PROVIDER = @GIF_PROVIDER@ +GREP = @GREP@ +HAVE_LINUX = @HAVE_LINUX@ +INCLUDEDIR = @INCLUDEDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ +JPEG_PROVIDER = @JPEG_PROVIDER@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBJPEG = @LIBJPEG@ +LIBOBJS = @LIBOBJS@ +LIBPNG = @LIBPNG@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_BINARY = @LT_BINARY@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MAN2HTML = @MAN2HTML@ +MKDIR_P = @MKDIR_P@ +MODULEDIR = @MODULEDIR@ +MODULEDIRNAME = @MODULEDIRNAME@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +OSX_LIBS = @OSX_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PNG_PROVIDER = @PNG_PROVIDER@ +RANLIB = @RANLIB@ +RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOPATH = @SOPATH@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +SYSFS_LIBS = @SYSFS_LIBS@ +THREADFLAGS = @THREADFLAGS@ +THREADLIB = @THREADLIB@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +VERSION = @VERSION@ +VNC_CFLAGS = @VNC_CFLAGS@ +VNC_CONFIG = @VNC_CONFIG@ +VNC_LIBS = @VNC_LIBS@ +X11_CFLAGS = @X11_CFLAGS@ +X11_LIBS = @X11_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = include +INCLUDES = \ + -I/usr/src/linux/drivers/video/nsc \ + -I/usr/src/linux/drivers/video/nsc/gfx \ + -I/usr/src/linux/drivers/video/nsc/panel \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/systems \ + -I$(top_srcdir)/gfxdrivers/nsc/include + +nsc_LTLIBRARIES = libdirectfb_nsc.la +@BUILD_STATIC_TRUE@nsc_DATA = $(nsc_LTLIBRARIES:.la=.o) +nscdir = $(MODULEDIR)/gfxdrivers +libdirectfb_nsc_la_SOURCES = \ + nsc.c \ + nsc_galfns.c + +libdirectfb_nsc_la_LDFLAGS = \ + -module \ + -avoid-version \ + $(DFB_LDFLAGS) + +libdirectfb_nsc_la_LIBADD = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la + +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/nsc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu gfxdrivers/nsc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(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 +install-nscLTLIBRARIES: $(nsc_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(nscdir)" || $(MKDIR_P) "$(DESTDIR)$(nscdir)" + @list='$(nsc_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(nscLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(nscdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(nscLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(nscdir)/$$f"; \ + else :; fi; \ + done + +uninstall-nscLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(nsc_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(nscdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(nscdir)/$$p"; \ + done + +clean-nscLTLIBRARIES: + -test -z "$(nsc_LTLIBRARIES)" || rm -f $(nsc_LTLIBRARIES) + @list='$(nsc_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 +libdirectfb_nsc.la: $(libdirectfb_nsc_la_OBJECTS) $(libdirectfb_nsc_la_DEPENDENCIES) + $(libdirectfb_nsc_la_LINK) -rpath $(nscdir) $(libdirectfb_nsc_la_OBJECTS) $(libdirectfb_nsc_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsc_galfns.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-nscDATA: $(nsc_DATA) + @$(NORMAL_INSTALL) + test -z "$(nscdir)" || $(MKDIR_P) "$(DESTDIR)$(nscdir)" + @list='$(nsc_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(nscDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(nscdir)/$$f'"; \ + $(nscDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(nscdir)/$$f"; \ + done + +uninstall-nscDATA: + @$(NORMAL_UNINSTALL) + @list='$(nsc_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(nscdir)/$$f'"; \ + rm -f "$(DESTDIR)$(nscdir)/$$f"; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +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; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + 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; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +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)'; \ + 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; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(nscdir)" "$(DESTDIR)$(nscdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +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 +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-nscLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-nscDATA install-nscLTLIBRARIES + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-nscDATA uninstall-nscLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-nscLTLIBRARIES ctags ctags-recursive 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-nscDATA install-nscLTLIBRARIES install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-nscDATA uninstall-nscLTLIBRARIES + +%.o: .libs/%.a %.la + rm -f $<.tmp/*.o + if test -d $<.tmp; then rmdir $<.tmp; fi + mkdir $<.tmp + (cd $<.tmp && $(AR) x ../../$<) + $(LD) -o $@ -r $<.tmp/*.o + rm -f $<.tmp/*.o && rmdir $<.tmp + +.PHONY: $(LTLIBRARIES:%.la=.libs/%.a) +# 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/Source/DirectFB/gfxdrivers/nsc/include/Makefile.am b/Source/DirectFB/gfxdrivers/nsc/include/Makefile.am new file mode 100755 index 0000000..dac0046 --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/include/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = \ + gfx_regs.h \ + gfx_type.h \ + nsc_galproto.h \ + pnl_defs.h diff --git a/Source/DirectFB/gfxdrivers/nsc/include/Makefile.in b/Source/DirectFB/gfxdrivers/nsc/include/Makefile.in new file mode 100755 index 0000000..b91603a --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/include/Makefile.in @@ -0,0 +1,403 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +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 = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = gfxdrivers/nsc/include +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +ASFLAGS = @ASFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIR = @DATADIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ +DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ +DFB_LDFLAGS = @DFB_LDFLAGS@ +DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ +DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ +DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ +DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ +DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ +DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ +DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ +DIRECTFB_VERSION = @DIRECTFB_VERSION@ +DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ +DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ +DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ +DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ +DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ +DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ +DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ +DSYMUTIL = @DSYMUTIL@ +DYNLIB = @DYNLIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ +FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ +FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ +FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ +GIF_PROVIDER = @GIF_PROVIDER@ +GREP = @GREP@ +HAVE_LINUX = @HAVE_LINUX@ +INCLUDEDIR = @INCLUDEDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ +JPEG_PROVIDER = @JPEG_PROVIDER@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBJPEG = @LIBJPEG@ +LIBOBJS = @LIBOBJS@ +LIBPNG = @LIBPNG@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_BINARY = @LT_BINARY@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MAN2HTML = @MAN2HTML@ +MKDIR_P = @MKDIR_P@ +MODULEDIR = @MODULEDIR@ +MODULEDIRNAME = @MODULEDIRNAME@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +OSX_LIBS = @OSX_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PNG_PROVIDER = @PNG_PROVIDER@ +RANLIB = @RANLIB@ +RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOPATH = @SOPATH@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +SYSFS_LIBS = @SYSFS_LIBS@ +THREADFLAGS = @THREADFLAGS@ +THREADLIB = @THREADLIB@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +VERSION = @VERSION@ +VNC_CFLAGS = @VNC_CFLAGS@ +VNC_CONFIG = @VNC_CONFIG@ +VNC_LIBS = @VNC_LIBS@ +X11_CFLAGS = @X11_CFLAGS@ +X11_LIBS = @X11_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ + gfx_regs.h \ + gfx_type.h \ + nsc_galproto.h \ + pnl_defs.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gfxdrivers/nsc/include/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu gfxdrivers/nsc/include/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(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 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @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; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-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 +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +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 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool 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-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + +# 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/Source/DirectFB/gfxdrivers/nsc/include/gfx_regs.h b/Source/DirectFB/gfxdrivers/nsc/include/gfx_regs.h new file mode 100755 index 0000000..059ce47 --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/include/gfx_regs.h @@ -0,0 +1,1733 @@ +/* + * $Workfile: gfx_regs.h $ + * + * This header file contains the graphics register definitions. + */ + +/* NSC_LIC_ALTERNATIVE_PREAMBLE + * + * Revision 1.0 + * + * National Semiconductor Alternative GPL-BSD License + * + * National Semiconductor Corporation licenses this software + * ("Software"): + * + * National Xfree frame buffer driver + * + * under one of the two following licenses, depending on how the + * Software is received by the Licensee. + * + * If this Software is received as part of the Linux Framebuffer or + * other GPL licensed software, then the GPL license designated + * NSC_LIC_GPL applies to this Software; in all other circumstances + * then the BSD-style license designated NSC_LIC_BSD shall apply. + * + * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ + +/* NSC_LIC_BSD + * + * National Semiconductor Corporation Open Source License for + * + * National Xfree frame buffer driver + * + * (BSD License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * * Neither the name of the National Semiconductor Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * END_NSC_LIC_BSD */ + +/* NSC_LIC_GPL + * + * National Semiconductor Corporation Gnu General Public License for + * + * National Xfree frame buffer driver + * + * (GPL License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted under the terms of the GNU General + * Public License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version + * + * In addition to the terms of the GNU General Public License, neither + * the name of the National Semiconductor Corporation nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. See the GNU General Public License for more details. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * You should have received a copy of the GNU General Public License + * along with this file; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * END_NSC_LIC_GPL */ + + +/*----------------------------------*/ +/* FIRST GENERATION GRAPHICS UNIT */ +/*----------------------------------*/ + +#define GP_DST_XCOOR 0x8100 /* x destination origin */ +#define GP_DST_YCOOR 0x8102 /* y destination origin */ +#define GP_WIDTH 0x8104 /* pixel width */ +#define GP_HEIGHT 0x8106 /* pixel height */ +#define GP_SRC_XCOOR 0x8108 /* x source origin */ +#define GP_SRC_YCOOR 0x810A /* y source origin */ + +#define GP_VECTOR_LENGTH 0x8104 /* vector length */ +#define GP_INIT_ERROR 0x8106 /* vector initial error */ +#define GP_AXIAL_ERROR 0x8108 /* axial error increment */ +#define GP_DIAG_ERROR 0x810A /* diagonal error increment */ + +#define GP_SRC_COLOR_0 0x810C /* source color 0 */ +#define GP_SRC_COLOR_1 0x810E /* source color 1 */ +#define GP_PAT_COLOR_0 0x8110 /* pattern color 0 */ +#define GP_PAT_COLOR_1 0x8112 /* pattern color 1 */ +#define GP_PAT_COLOR_2 0x8114 /* pattern color 2 */ +#define GP_PAT_COLOR_3 0x8116 /* pattern color 3 */ +#define GP_PAT_DATA_0 0x8120 /* bits 31:0 of pattern */ +#define GP_PAT_DATA_1 0x8124 /* bits 63:32 of pattern */ +#define GP_PAT_DATA_2 0x8128 /* bits 95:64 of pattern */ +#define GP_PAT_DATA_3 0x812C /* bits 127:96 of pattern */ + +#define GP_VGA_WRITE 0x8140 /* VGA write path control */ +#define GP_VGA_READ 0x8144 /* VGA read path control */ + +#define GP_RASTER_MODE 0x8200 /* raster operation */ +#define GP_VECTOR_MODE 0x8204 /* vector mode register */ +#define GP_BLIT_MODE 0x8208 /* blit mode register */ +#define GP_BLIT_STATUS 0x820C /* blit status register */ + +#define GP_VGA_BASE 0x8210 /* VGA memory offset (x64K) */ +#define GP_VGA_LATCH 0x8214 /* VGA display latch */ + +/* "GP_VECTOR_MODE" BIT DEFINITIONS */ + +#define VM_X_MAJOR 0x0000 /* X major vector */ +#define VM_Y_MAJOR 0x0001 /* Y major vector */ +#define VM_MAJOR_INC 0x0002 /* positive major axis step */ +#define VM_MINOR_INC 0x0004 /* positive minor axis step */ +#define VM_READ_DST_FB 0x0008 /* read destination data */ + +/* "GP_RASTER_MODE" BIT DEFINITIONS */ + +#define RM_PAT_DISABLE 0x0000 /* pattern is disabled */ +#define RM_PAT_MONO 0x0100 /* 1BPP pattern expansion */ +#define RM_PAT_DITHER 0x0200 /* 2BPP pattern expansion */ +#define RM_PAT_COLOR 0x0300 /* 8BPP or 16BPP pattern */ +#define RM_PAT_MASK 0x0300 /* mask for pattern mode */ +#define RM_PAT_TRANSPARENT 0x0400 /* transparent 1BPP pattern */ +#define RM_SRC_TRANSPARENT 0x0800 /* transparent 1BPP source */ + +/* "GP_BLIT_STATUS" BIT DEFINITIONS */ + +#define BS_BLIT_BUSY 0x0001 /* blit engine is busy */ +#define BS_PIPELINE_BUSY 0x0002 /* graphics pipeline is busy*/ +#define BS_BLIT_PENDING 0x0004 /* blit pending */ +#define BC_FLUSH 0x0080 /* flush pipeline requests */ +#define BC_8BPP 0x0000 /* 8BPP mode */ +#define BC_16BPP 0x0100 /* 16BPP mode */ +#define BC_FB_WIDTH_1024 0x0000 /* framebuffer width = 1024 */ +#define BC_FB_WIDTH_2048 0x0200 /* framebuffer width = 2048 */ +#define BC_FB_WIDTH_4096 0x0400 /* framebuffer width = 4096 */ + +/* "GP_BLIT_MODE" BIT DEFINITIONS */ + +#define BM_READ_SRC_NONE 0x0000 /* source foreground color */ +#define BM_READ_SRC_FB 0x0001 /* read source from FB */ +#define BM_READ_SRC_BB0 0x0002 /* read source from BB0 */ +#define BM_READ_SRC_BB1 0x0003 /* read source from BB1 */ +#define BM_READ_SRC_MASK 0x0003 /* read source mask */ + +#define BM_READ_DST_NONE 0x0000 /* no destination data */ +#define BM_READ_DST_BB0 0x0008 /* destination from BB0 */ +#define BM_READ_DST_BB1 0x000C /* destination from BB1 */ +#define BM_READ_DST_FB0 0x0010 /* dest from FB (store BB0) */ +#define BM_READ_DST_FB1 0x0014 /* dest from FB (store BB1) */ +#define BM_READ_DST_MASK 0x001C /* read destination mask */ + +#define BM_WRITE_FB 0x0000 /* write to framebuffer */ +#define BM_WRITE_MEM 0x0020 /* write to memory */ +#define BM_WRITE_MASK 0x0020 /* write mask */ + +#define BM_SOURCE_COLOR 0x0000 /* source is 8BPP or 16BPP */ +#define BM_SOURCE_EXPAND 0x0040 /* source is 1BPP */ +#define BM_SOURCE_TEXT 0x00C0 /* source is 1BPP text */ +#define BM_SOURCE_MASK 0x00C0 /* source mask */ + +#define BM_REVERSE_Y 0x0100 /* reverse Y direction */ + +/*---------------------------------------*/ +/* FIRST GENERATION DISPLAY CONTROLLER */ +/*---------------------------------------*/ + +#define DC_UNLOCK 0x8300 /* lock register */ +#define DC_GENERAL_CFG 0x8304 /* config registers... */ +#define DC_TIMING_CFG 0x8308 +#define DC_OUTPUT_CFG 0x830C + +#define DC_FB_ST_OFFSET 0x8310 /* framebuffer start offset */ +#define DC_CB_ST_OFFSET 0x8314 /* compression start offset */ +#define DC_CURS_ST_OFFSET 0x8318 /* cursor start offset */ +#define DC_ICON_ST_OFFSET 0x831C /* icon start offset */ +#define DC_VID_ST_OFFSET 0x8320 /* video start offset */ +#define DC_LINE_DELTA 0x8324 /* fb and cb skip counts */ +#define DC_BUF_SIZE 0x8328 /* fb and cb line size */ + +#define DC_H_TIMING_1 0x8330 /* horizontal timing... */ +#define DC_H_TIMING_2 0x8334 +#define DC_H_TIMING_3 0x8338 +#define DC_FP_H_TIMING 0x833C + +#define DC_V_TIMING_1 0x8340 /* vertical timing... */ +#define DC_V_TIMING_2 0x8344 +#define DC_V_TIMING_3 0x8348 +#define DC_FP_V_TIMING 0x834C + +#define DC_CURSOR_X 0x8350 /* cursor x position */ +#define DC_ICON_X 0x8354 /* HACK - 1.3 definition */ +#define DC_V_LINE_CNT 0x8354 /* vertical line counter */ +#define DC_CURSOR_Y 0x8358 /* cursor y position */ +#define DC_ICON_Y 0x835C /* HACK - 1.3 definition */ +#define DC_SS_LINE_CMP 0x835C /* line compare value */ +#define DC_CURSOR_COLOR 0x8360 /* cursor colors */ +#define DC_ICON_COLOR 0x8364 /* icon colors */ +#define DC_BORDER_COLOR 0x8368 /* border color */ +#define DC_PAL_ADDRESS 0x8370 /* palette address */ +#define DC_PAL_DATA 0x8374 /* palette data */ +#define DC_DFIFO_DIAG 0x8378 /* display FIFO diagnostic */ +#define DC_CFIFO_DIAG 0x837C /* compression FIF0 diagnostic */ + +/* PALETTE LOCATIONS */ + +#define PAL_CURSOR_COLOR_0 0x100 +#define PAL_CURSOR_COLOR_1 0x101 +#define PAL_ICON_COLOR_0 0x102 +#define PAL_ICON_COLOR_1 0x103 +#define PAL_OVERSCAN_COLOR 0x104 + +/* UNLOCK VALUE */ + +#define DC_UNLOCK_VALUE 0x00004758 /* used to unlock DC regs */ + +/* "DC_GENERAL_CFG" BIT DEFINITIONS */ + +#define DC_GCFG_DFLE 0x00000001 /* display FIFO load enable */ +#define DC_GCFG_CURE 0x00000002 /* cursor enable */ +#define DC_GCFG_VCLK_DIV 0x00000004 /* vid clock divisor */ +#define DC_GCFG_PLNO 0x00000004 /* planar offset LSB */ +#define DC_GCFG_PPC 0x00000008 /* pixel pan compatibility */ +#define DC_GCFG_CMPE 0x00000010 /* compression enable */ +#define DC_GCFG_DECE 0x00000020 /* decompression enable */ +#define DC_GCFG_DCLK_MASK 0x000000C0 /* dotclock multiplier */ +#define DC_GCFG_DCLK_POS 6 /* dotclock multiplier */ +#define DC_GCFG_DFHPSL_MASK 0x00000F00 /* FIFO high-priority start */ +#define DC_GCFG_DFHPSL_POS 8 /* FIFO high-priority start */ +#define DC_GCFG_DFHPEL_MASK 0x0000F000 /* FIFO high-priority end */ +#define DC_GCFG_DFHPEL_POS 12 /* FIFO high-priority end */ +#define DC_GCFG_CIM_MASK 0x00030000 /* compressor insert mode */ +#define DC_GCFG_CIM_POS 16 /* compressor insert mode */ +#define DC_GCFG_FDTY 0x00040000 /* frame dirty mode */ +#define DC_GCFG_RTPM 0x00080000 /* real-time perf. monitor */ +#define DC_GCFG_DAC_RS_MASK 0x00700000 /* DAC register selects */ +#define DC_GCFG_DAC_RS_POS 20 /* DAC register selects */ +#define DC_GCFG_CKWR 0x00800000 /* clock write */ +#define DC_GCFG_LDBL 0x01000000 /* line double */ +#define DC_GCFG_DIAG 0x02000000 /* FIFO diagnostic mode */ +#define DC_GCFG_CH4S 0x04000000 /* sparse refresh mode */ +#define DC_GCFG_SSLC 0x08000000 /* enable line compare */ +#define DC_GCFG_VIDE 0x10000000 /* video enable */ +#define DC_GCFG_DFCK 0x20000000 /* divide flat-panel clock - rev 2.3 down */ +#define DC_GCFG_VRDY 0x20000000 /* video port speed - rev 2.4 up */ +#define DC_GCFG_DPCK 0x40000000 /* divide pixel clock */ +#define DC_GCFG_DDCK 0x80000000 /* divide dot clock */ + +/* "DC_TIMING_CFG" BIT DEFINITIONS */ + +#define DC_TCFG_FPPE 0x00000001 /* flat-panel power enable */ +#define DC_TCFG_HSYE 0x00000002 /* horizontal sync enable */ +#define DC_TCFG_VSYE 0x00000004 /* vertical sync enable */ +#define DC_TCFG_BLKE 0x00000008 /* blank enable */ +#define DC_TCFG_DDCK 0x00000010 /* DDC clock */ +#define DC_TCFG_TGEN 0x00000020 /* timing generator enable */ +#define DC_TCFG_VIEN 0x00000040 /* vertical interrupt enable*/ +#define DC_TCFG_BLNK 0x00000080 /* blink enable */ +#define DC_TCFG_CHSP 0x00000100 /* horizontal sync polarity */ +#define DC_TCFG_CVSP 0x00000200 /* vertical sync polarity */ +#define DC_TCFG_FHSP 0x00000400 /* panel horz sync polarity */ +#define DC_TCFG_FVSP 0x00000800 /* panel vert sync polarity */ +#define DC_TCFG_FCEN 0x00001000 /* flat-panel centering */ +#define DC_TCFG_CDCE 0x00002000 /* HACK - 1.3 definition */ +#define DC_TCFG_PLNR 0x00002000 /* planar mode enable */ +#define DC_TCFG_INTL 0x00004000 /* interlace scan */ +#define DC_TCFG_PXDB 0x00008000 /* pixel double */ +#define DC_TCFG_BKRT 0x00010000 /* blink rate */ +#define DC_TCFG_PSD_MASK 0x000E0000 /* power sequence delay */ +#define DC_TCFG_PSD_POS 17 /* power sequence delay */ +#define DC_TCFG_DDCI 0x08000000 /* DDC input (RO) */ +#define DC_TCFG_SENS 0x10000000 /* monitor sense (RO) */ +#define DC_TCFG_DNA 0x20000000 /* display not active (RO) */ +#define DC_TCFG_VNA 0x40000000 /* vertical not active (RO) */ +#define DC_TCFG_VINT 0x80000000 /* vertical interrupt (RO) */ + +/* "DC_OUTPUT_CFG" BIT DEFINITIONS */ + +#define DC_OCFG_8BPP 0x00000001 /* 8/16 bpp select */ +#define DC_OCFG_555 0x00000002 /* 16 bpp format */ +#define DC_OCFG_PCKE 0x00000004 /* PCLK enable */ +#define DC_OCFG_FRME 0x00000008 /* frame rate mod enable */ +#define DC_OCFG_DITE 0x00000010 /* dither enable */ +#define DC_OCFG_2PXE 0x00000020 /* 2 pixel enable */ +#define DC_OCFG_2XCK 0x00000040 /* 2 x pixel clock */ +#define DC_OCFG_2IND 0x00000080 /* 2 index enable */ +#define DC_OCFG_34ADD 0x00000100 /* 3- or 4-bit add */ +#define DC_OCFG_FRMS 0x00000200 /* frame rate mod select */ +#define DC_OCFG_CKSL 0x00000400 /* clock select */ +#define DC_OCFG_PRMP 0x00000800 /* palette re-map */ +#define DC_OCFG_PDEL 0x00001000 /* panel data enable low */ +#define DC_OCFG_PDEH 0x00002000 /* panel data enable high */ +#define DC_OCFG_CFRW 0x00004000 /* comp line buffer r/w sel */ +#define DC_OCFG_DIAG 0x00008000 /* comp line buffer diag */ + +#define MC_MEM_CNTRL1 0x00008400 +#define MC_DR_ADD 0x00008418 +#define MC_DR_ACC 0x0000841C + +/* MC_MEM_CNTRL1 BIT DEFINITIONS */ + +#define MC_XBUSARB 0x00000008 /* 0 = GP priority < CPU priority */ + /* 1 = GP priority = CPU priority */ + /* GXm databook V2.0 is wrong ! */ +/*----------*/ +/* CS5530 */ +/*----------*/ + +/* CS5530 REGISTER DEFINITIONS */ + +#define CS5530_VIDEO_CONFIG 0x0000 +#define CS5530_DISPLAY_CONFIG 0x0004 +#define CS5530_VIDEO_X_POS 0x0008 +#define CS5530_VIDEO_Y_POS 0x000C +#define CS5530_VIDEO_SCALE 0x0010 +#define CS5530_VIDEO_COLOR_KEY 0x0014 +#define CS5530_VIDEO_COLOR_MASK 0x0018 +#define CS5530_PALETTE_ADDRESS 0x001C +#define CS5530_PALETTE_DATA 0x0020 +#define CS5530_DOT_CLK_CONFIG 0x0024 +#define CS5530_CRCSIG_TFT_TV 0x0028 + +/* "CS5530_VIDEO_CONFIG" BIT DEFINITIONS */ + +#define CS5530_VCFG_VID_EN 0x00000001 +#define CS5530_VCFG_VID_REG_UPDATE 0x00000002 +#define CS5530_VCFG_VID_INP_FORMAT 0x0000000C +#define CS5530_VCFG_8_BIT_4_2_0 0x00000004 +#define CS5530_VCFG_16_BIT_4_2_0 0x00000008 +#define CS5530_VCFG_GV_SEL 0x00000010 +#define CS5530_VCFG_CSC_BYPASS 0x00000020 +#define CS5530_VCFG_X_FILTER_EN 0x00000040 +#define CS5530_VCFG_Y_FILTER_EN 0x00000080 +#define CS5530_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 +#define CS5530_VCFG_INIT_READ_MASK 0x01FF0000 +#define CS5530_VCFG_EARLY_VID_RDY 0x02000000 +#define CS5530_VCFG_LINE_SIZE_UPPER 0x08000000 +#define CS5530_VCFG_4_2_0_MODE 0x10000000 +#define CS5530_VCFG_16_BIT_EN 0x20000000 +#define CS5530_VCFG_HIGH_SPD_INT 0x40000000 + +/* "CS5530_DISPLAY_CONFIG" BIT DEFINITIONS */ + +#define CS5530_DCFG_DIS_EN 0x00000001 +#define CS5530_DCFG_HSYNC_EN 0x00000002 +#define CS5530_DCFG_VSYNC_EN 0x00000004 +#define CS5530_DCFG_DAC_BL_EN 0x00000008 +#define CS5530_DCFG_DAC_PWDNX 0x00000020 +#define CS5530_DCFG_FP_PWR_EN 0x00000040 +#define CS5530_DCFG_FP_DATA_EN 0x00000080 +#define CS5530_DCFG_CRT_HSYNC_POL 0x00000100 +#define CS5530_DCFG_CRT_VSYNC_POL 0x00000200 +#define CS5530_DCFG_FP_HSYNC_POL 0x00000400 +#define CS5530_DCFG_FP_VSYNC_POL 0x00000800 +#define CS5530_DCFG_XGA_FP 0x00001000 +#define CS5530_DCFG_FP_DITH_EN 0x00002000 +#define CS5530_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 +#define CS5530_DCFG_CRT_SYNC_SKW_INIT 0x00010000 +#define CS5530_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 +#define CS5530_DCFG_PWR_SEQ_DLY_INIT 0x00080000 +#define CS5530_DCFG_VG_CK 0x00100000 +#define CS5530_DCFG_GV_PAL_BYP 0x00200000 +#define CS5530_DCFG_DDC_SCL 0x00400000 +#define CS5530_DCFG_DDC_SDA 0x00800000 +#define CS5530_DCFG_DDC_OE 0x01000000 +#define CS5530_DCFG_16_BIT_EN 0x02000000 + + +/*----------*/ +/* SC1200 */ +/*----------*/ + +/* SC1200 VIDEO REGISTER DEFINITIONS */ + +#define SC1200_VIDEO_CONFIG 0x000 +#define SC1200_DISPLAY_CONFIG 0x004 +#define SC1200_VIDEO_X_POS 0x008 +#define SC1200_VIDEO_Y_POS 0x00C +#define SC1200_VIDEO_UPSCALE 0x010 +#define SC1200_VIDEO_COLOR_KEY 0x014 +#define SC1200_VIDEO_COLOR_MASK 0x018 +#define SC1200_PALETTE_ADDRESS 0x01C +#define SC1200_PALETTE_DATA 0x020 +#define SC1200_VID_MISC 0x028 +#define SC1200_VID_CLOCK_SELECT 0x02C +#define SC1200_VIDEO_DOWNSCALER_CONTROL 0x03C +#define SC1200_VIDEO_DOWNSCALER_COEFFICIENTS 0x40 +#define SC1200_VID_CRC 0x044 +#define SC1200_DEVICE_ID 0x048 +#define SC1200_VID_ALPHA_CONTROL 0x04C +#define SC1200_CURSOR_COLOR_KEY 0x050 +#define SC1200_CURSOR_COLOR_MASK 0x054 +#define SC1200_CURSOR_COLOR_1 0x058 +#define SC1200_CURSOR_COLOR_2 0x05C +#define SC1200_ALPHA_XPOS_1 0x060 +#define SC1200_ALPHA_YPOS_1 0x064 +#define SC1200_ALPHA_COLOR_1 0x068 +#define SC1200_ALPHA_CONTROL_1 0x06C +#define SC1200_ALPHA_XPOS_2 0x070 +#define SC1200_ALPHA_YPOS_2 0x074 +#define SC1200_ALPHA_COLOR_2 0x078 +#define SC1200_ALPHA_CONTROL_2 0x07C +#define SC1200_ALPHA_XPOS_3 0x080 +#define SC1200_ALPHA_YPOS_3 0x084 +#define SC1200_ALPHA_COLOR_3 0x088 +#define SC1200_ALPHA_CONTROL_3 0x08C +#define SC1200_VIDEO_REQUEST 0x090 +#define SC1200_ALPHA_WATCH 0x094 +#define SC1200_VIDEO_DISPLAY_MODE 0x400 +#define SC1200_VIDEO_ODD_VBI_LINE_ENABLE 0x40C +#define SC1200_VIDEO_EVEN_VBI_LINE_ENABLE 0x410 +#define SC1200_VIDEO_VBI_HORIZ_CONTROL 0x414 +#define SC1200_VIDEO_ODD_VBI_TOTAL_COUNT 0x418 +#define SC1200_VIDEO_EVEN_VBI_TOTAL_COUNT 0x41C +#define SC1200_GENLOCK 0x420 +#define SC1200_GENLOCK_DELAY 0x424 +#define SC1200_TVOUT_HORZ_TIM 0x800 +#define SC1200_TVOUT_HORZ_SYNC 0x804 +#define SC1200_TVOUT_VERT_SYNC 0x808 +#define SC1200_TVOUT_LINE_END 0x80C +#define SC1200_TVOUT_VERT_DOWNSCALE 0x810 /* REV. A & B */ +#define SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE 0x810 /* REV. C */ +#define SC1200_TVOUT_HORZ_SCALING 0x814 +#define SC1200_TVOUT_DEBUG 0x818 +#define SC1200_TVENC_TIM_CTRL_1 0xC00 +#define SC1200_TVENC_TIM_CTRL_2 0xC04 +#define SC1200_TVENC_TIM_CTRL_3 0xC08 +#define SC1200_TVENC_SUB_FREQ 0xC0C +#define SC1200_TVENC_DISP_POS 0xC10 +#define SC1200_TVENC_DISP_SIZE 0xC14 +#define SC1200_TVENC_CC_DATA 0xC18 +#define SC1200_TVENC_EDS_DATA 0xC1C +#define SC1200_TVENC_CGMS_DATA 0xC20 +#define SC1200_TVENC_WSS_DATA 0xC24 +#define SC1200_TVENC_CC_CONTROL 0xC28 +#define SC1200_TVENC_DAC_CONTROL 0xC2C +#define SC1200_TVENC_MV_CONTROL 0xC30 + +/* "SC1200_VIDEO_CONFIG" BIT DEFINITIONS */ + +#define SC1200_VCFG_VID_EN 0x00000001 +#define SC1200_VCFG_VID_INP_FORMAT 0x0000000C +#define SC1200_VCFG_UYVY_FORMAT 0x00000000 +#define SC1200_VCFG_Y2YU_FORMAT 0x00000004 +#define SC1200_VCFG_YUYV_FORMAT 0x00000008 +#define SC1200_VCFG_YVYU_FORMAT 0x0000000C +#define SC1200_VCFG_X_FILTER_EN 0x00000040 +#define SC1200_VCFG_Y_FILTER_EN 0x00000080 +#define SC1200_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 +#define SC1200_VCFG_INIT_READ_MASK 0x01FF0000 +#define SC1200_VCFG_LINE_SIZE_UPPER 0x08000000 +#define SC1200_VCFG_4_2_0_MODE 0x10000000 + +/* "SC1200_DISPLAY_CONFIG" BIT DEFINITIONS */ + +#define SC1200_DCFG_DIS_EN 0x00000001 +#define SC1200_DCFG_HSYNC_EN 0x00000002 +#define SC1200_DCFG_VSYNC_EN 0x00000004 +#define SC1200_DCFG_DAC_BL_EN 0x00000008 +#define SC1200_DCFG_FP_PWR_EN 0x00000040 +#define SC1200_DCFG_FP_DATA_EN 0x00000080 +#define SC1200_DCFG_CRT_HSYNC_POL 0x00000100 +#define SC1200_DCFG_CRT_VSYNC_POL 0x00000200 +#define SC1200_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 +#define SC1200_DCFG_CRT_SYNC_SKW_INIT 0x00010000 +#define SC1200_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 +#define SC1200_DCFG_PWR_SEQ_DLY_INIT 0x00080000 +#define SC1200_DCFG_VG_CK 0x00100000 +#define SC1200_DCFG_GV_PAL_BYP 0x00200000 +#define SC1200_DCFG_DDC_SCL 0x00400000 +#define SC1200_DCFG_DDC_SDA 0x00800000 +#define SC1200_DCFG_DDC_OE 0x01000000 + +/* "SC1200_VID_MISC" BIT DEFINITIONS */ + +#define SC1200_GAMMA_BYPASS_BOTH 0x00000001 +#define SC1200_DAC_POWER_DOWN 0x00000400 +#define SC1200_ANALOG_POWER_DOWN 0x00000800 +#define SC1200_PLL_POWER_NORMAL 0x00001000 + +/* "SC1200_VIDEO_DOWNSCALER_CONTROL" BIT DEFINITIONS */ + +#define SC1200_VIDEO_DOWNSCALE_ENABLE 0x00000001 +#define SC1200_VIDEO_DOWNSCALE_FACTOR_POS 1 +#define SC1200_VIDEO_DOWNSCALE_FACTOR_MASK 0x0000001E +#define SC1200_VIDEO_DOWNSCALE_TYPE_A 0x00000000 +#define SC1200_VIDEO_DOWNSCALE_TYPE_B 0x00000040 +#define SC1200_VIDEO_DOWNSCALE_TYPE_MASK 0x00000040 + +/* "SC1200_VIDEO_DOWNSCALER_COEFFICIENTS" BIT DEFINITIONS */ + +#define SC1200_VIDEO_DOWNSCALER_COEF1_POS 0 +#define SC1200_VIDEO_DOWNSCALER_COEF2_POS 8 +#define SC1200_VIDEO_DOWNSCALER_COEF3_POS 16 +#define SC1200_VIDEO_DOWNSCALER_COEF4_POS 24 +#define SC1200_VIDEO_DOWNSCALER_COEF_MASK 0xF + +/* VIDEO DE-INTERLACING AND ALPHA CONTROL (REGISTER 0x4C) */ + +#define SC1200_VERTICAL_SCALER_SHIFT_MASK 0x00000007 +#define SC1200_VERTICAL_SCALER_SHIFT_INIT 0x00000004 +#define SC1200_VERTICAL_SCALER_SHIFT_EN 0x00000010 +#define SC1200_TOP_LINE_IN_ODD 0x00000040 +#define SC1200_NO_CK_OUTSIDE_ALPHA 0x00000100 +#define SC1200_VIDEO_IS_INTERLACED 0x00000200 +#define SC1200_CSC_VIDEO_YUV_TO_RGB 0x00000400 +#define SC1200_CSC_GFX_RGB_TO_YUV 0x00000800 +#define SC1200_VIDEO_INPUT_IS_RGB 0x00002000 +#define SC1200_VIDEO_LINE_OFFSET_ODD 0x00001000 +#define SC1200_ALPHA1_PRIORITY_POS 16 +#define SC1200_ALPHA1_PRIORITY_MASK 0x00030000 +#define SC1200_ALPHA2_PRIORITY_POS 18 +#define SC1200_ALPHA2_PRIORITY_MASK 0x000C0000 +#define SC1200_ALPHA3_PRIORITY_POS 20 +#define SC1200_ALPHA3_PRIORITY_MASK 0x00300000 + +/* VIDEO CURSOR COLOR KEY DEFINITIONS (REGISTER 0x50) */ + +#define SC1200_CURSOR_COLOR_KEY_OFFSET_POS 24 +#define SC1200_CURSOR_COLOR_BITS 23 +#define SC1200_COLOR_MASK 0x00FFFFFF /* 24 significant bits */ + +/* ALPHA COLOR BIT DEFINITION (REGISTERS 0x68, 0x78, AND 0x88) */ + +#define SC1200_ALPHA_COLOR_ENABLE 0x01000000 + +/* ALPHA CONTROL BIT DEFINITIONS (REGISTERS 0x6C, 0x7C, AND 0x8C) */ + +#define SC1200_ACTRL_WIN_ENABLE 0x00010000 +#define SC1200_ACTRL_LOAD_ALPHA 0x00020000 + +/* VIDEO REQUEST DEFINITIONS (REGISTER 0x90) */ + +#define SC1200_VIDEO_Y_REQUEST_POS 0 +#define SC1200_VIDEO_X_REQUEST_POS 16 +#define SC1200_VIDEO_REQUEST_MASK 0x00000FFF + +/* VIDEO DISPLAY MODE (REGISTER 0x400) */ + +#define SC1200_VIDEO_SOURCE_MASK 0x00000003 +#define SC1200_VIDEO_SOURCE_GX1 0x00000000 +#define SC1200_VIDEO_SOURCE_DVIP 0x00000002 +#define SC1200_VBI_SOURCE_MASK 0x00000004 +#define SC1200_VBI_SOURCE_DVIP 0x00000000 +#define SC1200_VBI_SOURCE_GX1 0x00000004 + +/* ODD/EVEN VBI LINE ENABLE (REGISTERS 0x40C, 0x410) */ + +#define SC1200_VIDEO_VBI_LINE_ENABLE_MASK 0x00FFFFFC +#define SC1200_VIDEO_ALL_ACTIVE_IS_VBI 0x01000000 +#define SC1200_VIDEO_VBI_LINE_OFFSET_POS 25 +#define SC1200_VIDEO_VBI_LINE_OFFSET_MASK 0x3E000000 + +/* ODD/EVEN VBI TOTAL COUNT (REGISTERS 0x418, 0x41C) */ + +#define SC1200_VIDEO_VBI_TOTAL_COUNT_MASK 0x000FFFFF + +/* GENLOCK BIT DEFINITIONS */ + +#define SC1200_GENLOCK_SINGLE_ENABLE 0x00000001 +#define SC1200_GENLOCK_FIELD_SYNC_ENABLE 0x00000001 +#define SC1200_GENLOCK_CONTINUOUS_ENABLE 0x00000002 +#define SC1200_GENLOCK_GX_VSYNC_FALLING_EDGE 0x00000004 +#define SC1200_GENLOCK_VIP_VSYNC_FALLING_EDGE 0x00000008 +#define SC1200_GENLOCK_TIMEOUT_ENABLE 0x00000010 +#define SC1200_GENLOCK_TVENC_RESET_EVEN_FIELD 0x00000020 +#define SC1200_GENLOCK_TVENC_RESET_BEFORE_DELAY 0x00000040 +#define SC1200_GENLOCK_TVENC_RESET_ENABLE 0x00000080 +#define SC1200_GENLOCK_SYNC_TO_TVENC 0x00000100 +#define SC1200_GENLOCK_DELAY_MASK 0x001FFFFF + +/* TVOUT HORIZONTAL PRE ENCODER SCALE BIT DEFINITIONS */ + +#define SC1200_TVOUT_YC_DELAY_MASK 0x00C00000 +#define SC1200_TVOUT_YC_DELAY_NONE 0x00000000 +#define SC1200_TVOUT_Y_DELAY_ONE_PIXEL 0x00400000 +#define SC1200_TVOUT_C_DELAY_ONE_PIXEL 0x00800000 +#define SC1200_TVOUT_C_DELAY_TWO_PIXELS 0x00C00000 + +/* TVOUT HORIZONTAL SCALING/CONTROL BIT DEFINITIONS */ + +#define SC1200_TVOUT_FLICKER_FILTER_MASK 0x60000000 +#define SC1200_TVOUT_FLICKER_FILTER_FOURTH_HALF_FOURTH 0x00000000 +#define SC1200_TVOUT_FLICKER_FILTER_HALF_ONE_HALF 0x20000000 +#define SC1200_TVOUT_FLICKER_FILTER_DISABLED 0x40000000 +#define SC1200_TVENC_EXTERNAL_RESET_INTERVAL_MASK 0x0F000000 +#define SC1200_TVENC_EXTERNAL_RESET_EVERY_ODD_FIELD 0x00000000 +#define SC1200_TVENC_EXTERNAL_RESET_EVERY_EVEN_FIELD 0x02000000 +#define SC1200_TVENC_EXTERNAL_RESET_NEXT_ODD_FIELD 0x05000000 +#define SC1200_TVENC_EXTERNAL_RESET_NEXT_EVEN_FIELD 0x07000000 +#define SC1200_TVENC_EXTERNAL_RESET_EVERY_FIELD 0x0E000000 +#define SC1200_TVENC_EXTERNAL_RESET_EVERY_X_ODD_FIELDS 0x08000000 +#define SC1200_TVENC_EXTERNAL_RESET_EVERY_X_EVEN_FIELDS 0x0A000000 + +/* TVOUT DEBUG BIT DEFINITIONS */ + +#define SC1200_TVOUT_FIELD_STATUS_EVEN 0x00000040 +#define SC1200_TVOUT_FIELD_STATUS_TV 0x00000080 +#define SC1200_TVOUT_CRT_VSYNC_STATUS_TRAILING 0x00000100 +#define SC1200_TVOUT_FIELD_STATUS_INVERT 0x00000200 +#define SC1200_TVOUT_CONVERTER_INTERPOLATION 0x00000400 + +/* TVENC TIMING/CONTROL 1 BIT DEFINITIONS (REGISTER 0xC00) */ + +#define SC1200_TVENC_VPHASE_MASK 0x001FF800 +#define SC1200_TVENC_VPHASE_POS 11 +#define SC1200_TVENC_SUB_CARRIER_RESET_MASK 0x30000000 +#define SC1200_TVENC_SUB_CARRIER_RESET_NEVER 0x00000000 +#define SC1200_TVENC_SUB_CARRIER_RESET_EVERY_TWO_LINES 0x10000000 +#define SC1200_TVENC_SUB_CARRIER_RESET_EVERY_TWO_FRAMES 0x20000000 +#define SC1200_TVENC_SUB_CARRIER_RESET_EVERY_FOUR_FRAMES 0x30000000 +#define SC1200_TVENC_VIDEO_TIMING_ENABLE 0x80000000 + +/* TVENC TIMING/CONTROL 2 BIT DEFINITIONS (REGISTER 0xC04) */ + +#define SC1200_TVENC_OUTPUT_YCBCR 0x40000000 +#define SC1200_TVENC_CFS_MASK 0x00030000 +#define SC1200_TVENC_CFS_BYPASS 0x00000000 +#define SC1200_TVENC_CFS_CVBS 0x00020000 +#define SC1200_TVENC_CFS_SVIDEO 0x00030000 + +/* TVENC TIMING/CONTROL 3 BIT DEFINITIONS (REGISTER 0xC08) */ + +#define SC1200_TVENC_CS 0x00000001 +#define SC1200_TVENC_SYNCMODE_MASK 0x00000006 +#define SC1200_TVENC_SYNC_ON_GREEN 0x00000002 +#define SC1200_TVENC_SYNC_ON_CVBS 0x00000004 +#define SC1200_TVENC_CM 0x00000008 + +/* TVENC DAC CONTROL BIT DEFINITIONS (REGISTER 0xC2C) */ +#define SC1200_TVENC_TRIM_MASK 0x00000007 +#define SC1200_TVENC_POWER_DOWN 0x00000020 + +/* TVENC MV CONTROL BIT DEFINITIONS (REGISTER 0xC30) */ +#define SC1200_TVENC_MV_ENABLE 0xBE + +/* SC1200 VIP REGISTER DEFINITIONS */ + +#define SC1200_VIP_CONFIG 0x00000000 +#define SC1200_VIP_CONTROL 0x00000004 +#define SC1200_VIP_STATUS 0x00000008 +#define SC1200_VIP_CURRENT_LINE 0x00000010 +#define SC1200_VIP_LINE_TARGET 0x00000014 +#define SC1200_ODD_DIRECT_VBI_LINE_ENABLE 0x00000018 +#define SC1200_EVEN_DIRECT_VBI_LINE_ENABLE 0x0000001C +#define SC1200_VIP_ODD_BASE 0x00000020 +#define SC1200_VIP_EVEN_BASE 0x00000024 +#define SC1200_VIP_PITCH 0x00000028 +#define SC1200_VBI_ODD_BASE 0x00000040 +#define SC1200_VBI_EVEN_BASE 0x00000044 +#define SC1200_VBI_PITCH 0x00000048 + +/* "SC1200_VIP_CONFIG" BIT DEFINITIONS */ + +#define SC1200_VIP_MODE_MASK 0x00000003 +#define SC1200_VIP_MODE_C 0x00000002 +#define SC1200_VBI_ANCILLARY_TO_MEMORY 0x000C0000 +#define SC1200_VBI_TASK_A_TO_MEMORY 0x00140000 +#define SC1200_VBI_TASK_B_TO_MEMORY 0x00240000 +#define SC1200_VIP_BUS_REQUEST_THRESHOLD 0x00400000 + +/* "SC1200_VIP_CONTROL" BIT DEFINITIONS */ + +#define SC1200_CAPTURE_RUN_MODE_MASK 0x00000003 +#define SC1200_CAPTURE_RUN_MODE_STOP_LINE 0x00000000 +#define SC1200_CAPTURE_RUN_MODE_STOP_FIELD 0x00000001 +#define SC1200_CAPTURE_RUN_MODE_START 0x00000003 +#define SC1200_VIP_DATA_CAPTURE_EN 0x00000100 +#define SC1200_VIP_VBI_CAPTURE_EN 0x00000200 +#define SC1200_VIP_VBI_FIELD_INTERRUPT_EN 0x00010000 + +/* "SC1200_VIP_STATUS" BIT DEFINITIONS */ + +#define SC1200_VIP_CURRENT_FIELD_ODD 0x01000000 +#define SC1200_VIP_BASE_NOT_UPDATED 0x00200000 +#define SC1200_VIP_FIFO_OVERFLOW 0x00100000 +#define SC1200_VIP_CLEAR_LINE_INT 0x00020000 +#define SC1200_VIP_CLEAR_FIELD_INT 0x00010000 +#define SC1200_VBI_DATA_CAPTURE_ACTIVE 0x00000200 +#define SC1200_VIDEO_DATA_CAPTURE_ACTIVE 0x00000100 + +/* "SC1200_VIP_CURRENT_LINE" BIT DEFINITIONS */ + +#define SC1200_VIP_CURRENT_LINE_MASK 0x000003FF + +/* "SC1200_VIP_LINE_TARGET" BIT DEFINITIONS */ + +#define SC1200_VIP_LAST_LINE_MASK 0x03FF0000 + +/* "SC1200_VIP_PITCH" BIT DEFINITION */ + +#define SC1200_VIP_PITCH_MASK 0x0000FFFC + +/* "SC1200_VBI_PITCH" BIT DEFINITION */ + +#define SC1200_VBI_PITCH_MASK 0x0000FFFC + +/* SC1200 DIRECT VBI LINE ENABLE BIT DEFINITION */ + +#define SC1200_DIRECT_VBI_LINE_ENABLE_MASK 0x00FFFFFF + +/* SC1200 CONFIGURATION BLOCK */ + +#define SC1200_CB_BASE_ADDR 0x9000 +#define SC1200_CB_WDTO 0x0000 +#define SC1200_CB_WDCNFG 0x0002 +#define SC1200_CB_WDSTS 0x0004 +#define SC1200_CB_TMVALUE 0x0008 +#define SC1200_CB_TMCNFG 0x000D +#define SC1200_CB_PMR 0x0030 +#define SC1200_CB_MCR 0x0034 +#define SC1200_CB_INTSEL 0x0038 +#define SC1200_CB_PID 0x003C +#define SC1200_CB_REV 0x003D + +/* SC1200 HIGH RESOLUTION TIMER CONFIGURATION REGISTER BITS */ + +#define SC1200_TMCLKSEL_27MHZ 0x2 + +/*---------------------------------*/ +/* PHILIPS SAA7114 VIDEO DECODER */ +/*---------------------------------*/ + +#define SAA7114_CHIPADDR 0x42 + +/* VIDEO DECODER REGISTER DEFINITIONS */ + +#define SAA7114_ANALOG_INPUT_CTRL1 0x02 +#define SAA7114_LUMINANCE_CONTROL 0x09 +#define SAA7114_BRIGHTNESS 0x0A +#define SAA7114_CONTRAST 0x0B +#define SAA7114_SATURATION 0x0C +#define SAA7114_HUE 0x0D +#define SAA7114_STATUS 0x1F +#define SAA7114_IPORT_CONTROL 0x86 + +/* TASK A REGISTER DEFINITIONS */ + +#define SAA7114_TASK_A_HORZ_OUTPUT_LO 0x9C +#define SAA7114_TASK_A_HORZ_OUTPUT_HI 0x9D +#define SAA7114_TASK_A_HSCALE_LUMA_LO 0xA8 +#define SAA7114_TASK_A_HSCALE_LUMA_HI 0xA9 +#define SAA7114_TASK_A_HSCALE_CHROMA_LO 0xAC +#define SAA7114_TASK_A_HSCALE_CHROMA_HI 0xAD + +/* TASK B REGISTER DEFINITIONS */ + +#define SAA7114_HORZ_OFFSET_LO 0xC4 +#define SAA7114_HORZ_OFFSET_HI 0xC5 +#define SAA7114_HORZ_INPUT_LO 0xC6 +#define SAA7114_HORZ_INPUT_HI 0xC7 +#define SAA7114_VERT_OFFSET_LO 0xC8 +#define SAA7114_VERT_OFFSET_HI 0xC9 +#define SAA7114_VERT_INPUT_LO 0xCA +#define SAA7114_VERT_INPUT_HI 0xCB +#define SAA7114_HORZ_OUTPUT_LO 0xCC +#define SAA7114_HORZ_OUTPUT_HI 0xCD +#define SAA7114_VERT_OUTPUT_LO 0xCE +#define SAA7114_VERT_OUTPUT_HI 0xCF +#define SAA7114_HORZ_PRESCALER 0xD0 +#define SAA7114_HORZ_ACL 0xD1 +#define SAA7114_HORZ_FIR_PREFILTER 0xD2 +#define SAA7114_FILTER_CONTRAST 0xD5 +#define SAA7114_FILTER_SATURATION 0xD6 +#define SAA7114_HSCALE_LUMA_LO 0xD8 +#define SAA7114_HSCALE_LUMA_HI 0xD9 +#define SAA7114_HSCALE_CHROMA_LO 0xDC +#define SAA7114_HSCALE_CHROMA_HI 0xDD +#define SAA7114_VSCALE_LUMA_LO 0xE0 +#define SAA7114_VSCALE_LUMA_HI 0xE1 +#define SAA7114_VSCALE_CHROMA_LO 0xE2 +#define SAA7114_VSCALE_CHROMA_HI 0xE3 +#define SAA7114_VSCALE_CONTROL 0xE4 +#define SAA7114_VSCALE_CHROMA_OFFS0 0xE8 +#define SAA7114_VSCALE_CHROMA_OFFS1 0xE9 +#define SAA7114_VSCALE_CHROMA_OFFS2 0xEA +#define SAA7114_VSCALE_CHROMA_OFFS3 0xEB +#define SAA7114_VSCALE_LUMINA_OFFS0 0xEC +#define SAA7114_VSCALE_LUMINA_OFFS1 0xED +#define SAA7114_VSCALE_LUMINA_OFFS2 0xEE +#define SAA7114_VSCALE_LUMINA_OFFS3 0xEF + + +/* Still need to determine PHO value (common phase offset) */ +#define SAA7114_VSCALE_PHO 0x00 + + +/*----------------------------------------------*/ +/* SECOND GENERATION GRAPHICS UNIT (REDCLOUD) */ +/*----------------------------------------------*/ + +#define MGP_DST_OFFSET 0x0000 /* dst address */ +#define MGP_SRC_OFFSET 0x0004 /* src address */ +#define MGP_VEC_ERR 0x0004 /* vector diag/axial errors */ +#define MGP_STRIDE 0x0008 /* src and dst strides */ +#define MGP_WID_HEIGHT 0x000C /* width and height of BLT */ +#define MGP_VEC_LEN 0x000C /* vector length/init error */ +#define MGP_SRC_COLOR_FG 0x0010 /* src mono data fgcolor */ +#define MGP_SRC_COLOR_BG 0x0014 /* src mono data bkcolor */ +#define MGP_PAT_COLOR_0 0x0018 /* pattern color 0 */ +#define MGP_PAT_COLOR_1 0x001C /* pattern color 1 */ +#define MGP_PAT_COLOR_2 0x0020 /* pattern color 2 */ +#define MGP_PAT_COLOR_3 0x0024 /* pattern color 3 */ +#define MGP_PAT_COLOR_4 0x0028 /* pattern color 4 */ +#define MGP_PAT_COLOR_5 0x002C /* pattern color 5 */ +#define MGP_PAT_DATA_0 0x0030 /* pattern data 0 */ +#define MGP_PAT_DATA_1 0x0034 /* pattern data 1 */ +#define MGP_RASTER_MODE 0x0038 /* raster operation */ +#define MGP_VECTOR_MODE 0x003C /* render vector */ +#define MGP_BLT_MODE 0x0040 /* render BLT */ +#define MGP_BLT_STATUS 0x0044 /* BLT status register */ +#define MGP_RESET 0x0044 /* reset register (write) */ +#define MGP_HST_SOURCE 0x0048 /* host src data (bitmap) */ +#define MGP_BASE_OFFSET 0x004C /* base render offset */ + +/* MGP_RASTER_MODE DEFINITIONS */ + +#define MGP_RM_BPPFMT_332 0x00000000 /* 8 BPP, 3:3:2 */ +#define MGP_RM_BPPFMT_4444 0x40000000 /* 16 BPP, 4:4:4:4 */ +#define MGP_RM_BPPFMT_1555 0x50000000 /* 16 BPP, 1:5:5:5 */ +#define MGP_RM_BPPFMT_565 0x60000000 /* 16 BPP, 5:6:5 */ +#define MGP_RM_BPPFMT_8888 0x80000000 /* 32 BPP, 8:8:8:8 */ +#define MGP_RM_ALPHA_EN_MASK 0x00C00000 /* Alpha enable */ +#define MGP_RM_ALPHA_TO_RGB 0x00400000 /* Alpha applies to RGB */ +#define MGP_RM_ALPHA_TO_ALPHA 0x00800000 /* Alpha applies to alpha */ +#define MGP_RM_ALPHA_OP_MASK 0x00300000 /* Alpha operation */ +#define MGP_RM_ALPHA_TIMES_A 0x00000000 /* Alpha * A */ +#define MGP_RM_BETA_TIMES_B 0x00100000 /* (1-alpha) * B */ +#define MGP_RM_A_PLUS_BETA_B 0x00200000 /* A + (1-alpha) * B */ +#define MGP_RM_ALPHA_A_PLUS_BETA_B 0x00300000 /* alpha * A + (1 - alpha)B */ +#define MGP_RM_ALPHA_SELECT 0x000E0000 /* Alpha Select */ +#define MGP_RM_SELECT_ALPHA_A 0x00000000 /* Alpha from channel A */ +#define MGP_RM_SELECT_ALPHA_B 0x00020000 /* Alpha from channel B */ +#define MGP_RM_SELECT_ALPHA_R 0x00040000 /* Registered alpha */ +#define MGP_RM_SELECT_ALPHA_1 0x00060000 /* Constant 1 */ +#define MGP_RM_SELECT_ALPHA_CHAN_A 0x00080000 /* RGB Values from A */ +#define MGP_RM_SELECT_ALPHA_CHAN_B 0x000A0000 /* RGB Values from B */ +#define MGP_RM_DEST_FROM_CHAN_A 0x00010000 /* Alpha channel select */ +#define MGP_RM_PAT_FLAGS 0x00000700 /* pattern related bits */ +#define MGP_RM_PAT_MONO 0x00000100 /* monochrome pattern */ +#define MGP_RM_PAT_COLOR 0x00000200 /* color pattern */ +#define MGP_RM_PAT_TRANS 0x00000400 /* pattern transparency */ +#define MGP_RM_SRC_TRANS 0x00000800 /* source transparency */ + +/* MGP_VECTOR_MODE DEFINITIONS */ + +#define MGP_VM_DST_REQ 0x00000008 /* dst data required */ +#define MGP_VM_THROTTLE 0x00000010 /* sync to VBLANK */ + +/* MGP_BLT_MODE DEFINITIONS */ + +#define MGP_BM_SRC_FB 0x00000001 /* src = frame buffer */ +#define MGP_BM_SRC_HOST 0x00000002 /* src = host register */ +#define MGP_BM_DST_REQ 0x00000004 /* dst data required */ +#define MGP_BM_SRC_MONO 0x00000040 /* monochrome source data */ +#define MGP_BM_SRC_BP_MONO 0x00000080 /* Byte-packed monochrome */ +#define MGP_BM_NEG_YDIR 0x00000100 /* negative Y direction */ +#define MGP_BM_NEG_XDIR 0x00000200 /* negative X direction */ +#define MGP_BM_THROTTLE 0x00000400 /* sync to VBLANK */ + +/* MGP_BLT_STATUS DEFINITIONS */ + +#define MGP_BS_BLT_BUSY 0x00000001 /* GP is not idle */ +#define MGP_BS_BLT_PENDING 0x00000004 /* second BLT is pending */ +#define MGP_BS_HALF_EMPTY 0x00000008 /* src FIFO half empty */ + +/* ALPHA BLENDING MODES */ + +#define ALPHA_MODE_BLEND 0x00000000 + +/*---------------------------------------------------*/ +/* SECOND GENERATION DISPLAY CONTROLLER (REDCLOUD) */ +/*---------------------------------------------------*/ + +#define MDC_UNLOCK 0x00000000 /* Unlock register */ +#define MDC_GENERAL_CFG 0x00000004 /* Config registers */ +#define MDC_DISPLAY_CFG 0x00000008 +#define MDC_GFX_SCL 0x0000000C /* Graphics scaling */ + +#define MDC_FB_ST_OFFSET 0x00000010 /* Frame buffer start offset */ +#define MDC_CB_ST_OFFSET 0x00000014 /* Compression start offset */ +#define MDC_CURS_ST_OFFSET 0x00000018 /* Cursor buffer start offset */ +#define MDC_ICON_ST_OFFSET 0x0000001C /* Icon buffer start offset */ +#define MDC_VID_Y_ST_OFFSET 0x00000020 /* Video Y Buffer start offset */ +#define MDC_VID_U_ST_OFFSET 0x00000024 /* Video U Buffer start offset */ +#define MDC_VID_V_ST_OFFSET 0x00000028 /* Video V Buffer start offset */ +#define MDC_LINE_SIZE 0x00000030 /* Video, CB, and FB line sizes */ +#define MDC_GFX_PITCH 0x00000034 /* FB and DB skip counts */ +#define MDC_VID_YUV_PITCH 0x00000038 /* Y, U and V buffer skip counts */ + +#define MDC_H_ACTIVE_TIMING 0x00000040 /* Horizontal timings */ +#define MDC_H_BLANK_TIMING 0x00000044 +#define MDC_H_SYNC_TIMING 0x00000048 +#define MDC_V_ACTIVE_TIMING 0x00000050 /* Vertical Timings */ +#define MDC_V_BLANK_TIMING 0x00000054 +#define MDC_V_SYNC_TIMING 0x00000058 + +#define MDC_CURSOR_X 0x00000060 /* Cursor X position */ +#define MDC_CURSOR_Y 0x00000064 /* Cursor Y Position */ +#define MDC_ICON_X 0x00000068 /* Icon X Position */ +#define MDC_LINE_CNT_STATUS 0x0000006C /* Icon Y Position */ + +#define MDC_PAL_ADDRESS 0x00000070 /* Palette Address */ +#define MDC_PAL_DATA 0x00000074 /* Palette Data */ +#define MDC_DFIFO_DIAG 0x00000078 /* Display FIFO diagnostic */ +#define MDC_CFIFO_DIAG 0x0000007C /* Compression FIFO diagnostic */ + +#define MDC_VID_DS_DELTA 0x00000080 /* Vertical Downscaling fraction */ + +#define MDC_PHY_MEM_OFFSET 0x00000084 /* VG Base Address Register */ +#define MDC_DV_CTL 0x00000088 /* Dirty-Valid Control Register */ +#define MDC_DV_ACC 0x0000008C /* Dirty-Valid RAM Access */ + +/* UNLOCK VALUE */ + +#define MDC_UNLOCK_VALUE 0x00004758 /* used to unlock DC regs */ + +/* VG MBUS DEVICE SMI MSR FIELDS */ + +#define MDC_VG_BL_MASK 0x00000001 +#define MDC_MISC_MASK 0x00000002 +#define MDC_ISR0_MASK 0x00000004 +#define MDC_VGA_BL_MASK 0x00000008 +#define MDC_CRTCIO_MSK 0x00000010 +#define MDC_VG_BLANK_SMI 0x00000001 +#define MDC_MISC_SMI 0x00000002 +#define MDC_ISR0_SMI 0x00000004 +#define MDC_VGA_BLANK_SMI 0x00000008 +#define MDC_CRTCIO_SMI 0x00000010 + +/* MDC_GENERAL_CFG BIT FIELDS */ + +#define MDC_GCFG_DBUG 0x80000000 +#define MDC_GCFG_DBSL 0x40000000 +#define MDC_GCFG_CFRW 0x20000000 +#define MDC_GCFG_DIAG 0x10000000 +#define MDC_GCFG_GXRFS4 0x08000000 +#define MDC_GCFG_SGFR 0x04000000 +#define MDC_GCFG_SGRE 0x02000000 +#define MDC_GCFG_SIGE 0x01000000 +#define MDC_GCFG_YUVM 0x00100000 +#define MDC_GCFG_VDSE 0x00080000 +#define MDC_GCFG_VGAFT 0x00040000 +#define MDC_GCFG_FDTY 0x00020000 +#define MDC_GCFG_STFM 0x00010000 +#define MDC_GCFG_DFHPEL_MASK 0x0000F000 +#define MDC_GCFG_DFHPSL_MASK 0x00000F00 +#define MDC_GCFG_VGAE 0x00000080 +#define MDC_GCFG_DECE 0x00000040 +#define MDC_GCFG_CMPE 0x00000020 +#define MDC_GCFG_VIDE 0x00000008 +#define MDC_GCFG_ICNE 0x00000004 +#define MDC_GCFG_CURE 0x00000002 +#define MDC_GCFG_DFLE 0x00000001 + +/* MDC_DISPLAY_CFG BIT FIELDS */ + +#define MDC_DCFG_A20M 0x80000000 +#define MDC_DCFG_A18M 0x40000000 +#define MDC_DCFG_VISL 0x08000000 +#define MDC_DCFG_FRLK 0x04000000 +#define MDC_DCFG_PALB 0x02000000 +#define MDC_DCFG_PIX_PAN_MASK 0x00F00000 +#define MDC_DCFG_DCEN 0x00080000 +#define MDC_DCFG_16BPP_MODE_MASK 0x00000C00 +#define MDC_DCFG_16BPP 0x00000000 +#define MDC_DCFG_15BPP 0x00000400 +#define MDC_DCFG_12BPP 0x00000800 +#define MDC_DCFG_DISP_MODE_MASK 0x00000300 +#define MDC_DCFG_DISP_MODE_8BPP 0x00000000 +#define MDC_DCFG_DISP_MODE_16BPP 0x00000100 +#define MDC_DCFG_DISP_MODE_24BPP 0x00000200 +#define MDC_DCFG_SCLE 0x00000080 +#define MDC_DCFG_TRUP 0x00000040 +#define MDC_DCFG_VIEN 0x00000020 +#define MDC_DCFG_VDEN 0x00000010 +#define MDC_DCFG_GDEN 0x00000008 +#define MDC_DCFG_VCKE 0x00000004 +#define MDC_DCFG_PCKE 0x00000002 +#define MDC_DCFG_TGEN 0x00000001 + +/* MDC_LINE_CNT BIT FIELDS */ + +#define MDC_LNCNT_DNA 0x80000000 +#define MDC_LNCNT_VNA 0x40000000 +#define MDC_LNCNT_VSA 0x20000000 +#define MDC_LNCNT_VINT 0x10000000 +#define MDC_LNCNT_FLIP 0x08000000 +#define MDC_LNCNT_V_LINE_CNT 0x07FF0000 +#define MDC_LNCNT_VFLIP 0x00008000 +#define MDC_LNCNT_SIGC 0x00004000 +#define MDC_LNCNT_SS_LINE_CMP 0x000007FF + +/* MDC_FB_ST_OFFSET BIT FIELDS */ + +#define MDC_FB_ST_OFFSET_MASK 0x0FFFFFFF + +/* MDC_CB_ST_OFFSET BIT FIELDS */ + +#define MDC_CB_ST_OFFSET_MASK 0x0FFFFFFF + +/* MDC_CURS_ST_OFFSET BIT FIELDS */ + +#define MDC_CURS_ST_OFFSET_MASK 0x0FFFFFFF + +/* MDC_ICON_ST_OFFSET BIT FIELDS */ + +#define MDC_ICON_ST_OFFSET_MASK 0x0FFFFFFF + +/* MDC_VID_Y_ST_OFFSET BIT FIELDS */ + +#define MDC_VID_Y_ST_OFFSET_MASK 0x0FFFFFFF + +/* MDC_VID_U_ST_OFFSET BIT FIELDS */ + +#define MDC_VID_U_ST_OFFSET_MASK 0x0FFFFFFF + +/* MDC_VID_V_ST_OFFSET BIT FIELDS */ + +#define MDC_VID_V_ST_OFFSET_MASK 0x0FFFFFFF + +/* MDC_LINE_SIZE BIT FIELDS */ + +#define MDC_LINE_SIZE_VLS_MASK 0xFF000000 +#define MDC_LINE_SIZE_CBLS_MASK 0x007F0000 +#define MDC_LINE_SIZE_FBLS_MASK 0x000007FF + +/* MDC_GFX_PITCH BIT FIELDS */ + +#define MDC_GFX_PITCH_CBP_MASK 0xFFFF0000 +#define MDC_GFX_PITCH_FBP_MASK 0x0000FFFF + +/* MDC_VID_YUV_PITCH BIT FIELDS */ + +#define MDC_YUV_PITCH_UVP_MASK 0xFFFF0000 +#define MDC_YUV_PITCH_YBP_MASK 0x0000FFFF + +/* MDC_H_ACTIVE_TIMING BIT FIELDS */ + +#define MDC_HAT_HT_MASK 0x0FF80000 +#define MDC_HAT_HA_MASK 0x00000FF8 + +/* MDC_H_BLANK_TIMING BIT FIELDS */ + +#define MDC_HBT_HBE_MASK 0x0FF80000 +#define MDC_HBT_HBS_MASK 0x00000FF8 + +/* MDC_H_SYNC_TIMING BIT FIELDS */ + +#define MDC_HST_HSE_MASK 0x0FF80000 +#define MDC_HST_HSS_MASK 0x00000FF8 + +/* MDC_V_ACTIVE_TIMING BIT FIELDS */ + +#define MDC_VAT_VT_MASK 0x07FF0000 +#define MDC_VAT_VA_MASK 0x000007FF + +/* MDC_V_BLANK_TIMING BIT FIELDS */ + +#define MDC_VBT_VBE_MASK 0x07FF0000 +#define MDC_VBT_VBS_MASK 0x000007FF + +/* MDC_V_SYNC_TIMING BIT FIELDS */ + +#define MDC_VST_VSE_MASK 0x07FF0000 +#define MDC_VST_VSS_MASK 0x000007FF + +/* MDC_DV_CTL BIT DEFINITIONS */ + +#define MDC_DV_LINE_SIZE_MASK 0x00000C00 +#define MDC_DV_LINE_SIZE_1024 0x00000000 +#define MDC_DV_LINE_SIZE_2048 0x00000400 +#define MDC_DV_LINE_SIZE_4096 0x00000800 +#define MDC_DV_LINE_SIZE_8192 0x00000C00 + +/* VGA DEFINITIONS */ + +#define MDC_SEQUENCER_INDEX 0x03C4 +#define MDC_SEQUENCER_DATA 0x03C5 +#define MDC_SEQUENCER_RESET 0x00 +#define MDC_SEQUENCER_CLK_MODE 0x01 + +#define MDC_RESET_VGA_DISP_ENABLE 0x03 +#define MDC_CLK_MODE_SCREEN_OFF 0x20 + + +/*---------------------------------------------------*/ +/* REDCLOUD DISPLAY FILTER */ +/*---------------------------------------------------*/ + +/* RCDF VIDEO REGISTER DEFINITIONS */ + +#define RCDF_VIDEO_CONFIG 0x000 +#define RCDF_DISPLAY_CONFIG 0x008 +#define RCDF_VIDEO_X_POS 0x010 +#define RCDF_VIDEO_Y_POS 0x018 +#define RCDF_VIDEO_SCALE 0x020 +#define RCDF_VIDEO_COLOR_KEY 0x028 +#define RCDF_VIDEO_COLOR_MASK 0x030 +#define RCDF_PALETTE_ADDRESS 0x038 +#define RCDF_PALETTE_DATA 0x040 +#define RCDF_VID_MISC 0x050 +#define RCDF_VID_CLOCK_SELECT 0x058 +#define RCDF_VIDEO_DOWNSCALER_CONTROL 0x078 +#define RCDF_VIDEO_DOWNSCALER_COEFFICIENTS 0x080 +#define RCDF_VID_CRC 0x088 +#define RCDF_VID_CRC32 0x090 +#define RCDF_VID_ALPHA_CONTROL 0x098 +#define RCDF_CURSOR_COLOR_KEY 0x0A0 +#define RCDF_CURSOR_COLOR_MASK 0x0A8 +#define RCDF_CURSOR_COLOR_1 0x0B0 +#define RCDF_CURSOR_COLOR_2 0x0B8 +#define RCDF_ALPHA_XPOS_1 0x0C0 +#define RCDF_ALPHA_YPOS_1 0x0C8 +#define RCDF_ALPHA_COLOR_1 0x0D0 +#define RCDF_ALPHA_CONTROL_1 0x0D8 +#define RCDF_ALPHA_XPOS_2 0x0E0 +#define RCDF_ALPHA_YPOS_2 0x0E8 +#define RCDF_ALPHA_COLOR_2 0x0F0 +#define RCDF_ALPHA_CONTROL_2 0x0F8 +#define RCDF_ALPHA_XPOS_3 0x100 +#define RCDF_ALPHA_YPOS_3 0x108 +#define RCDF_ALPHA_COLOR_3 0x110 +#define RCDF_ALPHA_CONTROL_3 0x118 +#define RCDF_VIDEO_REQUEST 0x120 +#define RCDF_ALPHA_WATCH 0x128 +#define RCDF_VIDEO_TEST_MODE 0x210 +#define RCDF_POWER_MANAGEMENT 0x410 + +/* DISPLAY FILTER POWER MANAGEMENT DEFINITIONS */ + +#define RCDF_PM_PANEL_POWER_ON 0x01000000 + +/* DISPLAY FILTER MSRS */ + +#define RCDF_MBD_MSR_DIAG_DF 0x2010 +#define RCDF_DIAG_32BIT_CRC 0x80000000 + +/* "RCDF_VIDEO_CONFIG" BIT DEFINITIONS */ + +#define RCDF_VCFG_VID_EN 0x00000001 +#define RCDF_VCFG_VID_INP_FORMAT 0x0000000C +#define RCDF_VCFG_X_FILTER_EN 0x00000040 +#define RCDF_VCFG_Y_FILTER_EN 0x00000080 +#define RCDF_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 +#define RCDF_VCFG_INIT_READ_MASK 0x01FF0000 +#define RCDF_VCFG_LINE_SIZE_UPPER 0x08000000 +#define RCDF_VCFG_4_2_0_MODE 0x10000000 +#define RCDF_VCFG_UYVY_FORMAT 0x00000000 +#define RCDF_VCFG_Y2YU_FORMAT 0x00000004 +#define RCDF_VCFG_YUYV_FORMAT 0x00000008 +#define RCDF_VCFG_YVYU_FORMAT 0x0000000C + +/* "RCDF_DISPLAY_CONFIG" BIT DEFINITIONS */ + +#define RCDF_DCFG_DIS_EN 0x00000001 +#define RCDF_DCFG_HSYNC_EN 0x00000002 +#define RCDF_DCFG_VSYNC_EN 0x00000004 +#define RCDF_DCFG_DAC_BL_EN 0x00000008 +#define RCDF_DCFG_FP_PWR_EN 0x00000040 +#define RCDF_DCFG_FP_DATA_EN 0x00000080 +#define RCDF_DCFG_CRT_HSYNC_POL 0x00000100 +#define RCDF_DCFG_CRT_VSYNC_POL 0x00000200 +#define RCDF_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 +#define RCDF_DCFG_CRT_SYNC_SKW_INIT 0x00010000 +#define RCDF_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 +#define RCDF_DCFG_PWR_SEQ_DLY_INIT 0x00080000 +#define RCDF_DCFG_VG_CK 0x00100000 +#define RCDF_DCFG_GV_PAL_BYP 0x00200000 +#define RCDF_DAC_VREF 0x04000000 +#define RCDF_FP_ON_STATUS 0x08000000 + +/* "RCDF_VID_MISC" BIT DEFINITIONS */ + +#define RCDF_GAMMA_BYPASS_BOTH 0x00000001 +#define RCDF_DAC_POWER_DOWN 0x00000400 +#define RCDF_ANALOG_POWER_DOWN 0x00000800 + +/* "RCDF_VIDEO_DOWNSCALER_CONTROL" BIT DEFINITIONS */ + +#define RCDF_VIDEO_DOWNSCALE_ENABLE 0x00000001 +#define RCDF_VIDEO_DOWNSCALE_FACTOR_POS 1 +#define RCDF_VIDEO_DOWNSCALE_FACTOR_MASK 0x0000001E +#define RCDF_VIDEO_DOWNSCALE_TYPE_A 0x00000000 +#define RCDF_VIDEO_DOWNSCALE_TYPE_B 0x00000040 +#define RCDF_VIDEO_DOWNSCALE_TYPE_MASK 0x00000040 + +/* "RCDF_VIDEO_DOWNSCALER_COEFFICIENTS" BIT DEFINITIONS */ + +#define RCDF_VIDEO_DOWNSCALER_COEF1_POS 0 +#define RCDF_VIDEO_DOWNSCALER_COEF2_POS 8 +#define RCDF_VIDEO_DOWNSCALER_COEF3_POS 16 +#define RCDF_VIDEO_DOWNSCALER_COEF4_POS 24 +#define RCDF_VIDEO_DOWNSCALER_COEF_MASK 0xF + +/* VIDEO DE-INTERLACING AND ALPHA CONTROL */ + +#define RCDF_NO_CK_OUTSIDE_ALPHA 0x00000100 +#define RCDF_CSC_VIDEO_YUV_TO_RGB 0x00000400 +#define RCDF_VIDEO_INPUT_IS_RGB 0x00002000 +#define RCDF_ALPHA1_PRIORITY_POS 16 +#define RCDF_ALPHA1_PRIORITY_MASK 0x00030000 +#define RCDF_ALPHA2_PRIORITY_POS 18 +#define RCDF_ALPHA2_PRIORITY_MASK 0x000C0000 +#define RCDF_ALPHA3_PRIORITY_POS 20 +#define RCDF_ALPHA3_PRIORITY_MASK 0x00300000 + +/* VIDEO CURSOR COLOR KEY DEFINITIONS */ + +#define RCDF_CURSOR_COLOR_KEY_ENABLE 0x20000000 +#define RCDF_CURSOR_COLOR_KEY_OFFSET_POS 24 +#define RCDF_CURSOR_COLOR_BITS 23 +#define RCDF_COLOR_MASK 0x00FFFFFF /* 24 significant bits */ + +/* ALPHA COLOR BIT DEFINITION (REGISTERS 0x68, 0x78, AND 0x88) */ + +#define RCDF_ALPHA_COLOR_ENABLE 0x01000000 + +/* ALPHA CONTROL BIT DEFINITIONS (REGISTERS 0x6C, 0x7C, AND 0x8C) */ + +#define RCDF_ACTRL_WIN_ENABLE 0x00010000 +#define RCDF_ACTRL_LOAD_ALPHA 0x00020000 + +/* VIDEO REQUEST DEFINITIONS (REGISTER 0x90) */ + +#define RCDF_VIDEO_Y_REQUEST_POS 0 +#define RCDF_VIDEO_X_REQUEST_POS 16 +#define RCDF_VIDEO_REQUEST_MASK 0x000007FF + +/* GEODELINK DEVICE MSR REGISTER SUMMARY */ + +#define MBD_MSR_CAP 0x2000 /* Device Capabilities */ +#define MBD_MSR_CONFIG 0x2001 /* Device Master Configuration Register */ +#define MBD_MSR_SMI 0x2002 /* MBus Device SMI Register */ +#define MBD_MSR_ERROR 0x2003 /* MBus Device Error */ +#define MBD_MSR_PM 0x2004 /* MBus Device Power Management Register */ +#define MBD_MSR_DIAG 0x2005 /* Mbus Device Diagnostic Register */ + +/* DISPLAY FILTER MBD_MSR_DIAG DEFINITIONS */ + +#define RCDF_MBD_DIAG_SEL0 0x00007FFF /* Lower 32-bits of Diag Bus Select */ +#define RCDF_MBD_DIAG_EN0 0x00008000 /* Enable for lower 32-bits of diag bus */ +#define RCDF_MBD_DIAG_SEL1 0x7FFF0000 /* Upper 32-bits of Diag Bus Select */ +#define RCDF_MBD_DIAG_EN1 0x80000000 /* Enable for upper 32-bits of diag bus */ + +/* DISPLAY FILTER MBD_MSR_CONFIG DEFINITIONS */ + +#define RCDF_CONFIG_FMT_MASK 0x00000038 /* Output Format */ +#define RCDF_CONFIG_FMT_CRT 0x00000000 +#define RCDF_CONFIG_FMT_FP 0x00000008 + +/* MCP MSR DEFINITIONS */ + +#define MCP_CLKOFF 0x0010 +#define MCP_CLKACTIVE 0x0011 +#define MCP_CLKDISABLE 0x0012 +#define MCP_CLK4ACK 0x0013 +#define MCP_SYS_RSTPLL 0x0014 +#define MCP_DOTPLL 0x0015 +#define MCP_DBGCLKCTL 0x0016 +#define MCP_RC_REVID 0x0017 +#define MCP_SETM0CTL 0x0040 +#define MCP_SETN0CTL 0x0048 +#define MCP_CMPVAL0 0x0050 +#define MCP_CMPMASK0 0x0051 +#define MCP_REGA 0x0058 +#define MCP_REGB 0x0059 +#define MCP_REGAMASK 0x005A +#define MCP_REGAVAL 0x005B +#define MCP_REGBMASK 0x005C +#define MCP_REGBVAL 0x005D +#define MCP_FIFOCTL 0x005E +#define MCP_DIAGCTL 0x005F +#define MCP_H0CTL 0x0060 +#define MCP_XSTATE 0x0066 +#define MCP_YSTATE 0x0067 +#define MCP_ACTION0 0x0068 + +/* MCP_SYS_RSTPLL DEFINITIONS */ + +#define MCP_DOTPOSTDIV3 0x00000008 +#define MCP_DOTPREMULT2 0x00000004 +#define MCP_DOTPREDIV2 0x00000002 + +/* MCP MBD_MSR_DIAG DEFINITIONS */ + +#define MCP_MBD_DIAG_SEL0 0x00000007 +#define MCP_MBD_DIAG_EN0 0x00008000 +#define MCP_MBD_DIAG_SEL1 0x00070000 +#define MCP_MBD_DIAG_EN1 0x80000000 + +/* MCP_DOTPLL DEFINITIONS */ + +#define MCP_DOTPLL_P 0x00000003 +#define MCP_DOTPLL_N 0x000001FC +#define MCP_DOTPLL_M 0x00001E00 +#define MCP_DOTPLL_LOCK 0x02000000 +#define MCP_DOTPLL_BYPASS 0x00008000 + + +/*---------------------------------------------------*/ +/* THIRD GENERATION DISPLAY CONTROLLER (CASTLE) */ +/*---------------------------------------------------*/ + +#define DC3_UNLOCK 0x00000000 /* Unlock register */ +#define DC3_GENERAL_CFG 0x00000004 /* Config registers */ +#define DC3_DISPLAY_CFG 0x00000008 + +#define DC3_FB_ST_OFFSET 0x00000010 /* Frame buffer start offset */ +#define DC3_CB_ST_OFFSET 0x00000014 /* Compression start offset */ +#define DC3_CURS_ST_OFFSET 0x00000018 /* Cursor buffer start offset */ +#define DC3_VID_Y_ST_OFFSET 0x00000020 /* Video Y Buffer start offset */ +#define DC3_VID_U_ST_OFFSET 0x00000024 /* Video U Buffer start offset */ +#define DC3_VID_V_ST_OFFSET 0x00000028 /* Video V Buffer start offset */ +#define DC3_LINE_SIZE 0x00000030 /* Video, CB, and FB line sizes */ +#define DC3_GFX_PITCH 0x00000034 /* FB and DB skip counts */ +#define DC3_VID_YUV_PITCH 0x00000038 /* Y, U and V buffer skip counts */ + +#define DC3_H_ACTIVE_TIMING 0x00000040 /* Horizontal timings */ +#define DC3_H_BLANK_TIMING 0x00000044 +#define DC3_H_SYNC_TIMING 0x00000048 +#define DC3_V_ACTIVE_TIMING 0x00000050 /* Vertical Timings */ +#define DC3_V_BLANK_TIMING 0x00000054 +#define DC3_V_SYNC_TIMING 0x00000058 + +#define DC3_CURSOR_X 0x00000060 /* Cursor X position */ +#define DC3_CURSOR_Y 0x00000064 /* Cursor Y Position */ +#define DC3_LINE_CNT_STATUS 0x0000006C /* Icon Y Position */ + +#define DC3_PAL_ADDRESS 0x00000070 /* Palette Address */ +#define DC3_PAL_DATA 0x00000074 /* Palette Data */ +#define DC3_DFIFO_DIAG 0x00000078 /* Display FIFO diagnostic */ +#define DC3_CFIFO_DIAG 0x0000007C /* Compression FIFO diagnostic */ + +#define DC3_VID_DS_DELTA 0x00000080 /* Vertical Downscaling fraction */ + +#define DC3_PHY_MEM_OFFSET 0x00000084 /* VG Base Address Register */ +#define DC3_DV_CTL 0x00000088 /* Dirty-Valid Control Register */ +#define DC3_DV_ACC 0x0000008C /* Dirty-Valid RAM Access */ + +#define DC3_COLOR_KEY 0x000000B8 /* Graphics color key */ +#define DC3_COLOR_MASK 0x000000BC /* Graphics color key mask */ + +/* UNLOCK VALUE */ + +#define DC3_UNLOCK_VALUE 0x00004758 /* used to unlock DC regs */ + +/* VG MBUS DEVICE SMI MSR FIELDS */ + +#define DC3_VG_BL_MASK 0x00000001 +#define DC3_MISC_MASK 0x00000002 +#define DC3_ISR0_MASK 0x00000004 +#define DC3_VGA_BL_MASK 0x00000008 +#define DC3_CRTCIO_MSK 0x00000010 +#define DC3_VG_BLANK_SMI 0x00000001 +#define DC3_MISC_SMI 0x00000002 +#define DC3_ISR0_SMI 0x00000004 +#define DC3_VGA_BLANK_SMI 0x00000008 +#define DC3_CRTCIO_SMI 0x00000010 + +/* DC3_GENERAL_CFG BIT FIELDS */ + +#define DC3_GCFG_DBUG 0x80000000 +#define DC3_GCFG_DBSL 0x40000000 +#define DC3_GCFG_CFRW 0x20000000 +#define DC3_GCFG_DIAG 0x10000000 +#define DC3_GCFG_GXRFS4 0x08000000 +#define DC3_GCFG_SGFR 0x04000000 +#define DC3_GCFG_SGRE 0x02000000 +#define DC3_GCFG_SIGE 0x01000000 +#define DC3_GCFG_YUVM 0x00100000 +#define DC3_GCFG_VDSE 0x00080000 +#define DC3_GCFG_VGAFT 0x00040000 +#define DC3_GCFG_FDTY 0x00020000 +#define DC3_GCFG_STFM 0x00010000 +#define DC3_GCFG_DFHPEL_MASK 0x0000F000 +#define DC3_GCFG_DFHPSL_MASK 0x00000F00 +#define DC3_GCFG_VGAE 0x00000080 +#define DC3_GCFG_DECE 0x00000040 +#define DC3_GCFG_CMPE 0x00000020 +#define DC3_GCFG_VIDE 0x00000008 +#define DC3_GCFG_ICNE 0x00000004 +#define DC3_GCFG_CURE 0x00000002 +#define DC3_GCFG_DFLE 0x00000001 + +/* DC3_DISPLAY_CFG BIT FIELDS */ + +#define DC3_DCFG_A20M 0x80000000 +#define DC3_DCFG_A18M 0x40000000 +#define DC3_DCFG_VISL 0x08000000 +#define DC3_DCFG_FRLK 0x04000000 +#define DC3_DCFG_PALB 0x02000000 +#define DC3_DCFG_PIX_PAN_MASK 0x00F00000 +#define DC3_DCFG_DCEN 0x00080000 +#define DC3_DCFG_16BPP_MODE_MASK 0x00000C00 +#define DC3_DCFG_16BPP 0x00000000 +#define DC3_DCFG_15BPP 0x00000400 +#define DC3_DCFG_12BPP 0x00000800 +#define DC3_DCFG_DISP_MODE_MASK 0x00000300 +#define DC3_DCFG_DISP_MODE_8BPP 0x00000000 +#define DC3_DCFG_DISP_MODE_16BPP 0x00000100 +#define DC3_DCFG_DISP_MODE_24BPP 0x00000200 +#define DC3_DCFG_SCLE 0x00000080 +#define DC3_DCFG_TRUP 0x00000040 +#define DC3_DCFG_VIEN 0x00000020 +#define DC3_DCFG_VDEN 0x00000010 +#define DC3_DCFG_GDEN 0x00000008 +#define DC3_DCFG_VCKE 0x00000004 +#define DC3_DCFG_PCKE 0x00000002 +#define DC3_DCFG_TGEN 0x00000001 + +/* DC3_LINE_CNT BIT FIELDS */ + +#define DC3_LNCNT_DNA 0x80000000 +#define DC3_LNCNT_VNA 0x40000000 +#define DC3_LNCNT_VSA 0x20000000 +#define DC3_LNCNT_VINT 0x10000000 +#define DC3_LNCNT_FLIP 0x08000000 +#define DC3_LNCNT_V_LINE_CNT 0x07FF0000 +#define DC3_LNCNT_VFLIP 0x00008000 +#define DC3_LNCNT_SIGC 0x00004000 +#define DC3_LNCNT_SS_LINE_CMP 0x000007FF + +/* DC3_FB_ST_OFFSET BIT FIELDS */ + +#define DC3_FB_ST_OFFSET_MASK 0x0FFFFFFF + +/* DC3_CB_ST_OFFSET BIT FIELDS */ + +#define DC3_CB_ST_OFFSET_MASK 0x0FFFFFFF + +/* DC3_CURS_ST_OFFSET BIT FIELDS */ + +#define DC3_CURS_ST_OFFSET_MASK 0x0FFFFFFF + +/* DC3_ICON_ST_OFFSET BIT FIELDS */ + +#define DC3_ICON_ST_OFFSET_MASK 0x0FFFFFFF + +/* DC3_VID_Y_ST_OFFSET BIT FIELDS */ + +#define DC3_VID_Y_ST_OFFSET_MASK 0x0FFFFFFF + +/* DC3_VID_U_ST_OFFSET BIT FIELDS */ + +#define DC3_VID_U_ST_OFFSET_MASK 0x0FFFFFFF + +/* DC3_VID_V_ST_OFFSET BIT FIELDS */ + +#define DC3_VID_V_ST_OFFSET_MASK 0x0FFFFFFF + +/* DC3_LINE_SIZE BIT FIELDS */ + +#define DC3_LINE_SIZE_VLS_MASK 0x3FF00000 +#define DC3_LINE_SIZE_CBLS_MASK 0x0007F000 +#define DC3_LINE_SIZE_FBLS_MASK 0x000003FF +#define DC3_LINE_SIZE_CB_SHIFT 12 +#define DC3_LINE_SIZE_VB_SHIFT 20 + +/* DC3_GFX_PITCH BIT FIELDS */ + +#define DC3_GFX_PITCH_CBP_MASK 0xFFFF0000 +#define DC3_GFX_PITCH_FBP_MASK 0x0000FFFF + +/* DC3_VID_YUV_PITCH BIT FIELDS */ + +#define DC3_YUV_PITCH_UVP_MASK 0xFFFF0000 +#define DC3_YUV_PITCH_YBP_MASK 0x0000FFFF + +/* DC3_H_ACTIVE_TIMING BIT FIELDS */ + +#define DC3_HAT_HT_MASK 0x0FF80000 +#define DC3_HAT_HA_MASK 0x00000FF8 + +/* DC3_H_BLANK_TIMING BIT FIELDS */ + +#define DC3_HBT_HBE_MASK 0x0FF80000 +#define DC3_HBT_HBS_MASK 0x00000FF8 + +/* DC3_H_SYNC_TIMING BIT FIELDS */ + +#define DC3_HST_HSE_MASK 0x0FF80000 +#define DC3_HST_HSS_MASK 0x00000FF8 + +/* DC3_V_ACTIVE_TIMING BIT FIELDS */ + +#define DC3_VAT_VT_MASK 0x07FF0000 +#define DC3_VAT_VA_MASK 0x000007FF + +/* DC3_V_BLANK_TIMING BIT FIELDS */ + +#define DC3_VBT_VBE_MASK 0x07FF0000 +#define DC3_VBT_VBS_MASK 0x000007FF + +/* DC3_V_SYNC_TIMING BIT FIELDS */ + +#define DC3_VST_VSE_MASK 0x07FF0000 +#define DC3_VST_VSS_MASK 0x000007FF + +/* DC3_DV_CTL BIT DEFINITIONS */ + +#define DC3_DV_LINE_SIZE_MASK 0x00000C00 +#define DC3_DV_LINE_SIZE_1024 0x00000000 +#define DC3_DV_LINE_SIZE_2048 0x00000400 +#define DC3_DV_LINE_SIZE_4096 0x00000800 +#define DC3_DV_LINE_SIZE_8192 0x00000C00 + +#define DC3_CLR_KEY_DATA_MASK 0x00FFFFFF +#define DC3_CLR_KEY_ENABLE 0x01000000 +#define DC3_CLR_KEY_INVERT 0x02000000 + +/* VGA DEFINITIONS */ + +#define DC3_SEQUENCER_INDEX 0x03C4 +#define DC3_SEQUENCER_DATA 0x03C5 +#define DC3_SEQUENCER_RESET 0x00 +#define DC3_SEQUENCER_CLK_MODE 0x01 + +#define DC3_RESET_VGA_DISP_ENABLE 0x03 +#define DC3_CLK_MODE_SCREEN_OFF 0x20 + +/*---------------------------------------------------*/ +/* CASTLE DISPLAY FILTER */ +/*---------------------------------------------------*/ + +/* CASTLE VIDEO REGISTER DEFINITIONS */ + +#define CASTLE_VIDEO_CONFIG 0x000 +#define CASTLE_DISPLAY_CONFIG 0x008 +#define CASTLE_VIDEO_X_POS 0x010 +#define CASTLE_VIDEO_Y_POS 0x018 +#define CASTLE_VIDEO_COLOR_KEY 0x028 +#define CASTLE_VIDEO_COLOR_MASK 0x030 +#define CASTLE_PALETTE_ADDRESS 0x038 +#define CASTLE_PALETTE_DATA 0x040 +#define CASTLE_VID_MISC 0x050 +#define CASTLE_VID_CLOCK_SELECT 0x058 +#define CASTLE_VIDEO_YSCALE 0x060 +#define CASTLE_VIDEO_XSCALE 0x068 +#define CASTLE_VIDEO_DOWNSCALER_CONTROL 0x078 +#define CASTLE_VID_CRC 0x088 +#define CASTLE_VID_CRC32 0x090 +#define CASTLE_VID_ALPHA_CONTROL 0x098 +#define CASTLE_CURSOR_COLOR_KEY 0x0A0 +#define CASTLE_CURSOR_COLOR_MASK 0x0A8 +#define CASTLE_CURSOR_COLOR_1 0x0B0 +#define CASTLE_CURSOR_COLOR_2 0x0B8 +#define CASTLE_ALPHA_XPOS_1 0x0C0 +#define CASTLE_ALPHA_YPOS_1 0x0C8 +#define CASTLE_ALPHA_COLOR_1 0x0D0 +#define CASTLE_ALPHA_CONTROL_1 0x0D8 +#define CASTLE_ALPHA_XPOS_2 0x0E0 +#define CASTLE_ALPHA_YPOS_2 0x0E8 +#define CASTLE_ALPHA_COLOR_2 0x0F0 +#define CASTLE_ALPHA_CONTROL_2 0x0F8 +#define CASTLE_ALPHA_XPOS_3 0x100 +#define CASTLE_ALPHA_YPOS_3 0x108 +#define CASTLE_ALPHA_COLOR_3 0x110 +#define CASTLE_ALPHA_CONTROL_3 0x118 +#define CASTLE_VIDEO_REQUEST 0x120 +#define CASTLE_ALPHA_WATCH 0x128 +#define CASTLE_VIDEO_TEST_MODE 0x210 +#define CASTLE_POWER_MANAGEMENT 0x410 + +/* DISPLAY FILTER POWER MANAGEMENT DEFINITIONS */ + +#define CASTLE_PM_PANEL_POWER_ON 0x01000000 + +/* DISPLAY FILTER MSRS */ + +#define CASTLE_MBD_MSR_DIAG_DF 0x2010 +#define CASTLE_DIAG_32BIT_CRC 0x80000000 + +/* "CASTLE_VIDEO_CONFIG" BIT DEFINITIONS */ + +#define CASTLE_VCFG_VID_EN 0x00000001 +#define CASTLE_VCFG_VID_INP_FORMAT 0x0000000C +#define CASTLE_VCFG_SCALER_BYPASS 0x00000020 +#define CASTLE_VCFG_X_FILTER_EN 0x00000040 +#define CASTLE_VCFG_Y_FILTER_EN 0x00000080 +#define CASTLE_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 +#define CASTLE_VCFG_INIT_READ_MASK 0x01FF0000 +#define CASTLE_VCFG_LINE_SIZE_UPPER 0x08000000 +#define CASTLE_VCFG_4_2_0_MODE 0x10000000 +#define CASTLE_VCFG_UYVY_FORMAT 0x00000000 +#define CASTLE_VCFG_Y2YU_FORMAT 0x00000004 +#define CASTLE_VCFG_YUYV_FORMAT 0x00000008 +#define CASTLE_VCFG_YVYU_FORMAT 0x0000000C + +/* "CASTLE_DISPLAY_CONFIG" BIT DEFINITIONS */ + +#define CASTLE_DCFG_DIS_EN 0x00000001 +#define CASTLE_DCFG_HSYNC_EN 0x00000002 +#define CASTLE_DCFG_VSYNC_EN 0x00000004 +#define CASTLE_DCFG_DAC_BL_EN 0x00000008 +#define CASTLE_DCFG_FP_PWR_EN 0x00000040 +#define CASTLE_DCFG_FP_DATA_EN 0x00000080 +#define CASTLE_DCFG_CRT_HSYNC_POL 0x00000100 +#define CASTLE_DCFG_CRT_VSYNC_POL 0x00000200 +#define CASTLE_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 +#define CASTLE_DCFG_CRT_SYNC_SKW_INIT 0x00010000 +#define CASTLE_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 +#define CASTLE_DCFG_PWR_SEQ_DLY_INIT 0x00080000 +#define CASTLE_DCFG_VG_CK 0x00100000 +#define CASTLE_DCFG_GV_PAL_BYP 0x00200000 +#define CASTLE_DAC_VREF 0x04000000 +#define CASTLE_FP_ON_STATUS 0x08000000 + +/* "CASTLE_VID_MISC" BIT DEFINITIONS */ + +#define CASTLE_GAMMA_BYPASS_BOTH 0x00000001 +#define CASTLE_DAC_POWER_DOWN 0x00000400 +#define CASTLE_ANALOG_POWER_DOWN 0x00000800 + +/* "CASTLE_VIDEO_DOWNSCALER_CONTROL" BIT DEFINITIONS */ + +#define CASTLE_VIDEO_DOWNSCALE_ENABLE 0x00000001 +#define CASTLE_VIDEO_DOWNSCALE_FACTOR_POS 1 +#define CASTLE_VIDEO_DOWNSCALE_FACTOR_MASK 0x0000001E +#define CASTLE_VIDEO_DOWNSCALE_TYPE_A 0x00000000 +#define CASTLE_VIDEO_DOWNSCALE_TYPE_B 0x00000040 +#define CASTLE_VIDEO_DOWNSCALE_TYPE_MASK 0x00000040 + +/* "CASTLE_VIDEO_DOWNSCALER_COEFFICIENTS" BIT DEFINITIONS */ + +#define CASTLE_VIDEO_DOWNSCALER_COEF1_POS 0 +#define CASTLE_VIDEO_DOWNSCALER_COEF2_POS 8 +#define CASTLE_VIDEO_DOWNSCALER_COEF3_POS 16 +#define CASTLE_VIDEO_DOWNSCALER_COEF4_POS 24 +#define CASTLE_VIDEO_DOWNSCALER_COEF_MASK 0xF + +/* VIDEO DE-INTERLACING AND ALPHA CONTROL */ + +#define CASTLE_NO_CK_OUTSIDE_ALPHA 0x00000100 +#define CASTLE_CSC_VIDEO_YUV_TO_RGB 0x00000400 +#define CASTLE_VIDEO_INPUT_IS_RGB 0x00002000 +#define CASTLE_ALPHA1_PRIORITY_POS 16 +#define CASTLE_ALPHA1_PRIORITY_MASK 0x00030000 +#define CASTLE_ALPHA2_PRIORITY_POS 18 +#define CASTLE_ALPHA2_PRIORITY_MASK 0x000C0000 +#define CASTLE_ALPHA3_PRIORITY_POS 20 +#define CASTLE_ALPHA3_PRIORITY_MASK 0x00300000 + +/* VIDEO CURSOR COLOR KEY DEFINITIONS */ + +#define CASTLE_CURSOR_COLOR_KEY_ENABLE 0x20000000 +#define CASTLE_CURSOR_COLOR_KEY_OFFSET_POS 24 +#define CASTLE_CURSOR_COLOR_BITS 23 +#define CASTLE_COLOR_MASK 0x00FFFFFF /* 24 significant bits */ + +/* ALPHA COLOR BIT DEFINITION (REGISTERS 0x68, 0x78, AND 0x88) */ + +#define CASTLE_ALPHA_COLOR_ENABLE 0x01000000 + +/* ALPHA CONTROL BIT DEFINITIONS (REGISTERS 0x6C, 0x7C, AND 0x8C) */ + +#define CASTLE_ACTRL_WIN_ENABLE 0x00010000 +#define CASTLE_ACTRL_LOAD_ALPHA 0x00020000 + +/* VIDEO REQUEST DEFINITIONS (REGISTER 0x90) */ + +#define CASTLE_VIDEO_Y_REQUEST_POS 0 +#define CASTLE_VIDEO_X_REQUEST_POS 16 +#define CASTLE_VIDEO_REQUEST_MASK 0x000007FF + +/* END OF FILE */ + diff --git a/Source/DirectFB/gfxdrivers/nsc/include/gfx_type.h b/Source/DirectFB/gfxdrivers/nsc/include/gfx_type.h new file mode 100755 index 0000000..71be2d9 --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/include/gfx_type.h @@ -0,0 +1,426 @@ +/* + * $Workfile: gfx_type.h $ + * + * This header file defines the pneumonics used when calling Durango routines. + * This file is automatically included by gfx_rtns.h + */ + +/* NSC_LIC_ALTERNATIVE_PREAMBLE + * + * Revision 1.0 + * + * National Semiconductor Alternative GPL-BSD License + * + * National Semiconductor Corporation licenses this software + * ("Software"): + * + * National Xfree frame buffer driver + * + * under one of the two following licenses, depending on how the + * Software is received by the Licensee. + * + * If this Software is received as part of the Linux Framebuffer or + * other GPL licensed software, then the GPL license designated + * NSC_LIC_GPL applies to this Software; in all other circumstances + * then the BSD-style license designated NSC_LIC_BSD shall apply. + * + * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ + +/* NSC_LIC_BSD + * + * National Semiconductor Corporation Open Source License for + * + * National Xfree frame buffer driver + * + * (BSD License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * * Neither the name of the National Semiconductor Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * END_NSC_LIC_BSD */ + +/* NSC_LIC_GPL + * + * National Semiconductor Corporation Gnu General Public License for + * + * National Xfree frame buffer driver + * + * (GPL License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted under the terms of the GNU General + * Public License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version + * + * In addition to the terms of the GNU General Public License, neither + * the name of the National Semiconductor Corporation nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. See the GNU General Public License for more details. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * You should have received a copy of the GNU General Public License + * along with this file; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * END_NSC_LIC_GPL */ + + +#ifndef _gfx_type_h +#define _gfx_type_h + +/* MSR DEFINITIONS */ + +typedef enum DevStatus { FOUND, NOT_KNOWN, REQ_NOT_FOUND, REQ_NOT_INSTALLED } DEV_STATUS; + +typedef struct msr { + DEV_STATUS Present; /* Node enumeration status */ + unsigned char Id; /* Device ID (from MSR specs) */ + unsigned long Address; /* Address - 32-bit MBus address at which 'Id' is found */ +} MSR; + +typedef struct mValue { + unsigned long high; + unsigned long low; +} Q_WORD; + +typedef struct mbusNode { + unsigned long address; + unsigned int deviceId; + unsigned int claimed; +} MBUS_NODE; + +/* MSR ARRAY INDEXES */ +/* These are indexes into the array of MBus devices. These */ +/* should not be confused with the class codes at MSR register */ +/* 0x2000. */ + +#define RC_ID_MBIU0 0x00 +#define RC_ID_MBIU1 0x01 +#define RC_ID_MCP 0x02 +#define RC_ID_MPCI 0x03 +#define RC_ID_MC 0x04 +#define RC_ID_GP 0x05 +#define RC_ID_VG 0x06 +#define RC_ID_DF 0x07 +#define RC_ID_FG 0x08 +#define RC_ID_VA 0x09 +#define CP_ID_MBIU 0x0A +#define CP_ID_MPCI 0x0B +#define CP_ID_USB2 0x0C +#define CP_ID_ATAC 0x0D +#define CP_ID_MDD 0x0E +#define CP_ID_ACC 0x0F +#define CP_ID_USB1 0x10 +#define CP_ID_MCP 0x11 + +/* MBUS DEVICE CLASS CODES */ +/* These are the device ids for the known Redcloud MBus devices. */ + +#define RC_CC_MBIU 0x01 +#define RC_CC_MCP 0x02 +#define RC_CC_MPCI 0x05 +#define RC_CC_MC 0x20 +#define RC_CC_GP 0x3D +#define RC_CC_VG 0x3E +#define RC_CC_DF 0x3F +#define RC_CC_FG 0xF0 +#define RC_CC_VA 0x86 +#define CP_CC_MBIU 0x01 +#define CP_CC_MPCI 0x05 +#define CP_CC_USB2 0x42 +#define CP_CC_ATAC 0x47 +#define CP_CC_MDD 0xDF +#define CP_CC_ACC 0x33 +#define CP_CC_USB1 0x42 +#define CP_CC_MCP 0x02 + +/* VAIL AND MBIUS ARE AT KNOWN ADDRESSES */ +/* We can initialize the addresses of these devices in advance, */ +/* as their location should never change. */ + +#define RC_MB0_MBIU0 0x10000000 +#define RC_MB0_MBIU1 0x40000000 +#define CP_MB0_MBIU0 0x51010000 +#define RC_MB0_CPU 0x00000000 +#define FAKE_ADDRESS 0xFFFFFFFF + +/* MSR PORT DESCRIPTORS */ + +#define NOT_POPULATED 0 +#define NOT_INSTALLED 0xFFFE +#define REFLECTIVE 0xFFFF + +/* CRC DATA SOURCES */ + +#define CRC_SOURCE_GFX_DATA 0x00 +#define CRC_SOURCE_CRT_RGB 0x01 +#define CRC_SOURCE_FP_DATA 0x02 + + +/* TV DEFINITIONS */ + +typedef enum TVStandardType { + TV_STANDARD_NTSC = 1, + TV_STANDARD_PAL +} TVStandardType; + +typedef enum GfxOnTVType { + GFX_ON_TV_SQUARE_PIXELS = 1, + GFX_ON_TV_NO_SCALING +} GfxOnTVType; + +#define CRT_DISABLE 0x00 +#define CRT_ENABLE 0x01 +#define CRT_STANDBY 0x02 +#define CRT_SUSPEND 0x03 + +#define TV_OUTPUT_COMPOSITE 0x01 +#define TV_OUTPUT_S_VIDEO 0x02 +#define TV_OUTPUT_YUV 0x03 +#define TV_OUTPUT_SCART 0x04 + +#define TV_FLICKER_FILTER_NONE 0x01 +#define TV_FLICKER_FILTER_NORMAL 0x02 +#define TV_FLICKER_FILTER_INTERLACED 0x03 + +#define TV_YC_DELAY_NONE 0x01 +#define TV_Y_DELAY_ONE_PIXEL 0x02 +#define TV_C_DELAY_ONE_PIXEL 0x03 +#define TV_C_DELAY_TWO_PIXELS 0x04 + +#define TV_SUB_CARRIER_RESET_NEVER 0x01 +#define TV_SUB_CARRIER_RESET_EVERY_TWO_LINES 0x02 +#define TV_SUB_CARRIER_RESET_EVERY_TWO_FRAMES 0x03 +#define TV_SUB_CARRIER_RESET_EVERY_FOUR_FRAMES 0x04 + +#define TVENC_RESET_EVERY_ODD_FIELD 0x01 +#define TVENC_RESET_EVERY_EVEN_FIELD 0x02 +#define TVENC_RESET_NEXT_ODD_FIELD 0x03 +#define TVENC_RESET_NEXT_EVEN_FIELD 0x04 +#define TVENC_RESET_EVERY_FIELD 0x05 +#define TVENC_RESET_EVERY_X_ODD_FIELDS 0x06 +#define TVENC_RESET_EVERY_X_EVEN_FIELDS 0x07 + +/* VBI FORMATS */ + +#define VBI_FORMAT_VIDEO 0x1 +#define VBI_FORMAT_RAW 0x2 +#define VBI_FORMAT_CC 0x4 +#define VBI_FORMAT_NABTS 0x8 + +/* VIDEO DEFINITIONS */ + +#define VIDEO_FORMAT_UYVY 0x0 +#define VIDEO_FORMAT_Y2YU 0x1 +#define VIDEO_FORMAT_YUYV 0x2 +#define VIDEO_FORMAT_YVYU 0x3 +#define VIDEO_FORMAT_Y0Y1Y2Y3 0x4 +#define VIDEO_FORMAT_Y3Y2Y1Y0 0x5 +#define VIDEO_FORMAT_Y1Y0Y3Y2 0x6 +#define VIDEO_FORMAT_Y1Y2Y3Y0 0x7 +#define VIDEO_FORMAT_RGB 0x8 +#define VIDEO_FORMAT_P2M_P2L_P1M_P1L 0x9 +#define VIDEO_FORMAT_P1M_P1L_P2M_P2L 0xA +#define VIDEO_FORMAT_P1M_P2L_P2M_P1L 0xB + +#define VIDEO_DOWNSCALE_KEEP_1_OF 0x1 +#define VIDEO_DOWNSCALE_DROP_1_OF 0x2 + +typedef enum VideoSourceType { /* The source from which the video processor shows full screen video */ + VIDEO_SOURCE_MEMORY = 1, + VIDEO_SOURCE_DVIP +} VideoSourceType; + +typedef enum VbiSourceType { /* The source from which the video processor takes VBI */ + VBI_SOURCE_MEMORY = 1, + VBI_SOURCE_DVIP +} VbiSourceType; + +/* GENLOCK DEFINITIONS */ + +#define GENLOCK_SINGLE 0x001 +#define GENLOCK_FIELD_SYNC 0x001 +#define GENLOCK_CONTINUOUS 0x002 +#define GENLOCK_SYNCED_EDGE_FALLING 0x004 +#define GENLOCK_SYNCING_EDGE_FALLING 0x008 +#define GENLOCK_TIMEOUT 0x010 +#define GENLOCK_TVENC_RESET_EVEN_FIELD 0x020 +#define GENLOCK_TVENC_RESET_BEFORE_DELAY 0x040 +#define GENLOCK_TVENC_RESET 0x080 +#define GENLOCK_SYNC_TO_TVENC 0x100 + +/* VIP DEFINITIONS */ + +#define VIP_MODE_C 0x1 + +#define VIP_CAPTURE_STOP_LINE 0x1 +#define VIP_CAPTURE_STOP_FIELD 0x2 +#define VIP_CAPTURE_START_FIELD 0x4 + +#define VBI_ANCILLARY 0x1 +#define VBI_TASK_A 0x2 +#define VBI_TASK_B 0x4 + +/* VGA STRUCTURE */ + +#define GFX_STD_CRTC_REGS 25 +#define GFX_EXT_CRTC_REGS 16 + +#define GFX_VGA_FLAG_MISC_OUTPUT 0x00000001 +#define GFX_VGA_FLAG_STD_CRTC 0x00000002 +#define GFX_VGA_FLAG_EXT_CRTC 0x00000004 + +/* FS450 TV Standard flags */ + +#define GFX_TV_STANDARD_NTSC_M 0x0001 +#define GFX_TV_STANDARD_NTSC_M_J 0x0002 +#define GFX_TV_STANDARD_PAL_B 0x0004 +#define GFX_TV_STANDARD_PAL_D 0x0008 +#define GFX_TV_STANDARD_PAL_H 0x0010 +#define GFX_TV_STANDARD_PAL_I 0x0020 +#define GFX_TV_STANDARD_PAL_M 0x0040 +#define GFX_TV_STANDARD_PAL_N 0x0080 +#define GFX_TV_STANDARD_PAL_G 0x0100 + +/* FS450 VGA Mode flags */ + +#define GFX_VGA_MODE_UNKNOWN 0 +#define GFX_VGA_MODE_640X480 0x0001 +#define GFX_VGA_MODE_720X487 0x0002 +#define GFX_VGA_MODE_720X576 0x0004 +#define GFX_VGA_MODE_800X600 0x0008 +#define GFX_VGA_MODE_1024X768 0x0010 + +/* FS450 TVout mode flags */ + +#define GFX_TVOUT_MODE_CVBS 0x0001 +#define GFX_TVOUT_MODE_YC 0x0002 +#define GFX_TVOUT_MODE_RGB 0x0004 +#define GFX_TVOUT_MODE_CVBS_YC (GFX_TVOUT_MODE_CVBS | GFX_TVOUT_MODE_YC) + +/* FS450 Luma and Chroma Filters */ + +#define GFX_LUMA_FILTER 0x0001 +#define GFX_CHROMA_FILTER 0x0002 + +/* APS Trigger Bits */ + +#define GFX_APS_TRIGGER_OFF 0 +#define GFX_APS_TRIGGER_AGC_ONLY 1 +#define GFX_APS_TRIGGER_AGC_2_LINE 2 +#define GFX_APS_TRIGGER_AGC_4_LINE 3 + +typedef struct { + int xsize; + int ysize; + int hz; + int clock; + unsigned char miscOutput; + unsigned char stdCRTCregs[GFX_STD_CRTC_REGS]; + unsigned char extCRTCregs[GFX_EXT_CRTC_REGS]; +} gfx_vga_struct; + +/* POSSIBLE STATUS VALUES */ + +#define GFX_STATUS_UNSUPPORTED (-3) +#define GFX_STATUS_BAD_PARAMETER (-2) +#define GFX_STATUS_ERROR (-1) +#define GFX_STATUS_OK 0 + +/* CPU AND VIDEO TYPES */ + +#define GFX_CPU_GXLV 1 +#define GFX_CPU_SC1200 2 +#define GFX_CPU_REDCLOUD 3 +#define GFX_CPU_PYRAMID 0x20801 + + +#define GFX_VID_CS5530 1 +#define GFX_VID_SC1200 2 +#define GFX_VID_REDCLOUD 3 + +/* CHIP NAME AND REVISION */ + +typedef enum ChipType { + CHIP_NOT_DETECTED, + SC1200_REV_A, + SC1200_REV_B1_B2, + SC1200_REV_B3, + SC1200_REV_C1, + SC1200_REV_D1, + SC1200_REV_D1_1, + SC1200_REV_D2_MVD, /* Macrovision disabled */ + SC1200_REV_D2_MVE, /* Macrovision enabled */ + SC1200_FUTURE_REV +} ChipType; + +#endif /* !_gfx_type_h */ diff --git a/Source/DirectFB/gfxdrivers/nsc/include/nsc_galproto.h b/Source/DirectFB/gfxdrivers/nsc/include/nsc_galproto.h new file mode 100755 index 0000000..67266cc --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/include/nsc_galproto.h @@ -0,0 +1,1987 @@ +/* + * $Workfile: nsc_galproto.h $ + * $Revision: 1.3 $ + * + * File Contents: This file contains the main functions of the Geode + * frame buffer device drivers GAL function prototypes and + * data structures. + * + * Project: Geode Frame buffer device driver + * + */ + +/* NSC_LIC_ALTERNATIVE_PREAMBLE + * + * Revision 1.0 + * + * National Semiconductor Alternative GPL-BSD License + * + * National Semiconductor Corporation licenses this software + * ("Software"): + * + * National Xfree frame buffer driver + * + * under one of the two following licenses, depending on how the + * Software is received by the Licensee. + * + * If this Software is received as part of the Linux Framebuffer or + * other GPL licensed software, then the GPL license designated + * NSC_LIC_GPL applies to this Software; in all other circumstances + * then the BSD-style license designated NSC_LIC_BSD shall apply. + * + * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ + +/* NSC_LIC_BSD + * + * National Semiconductor Corporation Open Source License for + * + * National Xfree frame buffer driver + * + * (BSD License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * * Neither the name of the National Semiconductor Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * END_NSC_LIC_BSD */ + +/* NSC_LIC_GPL + * + * National Semiconductor Corporation Gnu General Public License for + * + * National Xfree frame buffer driver + * + * (GPL License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted under the terms of the GNU General + * Public License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version + * + * In addition to the terms of the GNU General Public License, neither + * the name of the National Semiconductor Corporation nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. See the GNU General Public License for more details. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * You should have received a copy of the GNU General Public License + * along with this file; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * END_NSC_LIC_GPL */ + +#ifndef __GALPROTO_SEP_20_2000 +#define __GALPROTO_SEP_20_2000 + +/* durango reg definitions and type's */ +#include <gfx_type.h> +#include <gfx_regs.h> + +/* Panel related definition */ +#include <pnl_defs.h> + +typedef int SWORD; +typedef unsigned int DWORD; +typedef unsigned short WORD; +typedef unsigned char CHAR; +typedef unsigned char BOOLEAN; +typedef unsigned int *PDWORD; + +/***************************************/ +/* Applications/User mode drivers use this ioctl to + * send a graphics device request to the frame buffer + * driver + */ +#define FBIOGAL_API 0x4700 + +/* + * Applications must sign the I/O packet with this value + */ + +#define FBGAL_SIGNATURE 0xC0C0BABE + +/* + * Version is a 16:16 fixed value + * Current version is 1.0000 + */ + +#define FBGAL_VERSION 0x10000 + +/* + * Definitions for Graphics Subfunctions + * + */ + +typedef enum GALFN_CODES +{ +/* General Adapter level functions */ + GALFN_GETADAPTERINFO = 0, + GALFN_SETSOFTVGASTATE, + GALFN_GETSOFTVGASTATE, + GALFN_WAITUNTILIDLE, + GALFN_WAITVERTICALBLANK, + GALFN_SETCRTENABLE, + GALFN_WRITEREG, + GALFN_READREG, + +/* Change/Get Display hardware state */ + + GALFN_ISDISPLAYMODESUPPORTED, + GALFN_SETDISPLAYMODE, + GALFN_GETDISPLAYMODE, + GALFN_SETBPP, + GALFN_SETDISPLAYBPP, + GALFN_GETDISPLAYBPP, + GALFN_SETDISPLAYPITCH, + GALFN_GETDISPLAYPITCH, + GALFN_SETDISPLAYOFFSET, + GALFN_GETDISPLAYOFFSET, + GALFN_DOTCLKTOREFRESH, + GALFN_GETDISPLAYTIMINGS, + GALFN_SETDISPLAYTIMINGS, + GALFN_SETPALETTE, + GALFN_GETPALETTE, + GALFN_SETPALETTE_ENTRY, + GALFN_GETPALETTE_ENTRY, + GALFN_SETFIXEDTIMINGS, + +/* Hardware cursor funtions */ + + GALFN_SETCURSORENABLE, + GALFN_GETCURSORENABLE, + GALFN_SETCURSORPOSITION, + GALFN_GETCURSORPOSITION, + GALFN_SETCURSORCOLORS, + GALFN_GETCURSORCOLORS, + GALFN_SETCURSORSHAPE, + GALFN_SETCURSORSHAPE_RCLD, + +/* grafix rendering funtions */ + GALFN_SETSOLIDPATTERN, + GALFN_SETRASTEROPERATION, + GALFN_SETSOLIDSOURCE, + GALFN_PATTERNFILL, + GALFN_SETMONOSOURCE, + GALFN_SETMONOPATTERN, + GALFN_SCREENTOSCREENBLT, + GALFN_SCREENTOSCREENXBLT, + GALFN_BRESENHAMLINE, + GALFN_COLOR_PATTERNFILL, + GALFN_COLOR_BITMAP_TO_SCREEN_BLT, + GALFN_COLOR_BITMAP_TO_SCREEN_XBLT, + GALFN_MONO_BITMAP_TO_SCREEN_BLT, + GALFN_TEXT_BLT, + +/* VGA Support functions */ + + GALFN_VGAMODESWITCH, + GALFN_VGACLEARCRTEXT, + GALFN_VGASETPITCH, + GALFN_VGARESTORE, + GALFN_VGASAVE, + GALFN_VGASETMODE, + +/* Compression functions */ + GALFN_SETCOMPRESSIONSTATE, + GALFN_GETCOMPRESSIONSTATE, + GALFN_SETCOMPRESSIONPARAMS, + GALFN_GETCOMPRESSIONPARAMS, + +/* Panel Support functions */ + + GALFN_PNLSETPARAMS, + GALFN_PNLGETPARAMS, + GALFN_PNLINITPANEL, + GALFN_PNLSAVESTATE, + GALFN_PNLRESTORESTATE, + GALFN_PNLPOWERUP, + GALFN_PNLPOWERDOWN, + GALFN_PNLBIOSENABLE, + GALFN_PNLBIOSINFO, + GALFN_ENABLEPANNING, + +/* TV Support functions */ + + GALFN_SETTVPARAMS, + GALFN_GETTVPARAMS, + GALFN_SETTVTIMING, + GALFN_GETTVTIMING, + GALFN_SETENABLE, + GALFN_GETENABLE, + GALFN_ISTVMODESUPPORTED, + +/* Video Support functions */ + + GALFN_SETVIDEOENABLE, + GALFN_SETVIDEOFORMAT, + GALFN_SETVIDEOSIZE, + GALFN_SETVIDEOOFFSET, + GALFN_SETVIDEOWINDOW, + GALFN_SETVIDEOSCALE, + GALFN_SETVIDEOFILTER, + GALFN_SETVIDEOCOLORKEY, + GALFN_SETVIDEODOWNSCALEENABLE, + GALFN_SETVIDEODOWNSCALECONFIG, + GALFN_SETVIDEODOWNSCALECOEFF, + GALFN_SETVIDEOSOURCE, + GALFN_SETVIDEOINTERLACED, + GALFN_SETVIDEOCURSOR, + GALFN_SETVIDEOREQUEST, + GALFN_SETALPHAENABLE, + GALFN_SETALPHAWINDOW, + GALFN_SETALPHAVALUE, + GALFN_SETALPHAPRIORITY, + GALFN_SETALPHACOLOR, + GALFN_SETALPHAREGION, + GALFN_SETVIDEOOUTSIDEALPHA, + GALFN_SETVIDEOPALETTE, + GALFN_GETVIDEOINFO, + GALFN_SETVIDEOCOLORSPACE, + +/* VIP Supported functions */ + + GALFN_SETVIPENABLE, + GALFN_SETVIPCAPTURERUNMODE, + GALFN_SETVIPBASE, + GALFN_SETVIPPITCH, + GALFN_SETVIPMODE, + GALFN_SETVIPBRTH, + GALFN_SETVIPLASTLINE, + GALFN_TESTVIPODDFIELD, + GALFN_TESTVIPBASESUPDATED, + GALFN_SETVBIENABLE, + GALFN_SETVBIMODE, + GALFN_SETVBIBASE, + GALFN_SETVBIPITCH, + GALFN_SETVBIDIRECT, + GALFN_SETVBIINTERRUPT, + GALFN_SETGENLOCKENABLE, + GALFN_SETTOPLINEINODD, + GALFN_SETGENLOCKDELAY, + GALFN_SETMACROVISIONENABLE, + + GALFN_GETVIPENABLE, + GALFN_GETVIPBASE, + GALFN_GETVIPPITCH, + GALFN_GETVIPMODE, + GALFN_GETVIPBRTH, + GALFN_GETVIPLINE, + GALFN_GETVBIENABLE, + GALFN_GETVBIBASE, + GALFN_GETVBIPITCH, + GALFN_GETVBIMODE, + GALFN_GETVBIDIRECT, + GALFN_GETVBIINTERRUPT, + GALFN_TESTVIPFIFOOVERFLOW, + +/* Second generation rendering routines */ + + GALFN_SETICONENABLE, + GALFN_SETICONCOLORS, + GALFN_SETICONPOSITION, + GALFN_SETICONSHAPE64, + + GALFN_SETSOURCESTRIDE, + GALFN_SETDESTINATIONSTRIDE, + GALFN_SETSOURCETRANSPARENCY, + GALFN_SETPATTERNORIGIN, + GALFN_GFX2SETALPHAMODE, + GALFN_GFX2SETALPHAVALUE, + GALFN_GFX2PATTERNFILL, + GALFN_GFX2COLORPATTERNFILL, + GALFN_GFX2SCREENTOSCREENBLT, + GALFN_GFX2MONOEXPANDBLT, + GALFN_GFX2COLORBMPTOSCRBLT, + GALFN_GFX2MONOBMPTOSCRBLT, + GALFN_GFX2TEXTBLT, + GALFN_GFX2BRESENHAMLINE, + GALFN_GFX2SYNCTOVBLANK, + +/* Change/Get Video routines */ + + GALFN_SETCOLORSPACEYUV, + GALFN_SETVIDEOYUVPITCH, + GALFN_SETVIDEOYUVOFFSETS, + GALFN_SETVIDEOLEFTCROP, + GALFN_SETVIDEOVERTICALDOWNSCALE, + GALFN_SETVBISOURCE, + GALFN_SETVBILINES, + GALFN_SETVBITOTAL, + GALFN_SETVSCALEROFFSET, + + GALFN_GETVBISOURCE, + GALFN_GETVBILINES, + GALFN_GETVBITOTAL, + GALFN_GETVSCALEROFFSET, + GALFN_GETVIDEOINTERLACED, + GALFN_GETCOLORSPACEYUV, + GALFN_GETGENLOCKENABLE, + GALFN_GETGENLOCKDELAY, + GALFN_GETVIDEOCURSOR, + GALFN_READCRC, + GALFN_READWINDOWCRC, + GALFN_GETMACROVISIONENABLE, + GALFN_GETALPHAENABLE, + GALFN_GETALPHASIZE, + GALFN_GETALPHAVALUE, + GALFN_GETALPHAPRIORITY, + GALFN_GETALPHACOLOR, + GALFN_GETVIDEOYUVPITCH, + GALFN_GETVIDEOYUVOFFSETS, + +/* Additional VGA Support functions */ + + GALFN_VGATESTPCI, + GALFN_VGAGETPCICOMMAND, + GALFN_VGASEQRESET, + GALFN_VGASETGRAPHICSBITS, + +/* This is last function supported. + * If you want to define ioctl function. + * You should define before this function. + * Update that the lastfunction supported to new value. + */ + GALFN_LASTFUNCTION_SUPPORTED +} +GALFN_CODES; + +/* end of GAL function list */ + +#define GAL_HEADER\ + DWORD dwSignature; /* Sign all structs with FBGAL_SIGNATURE */\ + DWORD dwSize; /* Size of struct for that subfunction */\ + DWORD dwVersion; /* Current version of the API */\ + DWORD dwSubfunction; /* GAL subfunction */\ + DWORD dwReturnValue; /* Return value from subfunction */ + +/* + * #define GALFN_PNLPOWERUP + * #define GALFN_PNLPOWERDOWN + */ +typedef struct __GAL_BASE +{ +GAL_HEADER} +GAL_BASE, *PGAL_BASE; + +/* + * #define GALFN_GETADAPTERINFO + */ +typedef struct __GAL_GETADAPTERINFO +{ + GAL_HEADER DWORD dwCPUVersion; + DWORD dwCPUType; + DWORD dwFrameBufferBase; + DWORD dwFrameBufferSize; + DWORD dwGfxRegisterBase; + DWORD dwGpsRegisterBase; + DWORD dwVidRegisterBase; + DWORD dwVipRegisterBase; + DWORD dwVideoVersion; + DWORD dwMaxSupportedPixelClock; + +} +GAL_ADAPTERINFO, *PGAL_ADAPTERINFO; + +#define GAL_SOFTVGASTATE_ENABLE 1 +#define GAL_SOFTVGASTATE_DISABLE 0 +/* + * #define GALFN_SOFTVGASTATE + */ +typedef struct __GAL_SOFTVGASTATE +{ + GAL_HEADER BOOLEAN bSoftVgaEnable; + +} +GAL_SOFTVGASTATE, *PGAL_SOFTVGASTATE; + +/* + * #define GALFN_WAITUNTILIDLE + */ +typedef struct __GAL_WAITUNTILIDLE +{ +GAL_HEADER} +GAL_WAITUNTILIDLE, *PGAL_WAITUNTILIDLE; + +/* + * #define GALFN_WAITVERTICALBLANK + */ +typedef struct __GAL_WAITVERTICALBLANK +{ +GAL_HEADER} +GAL_WAITVERTICALBLANK, *PGAL_WAITVERTICALBLANK; + +#define GAL_REG 0x1 +#define GAL_VID 0x2 +#define GAL_VIP 0x4 +/* + * #define GALFN_WRITEREG + * #define GALFN_READREG + */ +typedef struct __GAL_HWACCESS +{ + GAL_HEADER DWORD dwType; + DWORD dwOffset; + DWORD dwValue; + DWORD dwByteCount; + +} +GAL_HWACCESS, *PGAL_HWACCESS; + +/* + * #define GALFN_ISDISPLAYMODESUPPORTED + * #define GALFN_SETDISPLAYMODE + * #define GALFN_GETDISPLAYMODE + */ +typedef struct __GAL_DISPLAYMODE +{ + GAL_HEADER WORD wXres; + WORD wYres; + WORD wBpp; + WORD wRefresh; + DWORD dwSupported; + +} +GAL_DISPLAYMODE, *PGAL_DISPLAYMODE; + +/* + * #define GALFN_SETBPP + * #define GALFN_GETBPP + * #define GALFN_SETPITCH + * #define GALFN_GETPITCH + * #define GALFN_SETOFFSET + * #define GALFN_GETOFFSET + */ +typedef struct __GAL_DISPLAYPARAMS +{ + GAL_HEADER DWORD dwOffset; + WORD wBpp; + WORD wPitch; + +} +GAL_DISPLAYPARAMS, *PGAL_DISPLAYPARAMS; + +/* + * #define GALFN_DOTCLKTOREFRESH + */ +typedef struct __GAL_DOTCLKTOREFRESH +{ + GAL_HEADER DWORD dwDotClock; + WORD wXres; + WORD wYres; + WORD wBpp; + WORD wRefreshRate; + +} +GAL_DOTCLKTOREFRESH, *PGAL_DOTCLKTOREFRESH; + +/* + * #define GALFN_GETDISPLAYTIMINGS + * #define GALFN_SETDISPLAYTIMINGS + */ +typedef struct __GAL_DISPLAYTIMING +{ + GAL_HEADER DWORD dwDotClock; + WORD wPitch; + WORD wBpp; + WORD wHTotal; + WORD wHActive; + WORD wHSyncStart; + WORD wHSyncEnd; + WORD wHBlankStart; + WORD wHBlankEnd; + WORD wVTotal; + WORD wVActive; + WORD wVSyncStart; + WORD wVSyncEnd; + WORD wVBlankStart; + WORD wVBlankEnd; + WORD wPolarity; + +} +GAL_DISPLAYTIMING, *PGAL_DISPLAYTIMING; + +/* + * #define GALFN_SETPALETTE_ENTRY + * #define GALFN_GETPALETTE_ENTRY + */ +typedef struct __GAL_PALETTE_ENTRY +{ + GAL_HEADER DWORD dwIndex; + DWORD dwPalette; +} +GAL_PALETTE_ENTRY, *PGAL_PALETTE_ENTRY; + +/* + * #define GALFN_SETPALETTE + * #define GALFN_GETPALETTE + */ +typedef struct __GAL_PALETTE +{ + GAL_HEADER DWORD dwColors[256]; +} +GAL_PALETTE, *PGAL_PALETTE; + +/* + * #define GALFN_COMPRESSIONSTATE + */ +typedef struct __GAL_COMPRESSIONSTATE +{ + GAL_HEADER BOOLEAN bCompressionState; +} +GAL_COMPRESSIONSTATE, *PGAL_COMPRESSIONSTATE; + +#define GAL_COMPRESSION_ENABLE 1 +#define GAL_COMPRESSION_DISABLE 0 + +#define GAL_COMPRESSION_OFFSET 1 +#define GAL_COMPRESSION_PITCH 2 +#define GAL_COMPRESSION_SIZE 4 +#define GAL_COMPRESSION_ALL 7 + +/* + * #define GALFN_COMPRESSIONPARAMS + */ +typedef struct __GAL_COMPRESSIONPARAMS +{ + GAL_HEADER DWORD dwFlags; + DWORD dwCompOffset; + WORD dwCompPitch; + WORD dwCompSize; +} +GAL_COMPRESSIONPARAMS, *PGAL_COMPRESSIONPARAMS; + +#define GAL_SETCURSORENABLE_ENABLE 1 +#define GAL_SETCURSORENABLE_DISABLE 0 +/* + * #define GALFN_CURSORENABLE + */ +typedef struct __GAL_CURSORENABLE +{ + GAL_HEADER BOOLEAN bCursorEnable; +} +GAL_CURSORENABLE, *PGAL_CURSORENABLE; + +/* + * #define GALFN_CURSORPOSITION + */ +typedef struct __GAL_CURSORPOSITION +{ + GAL_HEADER DWORD dwMemOffset; + WORD wXPos; + WORD wYPos; + WORD wXHot; + WORD wYHot; +} +GAL_CURSORPOSITION, *PGAL_CURSORPOSITION; + +/* + * #define GALFN_SETCURSORSHAPE + */ +typedef struct __GAL_SETCURSORSHAPE +{ + GAL_HEADER DWORD dwMemOffset; + DWORD dwAndMask[32]; /* Most gfx hardware support only 32x32 */ + DWORD dwXorMask[32]; +} +GAL_SETCURSORSHAPE, *PGAL_SETCURSORSHAPE; + +/* + * #define GALFN_SETCURSORCOLORS + */ +typedef struct __GAL_CURSORCOLORS +{ + GAL_HEADER DWORD dwBgColor; + DWORD dwFgColor; +} +GAL_CURSORCOLORS, *PGAL_CURSORCOLORS; + +/* + * #define GALFN_SETSOLIDPATTERN + */ +typedef struct __GAL_SETSOLIDPATTERN +{ + GAL_HEADER DWORD dwColor; +} +GAL_SETSOLIDPATTERN, *PGAL_SETSOLIDPATTERN; + +/* + * #define GALFN_SETRASTEROPERATION + */ +typedef struct __GAL_SETRASTEROPERATION +{ + GAL_HEADER CHAR cRop; +} +GAL_RASTEROPERATION, *PGAL_RASTEROPERATION; + +/* + * #define GALFN_SETSOLIDSOURCE + */ +typedef struct __GAL_SETSOLIDSOURCE +{ + GAL_HEADER DWORD dwColor; +} +GAL_SETSOLIDSOURCE, *PGAL_SETSOLIDSOURCE; + +/* + * #define GALFN_PATTERNFILL + */ +typedef struct __GAL_PATTERNFILL +{ + GAL_HEADER WORD wXPos; + WORD wYPos; + WORD wWidth; + WORD wHeight; +} +GAL_PATTERNFILL, *PGAL_PATTERNFILL; + +/* + * #define GALFN_SETMONOSOURCE + */ +typedef struct __GAL_SETMONOSOURCE +{ + GAL_HEADER DWORD dwBgColor; + DWORD dwFgColor; + CHAR cTransparency; +} +GAL_SETMONOSOURCE, *PGAL_SETMONOSOURCE; + +/* + * #define GALFN_SETMONOPATTERN + */ +typedef struct __GAL_SETMONOPATTERN +{ + GAL_HEADER DWORD dwBgColor; + DWORD dwFgColor; + DWORD dwData0; + DWORD dwData1; + CHAR cTransparency; +} +GAL_SETMONOPATTERN, *PGAL_SETMONOPATTERN; + +/* + * #define GALFN_SCREENTOSCREENBLT + */ +typedef struct __GAL_SCREENTOSCREENBLT +{ + GAL_HEADER WORD wXStart; + WORD wYStart; + WORD wXEnd; + WORD wYEnd; + WORD wWidth; + WORD wHeight; +} +GAL_SCREENTOSCREENBLT, *PGAL_SCREENTOSCREENBLT; + +/* + * #define GALFN_SCREENTOSCREENXBLT + */ +typedef struct __GAL_SCREENTOSCREENXBLT +{ + GAL_HEADER WORD wXStart; + WORD wYStart; + WORD wXEnd; + WORD wYEnd; + WORD wWidth; + WORD wHeight; + DWORD dwColor; +} +GAL_SCREENTOSCREENXBLT, *PGAL_SCREENTOSCREENXBLT; + +/* + * #define GALFN_BRESENHAMLINE + */ +typedef struct __GAL_BRESENHAMLINE +{ + GAL_HEADER WORD wX1; + WORD wY1; + WORD wLength; + WORD wErr; + WORD wE1; + WORD wE2; + WORD wFlags; +} +GAL_BRESENHAMLINE, *PGAL_BRESENHAMLINE; + +/* + * #define GALFN_COLOR_PATTERNFILL + */ +typedef struct __GAL_COLOR_PATTERNFILL +{ + GAL_HEADER WORD wDsty; + WORD wDstx; + WORD wWidth; + WORD wHeight; + DWORD dwPattern; +} +GAL_COLOR_PATTERNFILL, *PGAL_COLOR_PATTERNFILL; + +/* + * #define GALFN_COLOR_BITMAP_TO_SCREEN_BLT + */ +typedef struct __GAL_COLOR_BITMAP_TO_SCREEN_BLT +{ + GAL_HEADER WORD wSrcx; + WORD wSrcy; + WORD wDstx; + WORD wDsty; + WORD wWidth; + WORD wHeight; + DWORD dwData; + WORD wPitch; +} +GAL_COLOR_BITMAP_TO_SCREEN_BLT, *PGAL_COLOR_BITMAP_TO_SCREEN_BLT; + +/* + * #define GALFN_COLOR_BITMAP_TO_SCREEN_XBLT + */ +typedef struct __GAL_COLOR_BITMAP_TO_SCREEN_XBLT +{ + GAL_HEADER WORD wSrcx; + WORD wSrcy; + WORD wDstx; + WORD wDsty; + WORD wWidth; + WORD wHeight; + DWORD dwData; + WORD wPitch; + DWORD dwColor; +} +GAL_COLOR_BITMAP_TO_SCREEN_XBLT, *PGAL_COLOR_BITMAP_TO_SCREEN_XBLT; + +/* + * #define GALFN_MONO_BITMAP_TO_SCREEN_BLT + */ +typedef struct __GAL_MONO_BITMAP_TO_SCREEN_BLT +{ + GAL_HEADER WORD wSrcx; + WORD wSrcy; + WORD wDstx; + WORD wDsty; + WORD wWidth; + WORD wHeight; + DWORD dwData; + WORD wPitch; +} +GAL_MONO_BITMAP_TO_SCREEN_BLT, *PGAL_MONO_BITMAP_TO_SCREEN_BLT; + +/* + * #define GALFN_TEXT_BLT + */ +typedef struct __GAL_TEXT_BLT +{ + GAL_HEADER WORD wDstx; + WORD wDsty; + WORD wWidth; + WORD wHeight; + DWORD dwData; +} +GAL_TEXT_BLT, *PGAL_TEXT_BLT; + + /* + * * #define GALFN_VGAMODESWITCH + * * #define GALFN_VGACLEARCRTEXT + * * #define GALFN_VGASETPITCH + * * #define GALFN_VGARESTORE + * * #define GALFN_VGASAVE + * * #define GALFN_VGASETMODE + */ + +typedef struct __GAL_VGAREGS +{ + int xsize; + int ysize; + int hz; + int clock; + unsigned char miscOutput; + unsigned char stdCRTCregs[GFX_STD_CRTC_REGS]; + unsigned char extCRTCregs[GFX_EXT_CRTC_REGS]; +} +GAL_VGAREGS, *PGAL_VGAREGS; + +typedef struct __GAL_VGAMODEDATA +{ + GAL_HEADER DWORD dwFlags; /* Flags for this subfunction */ + GAL_VGAREGS sVgaRegs; /* CRT+SEQ+SEQ register data block */ + WORD wXres; + WORD wYres; + WORD wBpp; + WORD wRefresh; +} +GAL_VGAMODEDATA, *PGAL_VGAMODEDATA; + +typedef struct __GAL_VGATESTPCI +{ + GAL_HEADER SWORD softvga; +} +GAL_VGATESTPCI, *PGAL_VGATESTPCI; + +typedef struct __GAL_VGAGETPCICOMMAND +{ + GAL_HEADER unsigned char value; +} +GAL_VGAGETPCICOMMAND, *PGAL_VGAGETPCICOMMAND; + +typedef struct __GAL_VGASEQRESET +{ + GAL_HEADER SWORD reset; + SWORD statusok; +} +GAL_VGASEQRESET, *PGAL_VGASEQRESET; + +typedef struct __GAL_VGASETGRAPHICSBITS +{ + GAL_HEADER SWORD statusok; +} +GAL_VGASETGRAPHICSBITS, *PGAL_VGASETGRAPHICSBITS; + +/******** Panel Support functions *********************/ +/* +* #define GALFN_PNLSETPARAMS +* #define GALFN_PNLGETPARAMS +* #define GALFN_PNLINITPANEL +* #define GALFN_PNLSAVESTATE +* #define GALFN_PNLRESTORESTATE +*/ +typedef struct __GAL_PNLPARAMS +{ + GAL_HEADER Pnl_PanelParams PanelParams; +} +GAL_PNLPARAMS, *PGAL_PNLPARAMS; + +/* +* #define GALFN_PNLBIOSENABLE +* #define GALFN_PNLBIOSINFO +*/ +typedef struct __GAL_PNLBIOS +{ + GAL_HEADER int state; + int XRes; + int YRes; + int Bpp; + int Freq; +} +GAL_PNLBIOS, *PGAL_PNLBIOS; + +typedef struct __GAL_ENABLEPANNING +{ + GAL_HEADER int x; + int y; +} +GAL_ENABLEPANNING, *PGAL_ENABLEPANNING; + +/* + * #define GALFN_SETCRTENABLE + * #define GALFN_GETCRTENABLE + */ +typedef struct __GAL_CRTENABLE +{ + GAL_HEADER WORD wCrtEnable; +} +GAL_CRTENABLE, *PGAL_CRTENABLE; + +#define GAL_TVSTATE 0x01 +#define GAL_TVOUTPUT 0x02 +#define GAL_TVFORMAT 0x04 +#define GAL_TVRESOLUTION 0x08 +#define GAL_TVALL 0x0F +/* + * #define GALFN_SETTVPARAMS + * #define GALFN_GETTVPARAMS + * #define GALFN_SETENABLE + * #define GALFN_GETENABLE + * #define GALFN_ISTVMODESUPPORTED + */ +typedef struct __GAL_TVPARAMS +{ + GAL_HEADER DWORD dwFlags; + WORD wWidth; + WORD wHeight; + WORD wStandard; + WORD wType; + WORD wOutput; + WORD wResolution; + BOOLEAN bState; + +} +GAL_TVPARAMS, *PGAL_TVPARAMS; + +/* + * #define GALFN_SETTVTIMING + * #define GALFN_GETTVTIMING + */ +typedef struct __GAL_TVTIMING +{ + GAL_HEADER DWORD dwFlags; /* not used currently */ + unsigned long HorzTim; + unsigned long HorzSync; + unsigned long VertSync; + unsigned long LineEnd; + unsigned long VertDownscale; + unsigned long HorzScaling; + unsigned long TimCtrl1; + unsigned long TimCtrl2; + unsigned long Subfreq; + unsigned long DispPos; + unsigned long DispSize; + unsigned long Debug; + unsigned long DacCtrl; + unsigned long DotClock; +} +GAL_TVTIMING, *PGAL_TVTIMING; + +/******** Video Support functions *********************/ + +typedef struct __GAL_SETVIDEOENABLE +{ + GAL_HEADER BOOLEAN enable; +} +GAL_VIDEOENABLE, *PGAL_VIDEOENABLE; + +typedef struct __GAL_SETVIDEOFORMAT +{ + GAL_HEADER int format; +} +GAL_VIDEOFORMAT, *PGAL_VIDEOFORMAT; + +typedef struct __GAL_SETVIDEOSIZE +{ + GAL_HEADER unsigned short width; + unsigned short height; +} +GAL_VIDEOSIZE, *PGAL_VIDEOSIZE; + +typedef struct __GAL_SETVIDEOOFFSET +{ + GAL_HEADER unsigned long offset; +} +GAL_VIDEOOFFSET, *PGAL_VIDEOOFFSET; + +typedef struct __GAL_SETVIDEOWINDOW +{ + GAL_HEADER short x; + short y; + short w; + short h; +} +GAL_VIDEOWINDOW, *PGAL_VIDEOWINDOW; + +typedef struct __GAL_SETVIDEOSCALE +{ + GAL_HEADER unsigned short srcw; + unsigned short srch; + unsigned short dstw; + unsigned short dsth; +} +GAL_VIDEOSCALE, *PGAL_VIDEOSCALE; + +typedef struct __GAL_SETVIDEOFILTER +{ + GAL_HEADER int xfilter; + int yfilter; +} +GAL_VIDEOFILTER, *PGAL_VIDEOFILTER; + +typedef struct __GAL_SETVIDEOCOLORKEY +{ + GAL_HEADER unsigned long key; + unsigned long mask; + int bluescreen; +} +GAL_VIDEOCOLORKEY, *PGAL_VIDEOCOLORKEY; + +typedef struct __GAL_SETVIDEODOWNSCALEENABLE +{ + GAL_HEADER int enable; +} +GAL_VIDEODOWNSCALEENABLE, *PGAL_VIDEODOWNSCALEENABLE; + +typedef struct __GAL_SETVIDEODOWNSCALECONFIG +{ + GAL_HEADER unsigned short type; + unsigned short m; +} +GAL_VIDEODOWNSCALECONFIG, *PGAL_VIDEODOWNSCALECONFIG; + +typedef struct __GAL_SETVIDEODOWNSCALECOEFF +{ + GAL_HEADER unsigned short coef1; + unsigned short coef2; + unsigned short coef3; + unsigned short coef4; +} +GAL_VIDEODOWNSCALECOEFF, *PGAL_VIDEODOWNSCALECOEFF; + +#define GAL_VIDEO_SOURCE_MEMORY 0x0 +#define GAL_VIDEO_SOURCE_DVIP 0x1 +typedef struct __GAL_SETVIDEOSOURCE +{ + GAL_HEADER int source; +} +GAL_VIDEOSOURCE, *PGAL_VIDEOSOURCE; + +typedef struct __GAL_SETVIDEOINTERLACED +{ + GAL_HEADER int enable; +} +GAL_SETVIDEOINTERLACED, *PGAL_SETVIDEOINTERLACED; + +typedef struct __GAL_GETVIDEOINTERLACED +{ + GAL_HEADER int interlaced; +} +GAL_GETVIDEOINTERLACED, *PGAL_GETVIDEOINTERLACED; + +typedef struct __GAL_COLORSPACEYUV +{ + GAL_HEADER int colorspace; +} +GAL_COLORSPACEYUV, *PGAL_COLORSPACEYUV; + +typedef struct __GAL_SETGENLOCKENABLE +{ + GAL_HEADER int enable; +} +GAL_GENLOCKENABLE, *PGAL_GENLOCKENABLE; + +typedef struct __GAL_SETGENLOCKDELAY +{ + GAL_HEADER int delay; +} +GAL_GENLOCKDELAY, *PGAL_GENLOCKDELAY; + +typedef struct __GAL_SETTOPLINEINODD +{ + GAL_HEADER int enable; +} +GAL_TOPLINEINODD, *PGAL_TOPLINEINODD; + +typedef struct __GAL_SETVIDEOCURSOR +{ + GAL_HEADER unsigned long key; + unsigned long mask; + unsigned short select_color2; + unsigned long color1; + unsigned long color2; +} +GAL_VIDEOCURSOR, *PGAL_VIDEOCURSOR; + +typedef struct __GAL_READCRC +{ + GAL_HEADER DWORD crc; +} +GAL_READCRC, *PGAL_READCRC; + +typedef struct __GAL_READWINDOWCRC +{ + GAL_HEADER SWORD source; + WORD x; + WORD y; + WORD width; + WORD height; + SWORD crc32; + DWORD crc; +} +GAL_READWINDOWCRC, *PGAL_READWINDOWCRC; + +typedef struct __GAL_GETALPHASIZE +{ + GAL_HEADER WORD * x; + WORD *y; + WORD *width; + WORD *height; +} +GAL_ALPHASIZE, *PGAL_ALPHASIZE; + +typedef struct __GAL_SETMACROVISIONENABLE +{ + GAL_HEADER SWORD enable; +} +GAL_MACROVISIONENABLE, *PGAL_MACROVISIONENABLE; + +typedef struct __GAL_SETVIDEOREQUEST +{ + GAL_HEADER short x; + short y; +} +GAL_VIDEOREQUEST, *PGAL_VIDEOREQUEST; + +typedef struct __GAL_ALPHAENABLE +{ + GAL_HEADER int enable; +} +GAL_ALPHAENABLE, *PGAL_ALPHAENABLE; + +typedef struct __GAL_SETALPHAWINDOW +{ + GAL_HEADER short x; + short y; + unsigned short width; + unsigned short height; +} +GAL_ALPHAWINDOW, *PGAL_ALPHAWINDOW; + +typedef struct __GAL_ALPHAVALUE +{ + GAL_HEADER unsigned char alpha; + char delta; +} +GAL_ALPHAVALUE, *PGAL_ALPHAVALUE; + +typedef struct __GAL_ALPHAPRIORITY +{ + GAL_HEADER int priority; +} +GAL_ALPHAPRIORITY, *PGAL_ALPHAPRIORITY; + +typedef struct __GAL_ALPHACOLOR +{ + GAL_HEADER unsigned long color; +} +GAL_ALPHACOLOR, *PGAL_ALPHACOLOR; + +typedef struct __GAL_SETALPHAREGION +{ + GAL_HEADER int region; +} +GAL_ALPHAREGION, *PGAL_ALPHAREGION; + +typedef struct __GAL_SETVIDEOOUTSIDEALPHA +{ + GAL_HEADER int enable; +} +GAL_VIDEOOUTSIDEALPHA, *PGAL_VIDEOOUTSIDEALPHA; + +typedef struct __GAL_SETVIDEOPALETTE +{ + GAL_HEADER int identity; + unsigned long palette[256]; +} +GAL_VIDEOPALETTE, *PGAL_VIDEOPALETTE; + +typedef struct __GAL_VIDEOINFO +{ + GAL_HEADER int enable; + int format; + int filter; + + unsigned long src_size; + unsigned long dst_size; + unsigned long line_size; + unsigned long xclip; + unsigned long offset; + unsigned long scale; + unsigned long position; + + int color_key_src; + unsigned long color_key; + unsigned long color_key_mask; + + int downscale_enable; + + unsigned short downscale_type; + + unsigned short downscale_mask; + unsigned short downscale_coef1; + unsigned short downscale_coef2; + unsigned short downscale_coef3; + unsigned short downscale_coef4; +} +GAL_VIDEOINFO, *PGAL_VIDEOINFO; + +/* ICON related data strucures */ +typedef struct __GAL_SETICONENABLE +{ + GAL_HEADER SWORD enable; +} +GAL_ICONENABLE, *PGAL_ICONENABLE; + +typedef struct __GAL_SETICONCOLORS +{ + GAL_HEADER DWORD color0; + DWORD color1; + DWORD color2; +} +GAL_ICONCOLORS, *PGAL_ICONCOLORS; + +typedef struct __GAL_SETICONPOSITION +{ + GAL_HEADER DWORD memoffset; + WORD xpos; +} +GAL_ICONPOSITION, *PGAL_ICONPOSITION; + +typedef struct __GAL_SETICONSHAPE64 +{ + GAL_HEADER DWORD memoffset; + DWORD *andmask; + DWORD *xormask; + DWORD lines; +} +GAL_ICONSHAPE64, *PGAL_ICONSHAPE64; + +/* VIP related data strucures */ + +typedef struct __GAL_SETVIPENABLE +{ + GAL_HEADER SWORD enable; +} +GAL_VIPENABLE, *PGAL_VIPENABLE; + +typedef struct __GAL_SETVIPCAPTURERUNMODE +{ + GAL_HEADER SWORD mode; +} +GAL_VIPCAPTURERUNMODE, *PGAL_VIPCAPTURERUNMODE; + +typedef struct __GAL_SETVIPBASE +{ + GAL_HEADER DWORD even; + DWORD odd; + DWORD address; +} +GAL_VIPBASE, *PGAL_VIPBASE; + +typedef struct __GAL_SETVIPPITCH +{ + GAL_HEADER DWORD pitch; +} +GAL_VIPPITCH, *PGAL_VIPPITCH; + +typedef struct __GAL_SETVIPMODE +{ + GAL_HEADER SWORD mode; +} +GAL_VIPMODE, *PGAL_VIPMODE; + +typedef struct __GAL_SETVIPBUS_RTH +{ + GAL_HEADER SWORD enable; +} +GAL_VIPBUS_RTH, *PGAL_VIPBUS_RTH; + +typedef struct __GAL_SETVIPLASTLINE +{ + GAL_HEADER SWORD last_line; +} +GAL_VIPLASTLINE, *PGAL_VIPLASTLINE; + +typedef struct __GAL_TESTVIPODDFIELD +{ + GAL_HEADER SWORD status; +} +GAL_TESTVIPODDFIELD, *PGAL_TESTVIPODDFIELD; + +typedef struct __GAL_TESTVIPBASESUPDATED +{ + GAL_HEADER SWORD status; +} +GAL_TESTVIPBASESUPDATED, *PGAL_TESTVIPBASESUPDATED; + +typedef struct __GAL_TESTVIPFIFOOVERFLOW +{ + GAL_HEADER SWORD status; +} +GAL_TESTVIPOVERFLOW, *PGAL_TESTVIPOVERFLOW; + +typedef struct __GAL_GETVIPLINE +{ + GAL_HEADER SWORD status; +} +GAL_VIPLINE, *PGAL_VIPLINE; + +/* VBI related data strucures */ + +typedef struct __GAL_VBIENABLE +{ + GAL_HEADER SWORD enable; +} +GAL_VBIENABLE, *PGAL_VBIENABLE; + +typedef struct __GAL_VBIBASE +{ + GAL_HEADER DWORD even; + DWORD odd; + DWORD address; +} +GAL_VBIBASE, *PGAL_VBIBASE; + +typedef struct __GAL_VBIPITCH +{ + GAL_HEADER DWORD pitch; +} +GAL_VBIPITCH, *PGAL_VBIPITCH; + +typedef struct __GAL_VBIMODE +{ + GAL_HEADER SWORD mode; +} +GAL_VBIMODE, *PGAL_VBIMODE; + +typedef struct __GAL_SETVBIDIRECT +{ + GAL_HEADER DWORD even_lines; + DWORD odd_lines; +} +GAL_SETVBIDIRECT, *PGAL_SETVBIDIRECT; + +typedef struct __GAL_GETVBIDIRECT +{ + GAL_HEADER SWORD odd; + DWORD direct_lines; +} +GAL_GETVBIDIRECT, *PGAL_GETVBIDIRECT; + +typedef struct __GAL_VBIINTERRUPT +{ + GAL_HEADER SWORD enable; +} +GAL_VBIINTERRUPT, *PGAL_VBIINTERRUPT; + +/* Second generation rendering routines data structures */ + +typedef struct __GAL_SETSTRIDE +{ + GAL_HEADER WORD stride; +} +GAL_STRIDE, *PGAL_STRIDE; + +typedef struct __GAL_SETPATTERNORIGIN +{ + GAL_HEADER int x; + int y; +} +GAL_PATTERNORIGIN, *PGAL_PATTERNORIGIN; + +typedef struct __GAL_SETSOURCETRANSPARENCY +{ + GAL_HEADER DWORD color; + DWORD mask; +} +GAL_SOURCETRANSPARENCY, *PGAL_SOURCETRANSPARENCY; + +typedef struct __GAL_GFX2SETALPHAMODE +{ + GAL_HEADER SWORD mode; +} +GAL_GFX2ALPHAMODE, *PGAL_GFX2ALPHAMODE; + +typedef struct __GAL_GFX2SETALPHAVALUE +{ + GAL_HEADER CHAR value; +} +GAL_GFX2ALPHAVALUE, *PGAL_GFX2ALPHAVALUE; + +typedef struct __GAL_GFX2PATTERNFILL +{ + GAL_HEADER DWORD dstoffset; + WORD width; + WORD height; +} +GAL_GFX2PATTERNFILL, *PGAL_GFX2PATTERNFILL; + +typedef struct __GAL_GFX2COLORPATTERNFILL +{ + GAL_HEADER DWORD dstoffset; + WORD width; + WORD height; + DWORD pattern; +} +GAL_GFX2COLORPATTERNFILL, *PGAL_GFX2COLORPATTERNFILL; + +typedef struct __GAL_GFX2SCREENTOSCREENBLT +{ + GAL_HEADER DWORD srcoffset; + DWORD dstoffset; + WORD width; + WORD height; + SWORD flags; +} +GAL_GFX2SCREENTOSCREENBLT, *PGAL_GFX2SCREENTOSCREENBLT; + +typedef struct __GAL_GFX2MONOEXPANDBLT +{ + GAL_HEADER unsigned long srcbase; + WORD srcx; + WORD srcy; + DWORD dstoffset; + WORD width; + WORD height; + WORD byte_packed; +} +GAL_GFX2MONOEXPANDBLT, *PGAL_GFX2MONOEXPANDBLT; + +typedef struct __GAL_GFX2COLORBMPTOSCRBLT +{ + GAL_HEADER WORD srcx; + WORD srcy; + DWORD dstoffset; + WORD width; + WORD height; + DWORD data; + WORD pitch; +} +GAL_GFX2COLORBMPTOSCRBLT, *PGAL_GFX2COLORBMPTOSCRBLT; + +typedef struct __GAL_GFX2MONOBMPTOSCRBLT +{ + GAL_HEADER WORD srcbase; + WORD srcx; + WORD srcy; + DWORD dstoffset; + WORD width; + WORD height; + DWORD data; + WORD pitch; +} +GAL_GFX2MONOBMPTOSCRBLT, *PGAL_GFX2MONOBMPTOSCRBLT; + +typedef struct __GAL_GFX2TEXTBLT +{ + GAL_HEADER DWORD dstoffset; + WORD width; + WORD height; + DWORD data; +} +GAL_GFX2TEXTBLT, *PGAL_GFX2TEXTBLT; + +typedef struct __GAL_GFX2BRESENHAMLINE +{ + GAL_HEADER DWORD dstoffset; + WORD length; + WORD initerr; + WORD axialerr; + WORD diagerr; + WORD flags; +} +GAL_GFX2BRESENHAMLINE, *PGAL_GFX2BRESENHAMLINE; + +typedef struct __GAL_GFX2SYNCTOVBLANK +{ +GAL_HEADER} +GAL_GFX2SYNCTOVBLANK, *PGAL_GFX2SYNCTOVBLANK; + +/* + GALFN_SETVIDEOYUVPITCH + */ +typedef struct _GAL_SETVIDEOYUVPITCH +{ + GAL_HEADER unsigned long y_pitch; + unsigned long uv_pitch; +} +GAL_VIDEOYUVPITCH, *PGAL_VIDEOYUVPITCH; + +/* + GALFN_SETVIDEOYUVOFFSETS +*/ +typedef struct _GAL_VIDEOYUVOFFSETS +{ + GAL_HEADER unsigned long dwYoffset; + unsigned long dwUoffset; + unsigned long dwVoffset; +} +GAL_VIDEOYUVOFFSETS, *PGAL_VIDEOYUVOFFSETS; + +typedef struct __GAL_SETVIDEOLEFTCROP +{ + GAL_HEADER WORD x; + SWORD status; +} +GAL_VIDEOLEFTCROP, *PGAL_VIDEOLEFTCROP; + +typedef struct __GAL_SETVIDEOVERTICALDOWNSCALE +{ + GAL_HEADER WORD srch; + WORD dsth; + SWORD status; +} +GAL_VIDEOVERTICALDOWNSCALE, *PGAL_VIDEOVERTICALDOWNSCALE; + +typedef struct __GAL_VBISOURCE +{ + GAL_HEADER VideoSourceType source; + SWORD status; +} +GAL_VBISOURCE, *PGAL_VBISOURCE; + +typedef struct __GAL_VBILINES +{ + GAL_HEADER DWORD even; + DWORD odd; + SWORD status; + DWORD lines; +} +GAL_VBILINES, *PGAL_VBILINES; + +typedef struct __GAL_VBITOTAL +{ + GAL_HEADER DWORD even; + DWORD odd; + SWORD status; + DWORD total; +} +GAL_VBITOTAL, *PGAL_VBITOTAL; + +typedef struct __GAL_VSCALEROFFSET +{ + GAL_HEADER char offset; + SWORD status; +} +GAL_VSCALEROFFSET, *PGAL_VSCALEROFFSET; + +/* MSR data strucures */ + +typedef struct __GAL_IDMSRDEVICE +{ + GAL_HEADER MSR * pDev; + DWORD address; + DEV_STATUS dev_status; +} +GAL_IDMSRDEVICE, *PGAL_IDMSRDEVICE; + +typedef struct __GAL_GETMSRDEVADDRESS +{ + GAL_HEADER WORD device; + unsigned long address; + DEV_STATUS dev_status; +} +GAL_GETMSRDEVADDRESS, *PGAL_GETMSRDEVADDRESS; + +typedef struct __GAL_GETMBUSIDATADDRESS +{ + GAL_HEADER unsigned int device; + unsigned long address; + DEV_STATUS dev_status; +} +GAL_GETMBUSIDATADDRESS, *PGAL_GETMBUSIDATADDRESS; + +/* Gal device function's prototye declarations */ + +/** Init **********************************************************/ +BOOLEAN Gal_initialize_interface(void); +BOOLEAN Gal_cleanup_interface(void); +BOOLEAN Gal_get_adapter_info(PGAL_ADAPTERINFO pAdapterInfo); +BOOLEAN Gal_set_softvga_state(BOOLEAN); +BOOLEAN Gal_get_softvga_state(int *bState); +BOOLEAN Gal_set_crt_enable(int); +BOOLEAN Gal_wait_until_idle(void); +BOOLEAN Gal_wait_vertical_blank(void); +BOOLEAN Gal_write_register(int type, unsigned long offset, + unsigned long value, int size); + +BOOLEAN Gal_read_register(int type, unsigned long offset, + unsigned long *value, int size); +/** Display Engine ******************************************************/ +BOOLEAN Gal_is_display_mode_supported(int xres, int yres, int bpp, int hz, + int *supported); +BOOLEAN Gal_set_display_mode(int xres, int yres, int bpp, int hz); +BOOLEAN Gal_get_display_mode(int *xres, int *yres, int *bpp, int *hz); +BOOLEAN Gal_set_bpp(unsigned short bpp); +BOOLEAN Gal_set_display_bpp(unsigned short bpp); +BOOLEAN Gal_get_display_bpp(unsigned short *bpp); +BOOLEAN Gal_set_display_pitch(unsigned short pitch); +BOOLEAN Gal_get_display_pitch(unsigned short *pitch); +BOOLEAN Gal_set_display_offset(unsigned long offset); +BOOLEAN Gal_get_display_offset(unsigned long *offset); +BOOLEAN Gal_get_refreshrate_from_dotclock(int xres, int yres, int bpp, + int *hz, unsigned long frequency); +BOOLEAN Gal_get_display_timing(PGAL_DISPLAYTIMING pDisplayTiming); +BOOLEAN Gal_set_display_timing(PGAL_DISPLAYTIMING pDisplayTiming); +BOOLEAN Gal_set_fixed_timings(int pnlXres, int pnlYres, int totXres, + int totYres, int bpp); +BOOLEAN Gal_set_display_palette_entry(unsigned long index, + unsigned long palette); +BOOLEAN Gal_get_display_palette_entry(unsigned long index, + unsigned long *palette); +BOOLEAN Gal_set_display_palette(PGAL_PALETTE); +BOOLEAN Gal_get_display_palette(PGAL_PALETTE); +BOOLEAN Gal_set_cursor_enable(int enable); +BOOLEAN Gal_get_cursor_enable(int *enable); +BOOLEAN Gal_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor); +BOOLEAN Gal_get_cursor_colors(unsigned long *bkcolor, unsigned long *fgcolor); +BOOLEAN Gal_set_cursor_position(unsigned long memoffset, + unsigned short xpos, unsigned short ypos, + unsigned short xhotspot, + unsigned short yhotspot); +BOOLEAN Gal_get_cursor_position(unsigned long *memoffset, + unsigned short *xpos, unsigned short *ypos, + unsigned short *xhotspot, + unsigned short *yhotspot); +BOOLEAN Gal_set_cursor_shape32(unsigned long memoffset, + unsigned long *andmask, + unsigned long *xormask); + +BOOLEAN Gal_set_cursor_shape64(unsigned long memoffset, + unsigned long *andmask, + unsigned long *xormask); + +/** Render ********************************************************/ +BOOLEAN Gal_set_solid_pattern(unsigned long color); + +BOOLEAN Gal_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, + unsigned char transparency); +BOOLEAN Gal_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, + unsigned long data0, unsigned long data1, + unsigned char transparency); + +BOOLEAN Gal_set_raster_operation(unsigned char rop); + +BOOLEAN Gal_pattern_fill(unsigned short x, unsigned short y, + unsigned short width, unsigned short height); + +BOOLEAN Gal_set_solid_source(unsigned long color); + +BOOLEAN Gal_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, + unsigned short dstx, unsigned short dsty, + unsigned short width, unsigned short height); + +BOOLEAN Gal_screen_to_screen_xblt(unsigned short srcx, + unsigned short srcy, + unsigned short dstx, + unsigned short dsty, + unsigned short width, + unsigned short height, unsigned long color); + +BOOLEAN Gal_bresenham_line(unsigned short x, unsigned short y, + unsigned short length, unsigned short initerr, + unsigned short axialerr, unsigned short diagerr, + unsigned short flags); + +BOOLEAN Gal_color_pattern_fill(unsigned short x, unsigned short y, + unsigned short width, unsigned short height, + unsigned long pattern); + +BOOLEAN Gal_color_bitmap_to_screen_blt(unsigned short srcx, + unsigned short srcy, + unsigned short dstx, + unsigned short dsty, + unsigned short width, + unsigned short height, + unsigned long data, long pitch); + +BOOLEAN Gal_color_bitmap_to_screen_xblt(unsigned short srcx, + unsigned short srcy, + unsigned short dstx, + unsigned short dsty, + unsigned short width, + unsigned short height, + unsigned long data, long pitch, + unsigned long color); + +BOOLEAN Gal_mono_bitmap_to_screen_blt(unsigned short srcx, + unsigned short srcy, + unsigned short dstx, + unsigned short dsty, + unsigned short width, + unsigned short height, + unsigned long data, short pitch); + +BOOLEAN Gal_text_blt(unsigned short dstx, unsigned short dsty, + unsigned short width, unsigned short height, + unsigned long data); + +/** Compression*******************************************************/ +BOOLEAN Gal_set_compression_enable(BOOLEAN); +BOOLEAN Gal_get_compression_enable(int *flag); +BOOLEAN Gal_set_compression_parameters(unsigned long flags, + unsigned long offset, + unsigned short pitch, + unsigned short size); +BOOLEAN Gal_get_compression_parameters(unsigned long flags, + unsigned long *offset, + unsigned short *pitch, + unsigned short *size); + +/** VGA **********************************************************/ +BOOLEAN Gal_vga_mode_switch(int active); +BOOLEAN Gal_vga_clear_extended(void); +BOOLEAN Gal_vga_pitch(PGAL_VGAMODEDATA pvregs, unsigned short pitch); +BOOLEAN Gal_vga_restore(PGAL_VGAMODEDATA pvregs); +BOOLEAN Gal_vga_save(PGAL_VGAMODEDATA pvregs); +BOOLEAN Gal_vga_mode(PGAL_VGAMODEDATA pvregs); +BOOLEAN Gal_vga_test_pci(int *softvga); +BOOLEAN Gal_vga_get_pci_command(unsigned char *value); +BOOLEAN Gal_vga_seq_reset(int reset); +BOOLEAN Gal_vga_set_graphics_bits(void); + +/** Panel **********************************************************/ +BOOLEAN Gal_pnl_set_params(unsigned long flags, PPnl_PanelParams pParam); +BOOLEAN Gal_pnl_get_params(unsigned long flags, PPnl_PanelParams pParam); +BOOLEAN Gal_pnl_init(PPnl_PanelParams pParam); +BOOLEAN Gal_pnl_save(void); +BOOLEAN Gal_pnl_restore(void); +BOOLEAN Gal_pnl_powerup(void); +BOOLEAN Gal_pnl_powerdown(void); +BOOLEAN Gal_enable_panning(int x, int y); +BOOLEAN Gal_pnl_enabled_in_bios(int *state); +BOOLEAN Gal_pnl_info_from_bios(int *xres, int *yres, int *bpp, int *hz); + +/** TV **********************************************************/ +BOOLEAN Gal_tv_set_params(unsigned long flags, PGAL_TVPARAMS pTV); +BOOLEAN Gal_tv_get_params(unsigned long flags, PGAL_TVPARAMS pTV); +BOOLEAN Gal_tv_set_timings(unsigned long flags, PGAL_TVTIMING pTV); +BOOLEAN Gal_tv_get_timings(unsigned long flags, PGAL_TVTIMING pTV); +BOOLEAN Gal_set_tv_enable(int bState); +BOOLEAN Gal_get_tv_enable(unsigned int *bState); +BOOLEAN Gal_is_tv_mode_supported(unsigned long flags, PGAL_TVPARAMS pTV, + int *bState); + +/** Video **********************************************************/ +BOOLEAN Gal_set_video_enable(int enable); +BOOLEAN Gal_set_video_format(int format); +BOOLEAN Gal_set_video_size(unsigned short width, unsigned short height); +BOOLEAN Gal_set_video_offset(unsigned long offset); +BOOLEAN Gal_set_video_yuv_offsets(unsigned long yoffset, + unsigned long uoffset, + unsigned long voffset); +BOOLEAN Gal_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch); + +BOOLEAN Gal_set_video_window(short x, short y, short w, short h); +BOOLEAN Gal_set_video_scale(unsigned short srcw, unsigned short srch, + unsigned short dstw, unsigned short dsth); +BOOLEAN Gal_set_video_filter(int xfilter, int yfilter); +BOOLEAN Gal_set_video_color_key(unsigned long key, + unsigned long mask, int bluescreen); +BOOLEAN Gal_set_video_downscale_enable(int enable); +BOOLEAN Gal_set_video_downscale_config(unsigned short type, unsigned short m); +BOOLEAN Gal_set_video_downscale_coefficients(unsigned short coef1, + unsigned short coef2, + unsigned short coef3, + unsigned short coef4); +BOOLEAN Gal_set_video_source(int source); +BOOLEAN Gal_set_video_interlaced(int enable); +BOOLEAN Gal_get_video_interlaced(int *interlaced); +BOOLEAN Gal_set_color_space_YUV(int enable); +BOOLEAN Gal_get_color_space_YUV(int *colorspace); +BOOLEAN Gal_set_video_cursor(unsigned long key, + unsigned long mask, + unsigned short select_color2, + unsigned long color1, unsigned long color2); +BOOLEAN Gal_get_video_cursor(unsigned long *key, + unsigned long *mask, + unsigned short *select_color2, + unsigned long *color1, unsigned long *color2); +BOOLEAN Gal_set_video_request(short x, short y); +BOOLEAN Gal_set_alpha_enable(int enable); +BOOLEAN Gal_get_alpha_enable(int *enable); +BOOLEAN Gal_get_alpha_size(unsigned short *x, unsigned short *y, + unsigned short *width, unsigned short *height); + +BOOLEAN Gal_set_video_request(short x, short y); +BOOLEAN Gal_set_alpha_window(short x, short y, + unsigned short width, unsigned short height); +BOOLEAN Gal_set_alpha_value(unsigned char alpha, char delta); +BOOLEAN Gal_get_alpha_value(unsigned char *alpha, char *delta); +BOOLEAN Gal_set_alpha_priority(int priority); +BOOLEAN Gal_get_alpha_priority(int *priority); +BOOLEAN Gal_set_alpha_color(unsigned long color); +BOOLEAN Gal_get_alpha_color(unsigned long *color); +BOOLEAN Gal_select_alpha_region(int region); +BOOLEAN Gal_set_video_outside_alpha(int enable); +BOOLEAN Gal_set_video_palette(unsigned long *palette); + +/* Icon related prototypes */ + +BOOLEAN Gal_set_icon_enable(int enable); +BOOLEAN Gal_set_icon_colors(unsigned long color0, unsigned long color1, + unsigned long color2); + +BOOLEAN Gal_set_icon_position(unsigned long memoffset, unsigned short xpos); +BOOLEAN Gal_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, + unsigned long *xormask, unsigned int lines); + +/* Icon related prototypes */ + +BOOLEAN Gal_set_vip_enable(int enable); +BOOLEAN Gal_get_vip_enable(int *enable); +BOOLEAN Gal_set_vip_capture_run_mode(int mode); +BOOLEAN Gal_set_vip_base(unsigned long even, unsigned long odd); +BOOLEAN Gal_get_vip_base(unsigned long *address, int odd); +BOOLEAN Gal_set_vip_pitch(unsigned long pitch); +BOOLEAN Gal_get_vip_pitch(unsigned long *pitch); +BOOLEAN Gal_set_vip_mode(int mode); +BOOLEAN Gal_get_vip_mode(int *mode); +BOOLEAN Gal_set_vbi_enable(int enable); +BOOLEAN Gal_get_vbi_enable(int *enable); +BOOLEAN Gal_set_vbi_mode(int mode); +BOOLEAN Gal_get_vbi_mode(int *mode); +BOOLEAN Gal_set_vbi_base(unsigned long even, unsigned long odd); +BOOLEAN Gal_get_vbi_base(unsigned long *address, int odd); +BOOLEAN Gal_set_vbi_pitch(unsigned long pitch); +BOOLEAN Gal_get_vbi_pitch(unsigned long *pitch); +BOOLEAN Gal_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines); +BOOLEAN Gal_get_vbi_direct(int odd, unsigned long *vbi_direct); +BOOLEAN Gal_set_vbi_interrupt(int enable); +BOOLEAN Gal_get_vbi_interrupt(int *enable); +BOOLEAN Gal_set_vip_bus_request_threshold_high(int enable); +BOOLEAN Gal_get_vip_bus_request_threshold_high(int *enable); +BOOLEAN Gal_set_vip_last_line(int last_line); +BOOLEAN Gal_test_vip_odd_field(int *status); +BOOLEAN Gal_test_vip_bases_updated(int *status); +BOOLEAN Gal_test_vip_fifo_overflow(int *status); +BOOLEAN Gal_get_vip_line(int *status); + +/* Second generation rendering routines */ + +BOOLEAN Gal_set_source_stride(unsigned short stride); +BOOLEAN Gal_set_destination_stride(unsigned short stride); +BOOLEAN Gal_set_source_transparency(unsigned long color, unsigned long mask); +BOOLEAN Gal2_set_source_transparency(unsigned long color, unsigned long mask); +BOOLEAN Gal2_set_source_stride(unsigned short stride); +BOOLEAN Gal2_set_destination_stride(unsigned short stride); +BOOLEAN Gal2_set_pattern_origin(int x, int y); +BOOLEAN Gal2_set_alpha_mode(int mode); +BOOLEAN Gal2_set_alpha_value(unsigned char value); +BOOLEAN Gal2_pattern_fill(unsigned long dstoffset, unsigned short width, + unsigned short height); +BOOLEAN Gal2_color_pattern_fill(unsigned long dstoffset, unsigned short width, + unsigned short height, unsigned long pattern); +BOOLEAN Gal2_screen_to_screen_blt(unsigned long srcoffset, + unsigned long dstoffset, + unsigned short width, unsigned short height, + int flags); + +BOOLEAN Gal2_mono_expand_blt(unsigned long srcbase, unsigned short srcx, + unsigned short srcy, unsigned long dstoffset, + unsigned short width, unsigned short height, + int byte_packed); + +BOOLEAN Gal2_color_bitmap_to_screen_blt(unsigned short srcx, + unsigned short srcy, + unsigned long dstoffset, + unsigned short width, + unsigned short height, + unsigned char *data, + unsigned short pitch); +BOOLEAN Gal2_mono_bitmap_to_screen_blt(unsigned short srcx, + unsigned short srcy, + unsigned long dstoffset, + unsigned short width, + unsigned short height, + unsigned char *data, + unsigned short pitch); + +BOOLEAN Gal2_text_blt(unsigned long dstoffset, + unsigned short width, + unsigned short height, unsigned long data); +BOOLEAN Gal2_bresenham_line(unsigned long dstoffset, + unsigned short length, unsigned short initerr, + unsigned short axialerr, unsigned short diagerr, + unsigned short flags); +BOOLEAN Gal2_sync_to_vblank(void); + +/* Video routines */ + +BOOLEAN Gal_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch); +BOOLEAN Gal_get_video_yuv_pitch(unsigned long *ypitch, + unsigned long *uvpitch); + +BOOLEAN Gal_set_video_yuv_offsets(unsigned long yoffset, + unsigned long uoffset, + unsigned long voffset); +BOOLEAN Gal_get_video_yuv_offsets(unsigned long *yoffset, + unsigned long *uoffset, + unsigned long *voffset); + +BOOLEAN Gal_set_video_left_crop(unsigned short x); +BOOLEAN Gal_set_video_vertical_downscale(unsigned short srch, + unsigned short dsth); + +BOOLEAN Gal_set_vbi_source(VbiSourceType source); +BOOLEAN Gal_get_vbi_source(VbiSourceType * source); + +BOOLEAN Gal_set_vbi_lines(unsigned long even, unsigned long odd); +BOOLEAN Gal_get_vbi_lines(int odd, unsigned long *lines); + +BOOLEAN Gal_set_vbi_total(unsigned long even, unsigned long odd); +BOOLEAN Gal_get_vbi_total(int odd, unsigned long *total); + +BOOLEAN Gal_set_vertical_scaler_offset(char offset); +BOOLEAN Gal_get_vertical_scaler_offset(char *offset); +BOOLEAN Gal_get_genlock_enable(int *enable); +BOOLEAN Gal_set_genlock_enable(int flags); +BOOLEAN Gal_get_genlock_delay(unsigned long *delay); +BOOLEAN Gal_set_genlock_delay(unsigned long delay); +BOOLEAN Gal_set_top_line_in_odd(int enable); + +BOOLEAN Gal_read_crc(unsigned long *crc); +BOOLEAN Gal_read_window_crc(int source, unsigned short x, unsigned short y, + unsigned short width, unsigned short height, + int crc32, unsigned long *crc); + +BOOLEAN Gal_set_macrovision_enable(int enable); +BOOLEAN Gal_get_macrovision_enable(int *enable); + +/* MSR routines */ + +BOOLEAN Gal_id_msr_dev_address(MSR * pDev, unsigned long address); +BOOLEAN Gal_get_msr_dev_address(unsigned int device, unsigned long *address); + +#endif diff --git a/Source/DirectFB/gfxdrivers/nsc/include/pnl_defs.h b/Source/DirectFB/gfxdrivers/nsc/include/pnl_defs.h new file mode 100755 index 0000000..62de7bb --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/include/pnl_defs.h @@ -0,0 +1,201 @@ +/* + * $Workfile: pnl_defs.h $ + * + * File Contents: This file contains definitions of the Geode + * frame buffer panel data structures. + * + * SubModule: Geode FlatPanel library + * + */ + +/* NSC_LIC_ALTERNATIVE_PREAMBLE + * + * Revision 1.0 + * + * National Semiconductor Alternative GPL-BSD License + * + * National Semiconductor Corporation licenses this software + * ("Software"): + * + * National Xfree frame buffer driver + * + * under one of the two following licenses, depending on how the + * Software is received by the Licensee. + * + * If this Software is received as part of the Linux Framebuffer or + * other GPL licensed software, then the GPL license designated + * NSC_LIC_GPL applies to this Software; in all other circumstances + * then the BSD-style license designated NSC_LIC_BSD shall apply. + * + * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ + +/* NSC_LIC_BSD + * + * National Semiconductor Corporation Open Source License for + * + * National Xfree frame buffer driver + * + * (BSD License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * * Neither the name of the National Semiconductor Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * END_NSC_LIC_BSD */ + +/* NSC_LIC_GPL + * + * National Semiconductor Corporation Gnu General Public License for + * + * National Xfree frame buffer driver + * + * (GPL License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted under the terms of the GNU General + * Public License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version + * + * In addition to the terms of the GNU General Public License, neither + * the name of the National Semiconductor Corporation nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. See the GNU General Public License for more details. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * You should have received a copy of the GNU General Public License + * along with this file; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * END_NSC_LIC_GPL */ + +#ifndef _pnl_defs_h +#define _pnl_defs_h + +typedef enum +{ + MARMOT_PLATFORM = 0, + UNICORN_PLATFORM, + CENTAURUS_PLATFORM, + ARIES_PLATFORM, + CARMEL_PLATFORM, + HYDRA_PLATFORM, + DORADO_PLATFORM, + DRACO_PLATFORM, + REDCLOUD_PLATFORM, + OTHER_PLATFORM +} +SYS_BOARD; + +#define PNL_9210 0x01 +#define PNL_9211_A 0x02 +#define PNL_9211_C 0x04 +#define PNL_UNKNOWN_CHIP 0x08 + +#define PNL_TFT 0x01 +#define PNL_SSTN 0x02 +#define PNL_DSTN 0x04 +#define PNL_TWOP 0x08 +#define PNL_UNKNOWN_PANEL 0x10 + +#define PNL_MONO_PANEL 0x01 +#define PNL_COLOR_PANEL 0x02 +#define PNL_UNKNOWN_COLOR 0x08 + +#define PNL_PANELPRESENT 0x01 +#define PNL_PLATFORM 0x02 +#define PNL_PANELCHIP 0x04 +#define PNL_PANELSTAT 0x08 +#define PNL_OVERRIDE_STAT 0x10 +#define PNL_OVERRIDE_ALL 0x1F + +typedef struct _Pnl_PanelStat_ +{ + int Type; + int XRes; + int YRes; + int Depth; + int MonoColor; +} +Pnl_PanelStat; + +typedef struct _Pnl_Params_ +{ + unsigned long Flags; + int PanelPresent; + int Platform; + int PanelChip; + Pnl_PanelStat PanelStat; +} +Pnl_PanelParams, *PPnl_PanelParams; + +#endif /* _pnl_defs_h */ + +/* END OF FILE */ diff --git a/Source/DirectFB/gfxdrivers/nsc/nsc.c b/Source/DirectFB/gfxdrivers/nsc/nsc.c new file mode 100755 index 0000000..f0a0d72 --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/nsc.c @@ -0,0 +1,592 @@ +/* + * $Workfile: $ + * $Revision: 1.16 $ + * + * File Contents: This file contains the main functions of the NSC DFB. + * + * Project: NSC Direct Frame buffer device driver + * + */ + +/* NSC_LIC_ALTERNATIVE_PREAMBLE + * + * Revision 1.0 + * + * National Semiconductor Alternative GPL-BSD License + * + * National Semiconductor Corporation licenses this software + * ("Software"): + * + * National Xfree frame buffer driver + * + * under one of the two following licenses, depending on how the + * Software is received by the Licensee. + * + * If this Software is received as part of the Linux Framebuffer or + * other GPL licensed software, then the GPL license designated + * NSC_LIC_GPL applies to this Software; in all other circumstances + * then the BSD-style license designated NSC_LIC_BSD shall apply. + * + * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ + +/* NSC_LIC_BSD + * + * National Semiconductor Corporation Open Source License for + * + * National Xfree frame buffer driver + * + * (BSD License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * * Neither the name of the National Semiconductor Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * END_NSC_LIC_BSD */ + +/* NSC_LIC_GPL + * + * National Semiconductor Corporation Gnu General Public License for + * + * National Xfree frame buffer driver + * + * (GPL License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted under the terms of the GNU General + * Public License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version + * + * In addition to the terms of the GNU General Public License, neither + * the name of the National Semiconductor Corporation nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. See the GNU General Public License for more details. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * You should have received a copy of the GNU General Public License + * along with this file; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * END_NSC_LIC_GPL */ + +#include <config.h> + +#include <dfb_types.h> +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/mman.h> +#include <fcntl.h> +#include <sys/ioctl.h> +#include <malloc.h> +#include <directfb.h> +#include <core/coredefs.h> +#include <core/coretypes.h> +#include <core/state.h> +#include <core/gfxcard.h> +#include <core/surface.h> +#include <gfx/convert.h> +#include <gfx/util.h> +#include <misc/conf.h> +#include <misc/util.h> +#include <core/graphics_driver.h> +#include <direct/messages.h> +#include <direct/util.h> + +#include "nsc_galproto.h" + +#define NSC_ACCEL 1 + +#define GP_VECTOR_DEST_DATA 0x8 +#define GP_VECTOR_MINOR_AXIS_POS 0x4 +#define GP_VECTOR_MAJOR_AXIS_POS 0x2 +#define GP_VECTOR_Y_MAJOR 0x1 + +#define GFX_CPU_REDCLOUD 3 + +#define GX_SUPPORTED_DRAWINGFLAGS DSDRAW_NOFX + +#define GX_SUPPORTED_DRAWINGFUNCTIONS \ + (DFXL_FILLRECTANGLE | \ + DFXL_DRAWRECTANGLE | \ + DFXL_DRAWLINE) + +#define GX_SUPPORTED_BLITTINGFUNCTIONS DFXL_BLIT + +#define GX_SUPPORTED_BLITTINGFLAGS DSBLIT_SRC_COLORKEY + +DFB_GRAPHICS_DRIVER(nsc) + +typedef struct +{ + unsigned long Color; + unsigned long src_offset; + unsigned long dst_offset; + unsigned long src_pitch; + unsigned long dst_pitch; + unsigned long src_colorkey; + int v_srcColorkey; +}NSCDeviceData; + +typedef struct +{ + unsigned int cpu_version; + int cpu; +}NSCDriverData; + +static GAL_ADAPTERINFO sAdapterInfo; + +static bool nscDrawLine(void *drv, void *dev, DFBRegion *line); +static bool nscFillRectangle(void *drv, void *dev, DFBRectangle *rect); +static bool nscDrawRectangle(void *drv, void *dev, DFBRectangle *rect); +static bool nscBlit(void *drv, void *dev, DFBRectangle *rect, int dx, int dy); +static bool nscBlitGu1(void *drv, void *dev, DFBRectangle *rect, int dx, int dy); + +static DFBResult gxEngineSync(void *drv, void *dev) +{ + Gal_wait_until_idle(); + + return DFB_OK; +} + +static inline void +nsc_validate_srcColorkey(NSCDriverData *gxdrv, + NSCDeviceData *gxdev, CardState *state) +{ + if (gxdev->v_srcColorkey) + return; + gxdev->src_colorkey = state->src_colorkey; + gxdev->v_srcColorkey = 1; +} + +static void +gxCheckState(void *drv, + void *dev, CardState *state, DFBAccelerationMask accel) +{ +#if NSC_ACCEL + NSCDriverData *gxdrv = (NSCDriverData *) drv; + NSCDeviceData *gxdev = (NSCDeviceData *) dev; + + if(state->destination->config.format != DSPF_RGB16) + return; + + if (DFB_BLITTING_FUNCTION(accel)) { + + if(state->source->config.format != DSPF_RGB16) + return; + if (gxdrv->cpu) { + /* GU2 - if there are no other blitting flags than the supported + * and the source and destination formats are the same + */ + if (!(state->blittingflags & ~GX_SUPPORTED_BLITTINGFLAGS) && + state->source && state->source->config.format != DSPF_RGB24) { + state->accel |= GX_SUPPORTED_BLITTINGFUNCTIONS; + } + } else{ + /* GU1 - source width must match frame buffer strid + */ + if(state->source) { + int src_pitch = 0; + int dst_pitch = 0; + + if(state->source) { + src_pitch = state->source->config.size.w * DFB_BYTES_PER_PIXEL(state->source->config.format); + } + + if (state->modified & SMF_DESTINATION) { + if(state->destination && state->dst.buffer) + dst_pitch = state->dst.pitch; + } + if(dst_pitch == 0) { + dst_pitch = gxdev->dst_pitch; + } + + if(src_pitch == dst_pitch && state->source) { + state->accel |= GX_SUPPORTED_BLITTINGFUNCTIONS; + } + } + } + } else { + /* if there are no other drawing flags than the supported */ + if (!(state->drawingflags & ~GX_SUPPORTED_DRAWINGFLAGS)) { + state->accel |= GX_SUPPORTED_DRAWINGFUNCTIONS; + } + } +#endif /* NSC_ACCEL */ +} + +static void +gxSetState(void *drv, void *dev, + GraphicsDeviceFuncs *funcs, + CardState *state, DFBAccelerationMask accel) +{ + NSCDriverData *gxdrv = (NSCDriverData *) drv; + NSCDeviceData *gxdev = (NSCDeviceData *) dev; + + if (state->mod_hw & SMF_SRC_COLORKEY) + gxdev->v_srcColorkey = 0; + + switch (accel) { + case DFXL_BLIT: + state->set |= DFXL_BLIT; + if (state->blittingflags & DSBLIT_SRC_COLORKEY) + nsc_validate_srcColorkey(gxdrv, gxdev, state); + break; + + case DFXL_FILLRECTANGLE: + case DFXL_DRAWRECTANGLE: + case DFXL_DRAWLINE: + state->set |= DFXL_FILLRECTANGLE | DFXL_DRAWLINE | DFXL_DRAWRECTANGLE; + break; + + default: + D_BUG("unexpected drawing/blitting function"); + break; + } + + if (state->mod_hw & SMF_DESTINATION) { + + /* set offset & pitch */ + + gxdev->dst_offset = state->dst.offset; + gxdev->dst_pitch = state->dst.pitch; + } + + if (state->mod_hw & SMF_SOURCE && state->source) { + + gxdev->src_offset = state->src.offset; + gxdev->src_pitch = state->src.pitch; + } + + if (state->mod_hw & (SMF_DESTINATION | SMF_COLOR)) { + switch (state->destination->config.format) { + case DSPF_A8: + gxdev->Color = state->color.a; + break; + case DSPF_ARGB1555: + gxdev->Color = + PIXEL_ARGB1555(state->color.a, state->color.r, + state->color.g, state->color.b); + break; + case DSPF_RGB16: + gxdev->Color = + PIXEL_RGB16(state->color.r, state->color.g, state->color.b); + break; + + default: + D_BUG("unexpected pixelformat"); + break; + } + } + + state->mod_hw = 0; +} + +static bool +nscDrawLine(void *drv, void *dev, DFBRegion *line) +{ + long dx, dy, adx, ady; + short majorErr; + unsigned short destData; + NSCDeviceData *gxdev = (NSCDeviceData *) dev; + int yoffset; + + destData = 0; /* Value will be 0x8 (or) 0 */ + dx = line->x2 - line->x1; /* delta values */ + dy = line->y2 - line->y1; + adx = ABS(dx); + ady = ABS(dy); + yoffset = gxdev->dst_offset / gxdev->dst_pitch; + + /* Canonical Bresenham stepper. + * * We use hardware to draw the pixels to take care of alu modes + * * and whatnot. + */ + Gal_set_raster_operation(0xF0); + Gal_set_solid_pattern(gxdev->Color); + if (adx >= ady) { + unsigned short vectorMode; + + vectorMode = destData; + if (dy >= 0) + vectorMode |= GP_VECTOR_MINOR_AXIS_POS; + if (dx >= 0) + vectorMode |= GP_VECTOR_MAJOR_AXIS_POS; + majorErr = (short)(ady << 1); + + Gal_bresenham_line((short)line->x1, + (short)line->y1 + yoffset, + (short)adx, + (short)(majorErr - adx), + (short)majorErr, + (short)(majorErr - (adx << 1)), vectorMode); + } else { + unsigned short vectorMode; + + vectorMode = destData | GP_VECTOR_Y_MAJOR; + + if (dx >= 0) + vectorMode |= GP_VECTOR_MINOR_AXIS_POS; + if (dy >= 0) + vectorMode |= GP_VECTOR_MAJOR_AXIS_POS; + majorErr = (short)(adx << 1); + Gal_bresenham_line((short)line->x1, + (short)line->y1 + yoffset, + (short)ady, + (short)(majorErr - ady), + (short)majorErr, + (short)(majorErr - (ady << 1)), vectorMode); + } + + return true; +} + +static bool +nscFillRectangle(void *drv, void *dev, DFBRectangle *rect) +{ + NSCDeviceData *gxdev = (NSCDeviceData *) dev; + int yoffset; + + Gal_set_raster_operation(0xF0); + Gal_set_solid_pattern(gxdev->Color); + + yoffset = gxdev->dst_offset / gxdev->dst_pitch; + Gal_pattern_fill(rect->x, rect->y + yoffset, rect->w, rect->h); + + return true; +} + +static bool +nscDrawRectangle(void *drv, void *dev, DFBRectangle *rect) +{ + NSCDeviceData *gxdev = (NSCDeviceData *) dev; + int yoffset; + + Gal_set_raster_operation(0xF0); + Gal_set_solid_pattern(gxdev->Color); + + yoffset = gxdev->dst_offset / gxdev->dst_pitch; + + Gal_pattern_fill(rect->x, rect->y + yoffset, rect->w, 1); + Gal_pattern_fill(rect->x, ((rect->y + yoffset + rect->h) - 1), rect->w, 1); + Gal_pattern_fill(rect->x, (rect->y + yoffset + 1), 1, (rect->h - 2)); + Gal_pattern_fill(((rect->x + rect->w) - 1), + (rect->y + yoffset + 1), 1, (rect->h - 2)); + + return true; +} + +static bool +nscBlit(void *drv, void *dev, DFBRectangle * rect, int dx, int dy) +{ + NSCDeviceData *nscdev = (NSCDeviceData *) dev; + unsigned long soffset = (rect->x * nscdev->src_pitch) + (rect->y * 2); + unsigned long doffset = (dy * nscdev->dst_pitch) + (dx * 2); + + Gal_set_solid_pattern(nscdev->Color); + if (nscdev->v_srcColorkey) { + Gal2_set_source_transparency(nscdev->src_colorkey, 0xFFFF); + } + Gal_set_raster_operation(0xCC); + Gal2_set_source_stride((unsigned short)nscdev->src_pitch); + Gal2_set_destination_stride(nscdev->dst_pitch); + Gal2_screen_to_screen_blt(nscdev->src_offset + soffset, + nscdev->dst_offset + doffset, + (unsigned short)rect->w, + (unsigned short)rect->h, 1); + + return true; +} + +static bool +nscBlitGu1(void *drv, void *dev, DFBRectangle * rect, int dx, int dy) +{ + int result, yoff; + + NSCDeviceData *nscdev = (NSCDeviceData *) dev; + + Gal_set_solid_pattern(nscdev->Color); + if (nscdev->v_srcColorkey) { +//FIXME Gal_set_source_transparency(nscdev->src_colorkey, 0xFFFF); + } +#if 0 + printf("rect x %d y %d w %d h %d dx %d dy %d src_off %x dst_off %x src pitch %x dst pitch %x\n", + rect->x, rect->y, rect->w, rect->h, dx, dy, + nscdev->src_offset, nscdev->dst_offset, + nscdev->src_pitch, nscdev->dst_pitch); +#endif + + Gal_set_raster_operation(0xCC); + + yoff = nscdev->src_offset / nscdev->src_pitch; + result = Gal_screen_to_screen_blt(rect->x, rect->y + yoff, dx, dy, + (unsigned short)rect->w, + (unsigned short)rect->h); + + return true; +} + +/* exported symbols */ + +static int +driver_probe(CoreGraphicsDevice *device) +{ + Gal_initialize_interface(); + if(!Gal_get_adapter_info(&sAdapterInfo)) + return 0; + + return sAdapterInfo.dwFrameBufferBase == dfb_gfxcard_memory_physical( device, 0 ); +} + +static void +driver_get_info(CoreGraphicsDevice *device, GraphicsDriverInfo *info) +{ + /* fill driver info structure */ + snprintf(info->name, + DFB_GRAPHICS_DRIVER_INFO_NAME_LENGTH, "NSC GX1 and GX2 Driver"); + snprintf(info->vendor, DFB_GRAPHICS_DRIVER_INFO_VENDOR_LENGTH, "NSC"); + + info->version.major = 1; + info->version.minor = 1; + info->driver_data_size = sizeof(NSCDriverData); + info->device_data_size = sizeof(NSCDeviceData); +} + +static DFBResult +driver_init_driver(CoreGraphicsDevice *device, + GraphicsDeviceFuncs *funcs, + void *driver_data, + void *device_data, + CoreDFB *core) +{ + NSCDriverData *gxdrv = (NSCDriverData *) driver_data; + + Gal_set_compression_enable(0); + + gxdrv->cpu_version = sAdapterInfo.dwCPUVersion; + gxdrv->cpu = 0; + if ((gxdrv->cpu_version & 0xFF) == GFX_CPU_REDCLOUD) { + gxdrv->cpu = 1; + } + D_DEBUG("CPU is GX%d", gxdrv->cpu); + +#if NSC_ACCEL + funcs->CheckState = gxCheckState; + funcs->SetState = gxSetState; + funcs->EngineSync = gxEngineSync; + funcs->FillRectangle = nscFillRectangle; + funcs->DrawLine = nscDrawLine; + funcs->DrawRectangle = nscDrawRectangle; + funcs->DrawLine = nscDrawLine; + if (gxdrv->cpu) { + funcs->Blit = nscBlit; + } else { + funcs->Blit = nscBlitGu1; + } +#endif /* NSC_ACCEL */ + + /*dfb_config->pollvsync_after = 1;*/ + + return DFB_OK; +} + +static DFBResult +driver_init_device(CoreGraphicsDevice *device, + GraphicsDeviceInfo *device_info, + void *driver_data, void *device_data) +{ + snprintf(device_info->name, + DFB_GRAPHICS_DEVICE_INFO_NAME_LENGTH, "NSC GX1/GX2 driver version"); + snprintf(device_info->vendor, + DFB_GRAPHICS_DEVICE_INFO_VENDOR_LENGTH, "nsc"); + printf("Dependent NSC Kernel FrameBuffer driver version is 2.7.7 or later\n"); + device_info->caps.flags = CCF_NOTRIEMU; + device_info->caps.accel = GX_SUPPORTED_DRAWINGFUNCTIONS; + device_info->caps.drawing = GX_SUPPORTED_DRAWINGFLAGS; + device_info->caps.accel |= GX_SUPPORTED_BLITTINGFUNCTIONS; + device_info->caps.blitting = GX_SUPPORTED_BLITTINGFLAGS; + return DFB_OK; +} + +static void +driver_close_device(CoreGraphicsDevice * device, + void *driver_data, void *device_data) +{ + NSCDeviceData *gxdev = (NSCDeviceData *) device_data; + + (void)gxdev; + D_DEBUG("DirectFB/nsc: 5"); +} + +static void +driver_close_driver(CoreGraphicsDevice *device, void *driver_data) +{ + D_DEBUG("DirectFB/nsc: 6"); +} diff --git a/Source/DirectFB/gfxdrivers/nsc/nsc_galfns.c b/Source/DirectFB/gfxdrivers/nsc/nsc_galfns.c new file mode 100755 index 0000000..42a9b44 --- /dev/null +++ b/Source/DirectFB/gfxdrivers/nsc/nsc_galfns.c @@ -0,0 +1,4905 @@ +/* + * $Workfile: nsc_galfns.c $ + * $Revision: 1.13 $ + * $Author: dok $ + * + * File Contents: This file contains the main functions of the Geode + * frame buffer device drivers GAL function definitions. + * + * Project: Geode Frame buffer device driver + * + */ + +/* NSC_LIC_ALTERNATIVE_PREAMBLE + * + * Revision 1.0 + * + * National Semiconductor Alternative GPL-BSD License + * + * National Semiconductor Corporation licenses this software + * ("Software"): + * + * National Xfree frame buffer driver + * + * under one of the two following licenses, depending on how the + * Software is received by the Licensee. + * + * If this Software is received as part of the Linux Framebuffer or + * other GPL licensed software, then the GPL license designated + * NSC_LIC_GPL applies to this Software; in all other circumstances + * then the BSD-style license designated NSC_LIC_BSD shall apply. + * + * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ + +/* NSC_LIC_BSD + * + * National Semiconductor Corporation Open Source License for + * + * National Xfree frame buffer driver + * + * (BSD License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * * Neither the name of the National Semiconductor Corporation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * END_NSC_LIC_BSD */ + +/* NSC_LIC_GPL + * + * National Semiconductor Corporation Gnu General Public License for + * + * National Xfree frame buffer driver + * + * (GPL License with Export Notice) + * + * Copyright (c) 1999-2001 + * National Semiconductor Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted under the terms of the GNU General + * Public License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version + * + * In addition to the terms of the GNU General Public License, neither + * the name of the National Semiconductor Corporation nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, + * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. See the GNU General Public License for more details. + * + * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF + * YOUR JURISDICTION. It is licensee's responsibility to comply with + * any export regulations applicable in licensee's jurisdiction. Under + * CURRENT (2001) U.S. export regulations this software + * is eligible for export from the U.S. and can be downloaded by or + * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed + * destinations which include Cuba, Iraq, Libya, North Korea, Iran, + * Syria, Sudan, Afghanistan and any other country to which the U.S. + * has embargoed goods and services. + * + * You should have received a copy of the GNU General Public License + * along with this file; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * END_NSC_LIC_GPL */ + +#include <config.h> + +#ifndef XFree86LOADER +#include <stdio.h> +#include <stdarg.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/sysmacros.h> +#include <fcntl.h> +#include <errno.h> +#include <sys/ioctl.h> +#endif + +#include <fbdev/fbdev.h> /* FIXME: Needs to be included before dfb_types.h to work around a type clash with asm/types.h */ + +#include <direct/memcpy.h> + +static FBDev *dfb_fbdev = NULL; + +#include "nsc_galproto.h" + +/* + * Compile time constants + */ +#define FBDEV_NAME "/dev/nscgal" + +/* + * Cool Macros to access the structures + */ +#define INIT_GAL(x) \ + (x)->dwSignature = FBGAL_SIGNATURE;\ + (x)->dwSize = sizeof(*x);\ + (x)->dwVersion = FBGAL_VERSION; + +#if 0 +/*------------------------------------------------------------------------ + * create_devicenode + * + * Description: This function creates nscgal device node in the device + * directory. + * parameters : none + * + * return: '0' was return on creating the galdevice node. + *----------------------------------------------------------------------*/ +static int +create_devicenode(void) +{ + +#if 1 + FILE *pfdevices; + char line[200], devname[200]; + int majdev; + + /* remove fails if device is open */ + remove("/dev/nscgal"); + + if ((pfdevices = fopen("/proc/devices", "r"))) { + while (fgets(line, sizeof(line), pfdevices)) { + if (sscanf(line, "%d%*[ \t]%s", &majdev, devname) == 2) { + if (strstr(devname, "nscgal")) + mknod("/dev/nscgal", S_IFCHR | S_IRUSR | S_IWUSR, + makedev(majdev, 0)); + } + } + fclose(pfdevices); + } + return 1; +#endif + +} +#endif + +/*------------------------------------------------------------------------ + * Gal_initialize_interface + * + * Description: This function intializes the nscgal device . + * parameters : none + * + * return: '1' was returned on intialization of the galdevice + * otherwise '0' was returned on failure. + *----------------------------------------------------------------------*/ +BOOLEAN +Gal_initialize_interface(void) +{ +/* create_devicenode(); */ + dfb_fbdev = dfb_system_data(); + + return 1; +} + +/*------------------------------------------------------------------------ + * Gal_cleanup_interface + * + * Description: This function closes the nscgal device . + * parameters : none + * + * return: '1' was returned on closing the galdevice. + *----------------------------------------------------------------------*/ +BOOLEAN +Gal_cleanup_interface(void) +{ + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_write_register + * + * Description: This function writes the data to the hardware register + * of the nscgal device . + * parameters: + * type: It specifies the hardware access type. + * offset: It specifies the offset address the register to be accessed. + * value: It specifies the data value to be written into the register. + * size: It specifies the size of the data to be written. + * + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_write_register(int type, unsigned long offset, unsigned long value, + int size) +{ + GAL_HWACCESS hwAccess; + + INIT_GAL(&hwAccess); + hwAccess.dwSubfunction = GALFN_WRITEREG; + hwAccess.dwType = type; + hwAccess.dwOffset = offset; + hwAccess.dwValue = value; + hwAccess.dwByteCount = size; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &hwAccess)) + return 0; + else { + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_read_register + * + * Description: This function reads the data from the hardware register + * of the nscgal device . + * parameters: + * type: It specifies the hardware access type. + * offset: It specifies the offset address of the register to be accessed. + * value: It specifies the pointer to hold the data to be read from + * the gal hardware register. + * size: It specifies the size of the data to be read + * + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_read_register(int type, unsigned long offset, unsigned long *value, + int size) +{ + GAL_HWACCESS hwAccess; + + INIT_GAL(&hwAccess); + hwAccess.dwSubfunction = GALFN_READREG; + hwAccess.dwType = type; + hwAccess.dwOffset = offset; + hwAccess.dwByteCount = size; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &hwAccess)) + return 0; + else { + *value = hwAccess.dwValue; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_get_adapter_info + * + * Description: This function gets the adapter information of the + * nscgal device . + * parameters: + *pAdapterInfo: It specifies the adapter information structure. + * + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_adapter_info(PGAL_ADAPTERINFO pAdapterInfo) +{ + INIT_GAL(pAdapterInfo); + + pAdapterInfo->dwSubfunction = GALFN_GETADAPTERINFO; + + if (!dfb_fbdev || ioctl(dfb_fbdev->fd, FBIOGAL_API, pAdapterInfo)) + return 0; + else { + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_set_softvga_state + * + * Description: This function sets the softvga state of the platform device . + * parameters: + * bEnable: It specifies the softvga state enable state. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_softvga_state(BOOLEAN bEnable) +{ + GAL_SOFTVGASTATE sSoftVgaState; + + INIT_GAL(&sSoftVgaState); + sSoftVgaState.dwSubfunction = GALFN_SETSOFTVGASTATE; + sSoftVgaState.bSoftVgaEnable = bEnable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSoftVgaState)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_get_softvga_state + * + * Description: This function gets the softvga state of the platform device . + * parameters: + * bEnable: get the softvga state. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_softvga_state(int *bState) +{ + GAL_SOFTVGASTATE sSoftVgaState; + + INIT_GAL(&sSoftVgaState); + sSoftVgaState.dwSubfunction = GALFN_GETSOFTVGASTATE; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSoftVgaState)) + return 0; + else { + *bState = sSoftVgaState.bSoftVgaEnable; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_vga_test_pci + * + * Description: This function tests the vga pci. + * parameters: + * softvga: It is pointer to the softvga state. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_test_pci(int *softvga) +{ + GAL_VGATESTPCI sVgatestpci; + + INIT_GAL(&sVgatestpci); + sVgatestpci.dwSubfunction = GALFN_GETSOFTVGASTATE; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgatestpci)) + return 0; + else { + *softvga = sVgatestpci.softvga; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_vga_get_pci_command + * + * Description: This function gets the vga pci command. + * parameters: + * value: It is pointer to pci command value. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_get_pci_command(unsigned char *value) +{ + GAL_VGAGETPCICOMMAND sVgagetpcicommand; + + INIT_GAL(&sVgagetpcicommand); + sVgagetpcicommand.dwSubfunction = GALFN_VGAGETPCICOMMAND; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgagetpcicommand)) + return 0; + else { + *value = sVgagetpcicommand.value; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_vga_seq_reset + * + * Description: This function resets the vga seq. + * parameters: + * reset: It gives the reset value. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_seq_reset(int reset) +{ + GAL_VGASEQRESET sVgaseqreset; + + INIT_GAL(&sVgaseqreset); + sVgaseqreset.dwSubfunction = GALFN_VGASEQRESET; + sVgaseqreset.reset = reset; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgaseqreset)) + return 0; + else { + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_vga_set_graphics_bits + * + * Description: This function resets the vga seq. + * parameters: None. + * + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_set_graphics_bits(void) +{ + GAL_VGASETGRAPHICSBITS sVgasetgraphics; + + INIT_GAL(&sVgasetgraphics); + sVgasetgraphics.dwSubfunction = GALFN_VGASETGRAPHICSBITS; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgasetgraphics)) + return 0; + else { + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_set_crt_enable + * + * Description: This function sets the crt state of the device . + * parameters: + * crtState: It specifies the crt state of the galdevice. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_crt_enable(int crtEnable) +{ + GAL_CRTENABLE sCrtEnable; + + INIT_GAL(&sCrtEnable); + sCrtEnable.dwSubfunction = GALFN_SETCRTENABLE; + sCrtEnable.wCrtEnable = crtEnable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCrtEnable)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_is_display_mode_supported + * + * Description: This function checks the display mode is supported or not. + * parameters: + * xres: It specifies x co-ordinate resolution. + * Yres: It specifies y co-ordinate resolution. + * bpp: It specifies the bits per pixel (8/16 bits). + * hz: It specifies the frequency of the display mode. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_is_display_mode_supported(int xres, int yres, int bpp, int hz, + int *supported) +{ + GAL_DISPLAYMODE sDisplayMode; + + *supported = 0; + INIT_GAL(&sDisplayMode); + sDisplayMode.dwSubfunction = GALFN_ISDISPLAYMODESUPPORTED; + sDisplayMode.wXres = xres; + sDisplayMode.wYres = yres; + sDisplayMode.wBpp = bpp; + sDisplayMode.wRefresh = hz; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayMode)) + return 0; + else { + *supported = sDisplayMode.dwSupported; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_set_display_mode + * + * Description: This function sets the display mode of the galdevice. + * parameters: + * xres: It specifies x co-ordinate resolution. + * Yres: It specifies y co-ordinate resolution. + * bpp: It specifies the bits per pixel (8/16 bits). + * hz: It specifies the frequency of the display mode. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_display_mode(int xres, int yres, int bpp, int hz) +{ + GAL_DISPLAYMODE sDisplayMode; + + INIT_GAL(&sDisplayMode); + sDisplayMode.dwSubfunction = GALFN_SETDISPLAYMODE; + sDisplayMode.wXres = xres; + sDisplayMode.wYres = yres; + sDisplayMode.wBpp = bpp; + sDisplayMode.wRefresh = hz; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayMode)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_get_display_mode + * + * Description: This function gets the display mode of the galdevice. + * parameters: + * xres: It specifies x co-ordinate resolution. + * Yres: It specifies y co-ordinate resolution. + * bpp: It specifies the bits per pixel (8/16 bits). + * hz: It specifies the frequency of the display mode. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_display_mode(int *xres, int *yres, int *bpp, int *hz) +{ + GAL_DISPLAYMODE sDisplayMode; + + INIT_GAL(&sDisplayMode); + sDisplayMode.dwSubfunction = GALFN_GETDISPLAYMODE; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayMode)) + return 0; + else { + *xres = sDisplayMode.wXres; + *yres = sDisplayMode.wYres; + *bpp = sDisplayMode.wBpp; + *hz = sDisplayMode.wRefresh; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_set_display_bpp + * + * Description: This function sets the number bits per pixel in the display + * mode of the galdevice. + * parameters: + * bpp: It specifies the bits per pixel (8/16 bits). + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_display_bpp(unsigned short bpp) +{ + GAL_DISPLAYPARAMS sDisplayParams; + + INIT_GAL(&sDisplayParams); + sDisplayParams.dwSubfunction = GALFN_SETDISPLAYBPP; + sDisplayParams.wBpp = bpp; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_set_bpp + * + * Description: This function sets the number bits per pixel in the display + * mode of the galdevice. + * parameters: + * bpp: It specifies the bits per pixel (8/16 bits). + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_bpp(unsigned short bpp) +{ + GAL_DISPLAYPARAMS sDisplayParams; + + INIT_GAL(&sDisplayParams); + sDisplayParams.dwSubfunction = GALFN_SETBPP; + sDisplayParams.wBpp = bpp; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_get_display_bpp + * + * Description: This function gets the number bits per pixel in the display + * mode of the galdevice. + * parameters: + * bpp: It specifies the bits per pixel (8/16 bits). + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_display_bpp(unsigned short *bpp) +{ + GAL_DISPLAYPARAMS sDisplayParams; + + INIT_GAL(&sDisplayParams); + sDisplayParams.dwSubfunction = GALFN_GETDISPLAYBPP; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) + return 0; + else { + *bpp = sDisplayParams.wBpp; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_set_display_pitch + * + * Description: This function sets the display pitch of the galdevice. + * parameters: + * pitch: It specifies pitch of the display mode. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_display_pitch(unsigned short pitch) +{ + GAL_DISPLAYPARAMS sDisplayParams; + + INIT_GAL(&sDisplayParams); + sDisplayParams.dwSubfunction = GALFN_SETDISPLAYPITCH; + sDisplayParams.wPitch = pitch; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_get_display_pitch + * + * Description: This function gets the display pitch of the galdevice. + * parameters: + * pitch: It specifies pitch of the display mode. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_display_pitch(unsigned short *pitch) +{ + GAL_DISPLAYPARAMS sDisplayParams; + + INIT_GAL(&sDisplayParams); + sDisplayParams.dwSubfunction = GALFN_GETDISPLAYPITCH; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) + return 0; + else { + *pitch = sDisplayParams.wPitch; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_set_display_offset + * + * Description: This function sets the offset of display parameters. + * parameters: + * offset: It specifies the offset address of display parameters. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_display_offset(unsigned long offset) +{ + GAL_DISPLAYPARAMS sDisplayParams; + + INIT_GAL(&sDisplayParams); + sDisplayParams.dwSubfunction = GALFN_SETDISPLAYOFFSET; + sDisplayParams.dwOffset = offset; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_get_display_offset + * + * Description: This function gets the offset of display parameters. + * parameters: + * offset: It specifies the offset address of display parameters. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_display_offset(unsigned long *offset) +{ + GAL_DISPLAYPARAMS sDisplayParams; + + INIT_GAL(&sDisplayParams); + sDisplayParams.dwSubfunction = GALFN_GETDISPLAYOFFSET; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDisplayParams)) + return 0; + else { + *offset = sDisplayParams.dwOffset; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_get_refreshrate_from_dotclock + * + * Description: This function gets the refreshrate from dotclock. + * parameters: + * xres: It specifies x co-ordinate resolution. + * Yres: It specifies y co-ordinate resolution. + * bpp: It specifies the bits per pixel (8/16 bits). + * hz: It is a pointer which holds the refresh rate of the display. + * frequency: It spcifies the frequency of the dotclock. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_refreshrate_from_dotclock(int xres, int yres, int bpp, int *hz, + unsigned long frequency) +{ + GAL_DOTCLKTOREFRESH sDclkToRefresh; + + INIT_GAL(&sDclkToRefresh); + sDclkToRefresh.dwSubfunction = GALFN_DOTCLKTOREFRESH; + sDclkToRefresh.wXres = xres; + sDclkToRefresh.wYres = yres; + sDclkToRefresh.wBpp = bpp; + sDclkToRefresh.dwDotClock = frequency; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sDclkToRefresh)) + return 0; + else { + *hz = sDclkToRefresh.wRefreshRate; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_get_display_timing + * + * Description: This function gets the display timing from galdevice. + * parameters: + * pDisplayTiming: It specifies the display timing of the galdevice. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_display_timing(PGAL_DISPLAYTIMING pDisplayTiming) +{ + INIT_GAL(pDisplayTiming); + pDisplayTiming->dwSubfunction = GALFN_GETDISPLAYTIMINGS; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pDisplayTiming)) + return 0; + else { + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_set_display_timing + * + * Description: This function sets the display timing of the galdevice. + * parameters: + * pDisplayTiming: It specifies the display timing of the galdevice. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_display_timing(PGAL_DISPLAYTIMING pDisplayTiming) +{ + INIT_GAL(pDisplayTiming); + pDisplayTiming->dwSubfunction = GALFN_SETDISPLAYTIMINGS; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pDisplayTiming)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_set_fixed_timings + * + * Description: This function sets the fixed display timings of the + * galdevice. + * parameters: + * pnlXres: It specifies the panel X resolution. + * pnlYres: It specifies the panel Y resolution. + * totXres: It specifies the total X resolution. + * totYres: It specifies the total Y resolution. + * bpp: It specifies the bits per pixel (8/16 bits). + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_fixed_timings(int pnlXres, int pnlYres, int totXres, + int totYres, int bpp) +{ + GAL_DISPLAYTIMING DisplayTiming; + + INIT_GAL(&DisplayTiming); + DisplayTiming.dwSubfunction = GALFN_SETFIXEDTIMINGS; + DisplayTiming.wHActive = pnlXres; /* panel Xres */ + DisplayTiming.wVActive = pnlYres; /* panel Yres */ + DisplayTiming.wHTotal = totXres; /* Total Xres */ + DisplayTiming.wVTotal = totYres; /* Total Yres */ + DisplayTiming.wBpp = bpp; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &DisplayTiming)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_set_display_palette_entry + * + * Description: This function sets the display palette entry of the + * galdevice. + * parameters: + * index: It specifies the palette index, + * palette: It specifies the palette of the galdevice. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_display_palette_entry(unsigned long index, unsigned long palette) +{ + GAL_PALETTE_ENTRY sPalette; + + INIT_GAL(&sPalette); + sPalette.dwSubfunction = GALFN_SETPALETTE_ENTRY; + sPalette.dwIndex = index; + sPalette.dwPalette = palette; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sPalette)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_get_display_palette_entry + * + * Description: This function gets the display palette entry of the + * galdevice. + * parameters: + * index: It specifies the palette index, + * palette: It is a pointer to the palette of the galdevice. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_display_palette_entry(unsigned long index, unsigned long *palette) +{ + GAL_PALETTE_ENTRY sPalette; + + INIT_GAL(&sPalette); + sPalette.dwSubfunction = GALFN_GETPALETTE_ENTRY; + sPalette.dwIndex = index; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sPalette)) + return 0; + else { + *palette = sPalette.dwPalette; + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_set_display_palette_entry + * + * Description: This function sets the display palette entry of the + * galdevice. + * parameters: + * pPalette: It specifies the palette structure of the galdevice. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_display_palette(PGAL_PALETTE pPalette) +{ + INIT_GAL(pPalette); + pPalette->dwSubfunction = GALFN_SETPALETTE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pPalette)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_get_display_palette_entry + * + * Description: This function gets the display palette entry of the + * galdevice. + * parameters: + * pPalette: It specifies the palette structure of the galdevice. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_display_palette(PGAL_PALETTE pPalette) +{ + INIT_GAL(pPalette); + pPalette->dwSubfunction = GALFN_GETPALETTE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pPalette)) + return 0; + else { + return 1; + } +} + +/*--------------------------------------------------------------------------- + * Gal_wait_until_idle + * + * Description: This function waits until the graphics engine is idle. + * parameters: none. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_wait_until_idle(void) +{ + GAL_WAITUNTILIDLE sWaitIdle; + + INIT_GAL(&sWaitIdle); + sWaitIdle.dwSubfunction = GALFN_WAITUNTILIDLE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sWaitIdle)) + return 0; + else + return 1; +} + +/*--------------------------------------------------------------------------- + * Gal_wait_vertical_blank + * + * Description: This function wait until start of vertical blank. + * parameters: none. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_wait_vertical_blank(void) +{ + GAL_WAITVERTICALBLANK sWaitVerticalBlank; + + INIT_GAL(&sWaitVerticalBlank); + sWaitVerticalBlank.dwSubfunction = GALFN_WAITVERTICALBLANK; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sWaitVerticalBlank)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_cursor_enable + * + * Description: This function enable or disable the hardware cursor. + * parameters: + * enable: This specifies the enable value of the cursor. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_cursor_enable(int enable) +{ + GAL_CURSORENABLE sCursorEnable; + + INIT_GAL(&sCursorEnable); + sCursorEnable.dwSubfunction = GALFN_SETCURSORENABLE; + sCursorEnable.bCursorEnable = enable ? 1 : 0; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorEnable)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_cursor_position + * + * Description: This function sets the position of the cursor. + * parameters: + * memoffset: It specifies the memory offset of the cursor position. + * xpos: It specifies the X co-ordinate position of the cursor. + * ypos: It specifies the Y co-ordinate position of the cursor. + * xhotspot: It specifies the X hotspot location for current cursor shape. + * yhotspot: It specifies the Y hotspot location for current cursor shape. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_cursor_position(unsigned long memoffset, + unsigned short xpos, unsigned short ypos, + unsigned short xhotspot, unsigned short yhotspot) +{ + GAL_CURSORPOSITION sCursorPos; + + INIT_GAL(&sCursorPos); + sCursorPos.dwSubfunction = GALFN_SETCURSORPOSITION; + sCursorPos.dwMemOffset = memoffset; + sCursorPos.wXPos = xpos; + sCursorPos.wYPos = ypos; + sCursorPos.wXHot = xhotspot; + sCursorPos.wYHot = yhotspot; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorPos)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_get_cursor_position + * + * Description: This function gets the cursor position. + * parameters: + * memoffset: It points the memory offset of the cursor position. + * xpos: It points the X co-ordinate position of the cursor. + * ypos: It points the Y co-ordinate position of the cursor. + * xhotspot: It points the X hotspot location for current cursor shape. + * yhotspot: It points the Y hotspot location for current cursor shape. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_cursor_position(unsigned long *memoffset, + unsigned short *xpos, unsigned short *ypos, + unsigned short *xhotspot, unsigned short *yhotspot) +{ + GAL_CURSORPOSITION sCursorPos; + + INIT_GAL(&sCursorPos); + sCursorPos.dwSubfunction = GALFN_GETCURSORPOSITION; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorPos)) + return 0; + else { + *memoffset = sCursorPos.dwMemOffset; + *xpos = sCursorPos.wXPos; + *ypos = sCursorPos.wYPos; + *xhotspot = sCursorPos.wXHot; + *yhotspot = sCursorPos.wYHot; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_cursor_shape32 + * + * Description: This function loads 32x32 cursor pattern. + * parameters: + * memoffset: It specifies the graphics memory offset for cursor shape. + * andmask: It is a pointer to 32 DWORD of AND data. + * xormask: It is a pointer to 32 DWORD of XOR data. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_cursor_shape32(unsigned long memoffset, + unsigned long *andmask, unsigned long *xormask) +{ + GAL_SETCURSORSHAPE sCursorShape; + + INIT_GAL(&sCursorShape); + sCursorShape.dwSubfunction = GALFN_SETCURSORSHAPE; + sCursorShape.dwMemOffset = memoffset; + + direct_memcpy(sCursorShape.dwAndMask, andmask, sizeof(sCursorShape.dwAndMask)); + + direct_memcpy(sCursorShape.dwXorMask, xormask, sizeof(sCursorShape.dwXorMask)); + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorShape)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_cursor_shape64 + * + * Description: This function loads 64x64 cursor pattern. + * parameters: + * memoffset: It specifies the graphics memory offset for cursor shape. + * andmask: It is a pointer to 64 DWORD of AND data. + * xormask: It is a pointer to 64 DWORD of XOR data. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ BOOLEAN +Gal_set_cursor_shape64(unsigned long memoffset, + unsigned long *andmask, unsigned long *xormask) +{ + GAL_SETCURSORSHAPE sCursorShape; + + INIT_GAL(&sCursorShape); + sCursorShape.dwSubfunction = GALFN_SETCURSORSHAPE_RCLD; + sCursorShape.dwMemOffset = memoffset; + + direct_memcpy(sCursorShape.dwAndMask, andmask, sizeof(sCursorShape.dwAndMask)); + + direct_memcpy(sCursorShape.dwXorMask, xormask, sizeof(sCursorShape.dwXorMask)); + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorShape)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_cursor_colors + * + * Description: This function sets the colors of the hardware cursor. + * parameters: + * bkcolor:It specifies the RGB value for the background color. + * fgcolor:It specifies the RGB value for the foreground color. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor) +{ + GAL_CURSORCOLORS sCursorColor; + + INIT_GAL(&sCursorColor); + sCursorColor.dwSubfunction = GALFN_SETCURSORCOLORS; + sCursorColor.dwBgColor = bkcolor; + sCursorColor.dwFgColor = fgcolor; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorColor)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_get_cursor_colors + * + * Description: This function gets the colors of the hardware cursor. + * parameters: + * bkcolor:It points the RGB value for the background color. + * fgcolor:It points the RGB value for the foreground color. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_cursor_colors(unsigned long *bkcolor, unsigned long *fgcolor) +{ + GAL_CURSORCOLORS sCursorColor; + + INIT_GAL(&sCursorColor); + sCursorColor.dwSubfunction = GALFN_GETCURSORCOLORS; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCursorColor)) + return 0; + else { + *bkcolor = sCursorColor.dwBgColor; + *fgcolor = sCursorColor.dwFgColor; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_solid_pattern + * + * Description: This function sets a solid pattern color for future rendering. + * parameters: + * color: It specifies the pattern color in proper format for current + * display mode. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_solid_pattern(unsigned long color) +{ + GAL_SETSOLIDPATTERN sSetSoildPat; + + INIT_GAL(&sSetSoildPat); + sSetSoildPat.dwSubfunction = GALFN_SETSOLIDPATTERN; + sSetSoildPat.dwColor = color; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetSoildPat)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_solid_source + * + * Description: This function specifies a constant source data value for + * raster operations that use both pattern + * and source data. + * parameters: + * color: It specifies the source color. + * return: '1' was returned on success otherwise '0' was returned. + *-------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_solid_source(unsigned long color) +{ + GAL_SETSOLIDSOURCE sSetSolidSrc; + + INIT_GAL(&sSetSolidSrc); + sSetSolidSrc.dwSubfunction = GALFN_SETSOLIDSOURCE; + sSetSolidSrc.dwColor = color; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetSolidSrc)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_mono_source + * + * Description: + * parameters: + * bkcolor: It specifies the background color. + * fgcolor: It specifies the foreground color. + *transparency: It specifies the transparency flag. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, + unsigned char transparency) +{ + GAL_SETMONOSOURCE sSetMonoSrc; + + INIT_GAL(&sSetMonoSrc); + sSetMonoSrc.dwSubfunction = GALFN_SETMONOSOURCE; + sSetMonoSrc.dwFgColor = fgcolor; + sSetMonoSrc.dwBgColor = bgcolor; + sSetMonoSrc.cTransparency = transparency; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetMonoSrc)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_mono_pattern + * + * Description: This function specifies an 8x8 monochrome pattern + * used in future rendering operations. + * parameters: + * bkcolor: It specifies the background color. + * fgcolor: It specifies the foreground color. + * data0: It specifies the bits of 8x8 monochrome pattern. + * data1: It specifies the bits of 8x8 monochrome pattern. + *transparency: It specifies the transparency flag. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, + unsigned long data0, unsigned long data1, + unsigned char transparency) +{ + GAL_SETMONOPATTERN sSetMonoPat; + + INIT_GAL(&sSetMonoPat); + sSetMonoPat.dwSubfunction = GALFN_SETMONOPATTERN; + sSetMonoPat.dwFgColor = fgcolor; + sSetMonoPat.dwBgColor = bgcolor; + sSetMonoPat.dwData0 = data0; + sSetMonoPat.dwData1 = data1; + sSetMonoPat.cTransparency = transparency; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetMonoPat)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_raster_operation + * + * Description: This function specifies the raster operation for + * future rendering. + * parameters: + * rop: It specifies the ternary raster operation + * (pattern/source/destination). + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_raster_operation(unsigned char rop) +{ + GAL_RASTEROPERATION sSetRop; + + INIT_GAL(&sSetRop); + sSetRop.dwSubfunction = GALFN_SETRASTEROPERATION; + sSetRop.cRop = rop; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetRop)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_pattern_fill + * + * Description: This function renders pattern data to a rectangular + * region. + * parameters: + * x: It specifies the screen X position, in pixels. + * y: It specifies the screen Y position, in pixels. + * width: It specifies the width of rectangle, in pixels. + * height: It specifies the height of rectangle, in pixels. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pattern_fill(unsigned short x, unsigned short y, + unsigned short width, unsigned short height) +{ + GAL_PATTERNFILL sPatternFill; + + INIT_GAL(&sPatternFill); + sPatternFill.dwSubfunction = GALFN_PATTERNFILL; + sPatternFill.wXPos = x; + sPatternFill.wYPos = y; + sPatternFill.wWidth = width; + sPatternFill.wHeight = height; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sPatternFill)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_screen_to_screen_blt + * + * Description: This function is used to perform a screen to screen + * BLT operation. + * parameters: + * srcx: It specifies the source X position. + * srcy: It specifies the source Y position. + * dstx: It specifies the destination X position. + * dsty: It specifies the destination Y position. + * width: It specifies the width of BLT, in pixels. + * height: It specifies the height of BLT, in pixels. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, + unsigned short dstx, unsigned short dsty, + unsigned short width, unsigned short height) +{ + GAL_SCREENTOSCREENBLT sScreenBlt; + + INIT_GAL(&sScreenBlt); + sScreenBlt.dwSubfunction = GALFN_SCREENTOSCREENBLT; + sScreenBlt.wXStart = srcx; + sScreenBlt.wYStart = srcy; + sScreenBlt.wXEnd = dstx; + sScreenBlt.wYEnd = dsty; + sScreenBlt.wWidth = width; + sScreenBlt.wHeight = height; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sScreenBlt)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_screen_to_screen_xblt + * + * Description: This function is used to perform a screen to screen + * BLT operation using a transparency color. + * parameters: + * srcx: It specifies the source X position. + * srcy: It specifies the source Y position. + * dstx: It specifies the destination X position. + * dsty: It specifies the destination Y position. + * width: It specifies the width of BLT, in pixels. + * height: It specifies the height of BLT, in pixels. + * color: It specifies the transparency color. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, + unsigned short dstx, unsigned short dsty, + unsigned short width, unsigned short height, + unsigned long color) +{ + GAL_SCREENTOSCREENXBLT sScreenXBlt; + + INIT_GAL(&sScreenXBlt); + sScreenXBlt.dwSubfunction = GALFN_SCREENTOSCREENXBLT; + sScreenXBlt.wXStart = srcx; + sScreenXBlt.wYStart = srcy; + sScreenXBlt.wXEnd = dstx; + sScreenXBlt.wYEnd = dsty; + sScreenXBlt.wWidth = width; + sScreenXBlt.wHeight = height; + sScreenXBlt.dwColor = color; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sScreenXBlt)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_bresenham_line + * + * Description: This function is used to draw a single pixel line + * using the specified Bresenham parameters. + * parameters: + * x: It specifies the starting X position. + * y: It specifies the starting Y position. + * length: It specifies the length of the vector, in pixels. + * initerr: It specifies the Bresenham initial error term. + * axialerr: It specifies the Bresenham axial error term + * (moving in major direction only). + * diagerr: It specifies Bresenham diagonal error term + * (moving in major and minor direction. + * flags: It specifies the flag. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_bresenham_line(unsigned short x, unsigned short y, + unsigned short length, unsigned short initerr, + unsigned short axialerr, unsigned short diagerr, + unsigned short flags) +{ + GAL_BRESENHAMLINE sBresenhamLine; + + INIT_GAL(&sBresenhamLine); + sBresenhamLine.dwSubfunction = GALFN_BRESENHAMLINE; + sBresenhamLine.wX1 = x; + sBresenhamLine.wY1 = y; + sBresenhamLine.wLength = length; + sBresenhamLine.wErr = initerr; + sBresenhamLine.wE1 = axialerr; + sBresenhamLine.wE2 = diagerr; + sBresenhamLine.wFlags = flags; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBresenhamLine)) + return 0; + else + return 1; +} + +BOOLEAN +Gal_color_pattern_fill(unsigned short x, unsigned short y, + unsigned short width, unsigned short height, + unsigned long pattern) +{ + GAL_COLOR_PATTERNFILL sColorPat; + + INIT_GAL(&sColorPat); + sColorPat.dwSubfunction = GALFN_COLOR_PATTERNFILL; + sColorPat.wDstx = x; + sColorPat.wDsty = y; + sColorPat.wWidth = width; + sColorPat.wHeight = height; + sColorPat.dwPattern = pattern; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sColorPat)) + return 0; + else + return 1; +} + +BOOLEAN +Gal_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, + unsigned short dstx, unsigned short dsty, + unsigned short width, unsigned short height, + unsigned long data, long pitch) +{ + GAL_COLOR_BITMAP_TO_SCREEN_BLT sBmp2Scr; + + INIT_GAL(&sBmp2Scr); + sBmp2Scr.dwSubfunction = GALFN_COLOR_BITMAP_TO_SCREEN_BLT; + sBmp2Scr.wSrcx = srcx; + sBmp2Scr.wSrcy = srcy; + sBmp2Scr.wDstx = dstx; + sBmp2Scr.wDsty = dsty; + sBmp2Scr.wWidth = width; + sBmp2Scr.wHeight = height; + sBmp2Scr.dwData = data; + sBmp2Scr.wPitch = pitch; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBmp2Scr)) + return 0; + else + return 1; +} + +BOOLEAN +Gal_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, + unsigned short dstx, unsigned short dsty, + unsigned short width, unsigned short height, + unsigned long data, long pitch, + unsigned long color) +{ + GAL_COLOR_BITMAP_TO_SCREEN_XBLT sBmp2Scr; + + INIT_GAL(&sBmp2Scr); + sBmp2Scr.dwSubfunction = GALFN_COLOR_BITMAP_TO_SCREEN_XBLT; + sBmp2Scr.wSrcx = srcx; + sBmp2Scr.wSrcy = srcy; + sBmp2Scr.wDstx = dstx; + sBmp2Scr.wDsty = dsty; + sBmp2Scr.wWidth = width; + sBmp2Scr.wHeight = height; + sBmp2Scr.dwData = data; + sBmp2Scr.wPitch = pitch; + sBmp2Scr.dwColor = color; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBmp2Scr)) + return 0; + else + return 1; +} + +BOOLEAN +Gal_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, + unsigned short dstx, unsigned short dsty, + unsigned short width, unsigned short height, + unsigned long data, short pitch) +{ + GAL_MONO_BITMAP_TO_SCREEN_BLT sBmp2Scr; + + INIT_GAL(&sBmp2Scr); + sBmp2Scr.dwSubfunction = GALFN_MONO_BITMAP_TO_SCREEN_BLT; + sBmp2Scr.wSrcx = srcx; + sBmp2Scr.wSrcy = srcy; + sBmp2Scr.wDstx = dstx; + sBmp2Scr.wDsty = dsty; + sBmp2Scr.wWidth = width; + sBmp2Scr.wHeight = height; + sBmp2Scr.dwData = data; + sBmp2Scr.wPitch = pitch; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBmp2Scr)) + return 0; + else + return 1; +} + +BOOLEAN +Gal_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, + unsigned short height, unsigned long data) +{ + GAL_TEXT_BLT sTextBlt; + + INIT_GAL(&sTextBlt); + sTextBlt.dwSubfunction = GALFN_TEXT_BLT; + sTextBlt.wDstx = dstx; + sTextBlt.wDsty = dsty; + sTextBlt.wWidth = width; + sTextBlt.wHeight = height; + sTextBlt.dwData = data; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sTextBlt)) + return 0; + else + return 1; +} + +/*------------------------------------------------------------------------ + * Gal_set_compression_enable + * + * Description: This function enables or disables display + * compression. + * parameters: + * bCompressionState: It specifies the display compression state. + * return: '1' was returned on success otherwise + * '0' was returned. + *----------------------------------------------------------------------*/ +BOOLEAN +Gal_set_compression_enable(BOOLEAN bCompressionState) +{ + GAL_COMPRESSIONSTATE sCompState; + + INIT_GAL(&sCompState); + sCompState.dwSubfunction = GALFN_SETCOMPRESSIONSTATE; + sCompState.bCompressionState = bCompressionState; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCompState)) + return 0; + else + return 1; +} + +/*------------------------------------------------------------------------ + * Gal_get_compression_enable + * + * Description: This function gets the compression state. + * + * parameters: + * bCompressionState: gets the display compression state. + * return: '1' was returned on success otherwise + * '0' was returned. + *----------------------------------------------------------------------*/ +BOOLEAN +Gal_get_compression_enable(int *bCompressionState) +{ + GAL_COMPRESSIONSTATE sCompState; + + INIT_GAL(&sCompState); + sCompState.dwSubfunction = GALFN_GETCOMPRESSIONSTATE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCompState)) + return 0; + else { + *bCompressionState = sCompState.bCompressionState; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_compression_parameters + * + * Description: This function sets the compression parameters of the + * frame buffer device. + * parameters: + * flags: It specifies the flag. + * offset: It specifies the base offset in graphics memory for the + * compression buffer. + * pitch: It specifies the pitch of compression buffer, in bytes. + * size: It specifies the maximum line size of the compression buffer + * in bytes. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_compression_parameters(unsigned long flags, + unsigned long offset, unsigned short pitch, + unsigned short size) +{ + GAL_COMPRESSIONPARAMS sCompParams; + + INIT_GAL(&sCompParams); + sCompParams.dwSubfunction = GALFN_SETCOMPRESSIONPARAMS; + sCompParams.dwFlags = flags; + sCompParams.dwCompOffset = offset; + sCompParams.dwCompPitch = pitch; + sCompParams.dwCompSize = size; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCompParams)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_get_compression_parameters + * + * Description: This function gets the compression parameters of the + * frame buffer device. + * parameters: + * flags: It specifies the flag. + * offset: gets the base offset in graphics memory for the + * compression buffer. + * pitch: gets the pitch of compression buffer, in bytes. + * size: gets the maximum line size of the compression buffer + * in bytes. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_compression_parameters(unsigned long flags, + unsigned long *offset, + unsigned short *pitch, unsigned short *size) +{ + GAL_COMPRESSIONPARAMS sCompParams; + + INIT_GAL(&sCompParams); + sCompParams.dwSubfunction = GALFN_GETCOMPRESSIONPARAMS; + sCompParams.dwFlags = flags; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sCompParams)) + return 0; + else { + *offset = sCompParams.dwCompOffset; + *pitch = sCompParams.dwCompPitch; + *size = sCompParams.dwCompSize; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_vga_mode_switch + * + * Description:This function signals the beginning or end of a + * mode switch. + * parameters: + * active: It specifies the mode switch. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_mode_switch(int active) +{ + GAL_VGAMODEDATA sVgaData; + + INIT_GAL(&sVgaData); + sVgaData.dwSubfunction = GALFN_VGAMODESWITCH; + sVgaData.dwFlags = active; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgaData)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_vga_clear_extended + * + * Description: This will clear the Svga data. + * parameters: none. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_clear_extended(void) +{ + GAL_VGAMODEDATA sVgaData; + + INIT_GAL(&sVgaData); + sVgaData.dwSubfunction = GALFN_VGACLEARCRTEXT; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sVgaData)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_vga_pitch + * + * Description: This function sets VGA register values in VGA + * structure for specified pitch. + * parameters: + * pVgaData: It specifies the vga structure. + * pitch: It specifies the number of bytes between scanlines. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_pitch(PGAL_VGAMODEDATA pVgaData, unsigned short pitch) +{ + INIT_GAL(pVgaData); + pVgaData->dwSubfunction = GALFN_VGASETPITCH; + pVgaData->dwFlags = pitch; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pVgaData)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_vga_restore + * + * Description: This function sets the VGA state to the values in the + * VGA structure. + * parameters: + * pVgaData: It specifies the vga structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_restore(PGAL_VGAMODEDATA pVgaData) +{ + INIT_GAL(pVgaData); + pVgaData->dwSubfunction = GALFN_VGARESTORE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pVgaData)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_vga_save + * + * Description: This function saves the current VGA state in the + * VGA structure. + * parameters: + * pVgaData: It specifies the vga structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_save(PGAL_VGAMODEDATA pVgaData) +{ + INIT_GAL(pVgaData); + pVgaData->dwSubfunction = GALFN_VGASAVE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pVgaData)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_vga_mode + * + * Description: This function sets VGA register values in VGA + * structure for specified mode. + * parameters: + * pVgaData: It specifies the vga structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_vga_mode(PGAL_VGAMODEDATA pVgaData) +{ + INIT_GAL(pVgaData); + pVgaData->dwSubfunction = GALFN_VGASETMODE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pVgaData)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_pnl_enabled_in_bios + * + * Description: This function gets the status of the FP in BIOS. + * parameters: + * status: returns the state of FP in Bios. + * pParam: It specifies the panel parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pnl_enabled_in_bios(int *state) +{ + GAL_PNLBIOS pStat; + + INIT_GAL(&pStat); + pStat.dwSubfunction = GALFN_PNLBIOSENABLE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) + return 0; + else { + *state = pStat.state; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_pnl_info_from_bios + * + * Description: This function gets the parameters of the FP in BIOS. + * parameters: + * status: returns the state of FP in Bios. + * pParam: It specifies the panel parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pnl_info_from_bios(int *xres, int *yres, int *bpp, int *hz) +{ + GAL_PNLBIOS pStat; + + INIT_GAL(&pStat); + pStat.dwSubfunction = GALFN_PNLBIOSINFO; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) + return 0; + else { + *xres = pStat.XRes; + *yres = pStat.YRes; + *bpp = pStat.Bpp; + *hz = pStat.Freq; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_pnl_set_params + * + * Description: This function sets the panel parameters. + * parameters: + * flags: + * pParam: It specifies the panel parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pnl_set_params(unsigned long flags, PPnl_PanelParams pParam) +{ + GAL_PNLPARAMS pStat; + + INIT_GAL(&pStat); + pStat.dwSubfunction = GALFN_PNLSETPARAMS; + pParam->Flags = flags; + direct_memcpy(&(pStat.PanelParams), pParam, sizeof(Pnl_PanelParams)); + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_pnl_get_params + * + * Description: This function gets the panel parameters. + * parameters: + * flags: + * pParam: It specifies the panel parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pnl_get_params(unsigned long flags, PPnl_PanelParams pParam) +{ + GAL_PNLPARAMS pStat; + + INIT_GAL(&pStat); + pStat.dwSubfunction = GALFN_PNLGETPARAMS; + direct_memcpy(&(pStat.PanelParams), pParam, sizeof(Pnl_PanelParams)); + pStat.PanelParams.Flags = flags; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) + return 0; + else { + direct_memcpy(pParam, &(pStat.PanelParams), sizeof(Pnl_PanelParams)); + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_pnl_init + * + * Description: This function initializes the panel parameters. + * parameters: + * pParam: It specifies the panel parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pnl_init(PPnl_PanelParams pParam) +{ + GAL_PNLPARAMS pStat; + + INIT_GAL(&pStat); + pStat.dwSubfunction = GALFN_PNLINITPANEL; + direct_memcpy(&(pStat.PanelParams), pParam, sizeof(Pnl_PanelParams)); + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) + return 0; + else + return 1; + +} + +/*-------------------------------------------------------------------------- + * Gal_pnl_save + * + * Description: This function saves the current panel parameters. + * parameters: none. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pnl_save(void) +{ + GAL_PNLPARAMS pStat; + + INIT_GAL(&pStat); + pStat.dwSubfunction = GALFN_PNLSAVESTATE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_pnl_restore + * + * Description: This function restores the current panel parameters. + * parameters: none. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pnl_restore(void) +{ + GAL_PNLPARAMS pStat; + + INIT_GAL(&pStat); + pStat.dwSubfunction = GALFN_PNLRESTORESTATE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_pnl_powerup + * + * Description: This function powers up the panel. + * parameters: none. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pnl_powerup(void) +{ + GAL_BASE pStat; + + INIT_GAL(&pStat); + pStat.dwSubfunction = GALFN_PNLPOWERUP; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_pnl_powerdown + * + * Description: This function powers down the panel. + * parameters: none. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_pnl_powerdown(void) +{ + GAL_BASE pStat; + + INIT_GAL(&pStat); + pStat.dwSubfunction = GALFN_PNLPOWERDOWN; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pStat)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_enable_panning + * + * Description: This routine enables the panning when the Mode + * is bigger than the panel size. + * parameters: + * x: x-positon of the screen. + * y: y-positon of the screen. + * + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_enable_panning(int x, int y) +{ + GAL_ENABLEPANNING pEnablePanning; + + INIT_GAL(&pEnablePanning); + pEnablePanning.dwSubfunction = GALFN_ENABLEPANNING; + pEnablePanning.x = x; + pEnablePanning.y = y; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pEnablePanning)) + return 0; + else { + return 1; + } +} + + +/*-------------------------------------------------------------------------- + * Gal_tv_set_params + * + * Description: This function sets the tv parameters of + * tvparameters structure. + * parameters: + * flags: + * pTV: It specifies the tv parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_tv_set_params(unsigned long flags, PGAL_TVPARAMS pTV) +{ + INIT_GAL(pTV); + pTV->dwSubfunction = GALFN_SETTVPARAMS; + pTV->dwFlags = flags; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_tv_get_params + * + * Description: This function gets the tv parameters of + * tvparameters structure. + * parameters: + * flags: Dummy flag + * pTV: It specifies the tv parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_tv_get_params(unsigned long flags, PGAL_TVPARAMS pTV) +{ + INIT_GAL(pTV); + pTV->dwSubfunction = GALFN_GETTVPARAMS; + pTV->dwFlags = flags; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) + return 0; + else + return 1; + +} + +/*-------------------------------------------------------------------------- + * Gal_tv_set_timings + * + * Description: This function sets the tv timing registers. + * parameters: + * flags: Dummy flag. + * pTV: It specifies the tv parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_tv_set_timings(unsigned long flags, PGAL_TVTIMING pTV) +{ + INIT_GAL(pTV); + pTV->dwSubfunction = GALFN_SETTVTIMING; + pTV->dwFlags = flags; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_tv_get_timings + * + * Description: This function gets the tv timing registers. + * parameters: + * flags: Dummy flag. + * pTV: It specifies the tv parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_tv_get_timings(unsigned long flags, PGAL_TVTIMING pTV) +{ + INIT_GAL(pTV); + pTV->dwSubfunction = GALFN_GETTVTIMING; + pTV->dwFlags = flags; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_tv_enable + * + * Description: This function sets the tv state of the device . + * parameters: + * bState : set the tv state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_tv_enable(int bState) +{ + GAL_TVPARAMS pTV; + + INIT_GAL(&pTV); + pTV.dwSubfunction = GALFN_SETENABLE; + pTV.bState = bState; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pTV)) + return 0; + else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_tv_enable + * + * Description: This function gets the tv state of the device . + * parameters: + * bState : get the tv state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_tv_enable(unsigned int *bState) +{ + GAL_TVPARAMS pTV; + + INIT_GAL(&pTV); + pTV.dwSubfunction = GALFN_GETENABLE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &pTV)) { + *bState = 0; + return 0; + } else { + *bState = pTV.bState; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_is_tv_mode_supported + * + * Description: This function checks the tv mode is supported or not. + * parameters: + * flags: Dummy flag + * pTV: It specifies the tv parameters structure. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_is_tv_mode_supported(unsigned long flags, PGAL_TVPARAMS pTV, int *bState) +{ + INIT_GAL(pTV); + pTV->dwSubfunction = GALFN_ISTVMODESUPPORTED; + pTV->dwFlags = flags; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, pTV)) { + return 0; + } else { + *bState = pTV->bState; + return 1; + } +} + +/** Video **********************************************************/ + +/*-------------------------------------------------------------------------- + * Gal_set_video_enable + * + * Description: This function sets the video enable state. + * parameters: + * enable: Its value is '1' to enable video and '0' to disable video. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_enable(int enable) +{ + GAL_VIDEOENABLE sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOENABLE; + sSetVideo.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_format + * + * Description: This function sets the video format. + * parameters: + * format: Its video format value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_format(int format) +{ + GAL_VIDEOFORMAT sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOFORMAT; + sSetVideo.format = format; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_size + * + * Description: This function sets the video size. + * parameters: + * width: Width of the video. + * height: Height of the video. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_size(unsigned short width, unsigned short height) +{ + GAL_VIDEOSIZE sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOSIZE; + sSetVideo.width = width; + sSetVideo.height = height; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_offset + * + * Description: This function sets the video size. + * parameters: + * offset: Offset of the video. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_offset(unsigned long offset) +{ + GAL_VIDEOOFFSET sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOOFFSET; + sSetVideo.offset = offset; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_window + * + * Description: This function sets the video window. + * parameters: + * x: X co-ordinate of the Video screen. + * y: Y co-ordinate of the Video screen. + * w: Width of the Video screen. + * h: Height of the Video screen. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_window(short x, short y, short w, short h) +{ + GAL_VIDEOWINDOW sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOWINDOW; + sSetVideo.x = x; + sSetVideo.y = y; + sSetVideo.w = w; + sSetVideo.h = h; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_scale + * + * Description: This function sets the video scale. + * parameters: + * srcw: Source width. + * srch: Source height. + * dstw: Destination width. + * dsth: Destination height. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_scale(unsigned short srcw, unsigned short srch, + unsigned short dstw, unsigned short dsth) +{ + GAL_VIDEOSCALE sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOSCALE; + sSetVideo.srcw = srcw; + sSetVideo.srch = srch; + sSetVideo.dstw = dstw; + sSetVideo.dsth = dsth; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_filter. + * + * Description: This function sets the video filter. + * parameters: + * xfilter: X-co-ordinate filter. + * yfilter: Y-co-ordinate filter. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_filter(int xfilter, int yfilter) +{ + GAL_VIDEOFILTER sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOFILTER; + sSetVideo.xfilter = xfilter; + sSetVideo.yfilter = yfilter; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_color_key. + * + * Description: This function sets the video color key. + * parameters: + * key: Color key. + * mask: Color mask. + * bluescreen: Value for bluescreen. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_color_key(unsigned long key, unsigned long mask, int bluescreen) +{ + GAL_VIDEOCOLORKEY sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOCOLORKEY; + sSetVideo.key = key; + sSetVideo.mask = mask; + sSetVideo.bluescreen = bluescreen; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_downscale_enable. + * + * Description: This function sets the video downscale enable state. + * parameters: + * enable: Value for enable or disable the video downscale. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_downscale_enable(int enable) +{ + GAL_VIDEODOWNSCALEENABLE sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEODOWNSCALEENABLE; + sSetVideo.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_downscale_config. + * + * Description: This function sets the video downscale configuration. + * parameters: + * type: Video down scale type. + * m: Factor for the Video overlay window. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_downscale_config(unsigned short type, unsigned short m) +{ + GAL_VIDEODOWNSCALECONFIG sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEODOWNSCALECONFIG; + sSetVideo.type = type; + sSetVideo.m = m; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_downscale_coefficients. + * + * Description: This function sets the video downscale coefficients. + * parameters: + * coef1: Video downscale filter coefficient. + * coef2: Video downscale filter coefficient. + * coef3: Video downscale filter coefficient. + * coef4: Video downscale filter coefficient. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_downscale_coefficients(unsigned short coef1, + unsigned short coef2, + unsigned short coef3, + unsigned short coef4) +{ + GAL_VIDEODOWNSCALECOEFF sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEODOWNSCALECOEFF; + sSetVideo.coef1 = coef1; + sSetVideo.coef2 = coef2; + sSetVideo.coef3 = coef3; + sSetVideo.coef4 = coef4; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_source. + * + * Description: This function sets the video source to either memory or Direct + * VIP + * parameters: + * source: Video source. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_source(int source) +{ + GAL_VIDEOSOURCE sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOSOURCE; + sSetVideo.source = source; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_interlaced + * + * Description: This function configures the Video processor video overlay mode + * to be interlaced YUV. + * parameters: + * enable: Value used to enable or disalbe the Video interlaced. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ + +BOOLEAN +Gal_set_video_interlaced(int enable) +{ + GAL_SETVIDEOINTERLACED sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOINTERLACED; + sSetVideo.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_color_space + * + * Description: This function configures the Video processor to prcoess + * graphics and video in either YUV or RGB color space. + * + * parameters: + * enable: Value used to enable or disalbe the Video color space. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_color_space_YUV(int colorspace) +{ + GAL_COLORSPACEYUV sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOCOLORSPACE; + sSetVideo.colorspace = colorspace; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_cursor. + * + * Description: This function configures the Video Hardware cursor. + * + * + * parameters: + * key: color key. + * mask: color mask. + *select_color2: selected for color2. + * color1: color1 value. + * color2: color2 value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_cursor(unsigned long key, + unsigned long mask, + unsigned short select_color2, + unsigned long color1, unsigned long color2) +{ + GAL_VIDEOCURSOR sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOCURSOR; + sSetVideo.key = key; + sSetVideo.mask = mask; + sSetVideo.select_color2 = select_color2; + sSetVideo.color1 = color1; + sSetVideo.color2 = color2; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_request. + * + * Description: This function sets the horizontal(pixel) and vertical(line) + * video request values. + * + * parameters: + * x: X video request value. + * y: Y video request value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_request(short x, short y) +{ + GAL_VIDEOREQUEST sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOREQUEST; + sSetVideo.x = x; + sSetVideo.y = y; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_alpha_enable. + * + * Description: This function enables or disables the currently selected + * alpha region. + * + * parameters: + * enable: Value to enalbe or disable alha region. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_alpha_enable(int enable) +{ + GAL_ALPHAENABLE sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETALPHAENABLE; + sSetVideo.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_get_alpha_enable. + * + * Description: This function gets the alpha enable state. + * + * parameters: + * enable: Pointer to get the enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_alpha_enable(int *enable) +{ + GAL_ALPHAENABLE sGetalphaenable; + + INIT_GAL(&sGetalphaenable); + sGetalphaenable.dwSubfunction = GALFN_GETALPHAENABLE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphaenable)) + return 0; + else + + *enable = sGetalphaenable.enable; + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_alpha_window + * + * Description: This function sets the size of the currently selected + * alpha region. + * parameters: + * x: X co-ordinate of the alpha region. + * y: Y co-ordinate of the alpha region. + * width: Width of the alpha region. + * height: Height of the alpha region. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_alpha_window(short x, short y, + unsigned short width, unsigned short height) +{ + GAL_ALPHAWINDOW sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETALPHAWINDOW; + sSetVideo.x = x; + sSetVideo.y = y; + sSetVideo.width = width; + sSetVideo.height = height; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_get_alpha_size + * + * Description: This function gets the size of the currently selected + * alpha region. + * parameters: + * x: X co-ordinate of the alpha region. + * y: Y co-ordinate of the alpha region. + * width: Width of the alpha region. + * height: Height of the alpha region. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_alpha_size(unsigned short *x, unsigned short *y, + unsigned short *width, unsigned short *height) +{ + GAL_ALPHASIZE sGetalphasize; + + INIT_GAL(&sGetalphasize); + sGetalphasize.dwSubfunction = GALFN_GETALPHASIZE; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphasize)) + return 0; + else { + *x = *(sGetalphasize.x); + *y = *(sGetalphasize.y); + *width = *(sGetalphasize.width); + *height = *(sGetalphasize.height); + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_alpha_value + * + * Description: This function sets the alpha value for the selected alpha + * region. It also specifies an increment/decrement value for + * fading. + * parameters: + * alpha: Alpha value for the currently selected alpha region. + * delta: Gives the increment/decrement fading value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_alpha_value(unsigned char alpha, char delta) +{ + GAL_ALPHAVALUE sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETALPHAVALUE; + sSetVideo.alpha = alpha; + sSetVideo.delta = delta; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_get_alpha_value + * + * Description: This function gets the alpha value for the selected alpha + * region. It also gets increment/decrement value for + * fading. + * parameters: + * alpha: Alpha value for the currently selected alpha region. + * delta: Gives the increment/decrement fading value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_alpha_value(unsigned char *alpha, char *delta) +{ + GAL_ALPHAVALUE sGetalphavalue; + + INIT_GAL(&sGetalphavalue); + sGetalphavalue.dwSubfunction = GALFN_GETALPHAVALUE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphavalue)) + return 0; + else { + *alpha = sGetalphavalue.alpha; + *delta = sGetalphavalue.delta; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_alpha_priority + * + * Description: This function sets the priority of the selected alpha + * region. + * parameters: + * priority: Gives the priority value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_alpha_priority(int priority) +{ + GAL_ALPHAPRIORITY sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETALPHAPRIORITY; + sSetVideo.priority = priority; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_get_alpha_priority + * + * Description: This function gets the priority of the selected alpha + * region. + * parameters: + * priority: Gives the priority value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_alpha_priority(int *priority) +{ + GAL_ALPHAPRIORITY sGetalphapriority; + + INIT_GAL(&sGetalphapriority); + sGetalphapriority.dwSubfunction = GALFN_GETALPHAPRIORITY; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphapriority)) + return 0; + else { + *priority = sGetalphapriority.priority; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_alpha_color + * + * Description: This function sets the color to be displayed inside the + * currently of the selected alpha window. + * parameters: + * color: Gives the color value to be displayed. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_alpha_color(unsigned long color) +{ + GAL_ALPHACOLOR sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETALPHACOLOR; + sSetVideo.color = color; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_get_alpha_color + * + * Description: This function gets the color to be displayed inside the + * currently of the selected alpha window. + * parameters: + * color: Gives the color value to be displayed. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_alpha_color(unsigned long *color) +{ + GAL_ALPHACOLOR sGetalphacolor; + + INIT_GAL(&sGetalphacolor); + sGetalphacolor.dwSubfunction = GALFN_GETALPHACOLOR; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetalphacolor)) + return 0; + else { + *color = sGetalphacolor.color; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_select_alpha_region + * + * Description: This function selects the alpha region should be used for + * future updates. + * parameters: + * region: Gives the alpha window number. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_select_alpha_region(int region) +{ + GAL_ALPHAREGION sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETALPHAREGION; + sSetVideo.region = region; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_outside_alpha + * + * Description: This function enable/disable the video outside alpha region. + * parameters: + * enable: Gives the value for enable/disable. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_outside_alpha(int enable) +{ + GAL_VIDEOOUTSIDEALPHA sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOOUTSIDEALPHA; + sSetVideo.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_palette + * + * Description: This function loads the video hardware palette. + * parameters: + * palette: Gives value for hardware palette. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_palette(unsigned long *palette) +{ + GAL_VIDEOPALETTE sSetVideo; + + INIT_GAL(&sSetVideo); + sSetVideo.dwSubfunction = GALFN_SETVIDEOPALETTE; + + if (palette == NULL) { + sSetVideo.identity = 1; + } else { + sSetVideo.identity = 0; + direct_memcpy(sSetVideo.palette, palette, 256 * sizeof(*palette)); + } + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideo)) + return 0; + else + return 1; +} + +/** Video **********************************************************/ + +/*-------------------------------------------------------------------------- + * Gal_set_icon_enable + * + * Description: This function enable/disables the hardware icon. The icon + * position and colors should be programmed prior to calling + * this routine. + * parameters: + * enable: Gives value for enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_icon_enable(int enable) +{ + GAL_ICONENABLE sSetIconenable; + + INIT_GAL(&sSetIconenable); + sSetIconenable.dwSubfunction = GALFN_SETICONENABLE; + sSetIconenable.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetIconenable)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_icon_colors + * + * Description: This function sets the three hardware icon colors. + * parameters: + * color0: Gives first color value. + * color1: Gives second color value. + * color2: Gives third color value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_icon_colors(unsigned long color0, unsigned long color1, + unsigned long color2) +{ + GAL_ICONCOLORS sSetIconcolors; + + INIT_GAL(&sSetIconcolors); + sSetIconcolors.dwSubfunction = GALFN_SETICONCOLORS; + sSetIconcolors.color0 = color0; + sSetIconcolors.color1 = color1; + sSetIconcolors.color2 = color2; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetIconcolors)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_icon_position. + * + * Description: This function sets the hardware icon position. + * parameters: + * memoffset: Memory offset of the icon buffer. + * xpos: Starting X co-ordinate for the hardware icon. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_icon_position(unsigned long memoffset, unsigned short xpos) +{ + GAL_ICONPOSITION sSetIconposi; + + INIT_GAL(&sSetIconposi); + sSetIconposi.dwSubfunction = GALFN_SETICONPOSITION; + sSetIconposi.memoffset = memoffset; + sSetIconposi.xpos = xpos; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetIconposi)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_icon_shape64. + * + * Description: This function initializes the icon buffer according to + * the current mode. + * parameters: + * memoffset: Memory offset of the icon buffer. + * andmask: Andmask of the icon buffer. + * xormask: Xormask of the icon buffer. + * lines: Lines of the icon buffer. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, + unsigned long *xormask, unsigned int lines) +{ + GAL_ICONSHAPE64 sSetIconshape64; + + INIT_GAL(&sSetIconshape64); + sSetIconshape64.dwSubfunction = GALFN_SETICONSHAPE64; + sSetIconshape64.memoffset = memoffset; + *(sSetIconshape64.andmask) = *andmask; + *(sSetIconshape64.xormask) = *xormask; + sSetIconshape64.lines = lines; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetIconshape64)) { + return 0; + } else { + return 1; + } +} + +/* VIP Functions */ + +/*-------------------------------------------------------------------------- + * Gal_set_vip_enable + * + * Description: This function enable/disables the writes to memory from the + * video port. + * position and colors should be programmed prior to calling + * this routine. + * parameters: + * enable: Gives value for enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vip_enable(int enable) +{ + GAL_VIPENABLE sSetVipenable; + + INIT_GAL(&sSetVipenable); + sSetVipenable.dwSubfunction = GALFN_SETVIPENABLE; + sSetVipenable.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipenable)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vip_enable + * + * Description: This function gets the enable state of the + * video port. + * parameters: + * enable: Gives value for enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vip_enable(int *enable) +{ + GAL_VIPENABLE sGetVipenable; + + INIT_GAL(&sGetVipenable); + sGetVipenable.dwSubfunction = GALFN_GETVIPENABLE; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipenable)) { + return 0; + } else { + + *enable = sGetVipenable.enable; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vip_capture_run_mode + * + * Description: This function selects the VIP capture run mode. + * + * parameters: + * mode: VIP capture run mode. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vip_capture_run_mode(int mode) +{ + GAL_VIPCAPTURERUNMODE sSetVipcapturerunmode; + + INIT_GAL(&sSetVipcapturerunmode); + sSetVipcapturerunmode.dwSubfunction = GALFN_SETVIPCAPTURERUNMODE; + sSetVipcapturerunmode.mode = mode; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipcapturerunmode)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vip_base + * + * Description: This routine sets the odd and even base address values for + * the VIP memory buffer. + * parameters: + * even: Even base address. + * odd: odd base address. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vip_base(unsigned long even, unsigned long odd) +{ + GAL_VIPBASE sSetVipBase; + + INIT_GAL(&sSetVipBase); + sSetVipBase.dwSubfunction = GALFN_SETVIPBASE; + sSetVipBase.even = even; + sSetVipBase.odd = odd; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipBase)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vip_base + * + * Description: This routine gets the base address value for + * the VIP memory buffer. + * parameters: + * address: VIP base address. + * odd: odd base address. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vip_base(unsigned long *address, int odd) +{ + GAL_VIPBASE sGetVipBase; + + INIT_GAL(&sGetVipBase); + sGetVipBase.dwSubfunction = GALFN_GETVIPBASE; + sGetVipBase.odd = odd; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipBase)) { + return 0; + } else { + *address = sGetVipBase.address; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vip_pitch + * + * Description: This routine sets the number of bytes between scanlines + * for the VIP data. + * parameters: + * pitch: VIP pitch. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vip_pitch(unsigned long pitch) +{ + GAL_VIPPITCH sSetVipPitch; + + INIT_GAL(&sSetVipPitch); + sSetVipPitch.dwSubfunction = GALFN_SETVIPPITCH; + sSetVipPitch.pitch = pitch; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipPitch)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vip_pitch + * + * Description: This routine gets the number of bytes between scanlines + * for the VIP data. + * parameters: + * pitch: VIP pitch. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vip_pitch(unsigned long *pitch) +{ + GAL_VIPPITCH sGetVipPitch; + + INIT_GAL(&sGetVipPitch); + sGetVipPitch.dwSubfunction = GALFN_GETVIPPITCH; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipPitch)) { + return 0; + } else { + *pitch = sGetVipPitch.pitch; + return 1; + + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vip_mode + * + * Description: This routine sets the VIP operating mode. + * parameters: + * mode: VIP operating mode. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vip_mode(int mode) +{ + GAL_VIPMODE sSetVipMode; + + INIT_GAL(&sSetVipMode); + sSetVipMode.dwSubfunction = GALFN_SETVIPMODE; + sSetVipMode.mode = mode; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipMode)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vip_mode + * + * Description: This routine gets the VIP operating mode. + * parameters: + * mode: VIP operating mode. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vip_mode(int *mode) +{ + GAL_VIPMODE sGetVipMode; + + INIT_GAL(&sGetVipMode); + sGetVipMode.dwSubfunction = GALFN_GETVIPMODE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipMode)) { + return 0; + } else { + + *mode = sGetVipMode.mode; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vip_bus_request_threshold_high + * + * Description: This function sets the VIP FIFO bus request threshold. + * + * parameters: + * enable: Enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vip_bus_request_threshold_high(int enable) +{ + GAL_VIPBUS_RTH sSetVipBRTH; + + INIT_GAL(&sSetVipBRTH); + sSetVipBRTH.dwSubfunction = GALFN_SETVIPBRTH; + sSetVipBRTH.enable = enable; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVipBRTH)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vip_bus_request_threshold_high + * + * Description: This function gets the VIP FIFO bus request threshold. + * + * parameters: + * enable: Enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vip_bus_request_threshold_high(int *enable) +{ + GAL_VIPBUS_RTH sGetVipBRTH; + + INIT_GAL(&sGetVipBRTH); + sGetVipBRTH.dwSubfunction = GALFN_GETVIPBRTH; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipBRTH)) { + return 0; + } else { + + *enable = sGetVipBRTH.enable; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vip_last_line + * + * Description: This function sets the maximum number of lines captured + * in each field. + * + * parameters: + * last_line: Maximum number of lines captured in each field. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vip_last_line(int last_line) +{ + GAL_VIPLASTLINE sSetViplastline; + + INIT_GAL(&sSetViplastline); + sSetViplastline.dwSubfunction = GALFN_SETVIPLASTLINE; + sSetViplastline.last_line = last_line; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetViplastline)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vip_line + * + * Description: This function gets the number of the current video line being + * recieved by the VIP interface. + * + * parameters: + * vip_line: Number of the current video line. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vip_line(int *vip_line) +{ + GAL_VIPLINE sGetVipline; + + INIT_GAL(&sGetVipline); + sGetVipline.dwSubfunction = GALFN_GETVIPLINE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVipline)) { + return 0; + } else { + *vip_line = sGetVipline.status; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_test_vip_odd_field + * + * Description: This function tests the VIP odd field. + * + * parameters: + * status: Status of the odd field. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_test_vip_odd_field(int *status) +{ + GAL_TESTVIPODDFIELD sTestVipoddfield; + + INIT_GAL(&sTestVipoddfield); + sTestVipoddfield.dwSubfunction = GALFN_TESTVIPODDFIELD; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sTestVipoddfield)) { + return 0; + } else { + *status = sTestVipoddfield.status; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_test_vip_bases_updated + * + * Description: This function tests the VIP bases updated. + * + * parameters: + * status: Status of the VIP bases updated. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_test_vip_bases_updated(int *status) +{ + GAL_TESTVIPBASESUPDATED sTestVipbasesupdated; + + INIT_GAL(&sTestVipbasesupdated); + sTestVipbasesupdated.dwSubfunction = GALFN_TESTVIPBASESUPDATED; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sTestVipbasesupdated)) { + return 0; + } else { + *status = sTestVipbasesupdated.status; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_test_vip_fifo_overflow + * + * Description: This function tests the VIP FIFO overflow. + * + * parameters: + * status: Status of the VIP FIFO overflow. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_test_vip_fifo_overflow(int *status) +{ + GAL_TESTVIPOVERFLOW sTestVipoverflow; + + INIT_GAL(&sTestVipoverflow); + sTestVipoverflow.dwSubfunction = GALFN_TESTVIPFIFOOVERFLOW; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sTestVipoverflow)) { + return 0; + } else { + *status = sTestVipoverflow.status; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_enable + * + * Description: This function enable/disables the VBI data capture. + * + * parameters: + * enable: VBI enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vbi_enable(int enable) +{ + GAL_VBIENABLE sSetVbienable; + + INIT_GAL(&sSetVbienable); + sSetVbienable.dwSubfunction = GALFN_SETVBIENABLE; + sSetVbienable.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbienable)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vbi_enable + * + * Description: This function gets the enable state of the VBI data capture. + * + * parameters: + * enable: VBI enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vbi_enable(int *enable) +{ + GAL_VBIENABLE sGetVbienable; + + INIT_GAL(&sGetVbienable); + sGetVbienable.dwSubfunction = GALFN_GETVBIENABLE; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbienable)) { + return 0; + } else { + + *enable = sGetVbienable.enable; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_base + * + * Description: This function sets the VBI base addresses. + * + * parameters: + * even: Even base address. + * odd: Odd base address. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vbi_base(unsigned long even, unsigned long odd) +{ + GAL_VBIBASE sSetVbiBase; + + INIT_GAL(&sSetVbiBase); + sSetVbiBase.dwSubfunction = GALFN_SETVBIBASE; + sSetVbiBase.even = even; + sSetVbiBase.odd = odd; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbiBase)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vbi_base + * + * Description: This function gets the VBI base address. + * + * parameters: + * address: VBI base address. + * odd: Odd base address. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vbi_base(unsigned long *address, int odd) +{ + GAL_VBIBASE sGetVbiBase; + + INIT_GAL(&sGetVbiBase); + sGetVbiBase.dwSubfunction = GALFN_GETVBIBASE; + sGetVbiBase.odd = odd; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbiBase)) { + return 0; + } else { + *address = sGetVbiBase.address; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_pitch + * + * Description: This function sets the number of bytes between scanlines for + * VBI capture. + * + * parameters: + * pitch: VBI pitch. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vbi_pitch(unsigned long pitch) +{ + GAL_VBIPITCH sSetVbiPitch; + + INIT_GAL(&sSetVbiPitch); + sSetVbiPitch.dwSubfunction = GALFN_SETVBIPITCH; + sSetVbiPitch.pitch = pitch; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbiPitch)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vbi_pitch + * + * Description: This function gets the number of bytes between scanlines for + * VBI capture. + * + * parameters: + * pitch: VBI pitch. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vbi_pitch(unsigned long *pitch) +{ + GAL_VBIPITCH sGetVbiPitch; + + INIT_GAL(&sGetVbiPitch); + sGetVbiPitch.dwSubfunction = GALFN_GETVBIPITCH; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbiPitch)) { + return 0; + } else { + *pitch = sGetVbiPitch.pitch; + return 1; + + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_mode + * + * Description: This function sets the VBI data types captured to memory. + * + * parameters: + * mode: VBI mode. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vbi_mode(int mode) +{ + GAL_VBIMODE sSetVbiMode; + + INIT_GAL(&sSetVbiMode); + sSetVbiMode.dwSubfunction = GALFN_SETVBIMODE; + sSetVbiMode.mode = mode; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbiMode)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vbi_mode + * + * Description: This function gets the VBI data types captured to memory. + * + * parameters: + * mode: VBI mode. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vbi_mode(int *mode) +{ + GAL_VBIMODE sGetVbiMode; + + INIT_GAL(&sGetVbiMode); + sGetVbiMode.dwSubfunction = GALFN_GETVBIMODE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbiMode)) { + return 0; + } else { + + *mode = sGetVbiMode.mode; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_direct + * + * Description: This function sets the VBI lines to be passed to the + * Direct VIP. + * + * parameters: + * even_lines: VBI even lines. + * odd_lines: VBI odd lines. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines) +{ + GAL_SETVBIDIRECT sSetVbidirect; + + INIT_GAL(&sSetVbidirect); + sSetVbidirect.dwSubfunction = GALFN_SETVBIDIRECT; + sSetVbidirect.even_lines = even_lines; + sSetVbidirect.odd_lines = odd_lines; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbidirect)) { + return 0; + } else { + return 1; + } +} +BOOLEAN +Gal2_set_destination_stride(unsigned short stride) +{ + GAL_STRIDE sSetStride; + + INIT_GAL(&sSetStride); + sSetStride.dwSubfunction = GALFN_SETDESTINATIONSTRIDE; + + sSetStride.stride = stride; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetStride)) + return 0; + else + return 1; +} + +BOOLEAN +Gal2_set_pattern_origin(int x, int y) +{ + GAL_PATTERNORIGIN sSetPatOrigin; + + INIT_GAL(&sSetPatOrigin); + sSetPatOrigin.dwSubfunction = GALFN_SETPATTERNORIGIN; + + sSetPatOrigin.x = x; + sSetPatOrigin.y = y; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetPatOrigin)) + return 0; + else + return 1; +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_direct + * + * Description: This function gets the VBI lines to be passed to the + * Direct VIP. + * + * parameters: + * odd: VBI odd lines. + * direct_lines: VBI direct lines. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vbi_direct(int odd, unsigned long *direct_lines) +{ + GAL_GETVBIDIRECT sGetVbidirect; + + INIT_GAL(&sGetVbidirect); + sGetVbidirect.dwSubfunction = GALFN_GETVBIDIRECT; + sGetVbidirect.odd = odd; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbidirect)) { + return 0; + } else { + *direct_lines = sGetVbidirect.direct_lines; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_interrupt + * + * Description: This function enable/disables the VBI field interrupt. + * + * parameters: + * enable: Value to enable/disable VBI interrupt. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vbi_interrupt(int enable) +{ + GAL_VBIINTERRUPT sSetVbiinterrupt; + + INIT_GAL(&sSetVbiinterrupt); + sSetVbiinterrupt.dwSubfunction = GALFN_SETVBIINTERRUPT; + sSetVbiinterrupt.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbiinterrupt)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vbi_interrupt + * + * Description: This function gets the VBI field interrupt. + * + * parameters: + * enable: Value of enable/disable VBI interrupt. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vbi_interrupt(int *enable) +{ + GAL_VBIINTERRUPT sGetVbiinterrupt; + + INIT_GAL(&sGetVbiinterrupt); + sGetVbiinterrupt.dwSubfunction = GALFN_GETVBIINTERRUPT; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbiinterrupt)) { + return 0; + } else { + *enable = sGetVbiinterrupt.enable; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_source_stride + * + * Description: This function sets the stride to be used in successive screen + * to screen BLTs. + * + * parameters: + * enable: Value of enable/disable VBI interrupt. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_set_source_stride(unsigned short stride) +{ + GAL_STRIDE sSetsourcestride; + + INIT_GAL(&sSetsourcestride); + sSetsourcestride.dwSubfunction = GALFN_SETSOURCESTRIDE; + + sSetsourcestride.stride = stride; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetsourcestride)) { + return 0; + } else { + + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_source_transparency + * + * Description: This function sets the source transparency color and + * mask to be used in future rendering routines. + * to screen BLTs. + * + * parameters: + * color: Source color. + * mask: Source mask. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_set_source_transparency(unsigned long color, unsigned long mask) +{ + GAL_SOURCETRANSPARENCY sSetsourcetransparency; + + INIT_GAL(&sSetsourcetransparency); + sSetsourcetransparency.dwSubfunction = GALFN_SETSOURCETRANSPARENCY; + + sSetsourcetransparency.color = color; + sSetsourcetransparency.mask = mask; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetsourcetransparency)) { + return 0; + } else { + + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_alpha_mode + * + * Description: This function sets the alpha blending mode. + * parameters: + * mode: Alpha blending mode. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_set_alpha_mode(int mode) +{ + GAL_GFX2ALPHAMODE sSetalphamode; + + INIT_GAL(&sSetalphamode); + sSetalphamode.dwSubfunction = GALFN_GFX2SETALPHAMODE; + + sSetalphamode.mode = mode; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetalphamode)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_gfx2_set_alpha_value + * + * Description: This function sets the alpha value to be used with certain + * alpha blending modes. + * parameters: + * value: Alpha blending value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_set_alpha_value(unsigned char value) +{ + GAL_GFX2ALPHAVALUE sSetalphavalue; + + INIT_GAL(&sSetalphavalue); + sSetalphavalue.dwSubfunction = GALFN_GFX2SETALPHAVALUE; + + sSetalphavalue.value = value; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetalphavalue)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal2_pattern_fill + * + * Description: This function used to fill the pattern of GX2. + * It allows the arbitary destination stride. The rendering + * position is also specified as an offset instead of (x,y) + * position. + * parameters: + * dstoffset: Rendering offset. + * width: Width of the pattern. + * height: Height of the pattern. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_pattern_fill(unsigned long dstoffset, unsigned short width, + unsigned short height) +{ + GAL_GFX2PATTERNFILL sPatternfill; + + INIT_GAL(&sPatternfill); + sPatternfill.dwSubfunction = GALFN_GFX2PATTERNFILL; + + sPatternfill.dstoffset = dstoffset; + sPatternfill.width = width; + sPatternfill.height = height; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sPatternfill)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_gfx2_screen_to_screen_blt + * + * Description: This function used for screen to screen BLTs of GX2. + * It allows the arbitary source and destination strides and + * alpha blending. + * parameters: + * srcoffset: Source Rendering offset. + * dstoffset: Destination Rendering offset. + * width: Width of the screen. + * height: Height of the screen. + * flags: Flags of the screen to screen BLT. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_screen_to_screen_blt(unsigned long srcoffset, + unsigned long dstoffset, unsigned short width, + unsigned short height, int flags) +{ + GAL_GFX2SCREENTOSCREENBLT sScreentoScreenblt; + + INIT_GAL(&sScreentoScreenblt); + sScreentoScreenblt.dwSubfunction = GALFN_GFX2SCREENTOSCREENBLT; + + sScreentoScreenblt.srcoffset = srcoffset; + sScreentoScreenblt.dstoffset = dstoffset; + sScreentoScreenblt.width = width; + sScreentoScreenblt.height = height; + sScreentoScreenblt.flags = flags; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sScreentoScreenblt)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal2_mono_expand_blt + * + * Description: This function used to expand monochrome data stored in + * graphics memory for screen to screen BLTs. + * parameters: + * srcbase: Source Rendering base address. + * srcx: Source X offset. + * srcy: Source Y offset. + * dstoffset: Destination Rendering offset. + * width: Width of the screen. + * height: Height of the screen. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_mono_expand_blt(unsigned long srcbase, unsigned short srcx, + unsigned short srcy, unsigned long dstoffset, + unsigned short width, unsigned short height, + int byte_packed) +{ + GAL_GFX2MONOEXPANDBLT sMonoexpandblt; + + INIT_GAL(&sMonoexpandblt); + sMonoexpandblt.dwSubfunction = GALFN_GFX2MONOEXPANDBLT; + sMonoexpandblt.srcbase = srcbase; + sMonoexpandblt.srcx = srcx; + sMonoexpandblt.srcy = srcy; + sMonoexpandblt.dstoffset = dstoffset; + sMonoexpandblt.width = width; + sMonoexpandblt.height = height; + sMonoexpandblt.byte_packed = byte_packed; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sMonoexpandblt)) { + return 0; + } else { + return 1; + + } +} + +/*-------------------------------------------------------------------------- + * Gal2_color_bitmap_to_screen_blt + * + * Description: This function used for color bmp to screen BLTs. + * parameters: + * srcx: Source X offset. + * srcy: Source Y offset. + * dstoffset: Destination Rendering offset. + * width: Width of the screen. + * height: Height of the screen. + * *data: Color bmp data. + * pitch: Pitch of the dispaly mode. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_color_bitmap_to_screen_blt(unsigned short srcx, + unsigned short srcy, + unsigned long dstoffset, + unsigned short width, + unsigned short height, + unsigned char *data, unsigned short pitch) +{ + GAL_GFX2COLORBMPTOSCRBLT sColorbmptoscrblt; + + INIT_GAL(&sColorbmptoscrblt); + sColorbmptoscrblt.dwSubfunction = GALFN_GFX2COLORBMPTOSCRBLT; + sColorbmptoscrblt.srcx = srcx; + sColorbmptoscrblt.srcy = srcy; + sColorbmptoscrblt.dstoffset = dstoffset; + sColorbmptoscrblt.width = width; + sColorbmptoscrblt.height = height; + sColorbmptoscrblt.data = *data; + sColorbmptoscrblt.pitch = pitch; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sColorbmptoscrblt)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal2_mono_bitmap_to_screen_blt + * + * Description: This function used for mono bmp to screen BLTs. + * parameters: + * srcx: Source X offset. + * srcy: Source Y offset. + * dstoffset: Destination Rendering offset. + * width: Width of the screen. + * height: Height of the screen. + * *data: mono bmp data. + * pitch: Pitch of the display mode. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_mono_bitmap_to_screen_blt(unsigned short srcx, + unsigned short srcy, + unsigned long dstoffset, + unsigned short width, + unsigned short height, + unsigned char *data, unsigned short pitch) +{ + GAL_GFX2MONOBMPTOSCRBLT sMonobmptoscrblt; + + INIT_GAL(&sMonobmptoscrblt); + sMonobmptoscrblt.dwSubfunction = GALFN_GFX2MONOBMPTOSCRBLT; + sMonobmptoscrblt.srcx = srcx; + sMonobmptoscrblt.srcy = srcy; + sMonobmptoscrblt.dstoffset = dstoffset; + sMonobmptoscrblt.width = width; + sMonobmptoscrblt.height = height; + sMonobmptoscrblt.data = *data; + sMonobmptoscrblt.pitch = pitch; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sMonobmptoscrblt)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal2_bresenham_line + * + * Description: This function used to draw bresenham line. It allows the + * arbitary destination stride. + * parameters: + * dstoffset: Destination offset. + * length: Length of the line. + * initerr: Intial error. + * axialerr: + * diagerr: + * flags: + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_bresenham_line(unsigned long dstoffset, unsigned short length, + unsigned short initerr, unsigned short axialerr, + unsigned short diagerr, unsigned short flags) +{ + GAL_GFX2BRESENHAMLINE sBresenhamline; + + INIT_GAL(&sBresenhamline); + sBresenhamline.dwSubfunction = GALFN_GFX2BRESENHAMLINE; + sBresenhamline.dstoffset = dstoffset; + sBresenhamline.length = length; + sBresenhamline.initerr = initerr; + sBresenhamline.axialerr = axialerr; + sBresenhamline.diagerr = diagerr; + sBresenhamline.flags = flags; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sBresenhamline)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal2_sync_to_vblank + * + * Description: This function sets the a flag to synchronize the next + * rendering routine to VBLANK. + * parameters: none. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal2_sync_to_vblank(void) +{ + GAL_GFX2SYNCTOVBLANK sSynctovblank; + + INIT_GAL(&sSynctovblank); + sSynctovblank.dwSubfunction = GALFN_GFX2SYNCTOVBLANK; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSynctovblank)) { + return 0; + } else { + return 1; + } +} + +/* Video routines */ + +/*-------------------------------------------------------------------------- + * Gal_set_video_yuv_pitch + * + * Description: This function sets the Video YUV pitch. + * + * parameters: + * y_pitch: Y pitch. + * uv_pitch: UV pitch. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_yuv_pitch(unsigned long y_pitch, unsigned long uv_pitch) +{ + GAL_VIDEOYUVPITCH sSetVideoyuvpitch; + + INIT_GAL(&sSetVideoyuvpitch); + sSetVideoyuvpitch.dwSubfunction = GALFN_SETVIDEOYUVPITCH; + sSetVideoyuvpitch.y_pitch = y_pitch; + sSetVideoyuvpitch.uv_pitch = uv_pitch; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideoyuvpitch)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_video_yuv_pitch + * + * Description: This function gets the Video YUV pitch. + * + * parameters: + * y_pitch: Y pitch. + * uv_pitch: UV pitch. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_video_yuv_pitch(unsigned long *y_pitch, unsigned long *uv_pitch) +{ + GAL_VIDEOYUVPITCH sGetVideoyuvpitch; + + INIT_GAL(&sGetVideoyuvpitch); + sGetVideoyuvpitch.dwSubfunction = GALFN_GETVIDEOYUVPITCH; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVideoyuvpitch)) { + return 0; + } else { + *y_pitch = sGetVideoyuvpitch.y_pitch; + *uv_pitch = sGetVideoyuvpitch.uv_pitch; + + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_yuv_offsets + * + * Description: This function sets the Video YUV offsets. + * + * parameters: + * y_offset: Y offset. + * u_offset: U offset. + * v_offset: V offset. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_video_yuv_offsets(unsigned long y_offset, unsigned long u_offset, + unsigned long v_offset) +{ + GAL_VIDEOYUVOFFSETS sSetVideoyuvoffsets; + + INIT_GAL(&sSetVideoyuvoffsets); + sSetVideoyuvoffsets.dwSubfunction = GALFN_SETVIDEOYUVOFFSETS; + sSetVideoyuvoffsets.dwYoffset = y_offset; + sSetVideoyuvoffsets.dwUoffset = u_offset; + sSetVideoyuvoffsets.dwVoffset = v_offset; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideoyuvoffsets)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_video_yuv_offsets + * + * Description: This function gets the Video YUV offsets. + * + * parameters: + * y_offset: Y offset. + * u_offset: U offset. + * v_offset: V offset. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ BOOLEAN +Gal_get_video_yuv_offsets(unsigned long *y_offset, + unsigned long *u_offset, unsigned long *v_offset) +{ + GAL_VIDEOYUVOFFSETS sGetVideoyuvoffsets; + + INIT_GAL(&sGetVideoyuvoffsets); + sGetVideoyuvoffsets.dwSubfunction = GALFN_GETVIDEOYUVOFFSETS; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVideoyuvoffsets)) { + return 0; + } else { + *y_offset = sGetVideoyuvoffsets.dwYoffset; + *u_offset = sGetVideoyuvoffsets.dwUoffset; + *v_offset = sGetVideoyuvoffsets.dwVoffset; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_left_crop + * + * Description: This function sets the number of pixels which will be cropped + * from the beginning of each video line. + * + * parameters: + * x: + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ BOOLEAN +Gal_set_video_left_crop(unsigned short x) +{ + GAL_VIDEOLEFTCROP sSetVideoleftcrop;; + + INIT_GAL(&sSetVideoleftcrop); + sSetVideoleftcrop.dwSubfunction = GALFN_SETVIDEOLEFTCROP; + sSetVideoleftcrop.x = x; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideoleftcrop)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_video_vertical_downscale + * + * Description: This function sets the vertical downscale factor for the video + * overlay window. + * + * parameters: + * srch: Height of the source. + * dsth: Height of the destination. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ BOOLEAN +Gal_set_video_vertical_downscale(unsigned short srch, unsigned short dsth) +{ + GAL_VIDEOVERTICALDOWNSCALE sSetVideoverticaldownscale; + + INIT_GAL(&sSetVideoverticaldownscale); + sSetVideoverticaldownscale.dwSubfunction = GALFN_SETVIDEOVERTICALDOWNSCALE; + sSetVideoverticaldownscale.srch = srch; + sSetVideoverticaldownscale.dsth = dsth; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVideoverticaldownscale)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_source + * + * Description: This function sets the VBI source. + * + * parameters: + * source: VBI Source type. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ BOOLEAN +Gal_set_vbi_source(VbiSourceType source) +{ + GAL_VBISOURCE sSetVbisource; + + INIT_GAL(&sSetVbisource); + sSetVbisource.dwSubfunction = GALFN_SETVBISOURCE; + sSetVbisource.source = source; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbisource)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vbi_source + * + * Description: This function gets the VBI source. + * + * parameters: + * source: VBI Source type. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_vbi_source(VbiSourceType * source) +{ + GAL_VBISOURCE sGetVbisource; + + INIT_GAL(&sGetVbisource); + sGetVbisource.dwSubfunction = GALFN_GETVBISOURCE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbisource)) { + return 0; + } else { + + *source = sGetVbisource.source; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_lines + * + * Description: This function sets the VBI lines. + * + * parameters: + * even: VBI even lines. + * odd: VBI odd lines. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vbi_lines(unsigned long even, unsigned long odd) +{ + GAL_VBILINES sSetVbilines; + + INIT_GAL(&sSetVbilines); + sSetVbilines.dwSubfunction = GALFN_SETVBILINES; + sSetVbilines.even = even; + sSetVbilines.odd = odd; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbilines)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vbi_lines + * + * Description: This function gets the VBI lines. + * + * parameters: + * lines: VBI lines. + * odd: VBI odd lines. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ BOOLEAN +Gal_get_vbi_lines(int odd, unsigned long *lines) +{ + GAL_VBILINES sGetVbilines; + + INIT_GAL(&sGetVbilines); + sGetVbilines.dwSubfunction = GALFN_GETVBILINES; + sGetVbilines.odd = odd; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbilines)) { + return 0; + } else { + *lines = sGetVbilines.lines; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_total + * + * Description: This function sets the total number of VBI bytes for each + * field. + * + * parameters: + * even: + * odd: + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_vbi_total(unsigned long even, unsigned long odd) +{ + GAL_VBITOTAL sSetVbitotal; + + INIT_GAL(&sSetVbitotal); + sSetVbitotal.dwSubfunction = GALFN_SETVBITOTAL; + sSetVbitotal.even = even; + sSetVbitotal.odd = odd; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVbitotal)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vbi_total + * + * Description: This function gets the total number of VBI bytes in the + * field. + * + * parameters: + * even: + * odd: + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ BOOLEAN +Gal_get_vbi_total(int odd, unsigned long *total) +{ + GAL_VBITOTAL sGetVbitotal; + + INIT_GAL(&sGetVbitotal); + sGetVbitotal.dwSubfunction = GALFN_GETVBITOTAL; + sGetVbitotal.odd = odd; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVbitotal)) { + return 0; + } else { + *total = sGetVbitotal.total; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_vertical_scaler_offset + * + * Description: This function sets the Video vertical scaler offset. + * + * parameters: + * offset: Vertical Scaler offset. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ BOOLEAN +Gal_set_vertical_scaler_offset(char offset) +{ + GAL_VSCALEROFFSET sSetVscaleroffset; + + INIT_GAL(&sSetVscaleroffset); + sSetVscaleroffset.dwSubfunction = GALFN_SETVSCALEROFFSET; + sSetVscaleroffset.offset = offset; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetVscaleroffset)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_vertical_scaler_offset + * + * Description: This function gets the Video vertical scaler offset. + * + * parameters: + * offset: Vertical Scaler offset. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ BOOLEAN +Gal_get_vertical_scaler_offset(char *offset) +{ + GAL_VSCALEROFFSET sGetVscaleroffset; + + INIT_GAL(&sGetVscaleroffset); + sGetVscaleroffset.dwSubfunction = GALFN_GETVSCALEROFFSET; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetVscaleroffset)) { + return 0; + } else { + + *offset = sGetVscaleroffset.offset; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_video_interlaced + * + * Description: This function gets the video interlaced mode. + * parameters: + * interlaced: ptr to the interlaced status. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_video_interlaced(int *interlaced) +{ + GAL_GETVIDEOINTERLACED sGetvideointerlaced; + + INIT_GAL(&sGetvideointerlaced); + sGetvideointerlaced.dwSubfunction = GALFN_GETVIDEOINTERLACED; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetvideointerlaced)) { + return 0; + } else { + *interlaced = sGetvideointerlaced.interlaced; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_color_space_YUV + * + * Description: This function gets the video color space YUV. + * parameters: + * colorspace: ptr to the color space. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_color_space_YUV(int *colorspace) +{ + GAL_COLORSPACEYUV sGetcolorspaceyuv; + + INIT_GAL(&sGetcolorspaceyuv); + sGetcolorspaceyuv.dwSubfunction = GALFN_GETCOLORSPACEYUV; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetcolorspaceyuv)) { + return 0; + } else { + *colorspace = sGetcolorspaceyuv.colorspace; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_genlock_enable + * + * Description: This function gets the enable state of the genlock. + * parameters: + * enable: ptr to the enable state of the genlock. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_genlock_enable(int *enable) +{ + GAL_GENLOCKENABLE sGetgenlockenable; + + INIT_GAL(&sGetgenlockenable); + sGetgenlockenable.dwSubfunction = GALFN_GETGENLOCKENABLE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetgenlockenable)) { + return 0; + } else { + *enable = sGetgenlockenable.enable; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_genlock_enable + * + * Description: This function enable/disables and configure the genlock + * according to the parameters. + * parameters: + * enable: enable state of the genlock. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_genlock_enable(int enable) +{ + GAL_GENLOCKENABLE sSetgenlockenable; + + INIT_GAL(&sSetgenlockenable); + sSetgenlockenable.dwSubfunction = GALFN_SETGENLOCKENABLE; + + sSetgenlockenable.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetgenlockenable)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_genlock_delay + * + * Description: This function gets the genlock delay. + * parameters: + * delay: Ptr to the genlock delay. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_genlock_delay(unsigned long *delay) +{ + GAL_GENLOCKDELAY sGetgenlockdelay; + + INIT_GAL(&sGetgenlockdelay); + sGetgenlockdelay.dwSubfunction = GALFN_GETGENLOCKDELAY; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetgenlockdelay)) { + return 0; + } else { + *delay = sGetgenlockdelay.delay; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_genlock_delay + * + * Description: This function sets the genlock delay. + * parameters: + * delay: genlock delay. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_genlock_delay(unsigned long delay) +{ + GAL_GENLOCKDELAY sSetgenlockdelay; + + INIT_GAL(&sSetgenlockdelay); + sSetgenlockdelay.dwSubfunction = GALFN_SETGENLOCKDELAY; + + sSetgenlockdelay.delay = delay; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetgenlockdelay)) { + return 0; + } else { + return 1; + } +} + +BOOLEAN +Gal_set_top_line_in_odd(int enable) +{ + GAL_TOPLINEINODD sSettoplineinodd; + + INIT_GAL(&sSettoplineinodd); + sSettoplineinodd.dwSubfunction = GALFN_SETTOPLINEINODD; + + sSettoplineinodd.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSettoplineinodd)) { + return 0; + } else { + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_video_cursor. + * + * Description: This function gets configuration of the Video Hardware + * cursor. + * parameters: + * key: color key. + * mask: color mask. + *select_color2: selected for color2. + * color1: color1 value. + * color2: color2 value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_video_cursor(unsigned long *key, + unsigned long *mask, + unsigned short *select_color2, + unsigned long *color1, unsigned long *color2) +{ + GAL_VIDEOCURSOR sGetvideocursor; + + INIT_GAL(&sGetvideocursor); + sGetvideocursor.dwSubfunction = GALFN_GETVIDEOCURSOR; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetvideocursor)) { + return 0; + } else { + *key = sGetvideocursor.key; + *mask = sGetvideocursor.mask; + *select_color2 = sGetvideocursor.select_color2; + *color1 = sGetvideocursor.color1; + *color2 = sGetvideocursor.color2; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_read_crc. + * + * Description: This function reads the hardware CRC value, which is used for + * automated testing. + * parameters: + * crc: Holds the crc value. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_read_crc(unsigned long *crc) +{ + GAL_READCRC sReadcrc; + + INIT_GAL(&sReadcrc); + sReadcrc.dwSubfunction = GALFN_READCRC; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sReadcrc)) { + return 0; + } else { + *crc = sReadcrc.crc; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_read_window_crc. + * + * Description: This function reads the hardware CRC value for a subsection + * of the display. + * + * parameters: + * source: + * x: + * y: + * width: + * height: + * crc: + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_read_window_crc(int source, unsigned short x, unsigned short y, + unsigned short width, unsigned short height, + int crc32, unsigned long *crc) +{ + GAL_READWINDOWCRC sReadwindowcrc; + + INIT_GAL(&sReadwindowcrc); + sReadwindowcrc.dwSubfunction = GALFN_READWINDOWCRC; + sReadwindowcrc.source = source; + sReadwindowcrc.x = x; + sReadwindowcrc.y = y; + sReadwindowcrc.width = width; + sReadwindowcrc.height = height; + sReadwindowcrc.crc32 = crc32; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sReadwindowcrc)) { + return 0; + } else { + *crc = sReadwindowcrc.crc; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_get_macrovision_enable. + * + * Description: This function gets the enable state of the macrovision. + * + * parameters: + * enable: ptr holds the macrovision enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_get_macrovision_enable(int *enable) +{ + GAL_MACROVISIONENABLE sGetmacrovisionenable; + + INIT_GAL(&sGetmacrovisionenable); + sGetmacrovisionenable.dwSubfunction = GALFN_GETMACROVISIONENABLE; + + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sGetmacrovisionenable)) { + return 0; + } else { + *enable = sGetmacrovisionenable.enable; + return 1; + } +} + +/*-------------------------------------------------------------------------- + * Gal_set_macrovision_enable. + * + * Description: This function gets the enable state of the macrovision. + * + * parameters: + * enable: macrovision enable state. + * return: '1' was returned on success otherwise '0' was returned. + *------------------------------------------------------------------------*/ +BOOLEAN +Gal_set_macrovision_enable(int enable) +{ + GAL_MACROVISIONENABLE sSetmacrovisionenable; + + INIT_GAL(&sSetmacrovisionenable); + sSetmacrovisionenable.dwSubfunction = GALFN_SETMACROVISIONENABLE; + + sSetmacrovisionenable.enable = enable; + if (ioctl(dfb_fbdev->fd, FBIOGAL_API, &sSetmacrovisionenable)) { + return 0; + } else { + return 1; + } +} |