Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'drm-fixes-4.16' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

A few more fixes for 4.16. Mostly for displays:
- A fix for DP handling on radeon
- Fix banding on eDP panels
- Fix HBR audio
- Fix for disabling VGA mode on Raven that leads to a corrupt or
blank display on some platforms

* 'drm-fixes-4.16' of git://people.freedesktop.org/~agd5f/linux:
drm/amd/display: Add one to EDID's audio channel count when passing to DC
drm/amd/display: We shouldn't set format_default on plane as atomic driver
drm/amd/display: Fix FMT truncation programming
drm/amd/display: Allow truncation to 10 bits
drm/amd/display: fix dereferencing possible ERR_PTR()
drm/amd/display: Refine disable VGA
drm/amdgpu: Use atomic function to disable crtcs with dc enabled
drm/radeon: Don't turn off DP sink when disconnected

+45 -33
+6 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 2063 2063 2064 2064 DRM_INFO("amdgpu: finishing device.\n"); 2065 2065 adev->shutdown = true; 2066 - if (adev->mode_info.mode_config_initialized) 2067 - drm_crtc_force_disable_all(adev->ddev); 2068 - 2066 + if (adev->mode_info.mode_config_initialized){ 2067 + if (!amdgpu_device_has_dc_support(adev)) 2068 + drm_crtc_force_disable_all(adev->ddev); 2069 + else 2070 + drm_atomic_helper_shutdown(adev->ddev); 2071 + } 2069 2072 amdgpu_ib_pool_fini(adev); 2070 2073 amdgpu_fence_driver_fini(adev); 2071 2074 amdgpu_fbdev_fini(adev);
+3 -2
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 3134 3134 3135 3135 switch (aplane->base.type) { 3136 3136 case DRM_PLANE_TYPE_PRIMARY: 3137 - aplane->base.format_default = true; 3138 - 3139 3137 res = drm_universal_plane_init( 3140 3138 dm->adev->ddev, 3141 3139 &aplane->base, ··· 4792 4794 return -EDEADLK; 4793 4795 4794 4796 crtc_state = drm_atomic_get_crtc_state(plane_state->state, crtc); 4797 + if (IS_ERR(crtc_state)) 4798 + return PTR_ERR(crtc_state); 4799 + 4795 4800 if (crtc->primary == plane && crtc_state->active) { 4796 4801 if (!plane_state->fb) 4797 4802 return -EINVAL;
+1 -1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
··· 109 109 struct cea_sad *sad = &sads[i]; 110 110 111 111 edid_caps->audio_modes[i].format_code = sad->format; 112 - edid_caps->audio_modes[i].channel_count = sad->channels; 112 + edid_caps->audio_modes[i].channel_count = sad->channels + 1; 113 113 edid_caps->audio_modes[i].sample_rate = sad->freq; 114 114 edid_caps->audio_modes[i].sample_size = sad->byte2; 115 115 }
+7 -1
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.h
··· 496 496 HWS_SF(, DOMAIN7_PG_STATUS, DOMAIN7_PGFSM_PWR_STATUS, mask_sh), \ 497 497 HWS_SF(, DC_IP_REQUEST_CNTL, IP_REQUEST_EN, mask_sh), \ 498 498 HWS_SF(, D1VGA_CONTROL, D1VGA_MODE_ENABLE, mask_sh),\ 499 + HWS_SF(, D2VGA_CONTROL, D2VGA_MODE_ENABLE, mask_sh),\ 500 + HWS_SF(, D3VGA_CONTROL, D3VGA_MODE_ENABLE, mask_sh),\ 501 + HWS_SF(, D4VGA_CONTROL, D4VGA_MODE_ENABLE, mask_sh),\ 499 502 HWS_SF(, VGA_TEST_CONTROL, VGA_TEST_ENABLE, mask_sh),\ 500 503 HWS_SF(, VGA_TEST_CONTROL, VGA_TEST_RENDER_START, mask_sh),\ 501 504 HWS_SF(, LVTMA_PWRSEQ_CNTL, LVTMA_BLON, mask_sh), \ ··· 594 591 type DENTIST_DISPCLK_WDIVIDER; \ 595 592 type VGA_TEST_ENABLE; \ 596 593 type VGA_TEST_RENDER_START; \ 597 - type D1VGA_MODE_ENABLE; 594 + type D1VGA_MODE_ENABLE; \ 595 + type D2VGA_MODE_ENABLE; \ 596 + type D3VGA_MODE_ENABLE; \ 597 + type D4VGA_MODE_ENABLE; 598 598 599 599 struct dce_hwseq_shift { 600 600 HWSEQ_REG_FIELD_LIST(uint8_t)
+4 -5
drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
··· 128 128 return; 129 129 } 130 130 /* on other format-to do */ 131 - if (params->flags.TRUNCATE_ENABLED == 0 || 132 - params->flags.TRUNCATE_DEPTH == 2) 131 + if (params->flags.TRUNCATE_ENABLED == 0) 133 132 return; 134 133 /*Set truncation depth and Enable truncation*/ 135 134 REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL, 136 135 FMT_TRUNCATE_EN, 1, 137 136 FMT_TRUNCATE_DEPTH, 138 - params->flags.TRUNCATE_MODE, 137 + params->flags.TRUNCATE_DEPTH, 139 138 FMT_TRUNCATE_MODE, 140 - params->flags.TRUNCATE_DEPTH); 139 + params->flags.TRUNCATE_MODE); 141 140 } 142 141 143 142 144 143 /** 145 144 * set_spatial_dither 146 145 * 1) set spatial dithering mode: pattern of seed 147 - * 2) set spatical dithering depth: 0 for 18bpp or 1 for 24bpp 146 + * 2) set spatial dithering depth: 0 for 18bpp or 1 for 24bpp 148 147 * 3) set random seed 149 148 * 4) set random mode 150 149 * lfsr is reset every frame or not reset
+13 -3
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
··· 238 238 static void disable_vga( 239 239 struct dce_hwseq *hws) 240 240 { 241 - unsigned int in_vga_mode = 0; 241 + unsigned int in_vga1_mode = 0; 242 + unsigned int in_vga2_mode = 0; 243 + unsigned int in_vga3_mode = 0; 244 + unsigned int in_vga4_mode = 0; 242 245 243 - REG_GET(D1VGA_CONTROL, D1VGA_MODE_ENABLE, &in_vga_mode); 246 + REG_GET(D1VGA_CONTROL, D1VGA_MODE_ENABLE, &in_vga1_mode); 247 + REG_GET(D2VGA_CONTROL, D2VGA_MODE_ENABLE, &in_vga2_mode); 248 + REG_GET(D3VGA_CONTROL, D3VGA_MODE_ENABLE, &in_vga3_mode); 249 + REG_GET(D4VGA_CONTROL, D4VGA_MODE_ENABLE, &in_vga4_mode); 244 250 245 - if (in_vga_mode == 0) 251 + if (in_vga1_mode == 0 && in_vga2_mode == 0 && 252 + in_vga3_mode == 0 && in_vga4_mode == 0) 246 253 return; 247 254 248 255 REG_WRITE(D1VGA_CONTROL, 0); 256 + REG_WRITE(D2VGA_CONTROL, 0); 257 + REG_WRITE(D3VGA_CONTROL, 0); 258 + REG_WRITE(D4VGA_CONTROL, 0); 249 259 250 260 /* HW Engineer's Notes: 251 261 * During switch from vga->extended, if we set the VGA_TEST_ENABLE and
+11 -18
drivers/gpu/drm/radeon/radeon_connectors.c
··· 90 90 /* don't do anything if sink is not display port, i.e., 91 91 * passive dp->(dvi|hdmi) adaptor 92 92 */ 93 - if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) { 94 - int saved_dpms = connector->dpms; 95 - /* Only turn off the display if it's physically disconnected */ 96 - if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { 97 - drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); 98 - } else if (radeon_dp_needs_link_train(radeon_connector)) { 99 - /* Don't try to start link training before we 100 - * have the dpcd */ 101 - if (!radeon_dp_getdpcd(radeon_connector)) 102 - return; 93 + if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT && 94 + radeon_hpd_sense(rdev, radeon_connector->hpd.hpd) && 95 + radeon_dp_needs_link_train(radeon_connector)) { 96 + /* Don't start link training before we have the DPCD */ 97 + if (!radeon_dp_getdpcd(radeon_connector)) 98 + return; 103 99 104 - /* set it to OFF so that drm_helper_connector_dpms() 105 - * won't return immediately since the current state 106 - * is ON at this point. 107 - */ 108 - connector->dpms = DRM_MODE_DPMS_OFF; 109 - drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); 110 - } 111 - connector->dpms = saved_dpms; 100 + /* Turn the connector off and back on immediately, which 101 + * will trigger link training 102 + */ 103 + drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); 104 + drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); 112 105 } 113 106 } 114 107 }