移植Kernel上的HDMI驱动,目前已可以点亮屏幕,但是只能显示背景,无法显示图片信息,请问这个可能是什么问题呢?谢谢
移植中参考的代码:
\\ kernel drivers\gpu\drm\omapdrm\displays drivers\gpu\drm\omapdrm\dss \\ uboot uboot\drivers\video\am57xx-fb.c uboot\drivers\video\omap3_dss.c uboot\cmd\bmp.c uboot\common\lcd.c
使用VIDEO1时屏幕显示:背景颜色

配置信息:
#define FB_BASE_ADDR 0x85000000 // 显存地址 // 使用通道 OMAP_DSS_VIDEO1 OMAP_DSS_CHANNEL_DIGIT
使用GFX时,屏幕显示:花屏

bmp部分代码:
int video_display_bitmap(ulong bmp_image, int x, int y)
{
int lcd_line_length;
ushort *cmap_base = NULL;
ushort i, j;
uchar *fb;
struct bmp_image *bmp = (struct bmp_image *)map_sysmem(bmp_image, 0);
uchar *bmap;
ushort padded_width;
unsigned long width, height, byte_width;
unsigned long pwidth = VIDEO_COLS;
unsigned colors, bpix, bmp_bpix;
int hdr_size;
struct bmp_color_table_entry *palette = bmp->color_table;
if (!bmp || !(bmp->header.signature[0] == 'B' &&
bmp->header.signature[1] == 'M')) {
printf("Error: no valid bmp image at %lx\n", bmp_image);
return 1;
}
lcd_get_size(&lcd_line_length);
width = get_unaligned_le32(&bmp->header.width);
height = get_unaligned_le32(&bmp->header.height);
bmp_bpix = get_unaligned_le16(&bmp->header.bit_count);
hdr_size = get_unaligned_le16(&bmp->header.size);
zDebug2("hdr_size=%d, bmp_bpix=%d\n", hdr_size, bmp_bpix);
colors = 1 << bmp_bpix;
bpix = NBITS(VIDEO_PIXEL_SIZE);
if (bpix != 1 && bpix != 8 && bpix != 16 && bpix != 32)
{
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
bpix, bmp_bpix);
return 1;
}
/*
* We support displaying 8bpp BMPs on 16bpp LCDs
* and displaying 24bpp BMPs on 32bpp LCDs
* */
if (bpix != bmp_bpix &&
!(bmp_bpix == 8 && bpix == 16) &&
!(bmp_bpix == 24 && bpix == 32))
{
printf ("Error: %d bit/pixel mode, but BMP has %d bit/pixel\n",
bpix, get_unaligned_le16(&bmp->header.bit_count));
return 1;
}
printf("Display-bmp: %d x %d with %d colors, display %d\n",
(int)width, (int)height, (int)colors, 1 << bpix);
// if (bmp_bpix == 8)
// lcd_set_cmap(bmp, colors);
padded_width = (width & 0x3 ? (width & ~0x3) + 4 : width);
if ((x + width) > pwidth)
width = pwidth - x;
if ((y + height) > VIDEO_ROWS)
height = VIDEO_ROWS - y;
bmap = (uchar *)bmp + get_unaligned_le32(&bmp->header.data_offset);
fb = (uchar *)(video_fb_address +
(y + height - 1) * VIDEO_LINE_LEN + x * bpix / 8);
switch (bmp_bpix) {
case 1:
case 8:
printf("bmp 8 bit is not support\n");
break;
#if defined(CONFIG_BMP_16BPP)
case 16:
for (i = 0; i < height; ++i) {
WATCHDOG_RESET();
for (j = 0; j < width; j++)
fb_put_word(&fb, &bmap);
bmap += (padded_width - width) * 2;
fb -= width * 2 + lcd_line_length;
}
break;
#endif /* CONFIG_BMP_16BPP */
#if defined(CONFIG_BMP_24BMP)
case 24:
for (i = 0; i < height; ++i) {
for (j = 0; j < width; j++) {
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
*(fb++) = 0;
}
fb -= lcd_line_length + width * (bpix / 8);
}
break;
#endif /* CONFIG_BMP_24BMP */
#if defined(CONFIG_BMP_32BPP)
case 32:
for (i = 0; i < height; ++i) {
for (j = 0; j < width; j++) {
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
}
fb -= lcd_line_length + width * (bpix / 8);
}
break;
#endif /* CONFIG_BMP_32BPP */
default:
break;
};
flush_dcache_range(VIDEO_FB_ADRS, VIDEO_SIZE);
return 0;
}
