linux/drivers/gpu/drm
Daniel Vetter 25f397a429 drm/crtc-helper: explicit DPMS on after modeset
Atm the crtc helper implementation of set_config has really
inconsisten semantics: If just an fb update is good enough, dpms state
will be left as-is, but if we do a full modeset we force everything to
dpms on.

This change has already been applied to the i915 modeset code in

commit e3de42b684
Author: Imre Deak <imre.deak@intel.com>
Date:   Fri May 3 19:44:07 2013 +0200

    drm/i915: force full modeset if the connector is in DPMS OFF mode

which according to Greg KH seems to aim for a new record in most
Bugzilla: links in a commit message.

The history of this dpms forcing is pretty interesting. This patch
here is an almost-revert of

commit 811aaa55ba
Author: Keith Packard <keithp@keithp.com>
Date:   Thu Feb 3 16:57:28 2011 -0800

    drm: Only set DPMS ON when actually configuring a mode

which fixed the bug of trying to dpms on disabled outputs, but
introduced the new discrepancy between an fb update only and full
modesets. The actual introduction of this goes back to

commit bf9dc102e2
Author: Keith Packard <keithp@keithp.com>
Date:   Fri Nov 26 10:45:58 2010 -0800

    drm: Set connector DPMS status to ON in drm_crtc_helper_set_config

And if you'd dig around in the i915 driver code there's even more fun
around forcing dpms on and losing our heads and temper of the
resulting inconsistencies. Especially the DP re-training code had tons
of funny stuff in it.

v2: So v1 totally blew up on resume on my radeon system here. After
much head-scraching I've figured out that the radeon resume functions
resumes the console system _before_ it actually restores all the
modeset state. And resuming the console systems means that fbdev doeas
an immediate ->set_par call.

