Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1123886ybe; Fri, 13 Sep 2019 11:23:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJQbHoa0axTZF95/TO/15uJe8vkJlsawaJrOEom0Ru1gfXS2AL1YCvK8MrJBM2UJiHW2es X-Received: by 2002:a17:906:3553:: with SMTP id s19mr39812593eja.163.1568399032651; Fri, 13 Sep 2019 11:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568399032; cv=none; d=google.com; s=arc-20160816; b=PURkhkhahWnXgqW7c5oduleR+UZlccqGoqt8NTdFLDJzKGfG+Gs8g9zQalLb2TUFqs VC6g67Z0boICe97fODv2xz0rbRpUb20cVBuYutFk5W36nSQs7B+SUqad0u75kEsamdOD /wo/Gz0vTK0/BeAAjdWD2NOlFueEOPPH5CGdtDeDDku1eejcgnYc5WJL/uZhqI7cF012 GgMTQG4y1bWs4tgTEc4N629Y2JoB1iC2wrso7mwSi/IGxSk4fklQZJ8NeWPPUv4Nq+fN GYdpp0BxEawFTRIVoEdYheuJGIqRV09RoTmkmesz+s7q93Pu8syFYIPZeiuzVDeSR/U6 mc+w== 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:dkim-signature; bh=9yAvlR/gkmhYQHQ1AotuTDQLwv/nbZUWm2bDOMqIuSg=; b=DEGzduhZZrEKUqgf/RcM0/b5C105xzUei0L6YJiwem7SOdzFTJjVaPsvohEXXUAkXy +7nRZATGBYGAqaw/BYJ0D+sZ4ZFS0iBAgWlkmPLLJX9Lm0zsPt5PQaJ/WZFV9xVBgIu6 xppm/sXYk1Kf15gxjeRkp8sAKExSxz8K2jKCYh/DfuqktCDwNYbzInLgGY80HrzCeWJQ Oc1kv26JkjFEf0dQqlOZSGWcB6AKf6lWLdylnRnrb0Ahb81FrO3icMzMOz9Uj4rDBFzY xfbr6bxEFWskP6ou/Jn+m7ndgPGzSINV1adt/l/7xTsYzs12QdgwJeC1NkwoUyhaoxoW j0MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="HOZQxyo/"; 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 k14si15658477ejg.91.2019.09.13.11.23.28; Fri, 13 Sep 2019 11:23:52 -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; dkim=pass header.i=@kernel.org header.s=default header.b="HOZQxyo/"; 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 S2390963AbfIMNWF (ORCPT + 99 others); Fri, 13 Sep 2019 09:22:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:52046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389953AbfIMNWB (ORCPT ); Fri, 13 Sep 2019 09:22:01 -0400 Received: from localhost (unknown [104.132.45.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4AEFB20830; Fri, 13 Sep 2019 13:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568380920; bh=UDnXtbd710pMVoNFt1FBa760326mEjIhMRy4SgOn1Hw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HOZQxyo/2OcrPy/RQ8tJJVDOXRpd2/eiMx20GTH4WhDRn4eZuFygjzghFTd9zHSCr TJNAY3AwtVDPMueuH7hAYQPJysuUVeC43PuyI/bMJFEhiQhl6+NeHrWRhCe5YzNmjg CN2u28Dxse+p8lek+CoU8GW+Cl43tI3oqanpR0G8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Gottwald , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Chris Wilson , Jani Nikula , Sasha Levin Subject: [PATCH 5.2 25/37] drm/i915: Make sure cdclk is high enough for DP audio on VLV/CHV Date: Fri, 13 Sep 2019 14:07:30 +0100 Message-Id: <20190913130520.218322624@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190913130510.727515099@linuxfoundation.org> References: <20190913130510.727515099@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit a8f196a0fa6391a436f63f360a1fb57031fdf26c ] On VLV/CHV there is some kind of linkage between the cdclk frequency and the DP link frequency. The spec says: "For DP audio configuration, cdclk frequency shall be set to meet the following requirements: DP Link Frequency(MHz) | Cdclk frequency(MHz) 270 | 320 or higher 162 | 200 or higher" I suspect that would more accurately be expressed as "cdclk >= DP link clock", and in any case we can express it like that in the code because of the limited set of cdclk (200, 266, 320, 400 MHz) and link frequencies (162 and 270 MHz) we support. Without this we can end up in a situation where the cdclk is too low and enabling DP audio will kill the pipe. Happens eg. with 2560x1440 modes where the 266MHz cdclk is sufficient to pump the pixels (241.5 MHz dotclock) but is too low for the DP audio due to the link frequency being 270 MHz. v2: Spell out the cdclk and link frequencies we actually support Cc: stable@vger.kernel.org Tested-by: Stefan Gottwald Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111149 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20190717114536.22937-1-ville.syrjala@linux.intel.com Acked-by: Chris Wilson (cherry picked from commit bffb31f73b29a60ef693842d8744950c2819851d) Signed-off-by: Jani Nikula Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/intel_cdclk.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c index ae40a8679314e..fd5236da039fb 100644 --- a/drivers/gpu/drm/i915/intel_cdclk.c +++ b/drivers/gpu/drm/i915/intel_cdclk.c @@ -2269,6 +2269,17 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state) if (crtc_state->has_audio && INTEL_GEN(dev_priv) >= 9) min_cdclk = max(2 * 96000, min_cdclk); + /* + * "For DP audio configuration, cdclk frequency shall be set to + * meet the following requirements: + * DP Link Frequency(MHz) | Cdclk frequency(MHz) + * 270 | 320 or higher + * 162 | 200 or higher" + */ + if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) && + intel_crtc_has_dp_encoder(crtc_state) && crtc_state->has_audio) + min_cdclk = max(crtc_state->port_clock, min_cdclk); + /* * On Valleyview some DSI panels lose (v|h)sync when the clock is lower * than 320000KHz. -- 2.20.1