@@ -7456,12 +7456,12 @@ static enum dc_status dm_validate_stream_and_context(struct dc *dc,
7456
7456
}
7457
7457
7458
7458
struct dc_stream_state *
7459
- create_validate_stream_for_sink (struct amdgpu_dm_connector * aconnector ,
7459
+ create_validate_stream_for_sink (struct drm_connector * connector ,
7460
7460
const struct drm_display_mode * drm_mode ,
7461
7461
const struct dm_connector_state * dm_state ,
7462
7462
const struct dc_stream_state * old_stream )
7463
7463
{
7464
- struct drm_connector * connector = & aconnector -> base ;
7464
+ struct amdgpu_dm_connector * aconnector = NULL ;
7465
7465
struct amdgpu_device * adev = drm_to_adev (connector -> dev );
7466
7466
struct dc_stream_state * stream ;
7467
7467
const struct drm_connector_state * drm_state = dm_state ? & dm_state -> base : NULL ;
@@ -7472,8 +7472,12 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,
7472
7472
if (!dm_state )
7473
7473
return NULL ;
7474
7474
7475
- if (aconnector -> dc_link -> connector_signal == SIGNAL_TYPE_HDMI_TYPE_A ||
7476
- aconnector -> dc_link -> dpcd_caps .dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER )
7475
+ if (connector -> connector_type != DRM_MODE_CONNECTOR_WRITEBACK )
7476
+ aconnector = to_amdgpu_dm_connector (connector );
7477
+
7478
+ if (aconnector &&
7479
+ (aconnector -> dc_link -> connector_signal == SIGNAL_TYPE_HDMI_TYPE_A ||
7480
+ aconnector -> dc_link -> dpcd_caps .dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER ))
7477
7481
bpc_limit = 8 ;
7478
7482
7479
7483
do {
@@ -7485,10 +7489,11 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,
7485
7489
break ;
7486
7490
}
7487
7491
7488
- if (aconnector -> base .connector_type == DRM_MODE_CONNECTOR_WRITEBACK )
7492
+ dc_result = dc_validate_stream (adev -> dm .dc , stream );
7493
+
7494
+ if (!aconnector ) /* writeback connector */
7489
7495
return stream ;
7490
7496
7491
- dc_result = dc_validate_stream (adev -> dm .dc , stream );
7492
7497
if (dc_result == DC_OK && stream -> signal == SIGNAL_TYPE_DISPLAY_PORT_MST )
7493
7498
dc_result = dm_dp_mst_is_port_support_mode (aconnector , stream );
7494
7499
@@ -7518,7 +7523,7 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,
7518
7523
__func__ , __LINE__ );
7519
7524
7520
7525
aconnector -> force_yuv420_output = true;
7521
- stream = create_validate_stream_for_sink (aconnector , drm_mode ,
7526
+ stream = create_validate_stream_for_sink (connector , drm_mode ,
7522
7527
dm_state , old_stream );
7523
7528
aconnector -> force_yuv420_output = false;
7524
7529
}
@@ -7533,6 +7538,9 @@ enum drm_mode_status amdgpu_dm_connector_mode_valid(struct drm_connector *connec
7533
7538
struct dc_sink * dc_sink ;
7534
7539
/* TODO: Unhardcode stream count */
7535
7540
struct dc_stream_state * stream ;
7541
+ /* we always have an amdgpu_dm_connector here since we got
7542
+ * here via the amdgpu_dm_connector_helper_funcs
7543
+ */
7536
7544
struct amdgpu_dm_connector * aconnector = to_amdgpu_dm_connector (connector );
7537
7545
7538
7546
if ((mode -> flags & DRM_MODE_FLAG_INTERLACE ) ||
@@ -7557,7 +7565,7 @@ enum drm_mode_status amdgpu_dm_connector_mode_valid(struct drm_connector *connec
7557
7565
7558
7566
drm_mode_set_crtcinfo (mode , 0 );
7559
7567
7560
- stream = create_validate_stream_for_sink (aconnector , mode ,
7568
+ stream = create_validate_stream_for_sink (connector , mode ,
7561
7569
to_dm_connector_state (connector -> state ),
7562
7570
NULL );
7563
7571
if (stream ) {
@@ -10608,7 +10616,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
10608
10616
if (!drm_atomic_crtc_needs_modeset (new_crtc_state ))
10609
10617
goto skip_modeset ;
10610
10618
10611
- new_stream = create_validate_stream_for_sink (aconnector ,
10619
+ new_stream = create_validate_stream_for_sink (connector ,
10612
10620
& new_crtc_state -> mode ,
10613
10621
dm_new_conn_state ,
10614
10622
dm_old_crtc_state -> stream );
0 commit comments