diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-07-08 18:16:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-04 04:51:03 -0400 |
commit | 1b4eafabcef5a74ccbc6edd201353cf23046a5a5 (patch) | |
tree | a1281167a344694e95edb7df2b900ed98a65fa2b | |
parent | dabd2582219f0b1b1724a42e7be4045fa3686598 (diff) |
drm/radeon/hdmi: make sure we have an afmt block assigned
commit c2b4cacfe9816c1fe378c785ce8a678cf0635ec6 upstream.
Prevents a segfault if an afmt block is not assigned to the
encoder such as in the LVDS or eDP case.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=66714
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen_hdmi.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_hdmi.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c index b9c6f7675e59..b0d3fb341417 100644 --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c | |||
@@ -177,6 +177,9 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode | |||
177 | uint32_t offset; | 177 | uint32_t offset; |
178 | ssize_t err; | 178 | ssize_t err; |
179 | 179 | ||
180 | if (!dig || !dig->afmt) | ||
181 | return; | ||
182 | |||
180 | /* Silent, r600_hdmi_enable will raise WARN for us */ | 183 | /* Silent, r600_hdmi_enable will raise WARN for us */ |
181 | if (!dig->afmt->enabled) | 184 | if (!dig->afmt->enabled) |
182 | return; | 185 | return; |
@@ -280,6 +283,9 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) | |||
280 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 283 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
281 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | 284 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
282 | 285 | ||
286 | if (!dig || !dig->afmt) | ||
287 | return; | ||
288 | |||
283 | /* Silent, r600_hdmi_enable will raise WARN for us */ | 289 | /* Silent, r600_hdmi_enable will raise WARN for us */ |
284 | if (enable && dig->afmt->enabled) | 290 | if (enable && dig->afmt->enabled) |
285 | return; | 291 | return; |
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index e73b2a73494a..f48240bb8c56 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c | |||
@@ -266,6 +266,9 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod | |||
266 | uint32_t offset; | 266 | uint32_t offset; |
267 | ssize_t err; | 267 | ssize_t err; |
268 | 268 | ||
269 | if (!dig || !dig->afmt) | ||
270 | return; | ||
271 | |||
269 | /* Silent, r600_hdmi_enable will raise WARN for us */ | 272 | /* Silent, r600_hdmi_enable will raise WARN for us */ |
270 | if (!dig->afmt->enabled) | 273 | if (!dig->afmt->enabled) |
271 | return; | 274 | return; |
@@ -448,6 +451,9 @@ void r600_hdmi_enable(struct drm_encoder *encoder, bool enable) | |||
448 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | 451 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
449 | u32 hdmi = HDMI0_ERROR_ACK; | 452 | u32 hdmi = HDMI0_ERROR_ACK; |
450 | 453 | ||
454 | if (!dig || !dig->afmt) | ||
455 | return; | ||
456 | |||
451 | /* Silent, r600_hdmi_enable will raise WARN for us */ | 457 | /* Silent, r600_hdmi_enable will raise WARN for us */ |
452 | if (enable && dig->afmt->enabled) | 458 | if (enable && dig->afmt->enabled) |
453 | return; | 459 | return; |