Commit 8efe82ca authored by Alex Deucher's avatar Alex Deucher

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=85771Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent dc4edad6
...@@ -9447,6 +9447,9 @@ void dce8_bandwidth_update(struct radeon_device *rdev) ...@@ -9447,6 +9447,9 @@ void dce8_bandwidth_update(struct radeon_device *rdev)
u32 num_heads = 0, lb_size; u32 num_heads = 0, lb_size;
int i; int i;
if (!rdev->mode_info.mode_config_initialized)
return;
radeon_update_display_priority(rdev); radeon_update_display_priority(rdev);
for (i = 0; i < rdev->num_crtc; i++) { for (i = 0; i < rdev->num_crtc; i++) {
......
...@@ -2345,6 +2345,9 @@ void evergreen_bandwidth_update(struct radeon_device *rdev) ...@@ -2345,6 +2345,9 @@ void evergreen_bandwidth_update(struct radeon_device *rdev)
u32 num_heads = 0, lb_size; u32 num_heads = 0, lb_size;
int i; int i;
if (!rdev->mode_info.mode_config_initialized)
return;
radeon_update_display_priority(rdev); radeon_update_display_priority(rdev);
for (i = 0; i < rdev->num_crtc; i++) { for (i = 0; i < rdev->num_crtc; i++) {
......
...@@ -3207,6 +3207,9 @@ void r100_bandwidth_update(struct radeon_device *rdev) ...@@ -3207,6 +3207,9 @@ void r100_bandwidth_update(struct radeon_device *rdev)
uint32_t pixel_bytes1 = 0; uint32_t pixel_bytes1 = 0;
uint32_t pixel_bytes2 = 0; uint32_t pixel_bytes2 = 0;
if (!rdev->mode_info.mode_config_initialized)
return;
radeon_update_display_priority(rdev); radeon_update_display_priority(rdev);
if (rdev->mode_info.crtcs[0]->base.enabled) { if (rdev->mode_info.crtcs[0]->base.enabled) {
......
...@@ -879,6 +879,9 @@ void rs600_bandwidth_update(struct radeon_device *rdev) ...@@ -879,6 +879,9 @@ void rs600_bandwidth_update(struct radeon_device *rdev)
u32 d1mode_priority_a_cnt, d2mode_priority_a_cnt; u32 d1mode_priority_a_cnt, d2mode_priority_a_cnt;
/* FIXME: implement full support */ /* FIXME: implement full support */
if (!rdev->mode_info.mode_config_initialized)
return;
radeon_update_display_priority(rdev); radeon_update_display_priority(rdev);
if (rdev->mode_info.crtcs[0]->base.enabled) if (rdev->mode_info.crtcs[0]->base.enabled)
......
...@@ -579,6 +579,9 @@ void rs690_bandwidth_update(struct radeon_device *rdev) ...@@ -579,6 +579,9 @@ void rs690_bandwidth_update(struct radeon_device *rdev)
u32 d1mode_priority_a_cnt, d1mode_priority_b_cnt; u32 d1mode_priority_a_cnt, d1mode_priority_b_cnt;
u32 d2mode_priority_a_cnt, d2mode_priority_b_cnt; u32 d2mode_priority_a_cnt, d2mode_priority_b_cnt;
if (!rdev->mode_info.mode_config_initialized)
return;
radeon_update_display_priority(rdev); radeon_update_display_priority(rdev);
if (rdev->mode_info.crtcs[0]->base.enabled) if (rdev->mode_info.crtcs[0]->base.enabled)
......
...@@ -1277,6 +1277,9 @@ void rv515_bandwidth_update(struct radeon_device *rdev) ...@@ -1277,6 +1277,9 @@ void rv515_bandwidth_update(struct radeon_device *rdev)
struct drm_display_mode *mode0 = NULL; struct drm_display_mode *mode0 = NULL;
struct drm_display_mode *mode1 = NULL; struct drm_display_mode *mode1 = NULL;
if (!rdev->mode_info.mode_config_initialized)
return;
radeon_update_display_priority(rdev); radeon_update_display_priority(rdev);
if (rdev->mode_info.crtcs[0]->base.enabled) if (rdev->mode_info.crtcs[0]->base.enabled)
......
...@@ -2384,6 +2384,9 @@ void dce6_bandwidth_update(struct radeon_device *rdev) ...@@ -2384,6 +2384,9 @@ void dce6_bandwidth_update(struct radeon_device *rdev)
u32 num_heads = 0, lb_size; u32 num_heads = 0, lb_size;
int i; int i;
if (!rdev->mode_info.mode_config_initialized)
return;
radeon_update_display_priority(rdev); radeon_update_display_priority(rdev);
for (i = 0; i < rdev->num_crtc; i++) { for (i = 0; i < rdev->num_crtc; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment