From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEBF6C33CB1 for ; Fri, 17 Jan 2020 14:04:20 +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 7EF982073A for ; Fri, 17 Jan 2020 14:04:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EF982073A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B1A36F584; Fri, 17 Jan 2020 14:04:20 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id D72A76F584 for ; Fri, 17 Jan 2020 14:04:18 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2020 06:04:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,330,1574150400"; d="scan'208";a="218916560" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga008.jf.intel.com with SMTP; 17 Jan 2020 06:04:14 -0800 Received: by stinkbox (sSMTP sendmail emulation); Fri, 17 Jan 2020 16:04:14 +0200 Date: Fri, 17 Jan 2020 16:04:14 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Lee Shawn C Message-ID: <20200117140414.GL13686@intel.com> References: <20200117134717.2703-1-shawn.c.lee@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200117134717.2703-1-shawn.c.lee@intel.com> X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH] drm/i915: Check require bandwidth did not exceed LSPCON limitation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cooper Chiou , intel-gfx@lists.freedesktop.org, Sam McNally Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, Jan 17, 2020 at 09:47:17PM +0800, Lee Shawn C wrote: > While mode setting, driver would calculate mode rate based on > resolution and bpp. And choose the best bpp that did not exceed > DP bandwidtd. > = > But LSPCON had more restriction due to it convert DP to HDMI. > Driver should respect HDMI's bandwidth limitation if LSPCON > was active. This change would ignore the bpp when its required > output bandwidth already over HDMI 2.0 or 1.4 spec. > = > Cc: Imre Deak > Cc: Ville Syrj=E4l=E4 > Cc: Maarten Lankhorst > Cc: Jani Nikula > Cc: Cooper Chiou > Cc: Sam McNally > Signed-off-by: Lee Shawn C > --- > drivers/gpu/drm/i915/display/intel_dp.c | 45 +++++++++++++++++++++ > drivers/gpu/drm/i915/display/intel_lspcon.c | 5 +++ > drivers/gpu/drm/i915/display/intel_lspcon.h | 1 + > 3 files changed, 51 insertions(+) > = > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i9= 15/display/intel_dp.c > index c7424e2a04a3..c27d3e7ac219 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -1976,6 +1976,47 @@ static int intel_dp_output_bpp(const struct intel_= crtc_state *crtc_state, int bp > return bpp; > } > = > +static bool > +intel_dp_lspcon_exceed_bandwidth_limitation(struct intel_dp *intel_dp, > + struct intel_crtc_state *pipe_config, > + int bpp) > +{ > + struct intel_lspcon *lspcon =3D dp_to_lspcon(intel_dp); > + struct intel_connector *connector =3D intel_dp->attached_connector; > + const struct drm_display_info *info =3D &connector->base.display_info; > + enum drm_lspcon_mode lspcon_current_mode =3D lspcon_get_mode(lspcon); > + const int pcon_mode_max_tmds_clock =3D 600000; > + const int ls_mode_max_tmds_clock =3D 340000; > + int mode_rate, max_tmds_clock =3D pcon_mode_max_tmds_clock; > + > + if (lspcon->active) { > + switch (bpp) { > + case 36: > + mode_rate =3D pipe_config->hw.adjusted_mode.crtc_clock * 3 / 2; > + break; > + case 30: > + mode_rate =3D pipe_config->hw.adjusted_mode.crtc_clock * 5 / 4; > + break; > + case 24: > + default: > + mode_rate =3D pipe_config->hw.adjusted_mode.crtc_clock; > + break; > + } > + > + if (lspcon_current_mode =3D=3D DRM_LSPCON_MODE_LS) > + max_tmds_clock =3D ls_mode_max_tmds_clock; > + > + if (info->max_tmds_clock) > + max_tmds_clock =3D min(max_tmds_clock, > + info->max_tmds_clock); > + > + if (mode_rate > max_tmds_clock) > + return true; > + } > + > + return false; > +} That's rather ad-hoc. I've been cooking a much more generic solution to deal with all kinds of DP DFPs. It should handle the TMDS limits for HDMI/DVI DFPs (and on board LSPCON too IIRC), as well as hooking up YUV 444->420 conversion if supported by the dongle (though those old on board LSPCON chips do that differently so shouldn't affect them). Rebased version available here: git://github.com/vsyrjala/linux.git dp_downstream_ports_4 One caveat is that I've not re-tested it in maybe half a year, so not entirely sure it still works 100%. -- = Ville Syrj=E4l=E4 Intel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx