Skip to content

Commit 7728e73

Browse files
Devarsh Thakkarcshilwant
authored andcommitted
feat(DSS7): Document SELF_REFRESH and ALWAYS_ON_DISPLAY properties
Add the SELF_REFRESH (plane) and ALWAYS_ON_DISPLAY (crtc) DRM properties to the tidss properties table, along with usage sections describing their behaviour and modetest examples, following the format used for the other documented properties. Signed-off-by: Devarsh Thakkar <devarsht@ti.com>
1 parent fbb9d70 commit 7728e73

2 files changed

Lines changed: 227 additions & 12 deletions

File tree

  • .github/styles/config/vocabularies/PSDK
  • source/linux/Foundational_Components/Kernel/Kernel_Drivers/Display

.github/styles/config/vocabularies/PSDK/accept.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Zink
2727
[Cc]odec
2828
[Dd]unfell
2929
[Ee]thernet
30-
[Ff]ramebuffer
30+
[Ff]ramebuffers?
3131
[Kk]eywriter
3232
[Kk]irkstone
3333
[Mm]ulticast

source/linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7.rst

Lines changed: 226 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,24 @@ In addition to the SoC's DSS, boards often contain external display bridges (for
2727

2828
.. ifconfig:: CONFIG_part_variant in ('J721E', 'J721S2', 'J784S4','J742S2')
2929

30-
.. Image:: /images/DSS7_HW.png
30+
.. figure:: /images/DSS7_HW.png
3131

32-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM65X', 'AM62AX', 'AM62PX', 'J722S')
32+
Overview of DSS Hardware
3333

34-
.. Image:: /images/DSS7Lite_HW.png
34+
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM65X', 'AM62AX', 'AM62PX', 'J722S')
3535

36+
.. figure:: /images/DSS7Lite_HW.png
3637

37-
The above image gives an overview of the DSS hardware.
38+
Overview of DSS Hardware
3839

3940
.. ifconfig:: CONFIG_part_variant in ('AM62PX', 'J722S')
4041

4142
- The |__PART_FAMILY_NAME__| SoC has 2 instances of the DSS7-UL, connected to different display peripherals, inside the SoC.
4243
- **Note:** The Video Pipelines from one instance of DSS **cannot** overlay image planes via the Overlay Managers of another DSS.
4344

44-
The arrows show how pipelines are connected to overlay managers, which are further connected to video-ports, which finally create an encoded pixel stream for display on the LCD or monitor.
45+
.. ifconfig:: CONFIG_part_variant in ('J721E', 'J721S2', 'J784S4', 'J742S2', 'AM62X', 'AM65X', 'AM62AX', 'AM62PX', 'J722S')
46+
47+
The arrows show how pipelines are connected to overlay managers, which are further connected to video-ports, which finally create an encoded pixel stream for display on the LCD or monitor.
4548

4649
.. ifconfig:: CONFIG_part_variant in ('AM62AX')
4750

@@ -239,7 +242,7 @@ The mapping of DRM entities to DSS hardware is roughly as follows:
239242
+===========+================================+
240243
| plane | DSS pipeline |
241244
+-----------+--------------------------------+
242-
| crtc | DSS videoport |
245+
| CRTC | DSS videoport |
243246
+-----------+--------------------------------+
244247
| encoder | Internal and external bridges |
245248
+-----------+--------------------------------+
@@ -502,11 +505,17 @@ tidss supports configuration via DRM properties. These are standard DRM properti
502505
+--------------------+----------+------------------------------------------------------------------------------------------------------+
503506
| alpha | plane | Full plane alpha-blending |
504507
+--------------------+----------+------------------------------------------------------------------------------------------------------+
505-
| CTM | crtc | Color Transformation Matrix blob property. Implemented trough Color phase rotation matrix in DSS IP. |
508+
| CTM | CRTC | Color Transformation Matrix blob property. Implemented trough Color phase rotation matrix in DSS IP. |
509+
+--------------------+----------+------------------------------------------------------------------------------------------------------+
510+
| GAMMA_LUT | CRTC | Blob property to set the gamma lookup table (LUT) mapping pixel data sent to the connector. |
511+
+--------------------+----------+------------------------------------------------------------------------------------------------------+
512+
| GAMMA_LUT_SIZE | CRTC | Number of elements in gammma lookup table. |
506513
+--------------------+----------+------------------------------------------------------------------------------------------------------+
507-
| GAMMA_LUT | crtc | Blob property to set the gamma lookup table (LUT) mapping pixel data sent to the connector. |
514+
| SELF_REFRESH | plane | Boolean property. When set, plays the last displayed frame in a loop from the DSS internal buffer; |
515+
| | | the driver ignores new framebuffers submitted by userspace until userspace clears the property. |
508516
+--------------------+----------+------------------------------------------------------------------------------------------------------+
509-
| GAMMA_LUT_SIZE | crtc | Number of elements in gammma lookup table. |
517+
| ALWAYS_ON_DISPLAY | CRTC | Boolean property. When set, keeps the video port, along with its associated bridges and PHYs, |
518+
| | | powered on even after the last DRM client exits. |
510519
+--------------------+----------+------------------------------------------------------------------------------------------------------+
511520

