HDMI display in nano

Hello , I find a problem about HDMI display a bgr file (1920*1080) by framebuffer(/dev/fb0), but it does not work well,the code is:

m_tFBInfo.tBuf.start = (MAX_S8 *)mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, m_tFBInfo.iFrameFd, 0);

for(int i =0; i <1080; i++)
{
	memcpy((unsigned char *) m_tFBInfo.tBuf.start + i * 1920 * 3,
                    tlocalfile.pFileBuf, 1920 * 3);
}

please help me ,thanks

Hi,

Please share the full code with us. What kind of error did you see?

Actually, we seldom directly do operation on the fbdev API. But use EGL or DRM-KMS to do the render work.

the code is
m_tFBInfo.iFrameFd = open(/dev/fb0, O_RDWR);
if (m_tFBInfo.iFrameFd < 0)
{
printf(“Error: cannot open framebuffer device.\n”);
return OPEN_FRAMEBUFFER_FILE;
}

if (ioctl(m_tFBInfo.iFrameFd, FBIOGET_FSCREENINFO, &finfo))  
{  
    printf("Error:reading fixed information.\n");  
    return OPEN_FRAMEBUFFER_FILE;  
}  

if (ioctl(m_tFBInfo.iFrameFd, FBIOGET_VSCREENINFO, &vinfo))  
{  
    printf("Error: reading variable information.\n");  
    return OPEN_FRAMEBUFFER_FILE; 
}  

printf("%dx%d, %dbpp\n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel );  

m_tFBInfo.xres = vinfo.xres;  
m_tFBInfo.yres = vinfo.yres;  
m_tFBInfo.bits_per_pixel = vinfo.bits_per_pixel;  

screensize =  vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;  
printf("screensize=%d byte\n",screensize);  

m_tFBInfo.tBuf.start = (MAX_S8 *)mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, m_tFBInfo.iFrameFd, 0);  
if (m_tFBInfo.tBuf.start == MAP_FAILED)  
{  
    printf("Error: failed to map framebuffer device to memory.\n");  
    return FRAMEBUFFER_MAP_FAIL;  
}

Hi,

1.Please just share the whole file that can build and share the build command you are using.
2. Please do reply all the questions. What kind of error did you see?