From patchwork Wed Feb 26 22:07:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 11407383 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BA3114B4 for ; Wed, 26 Feb 2020 22:07:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id ECE5421D7E for ; Wed, 26 Feb 2020 22:07:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ghjQ5U1N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECE5421D7E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 778046E153; Wed, 26 Feb 2020 22:07:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1961C88A9C; Wed, 26 Feb 2020 22:07:22 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id t7so708620edr.4; Wed, 26 Feb 2020 14:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=smlCNyZtkUS5wtodeApayWhfct5DN5V19mI08hkP2Xo=; b=ghjQ5U1NmSHaFr6tU8IENHZwipVNP5jyCzhU6nV7h62ZPW7X/96FvJA4rm+8dx9NLp Lzd5H3l47KL7iTnNZY7zVeqQ/HnDHNpQuZP7ARkYx2TTibZvYng1c2fUWKKEjHGkzxtW j1PlGGs0/1wf50f7E3QadDLs3ZBZRg9/DvGaOqo/8AvBqVzwQBjqD1DQuwqCnO3lK2bT rwoIV172jr0CeKH9b1pAVwxqkMxt0yqC4ZUhM2SxcG9cd9GwMlXDtdBrZARBHOHdwr41 VUFjM18z3YNswbBL+eHJYJPQ3udUr/0Hk8gGHg5rhle/X6/ZmXBw1ZALYJwNCy1zxr7l 3ZTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=smlCNyZtkUS5wtodeApayWhfct5DN5V19mI08hkP2Xo=; b=KCas3jbZhbHpiRDwf7HYK/dp0osNTGCjj/MHsxCAEYAQlhRzj1Q/4IM02/DBWfQbiP QHYSWofVyB799NnuZZNdzI3PWJ6u9CeRejna0DWq3RWYrgvt8tfsswTocpy6w41z8yDd x/rFAklMQ00uac1/mV8VeeSbS2HbD+MxZ1gq7O78BE5QMIj4aSnkRp1I8NGFJ5v8LaS9 LjzbKzZfCAw4Hppqp0TuUhp9Gz5GvF2LiGpFoDlemBEFxWVJn8ZWXY2ozrNOZiEnQ0Pw lscry3BwKNfAUkwqFiyTY7YAjdLdDP90CtKvshvcf4UKD+eutGxJctNUmJvlzGHaQyKQ KlaA== X-Gm-Message-State: APjAAAV01xFOuSsgvXo4av7CYbbegEkakxj5s62Xwidr08h7t936FIC+ SII/cdAG7djI+Pbc/H6e9Fk= X-Google-Smtp-Source: APXvYqydPKo4Tg7/Ss78gnfFNnIqgFyswXLCr8T6+nOwPFGDOTqqAMzZ17XdJSY95CGjyb3Ru2edmw== X-Received: by 2002:aa7:ca10:: with SMTP id y16mr489172eds.217.1582754840773; Wed, 26 Feb 2020 14:07:20 -0800 (PST) Received: from smtp.gmail.com ([2001:818:e238:a000:51c6:2c09:a768:9c37]) by smtp.gmail.com with ESMTPSA id dd20sm167771ejb.59.2020.02.26.14.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 14:07:20 -0800 (PST) Date: Wed, 26 Feb 2020 19:07:12 -0300 From: Melissa Wen To: Harry Wentland , Leo Li , Alex Deucher , Christian Konig , David Zhou , David Airlie , Daniel Vetter , Rodrigo Siqueira Subject: [PATCH 1/2] drm/amd/display: dc_link: code clean up on enable_link_dp function Message-ID: <990112183d2bc344bd921bb55eee2f8cc2cd8bd5.1582752490.git.melissa.srw@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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" Coding style clean up on enable_link_dp function as suggested by checkpatch.pl: CHECK: Lines should not end with a '(' WARNING: line over 80 characters WARNING: suspect code indent for conditional statements (8, 24) CHECK: braces {} should be used on all arms of this statement ERROR: else should follow close brace '}' CHECK: Comparison to NULL could be written "link->preferred_training_settings.fec_enable" Signed-off-by: Melissa Wen --- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index a09119c10d7c..0f28b5694144 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -1480,9 +1480,8 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx) } } -static enum dc_status enable_link_dp( - struct dc_state *state, - struct pipe_ctx *pipe_ctx) +static enum dc_status enable_link_dp(struct dc_state *state, + struct pipe_ctx *pipe_ctx) { struct dc_stream_state *stream = pipe_ctx->stream; enum dc_status status; @@ -1512,27 +1511,28 @@ static enum dc_status enable_link_dp( pipe_ctx->stream_res.pix_clk_params.requested_sym_clk = link_settings.link_rate * LINK_RATE_REF_FREQ_IN_KHZ; - if (state->clk_mgr && !apply_seamless_boot_optimization) - state->clk_mgr->funcs->update_clocks(state->clk_mgr, state, false); + if (state->clk_mgr && !apply_seamless_boot_optimization) { + state->clk_mgr->funcs->update_clocks(state->clk_mgr, + state, false); + } skip_video_pattern = true; if (link_settings.link_rate == LINK_RATE_LOW) - skip_video_pattern = false; - - if (perform_link_training_with_retries( - &link_settings, - skip_video_pattern, - LINK_TRAINING_ATTEMPTS, - pipe_ctx, - pipe_ctx->stream->signal)) { + skip_video_pattern = false; + + if (perform_link_training_with_retries(&link_settings, + skip_video_pattern, + LINK_TRAINING_ATTEMPTS, + pipe_ctx, + pipe_ctx->stream->signal)) { link->cur_link_settings = link_settings; status = DC_OK; - } - else + } else { status = DC_FAIL_DP_LINK_TRAINING; + } - if (link->preferred_training_settings.fec_enable != NULL) + if (link->preferred_training_settings.fec_enable) fec_enable = *link->preferred_training_settings.fec_enable; else fec_enable = true; From patchwork Wed Feb 26 22:08:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 11407385 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F92614B4 for ; Wed, 26 Feb 2020 22:08:34 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E11022072D for ; Wed, 26 Feb 2020 22:08:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qz9P+oGn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E11022072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F5B36E48F; Wed, 26 Feb 2020 22:08:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 396616EBE1; Wed, 26 Feb 2020 22:08:31 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id n18so412347edw.9; Wed, 26 Feb 2020 14:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jp59utgfg7BcBD4RiJuNr7SC9meFZCk4nKcHVjkdN50=; b=Qz9P+oGnzpRBIGm+tjDYqC7KUbkMLXzwKCqJyVX6pWiKSNOtpN4SEQi4/jqWDfUrkD 6gBbvmkX5kEHf4Dj1xuaNM0jHKaLdHYAYGygGRIpDNDzFQgi7+dhWPJ5t6l9rq+YAl2m XLwFkKZeAEuDbWlqESft9qhr3/p6MaG1X6OdmxGyeNsLxq/oUJuNfpO1HKSPqJqPLE5L qBUpjtgFU3f31/dvTtaC41DwPGURuN3jwmtnWFPo6zrUPmB1G0eakN/UKjJkU1fwhqTM jKBBf2JVTR9PA0bWpAlVvwzINzPTxzYPDKR8K/XwoJTfY14Nf0GKdWv+4jWmyyKafSKs ly0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jp59utgfg7BcBD4RiJuNr7SC9meFZCk4nKcHVjkdN50=; b=O46R+KursmCm01fB5ZczYnjp8rLyDjnFco5pymqSGm35ecKCnaw7yAP+iagIbuz+Aq D8Sei7g9cZ3mz2FoWtRSF2dGZtktaLtvmaIUGMqLidPSk3rquS6V3dERoqujIavOkITh JmJHp9JbmGhN2ZiexWddGSOWqJ5qpA80vOH+GYElQAbQnb4NCEc2Avzki/J3h/c8zrGL DJaX6Q5Yy1WYyVPTfQY3aJSUK92g4MgkW/IHGyylB4oSdge0uIGbXgLe/o5gIQJEe+QU YFZXfUM+g9Grin3zrQu0gpHcTms/4fWg5xbHvUxBxVz7wDBB3lYidQ6wiRBnUuXoA7dP w14Q== X-Gm-Message-State: APjAAAUH25wPTXwhZ1F8kD0sNNi8NgRYDJzuW9nBnUiN+SKVExQN+QBj tOpl1l68tCLOp4ug26pyZj4= X-Google-Smtp-Source: APXvYqxfA48ICMaI6cFaxqrBbC/3SJLNyp1g5yxBCFl4kmx+9vVWLt/xQF5pq0bUfYNL7YVOdhIbPg== X-Received: by 2002:a17:906:55c1:: with SMTP id z1mr790598ejp.288.1582754909801; Wed, 26 Feb 2020 14:08:29 -0800 (PST) Received: from smtp.gmail.com ([2001:818:e238:a000:51c6:2c09:a768:9c37]) by smtp.gmail.com with ESMTPSA id q7sm232033edr.34.2020.02.26.14.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 14:08:29 -0800 (PST) Date: Wed, 26 Feb 2020 19:08:22 -0300 From: Melissa Wen To: Harry Wentland , Leo Li , Alex Deucher , Christian Konig , David Zhou , David Airlie , Daniel Vetter , Rodrigo Siqueira Subject: [PATCH 2/2] drm/amd/display: dc_link: code clean up on detect_dp function Message-ID: <9961afca2cf831ac688025a63b7cd35dd0908fac.1582752490.git.melissa.srw@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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" Removes codestyle issues on detect_dp function as suggested by checkpatch.pl. CHECK: Lines should not end with a '(' WARNING: Missing a blank line after declarations WARNING: line over 80 characters CHECK: Alignment should match open parenthesis Signed-off-by: Melissa Wen Reviewed-by: Zhan Liu --- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index 0f28b5694144..adb717f02c9c 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c @@ -585,14 +585,14 @@ static void read_current_link_settings_on_detect(struct dc_link *link) LINK_SPREAD_05_DOWNSPREAD_30KHZ : LINK_SPREAD_DISABLED; } -static bool detect_dp( - struct dc_link *link, - struct display_sink_capability *sink_caps, - bool *converter_disable_audio, - struct audio_support *audio_support, - enum dc_detect_reason reason) +static bool detect_dp(struct dc_link *link, + struct display_sink_capability *sink_caps, + bool *converter_disable_audio, + struct audio_support *audio_support, + enum dc_detect_reason reason) { bool boot = false; + sink_caps->signal = link_detect_sink(link, reason); sink_caps->transaction_type = get_ddc_transaction_type(sink_caps->signal); @@ -606,9 +606,8 @@ static bool detect_dp( sink_caps->signal = SIGNAL_TYPE_DISPLAY_PORT_MST; link->type = dc_connection_mst_branch; - dal_ddc_service_set_transaction_type( - link->ddc, - sink_caps->transaction_type); + dal_ddc_service_set_transaction_type(link->ddc, + sink_caps->transaction_type); /* * This call will initiate MST topology discovery. Which @@ -637,13 +636,10 @@ static bool detect_dp( if (reason == DETECT_REASON_BOOT) boot = true; - dm_helpers_dp_update_branch_info( - link->ctx, - link); + dm_helpers_dp_update_branch_info(link->ctx, link); - if (!dm_helpers_dp_mst_start_top_mgr( - link->ctx, - link, boot)) { + if (!dm_helpers_dp_mst_start_top_mgr(link->ctx, + link, boot)) { /* MST not supported */ link->type = dc_connection_single; sink_caps->signal = SIGNAL_TYPE_DISPLAY_PORT; @@ -651,7 +647,7 @@ static bool detect_dp( } if (link->type != dc_connection_mst_branch && - is_dp_active_dongle(link)) { + is_dp_active_dongle(link)) { /* DP active dongles */ link->type = dc_connection_active_dongle; if (!link->dpcd_caps.sink_count.bits.SINK_COUNT) { @@ -662,14 +658,15 @@ static bool detect_dp( return true; } - if (link->dpcd_caps.dongle_type != DISPLAY_DONGLE_DP_HDMI_CONVERTER) + if (link->dpcd_caps.dongle_type != + DISPLAY_DONGLE_DP_HDMI_CONVERTER) *converter_disable_audio = true; } } else { /* DP passive dongles */ sink_caps->signal = dp_passive_dongle_detection(link->ddc, - sink_caps, - audio_support); + sink_caps, + audio_support); } return true;