summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-10-09 18:22:21 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-10-09 18:22:21 -0600
commit75e0cdbb60823e57a39005d011dbabe9290bc4da (patch)
tree0bba1aae4a2844f9d57cf16b0a274ba382aba9c3
parentd67a12a28d37ae931fd779a3e19bfe93ce244707 (diff)
downloadnuttx-75e0cdbb60823e57a39005d011dbabe9290bc4da.tar.gz
nuttx-75e0cdbb60823e57a39005d011dbabe9290bc4da.tar.bz2
nuttx-75e0cdbb60823e57a39005d011dbabe9290bc4da.zip
SAMA5 LCDC: Few more bug fixes but still not working
-rw-r--r--nuttx/arch/arm/src/sama5/sam_lcd.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/nuttx/arch/arm/src/sama5/sam_lcd.c b/nuttx/arch/arm/src/sama5/sam_lcd.c
index 456d32b0a..e027b2096 100644
--- a/nuttx/arch/arm/src/sama5/sam_lcd.c
+++ b/nuttx/arch/arm/src/sama5/sam_lcd.c
@@ -1147,9 +1147,10 @@ static void sam_dmasetup(int lid, struct sam_dscr_s *dscr, uint8_t *buffer)
/* Modify descriptor */
+ physaddr = sam_physramaddr((uintptr_t)dscr);
dscr->addr = (uint32_t)buffer;
dscr->ctrl = LCDC_BASECTRL_DFETCH;
- dscr->next = (uint32_t)dscr;
+ dscr->next = (uint32_t)physaddr;
/* Flush the modified descriptor to RAM */
@@ -1158,12 +1159,12 @@ static void sam_dmasetup(int lid, struct sam_dscr_s *dscr, uint8_t *buffer)
/* Modify registers */
- physaddr = sam_physramaddr((uint32_t)buffer);
- sam_putreg(g_layerhead[lid], physaddr);
+ physaddr = sam_physramaddr((uintptr_t)buffer);
+ sam_putreg(g_layeraddr[lid], physaddr);
sam_putreg(g_layerctrl[lid], LCDC_BASECTRL_DFETCH);
- physaddr = sam_physramaddr((uint32_t)dscr);
+ physaddr = sam_physramaddr((uintptr_t)dscr);
sam_putreg(g_layernext[lid], physaddr);
}
@@ -1568,7 +1569,7 @@ static void sam_ovr2_disable(void)
* channel at the end of the frame.
*/
- dscr = (uintptr_t)&g_ovr1.dscr;
+ dscr = (uintptr_t)&g_ovr2.dscr;
physaddr = sam_physramaddr(dscr);
g_ovr2.dscr.next = physaddr;
@@ -2974,8 +2975,8 @@ void sam_lcdclear(nxgl_mxpixel_t color)
for (i = 0; i < SAMA5_BASE_FBSIZE; i += 3*sizeof(uint8_t))
{
*dest++ = b;
- *dest++ = r;
*dest++ = g;
+ *dest++ = r;
}
#elif SAMA5_LCDC_BASE_BPP == 32
uint32_t *dest = (uint32_t*)g_base.layer.framebuffer;