A switch using ioctl is found in the gralloc lib: device/renesas/emev/libgralloc/framebuffer.cpp:
int mapFrameBufferLocked(struct private_module_t* module)
{
...
struct fb_fix_screeninfo finfo;
if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1) {
LOGE("mapFrameBufferLocked - FBIOGET_FSCREENINFO error");
return -errno;
}
/* Switch to the HDMI output mode */
if(finfo.reserved[0] == 1){
LOGI("Calling checkandsetHDMI...");
checkandsetHDMI(fd);
}
...
Then, checkandsetHDMI() sets the output mode to EMXX_FB_OUTPUT_MODE_HDMI_720P.
All depending on the value found in reserved[0], which seems like using the info passed by kernel here:
for (i = 0; i < EMXX_FB_DEVICES; i++) {
printk_info("hdmi_output_setup - dev %d - mode %d", i, event);
struct fb_info *info =
drvdata.info[i];
info->var.reserved[0] = event;
}
but from dmesg I can see that event = 2 (which is EMXX_FB_OUTPUT_MODE_HDMI_720P), while check above is expecting 1 !!!!
I tried fixing framebuffer.cpp, replacing if(finfo.reserved[0] == 1) with if(finfo.reserved[0] != 0), but issue is that rebuilding this lib and pushing it on device
adb push out/target/product/emev/symbols/system/lib/hw/
gralloc.emxx.so system/vendor/lib/hw/
gralloc.emxx.soit crashes on boot (/system/bin/surfaceflinger).
In fact, this code makes the
grallox.emxx.so, which I had it prebuilt too (device/renesas/emev/sgx/um/system/vendor/lib/hw/
gralloc.emxx.so) and I miss the original code of.
So, I have to guess a fix on kernel side, maybe trying to pass 1 into finfo.reserved[0], assuming that's the value being checked in the pre-built lib.
Liu, any suggestion?