diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-07-09 02:16:56 +0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-07-14 18:10:53 +0400 |
commit | c2b4cacfe9816c1fe378c785ce8a678cf0635ec6 (patch) | |
tree | 5231af1e1499a7b201b6a0526ffc1893edf01609 /drivers/gpu/drm/radeon/evergreen_hdmi.c | |
parent | 774d8e34e46506222bb5e2888e3ef42b2775715f (diff) | |
download | linux-c2b4cacfe9816c1fe378c785ce8a678cf0635ec6.tar.xz |
drm/radeon/hdmi: make sure we have an afmt block assigned
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>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/radeon/evergreen_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen_hdmi.c | 6 |
1 files changed, 6 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 uint32_t offset; ssize_t err; + if (!dig || !dig->afmt) + return; + /* Silent, r600_hdmi_enable will raise WARN for us */ if (!dig->afmt->enabled) return; @@ -280,6 +283,9 @@ void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable) struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; + if (!dig || !dig->afmt) + return; + /* Silent, r600_hdmi_enable will raise WARN for us */ if (enable && dig->afmt->enabled) return; |