From 07128dc5ae0bd5c9037b1b2b021fbd32c87f790a Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 9 Feb 2014 13:43:03 +0000 Subject: drm/radeon/hdmi: make sure we have an afmt block assigned From Alex Deucher 4d178917546b339a5486645f40f32c9cbd1240f1 in ubuntu 3.8 c2b4cacfe9816c1fe378c785ce8a678cf0635ec6 in mainline linux --- sys/dev/pci/drm/radeon/evergreen_hdmi.c | 5 ++++- sys/dev/pci/drm/radeon/r600_hdmi.c | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/dev/pci/drm/radeon/evergreen_hdmi.c b/sys/dev/pci/drm/radeon/evergreen_hdmi.c index 0cd87c2e3f1..127f6faf8c2 100644 --- a/sys/dev/pci/drm/radeon/evergreen_hdmi.c +++ b/sys/dev/pci/drm/radeon/evergreen_hdmi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evergreen_hdmi.c,v 1.1 2013/08/12 04:11:53 jsg Exp $ */ +/* $OpenBSD: evergreen_hdmi.c,v 1.2 2014/02/09 13:43:02 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -157,6 +157,9 @@ void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; uint32_t offset; + if (!dig || !dig->afmt) + return; + /* Silent, r600_hdmi_enable will raise WARN for us */ if (!dig->afmt->enabled) return; diff --git a/sys/dev/pci/drm/radeon/r600_hdmi.c b/sys/dev/pci/drm/radeon/r600_hdmi.c index 442fd43ddb3..91fa290d5ef 100644 --- a/sys/dev/pci/drm/radeon/r600_hdmi.c +++ b/sys/dev/pci/drm/radeon/r600_hdmi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: r600_hdmi.c,v 1.1 2013/08/12 04:11:53 jsg Exp $ */ +/* $OpenBSD: r600_hdmi.c,v 1.2 2014/02/09 13:43:02 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -323,6 +323,9 @@ void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mod struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; uint32_t offset; + if (!dig || !dig->afmt) + return; + /* Silent, r600_hdmi_enable will raise WARN for us */ if (!dig->afmt->enabled) return; @@ -481,6 +484,9 @@ void r600_hdmi_enable(struct drm_encoder *encoder) uint32_t offset; u32 hdmi; + if (!dig || !dig->afmt) + return; + if (ASIC_IS_DCE6(rdev)) return; -- cgit v1.2.3