OSDN Git Service

drm/amd/display: fix crash with modesetting driver
authorHarry Wentland <harry.wentland@amd.com>
Fri, 3 Feb 2017 16:45:43 +0000 (11:45 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:13:47 +0000 (17:13 -0400)
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.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c

index ad60a28..fdb264c 100644 (file)
@@ -638,6 +638,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;