Skip to content

Commit b72651d

Browse files
committed
feat(linux): Document gamma correction feature
Add gamma correction feature supported by DSS. Signed-off-by: Swamil Jain <s-jain1@ti.com>
1 parent 8db942b commit b72651d

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed
3.48 MB
Loading
4.44 MB
Loading

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

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,18 +716,60 @@ Taking as an input a video frame of dimensions ``1000x1000``,the example creates
716716

717717
.. code-block:: console
718718
719-
$ kmstest -c hdmi -p 0:500,200-800x800 -f 1000x1000 -v 200,100-800x800
719+
$ kmstest -c hdmi -p 0:500,200-800x800 -f 1000x1000 -v 200,100-800x800
720720
Connector 1/@50: HDMI-A-1
721721
Crtc 1/@48: 1920x1080@59.93 138.500 1920/48/32/80/+ 1080/3/5/23/- 60 (59.93) 0x9 0x48
722722
Plane 0/@31: 500,200-800x800
723723
Fb 54 1000x1000-XR24
724724
725-
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.
725+
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.
726726

727727
.. figure:: /images/DSS_cropping_example_3.jpg
728728
:height: 600
729729
:width: 1020
730730

731+
- **Gamma Correction**
732+
733+
Gamma correction or gamma is used to adjust the brightness and color of images on a display. It is applied to ensure that the image appears as intended, with accurate brightness and color representation. Displays, such as LCDs and OLEDs, do not respond linearly to input signals. This means that the display's brightness does not increase linearly with the input voltage. Gamma correction compensates for this non-linear response by applying a non-linear transformation to the input signal. Gamma correction is typically applied using a look-up table (LUT) or a mathematical formula. The LUT or formula maps the input pixel values to output values that have been adjusted to compensate for the display’s non-linear response. DSS7 uses a look-up table for gamma correction. The gamma correction curve is usually represented by a power-law function, where the output value is proportional to the input value raised to a power.
734+
735+
.. math::
736+
737+
V_{out} = AV_{in}^\gamma
738+
739+
To show the effects of Gamma Correction, we have used a script(`<https://github.com/tomba/kmsxx/blob/master/py/tests/gamma.py>`__) that can be used directly from user-space. The script creates and sets the gamma look-up table using gamma value as 2.2. To use the script, first weston/display-manager should be stopped, see :ref:`stopping-weston`.
740+
741+
.. code-block:: console
742+
743+
$ systemctl stop display-manager
744+
745+
Now, save the script and run it.
746+
747+
.. code-block:: console
748+
749+
$ python3 gamma.py
750+
press enter to apply gamma
751+
752+
press enter to remove gamma
753+
754+
press enter to exit
755+
756+
Below is the test pattern image with gamma correction applied
757+
758+
.. figure:: /images/DSS_example_with_gamma.jpg
759+
:height: 670
760+
:width: 1020
761+
762+
Below is the test pattern image without gamma correction
763+
764+
.. figure:: /images/DSS_example_without_gamma.jpg
765+
:height: 670
766+
:width: 1020
767+
768+
For further information on gamma correction:
769+
770+
* `<https://www.w3.org/TR/PNG-GammaAppendix.html>`__
771+
* `<https://www.benq.com/en-us/knowledge-center/knowledge/gamma-monitor.html>`__
772+
731773
Buffers
732774
-------
733775

0 commit comments

Comments
 (0)