public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 0/9] drm/i915: Check pixel clock when setting mode
Date: Mon, 6 Jul 2015 20:00:43 +0200	[thread overview]
Message-ID: <20150706180043.GE7568@phenom.ffwll.local> (raw)
In-Reply-To: <20150706152856.GP5176@intel.com>

On Mon, Jul 06, 2015 at 06:28:56PM +0300, Ville Syrjälä wrote:
> On Mon, Jul 06, 2015 at 05:21:48PM +0200, Daniel Vetter wrote:
> > 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 :(
> 
> I tried to look at sharing the checking code between .mode_valid() and
> mdoeset a while back but it turned into a bit of a nightmare when I
> started to think about stereo 3D. To do the checks properly for stereo
> 3D we'd basically need to feed the mode through
> drm_mode_set_crtcinfo(CRTC_STEREO_DOUBLE) and then check the crtc_
> timings instead of the normal ones. So that would mean changing all the
> .mode_valid() callbacks, and when I started down that path I landed
> somewhere in DVO land and couldn't even figure out what limitations
> .mode_valid() functions were trying to check. At that point I gave up,
> and I also suggested to Mika that he first just look at adding the
> checks to the .mode_valid() callbacks and not worry too much about
> stereo 3D. I think that's a good enough first step.

Yeah makes sense as a first step. We should still look into how we could
at least share most of this across encoders a bit.
-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 17:57 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
2015-07-06 15:28     ` Ville Syrjälä
2015-07-06 18:00       ` Daniel Vetter [this message]
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=20150706180043.GE7568@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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