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
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c
index 65f516c..083b925 100644
--- a/hal/audio_extn/audio_extn.c
+++ b/hal/audio_extn/audio_extn.c
@@ -129,7 +129,7 @@
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 @@
}
}
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;
}
}
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index b86040c..09a5734 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1131,10 +1131,9 @@
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) {