512521
.. _testing_tidss_properties:
@@ -633,7 +642,7 @@ hence plane 41 remains unused.
633642
setting mode 1920x1200-60.00Hz on connectors 40, crtc 38
634643
testing 1280x720@XR24 overlay plane 41
635644
636-
In this example, we use the primary plane via its connector and crtc using the ``-s`` option.
645+
In this example, we use the primary plane via its connector and CRTC using the ``-s`` option.
637646
``-s 40@38:1920x1200`` renders vertical color bars on the LVDS display. Adding the ``-P`` option,
638647
``-P 41@38:1280x720``, renders another frame of color bars (diagonal in this case) of resolution
639648
1280x720. The ``-w 41:zpos:1`` ensures that the plane 41 is displayed on top of plane 31 (or else,
@@ -770,15 +779,221 @@ For further information on gamma correction:
770779
* `<https://www.w3.org/TR/PNG-GammaAppendix.html>`__
771780
* `<https://www.benq.com/en-us/knowledge-center/knowledge/gamma-monitor.html>`__
772781

782+
.. rubric:: Self Refresh
783+
784+
Self refresh plays the last displayed frame in a loop by using the DSS internal buffer.
785+
786+
The ``SELF_REFRESH`` plane property is a boolean property. When userspace sets it
787+
to 1, the DSS hardware loops the last frame the plane received from its internal
788+
buffer. The driver silently ignores any new framebuffer that userspace submits
789+
while the property remains set. The display resumes normal operation, taking new
790+
framebuffers into account, only after userspace clears the property (sets it back
791+
to 0).
792+
793+
The size of this internal buffer varies per SoC family, and therefore so does the
794+
maximum frame size (width x height x bytes-per-pixel) that self-refresh can loop:
795+
796+
+----------------------------------+-----------------------------------+
797+
| SoC Family | Self-Refresh Internal Buffer Size |
798+
+==================================+===================================+
799+
| AM65X | 40 KB |
800+
+----------------------------------+-----------------------------------+
801+
| AM62X | 40 KB |
802+
+----------------------------------+-----------------------------------+
803+
| AM62AX | 40 KB |
804+
+----------------------------------+-----------------------------------+
805+
| AM62PX / J722S | 40 KB |
806+
+----------------------------------+-----------------------------------+
807+
| AM62LX | 20 KB |
808+
+----------------------------------+-----------------------------------+
809+
| J721E / J721S2 / J784S4 / J742S2 | 64 KB |
810+
+----------------------------------+-----------------------------------+
811+
812+
If the frame exceeds the internal buffer size for the given SoC, the
813+
``SELF_REFRESH`` property still reads back as 1, but the driver does not switch
814+
that plane into self-refresh hardware mode. The plane keeps displaying live
815+
content as normal; nothing goes blank or freezes. To make self-refresh take
816+
effect, reduce the plane's resolution or pixel format so the frame fits within
817+
the internal buffer size. The driver then activates self-refresh automatically
818+
on the next commit, without needing to clear and re-set the property.
819+
820+
.. code-block:: console
821+
822+
$ modetest -M tidss -w 35:SELF_REFRESH:1
823+
824+
In this example, ``SELF_REFRESH`` is enabled on plane 35. The plane keeps displaying
825+
whatever frame was on screen when userspace set the property. The driver drops any
826+
later frame that an application pushes to the plane while the property remains set.
827+
The combined example under **Always On Display** below shows how ``kmstest``
828+
exercises ``SELF_REFRESH`` together with ``ALWAYS_ON_DISPLAY``.
829+
830+
.. rubric:: Always On Display
831+
832+
Keep the display pipeline powered after the application exits. With additional
833+
firmware-side support, the pipeline also stays powered across system suspend and
834+
resume; see the note that follows.
835+
836+
The ``ALWAYS_ON_DISPLAY`` CRTC property is a boolean property. When set to 1, the
837+
driver keeps the video port's power domain powered, along with the power domains
838+
of its bridges and PHYs (for example DSI and D-PHY). This holds for that video
839+
port's entire pipeline even after the last DRM client that uses the CRTC exits,
840+
and across system suspend and resume. This avoids incurring the cost of hardware
841+
reinitialization of the DSI and D-PHY link the next time an application opens the
842+
device, at the cost of keeping that hardware powered while idle.
843+
844+
The driver uses two separate mechanisms to keep tidss and every bridge/PHY device
845+
in the pipeline powered:
846+
847+
- ``pm_runtime_get_noresume()`` on each device, which prevents its runtime PM
848+
``suspend`` callback from running and therefore blocks runtime autosuspend for
849+
tidss itself, not only the external bridges/PHYs.
850+
- ``dev_pm_genpd_set_always_on()``, which marks the device's power domain as
851+
always-on, blocking both runtime power-off and the power-off that would
852+
otherwise happen when the system suspends.
853+
854+
The driver removes both mechanisms once userspace clears ``ALWAYS_ON_DISPLAY`` on
855+
all CRTCs that had it set.
856+
857+
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
858+
859+
.. note::
860+
861+
Keeping the display pipeline powered across the Linux driver's own suspend and resume
862+
calls is handled entirely by the ``ALWAYS_ON_DISPLAY`` property as described above.
863+
However, surviving an actual system-wide low power state (for example
864+
``echo mem > /sys/power/state``) additionally requires cooperation from the
865+
device firmware, which must also be told to keep the display power rails on
866+
during that low power state. This firmware-side support is available on
867+
AM62LX as the :ref:`dss-plus-deepsleep` low power mode.
868+
869+
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
870+
871+
.. note::
872+
873+
Keeping the display pipeline powered across the Linux driver's own suspend/resume
874+
calls is handled entirely by the ``ALWAYS_ON_DISPLAY`` property as described above.
875+
However, surviving an actual system-wide low power state (for example
876+
``echo mem > /sys/power/state``) additionally requires cooperation from the
877+
device firmware, which must also be told to keep the display power rails on
878+
during that low power state. This firmware-side support is only available on
879+
the AM62LX SoC and no other SoC supports it. For other SoCs,
880+
``ALWAYS_ON_DISPLAY`` keeps the pipeline powered across application handoff,
881+
thus avoiding runtime suspend even if no application is holding a reference,
882+
but the display should be assumed to lose power during a full system
883+
suspend and resume cycle.
884+
885+
.. code-block:: console
886+
887+
$ modetest -M tidss -w 42:ALWAYS_ON_DISPLAY:1
888+
889+
In this example, CRTC 42 has ``ALWAYS_ON_DISPLAY`` set to 1. Once the application
890+
that uses this CRTC exits, the video port and its associated bridge/PHY power
891+
domains remain powered on, so a later application can reuse the pipeline without
892+
incurring the cost of hardware reinitialization of the DSI and D-PHY link.
893+
894+
When ``ALWAYS_ON_DISPLAY`` is combined with ``SELF_REFRESH`` on a plane of the same
895+
CRTC, the video port itself is also kept running (instead of being disabled) once
896+
the application exits, so the frame looped by ``SELF_REFRESH`` continues to be
897+
displayed even after application handoff or system suspend/resume.
898+
899+
To keep the frame looped by ``SELF_REFRESH`` displayed even after application
900+
handoff or system suspend and resume, set ``ALWAYS_ON_DISPLAY`` and
901+
``SELF_REFRESH`` on the same CRTC. This keeps the video port running after the
902+
application exits.
903+
904+
.. code-block:: console
905+
906+
$ modetest -M tidss -w 42:ALWAYS_ON_DISPLAY:1
907+
$ modetest -M tidss -w 35:SELF_REFRESH:1
908+
$ kmstest --flip
909+
910+
In this combined example, CRTC 42 has ``ALWAYS_ON_DISPLAY`` set and plane 35
911+
(belonging to that CRTC) has ``SELF_REFRESH`` set. ``kmstest --flip`` is then
912+
run to exercise page-flipping on the display. While ``SELF_REFRESH`` remains
913+
set, new frames that ``kmstest`` presents get dropped by the driver. The plane
914+
will instead continue looping the earlier frame. This will continue even after
915+
``kmstest`` exits because the video port is not torn down.
916+
773917
Buffers
774918
-------
775919

776920
The buffers used for tidss can be either allocated from tidss or imported from some other driver (dmabuf import). All buffers must be contiguous.
777-
778921
tidss supports generic DRM dumb buffers. Dumb buffers are allocated using the generic DRM_IOCTL_MODE_CREATE_DUMB ioctl.
779922

780923

781924
fbdev emulation (/dev/fb0)
782925
--------------------------
783926

784927
DRM framework supports "emulating" the legacy fbdev API. This feature can be enabled or disabled in the kernel config (CONFIG_DRM_FBDEV_EMULATION). The fbdev emulation offers only basic feature set and the fb is shown on the first display. Fbdev emulation is mainly intended for kernel console or boot splash screens.
928+
929+
930+
Abbreviations
931+
=============
932+
933+
+-----------------+--------------------------------------------------------------+
934+
| Abbreviation | Description |
935+
+=================+==============================================================+
936+
| DSS | Display SubSystem |
937+
+-----------------+--------------------------------------------------------------+
938+
| DISPC | Display Controller |
939+
+-----------------+--------------------------------------------------------------+
940+
| DRM | Direct Rendering Manager |
941+
+-----------------+--------------------------------------------------------------+
942+
| KMS | Kernel Mode Setting |
943+
+-----------------+--------------------------------------------------------------+
944+
| CRTC | CRT Controller (represents a display pipeline's timing and |
945+
| | scanout engine in the DRM/KMS model) |
946+
+-----------------+--------------------------------------------------------------+
947+
| VP | Video Port |
948+
+-----------------+--------------------------------------------------------------+
949+
| VID / VIDL | Video pipeline types; VID pipelines support scaling, VIDL |
950+
| | pipelines do not |
951+
+-----------------+--------------------------------------------------------------+
952+
| DPI | Display Parallel Interface |
953+
+-----------------+--------------------------------------------------------------+
954+
| DSI | Display Serial Interface (MIPI DSI) |
955+
+-----------------+--------------------------------------------------------------+
956+
| MIPI | Mobile Industry Processor Interface |
957+
+-----------------+--------------------------------------------------------------+
958+
| OLDI | Open LVDS Display Interface |
959+
+-----------------+--------------------------------------------------------------+
960+
| LVDS | Low-Voltage Differential Signaling |
961+
+-----------------+--------------------------------------------------------------+
962+
| DP | DisplayPort |
963+
+-----------------+--------------------------------------------------------------+
964+
| SST | Single-Stream Transport (DisplayPort mode) |
965+
+-----------------+--------------------------------------------------------------+
966+
| MST | Multi-Stream Transport (DisplayPort mode) |
967+
+-----------------+--------------------------------------------------------------+
968+
| HDMI | High-Definition Multimedia Interface |
969+
+-----------------+--------------------------------------------------------------+
970+
| MHDP | Multi-Host DisplayPort controller IP (Cadence) |
971+
+-----------------+--------------------------------------------------------------+
972+
| PHY | Physical layer transceiver |
973+
+-----------------+--------------------------------------------------------------+
974+
| GPU | Graphics Processing Unit |
975+
+-----------------+--------------------------------------------------------------+
976+
| LUT | Look-Up Table |
977+
+-----------------+--------------------------------------------------------------+
978+
| RGB | Red-Green-Blue color format |
979+
+-----------------+--------------------------------------------------------------+
980+
| YCbCr | Luma, blue-difference, red-difference chroma color format |
981+
+-----------------+--------------------------------------------------------------+
982+
| BT.601 / BT.709 | ITU-R color encoding standards for YCbCr conversion |
983+
+-----------------+--------------------------------------------------------------+
984+
| DMA | Direct Memory Access |
985+
+-----------------+--------------------------------------------------------------+
986+
| FB | Framebuffer |
987+
+-----------------+--------------------------------------------------------------+
988+
| IP | Intellectual Property (a reusable hardware block) |
989+
+-----------------+--------------------------------------------------------------+
990+
| EVM | Evaluation Module |
991+
+-----------------+--------------------------------------------------------------+
992+
| SK | Starter Kit |
993+
+-----------------+--------------------------------------------------------------+
994+
| DT | Device Tree |
995+
+-----------------+--------------------------------------------------------------+
996+
| PM | Power Management |
997+
+-----------------+--------------------------------------------------------------+
998+
| V4L2 | Video for Linux 2 (Linux media/video capture API) |
999+
+-----------------+--------------------------------------------------------------+

0 commit comments

Comments
 (0)