
Windows CE .NET Lynx Express driver information
==============================================

Introduction
------------
Silicon Motion, Inc. Lynx Express Driver is architected from the beginning
to support variety of features and extension of Windows CE .NET, such as 
DirectDraw feature, Dynamic Rotation feature, Multimon feature, SMI Multimon
Emulation feature (using single Lynx Express chip to drive two independent
displays), WCEfA (Windows CE for Automotive) feature, and more. 


Setup
-----
+ Lynx Express display driver setup information for Windows CE 6.0
* copy  the source files to "$(_WINCEROOT)\3rdparty\Silicon_motion\SMIVGX\"
* copy  the smivgx6.pbcxml to "$(_WINCEROOT)\PUBLIC\COMMON\CATALOG".
  Then Silicon Motion Lynx Express driver option will be in the Platform Builder 
  Catalog Items View.
* Select the Lynx Express display driver to the current platform.
* Change the Lynx Express Windows CE registry settings
  - The registry is used to specify the special modes and panels
  - Edit smivgx.reg (or any .reg files, as preferred)
  - Add the following lines, and specify the registry options (See Registry Settings 
    section):
    IF BSP_DISPLAY_SMIVGX
    [HKEY_LOCAL_MACHINE\System\GDI\Drivers]
       "Display"="ddi_vgx.dll"
    [HKEY_LOCAL_MACHINE\Drivers\Display\SMIVGX]
	; Specify Lynx Express registry options below here
    ENDIF
*Add ddi_vgx.dll module info to smivgx.BIB files, as shown below:
   IF BSP_DISPLAY_SMIVGX
	   ddi_vgx.dll          $(_FLATRELEASEDIR)\ddi_vgx.dll              NK  SHk
   ENDIF BSP_DISPLAY_SMIVGX
    
    
* Multiple Adapter Feature support process,ignore it if not include the feature
  - Open catalog\Core OS\Windows CE device\Graphics and  Multimedia Technologies\Graphic
        Add "Multiple Monitor Support" to OS Design
  - Add the following to smivgx.reg (or any .reg files, as preferred)
         [HKEY_LOCAL_MACHINE\System\GDI\Monitors]
         "Total Monitors"=dword:{number}
  -If open Dual Head,as  use two adapter to get four monitor,add the enviroment setting 
       "SMI_MMEMU"=1  in Platform Property setting.


* Build the Lynx Express driver
  - To build the whole platform, click Build\Build solution or Build\Rebuild solution
  - To rebuild the driver separately, right click on Lynx Express and 
     select "Build" or "Rebuild" and then click Build\Make run_time image





+ Lynx Express display driver setup information for Windows CE .NET 5.XX
* Run the provided SMIVGX.msi installation executables to copy
  the source files to "$(_WINCEROOT)\3rdparty\Silicon_motion\SMIVGX\"
  and set up Silicon Motion Lynx Express driver option in the Platform Builder 
  Catalog Features.

* Add the Lynx Express display driver to the current platform.

* Change the Lynx Express Windows CE registry settings
  - The registry is used to specify the special modes and panels
  - Click on "Parameters" tab, edit common.reg (or any .reg files, as preferred)
  - Add the following lines, and specify the registry options (See Registry Settings 
    section):
    IF BSP_DISPLAY_SMIVGX
    [HKEY_LOCAL_MACHINE\System\GDI\Drivers]
       "Display"="ddi_vgx.dll"
    [HKEY_LOCAL_MACHINE\Drivers\Display\SMIVGX]
	; Specify Lynx Express registry options below here
    ENDIF


* Add ddi_vgx.dll module info to .BIB files, as shown below:
	IF BSP_DISPLAY_SMIVGX
	   ddi_vgx.dll          $(_FLATRELEASEDIR)\ddi_vgx.dll              NK  SH
	ENDIF BSP_DISPLAY_SMIVGX

* Multiple Adapter Feature support process,ignore it if not include the feature
  - Open catalog\Core OS\Windows CE device\Graphics and  Multimedia Technologies\Graphic
        Add "Multiple Monitor Support" to OS Design
  - Add the following to common.reg 
         [HKEY_LOCAL_MACHINE\System\GDI\Monitors]
         "Total Monitors"=dword:4
  -If open Dual Head,as  use two adapter to get four monitor,add the enviroment setting 
       "SMI_MMEMU"=1 in Platform Property setting.


* Build the Lynx Express driver
  - To build the whole platform, click Build\Build Platform or Build\Rebuild Platform
  - To rebuild the driver separately, right click on Lynx Express and 
     select "Build Selected Features" and then click Build\MakeImg





