完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
一、测试发现在philips显示器休眠的情况下,rk3288 开机后hmdi无法唤醒显示器。
cat /d/dw-hdmi/status PHY: disabled 分析后发现是无法打开kerneldriversgpudrmbridgesynopsysdw-hdmi.c dw_hdmi_bridge_enable 二、解决方案,检测到无法显示就: echo off >/sys/devices/platform/display-subsystem/drm/card0/card0-HDMI-A-1/status 关闭 然后 echo detect >/sys/devices/platform/display-subsystem/drm/card0/card0-HDMI-A-1/status 打开 三、具体代码。 diff --git a/device/rockchip/rk3288/init.rk3288.rc b/device/rockchip/rk3288/init.rk3288.rc index c624b15..a4ba933 100755 --- a/device/rockchip/rk3288/init.rk3288.rc +++ b/device/rockchip/rk3288/init.rk3288.rc @@ -47,6 +47,7 @@ on init chown root system /dev/cec0 chmod 0664 /dev/cec0 + chmod 0664 /d/dw-hdmi/status on verity-logging exec u:r:slideshow:s0 -- /***in/slideshow warning/verity_red_1 warning/verity_red_2 diff --git a/hardware/rockchip/hwcomposer/hwcomposer.cpp b/hardware/rockchip/hwcomposer/hwcomposer.cpp index 5dc0ea2..5d0402a 100755 --- a/hardware/rockchip/hwcomposer/hwcomposer.cpp +++ b/hardware/rockchip/hwcomposer/hwcomposer.cpp @@ -4258,6 +4258,97 @@ void *invalidate_refresh(void *arg) } #endif +#define DW_HDMI_STATUS_PATH "/d/dw-hdmi/status" + +static bool read_hdmi_status_from_node(const char *path, char *read_buf,unsigned char length) +{ + int ret, fd; + char statebuf[200]; + //ALOGI("%s", __FUNCTION__); + memset(statebuf, 0, sizeof(statebuf)); + fd = open(path, O_RDONLY); + if (fd < 0) + return -ENOENT; + ret = read(fd, statebuf, length); + close(fd); + if (ret < 0) { + ALOGE("read hdmi state errn"); + return -EINVAL; + } + memcpy(read_buf,statebuf,length); + return 0; +} + +static bool set_hdmi_status(bool hdmi_enable) +{ + char acStatus[10]; + int fd,ret = 0; + + if(hdmi_enable == true) + strcpy(acStatus,"detect"); + else + strcpy(acStatus,"off"); + + fd = open(HDMI_STATUS_PATH, O_RDWR, 0); + if(fd < 0) + { + ALOGE("Open hdmi_status_fd fail in %s",__FUNCTION__); + return 1; + } + ret = write(fd,acStatus,strlen(acStatus)+1); + if(ret < 0) + { + ALOGE("set hdmi status to %s falied, ret = %d", acStatus, ret); + } + close(fd); + return 0; +} + +void *giada_fix_rk3288_hdmi_display(void *arg) +{ + int ret,boot_completed_number=0; + char hdmi_status[20],dw_hdmi_status[200]; + char boot_completed_value[PROPERTY_VALUE_MAX]; + + while(true) + { + property_get( "sys.boot_completed", boot_completed_value, "0"); + if (!strcmp(boot_completed_value, "1")) + { + ++boot_completed_number; + memset(hdmi_status,0,sizeof(hdmi_status)); + ret=read_hdmi_status_from_node(HDMI_STATUS_PATH,hdmi_status,sizeof(hdmi_status)); + if (ret < 0) { + ALOGE("read hdmi statusn"); + } + memset(dw_hdmi_status,0,sizeof(dw_hdmi_status)); + ret=read_hdmi_status_from_node(DW_HDMI_STATUS_PATH,dw_hdmi_status,sizeof(dw_hdmi_status)); + if (ret < 0) { + ALOGE("read dw_hdmi statusn"); + } + ALOGI("**********[%s]**********boot_completed_number=%d boot_completed_value=%s rnhdmi statusrn%srndw_hdmi_statusrn%s",__FUNCTION__,boot_completed_number,boot_completed_value,hdmi_status,dw_hdmi_status); + if ((!strcmp(hdmi_status, "connectedn"))&&(!strcmp(dw_hdmi_status, "PHY: disabledn"))&&(boot_completed_number>=10)) + { + system("echo HDMIDISPALYERROR >>/data/hdmi_information_error.txt"); + ALOGE("########### ERROR:RK3288 HDMI DISPALY IS NOT NORMAL,TRY TO REOPEN IT!###########"); + set_hdmi_status(false); + usleep(1000000); + set_hdmi_status(true); + }else if ((!strcmp(hdmi_status, "connectedn"))&&(strcmp(dw_hdmi_status, "PHY: disabledn"))) + { + break; + } + + } else + ALOGE("********Android System Booting...........!********"); + + usleep(1000000); + } + ALOGI("RK3288 HDMI DISPLAY IS OK NOW!"); + pthread_exit(NULL); + return NULL; +} + #if 0 void* hwc_control_3dmode_thread(void *arg) { @@ -4401,6 +4492,13 @@ static int hwc_device_open(const struct hw_module_t *module, const char *name, signal(SIGALRM, hwc_static_screen_opt_handler); #endif + pthread_t detect_rk3288_dispaly; + if (pthread_create(&detect_rk3288_dispaly, NULL, giada_fix_rk3288_hdmi_display, ctx.get())) + { + ALOGE("Create detect_rk3288_dispaly thread error ."); + } + else + ALOGI("Created detect_rk3288_dispaly pthread "); #if 0 init_thread_pamaters(&ctx->mControlStereo); ctx->fd_3d = open("/sys/class/display/HDMI/3dmode", O_RDWR, 0); |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
678 浏览 0 评论
920 浏览 1 评论
814 浏览 1 评论
2030 浏览 1 评论
3275 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 23:36 , Processed in 0.519366 second(s), Total 73, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号