1
0
Fork 0
forked from len0rd/rockbox

zen/zenxfi: switch lcd driver to 24-bit mode

Change-Id: I2c42f0e422130bcdaf1aaf92c7b56776752f4f64
This commit is contained in:
Amaury Pouly 2014-06-22 12:55:41 +02:00
parent cd4fb9ee79
commit d5591a2b28
9 changed files with 22 additions and 46 deletions

View file

@ -1189,6 +1189,7 @@ target/arm/imx233/fmradio-imx233.c
#endif #endif
target/arm/imx233/creative-zen/backlight-zen.c target/arm/imx233/creative-zen/backlight-zen.c
# if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI) # if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI)
drivers/lcd-memframe.c
target/arm/imx233/creative-zen/lcd-zen.c target/arm/imx233/creative-zen/lcd-zen.c
# elif defined(CREATIVE_ZENMOZAIC) # elif defined(CREATIVE_ZENMOZAIC)
target/arm/imx233/creative-zen/lcd-zenmozaic.c target/arm/imx233/creative-zen/lcd-zenmozaic.c

View file

@ -10,7 +10,8 @@ strlen.c
#if (defined(SANSA_E200) || defined(GIGABEAT_F) || defined(GIGABEAT_S) || \ #if (defined(SANSA_E200) || defined(GIGABEAT_F) || defined(GIGABEAT_S) || \
defined(CREATIVE_ZVx) || defined(SANSA_CONNECT) || defined(SANSA_FUZEPLUS) || \ defined(CREATIVE_ZVx) || defined(SANSA_CONNECT) || defined(SANSA_FUZEPLUS) || \
defined(COWON_D2) || defined(MINI2440) || defined(SAMSUNG_YPR0) || \ defined(COWON_D2) || defined(MINI2440) || defined(SAMSUNG_YPR0) || \
defined(SAMSUNG_YPR1) || (defined(MROBE_500) && !defined(LCD_USE_DMA))) && \ defined(SAMSUNG_YPR1) || (defined(MROBE_500) && !defined(LCD_USE_DMA)) || \
defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI)) && \
!defined(SIMULATOR) !defined(SIMULATOR)
#if LCD_DEPTH == 24 #if LCD_DEPTH == 24
lcd-as-memframe-24bit.c lcd-as-memframe-24bit.c

View file

@ -95,10 +95,8 @@
#define LCD_HEIGHT 240 #define LCD_HEIGHT 240
/* sqrt(320^2 + 240^2) / 2.5 = 160.0 */ /* sqrt(320^2 + 240^2) / 2.5 = 160.0 */
#define LCD_DPI 160 #define LCD_DPI 160
#define LCD_DEPTH 16 /* 65536 colours */ #define LCD_DEPTH 24 /* 65536 colours */
#define LCD_PIXELFORMAT RGB565 /* rgb565 */ #define LCD_PIXELFORMAT RGB888 /* rgb565 */
/* framebuffer uses 24-bit/pix */
#define IMX233_FRAMEBUFFER_SIZE (LCD_WIDTH * LCD_HEIGHT * 3)
/* Define this if you have a software controlled poweroff */ /* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF #define HAVE_SW_POWEROFF

View file

@ -102,10 +102,8 @@
#define LCD_HEIGHT 240 #define LCD_HEIGHT 240
/* sqrt(320^2 + 240^2) / 2.5 = 160.0 */ /* sqrt(320^2 + 240^2) / 2.5 = 160.0 */
#define LCD_DPI 160 #define LCD_DPI 160
#define LCD_DEPTH 16 /* 65536 colours */ #define LCD_DEPTH 24 /* 65536 colours */
#define LCD_PIXELFORMAT RGB565 /* rgb565 */ #define LCD_PIXELFORMAT RGB888 /* rgb565 */
/* framebuffer uses 24-bit/pix */
#define IMX233_FRAMEBUFFER_SIZE (LCD_WIDTH * LCD_HEIGHT * 3)
/* Define this if you have a software controlled poweroff */ /* Define this if you have a software controlled poweroff */
#define HAVE_SW_POWEROFF #define HAVE_SW_POWEROFF

View file