+ Lynx Express driver initial setup information for Windows CE .NET 4.XX
* Copy source codes or binary dll file to 
  "$(_WINCEROOT)\public\common\oak\DRIVERS\DISPLAY\SMIVGX\"
  Where $(_WINCEROOT) is the installation location of the Windows CE .NET,
  usually defaulted to C:\WINCE400

* Import Lynx Express driver feature to Catalog, as follows:
  - Click on File\Manage Catalog Features. 
  - Remove any older smivgx.cec file from the list, if any.
  - Click Import and get the smivgx.cec from the directory above.
  - Click Refresh, if necessary.

* Include Lynx Express driver to the platform, as follows:
  - Find any Display driver instances on the FeatureView of Platform builder
    (including older Lynx Express and NULL instances) and remove them all.
  - Drag ONLY one of the Catalog\Device Driver\SMI Lynx Express Family features 
    (source code or binary dll only) to the FeatureView

* Change the build settings of Lynx Express driver, ie. Rotation driver, 
  Non Direct Draw driver, etc., as follows:
  - Right click on Lynx Express driver, and select Settings
  - Select "Custom Build" tab, in Build Step "Feature Build", 
    Change any necessary environment settings (See Environment Settings section 
    for more info).

* Change the Lynx Express Windows CE registry settings
  - The registry is used to specify the special modes and panels
  - Click on "Parameters" tab, edit common.reg (or any .reg files, as preferred)
  - Add the following lines, and specify the registry options (See Registry Settings 
    section):
    IF BSP_DISPLAY_SMIVGX
    [HKEY_LOCAL_MACHINE\System\GDI\Drivers]
       "Display"="ddi_vgx.dll"
    [HKEY_LOCAL_MACHINE\Drivers\Display\SMIVGX]
	; Specify Lynx Express registry options below here
    ENDIF


* Multiple Adapter Feature support process,ignore it if not include the feature
  - Open catalog\Core OS\Display based device\Multimedia Technologies\Multimedia Components
        Add "Multiple Monitor Support" to OS Design
  - Add the following to common.reg 
         [HKEY_LOCAL_MACHINE\System\GDI\Monitors]
         "Total Monitors"=dword:4
  -If open Dual Head,as  use two adapter to get four monitor,add the enviroment setting 
       "SMI_MMEMU"=1 in Platform Property setting.



* No need to add ddi_vgx.dll module info to .BIB files, it is already included by
  smivgx.cec

* Build the Lynx Express driver
  - To build the whole platform, click Build\Build Platform or Build\Rebuild Platform
  - To rebuild the driver separately, right click on Lynx Express  and 
     select "Build Selected Features" and then click Build\MakeImg
  




Enviroment Settings
-------------------
The enviroment settings should be set before building the driver (See Setup section on
how to specify them), thus the binary-dll driver is not affected by this settings.

If no enviroment settings are set, the DirectDraw-based driver will be built

Where options are:
* SMI_NOLIB: Turn this flag to 1, if you get "gpe_lib.lib not found" error
  messages.

* SMI_HOST: Turn this flag to 1, the compiler will enable the Host interface
  mode. See registry settings below to set the base and register physical 
  address for different platforms.

* SMI_ACCELENT: Turn this flag to 1, together with SMI_HOST to enable Accelent
  host platform compiling.

* SMI_NODD: When this option is set to 1, the compiler will disable the
  DirectDraw feature.

* SMI_WCEFA: When this option is set to 1, the compiler will enable the 
  WCEfA (Windows CE for Automotive) API feature.

* SMI_ROTATION: When this option is set to 1, the compiler will enable the
  special Dynamic Rotation feature. This option automatically set SMI_NODD to 1.

* SMI_MMEMU: When this option is set to 1, the compiler will enable the
  special SMI MultiMon Emulation using single chip to power two different screens
  in any resolutions specified in the registry.

* SMI_DISPPERF: When this option is set to 1, the compiler will enable the
  profiling information for the driver. 

* SMI_UMA: When this option is set to 1, the compiler will enable the UMA support
  for Vytek platform only.

* SMI_DISABLE_INT_MGR: When this option is set to 1, the compiler will disable the 
  interrupt management support.

* SMI_DISABLE_AUTO_PWRMGR: When this option is set to 1, the compiler will disable the 
  auto power management support.

* SMI_NOBOOTARG: When this option is set to 1, the compiler will disable the 
  boot argument support.

* SMI_VGXDMA: Turn this flag to 1, Voyager GX DMA API will be available to use by 
  applications. Utility vgxdma is a sample code to use the DMA API.

Registry Settings
-----------------
Registry Settings determine the mode sets by the driver when it first loads up
(See Setup section on how to specify them). 

* The default registry format is as follows:

