summaryrefslogtreecommitdiff
path: root/utils/nwztools/plattools/nwz_fb.h
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-11-06 00:12:04 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2016-11-06 00:12:04 +0100
commit5017babb307122d8567ca78a5721e96c4d7ff8f2 (patch)
tree26ca7ac1d8a3608e364d59a203c32b81b16f92e3 /utils/nwztools/plattools/nwz_fb.h
parentd492f25c54b4134fd6632156efee07670ab4004f (diff)
downloadrockbox-5017babb307122d8567ca78a5721e96c4d7ff8f2.tar.gz
rockbox-5017babb307122d8567ca78a5721e96c4d7ff8f2.zip
nwztools/plattools: fix black screen issue in dualboot, rework dualboot
Sony added extensions to the frambuffer interface. It is important to take them into account since the OF uses them and might leave the framebuffer in an unusual state which would make the dualboot not display anything. Also rework the dualboot code so that it can boot rockbox (not doing anything at the moment), display all tools or boot the OF. Change-Id: Ia0f589c9ec8558f375270841503c0964aff07f0b
Diffstat (limited to 'utils/nwztools/plattools/nwz_fb.h')
-rw-r--r--utils/nwztools/plattools/nwz_fb.h87
1 files changed, 85 insertions, 2 deletions
diff --git a/utils/nwztools/plattools/nwz_fb.h b/utils/nwztools/plattools/nwz_fb.h
index c857c5eb8a..9334b625c9 100644
--- a/utils/nwztools/plattools/nwz_fb.h
+++ b/utils/nwztools/plattools/nwz_fb.h
@@ -50,7 +50,90 @@ struct nwz_fb_brightness
50 int period; /* period in ms between steps when changing: >=10 */ 50 int period; /* period in ms between steps when changing: >=10 */
51}; 51};
52 52
53#define NWZ_FB_SET_BRIGHTNESS _IOW(NWZ_FB_TYPE, 0x07, struct nwz_fb_brightness) 53/* FB extensions:
54#define NWZ_FB_GET_BRIGHTNESS _IOR(NWZ_FB_TYPE, 0x08, struct nwz_fb_brightness) 54 *
55 * Sony added relatively complicated extensions to the framebuffer. They allow
56 * better control of framebuffer refresh, double-buffering and mixing with DSP
57 * (v4l2). Each outout (LCD and TV) has two buffers, called page 0 and 1 (or A
58 * and B). Each page has its own attributes (image info) that control
59 * transparency, rotation and updates. At any point in time, the LCD is drawing
60 * a page and one can select the next page to draw. Unless an UPDATE ioctl()
61 * is made to change it, the next page will be the same as the one being drawn.
62 *
63 * FIXME I don't know what the timer is, it seems irrelevant for the LCD but
64 * the OF uses it for TV, maybe this controls the refresh rate of the TV output?
65 *
66 * On a side note, this information only applies to a subset of LCD types (the
67 * LCD type can be gathered from icx_sysinfo):
68 * - BB(0): AQUILA BB LCD
69 * - SW(1): SWAN or FIJI LCD
70 * - FC(2): FALCON OLED
71 * - GM(3): GUAM and ROTA LCD
72 * - FR(5): FURANO LCD ---> /!\ DOES NOT APPLY /!\
73 * - SD(6): SPICA_D LCD
74 * - AQ(7): AQUILA LCD
75 */
76
77/* Image infomation:
78 * SET_MODE will change the attributes of the requested page (ie .page)
79 * GET_MODE will return the attributes of the currently being displayed page
80 * UPDATE will do the same thing as SET_MODE but immediately refreshes the screen */
81struct nwz_fb_image_info
82{
83 int tc_enable; /* enable(1)/disable(0) transparent color */
84 int t_color; /* transparent color (16bpp RGB565) */
85 int alpha; /* alpha ratio (0 - 255) */
86 int page; /* 2D framebuffer page(0/1) */
87 int rot; /* LCD image rotation(0/1=180deg.) */
88 int update; /* only use with NWZ_FB_UPDATE, ignored for others */
89};
90
91/* update type */
92#define NWZ_FB_ONLY_2D_MODE 0
93#define NWZ_FB_DSP_AND_2D_MODE 1
94
95/* frame buffer page infomation: when NWZ_FB_WAIT_REFREHS is called, the driver
96 * will wait until the next refresh or the timeout, whichever comes first. It
97 * will then fill this structure with the page status. */
98struct nwz_fb_status
99{
100 int timeout; /* waiting time for any frame ready (in units of 10 ms) */
101 int page0; /* page 0 is out of display or waiting to be displayed */
102 int page1; /* page 0 is out of display or waiting to be displayed */
103};
104
105/* frame buffer page status */
106#define NWZ_FB_OUT_OF_DISPLAY 0
107#define NWZ_FB_WAITING_FOR_ON_DISPLAY 1
108
109/* frame buffer update timer infomation (use I/F fb <-> 2D API) */
110struct nwz_fb_update_timer
111{
112 int timerflag; /* auto update off(0) / auto update on(1) */
113 int timeout; /* timeout timer value (ms) */
114};
115
116/* timer flags */
117#define NWZ_FB_TIMER_ON 1
118#define NWZ_FB_TIMER_OFF 0
119
120/* default and minimum timeout value */
121#define NWZ_FB_DEFAULT_TIMEOUT 60
122#define NWZ_FB_MIN_TIMEOUT 33
123
124/* mmap offsets for page 1 (page 0 is always at address 0) */
125#define NWZ_FB_LCD_PAGE_OFFSET 0x2f000
126
127/* NOTE: I renamed those from Sony's header, because their original names were
128 * pure crap */
129/* FIXME: Sony uses _IOR for NWZ_FB_WAIT_REFRESH but it should be _IORW */
130#define NWZ_FB_WAIT_REFRESH _IORW(NWZ_FB_TYPE, 0x00, struct nwz_fb_status)
131#define NWZ_FB_UPDATE _IOW(NWZ_FB_TYPE, 0x01, struct nwz_fb_image_info)
132#define NWZ_FB_SET_MODE _IOW(NWZ_FB_TYPE, 0x02, struct nwz_fb_image_info)
133#define NWZ_FB_GET_MODE _IOR(NWZ_FB_TYPE, 0x03, struct nwz_fb_image_info)
134#define NWZ_FB_UPDATE_TIMER _IOR(NWZ_FB_TYPE, 0x04, struct nwz_fb_update_timer)
135#define NWZ_FB_SET_BRIGHTNESS _IOW(NWZ_FB_TYPE, 0x07, struct nwz_fb_brightness)
136#define NWZ_FB_GET_BRIGHTNESS _IOR(NWZ_FB_TYPE, 0x08, struct nwz_fb_brightness)
137
55 138
56#endif /* __NWZ_FB_H__ */ 139#endif /* __NWZ_FB_H__ */