@ -23,4 +23,9 @@
bool lcd_debug_screen(void); bool lcd_debug_screen(void);
#if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI)
#define LCD_FRAMEBUF_ADDR(col, row) (row*LCD_WIDTH + col + (fb_data *)FRAME)
extern void lcd_set_active(bool active);
#endif
#endif /* LCD_TARGET_H */ #endif /* LCD_TARGET_H */

View file

@ -30,16 +30,14 @@
#include "clkctrl-imx233.h" #include "clkctrl-imx233.h"
#include "pinctrl-imx233.h" #include "pinctrl-imx233.h"
#include "dma-imx233.h" #include "dma-imx233.h"
#include "regs/regs-uartdbg.h"
#include "logf.h" #include "logf.h"
#include "lcd-target.h"
#ifndef BOOTLOADER #ifndef BOOTLOADER
#include "button.h" #include "button.h"
#include "font.h" #include "font.h"
#include "action.h" #include "action.h"
#endif #endif
static bool lcd_on;
/** /**
* DMA * DMA
*/ */
@ -170,7 +168,7 @@ static void lcd_power_seq(void)
static void lcd_init_seq(void) static void lcd_init_seq(void)
{ {
/* NOTE I don't understand why I have to use BGR, logic would say I should not */ /* NOTE I don't understand why I have to use BGR, logic would say I should not */
spi_write_reg(0x1, 0x2b1d);// inversion spi_write_reg(0x1, 0x231d);// no inversion
spi_write_reg(0x2, 0x300); spi_write_reg(0x2, 0x300);
/* NOTE by default stmp3700 has vsync/hsync active low and data launch /* NOTE by default stmp3700 has vsync/hsync active low and data launch
* at negative edge of dotclk, reflect this in the polarity settings */ * at negative edge of dotclk, reflect this in the polarity settings */
@ -225,18 +223,13 @@ static void lcd_display_off_seq(void)
* Rockbox * Rockbox
*/ */
bool lcd_active(void)
{
return lcd_on;
}
void lcd_enable(bool enable) void lcd_enable(bool enable)
{ {
if(lcd_on == enable) if(lcd_active() == enable)
return; return;
lcd_on = enable; lcd_set_active(enable);
if(lcd_on) if(lcd_active())
{ {
// enable spi // enable spi
spi_enable(true); spi_enable(true);
@ -341,27 +334,3 @@ void lcd_init_device(void)
// enable // enable
lcd_enable(true); lcd_enable(true);
} }
void lcd_update(void)
{
lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
}
void lcd_update_rect(int x, int y, int w, int h)
{
#ifdef HAVE_LCD_ENABLE
if(!lcd_on)
return;
#endif
for(int yy = y; yy < y + h; yy++)
{
uint16_t *pix = FBADDR(x, yy);
uint8_t *p = 3 * (yy * LCD_WIDTH + x) + (uint8_t *)FRAME;
for(int xx = 0; xx < w; xx++, pix++)
{
*p++ = RGB_UNPACK_RED(*pix);
*p++ = RGB_UNPACK_GREEN(*pix);
*p++ = RGB_UNPACK_BLUE(*pix);
}
}
}

View file

@ -127,6 +127,8 @@ void lcd_enable(bool enable)
return; return;
lcd_on = enable; lcd_on = enable;
if(enable)
send_event(LCD_EVENT_ACTIVATION, NULL);
} }
#endif #endif

View file

@ -138,6 +138,8 @@ void lcd_enable(bool enable)
return; return;
lcd_on = enable; lcd_on = enable;
if(enable)
send_event(LCD_EVENT_ACTIVATION, NULL);
} }
#endif #endif

2
tools/configure vendored
View file

@ -2377,7 +2377,7 @@ fi
target="CREATIVE_ZEN" target="CREATIVE_ZEN"
memory=32 memory=32
bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
bmp2rb_native="$rootdir/tools/bmp2rb -f 4" bmp2rb_native="$rootdir/tools/bmp2rb -f 9"
tool="$rootdir/tools/scramble -add=zen" tool="$rootdir/tools/scramble -add=zen"
output="rockbox.creative" output="rockbox.creative"
bootoutput="bootloader-zen.creative" bootoutput="bootloader-zen.creative"