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

drm/radeon: make sure mode init is complete in bandwidth_update

The power management code calls into the display code for
certain things. If certain power management sysfs attributes
are called before the driver has finished initializing all of
the hardware we can run into problems with uninitialized
modesetting state. Add a check to make sure modesetting
init has completed to the bandwidth update callbacks to
fix this. Can be triggered by the tlp and laptop start
up scripts depending on the timing.

bugs:
https://bugzilla.kernel.org/show_bug.cgi?id=83611
https://bugs.freedesktop.org/show_bug.cgi?id=85771

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org

+21
+3
drivers/gpu/drm/radeon/cik.c
··· 9447 9447 u32 num_heads = 0, lb_size; 9448 9448 int i; 9449 9449 9450 + if (!rdev->mode_info.mode_config_initialized) 9451 + return; 9452 + 9450 9453 radeon_update_display_priority(rdev); 9451 9454 9452 9455 for (i = 0; i < rdev->num_crtc; i++) {
+3
drivers/gpu/drm/radeon/evergreen.c
··· 2345 2345 u32 num_heads = 0, lb_size; 2346 2346 int i; 2347 2347 2348 + if (!rdev->mode_info.mode_config_initialized) 2349 + return; 2350 + 2348 2351 radeon_update_display_priority(rdev); 2349 2352 2350 2353 for (i = 0; i < rdev->num_crtc; i++) {
+3
drivers/gpu/drm/radeon/r100.c
··· 3207 3207 uint32_t pixel_bytes1 = 0; 3208 3208 uint32_t pixel_bytes2 = 0; 3209 3209 3210 + if (!rdev->mode_info.mode_config_initialized) 3211 + return; 3212 + 3210 3213 radeon_update_display_priority(rdev); 3211 3214 3212 3215 if (rdev->mode_info.crtcs[0]->base.enabled) {
+3
drivers/gpu/drm/radeon/rs600.c
··· 879 879 u32 d1mode_priority_a_cnt, d2mode_priority_a_cnt; 880 880 /* FIXME: implement full support */ 881 881 882 + if (!rdev->mode_info.mode_config_initialized) 883 + return; 884 + 882 885 radeon_update_display_priority(rdev); 883 886 884 887 if (rdev->mode_info.crtcs[0]->base.enabled)
+3
drivers/gpu/drm/radeon/rs690.c
··· 579 579 u32 d1mode_priority_a_cnt, d1mode_priority_b_cnt; 580 580 u32 d2mode_priority_a_cnt, d2mode_priority_b_cnt; 581 581 582 + if (!rdev->mode_info.mode_config_initialized) 583 + return; 584 + 582 585 radeon_update_display_priority(rdev); 583 586 584 587 if (rdev->mode_info.crtcs[0]->base.enabled)
+3
drivers/gpu/drm/radeon/rv515.c
··· 1277 1277 struct drm_display_mode *mode0 = NULL; 1278 1278 struct drm_display_mode *mode1 = NULL; 1279 1279 1280 + if (!rdev->mode_info.mode_config_initialized) 1281 + return; 1282 + 1280 1283 radeon_update_display_priority(rdev); 1281 1284 1282 1285 if (rdev->mode_info.crtcs[0]->base.enabled)
+3
drivers/gpu/drm/radeon/si.c
··· 2384 2384 u32 num_heads = 0, lb_size; 2385 2385 int i; 2386 2386 2387 + if (!rdev->mode_info.mode_config_initialized) 2388 + return; 2389 + 2387 2390 radeon_update_display_priority(rdev); 2388 2391 2389 2392 for (i = 0; i < rdev->num_crtc; i++) {