Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7098e119 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: check existence of ext disp device before routing"

parents e5860e66 80c8f9a1
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -4725,6 +4725,18 @@ int route_output_stream(struct stream_out *out,
        str_parms_destroy(parms);
    }

    // Workaround: If routing to an non existing hdmi device, fail gracefully
    if (compare_device_type(&new_devices, AUDIO_DEVICE_OUT_AUX_DIGITAL) &&
        (platform_get_edid_info_v2(adev->platform,
                                   out->extconn.cs.controller,
                                   out->extconn.cs.stream) != 0)) {
        ALOGW("out_set_parameters() ignoring rerouting to non existing HDMI/DP");
        pthread_mutex_unlock(&adev->lock);
        pthread_mutex_unlock(&out->lock);
        ret = -ENOSYS;
        goto error;
    }

    /*
     * select_devices() call below switches all the usecases on the same
     * backend to the new device. Refer to check_usecases_codec_backend() in
+4 −4
Original line number Diff line number Diff line
@@ -4167,7 +4167,7 @@ int platform_get_ext_disp_type(void *platform)
    int disp_type;
    struct platform_data *my_data = (struct platform_data *)platform;

    if (my_data->ext_disp_type != EXT_DISPLAY_TYPE_NONE) {
    if (my_data->ext_disp_type > EXT_DISPLAY_TYPE_NONE) {
         ALOGD("%s: Returning cached ext disp type:%s",
               __func__, (my_data->ext_disp_type == EXT_DISPLAY_TYPE_DP) ? "DisplayPort" : "HDMI");
         return my_data->ext_disp_type;
@@ -4186,7 +4186,7 @@ int platform_get_ext_disp_type(void *platform)
        }

        disp_type = mixer_ctl_get_value(ctl, 0);
        if (disp_type == EXT_DISPLAY_TYPE_NONE) {
        if (disp_type <= EXT_DISPLAY_TYPE_NONE) {
             ALOGE("%s: Invalid external display type: %d", __func__, disp_type);
             return -EINVAL;
        }
+1 −1
Original line number Diff line number Diff line
@@ -5905,7 +5905,7 @@ int platform_get_ext_disp_type_v2(void *platform, int controller, int stream)
    }

    disp = &my_data->ext_disp[controller][stream];
    if (disp->type != EXT_DISPLAY_TYPE_NONE) {
    if (disp->type > EXT_DISPLAY_TYPE_NONE) {
         ALOGD("%s: Returning cached ext disp type:%s",
               __func__, (disp->type == EXT_DISPLAY_TYPE_DP) ? "DisplayPort" : "HDMI");
         return disp->type;