From: Paul Wu <[email protected]>

[Why]
When hardware need to be reset, driver need to reset stream objects but
dc_resource_state_destruct function omit resetting stream_count. It will
lead page fault if some logic will touch stream object.

[How]
Set stream_count to 0 when dc_resource_state_destruct.

Signed-off-by: Paul Wu <[email protected]>
Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Wayne Lin <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 9fb0930f977b..f2bc630a0871 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -2673,6 +2673,7 @@ void dc_resource_state_destruct(struct dc_state *context)
                dc_stream_release(context->streams[i]);
                context->streams[i] = NULL;
        }
+       context->stream_count = 0;
 }
 
 void dc_resource_state_copy_construct(
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to