From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lee Shawn C <shawn.c.lee@intel.com>
Cc: Cooper Chiou <cooper.chiou@intel.com>,
intel-gfx@lists.freedesktop.org, Sam McNally <sammc@google.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Check require bandwidth did not exceed LSPCON limitation
Date: Fri, 17 Jan 2020 16:04:14 +0200 [thread overview]
Message-ID: <20200117140414.GL13686@intel.com> (raw)
In-Reply-To: <20200117134717.2703-1-shawn.c.lee@intel.com>
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 <imre.deak@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Cooper Chiou <cooper.chiou@intel.com>
> Cc: Sam McNally <sammc@google.com>
> Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
> ---
> 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/i915/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 = dp_to_lspcon(intel_dp);
> + struct intel_connector *connector = intel_dp->attached_connector;
> + const struct drm_display_info *info = &connector->base.display_info;
> + enum drm_lspcon_mode lspcon_current_mode = lspcon_get_mode(lspcon);
> + const int pcon_mode_max_tmds_clock = 600000;
> + const int ls_mode_max_tmds_clock = 340000;
> + int mode_rate, max_tmds_clock = pcon_mode_max_tmds_clock;
> +
> + if (lspcon->active) {
> + switch (bpp) {
> + case 36:
> + mode_rate = pipe_config->hw.adjusted_mode.crtc_clock * 3 / 2;
> + break;
> + case 30:
> + mode_rate = pipe_config->hw.adjusted_mode.crtc_clock * 5 / 4;
> + break;
> + case 24:
> + default:
> + mode_rate = pipe_config->hw.adjusted_mode.crtc_clock;
> + break;
> + }
> +
> + if (lspcon_current_mode == DRM_LSPCON_MODE_LS)
> + max_tmds_clock = ls_mode_max_tmds_clock;
> +
> + if (info->max_tmds_clock)
> + max_tmds_clock = 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älä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2020-01-17 14:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 13:47 [Intel-gfx] [PATCH] drm/i915: Check require bandwidth did not exceed LSPCON limitation Lee Shawn C
2020-01-17 6:43 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-01-17 6:43 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2020-01-17 6:56 ` [Intel-gfx] [PATCH] " Jani Nikula
2020-01-17 7:15 ` Lee, Shawn C
2020-01-17 14:04 ` Ville Syrjälä [this message]
2020-01-17 16:08 ` Lee, Shawn C
2020-01-20 10:51 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork
2020-01-21 6:30 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Check require bandwidth did not exceed LSPCON limitation (rev5) Patchwork
2020-01-21 7:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Check require bandwidth did not exceed LSPCON limitation (rev3) Patchwork
2020-01-21 13:26 ` [Intel-gfx] [PATCH v2] drm/i915: Check require bandwidth did not exceed LSPCON limitation Lee Shawn C
2020-01-21 6:14 ` Sharma, Shashank
2020-01-21 6:16 ` Sharma, Shashank
2020-01-21 13:33 ` [Intel-gfx] [PATCH v3] " Lee Shawn C
-- strict thread matches above, loose matches on Subject: below --
2020-02-05 14:38 [Intel-gfx] [PATCH] " Lee Shawn C
2020-02-05 9:29 ` Lee, Shawn C
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200117140414.GL13686@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=cooper.chiou@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=sammc@google.com \
--cc=shawn.c.lee@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.