Commit 6027cbee authored by Wentao Liang's avatar Wentao Liang Committed by Alex Deucher
Browse files

drm/amd/display: Add error check for avi and vendor infoframe setup function



The function fill_stream_properties_from_drm_display_mode() calls the
function drm_hdmi_avi_infoframe_from_display_mode() and the
function drm_hdmi_vendor_infoframe_from_display_mode(), but does
not check its return value. Log the error messages to prevent silent
failure if either function fails.

Signed-off-by: default avatarWentao Liang <vulab@iscas.ac.cn>
Reviewed-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8f23a979
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -6437,6 +6437,7 @@ static void fill_stream_properties_from_drm_display_mode(
	struct amdgpu_dm_connector *aconnector = NULL;
	struct hdmi_vendor_infoframe hv_frame;
	struct hdmi_avi_infoframe avi_frame;
	ssize_t err;

	if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK)
		aconnector = to_amdgpu_dm_connector(connector);
@@ -6483,9 +6484,17 @@ static void fill_stream_properties_from_drm_display_mode(
	}

	if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {
		drm_hdmi_avi_infoframe_from_display_mode(&avi_frame, (struct drm_connector *)connector, mode_in);
		err = drm_hdmi_avi_infoframe_from_display_mode(&avi_frame,
							       (struct drm_connector *)connector,
							       mode_in);
		if (err < 0)
			drm_err(connector->dev, "Failed to setup avi infoframe: %zd\n", err);
		timing_out->vic = avi_frame.video_code;
		drm_hdmi_vendor_infoframe_from_display_mode(&hv_frame, (struct drm_connector *)connector, mode_in);
		err = drm_hdmi_vendor_infoframe_from_display_mode(&hv_frame,
								  (struct drm_connector *)connector,
								  mode_in);
		if (err < 0)
			drm_err(connector->dev, "Failed to setup vendor infoframe: %zd\n", err);
		timing_out->hdmi_vic = hv_frame.vic;
	}