From patchwork Sun Jun 11 15:23:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13275228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7BB6C7EE2E for ; Sun, 11 Jun 2023 15:23:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9120D10E0E3; Sun, 11 Jun 2023 15:23:58 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D02E10E0E3; Sun, 11 Jun 2023 15:23:55 +0000 (UTC) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8BxZ+kH54VkptwCAA--.4558S3; Sun, 11 Jun 2023 23:23:52 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxVeQH54VkHBATAA--.55302S2; Sun, 11 Jun 2023 23:23:51 +0800 (CST) From: Sui Jingfeng To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , Christian Konig , Pan Xinhui , David Airlie , Daniel Vetter , Alvin Lee , Jun Lei , Qingqing Zhuo , Wenjing Liu , Samson Tam , Dillon Varone , Alan Liu Subject: [PATCH v2] drm/amdgpu: Add error reporting code for the display core Date: Sun, 11 Jun 2023 23:23:51 +0800 Message-Id: <20230611152351.24569-1-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxVeQH54VkHBATAA--.55302S2 X-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I42IY6xAIw20EY4 v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AK xVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8hID7UUUUU== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" [why] Because the drm/amdgpu drivers do not work with Navi 10 [RX 5700] series GPUs on non-x86 platforms, this patch helps find out where the drivers fail. After applying his patch, the following error message can be found: [drm:dc_create [amdgpu]] *ERROR* dc_construct: failed to create resource pool [drm:dc_create [amdgpu]] *ERROR* dc_create: dc construct failed [drm] Display Core failed to initialize with v3.2.230! Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/amd/display/dc/core/dc.c | 29 ++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 52564b93f7eb..d33b78aa3e58 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -951,7 +951,7 @@ static bool dc_construct(struct dc *dc, goto fail; } - dc_ctx = dc->ctx; + dc_ctx = dc->ctx; /* Resource should construct all asic specific resources. * This should be the only place where we need to parse the asic id @@ -990,16 +990,21 @@ static bool dc_construct(struct dc *dc, } dc->res_pool = dc_create_resource_pool(dc, init_params, dc_ctx->dce_version); - if (!dc->res_pool) + if (!dc->res_pool) { + dm_error("%s: failed to create resource pool\n", __func__); goto fail; + } /* set i2c speed if not done by the respective dcnxxx__resource.c */ if (dc->caps.i2c_speed_in_khz_hdcp == 0) dc->caps.i2c_speed_in_khz_hdcp = dc->caps.i2c_speed_in_khz; dc->clk_mgr = dc_clk_mgr_create(dc->ctx, dc->res_pool->pp_smu, dc->res_pool->dccg); - if (!dc->clk_mgr) + if (!dc->clk_mgr) { + dm_error("%s: failed to create clk manager\n", __func__); goto fail; + } + #ifdef CONFIG_DRM_AMD_DC_FP dc->clk_mgr->force_smu_not_present = init_params->force_smu_not_present; @@ -1022,14 +1027,18 @@ static bool dc_construct(struct dc *dc, goto fail; } - if (!create_links(dc, init_params->num_virtual_links)) + if (!create_links(dc, init_params->num_virtual_links)) { + dm_error("%s: failed to create links\n", __func__); goto fail; + } /* Create additional DIG link encoder objects if fewer than the platform * supports were created during link construction. */ - if (!create_link_encoders(dc)) + if (!create_link_encoders(dc)) { + dm_error("%s: failed to create link encoders\n", __func__); goto fail; + } dc_resource_state_construct(dc, dc->current_state); @@ -1314,11 +1323,15 @@ struct dc *dc_create(const struct dc_init_data *init_params) return NULL; if (init_params->dce_environment == DCE_ENV_VIRTUAL_HW) { - if (!dc_construct_ctx(dc, init_params)) + if (!dc_construct_ctx(dc, init_params)) { + DC_LOG_ERROR("%s: dc construct failed\n", __func__); goto destruct_dc; + } } else { - if (!dc_construct(dc, init_params)) + if (!dc_construct(dc, init_params)) { + DC_LOG_ERROR("%s: dc construct failed\n", __func__); goto destruct_dc; + } full_pipe_count = dc->res_pool->pipe_count; if (dc->res_pool->underlay_pipe_index != NO_UNDERLAY_PIPE) @@ -1349,8 +1362,6 @@ struct dc *dc_create(const struct dc_init_data *init_params) DC_LOG_DC("Display Core initialized\n"); - - return dc; destruct_dc: