aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0284-drm-amdgpu-Don-t-crash-system-if-we-can-t-get-crtc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0284-drm-amdgpu-Don-t-crash-system-if-we-can-t-get-crtc.patch')
-rw-r--r--common/recipes-kernel/linux/files/0284-drm-amdgpu-Don-t-crash-system-if-we-can-t-get-crtc.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0284-drm-amdgpu-Don-t-crash-system-if-we-can-t-get-crtc.patch b/common/recipes-kernel/linux/files/0284-drm-amdgpu-Don-t-crash-system-if-we-can-t-get-crtc.patch
new file mode 100644
index 00000000..542a3d6f
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0284-drm-amdgpu-Don-t-crash-system-if-we-can-t-get-crtc.patch
@@ -0,0 +1,32 @@
+From db54921428ca7db9ad7586500ea0ef469bc6b88d Mon Sep 17 00:00:00 2001
+From: Harry Wentland <harry.wentland@amd.com>
+Date: Wed, 25 Nov 2015 15:42:09 -0500
+Subject: [PATCH 0284/1110] drm/amdgpu: Don't crash system if we can't get crtc
+
+Signed-off-by: Harry Wentland <harry.wentland@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+index 4488e82..ab58187 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+@@ -727,6 +727,12 @@ int amdgpu_get_vblank_timestamp_kms(struct drm_device *dev, unsigned int pipe,
+
+ /* Get associated drm_crtc: */
+ crtc = &adev->mode_info.crtcs[pipe]->base;
++ if (!crtc) {
++ /* This can occur on driver load if some component fails to
++ * initialize completely and driver is unloaded */
++ DRM_ERROR("Uninitialized crtc %d\n", pipe);
++ return -EINVAL;
++ }
+
+ /* Helper routine in DRM core does all the work: */
+ return drm_calc_vbltimestamp_from_scanoutpos(dev, pipe, max_error,
+--
+2.7.4
+