dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [RFC] [PATCH 00/14] HPD/connector-polling rework
@ 2012-05-24 19:26 Daniel Vetter
  2012-05-24 19:26 ` [PATCH 01/14] drm: extract drm_kms_helper_hotplug_event Daniel Vetter
                   ` (14 more replies)
  0 siblings, 15 replies; 26+ messages in thread
From: Daniel Vetter @ 2012-05-24 19:26 UTC (permalink / raw)
  To: Intel Graphics Development, DRI Development; +Cc: Daniel Vetter

Hi all,

I've got fed up with our sorry state of connector detection and rampant edid re
and rere-reading.

This patch series lays the groundwork in the drm helpers so that drivers can
avoid all this madness (at least on working hw) and properly cache the edid.

With the additional changes for drm/i915, the edid is now read _once_ per plug
event (or at boot-up/resume time). A further step would be to integrate the
hotplug handling into the driver itself and only call ->detect on the connectors
for which the irq handler received a hotplug event.

By adding POLL_FORCE drivers can get back the old behaviour of calling ->detect
every time probe_single_connector is called from userspace. I've splattered that
over all drivers where I've thought it might be required.

Note though that setting this doesn't avoid all regressions - the regular output
poll work will still ignore any connectors with POLL_HPD set. If a driver/hw
with broken hpd got away due to this, this will break stuff. But that should be
easy to fix by admitting the defeat and setting POLL_CONNECT|DISCONNECT
directly.

If other people want to convert over their drivers, the following steps are
required:
- Ensure that the connector status is unknown every time the driver could have
  missed a hpd event (e.g. after resume). drm_mode_config_reset will do that for
  you.
- Drop the POLL_FORCE flag for connectors where hdp is fully reliable.
- Implement edid caching - that's a nice way to figure out whether hpd is
  actually reliable, because if it isn't, this step will ensure that you get bug
  reports because the the edid won't ever get updated ;-)
- Optionally teach the driver some smarts about which specific connectors
  actually got a hotplug event. Mostly useful on cheap hw (like intel's) that
  can't distinguish between hdmi and dp without trying some aux channel
  transfers.

As you can guess from the patch series, I've discovered the hard way that i915
sdvo support is totally broken. Tested on most of the intel machines I have and
also quickly on my radeon hd5000.

Comments, flames, ideas and test reports highly welcome.

Cheers, Daniel

Daniel Vetter (14):
  drm: extract drm_kms_helper_hotplug_event
  drm: handle HDP and polled connectors separately
  drm: introduce DRM_CONNECTOR_POLL_FORCE
  drm/i915: set POLL_FORCE for sdvo outputs
  drm: properly init/reset connector status
  drm: kill unnecessary calls to connector->detect
  drm: don't start the poll engine in probe_single_connector
  drm: don't unnecessarily enable the polling work
  drm: don't poll forced connectors
  drm/i915: cache crt edid
  drm/i915: cache dp edid
  drm/i915: cache hdmi edid
  drm/i915/sdvo: implement correct return value for ->get_modes
  drm/i915: s/mdelay/msleep/ in the sdvo detect function

 drivers/gpu/drm/drm_crtc.c                    |    6 ++-
 drivers/gpu/drm/drm_crtc_helper.c             |   76 ++++++++++++++++++-------
 drivers/gpu/drm/exynos/exynos_drm_connector.c |    2 +
 drivers/gpu/drm/gma500/cdv_intel_crt.c        |    2 +
 drivers/gpu/drm/gma500/cdv_intel_hdmi.c       |    2 +
 drivers/gpu/drm/gma500/mdfld_dsi_output.c     |    1 +
 drivers/gpu/drm/gma500/oaktrail_hdmi.c        |    2 +
 drivers/gpu/drm/gma500/psb_intel_sdvo.c       |    2 +
 drivers/gpu/drm/i915/intel_crt.c              |   28 +++++++--
 drivers/gpu/drm/i915/intel_dp.c               |   47 +++++++--------
 drivers/gpu/drm/i915/intel_drv.h              |    2 +
 drivers/gpu/drm/i915/intel_hdmi.c             |   48 ++++++++++------
 drivers/gpu/drm/i915/intel_modes.c            |   18 +++++-
 drivers/gpu/drm/i915/intel_sdvo.c             |   45 +++++++++------
 drivers/gpu/drm/i915/intel_tv.c               |    3 +-
 drivers/gpu/drm/nouveau/nouveau_connector.c   |    1 +
 drivers/gpu/drm/radeon/radeon_connectors.c    |    5 ++
 drivers/gpu/drm/udl/udl_connector.c           |    2 +
 drivers/staging/omapdrm/omap_connector.c      |    2 +
 include/drm/drm_crtc.h                        |    5 ++
 include/drm/drm_crtc_helper.h                 |    1 +
 21 files changed, 208 insertions(+), 92 deletions(-)

-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2012-10-04 17:43 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 19:26 [RFC] [PATCH 00/14] HPD/connector-polling rework Daniel Vetter
2012-05-24 19:26 ` [PATCH 01/14] drm: extract drm_kms_helper_hotplug_event Daniel Vetter
2012-05-24 19:26 ` [PATCH 02/14] drm: handle HDP and polled connectors separately Daniel Vetter
2012-05-25 17:26   ` [Intel-gfx] " Adam Jackson
2012-05-29  7:50     ` [PATCH] drm: handle HPD " Daniel Vetter
2012-05-29  9:22       ` [PATCH 1/2] " Daniel Vetter
2012-05-29  9:22         ` [PATCH 2/2] drm: run the hpd irq event code directly Daniel Vetter
2012-05-24 19:26 ` [PATCH 03/14] drm: introduce DRM_CONNECTOR_POLL_FORCE Daniel Vetter
2012-05-25 10:54   ` [PATCH] " Daniel Vetter
2012-05-24 19:26 ` [PATCH 04/14] drm/i915: set POLL_FORCE for sdvo outputs Daniel Vetter
2012-05-24 19:26 ` [PATCH 05/14] drm: properly init/reset connector status Daniel Vetter
2012-05-24 19:26 ` [PATCH 06/14] drm: kill unnecessary calls to connector->detect Daniel Vetter
2012-05-24 19:26 ` [PATCH 07/14] drm: don't start the poll engine in probe_single_connector Daniel Vetter
2012-05-24 19:26 ` [PATCH 08/14] drm: don't unnecessarily enable the polling work Daniel Vetter
2012-05-24 19:26 ` [PATCH 09/14] drm: don't poll forced connectors Daniel Vetter
2012-05-24 19:26 ` [PATCH 10/14] drm/i915: cache crt edid Daniel Vetter
2012-05-24 19:26 ` [PATCH 11/14] drm/i915: cache dp edid Daniel Vetter
2012-05-24 19:26 ` [PATCH 12/14] drm/i915: cache hdmi edid Daniel Vetter
2012-05-24 19:26 ` [PATCH 13/14] drm/i915/sdvo: implement correct return value for ->get_modes Daniel Vetter
2012-05-24 19:26 ` [PATCH 14/14] drm/i915: s/mdelay/msleep/ in the sdvo detect function Daniel Vetter
2012-05-31  8:29   ` Daniel Vetter
2012-05-31 19:24     ` Singh, Satyeshwar
2012-05-31 19:36       ` Daniel Vetter
2012-10-04 16:07 ` [RFC] [PATCH 00/14] HPD/connector-polling rework Alex Deucher
2012-10-04 17:16   ` Daniel Vetter
2012-10-04 17:43     ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).