forked from len0rd/rockbox
iPod 5G: Split lcd_bcm_finishup() function into two halves, and incorporate into the start and end of lcd_update_rect.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8712 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4c63ab6a6e
commit
bd203e02cb
1 changed files with 21 additions and 16 deletions
|
@ -131,21 +131,7 @@ static unsigned lcd_bcm_read32(unsigned address) {
|
||||||
return inw(0x30000000) | inw(0x30000000) << 16;
|
return inw(0x30000000) | inw(0x30000000) << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void lcd_bcm_finishup(void) {
|
extern void _HD_ARM_Update5G (fb_data *fb, int x, int y, int w, int h);
|
||||||
unsigned data;
|
|
||||||
|
|
||||||
outw(0x31, 0x30030000);
|
|
||||||
|
|
||||||
lcd_bcm_read32(0x1FC);
|
|
||||||
|
|
||||||
do {
|
|
||||||
/* This function takes about 14ms to execute - so we yield() */
|
|
||||||
yield();
|
|
||||||
data = lcd_bcm_read32(0x1F8);
|
|
||||||
} while (data == 0xFFFA0005 || data == 0xFFFF);
|
|
||||||
|
|
||||||
lcd_bcm_read32(0x1FC);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Update a fraction of the display. */
|
/* Update a fraction of the display. */
|
||||||
void lcd_update_rect(int x, int y, int width, int height) ICODE_ATTR;
|
void lcd_update_rect(int x, int y, int width, int height) ICODE_ATTR;
|
||||||
|
@ -155,7 +141,9 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
int newx,newwidth;
|
int newx,newwidth;
|
||||||
int count;
|
int count;
|
||||||
int c, r;
|
int c, r;
|
||||||
|
unsigned int data;
|
||||||
unsigned short *src;
|
unsigned short *src;
|
||||||
|
static int finishup_needed = 0;
|
||||||
|
|
||||||
/* Ensure x and width are both even - so we can read 32-bit aligned
|
/* Ensure x and width are both even - so we can read 32-bit aligned
|
||||||
data from lcd_framebuffer */
|
data from lcd_framebuffer */
|
||||||
|
@ -170,6 +158,18 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
rect3 = (x + width) - 1; /* max horiz */
|
rect3 = (x + width) - 1; /* max horiz */
|
||||||
rect4 = (y + height) - 1; /* max vert */
|
rect4 = (y + height) - 1; /* max vert */
|
||||||
|
|
||||||
|
if (finishup_needed) {
|
||||||
|
/* Bottom-half of original lcd_bcm_finishup() function */
|
||||||
|
do {
|
||||||
|
/* This function takes about 14ms to execute - so we yield() */
|
||||||
|
yield();
|
||||||
|
data = lcd_bcm_read32(0x1F8);
|
||||||
|
} while (data == 0xFFFA0005 || data == 0xFFFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
lcd_bcm_read32(0x1FC);
|
||||||
|
|
||||||
|
|
||||||
/* setup the drawing region */
|
/* setup the drawing region */
|
||||||
count=(width * height) << 1;
|
count=(width * height) << 1;
|
||||||
lcd_bcm_setup_rect(0x34, rect1, rect2, rect3, rect4, count);
|
lcd_bcm_setup_rect(0x34, rect1, rect2, rect3, rect4, count);
|
||||||
|
@ -193,7 +193,12 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
src += (LCD_WIDTH - width);
|
src += (LCD_WIDTH - width);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_bcm_finishup();
|
/* Top-half of original lcd_bcm_finishup() function */
|
||||||
|
outw(0x31, 0x30030000);
|
||||||
|
|
||||||
|
lcd_bcm_read32(0x1FC);
|
||||||
|
|
||||||
|
finishup_needed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the display.
|
/* Update the display.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue