371f4cfd |
1 | OMAP specific SDL driver |
2 | by GraÅžvydas "notaz" Ignotas |
50339c93 |
3 | |
4 | |
5 | About |
6 | ----- |
7 | |
8 | This is a quick SDL driver to make use of some OMAP features, namely double |
9 | buffering and hardware scaler. |
10 | |
371f4cfd |
11 | Features: |
12 | |
13 | * hardware scaling support (up and down) |
14 | * doublebuffering support (can eliminate tearing) |
15 | * vsync support (can give smooth scrolling if done right) |
16 | * keymap change with a config file |
17 | * 16/24/32bpp display support |
18 | * touchscreen input translation to scaler source image coordinates |
19 | * screen surface cropping / border removal support |
20 | |
21 | Caveats: |
22 | * disabled by default (falls back to x11/fbcon SDL drivers) unless |
23 | SDL_VIDEODRIVER environment variable is set |
24 | * no windowed mode support, fullscreen only |
25 | * requires functional DSS2 driver with /dev/fb1 mapped to overlay1 or |
26 | overlay2 and enough free VRAM available for requested display mode. |
50339c93 |
27 | |
28 | Although this was created for pandora, there is nothing preventing this to work |
29 | on other OMAP platforms as well (well, nothing intentional at least). |
30 | |
31 | |
32 | Usage / environment |
33 | ------------------- |
34 | |
35 | To enable this driver, SDL_VIDEODRIVER environment variable must be set to |
36 | "omapdss". It can be set by calling setenv() in the code, but it's better to |
37 | just set it in launcher script so that it can be changed easily without |
38 | recompiling as needed: |
39 | --- |
40 | #!/bin/sh |
41 | export SDL_VIDEODRIVER=omapdss |
42 | ./your_program_here |
43 | --- |
44 | |
45 | Other environment variables: |
5d957fa5 |
46 | |
50339c93 |
47 | SDL_OMAP_LAYER_SIZE: |
48 | Output layer size. Regardless what you set with SDL_SetVideoMode(), output |
455c8c43 |
49 | will be scaled to this size using hardware with zero processing cost. |
50 | Note: scaling amount range is limited to roughly 1/4x-8x. The exact range |
51 | depends on various factors like version of the driver or OMAP hardware itself. |
52 | Valid values: |
50339c93 |
53 | "WxH", for example "640x480" |
0bb19c41 |
54 | "fullscreen" to cover whole screen. |
5d957fa5 |
55 | |
455c8c43 |
56 | SDL_OMAP_BORDER_CUT: |
57 | This can be used to move parts of SDL surface out of screen, in other |
58 | words cut borders and zoom in. Format: <left>,<right>,<top>,<bottom> |
59 | For example, "0,0,16,0" would hide top 16 lines offscreen, making 17th |
60 | (16th if you count from 0) line the first visible. |
61 | Note: like for layer size ranges are limited. |
62 | |
50339c93 |
63 | SDL_OMAP_VSYNC: |
5d957fa5 |
64 | Enables waiting for vertical sync on SDL_Flip() calls. |
50339c93 |
65 | Set to "1" to enable, "0" to disable. |
66 | |
5d957fa5 |
67 | SDL_OMAP_DEFAULT_MODE: |
68 | If the app doesn't specify resolution in SDL_SetVideoMode(), then use this. |
69 | Should be specified in "WxH" format, for example "640x480". |
70 | |
0bb19c41 |
71 | SDL_OMAP_FORCE_DOUBLEBUF: |
72 | This can force double buffering to on, which can help to eliminate tearing. |
73 | Note that if app isn't updating whole buffer each frame, it will glitch. |
74 | This is the same as specifying SDL_DOUBLEBUF to SDL_SetVideoMode. |
75 | |
5f4b1fd3 |
76 | SDL_OMAP_NO_TS_TRANSLATE: |
77 | Disable automatic touchscreen screen -> layer coordinate translation, |
78 | return real screen coordinates. |
79 | |
e1837b2c |
80 | SDL_OMAP_TS_FORCE_TSLIB: |
81 | Always use tslib to read touchscreen. Without this, use X events when they |
82 | are available (this gives external input device support). |
83 | |
50339c93 |
84 | |
85 | Config file |
86 | ----------- |
87 | |
88 | Optionally a file named "omapsdl.cfg" can be created in the game's working |
89 | directory. It has lower priority than environment variables, and has these |
90 | options (only when omapdss driver is active): |
91 | |
92 | # same as SDL_OMAP_VSYNC |
93 | force_vsync = 1/0 |
94 | |
0bb19c41 |
95 | # same as SDL_OMAP_FORCE_DOUBLEBUF |
96 | force_doublebuf = 1/0 |
97 | |
5f4b1fd3 |
98 | # same as SDL_OMAP_NO_TS_TRANSLATE |
99 | no_ts_translate = 1/0 |
100 | |
e1837b2c |
101 | # same as SDL_OMAP_TS_FORCE_TSLIB |
102 | ts_force_tslib = 1/0 |
103 | |
50339c93 |
104 | # can be used to bind a key to SDL keysym, good for quick ports. |
105 | # Example: |
106 | # bind ev_home = sdlk_space |
107 | bind ev_<evdev_key> = <sdl_key> |
108 | |
7b66578c |
109 | |
110 | Source |
111 | ------ |
112 | |
113 | Available at git://notaz.gp2x.de/~notaz/sdl_omap.git |
114 | |