summaryrefslogtreecommitdiffstats
path: root/firmware/target/coldfire
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2012-02-22 21:18:05 +1100
committerJonathan Gordon <rockbox@jdgordon.info>2012-02-28 11:44:59 +1100
commitb37e6bc8c119289aca8740dd5e3b60d72f9d6b40 (patch)
tree7ee9d491811c950943f0fc068d2e2b460ff05c6d /firmware/target/coldfire
parent15c69b8bafc3e89e1a825b5bbefef4a97f0001b1 (diff)
downloadrockbox-b37e6bc8c119289aca8740dd5e3b60d72f9d6b40.tar.gz
rockbox-b37e6bc8c119289aca8740dd5e3b60d72f9d6b40.zip
lcd drivers: Convert lcd_[remote_]framebuffer to a pointer
Change all lcd drivers to using a pointer to the static framebuffer instead of directly accessing the static array. This will let us later do fun things like dynamic framebuffer sizes (RaaA) or ability to use different buffers for different layers (dynamic skin backdrops!) Change-Id: I0a4d58a9d7b55e6c932131b929e5d4c9f9414b06
Diffstat (limited to 'firmware/target/coldfire')
-rw-r--r--firmware/target/coldfire/iaudio/lcd-remote-iaudio.c4
-rw-r--r--firmware/target/coldfire/iaudio/m3/lcd-m3.c4
-rw-r--r--firmware/target/coldfire/iaudio/m5/lcd-m5.c4
-rw-r--r--firmware/target/coldfire/iaudio/x5/lcd-x5.c2
-rw-r--r--firmware/target/coldfire/iriver/h100/lcd-h100.c4
-rw-r--r--firmware/target/coldfire/iriver/h300/lcd-h300.c4
-rw-r--r--firmware/target/coldfire/iriver/lcd-remote-iriver.c4
-rw-r--r--firmware/target/coldfire/mpio/hd200/lcd-hd200.c4
-rw-r--r--firmware/target/coldfire/mpio/hd300/lcd-hd300.c4
9 files changed, 17 insertions, 17 deletions
diff --git a/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c b/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c
index 88fc6fc563..e84760e197 100644
--- a/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c
+++ b/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c
@@ -228,7 +228,7 @@ void lcd_remote_update(void)
have to update one page at a time. */
lcd_remote_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y));
lcd_remote_write_command_ex(LCD_SET_COLUMN | 0, 0);
- lcd_remote_write_data(lcd_remote_framebuffer[y], LCD_REMOTE_WIDTH);
+ lcd_remote_write_data(FBREMOTEADDR(0, y), LCD_REMOTE_WIDTH);
}
}
}
@@ -260,7 +260,7 @@ void lcd_remote_update_rect(int x, int y, int width, int height)
lcd_remote_write_command_ex(LCD_SET_COLUMN | ((x >> 4) & 0xf),
x & 0xf);
- lcd_remote_write_data(&lcd_remote_framebuffer[y][x], width);
+ lcd_remote_write_data(FBREMOTEADDR(x,y), width);
}
}
}
diff --git a/firmware/target/coldfire/iaudio/m3/lcd-m3.c b/firmware/target/coldfire/iaudio/m3/lcd-m3.c
index 380789e7f7..1d61daf323 100644
--- a/firmware/target/coldfire/iaudio/m3/lcd-m3.c
+++ b/firmware/target/coldfire/iaudio/m3/lcd-m3.c
@@ -265,7 +265,7 @@ void lcd_update(void)
have to update one page at a time. */
lcd_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y));
lcd_write_command_e(LCD_SET_COLUMN | 0, 0);
- lcd_write_data(lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data(FBADDR(0, y), LCD_WIDTH);
}
}
}
@@ -295,7 +295,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command(LCD_SET_PAGE | ((y > 5 ? y + 2 : y) & 0xf));
lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf);
- lcd_write_data(&lcd_framebuffer[y][x], width);
+ lcd_write_data(FBADDR(x,y), width);
}
}
}
diff --git a/firmware/target/coldfire/iaudio/m5/lcd-m5.c b/firmware/target/coldfire/iaudio/m5/lcd-m5.c
index ae8f14bb25..8f022adf96 100644
--- a/firmware/target/coldfire/iaudio/m5/lcd-m5.c
+++ b/firmware/target/coldfire/iaudio/m5/lcd-m5.c
@@ -207,7 +207,7 @@ void lcd_update(void)
lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data (FBADDR(0, y), LCD_WIDTH);
}
}
@@ -235,6 +235,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
index 19b0725ce4..cf6e301c16 100644
--- a/firmware/target/coldfire/iaudio/x5/lcd-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
@@ -530,7 +530,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_begin_write_gram();
- ptr = (unsigned short *)&lcd_framebuffer[y][x];
+ ptr = (unsigned short *)FBADDR(x,y);
do
{
diff --git a/firmware/target/coldfire/iriver/h100/lcd-h100.c b/firmware/target/coldfire/iriver/h100/lcd-h100.c
index ae77affd18..b13751b9eb 100644
--- a/firmware/target/coldfire/iriver/h100/lcd-h100.c
+++ b/firmware/target/coldfire/iriver/h100/lcd-h100.c
@@ -216,7 +216,7 @@ void lcd_update(void)
lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data (FBADDR(0, y), LCD_WIDTH);
}
}
@@ -244,6 +244,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}
diff --git a/firmware/target/coldfire/iriver/h300/lcd-h300.c b/firmware/target/coldfire/iriver/h300/lcd-h300.c
index 6c21a7e260..191c769c97 100644
--- a/firmware/target/coldfire/iriver/h300/lcd-h300.c
+++ b/firmware/target/coldfire/iriver/h300/lcd-h300.c
@@ -447,13 +447,13 @@ void lcd_update_rect(int x, int y, int width, int height)
if (width == LCD_WIDTH)
{
dma_count = 1;
- SAR3 = (unsigned long)lcd_framebuffer[y];
+ SAR3 = (unsigned long)FBADDR(0, y);
BCR3 = (LCD_WIDTH*sizeof(fb_data)) * height;
}
else
{
dma_count = height;
- SAR3 = dma_addr = (unsigned long)&lcd_framebuffer[y][x];
+ SAR3 = dma_addr = (unsigned long)FBADDR(x,y);
BCR3 = dma_len = width * sizeof(fb_data);
}
DCR3 = DMA_INT | DMA_AA | DMA_BWC(1)
diff --git a/firmware/target/coldfire/iriver/lcd-remote-iriver.c b/firmware/target/coldfire/iriver/lcd-remote-iriver.c
index 0ff041f033..03c0e40dbe 100644
--- a/firmware/target/coldfire/iriver/lcd-remote-iriver.c
+++ b/firmware/target/coldfire/iriver/lcd-remote-iriver.c
@@ -312,7 +312,7 @@ void lcd_remote_update(void)
lcd_remote_write_command(LCD_REMOTE_CNTL_SET_PAGE_ADDRESS | y);
lcd_remote_write_command(LCD_REMOTE_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf));
lcd_remote_write_command(LCD_REMOTE_CNTL_LOWCOL | (xoffset & 0xf));
- lcd_remote_write_data(lcd_remote_framebuffer[y], LCD_REMOTE_WIDTH);
+ lcd_remote_write_data(FBREMOTEADDR(0, y), LCD_REMOTE_WIDTH);
}
}
@@ -346,6 +346,6 @@ void lcd_remote_update_rect(int x, int y, int width, int height)
lcd_remote_write_command(LCD_REMOTE_CNTL_SET_PAGE_ADDRESS | y);
lcd_remote_write_command(LCD_REMOTE_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf));
lcd_remote_write_command(LCD_REMOTE_CNTL_LOWCOL | ((x+xoffset) & 0xf));
- lcd_remote_write_data(&lcd_remote_framebuffer[y][x], width);
+ lcd_remote_write_data(FBREMOTEADDR(x,y), width);
}
}
diff --git a/firmware/target/coldfire/mpio/hd200/lcd-hd200.c b/firmware/target/coldfire/mpio/hd200/lcd-hd200.c
index 879352f7b4..3c00959745 100644
--- a/firmware/target/coldfire/mpio/hd200/lcd-hd200.c
+++ b/firmware/target/coldfire/mpio/hd200/lcd-hd200.c
@@ -187,7 +187,7 @@ void DMA3(void)
lcd_write_command_e(LCD_SET_COLUMN | ((column >> 4) & 0xf),
column & 0x0f);
- SAR3 = (unsigned long)&lcd_framebuffer[page][column];
+ SAR3 = (unsigned long)FBADDR(column,page);
BCR3 = dma_len;
DCR3 = DMA_INT | DMA_AA | DMA_BWC(1)
| DMA_SINC | DMA_SSIZE(DMA_SIZE_LINE)
@@ -261,7 +261,7 @@ void lcd_update_rect(int x, int y, int width, int height)
dma_count = ymax - y + 1;
/* Initialize DMA transfer */
- SAR3 = (unsigned long)&lcd_framebuffer[page][column];
+ SAR3 = (unsigned long)FBADDR(column,page);
BCR3 = dma_len;
DCR3 = DMA_INT | DMA_AA | DMA_BWC(1)
| DMA_SINC | DMA_SSIZE(DMA_SIZE_LINE)
diff --git a/firmware/target/coldfire/mpio/hd300/lcd-hd300.c b/firmware/target/coldfire/mpio/hd300/lcd-hd300.c
index 31087a5d43..509ed4cd53 100644
--- a/firmware/target/coldfire/mpio/hd300/lcd-hd300.c
+++ b/firmware/target/coldfire/mpio/hd300/lcd-hd300.c
@@ -211,7 +211,7 @@ void lcd_update(void)
lcd_write_command(LCD_CNTL_DATA_WRITE);
/* Copy display bitmap to hardware */
- lcd_write_data (&lcd_framebuffer[0][0], LCD_WIDTH*LCD_FBHEIGHT);
+ lcd_write_data (FBADDR(0,0), LCD_WIDTH*LCD_FBHEIGHT);
}
/* Update a fraction of the display. */
@@ -238,6 +238,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}