Now up to this patch that ->set_par did absolutely nothing: All the
old sw state from pre-suspend was still around (since the modeset
reset wasn't done yet), which means that the set_config calls done as
a result of the ->set_par where all treated as no-ops (despite that
the real hw state was obviously something completely different).

Since v1 of this patch just added a bunch of ->dpms calls if the crtc
was enabled, those set_config calls suddenly stopped being no-ops. But
because the hw state wasn't restored the ->dpms callbacks resulted in
decent amounts of hilarity and eventual full hangs.

Since I can't review all kms drivers for such tricky ordering
constraints v2 opts for a different approach and forces a full modeset
if the connector dpms state isnt' DPMS_ON. Since the ->dpms callbacks
implemented by the modeset helpers update the connector->dpms property
we have the same effect of ensuring that the pipe is ultimately turned
on, even if we just end up updating the fb. This is the same approac
we ended up using in the intel driver.

Note that besides i915.ko only all other drivers eventually call
drm_helper_connector_dpms with the exception of vmwgfx, which does not
support dmps at all.

v3: Dave Airlie merged the broken first version of this patch, so
squash in the revert of

commit 372835a852
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Sat Jun 15 00:13:13 2013 +0200

    drm/crtc-helper: explicit DPMS on after modeset

Also fix up the spelling fail a bit in the commit message while at it.

Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67043
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-07-22 09:55:17 +10:00
..
ast drm/ast: inline reservations 2013-06-28 12:04:04 +10:00
cirrus drm/cirrus: inline reservations 2013-06-28 12:04:05 +10:00
exynos drm/exynos: remove duplicated error routine and unnecessary assign 2013-07-04 15:55:37 +09:00
gma500 Merge branch 'gma500-fixes' of git://github.com/patjak/drm-gma500 into drm-fixes 2013-06-11 08:16:10 +10:00
i2c
i810 i810: VM_IO is set by io_remap_pfn_range() 2013-06-29 12:46:40 +04:00
i915 ACPI video support fixes for 3.11 2013-07-21 10:11:04 -07:00
mga
mgag200 drm/mgag200: inline reservations 2013-06-28 12:04:06 +10:00
nouveau Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next 2013-07-09 10:48:41 +10:00
omapdrm Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-07-09 16:04:31 -07:00
qxl Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-07-09 16:04:31 -07:00
r128
radeon drm/radeon/dpm: add debugfs support for RS780/RS880 (v3) 2013-07-17 16:47:52 -04:00
rcar-du drm/rcar-du: Use the GEM PRIME helpers 2013-07-17 15:44:01 +02:00
savage drm (ast, cirrus, mgag200, nouveau, savage, vmwgfx): Remove drm_mtrr_{add, del} 2013-05-31 13:02:54 +10:00
shmobile drm/shmobile: Use the GEM PRIME helpers 2013-07-17 15:43:55 +02:00
sis
tdfx
tilcdc drm/tilcdc: Clear bits of register we're going to set. 2013-06-28 09:13:00 +10:00
ttm drm: make drm_mm_init() return void 2013-07-02 13:34:41 +10:00
udl drm: Drop all the stub gamma_get, gamma_set, load_lut functions from drivers 2013-06-17 19:42:47 +10:00
via
vmwgfx drm/vmwgfx: get rid of ttm_bo_is_reserved usage 2013-06-28 12:04:14 +10:00
ati_pcigart.c
drm_agpsupport.c
drm_auth.c
drm_buffer.c
drm_bufs.c drm: Don't leak phys_wc "handles" to userspace 2013-05-31 13:37:39 +10:00
drm_cache.c lib/scatterlist: sg_page_iter: support sg lists w/o backing pages 2013-03-27 17:13:44 +01:00
drm_context.c
drm_crtc.c drm: add hotspot support for cursors. 2013-06-28 09:13:39 +10:00
drm_crtc_helper.c drm/crtc-helper: explicit DPMS on after modeset 2013-07-22 09:55:17 +10:00
drm_debugfs.c
drm_dma.c
drm_dp_helper.c
drm_drv.c drm: add hotspot support for cursors. 2013-06-28 09:13:39 +10:00
drm_edid.c drm: add assertion for checking null edid to drm_edid_block_valid 2013-07-04 10:52:50 +10:00
drm_edid_load.c drm: avoid warning in drm_load_edid_firmware() 2013-07-10 14:21:46 -07:00
drm_encoder_slave.c drm: refactor call to request_module 2013-05-10 14:46:03 +10:00
drm_fb_cma_helper.c treewide: Fix typo in printk 2013-05-28 12:02:13 +02:00
drm_fb_helper.c drm/fb-helper: Make load_lut and gamma_set/gamma_get hooks optional 2013-06-17 19:42:47 +10:00
drm_fops.c drm: fix error routines in drm_open_helper 2013-07-04 10:53:37 +10:00
drm_gem.c drm: make drm_mm_init() return void 2013-07-02 13:34:41 +10:00
drm_gem_cma_helper.c drm/cma: remove GEM CMA specific dma_buf functionality 2013-07-05 15:44:54 +10:00
drm_global.c
drm_hashtab.c
drm_info.c
drm_ioc32.c
drm_ioctl.c drm: Don't leak phys_wc "handles" to userspace 2013-05-31 13:37:39 +10:00
drm_irq.c drm: fix a use-after-free when GPU acceleration disabled 2013-06-03 19:12:04 +10:00
drm_lock.c
drm_memory.c
drm_mm.c drm/mm: WARN for unclean mm takedown 2013-07-04 10:01:12 +10:00
drm_modes.c drm: Sort connector modes based on vrefresh 2013-06-11 08:35:51 +10:00
drm_pci.c drm, agpgart: Use pgprot_writecombine for AGP maps and make the MTRR optional 2013-05-31 13:37:31 +10:00
drm_platform.c
drm_prime.c drm: add mmap function to prime helpers 2013-07-05 15:44:44 +10:00
drm_proc.c drm: proc: Use remove_proc_subtree() 2013-05-01 17:29:44 -04:00
drm_rect.c drm: Add drm_rect_debug_print() 2013-04-30 22:20:00 +02:00
drm_scatter.c
drm_stub.c drm: drm_stub: Fixing return value if driver master_set call failed 2013-06-27 21:03:16 +10:00
drm_sysfs.c drm: Convert drm class driver from legacy pm ops to dev_pm_ops 2013-07-04 10:50:26 +10:00
drm_trace.h drm: fix print format of sequence in trace point 2013-07-04 10:55:27 +10:00
drm_trace_points.c
drm_usb.c
drm_vm.c drm: io_remap_pfn_range() sets VM_IO... 2013-06-29 12:46:39 +04:00
Kconfig drm/nouveau: always select ACPI_VIDEO if ACPI is enabled. 2013-06-28 11:56:22 +10:00
Makefile drm: Renesas R-Car Display Unit DRM driver 2013-06-27 10:08:04 +10:00
README.drm

************************************************************
* For the very latest on DRI development, please see:      *
*     http://dri.freedesktop.org/                          *
************************************************************

The Direct Rendering Manager (drm) is a device-independent kernel-level
device driver that provides support for the XFree86 Direct Rendering
Infrastructure (DRI).

The DRM supports the Direct Rendering Infrastructure (DRI) in four major
ways:

    1. The DRM provides synchronized access to the graphics hardware via
       the use of an optimized two-tiered lock.

    2. The DRM enforces the DRI security policy for access to the graphics
       hardware by only allowing authenticated X11 clients access to
       restricted regions of memory.

    3. The DRM provides a generic DMA engine, complete with multiple
       queues and the ability to detect the need for an OpenGL context
       switch.

    4. The DRM is extensible via the use of small device-specific modules
       that rely extensively on the API exported by the DRM module.


Documentation on the DRI is available from:
    http://dri.freedesktop.org/wiki/Documentation
    http://sourceforge.net/project/showfiles.php?group_id=387
    http://dri.sourceforge.net/doc/

For specific information about kernel-level support, see:

    The Direct Rendering Manager, Kernel Support for the Direct Rendering
    Infrastructure
    http://dri.sourceforge.net/doc/drm_low_level.html

    Hardware Locking for the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/hardware_locking_low_level.html

    A Security Analysis of the Direct Rendering Infrastructure
    http://dri.sourceforge.net/doc/security_low_level.html