Skip to content

Commit 08632d6

Browse files
s-jain1jainswamil
authored andcommitted
docs(linux): Add documentation regaring DSS feature: cropping
This documentation includes examples showing the cropped part of a frame. Signed-off-by: Swamil Jain <[email protected]>
1 parent 1de18d4 commit 08632d6

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed
130 KB
Loading
119 KB
Loading
136 KB
Loading

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

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ libdrm is included in TI releases and its sources can be found from: ::
387387

388388
https://gitlab.freedesktop.org/mesa/drm
389389

390-
libdrm also contains 'modetest' tool, which can be used to get basic information about DRM state, and to show a test pattern on a display. Refer to the section `Testing tidss properties with modetest` below for some examples.
390+
libdrm also contains 'modetest' tool, which can be used to get basic information about DRM state, and to show a test pattern on a display. Refer to the section :ref:`testing_tidss_properties` below for some examples.
391391

392392
Another option is kms++, a C++11 library for kernel mode setting which includes a bunch of test utilities and also V4L2 classes and Python bindings for DRM and V4L2. Some kms++ tools are included in TI releases. kms++ can be found from: ::
393393

@@ -490,8 +490,10 @@ tidss supports configuration via DRM properties. These are standard DRM properti
490490
| GAMMA_LUT_SIZE | crtc | Number of elements in gammma lookup table. |
491491
+--------------------+----------+------------------------------------------------------------------------------------------------------+
492492

493-
Testing tidss properties with modetest
494-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
493+
.. _testing_tidss_properties:
494+
495+
Testing tidss properties with modetest and kmstest
496+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
495497

496498
As the name suggests, ``modetest`` is DRM based mode setting test program available along with libdrm.
497499
It is an easy-to-use tool to test different features provided by display HWs. The DRM driver for,
@@ -663,6 +665,52 @@ The following example was run on DSS7-UL and hence the pipe with scaling capabil
663665
664666
Note that the ``*2`` at the end of ``-P 41@38:400x400*2`` is the scaling factor.
665667

668+
- **Cropping**
669+
670+
``kmstest`` utility can be used to demonstrate cropping in a video frame using a test pattern.
671+
The user can specify the main video frame size and an input color format using the ``-f`` argument. Then the source region, also known as a view region, can be specified using the ``-v`` argument. This takes a secondary width and height to create a rectangle starting at a given coordinate. The destination region, or plane region, for the view can be specified using ``-p`` argument. This takes a third width, height and coordinate position to place an overlay with the associated view region's content.
672+
673+
.. code-block:: console
674+
675+
$ kmstest -c hdmi -p 0:0,0-1000x1000 -f 1000x1000-XR24 -v 0,0-1000x1000
676+
Connector 1/@50: HDMI-A-1
677+
Crtc 1/@48: [email protected] 138.500 1920/48/32/80/+ 1080/3/5/23/- 60 (59.93) 0x9 0x48
678+
Plane 0/@31: 0,0-1000x1000
679+
Fb 55 1000x1000-XR24
680+
681+
The above example displays a ``1000x1000`` video frame on the screen at coordinates ``0,0``.
682+
683+
.. figure:: /images/DSS_cropping_example_1.jpg
684+
:height: 600
685+
:width: 1020
686+
687+
.. code-block:: console
688+
689+
$ kmstest -c hdmi -p 0:0,0-800x800 -f 1000x1000 -v 0,0-800x800
690+
Connector 1/@50: HDMI-A-1
691+
Crtc 1/@48: [email protected] 138.500 1920/48/32/80/+ 1080/3/5/23/- 60 (59.93) 0x9 0x48
692+
Plane 0/@31: 0,0-800x800
693+
Fb 55 1000x1000-XR24
694+
695+
Taking as an input a video frame of dimensions ``1000x1000``,the example creates a cropped source rectangle of dimensions ``800x800``, starting at coordinates ``0,0`` and displays it on screen at coordinates ``0,0``.
696+
697+
.. figure:: /images/DSS_cropping_example_2.jpg
698+
:height: 600
699+
:width: 1020
700+
701+
.. code-block:: console
702+
703+
$ kmstest -c hdmi -p 0:500,200-800x800 -f 1000x1000 -v 200,100-800x800
704+
Connector 1/@50: HDMI-A-1
705+
Crtc 1/@48: [email protected] 138.500 1920/48/32/80/+ 1080/3/5/23/- 60 (59.93) 0x9 0x48
706+
Plane 0/@31: 500,200-800x800
707+
Fb 54 1000x1000-XR24
708+
709+
Taking as an input a video frame of dimensions ``1000x1000``, this example creates a cropped source rectangle of dimensions ``800x800``, starting at coordinates ``500,200`` and displays it on screen at coordinates ``200,100`` keeping the same dimensions as source rectangle i.e ``800x800`` without scaling.
710+
711+
.. figure:: /images/DSS_cropping_example_3.jpg
712+
:height: 600
713+
:width: 1020
666714

667715
Buffers
668716
-------

0 commit comments

Comments
 (0)