From 5017babb307122d8567ca78a5721e96c4d7ff8f2 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sun, 6 Nov 2016 00:12:04 +0100 Subject: 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 --- utils/nwztools/plattools/nwz_lib.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'utils/nwztools/plattools/nwz_lib.c') diff --git a/utils/nwztools/plattools/nwz_lib.c b/utils/nwztools/plattools/nwz_lib.c index 087db8834a..43dc977d42 100644 --- a/utils/nwztools/plattools/nwz_lib.c +++ b/utils/nwztools/plattools/nwz_lib.c @@ -238,6 +238,27 @@ int nwz_fb_set_brightness(int fd, struct nwz_fb_brightness *bl) return 1; } +int nwz_fb_set_standard_mode(int fd) +{ + /* disable timer (apparently useless with LCD) */ + struct nwz_fb_update_timer update_timer; + update_timer.timerflag = NWZ_FB_TIMER_OFF; + update_timer.timeout = NWZ_FB_DEFAULT_TIMEOUT; + if(ioctl(fd, NWZ_FB_UPDATE_TIMER, &update_timer) < 0) + return -1; + /* set page 0 mode to no transparency and no rotation */ + struct nwz_fb_image_info mode_info; + mode_info.tc_enable = 0; + mode_info.t_color = 0; + mode_info.alpha = 0; + mode_info.rot = 0; + mode_info.page = 0; + mode_info.update = NWZ_FB_ONLY_2D_MODE; + if(ioctl(fd, NWZ_FB_UPDATE, &mode_info) < 0) + return -2; + return 0; +} + int nwz_adc_open(void) { return open(NWZ_ADC_DEV, O_RDONLY); -- cgit v1.2.3