Commit 3d47b2d741683023de05f08f9adb4bd25c189c46

Authored by Martin Pietryka
Committed by Anatolij Gustschin
1 parent 7d045170ac

drivers/video/am335x-fb: Properly point framebuffer behind palette

The DMA was outputting the palette on the screen because the base
for the DMA was not after the palette. In addition to that, the ceiling was
also too high, this led that the output on the screen was shifted.

NOTE: According to the TRM, even in 16/24bit mode a palette is required
in the first 32 bytes of the framebuffer.

See also:
https://e2e.ti.com/support/arm/sitara_arm/f/791/p/234967/834483#834483

"In this mode, the LCDC will assume all information is data and thus you
need to ensure that the DMA points to the first pixel of data and not the
first entry in the frame buffer which is the beginning of the 512 byte
palette."

Signed-off-by: Martin Pietryka <martin.pietryka@chello.at>
Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

drivers/video/am335x-fb.c
... ... @@ -143,6 +143,8 @@
143 143 /* palette default entry */
144 144 memset((void *)gd->fb_base, 0, 0x20);
145 145 *(unsigned int *)gd->fb_base = 0x4000;
  146 + /* point fb behind palette */
  147 + gd->fb_base += 0x20;
146 148  
147 149 /* turn ON display through powercontrol function if accessible */
148 150 if (0 != panel->panel_power_ctrl)
149 151  
... ... @@ -154,9 +156,9 @@
154 156 lcdhw->raster_ctrl = 0;
155 157 lcdhw->ctrl = LCD_CLK_DIVISOR(panel->pxl_clk_div) | LCD_RASTER_MODE;
156 158 lcdhw->lcddma_fb0_base = gd->fb_base;
157   - lcdhw->lcddma_fb0_ceiling = gd->fb_base + FBSIZE(panel) + 0x20;
  159 + lcdhw->lcddma_fb0_ceiling = gd->fb_base + FBSIZE(panel);
158 160 lcdhw->lcddma_fb1_base = gd->fb_base;
159   - lcdhw->lcddma_fb1_ceiling = gd->fb_base + FBSIZE(panel) + 0x20;
  161 + lcdhw->lcddma_fb1_ceiling = gd->fb_base + FBSIZE(panel);
160 162 lcdhw->lcddma_ctrl = LCD_DMA_BURST_SIZE(LCD_DMA_BURST_16);
161 163  
162 164 lcdhw->raster_timing0 = LCD_HORLSB(panel->hactive) |
... ... @@ -178,8 +180,6 @@
178 180 LCD_PALMODE_RAWDATA |
179 181 LCD_TFT_MODE |
180 182 LCD_RASTER_ENABLE;
181   -
182   - gd->fb_base += 0x20; /* point fb behind palette */
183 183  
184 184 debug("am335x-fb: waiting picture to be stable.\n.");
185 185 mdelay(panel->pon_delay);