zen/zenxfi: switch lcd driver to 24-bit mode
Change-Id: I2c42f0e422130bcdaf1aaf92c7b56776752f4f64
This commit is contained in:
parent
cd4fb9ee79
commit
d5591a2b28
9 changed files with 22 additions and 46 deletions
|
@ -1189,6 +1189,7 @@ target/arm/imx233/fmradio-imx233.c
|
|||
#endif
|
||||
target/arm/imx233/creative-zen/backlight-zen.c
|
||||
# if defined(CREATIVE_ZEN) || defined(CREATIVE_ZENXFI)
|
||||
drivers/lcd-memframe.c
|
||||
target/arm/imx233/creative-zen/lcd-zen.c
|
||||
# elif defined(CREATIVE_ZENMOZAIC)
|
||||
target/arm/imx233/creative-zen/lcd-zenmozaic.c
|
||||
|
|
|
@ -10,7 +10,8 @@ strlen.c
|
|||
#if (defined(SANSA_E200) || defined(GIGABEAT_F) || defined(GIGABEAT_S) || \
|
||||
defined(CREATIVE_ZVx) || defined(SANSA_CONNECT) || defined(SANSA_FUZEPLUS) || \
|
||||
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)
|
||||
#if LCD_DEPTH == 24
|
||||
lcd-as-memframe-24bit.c
|
||||
|
|
|
@ -95,10 +95,8 @@
|
|||
#define LCD_HEIGHT 240
|
||||
/* sqrt(320^2 + 240^2) / 2.5 = 160.0 */
|
||||
#define LCD_DPI 160
|
||||
#define LCD_DEPTH 16 /* 65536 colours */
|
||||
#define LCD_PIXELFORMAT RGB565 /* rgb565 */
|
||||
/* framebuffer uses 24-bit/pix */
|
||||
#define IMX233_FRAMEBUFFER_SIZE (LCD_WIDTH * LCD_HEIGHT * 3)
|
||||
#define LCD_DEPTH 24 /* 65536 colours */
|
||||
#define LCD_PIXELFORMAT RGB888 /* rgb565 */
|
||||
|
||||
/* Define this if you have a software controlled poweroff */
|
||||
#define HAVE_SW_POWEROFF
|
||||
|
|
|
@ -102,10 +102,8 @@
|
|||
#define LCD_HEIGHT 240
|
||||
/* sqrt(320^2 + 240^2) / 2.5 = 160.0 */
|
||||
#define LCD_DPI 160
|
||||
#define LCD_DEPTH 16 /* 65536 colours */
|
||||
#define LCD_PIXELFORMAT RGB565 /* rgb565 */
|
||||
/* framebuffer uses 24-bit/pix */
|
||||
#define IMX233_FRAMEBUFFER_SIZE (LCD_WIDTH * LCD_HEIGHT * 3)
|
||||
#define LCD_DEPTH 24 /* 65536 colours */
|
||||
#define LCD_PIXELFORMAT RGB888 /* rgb565 */
|
||||
|
||||
/* Define this if you have a software controlled poweroff */
|
||||
#define HAVE_SW_POWEROFF
|
||||
|
|
|
@ -23,4 +23,9 @@
|
|||
|
||||
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 */
|
||||
|
|
|
@ -30,16 +30,14 @@
|
|||
#include "clkctrl-imx233.h"
|
||||
#include "pinctrl-imx233.h"
|
||||
#include "dma-imx233.h"
|
||||
#include "regs/regs-uartdbg.h"
|
||||
#include "logf.h"
|
||||
#include "lcd-target.h"
|
||||
#ifndef BOOTLOADER
|
||||
#include "button.h"
|
||||
#include "font.h"
|
||||
#include "action.h"
|
||||
#endif
|
||||
|
||||
static bool lcd_on;
|
||||
|
||||
/**
|
||||
* DMA
|
||||
*/
|
||||
|
@ -170,7 +168,7 @@ static void lcd_power_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 */
|
||||
spi_write_reg(0x1, 0x2b1d);// inversion
|
||||
spi_write_reg(0x1, 0x231d);// no inversion
|
||||
spi_write_reg(0x2, 0x300);
|
||||
/* NOTE by default stmp3700 has vsync/hsync active low and data launch
|
||||
* at negative edge of dotclk, reflect this in the polarity settings */
|
||||
|
@ -225,18 +223,13 @@ static void lcd_display_off_seq(void)
|
|||
* Rockbox
|
||||
*/
|
||||
|
||||
bool lcd_active(void)
|
||||
{
|
||||
return lcd_on;
|
||||
}
|
||||
|
||||
void lcd_enable(bool enable)
|
||||
{
|
||||
if(lcd_on == enable)
|
||||
if(lcd_active() == enable)
|
||||
return;
|
||||
|
||||
lcd_on = enable;
|
||||
if(lcd_on)
|
||||
lcd_set_active(enable);
|
||||
if(lcd_active())
|
||||
{
|
||||
// enable spi
|
||||
spi_enable(true);
|
||||
|
@ -341,27 +334,3 @@ void lcd_init_device(void)
|
|||
// enable
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,6 +127,8 @@ void lcd_enable(bool enable)
|
|||
return;
|
||||
|
||||
lcd_on = enable;
|
||||
if(enable)
|
||||
send_event(LCD_EVENT_ACTIVATION, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -138,6 +138,8 @@ void lcd_enable(bool enable)
|
|||
return;
|
||||
|
||||
lcd_on = enable;
|
||||
if(enable)
|
||||
send_event(LCD_EVENT_ACTIVATION, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
2
tools/configure
vendored
2
tools/configure
vendored
|
@ -2377,7 +2377,7 @@ fi
|
|||
target="CREATIVE_ZEN"
|
||||
memory=32
|
||||
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"
|
||||
output="rockbox.creative"
|
||||
bootoutput="bootloader-zen.creative"
|
||||
|
|
Loading…
Reference in a new issue