summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-02-09 13:43:03 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-02-09 13:43:03 +0000
commit07128dc5ae0bd5c9037b1b2b021fbd32c87f790a (patch)
tree9a64ea1964129600eef4b5eac25aa833d1c92f03 /sys
parent4cd099d30255b909403254e72c9a5baa86f6fbf4 (diff)
drm/radeon/hdmi: make sure we have an afmt block assigned
From Alex Deucher 4d178917546b339a5486645f40f32c9cbd1240f1 in ubuntu 3.8 c2b4cacfe9816c1fe378c785ce8a678cf0635ec6 in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/radeon/evergreen_hdmi.c5
-rw-r--r--sys/dev/pci/drm/radeon/r600_hdmi.c8
2 files changed, 11 insertions, 2 deletions
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;