xref: /OK3568_Linux_fs/kernel/Documentation/fb/viafb.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun=======================================================
2*4882a593SmuzhiyunVIA Integration Graphic Chip Console Framebuffer Driver
3*4882a593Smuzhiyun=======================================================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunPlatform
6*4882a593Smuzhiyun--------
7*4882a593Smuzhiyun    The console framebuffer driver is for graphics chips of
8*4882a593Smuzhiyun    VIA UniChrome Family
9*4882a593Smuzhiyun    (CLE266, PM800 / CN400 / CN300,
10*4882a593Smuzhiyun    P4M800CE / P4M800Pro / CN700 / VN800,
11*4882a593Smuzhiyun    CX700 / VX700, K8M890, P4M890,
12*4882a593Smuzhiyun    CN896 / P4M900, VX800, VX855)
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunDriver features
15*4882a593Smuzhiyun---------------
16*4882a593Smuzhiyun    Device: CRT, LCD, DVI
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun    Support viafb_mode::
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun	CRT:
21*4882a593Smuzhiyun	    640x480(60, 75, 85, 100, 120 Hz), 720x480(60 Hz),
22*4882a593Smuzhiyun	    720x576(60 Hz), 800x600(60, 75, 85, 100, 120 Hz),
23*4882a593Smuzhiyun	    848x480(60 Hz), 856x480(60 Hz), 1024x512(60 Hz),
24*4882a593Smuzhiyun	    1024x768(60, 75, 85, 100 Hz), 1152x864(75 Hz),
25*4882a593Smuzhiyun	    1280x768(60 Hz), 1280x960(60 Hz), 1280x1024(60, 75, 85 Hz),
26*4882a593Smuzhiyun	    1440x1050(60 Hz), 1600x1200(60, 75 Hz), 1280x720(60 Hz),
27*4882a593Smuzhiyun	    1920x1080(60 Hz), 1400x1050(60 Hz), 800x480(60 Hz)
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun    color depth: 8 bpp, 16 bpp, 32 bpp supports.
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun    Support 2D hardware accelerator.
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunUsing the viafb module
34*4882a593Smuzhiyun----------------------
35*4882a593Smuzhiyun    Start viafb with default settings::
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun	#modprobe viafb
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun    Start viafb with user options::
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun	#modprobe viafb viafb_mode=800x600 viafb_bpp=16 viafb_refresh=60
42*4882a593Smuzhiyun		  viafb_active_dev=CRT+DVI viafb_dvi_port=DVP1
43*4882a593Smuzhiyun		  viafb_mode1=1024x768 viafb_bpp=16 viafb_refresh1=60
44*4882a593Smuzhiyun		  viafb_SAMM_ON=1
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun    viafb_mode:
47*4882a593Smuzhiyun	- 640x480 (default)
48*4882a593Smuzhiyun	- 720x480
49*4882a593Smuzhiyun	- 800x600
50*4882a593Smuzhiyun	- 1024x768
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun    viafb_bpp:
53*4882a593Smuzhiyun	- 8, 16, 32 (default:32)
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun    viafb_refresh:
56*4882a593Smuzhiyun	- 60, 75, 85, 100, 120 (default:60)
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun    viafb_lcd_dsp_method:
59*4882a593Smuzhiyun	- 0 : expansion (default)
60*4882a593Smuzhiyun	- 1 : centering
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun    viafb_lcd_mode:
63*4882a593Smuzhiyun	0 : LCD panel with LSB data format input (default)
64*4882a593Smuzhiyun	1 : LCD panel with MSB data format input
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun    viafb_lcd_panel_id:
67*4882a593Smuzhiyun	- 0 : Resolution: 640x480, Channel: single, Dithering: Enable
68*4882a593Smuzhiyun	- 1 : Resolution: 800x600, Channel: single, Dithering: Enable
69*4882a593Smuzhiyun	- 2 : Resolution: 1024x768, Channel: single, Dithering: Enable (default)
70*4882a593Smuzhiyun	- 3 : Resolution: 1280x768, Channel: single, Dithering: Enable
71*4882a593Smuzhiyun	- 4 : Resolution: 1280x1024, Channel: dual, Dithering: Enable
72*4882a593Smuzhiyun	- 5 : Resolution: 1400x1050, Channel: dual, Dithering: Enable
73*4882a593Smuzhiyun	- 6 : Resolution: 1600x1200, Channel: dual, Dithering: Enable
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun	- 8 : Resolution: 800x480, Channel: single, Dithering: Enable
76*4882a593Smuzhiyun	- 9 : Resolution: 1024x768, Channel: dual, Dithering: Enable
77*4882a593Smuzhiyun	- 10: Resolution: 1024x768, Channel: single, Dithering: Disable
78*4882a593Smuzhiyun	- 11: Resolution: 1024x768, Channel: dual, Dithering: Disable
79*4882a593Smuzhiyun	- 12: Resolution: 1280x768, Channel: single, Dithering: Disable
80*4882a593Smuzhiyun	- 13: Resolution: 1280x1024, Channel: dual, Dithering: Disable
81*4882a593Smuzhiyun	- 14: Resolution: 1400x1050, Channel: dual, Dithering: Disable
82*4882a593Smuzhiyun	- 15: Resolution: 1600x1200, Channel: dual, Dithering: Disable
83*4882a593Smuzhiyun	- 16: Resolution: 1366x768, Channel: single, Dithering: Disable
84*4882a593Smuzhiyun	- 17: Resolution: 1024x600, Channel: single, Dithering: Enable
85*4882a593Smuzhiyun	- 18: Resolution: 1280x768, Channel: dual, Dithering: Enable
86*4882a593Smuzhiyun	- 19: Resolution: 1280x800, Channel: single, Dithering: Enable
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun    viafb_accel:
89*4882a593Smuzhiyun	- 0 : No 2D Hardware Acceleration
90*4882a593Smuzhiyun	- 1 : 2D Hardware Acceleration (default)
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun    viafb_SAMM_ON:
93*4882a593Smuzhiyun	- 0 : viafb_SAMM_ON disable (default)
94*4882a593Smuzhiyun	- 1 : viafb_SAMM_ON enable
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun    viafb_mode1: (secondary display device)
97*4882a593Smuzhiyun	- 640x480 (default)
98*4882a593Smuzhiyun	- 720x480
99*4882a593Smuzhiyun	- 800x600
100*4882a593Smuzhiyun	- 1024x768
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun    viafb_bpp1: (secondary display device)
103*4882a593Smuzhiyun	- 8, 16, 32 (default:32)
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun    viafb_refresh1: (secondary display device)
106*4882a593Smuzhiyun	- 60, 75, 85, 100, 120 (default:60)
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun    viafb_active_dev:
109*4882a593Smuzhiyun	This option is used to specify active devices.(CRT, DVI, CRT+LCD...)
110*4882a593Smuzhiyun	DVI stands for DVI or HDMI, E.g., If you want to enable HDMI,
111*4882a593Smuzhiyun	set viafb_active_dev=DVI. In SAMM case, the previous of
112*4882a593Smuzhiyun	viafb_active_dev is primary device, and the following is
113*4882a593Smuzhiyun	secondary device.
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun	For example:
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun	To enable one device, such as DVI only, we can use::
118*4882a593Smuzhiyun
119*4882a593Smuzhiyun	    modprobe viafb viafb_active_dev=DVI
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun	To enable two devices, such as CRT+DVI::
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun	    modprobe viafb viafb_active_dev=CRT+DVI;
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun	For DuoView case, we can use::
126*4882a593Smuzhiyun
127*4882a593Smuzhiyun	    modprobe viafb viafb_active_dev=CRT+DVI
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun	OR::
130*4882a593Smuzhiyun
131*4882a593Smuzhiyun	    modprobe viafb viafb_active_dev=DVI+CRT...
132*4882a593Smuzhiyun
133*4882a593Smuzhiyun	For SAMM case:
134*4882a593Smuzhiyun
135*4882a593Smuzhiyun	If CRT is primary and DVI is secondary, we should use::
136*4882a593Smuzhiyun
137*4882a593Smuzhiyun	    modprobe viafb viafb_active_dev=CRT+DVI viafb_SAMM_ON=1...
138*4882a593Smuzhiyun
139*4882a593Smuzhiyun	If DVI is primary and CRT is secondary, we should use::
140*4882a593Smuzhiyun
141*4882a593Smuzhiyun	    modprobe viafb viafb_active_dev=DVI+CRT viafb_SAMM_ON=1...
142*4882a593Smuzhiyun
143*4882a593Smuzhiyun    viafb_display_hardware_layout:
144*4882a593Smuzhiyun	This option is used to specify display hardware layout for CX700 chip.
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun	- 1 : LCD only
147*4882a593Smuzhiyun	- 2 : DVI only
148*4882a593Smuzhiyun	- 3 : LCD+DVI (default)
149*4882a593Smuzhiyun	- 4 : LCD1+LCD2 (internal + internal)
150*4882a593Smuzhiyun	- 16: LCD1+ExternalLCD2 (internal + external)
151*4882a593Smuzhiyun
152*4882a593Smuzhiyun    viafb_second_size:
153*4882a593Smuzhiyun	This option is used to set second device memory size(MB) in SAMM case.
154*4882a593Smuzhiyun	The minimal size is 16.
155*4882a593Smuzhiyun
156*4882a593Smuzhiyun    viafb_platform_epia_dvi:
157*4882a593Smuzhiyun	This option is used to enable DVI on EPIA - M
158*4882a593Smuzhiyun
159*4882a593Smuzhiyun	- 0 : No DVI on EPIA - M (default)
160*4882a593Smuzhiyun	- 1 : DVI on EPIA - M
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun    viafb_bus_width:
163*4882a593Smuzhiyun	When using 24 - Bit Bus Width Digital Interface,
164*4882a593Smuzhiyun	this option should be set.
165*4882a593Smuzhiyun
166*4882a593Smuzhiyun	- 12: 12-Bit LVDS or 12-Bit TMDS (default)
167*4882a593Smuzhiyun	- 24: 24-Bit LVDS or 24-Bit TMDS
168*4882a593Smuzhiyun
169*4882a593Smuzhiyun    viafb_device_lcd_dualedge:
170*4882a593Smuzhiyun	When using Dual Edge Panel, this option should be set.
171*4882a593Smuzhiyun
172*4882a593Smuzhiyun	- 0 : No Dual Edge Panel (default)
173*4882a593Smuzhiyun	- 1 : Dual Edge Panel
174*4882a593Smuzhiyun
175*4882a593Smuzhiyun    viafb_lcd_port:
176*4882a593Smuzhiyun	This option is used to specify LCD output port,
177*4882a593Smuzhiyun	available values are "DVP0" "DVP1" "DFP_HIGHLOW" "DFP_HIGH" "DFP_LOW".
178*4882a593Smuzhiyun
179*4882a593Smuzhiyun	for external LCD + external DVI on CX700(External LCD is on DVP0),
180*4882a593Smuzhiyun	we should use::
181*4882a593Smuzhiyun
182*4882a593Smuzhiyun	    modprobe viafb viafb_lcd_port=DVP0...
183*4882a593Smuzhiyun
184*4882a593SmuzhiyunNotes:
185*4882a593Smuzhiyun    1. CRT may not display properly for DuoView CRT & DVI display at
186*4882a593Smuzhiyun       the "640x480" PAL mode with DVI overscan enabled.
187*4882a593Smuzhiyun    2. SAMM stands for single adapter multi monitors. It is different from
188*4882a593Smuzhiyun       multi-head since SAMM support multi monitor at driver layers, thus fbcon
189*4882a593Smuzhiyun       layer doesn't even know about it; SAMM's second screen doesn't have a
190*4882a593Smuzhiyun       device node file, thus a user mode application can't access it directly.
191*4882a593Smuzhiyun       When SAMM is enabled, viafb_mode and viafb_mode1, viafb_bpp and
192*4882a593Smuzhiyun       viafb_bpp1, viafb_refresh and viafb_refresh1 can be different.
193*4882a593Smuzhiyun    3. When console is depending on viafbinfo1, dynamically change resolution
194*4882a593Smuzhiyun       and bpp, need to call VIAFB specified ioctl interface VIAFB_SET_DEVICE
195*4882a593Smuzhiyun       instead of calling common ioctl function FBIOPUT_VSCREENINFO since
196*4882a593Smuzhiyun       viafb doesn't support multi-head well, or it will cause screen crush.
197*4882a593Smuzhiyun
198*4882a593Smuzhiyun
199*4882a593SmuzhiyunConfigure viafb with "fbset" tool
200*4882a593Smuzhiyun---------------------------------
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun    "fbset" is an inbox utility of Linux.
203*4882a593Smuzhiyun
204*4882a593Smuzhiyun    1. Inquire current viafb information, type::
205*4882a593Smuzhiyun
206*4882a593Smuzhiyun	   # fbset -i
207*4882a593Smuzhiyun
208*4882a593Smuzhiyun    2. Set various resolutions and viafb_refresh rates::
209*4882a593Smuzhiyun
210*4882a593Smuzhiyun	   # fbset <resolution-vertical_sync>
211*4882a593Smuzhiyun
212*4882a593Smuzhiyun       example::
213*4882a593Smuzhiyun
214*4882a593Smuzhiyun	   # fbset "1024x768-75"
215*4882a593Smuzhiyun
216*4882a593Smuzhiyun       or::
217*4882a593Smuzhiyun
218*4882a593Smuzhiyun	   # fbset -g 1024 768 1024 768 32
219*4882a593Smuzhiyun
220*4882a593Smuzhiyun       Check the file "/etc/fb.modes" to find display modes available.
221*4882a593Smuzhiyun
222*4882a593Smuzhiyun    3. Set the color depth::
223*4882a593Smuzhiyun
224*4882a593Smuzhiyun	   # fbset -depth <value>
225*4882a593Smuzhiyun
226*4882a593Smuzhiyun       example::
227*4882a593Smuzhiyun
228*4882a593Smuzhiyun	   # fbset -depth 16
229*4882a593Smuzhiyun
230*4882a593Smuzhiyun
231*4882a593SmuzhiyunConfigure viafb via /proc
232*4882a593Smuzhiyun-------------------------
233*4882a593Smuzhiyun    The following files exist in /proc/viafb
234*4882a593Smuzhiyun
235*4882a593Smuzhiyun    supported_output_devices
236*4882a593Smuzhiyun	This read-only file contains a full ',' separated list containing all
237*4882a593Smuzhiyun	output devices that could be available on your platform. It is likely
238*4882a593Smuzhiyun	that not all of those have a connector on your hardware but it should
239*4882a593Smuzhiyun	provide a good starting point to figure out which of those names match
240*4882a593Smuzhiyun	a real connector.
241*4882a593Smuzhiyun
242*4882a593Smuzhiyun	Example::
243*4882a593Smuzhiyun
244*4882a593Smuzhiyun		# cat /proc/viafb/supported_output_devices
245*4882a593Smuzhiyun
246*4882a593Smuzhiyun    iga1/output_devices, iga2/output_devices
247*4882a593Smuzhiyun	These two files are readable and writable. iga1 and iga2 are the two
248*4882a593Smuzhiyun	independent units that produce the screen image. Those images can be
249*4882a593Smuzhiyun	forwarded to one or more output devices. Reading those files is a way
250*4882a593Smuzhiyun	to query which output devices are currently used by an iga.
251*4882a593Smuzhiyun
252*4882a593Smuzhiyun	Example::
253*4882a593Smuzhiyun
254*4882a593Smuzhiyun		# cat /proc/viafb/iga1/output_devices
255*4882a593Smuzhiyun
256*4882a593Smuzhiyun	If there are no output devices printed the output of this iga is lost.
257*4882a593Smuzhiyun	This can happen for example if only one (the other) iga is used.
258*4882a593Smuzhiyun	Writing to these files allows adjusting the output devices during
259*4882a593Smuzhiyun	runtime. One can add new devices, remove existing ones or switch
260*4882a593Smuzhiyun	between igas. Essentially you can write a ',' separated list of device
261*4882a593Smuzhiyun	names (or a single one) in the same format as the output to those
262*4882a593Smuzhiyun	files. You can add a '+' or '-' as a prefix allowing simple addition
263*4882a593Smuzhiyun	and removal of devices. So a prefix '+' adds the devices from your list
264*4882a593Smuzhiyun	to the already existing ones, '-' removes the listed devices from the
265*4882a593Smuzhiyun	existing ones and if no prefix is given it replaces all existing ones
266*4882a593Smuzhiyun	with the listed ones. If you remove devices they are expected to turn
267*4882a593Smuzhiyun	off. If you add devices that are already part of the other iga they are
268*4882a593Smuzhiyun	removed there and added to the new one.
269*4882a593Smuzhiyun
270*4882a593Smuzhiyun	Examples:
271*4882a593Smuzhiyun
272*4882a593Smuzhiyun	Add CRT as output device to iga1::
273*4882a593Smuzhiyun
274*4882a593Smuzhiyun		# echo +CRT > /proc/viafb/iga1/output_devices
275*4882a593Smuzhiyun
276*4882a593Smuzhiyun	Remove (turn off) DVP1 and LVDS1 as output devices of iga2::
277*4882a593Smuzhiyun
278*4882a593Smuzhiyun		# echo -DVP1,LVDS1 > /proc/viafb/iga2/output_devices
279*4882a593Smuzhiyun
280*4882a593Smuzhiyun	Replace all iga1 output devices by CRT::
281*4882a593Smuzhiyun
282*4882a593Smuzhiyun		# echo CRT > /proc/viafb/iga1/output_devices
283*4882a593Smuzhiyun
284*4882a593Smuzhiyun
285*4882a593SmuzhiyunBootup with viafb
286*4882a593Smuzhiyun-----------------
287*4882a593Smuzhiyun
288*4882a593SmuzhiyunAdd the following line to your grub.conf::
289*4882a593Smuzhiyun
290*4882a593Smuzhiyun    append = "video=viafb:viafb_mode=1024x768,viafb_bpp=32,viafb_refresh=85"
291*4882a593Smuzhiyun
292*4882a593Smuzhiyun
293*4882a593SmuzhiyunVIA Framebuffer modes
294*4882a593Smuzhiyun=====================
295*4882a593Smuzhiyun
296*4882a593Smuzhiyun.. include:: viafb.modes
297*4882a593Smuzhiyun   :literal:
298