hal: Changes Relating to DisplayPort Audio

- Update the way we scan for HDMI fb nodes. We
  currently scan nodes 0, 1 & 2 which is not
  sufficient when fb3 is present. We will now open
  fbx until we get an error to ensure we will not
  miss any nodes if new ones are added.

- Fix return value of read_hdmi_sink_caps(), we are
  currently returning the displaytype. The caller
  of the function is interpreting it as an error.

Change-Id: I4a81e93d246d234b86a81eb6597cf641e1ea1991
CRs-Fixed: 1075152
This commit is contained in:
Garmond Leung 2016-10-06 11:42:18 -07:00 committed by Gerrit - the friendly Code Review server
parent 6a83666d71
commit 37850abb13
2 changed files with 6 additions and 5 deletions

View File

@ -129,7 +129,7 @@ static int get_ext_disp_sysfs_node_index(int ext_disp_type)
int i = 0;
FILE *ext_disp_fd = NULL;
for(i = 0; i < 3; i++) {
while (1) {
snprintf(fbpath, sizeof(fbpath),
"/sys/class/graphics/fb%d/msm_fb_type", i);
ext_disp_fd = fopen(fbpath, "r");
@ -146,8 +146,10 @@ static int get_ext_disp_sysfs_node_index(int ext_disp_type)
}
}
fclose(ext_disp_fd);
i++;
} else {
ALOGE("%s: Failed to open fb node %d", __func__, i);
ALOGE("%s: Scanned till end of fbs or Failed to open fb node %d", __func__, i);
break;
}
}

View File

@ -1131,10 +1131,9 @@ static int read_hdmi_sink_caps(struct stream_out *out)
reset_hdmi_sink_caps(out);
/* Cache ext disp type */
ret = platform_get_ext_disp_type(adev->platform);
if (ret < 0) {
if (platform_get_ext_disp_type(adev->platform) <= 0) {
ALOGE("%s: Failed to query disp type, ret:%d", __func__, ret);
return ret;
return -EINVAL;
}
switch (channels) {