From: Andy Walls Subject: [PATCH v2 2/2] Doc/ABI: sysfs-drm initial document; "polled" entry Date: Tue, 21 Sep 2010 23:20:22 -0400 Message-ID: <1285125622.2518.21.camel@morgan.silverblock.net> References: <1284987540.2242.29.camel@morgan.silverblock.net> <1285023750.30856.99.camel@morgan.silverblock.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1285023750.30856.99.camel@morgan.silverblock.net> Sender: linux-kernel-owner@vger.kernel.org To: linux-kernel@vger.kernel.org Cc: =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , Dave Airlie , Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, Jon Smirl List-Id: dri-devel@lists.freedesktop.org This is the initial addition of documentation for the drm module's sysf= s entries. It provides a drm sysfs entries overview, and a detailed description of the new drm per output connector "polled" entry in sysfs= =2E Signed-of-by: Andy Walls diff --git a/Documentation/ABI/testing/sysfs-drm b/Documentation/ABI/te= sting/sysfs-drm new file mode 100644 index 0000000..18a017a --- /dev/null +++ b/Documentation/ABI/testing/sysfs-drm @@ -0,0 +1,208 @@ +Direct Rendering Infrastructure (DRI) Direct Rendering Manager (drm) m= odule +and Translation Table Manager (ttm) module sysfs entries + +Example class view showing a single graphics adapter with three output +connectors, a special control device node for the graphics adapter, an= d the +Translation Table Manager (ttm) graphics memory manager virtual device= : + + /sys/class/drm/ + =E2=94=9C=E2=94=80=E2=94=80 card0 -> ../../devices/<= =2E..>/drm/card0 + =E2=94=9C=E2=94=80=E2=94=80 card0-DVI-D-1 -> ../../devices/<= =2E..>/drm/card0/card0-DVI-D-1 + =E2=94=9C=E2=94=80=E2=94=80 card0-HDMI Type A-1 -> ../../devices/<= =2E..>/drm/card0/card0-HDMI Type A-1 + =E2=94=9C=E2=94=80=E2=94=80 card0-VGA-1 -> ../../devices/<= =2E..>/drm/card0/card0-VGA-1 + =E2=94=9C=E2=94=80=E2=94=80 controlD64 -> ../../devices/<= =2E..>/drm/controlD64 + =E2=94=9C=E2=94=80=E2=94=80 ttm -> ../../devices/v= irtual/drm/ttm + =E2=94=94=E2=94=80=E2=94=80 version + + 6 directories, 1 file + + +Corresponding DRI device nodes for the example graphics adapter, with +additional ACL properties on card0 granting rw perms to the X/console = user: + + crw-rw----+ 1 root video 226, 0 2010-09-21 20:52 /dev/dri/card0 + crw-rw-rw-. 1 root video 226, 64 2010-09-21 20:51 /dev/dri/control= D64 + + +Example physical device view for a single graphics adapter with three = output +connectors and a special control device node for the graphics adapter: + + /sys/devices/<...>/drm + =E2=94=9C=E2=94=80=E2=94=80 card0 + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 card0-DVI-D-1 + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 device -> ../.= =2E/card0 + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 dpms + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 edid + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 enabled + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 modes + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 polled + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 power + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 co= ntrol + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 ru= ntime_active_time + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 ru= ntime_status + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 ru= ntime_suspended_time + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 wa= keup + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 wa= keup_count + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 status + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 subsystem -> .= =2E/../../../../../../class/drm + =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 uevent + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 card0-HDMI Type A-1 + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 device -> ../.= =2E/card0 + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 dpms + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 edid + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 enabled + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 modes + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 polled + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 power + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 co= ntrol + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 ru= ntime_active_time + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 ru= ntime_status + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 ru= ntime_suspended_time + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 wa= keup + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 wa= keup_count + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 status + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 subsystem -> .= =2E/../../../../../../class/drm + =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 uevent + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 card0-VGA-1 + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 device -> ../.= =2E/card0 + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 dpms + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 edid + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 enabled + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 modes + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 polled + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 power + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 co= ntrol + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 ru= ntime_active_time + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 ru= ntime_status + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 ru= ntime_suspended_time + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 wa= keup + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 wa= keup_count + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 status + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 subsystem -> .= =2E/../../../../../../class/drm + =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 uevent + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 dev + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 device -> ../../../0000:01= :05.0 + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 power + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 control + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 runtime_active= _time + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 runtime_status + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 runtime_suspen= ded_time + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 wakeup + =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 wakeup_count + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 subsystem -> ../../../../.= =2E/../class/drm + =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 uevent + =E2=94=94=E2=94=80=E2=94=80 controlD64 + =E2=94=9C=E2=94=80=E2=94=80 dev + =E2=94=9C=E2=94=80=E2=94=80 device -> ../../../0000:01:05.0 + =E2=94=9C=E2=94=80=E2=94=80 power + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 control + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 runtime_active_time + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 runtime_status + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 runtime_suspended_time + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 wakeup + =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 wakeup_count + =E2=94=9C=E2=94=80=E2=94=80 subsystem -> ../../../../../../cla= ss/drm + =E2=94=94=E2=94=80=E2=94=80 uevent + + 20 directories, 55 files + + +Example virtual device view view showing the Translation Table Manager= (ttm) +graphics memory manager virtual device: + + /sys/devices/virtual/drm + =E2=94=94=E2=94=80=E2=94=80 ttm + =E2=94=9C=E2=94=80=E2=94=80 buffer_objects + =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 bo_count + =E2=94=9C=E2=94=80=E2=94=80 memory_accounting + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 kernel + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 available_= memory + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 emergency_= memory + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 swap_limit + =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 used_memor= y + =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 zone_memor= y + =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 pool + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 pool_allocation_si= ze + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 pool_max_size + =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 pool_small_allocat= ion + =E2=94=9C=E2=94=80=E2=94=80 power + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 control + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 runtime_active_time + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 runtime_status + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 runtime_suspended_time + =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 wakeup + =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 wakeup_count + =E2=94=9C=E2=94=80=E2=94=80 subsystem -> ../../../../class/drm + =E2=94=94=E2=94=80=E2=94=80 uevent + + 7 directories, 16 files + + + +Where: /sys/devices/<...>/drm/cardN/cardN-C-M/polled + For N a decimal system graphics adapter number: 0, 1, 2, ... + For C a connector type name (including spaces) from the set: + Unknown + VGA + DVI-I + DVI-D + DVI-A + Composite + SVIDEO + LVDS + Component + 9-pin DIN + DisplayPort + HDMI Type A + HDMI Type B + TV + Embedded DisplayPort + For M a decimal connector number for connectors of that type + over all the graphics adapters in the system: 1, 2, ... +Date: 22 September 2010 +KernelVersion: 2.6.37 +Contact: Andy Walls +Description: + Manual control over DRM Kernel Mode Set (KMS) output connector + hotplug/connect/disconnect polling criteria. The graphics + adapter drm driver (e.g. radeon, i915, nouveau) will detect + the available connectors on a graphics adapter and set polling + criteria flags for the connector to specify for what events the + 0.1 Hz DRM KMS poll of the connector should look. + + A read of the contents of this entry will show what flags are + available, with the names of flags that are set for the + connector enclosed in brackets: + + # cat /sys/devices/.../drm/card0/card0-DVI-D-1/polled + [hotplug_detectable] connect disconnect + + A write of flags names to this entry, will clear the current + flag settings and set the poll criteria flags for that + connector to those specified names: + + # echo " disconnect connect " > \ + /sys/devices/.../drm/card0/card0-DVI-D-1/polled + # cat /sys/devices/.../drm/card0/card0-DVI-D-1/polled + hotplug_detectable [connect] [disconnect] + + # echo > /sys/devices/.../drm/card0/card0-DVI-D-1/polled + # cat /sys/devices/.../drm/card0/card0-DVI-D-1/polled + hotplug_detectable connect disconnect + + The flags have the following meanings in drm_crtc_helper.c: + + hotplug_detectable: + always attempt to detect connection status upon poll + don't automatically set up another poll of connector + + connect: + attempt to detect "connect" events + automatically set up another poll of connector + + disconnect: + attempt to detect "disconnect" events + automatically set up another poll of connector + + Clearing all three flags will disable any detection actions + being taken for that connector during the 0.1 Hz poll.