~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/video/display_timing.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
  4  *
  5  * description of display timings
  6  */
  7 
  8 #ifndef __LINUX_DISPLAY_TIMING_H
  9 #define __LINUX_DISPLAY_TIMING_H
 10 
 11 #include <linux/bitops.h>
 12 #include <linux/types.h>
 13 
 14 enum display_flags {
 15         DISPLAY_FLAGS_HSYNC_LOW         = BIT(0),
 16         DISPLAY_FLAGS_HSYNC_HIGH        = BIT(1),
 17         DISPLAY_FLAGS_VSYNC_LOW         = BIT(2),
 18         DISPLAY_FLAGS_VSYNC_HIGH        = BIT(3),
 19 
 20         /* data enable flag */
 21         DISPLAY_FLAGS_DE_LOW            = BIT(4),
 22         DISPLAY_FLAGS_DE_HIGH           = BIT(5),
 23         /* drive data on pos. edge */
 24         DISPLAY_FLAGS_PIXDATA_POSEDGE   = BIT(6),
 25         /* drive data on neg. edge */
 26         DISPLAY_FLAGS_PIXDATA_NEGEDGE   = BIT(7),
 27         DISPLAY_FLAGS_INTERLACED        = BIT(8),
 28         DISPLAY_FLAGS_DOUBLESCAN        = BIT(9),
 29         DISPLAY_FLAGS_DOUBLECLK         = BIT(10),
 30         /* drive sync on pos. edge */
 31         DISPLAY_FLAGS_SYNC_POSEDGE      = BIT(11),
 32         /* drive sync on neg. edge */
 33         DISPLAY_FLAGS_SYNC_NEGEDGE      = BIT(12),
 34 };
 35 
 36 /*
 37  * A single signal can be specified via a range of minimal and maximal values
 38  * with a typical value, that lies somewhere inbetween.
 39  */
 40 struct timing_entry {
 41         u32 min;
 42         u32 typ;
 43         u32 max;
 44 };
 45 
 46 /*
 47  * Single "mode" entry. This describes one set of signal timings a display can
 48  * have in one setting. This struct can later be converted to struct videomode
 49  * (see include/video/videomode.h). As each timing_entry can be defined as a
 50  * range, one struct display_timing may become multiple struct videomodes.
 51  *
 52  * Example: hsync active high, vsync active low
 53  *
 54  *                                  Active Video
 55  * Video  ______________________XXXXXXXXXXXXXXXXXXXXXX_____________________
 56  *        |<- sync ->|<- back ->|<----- active ----->|<- front ->|<- sync..
 57  *        |          |   porch  |                    |   porch   |
 58  *
 59  * HSync _|¯¯¯¯¯¯¯¯¯¯|___________________________________________|¯¯¯¯¯¯¯¯¯
 60  *
 61  * VSync ¯|__________|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|_________
 62  */
 63 struct display_timing {
 64         struct timing_entry pixelclock;
 65 
 66         struct timing_entry hactive;            /* hor. active video */
 67         struct timing_entry hfront_porch;       /* hor. front porch */
 68         struct timing_entry hback_porch;        /* hor. back porch */
 69         struct timing_entry hsync_len;          /* hor. sync len */
 70 
 71         struct timing_entry vactive;            /* ver. active video */
 72         struct timing_entry vfront_porch;       /* ver. front porch */
 73         struct timing_entry vback_porch;        /* ver. back porch */
 74         struct timing_entry vsync_len;          /* ver. sync len */
 75 
 76         enum display_flags flags;               /* display flags */
 77 };
 78 
 79 /*
 80  * This describes all timing settings a display provides.
 81  * The native_mode is the default setting for this display.
 82  * Drivers that can handle multiple videomodes should work with this struct and
 83  * convert each entry to the desired end result.
 84  */
 85 struct display_timings {
 86         unsigned int num_timings;
 87         unsigned int native_mode;
 88 
 89         struct display_timing **timings;
 90 };
 91 
 92 /* get one entry from struct display_timings */
 93 static inline struct display_timing *display_timings_get(const struct
 94                                                          display_timings *disp,
 95                                                          unsigned int index)
 96 {
 97         if (disp->num_timings > index)
 98                 return disp->timings[index];
 99         else
100                 return NULL;
101 }
102 
103 void display_timings_release(struct display_timings *disp);
104 
105 #endif
106 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php