[PATCH 6/7] drm/amd/display: fix crash with modesetting driver

Harry Wentland harry.wentland at amd.com
Tue Feb 7 00:18:11 UTC 2017


They might call commit with ACTION_NOTHING without a mode.
We shouldn't crash but simply skip updating stream scaling
settings since scaling obviously didn't change without a
provided mode.

Change-Id: Id787a2f3dd73eef3512cb35f48c8cd5842d22032
Signed-off-by: Harry Wentland <harry.wentland at amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index 865ee1ecce4f..c8a7b636a1b3 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -644,6 +644,10 @@ static void update_stream_scaling_settings(
 	struct rect src = { 0 }; /* viewport in composition space*/
 	struct rect dst = { 0 }; /* stream addressable area */
 
+	/* no mode. nothing to be done */
+	if (!mode)
+		return;
+
 	/* Full screen scaling by default */
 	src.width = mode->hdisplay;
 	src.height = mode->vdisplay;
-- 
2.9.3



More information about the amd-gfx mailing list