From patchwork Tue Jun 6 19:10:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13269636 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 C177EC7EE2A for ; Tue, 6 Jun 2023 19:11:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C3E810E394; Tue, 6 Jun 2023 19:11:06 +0000 (UTC) Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by gabe.freedesktop.org (Postfix) with ESMTP id D3DDC10E255; Tue, 6 Jun 2023 19:11:03 +0000 (UTC) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8AxUem3hH9kQk0AAA--.396S3; Wed, 07 Jun 2023 03:10:47 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxCOW3hH9k7voCAA--.11776S2; Wed, 07 Jun 2023 03:10:47 +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 , Wenjing Liu , Samson Tam , Dillon Varone , Alan Liu Subject: [PATCH] drm/amdgpu: add error reporting code Date: Wed, 7 Jun 2023 03:10:46 +0800 Message-Id: <20230606191046.300194-1-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxCOW3hH9k7voCAA--.11776S2 X-CM-SenderInfo: xvxlyxpqjiv03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UJbIYCTnIWIevJa73UjIFyTuYvjxUcsjjDUUUU 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" 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: