From: Meenakshikumar Somasundaram <meenakshikumar.somasunda...@amd.com>

[Why]
For dpia, preferred engine instance availability is not checked
when assigning stream encoder instance.

[How]
Check for dpia preferred engine id and assign the same stream
encoder instance for the stream if available.

Reviewed-by: PeiChen Huang <peichen.hu...@amd.com>
Signed-off-by: Meenakshikumar Somasundaram <meenakshikumar.somasunda...@amd.com>
Signed-off-by: Ray Wu <ray...@amd.com>
---
 .../gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c 
b/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c
index 9d8ecc6229d9..be4ade0853e9 100644
--- a/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/resource/dcn10/dcn10_resource.c
@@ -1246,6 +1246,10 @@ struct stream_encoder 
*dcn10_find_first_free_match_stream_enc_for_link(
                        if (link->ep_type == DISPLAY_ENDPOINT_PHY && 
pool->stream_enc[i]->id ==
                                        link->link_enc->preferred_engine)
                                return pool->stream_enc[i];
+
+                       if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA && 
pool->stream_enc[i]->id ==
+                                       link->dpia_preferred_eng_id)
+                               return pool->stream_enc[i];
                }
        }
 
-- 
2.43.0

Reply via email to