public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Mika Kahola <mika.kahola@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 0/9] drm/i915: Check pixel clock when setting mode
Date: Mon, 6 Jul 2015 17:21:48 +0200	[thread overview]
Message-ID: <20150706152148.GT2156@phenom.ffwll.local> (raw)
In-Reply-To: <20150703124917.GL14231@nuc-i3427.alporthouse.com>

On Fri, Jul 03, 2015 at 01:49:17PM +0100, Chris Wilson wrote:
> On Fri, Jul 03, 2015 at 02:35:48PM +0300, Mika Kahola wrote:
> > From EDID we can read and request higher pixel clock than
> > our HW can support. This set of patches add checks if
> > requested pixel clock is lower than the one supported by the HW.
> > The requested mode is discarded if we cannot support the requested
> > pixel clock. For example for Cherryview
> > 
> > 'cvt 2560 1600 60' gives
> > 
> > # 2560x1600 59.99 Hz (CVT 4.10MA) hsync: 99.46 kHz; pclk: 348.50 MHz
> > Modeline "2560x1600_60.00"  348.50  2560 2760 3032 3504  1600 1603 1609 1658 -hsync +vsync
> > 
> > where pixel clock 348.50 MHz is higher than the supported 304 MHz.
> > 
> > The checks are implemented for DisplayPort, HDMI, LVDS, DVO, SDVO, DSI,
> > CRT, TV, and DP-MST.
> 
> Why do I get the feeling that there was a lot of duplicated code?

The problem on top is that this only changes the mode_valid callback as
used by the probe helpers. Which means userspace can still do an addmode
of something not supported and try to trick over the code into accepting
something it can't. That code is the stuff around compute_config.

Which means we have some unpretty duplication going on, both between the
probe and compute_config paths and across all the different encoder types.
For the later an easy solution would be to add a device-global mode_valid
function and integrate that into the probe helpers. Should be a helper
library vfunc, i.e. separate from the main display vtable.

For the duplication between probe code and modeset code we should at least
try to cross-check the results (i.e. make sure that anything the modeset
code taks is also considered valid by the probe code, the other way round
only works for single-pipe and is a bit tricky due to other constraints
like plane limits). One idea I had for at least the encoder specific
checks (e.g. hdmi dotclock limits) would be to call the compute_config
function from mode_valid with a minimal pipe_config and hope for the best.
But I think that's way too tricky code, so probably the only thing we can
do without creating really hard to read&maintain code is to cross-check
the inevitable duplication :(
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-06 15:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-03 11:35 [PATCH 0/9] drm/i915: Check pixel clock when setting mode Mika Kahola
2015-07-03 11:35 ` [PATCH 1/9] drm/i915: Check pixel clock when setting mode for DP Mika Kahola
2015-07-03 12:57   ` Ville Syrjälä
2015-07-06  6:45     ` Sivakumar Thulasimani
2015-07-06  9:23       ` Ville Syrjälä
2015-07-28  7:36     ` Mika Kahola
2015-07-03 11:35 ` [PATCH 2/9] drm/i915: Check pixel clock when setting mode for HDMI Mika Kahola
2015-07-03 11:35 ` [PATCH 3/9] drm/i915: Check pixel clock when setting mode for LVDS Mika Kahola
2015-07-03 12:35   ` Chris Wilson
2015-07-03 11:35 ` [PATCH 4/9] drm/i915: Check pixel clock when setting mode for DVO Mika Kahola
2015-07-03 11:35 ` [PATCH 5/9] drm/i915: Check pixel clock when setting mode for SDVO Mika Kahola
2015-07-03 11:35 ` [PATCH 6/9] drm/i915: Check pixel clock when setting mode for DSI Mika Kahola
2015-07-03 12:38   ` Chris Wilson
2015-07-27 11:47     ` Mika Kahola
2015-07-03 11:35 ` [PATCH 7/9] drm/i915: Check pixel clock when setting mode for CRT Mika Kahola
2015-07-03 11:35 ` [PATCH 8/9] drm/i915: Check pixel clock when setting mode for TV Mika Kahola
2015-07-03 11:35 ` [PATCH 9/9] drm/i915: Check pixel clock when setting mode for DP-MST Mika Kahola
2015-07-04 23:24   ` shuang.he
2015-07-03 12:49 ` [PATCH 0/9] drm/i915: Check pixel clock when setting mode Chris Wilson
2015-07-06 15:21   ` Daniel Vetter [this message]
2015-07-06 15:28     ` Ville Syrjälä
2015-07-06 18:00       ` Daniel Vetter
2015-07-06 15:35     ` Chris Wilson

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=20150706152148.GT2156@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox