From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Mika Kahola <mika.kahola@intel.com>
Cc: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org,
jim.bride@linux.intel.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 09/11] drm/i915: Check pixel rate for DP to VGA dongle
Date: Thu, 9 Jun 2016 11:14:08 +0300 [thread overview]
Message-ID: <20160609081408.GB4329@intel.com> (raw)
In-Reply-To: <1465219753-3737-10-git-send-email-mika.kahola@intel.com>
On Mon, Jun 06, 2016 at 04:29:11PM +0300, Mika Kahola wrote:
> Filter out a mode that exceeds the max pixel rate setting
> for DP to VGA dongle. This is defined in DPCD register 0x81
> if detailed cap info i.e. info field is 4 bytes long and
> it is available for DP downstream port.
>
> The register defines the pixel rate divided by 8 in MP/s.
>
> v2: DPCD read outs and computation moved to drm (Ville, Daniel)
> v3: Sink pixel rate computation moved to drm_dp_max_sink_dotclock()
> function (Daniel)
> v4: Use of drm_dp_helper.c routines to compute max pixel clock (Ville)
>
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 096acbf0..1b94347 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -200,6 +200,23 @@ intel_dp_mode_valid(struct drm_connector *connector,
> int target_clock = mode->clock;
> int max_rate, mode_rate, max_lanes, max_link_clock;
> int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
> + bool is_branch_device;
> + int max_dp_clk;
> + int type;
> + uint8_t port_cap[4];
> +
> + is_branch_device = intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> + DP_DWN_STRM_PORT_PRESENT;
> +
> + if (is_branch_device) {
> + drm_dp_downstream_port_cap(&intel_dp->aux, intel_dp->dpcd, port_cap);
I'm pretty sure we already read out the downstream port caps in fact.
Hmm, yeah ->downstream_ports. So no need for this, and I suppose no need
for your helper for the readout either. Just always readoing out the
full 16 bytes should be fine.
> + type = drm_dp_downstream_type(intel_dp->dpcd, port_cap);
> + max_dp_clk = drm_dp_downstream_max_clock(intel_dp->dpcd, port_cap);
> +
> + if ((type == DP_DS_PORT_TYPE_VGA) && (max_dp_clk > 0)) {
Type check can be skipped if drm_dp_downstream_max_clock() just returns
0 for the "don't know" case.
> + max_dotclk = min(max_dotclk, max_dp_clk);
> + }
> + }
>
> if (is_edp(intel_dp) && fixed_mode) {
> if (mode->hdisplay > fixed_mode->hdisplay)
> --
> 1.9.1
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-06-09 8:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 13:29 [PATCH v4 00/11] drm/i915: DP branch devices Mika Kahola
2016-06-06 13:29 ` [PATCH v4 01/11] drm: Add missing DP downstream port types Mika Kahola
2016-06-06 13:29 ` [PATCH v4 02/11] drm: Read DP downstream port capabilities Mika Kahola
2016-06-06 16:00 ` kbuild test robot
2016-06-09 7:52 ` Ville Syrjälä
2016-06-06 13:29 ` [PATCH v4 03/11] drm: Helper to read DP branch device type Mika Kahola
2016-06-09 7:57 ` Ville Syrjälä
2016-06-06 13:29 ` [PATCH v4 04/11] drm: Helper to read max clock rate Mika Kahola
2016-06-09 7:59 ` Ville Syrjälä
2016-06-06 13:29 ` [PATCH v4 05/11] drm: Helper to read max bits per component Mika Kahola
2016-06-09 8:02 ` Ville Syrjälä
2016-06-09 10:08 ` Mika Kahola
2016-06-06 13:29 ` [PATCH v4 06/11] drm: Read DP branch device id Mika Kahola
2016-06-06 17:55 ` kbuild test robot
2016-06-06 13:29 ` [PATCH v4 07/11] drm: Read DP branch device HW revision Mika Kahola
2016-06-06 13:29 ` [PATCH v4 08/11] drm: Read DP branch device SW revision Mika Kahola
2016-06-06 13:29 ` [PATCH v4 09/11] drm/i915: Check pixel rate for DP to VGA dongle Mika Kahola
2016-06-09 8:14 ` Ville Syrjälä [this message]
2016-06-09 8:27 ` Kahola, Mika
2016-06-06 13:29 ` [PATCH v4 10/11] drm/i915: Update bits per component for display info Mika Kahola
2016-06-06 13:29 ` [PATCH v4 11/11] drm/i915: Add DP branch device info on debugfs Mika Kahola
2016-06-06 14:03 ` ✗ Ro.CI.BAT: warning for drm/i915: DP branch devices (rev4) Patchwork
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=20160609081408.GB4329@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jim.bride@linux.intel.com \
--cc=mika.kahola@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.