public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Dave Airlie <airlied@gmail.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [RFC] attempting to hide 30" monitor in kernel (raw)
Date: Tue, 9 Sep 2014 10:54:52 +0200	[thread overview]
Message-ID: <20140909085452.GE15520@phenom.ffwll.local> (raw)
In-Reply-To: <1410244096-9854-1-git-send-email-airlied@gmail.com>

On Tue, Sep 09, 2014 at 04:28:05PM +1000, Dave Airlie wrote:
> All these are on top of rc3 (also in my drm-mst-hide-monitor branch).
> 
> So after talking to Keith and Daniel in Chicago I decided to give
> another go at hiding the horror that is 30" 4k dual-panel MST
> monitors in the kernel.
> 
> Also this hw is not going away, if anything it seems to be getting
> worse with Dell promising a 5k monitor, requiring 2 MST ports.

There's also dual-channel dsi and similar stuff which is the same. At
least on some platforms where you need 2 crtcs to drive both channels.

> The first two patches aren't really part of this series, I should
> probably put them in -fixes anyways. (i.e. ignore them)
> 
> So this series, contains the functionality changes required to hide
> tiled crtc underneath a master crtc, and to keep track of them
> for modeset and pageflipping and cursors (not finished).
> 
> It also allows EDID patching to fake the super-mode, along with
> hiding the sub-connectors.
> 
> Patch 9 is probably the biggest hack here due to lack of atomic
> modesetting, and how userspace picks crtcs.
> 
> Patch 10 is pageflip so hacky as well, and 11 is just bogus
> cursor handling, I just wanted to see the cursor in some form for now.
> 
> Mostly I'm looking for some high-level review of the concepts of this
> and how much harder it'll make life going forward.

So thinking about this some more I see piles of issues:

- It obviously looks and works fairly badly without atomic. And it's not
  just the crtc stealing, but we also need to steal planes. Which isn't a
  problem on i915, but on SoC platforms there's often just a set of
  universal planes for all crtcs, and if we also want to fix the dual
  channel dsi mess with this those matter.

- It will be a lot of work to virtualize the crtcs properly. You ducttape
  over the pageflip issues, but there's a lot more:

  We need to consistently pick the leading crtc for pageflips and
  timestamps since otherwise the timestamps will be all over the place.
  Which will upset timing applications and result in video judder.

  We need to virtualize all the planes which runs into all the same issues
  as virtualizing crtcs: We might run out of them when userspace doesn't
  expect it, or we might not even be able to seamlessly stitch them
  together over the two crtcs. E.g. older intel chips only had 1 special
  purpose video overlay shared between all crtcs, so you just can't
  virtualize that one for 2 crtcs.

  There's probably more I've forgotten, but in any case a proper
  compositor already knows how to deal with all this. Second-guessing the
  compositor in the kernel is imo not the right approach and will result
  in major design headaches going forward.

So yeah this approach has a lot of appeal since faking it means existing
userspace will keep on working. But I also think the troubles for non-X
userspace (which actually wants to use planes properly) isn't worth it.
And also for simple X compositors the illusion falls appart quickly with
the crtc stealing and timestamp troubles for pageflips/vblanks. So let's
look at the differnt issues with the split screen stuff again, and I think
most are fairly easy to solve:

- fbdev configuration: We can just move the tiling detection into the
  fbdev helpers and it should resolve a lot of the troubles since fbdev
  emulation can explicitly assign crtcs.

- X initial configuration: Decent drivers (sna does it, dunno about the
  others) already goes to great lengths to faithfully inherit the kernel's
  setup. Ofc there's stupid xdm which club the driver/kernel right away
  with a modeset, but imo not trusting the initial setup the kernel has
  done is a bug. Both from a fastboot perspective and from a "users don't
  want to spec quirks in 3 billion different config places if kernel
  cmdline works well enough" pov.

- X compositor real screen size detection: I guess there's no way around to
  add a new "real screen" rectangles on top of the Xrandr crtc rects.
  Either the xinerama hack or something new in Xrandr, and then also
  teaching all compositors about it. Xinerama might fare better since some
  compositors already use it.

  This is obviously the crux since it means we won't have nice 4/5k
  support from the start until compositors are all updated. But I really
  don't see a quick way around this.

- Sharing the tile layout detection code: Imo the kernel should expose
  tile-id, tile-x and tile-y on connectors when they are part of a tiled
  screen. For dual channel dsi drivers can fill them from DT or vbt or
  similar. And for dp mst I think your hack is going in the right
  direction - if we always probe _all_ dp mst slaves on a given master dp
  port we should be able to fill out the tile properties correctly. Of
  course that means a bit excessive amounts of reprobing, but that's just
  a good excuse to finally have decent edid and output state caching in
  general.

  Or we just need to add an atomic probe ioctl which gives you the output
  state for _all_ connectors at the same time ...

Ok, that's my dump, let's see how much sense it still makes once coffee
kicks in ;-)

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

      parent reply	other threads:[~2014-09-09  8:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09  6:28 [RFC] attempting to hide 30" monitor in kernel (raw) Dave Airlie
2014-09-09  6:28 ` [PATCH 01/11] drm/mst: rework payload table allocation to conform better Dave Airlie
2014-09-09  6:28 ` [PATCH 02/11] drm/i915: add config option to enable/disable DP MST Dave Airlie
2014-09-09  7:51   ` Jani Nikula
2014-09-09  6:28 ` [PATCH 03/11] drm/mst: start caching edid for logical ports Dave Airlie
2014-09-09  6:28 ` [PATCH 04/11] drm/displayid: add some DisplayID related defines/structs Dave Airlie
2014-09-09  6:28 ` [PATCH 05/11] drm/dp/mst: add concept of base connector id Dave Airlie
2014-09-09  6:28 ` [PATCH 06/11] drm/tile: attempt to set tiled crtcs up Dave Airlie
2014-09-09  6:28 ` [PATCH 07/11] drm/edid: allow patching the EDID to report monster mode Dave Airlie
2014-09-09  6:28 ` [PATCH 08/11] drm/crtc: attempt to set tiled modes from userspace Dave Airlie
2014-09-09  6:28 ` [PATCH 09/11] drm/crtc: workaround userspace trying to derail crtc stealing Dave Airlie
2014-09-09  6:28 ` [PATCH 10/11] drm/tiled: add page_flip support for multi-crtc monitors Dave Airlie
2014-09-09  6:28 ` [PATCH 11/11] drm/tiled: vague attempt at waving at cursors Dave Airlie
2014-09-09  8:54 ` Daniel Vetter [this message]

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=20140909085452.GE15520@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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