drm/amd/display: Skip querying caps when DMCUB emulation is in use
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Thu, 22 Jun 2023 20:14:22 +0000 (16:14 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 18 Jul 2023 15:14:08 +0000 (11:14 -0400)
[Why]
Workaround to avoid accessing DMCUB state too early if the emulator
is in use - we don't support any of the features the caps are querying
with emulation anyway.

[How]
Guard the query if emulation is in use.

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c

index c753c6f30dd71445fc9476e41d20985b366f27ff..24433409d7def831a9098b70ae78e05c2edfe7f1 100644 (file)
@@ -381,6 +381,9 @@ void dc_dmub_srv_query_caps_cmd(struct dc_dmub_srv *dc_dmub_srv)
 {
        union dmub_rb_cmd cmd = { 0 };
 
+       if (dc_dmub_srv->ctx->dc->debug.dmcub_emulation)
+               return;
+
        memset(&cmd, 0, sizeof(cmd));
 
        /* Prepare fw command */