[HKEY_LOCAL_MACHINE\Drivers\Display\SMIVGX]
; For Screen Size, Panel Size, and Bpp
  "CxPanel"		=	dword:{any value in hex, as supported by driver}
  "CyPanel"		=	dword:{any value in hex, as supported by driver}
  "CxScreen"		=	dword:{any value in hex, as supported by driver}
  "CyScreen"		=	dword:{any value in hex, as supported by driver}
  "Bpp"	  		=	dword:{8, 10, 20}
  "RefreshRate"		=	dword:{any value in hex, as supported by driver}
  "TestClock"		=	dword:{any value in hex, as installed on the VGX board}
  "DisplayType"		=	dword:{1 = panel, 2 = CRT, 3 = panel + CRT, 4 = panel1 + panel2 }
  "DisplayControl"	= 	dword:{0 = PANEL_CTRL, 1 = CRT_CTRL, 2 = VGA_CTRL}
  "SaveRestore"		=	dword:{0, 1}
  "SaveSurface"		=	dword:{0, 1}
  "OverlayDisabled"	=	dword:{0,1} 
  "CSCDisabled"		=	dword:{0,1}

; For Host-based driver
  "FB_BASE" 	= dword:{base physical address in hex}
  "FG_BASE" 	= dword:{register physical address in hex}



; For SMI Special Modes and Panel Types
  "PanelType" = dword:{as specified below}


; For special panel settings by modifying hardware register directly
; See definition below for detail explanation.
  "PanelSettings" = hex:xx0,xx0,xx0,xx0, xx1,xx1,xx1,xx1,....

; For Rotation Feature
  "Angle"		=	dword:{0,5A,B4,10E}

; For Multimon support
[HKEY_LOCAL_MACHINE\SYSTEM\GDI\MONITORS]
  "TOTAL MONITORS" = dword:{number of monitors} 

; NOTE: Bpp option has to be the same across all monitors (WinCE limitation)
[HKEY_LOCAL_MACHINE\Drivers\Display\SMIVGX\MONITOR0]
; Specify Panel settings and refresh rate for first monitor, as necessary

[HKEY_LOCAL_MACHINE\Drivers\Display\SMIVGX\MONITOR1]
; Specify Panel settings and refresh rate for second monitor, as necessary

[HKEY_LOCAL_MACHINE\Drivers\Display\SMIVGX\MONITOR2]
; Specify Panel settings and refresh rate for third monitor, as necessary

[HKEY_LOCAL_MACHINE\Drivers\Display\SMIVGX\MONITOR3]
; Specify Panel settings and refresh rate for fourth monitor, as necessary



* The definitions are:
  - CxPanel, CyPanel: Panel width and height.
  		If not specified, CxPanel and CyPanel will be defaulted to 800x600 

  - CxScreen, CyScreen: Screen width and height (Display mode resolution).
		If not specified, CxScreen and CyScreen will be the same as on 
		CxPanel and CyPanel.
	NOTE1: currently CxScreen & CyScreen not equals CxPanel & CyPanel is not supported.

  - Bpp: Number of bits of colors for one pixel.  
 	    If not specified, Bpp is defaulted to 16-bpp mode.

  - RefreshRate: Refresh rate / vertical frequency of monitors/panels.
 	    If not specified, RefreshRate is defaulted to 60 Hz.

  - DisplayType: 1 - Enable panel output only
                 2 - Enable CRT output only
                 3 - Enable both panel & CRT outputs

  - SaveRestore: 0 - The driver will not save/restore VGX registers and memory
                     to/from system memory
                 1 - Otherwise

  - SaveSurface: Valid only if 'SaveRestore' registry key is 1
                 0 - The driver will not save/restore all surfaces to/from system memory
                 1 - Otherwise

  - OverlayDisabled: Enable or disable the back-end Overlay video feature in the driver.
				If not specified, Overlay video feature will be enabled.
				If 1, Overlay video feature will be disabled.

  - CSCDisabled: Enable or disable the front-end Color Space Conversion feature in the driver.
				If not specified, CSC feature will be enabled.
				If 1, CSC feature will be disabled.

  - FB_BASE:  For Host-based driver only!
        Specify the physical address of the VGX frame buffer.

  - FG_BASE:  For Host-based driver only!
        Specify the physical address of the VGX register MMIO.

  - PanelType: For special panel type. Certain number corresponds to certain panel type, 
        as listed below (all values are hex values):
		    0 TFT_18BIT 
		    1 TFT_24BIT
		    2 TFT_36BIT
  - DisplayControl: For display control settings, if no registry value, default is PANEL_CTRL
        as listed below (all values are hex values):
    		PANEL_CTRL = 0,
    		CRT_CTRL   = 1,
    		VGA_CTRL   = 2
  - Angle: Angle of rotation 0(0), 90(0x5A), 180(0xB4), and 270(0x10E),
  		only if Rotation feature is enabled.
		If not specified, Angle is defaulted to 0.




