Get current HDMI mode
This commit is contained in:
parent
1a0a75e8ca
commit
6165db01c8
1 changed files with 21 additions and 9 deletions
|
@ -152,8 +152,19 @@ disp_tv_mode get_suitable_hdmi_mode(int select, disp_tv_mode lastmode)
|
|||
int ret, i, j = -1;
|
||||
disp_tv_mode theMostMode = DISP_TV_MODE_NUM;
|
||||
i = sizeof(g_tv_para) / sizeof(g_tv_para[0]);
|
||||
if(lastmode < DISP_TV_MODE_NUM)
|
||||
{
|
||||
|
||||
if (lastmode == DISP_TV_MODE_NUM) {
|
||||
struct disp_output disp_output;
|
||||
arg[1] = (unsigned long)&disp_output;
|
||||
ret = ioctl(Globctx->DisplayFd, DISP_GET_OUTPUT, arg);
|
||||
ALOGV("get_suitable_hdmi_mode select: %d, type: %d, mode: %d, ret: %d, errno: %d",
|
||||
select, disp_output.type, disp_output.mode, ret, errno);
|
||||
if(ret >= 0 && disp_output.type == DISP_OUTPUT_TYPE_HDMI) {
|
||||
lastmode = (disp_tv_mode)disp_output.mode;
|
||||
}
|
||||
}
|
||||
|
||||
if(lastmode < DISP_TV_MODE_NUM) {
|
||||
arg[1] = DISP_OUTPUT_TYPE_HDMI;
|
||||
arg[2] = lastmode;
|
||||
ret = ioctl(Globctx->DisplayFd, DISP_DEVICE_SWITCH, arg);
|
||||
|
@ -162,6 +173,7 @@ disp_tv_mode get_suitable_hdmi_mode(int select, disp_tv_mode lastmode)
|
|||
return lastmode;
|
||||
}
|
||||
}
|
||||
|
||||
while(i > 0)
|
||||
{
|
||||
i--;
|
||||
|
|
Loading…
Reference in a new issue