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

Commit f4791779 authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher
Browse files

drm/amd/display: Make create_stream_for_sink more consistent



We've got a helper function to call dc_create_stream_for_sink and one
other place that calls it directly. Make sure we call the helper
functions always since we need to update a bunch of things in stream and
don't want to miss that.

Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c7e74f49
Loading
Loading
Loading
Loading
+25 −28
Original line number Diff line number Diff line
@@ -2036,6 +2036,7 @@ static void update_stream_scaling_settings(const struct drm_display_mode *mode,
	dst.width = stream->timing.h_addressable;
	dst.height = stream->timing.v_addressable;

	if (dm_state) {
		rmx_type = dm_state->scaling;
		if (rmx_type == RMX_ASPECT || rmx_type == RMX_OFF) {
			if (src.width * dst.height <
@@ -2061,6 +2062,7 @@ static void update_stream_scaling_settings(const struct drm_display_mode *mode,
			dst.width -= dm_state->underscan_hborder;
			dst.height -= dm_state->underscan_vborder;
		}
	}

	stream->src = src;
	stream->dst = dst;
@@ -2387,11 +2389,6 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
		return stream;
	}

	if (dm_state == NULL) {
		DRM_ERROR("dm_state is NULL!\n");
		return stream;
	}

	drm_connector = &aconnector->base;

	if (!aconnector->dc_sink) {
@@ -2438,7 +2435,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
	} else {
		decide_crtc_timing_for_drm_display_mode(
				&mode, preferred_mode,
				dm_state->scaling != RMX_OFF);
				dm_state ? (dm_state->scaling != RMX_OFF) : false);
	}

	fill_stream_properties_from_drm_display_mode(stream,
@@ -2821,7 +2818,7 @@ int amdgpu_dm_connector_mode_valid(struct drm_connector *connector,
		goto fail;
	}

	stream = dc_create_stream_for_sink(dc_sink);
	stream = create_stream_for_sink(aconnector, mode, NULL);
	if (stream == NULL) {
		DRM_ERROR("Failed to create stream for sink!\n");
		goto fail;