drm/amd/display: always switch off ODM before committing more streams
authorjsg <jsg@openbsd.org>
Tue, 19 Sep 2023 12:46:20 +0000 (12:46 +0000)
committerjsg <jsg@openbsd.org>
Tue, 19 Sep 2023 12:46:20 +0000 (12:46 +0000)
From Wenjing Liu
2d7a6fcb1f232c91fe405161d2ba5731ccb97a34 in linux-6.1.y/6.1.54
49a30c3d1a2258fc93cfe6eea8e4951dabadc824 in mainline linux

sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c

index 674ab6d..0a7c083 100644 (file)
@@ -1977,12 +1977,12 @@ enum dc_status dc_commit_streams(struct dc *dc,
                }
        }
 
-       /* Check for case where we are going from odm 2:1 to max
-        *  pipe scenario.  For these cases, we will call
-        *  commit_minimal_transition_state() to exit out of odm 2:1
-        *  first before processing new streams
+       /* ODM Combine 2:1 power optimization is only applied for single stream
+        * scenario, it uses extra pipes than needed to reduce power consumption
+        * We need to switch off this feature to make room for new streams.
         */
-       if (stream_count == dc->res_pool->pipe_count) {
+       if (stream_count > dc->current_state->stream_count &&
+                       dc->current_state->stream_count == 1) {
                for (i = 0; i < dc->res_pool->pipe_count; i++) {
                        pipe = &dc->current_state->res_ctx.pipe_ctx[i];
                        if (pipe->next_odm_pipe)