Skip to content

Commit 73622dd

Browse files
s-jain1praneethbajjuri
authored andcommitted
feat(linux): Document gamma correction feature
Add gamma correction feature supported by DSS. Signed-off-by: Swamil Jain <[email protected]>
1 parent 3130224 commit 73622dd

File tree

3 files changed

+40
-2
lines changed

3 files changed

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

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

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,18 +716,56 @@ 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: [email protected] 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+
Now, save the script and run it.
742+
743+
.. code-block:: console
744+
745+
$ python3 gamma.py
746+
press enter to apply gamma
747+
748+
press enter to remove gamma
749+
750+
press enter to exit
751+
752+
Below is the test pattern image with gamma correction applied
753+
754+
.. figure:: /images/DSS_example_with_gamma.jpg
755+
:height: 670
756+
:width: 1020
757+
758+
Below is the test pattern image without gamma correction
759+
760+
.. figure:: /images/DSS_example_without_gamma.jpg
761+
:height: 670
762+
:width: 1020
763+
764+
For further information on gamma correction:
765+
766+
* `<https://www.w3.org/TR/PNG-GammaAppendix.html>`__
767+
* `<https://www.benq.com/en-us/knowledge-center/knowledge/gamma-monitor.html>`__
768+
731769
Buffers
732770
-------
733771

0 commit comments

Comments
 (0)