Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp739028imm; Thu, 13 Sep 2018 07:04:38 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbOUPVFVEHH+WzusBtwRU1IpQHit+awyDEnISjv+kjeBRiATxr3O4J1u0Exfo3iFlFD6Uoe X-Received: by 2002:a17:902:6bc8:: with SMTP id m8-v6mr7567644plt.162.1536847478147; Thu, 13 Sep 2018 07:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847478; cv=none; d=google.com; s=arc-20160816; b=Xitds7/qliHXlZHotfcugqWQaY+ltf/80UECqXbmzB0OFpf6mt4oJMCed1hhSAWzk+ t4wsLf1YiHwleRicWYrHj9AiIuPEcmrHd/d/RJoKTPLdNlOAb9BXXuiURAeP+nfTz3wr KitASNp/nWcIrwAUKTcOsJtghDCWUJpRjcASiebXg3nvQPe5kKPaqiGPTS41YdcKj6hJ PIdR1FgogTOxJKb+z7hxwaSRBtDUPkg8bz8WhbeCkVfdb4IZ9Jtk4LLle2FtuNGvmFV3 zcsfggwt5/83vlwmQMmwZ/7bvjK+zDnl/5ROyDVMyr6FnHcRtiYaMRcMgEBL6C8BEhzp 5XYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=iohISXQ/mGsiddBA5ROaOKYY+DdBzn+0wC4+Pu8sDr0=; b=WIl+TnUFg3DE7FaXlI8Ij4k+JVBvTxoDlMwxlLKSJ/w79l5wIZIhJeTw029zBOWMqq BjFuF9J20UE+ApXiEeKbFexsP/MahM5csZsMnczEQN0/G9UX4t2mFBVcoMYU3lXz+Xua 6sQq3uw2YJYQ5xmn3e6I1/j/yLiRkV4dKSiYUTrBC5e0CRtZxrTPwX2nwtA8PfibQpKh avrXVnjdjuzPgBZqb/013cjcI342U4TZdbvGHlTBfuuaCAYAoolaCeJpQd+txaG8IxH/ mi1hMNRDJOAiFkQo7ZRYPXaJVsuox2bmE3jUYCdB0vTGMbiRXqaRl2tnsnbIxuQNDDJ1 Zklg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si3706965pgv.85.2018.09.13.07.04.20; Thu, 13 Sep 2018 07:04:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731865AbeIMTNW (ORCPT + 99 others); Thu, 13 Sep 2018 15:13:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35324 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728556AbeIMTNV (ORCPT ); Thu, 13 Sep 2018 15:13:21 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 12E2CD32; Thu, 13 Sep 2018 14:03:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikita Lipski , Hersen Wu , Bhawanpreet Lakha , Alex Deucher Subject: [PATCH 4.18 165/197] drm/amd/display: Dont share clk source between DP and HDMI Date: Thu, 13 Sep 2018 15:31:54 +0200 Message-Id: <20180913131848.158712671@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mikita Lipski commit 3e27e10e2ecee0d3a0083f8ae76354ac9c6ad15c upstream. [why] Prevent clock source sharing between HDMI and DP connectors. DP shouldn't be sharing its ref clock with phy clock, which caused an issue of older ASICS booting up with multiple diplays plugged in. [how] Add an extra check that would prevent HDMI and DP sharing clk. Signed-off-by: Mikita Lipski Reviewed-by: Hersen Wu Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 22 +++++++++++++++- drivers/gpu/drm/amd/display/dc/dc.h | 1 drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c | 2 - drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c | 3 ++ 4 files changed, 26 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -330,6 +330,9 @@ bool resource_are_streams_timing_synchro != stream2->timing.pix_clk_khz) return false; + if (stream1->clamping.c_depth != stream2->clamping.c_depth) + return false; + if (stream1->phy_pix_clk != stream2->phy_pix_clk && (!dc_is_dp_signal(stream1->signal) || !dc_is_dp_signal(stream2->signal))) @@ -337,6 +340,20 @@ bool resource_are_streams_timing_synchro return true; } +static bool is_dp_and_hdmi_sharable( + struct dc_stream_state *stream1, + struct dc_stream_state *stream2) +{ + if (stream1->ctx->dc->caps.disable_dp_clk_share) + return false; + + if (stream1->clamping.c_depth != COLOR_DEPTH_888 || + stream2->clamping.c_depth != COLOR_DEPTH_888) + return false; + + return true; + +} static bool is_sharable_clk_src( const struct pipe_ctx *pipe_with_clk_src, @@ -348,7 +365,10 @@ static bool is_sharable_clk_src( if (pipe_with_clk_src->stream->signal == SIGNAL_TYPE_VIRTUAL) return false; - if (dc_is_dp_signal(pipe_with_clk_src->stream->signal)) + if (dc_is_dp_signal(pipe_with_clk_src->stream->signal) || + (dc_is_dp_signal(pipe->stream->signal) && + !is_dp_and_hdmi_sharable(pipe_with_clk_src->stream, + pipe->stream))) return false; if (dc_is_hdmi_signal(pipe_with_clk_src->stream->signal) --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h @@ -77,6 +77,7 @@ struct dc_caps { bool dual_link_dvi; bool post_blend_color_processing; bool force_dp_tps4_for_cp2520; + bool disable_dp_clk_share; }; struct dc_dcc_surface_param { --- a/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c @@ -884,7 +884,7 @@ static bool construct( dc->caps.i2c_speed_in_khz = 40; dc->caps.max_cursor_size = 128; dc->caps.dual_link_dvi = true; - + dc->caps.disable_dp_clk_share = true; for (i = 0; i < pool->base.pipe_count; i++) { pool->base.timing_generators[i] = dce100_timing_generator_create( --- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c @@ -902,6 +902,7 @@ static bool dce80_construct( } dc->caps.max_planes = pool->base.pipe_count; + dc->caps.disable_dp_clk_share = true; if (!resource_construct(num_virtual_links, dc, &pool->base, &res_create_funcs)) @@ -1087,6 +1088,7 @@ static bool dce81_construct( } dc->caps.max_planes = pool->base.pipe_count; + dc->caps.disable_dp_clk_share = true; if (!resource_construct(num_virtual_links, dc, &pool->base, &res_create_funcs)) @@ -1268,6 +1270,7 @@ static bool dce83_construct( } dc->caps.max_planes = pool->base.pipe_count; + dc->caps.disable_dp_clk_share = true; if (!resource_construct(num_virtual_links, dc, &pool->base, &res_create_funcs))