XenevaOS
Loading...
Searching...
No Matches
display_timing.h
Go to the documentation of this file.
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
19
20 /* data enable flag */
23 /* drive data on pos. edge */
25 /* drive data on neg. edge */
30 /* drive sync on pos. edge */
32 /* drive sync on neg. edge */
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 */
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 */
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 */
86 unsigned int num_timings;
87 unsigned int native_mode;
88
90};
91
92/* get one entry from struct display_timings */
93static 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
104
105#endif
#define index(str, chr)
Definition string.h:66
#define NULL
Definition actypes.h:561
#define BIT(nr)
Definition bitops.h:112
void display_timings_release(struct display_timings *disp)
display_flags
Definition display_timing.h:14
@ DISPLAY_FLAGS_HSYNC_LOW
Definition display_timing.h:15
@ DISPLAY_FLAGS_PIXDATA_POSEDGE
Definition display_timing.h:24
@ DISPLAY_FLAGS_VSYNC_HIGH
Definition display_timing.h:18
@ DISPLAY_FLAGS_DOUBLECLK
Definition display_timing.h:29
@ DISPLAY_FLAGS_PIXDATA_NEGEDGE
Definition display_timing.h:26
@ DISPLAY_FLAGS_SYNC_NEGEDGE
Definition display_timing.h:33
@ DISPLAY_FLAGS_DE_LOW
Definition display_timing.h:21
@ DISPLAY_FLAGS_HSYNC_HIGH
Definition display_timing.h:16
@ DISPLAY_FLAGS_SYNC_POSEDGE
Definition display_timing.h:31
@ DISPLAY_FLAGS_DE_HIGH
Definition display_timing.h:22
@ DISPLAY_FLAGS_INTERLACED
Definition display_timing.h:27
@ DISPLAY_FLAGS_DOUBLESCAN
Definition display_timing.h:28
@ DISPLAY_FLAGS_VSYNC_LOW
Definition display_timing.h:17
uint32_t u32
Definition kernel.h:16
Definition display_timing.h:63
struct timing_entry pixelclock
Definition display_timing.h:64
struct timing_entry vfront_porch
Definition display_timing.h:72
struct timing_entry vsync_len
Definition display_timing.h:74
struct timing_entry vback_porch
Definition display_timing.h:73
struct timing_entry vactive
Definition display_timing.h:71
enum display_flags flags
Definition display_timing.h:76
struct timing_entry hsync_len
Definition display_timing.h:69
struct timing_entry hfront_porch
Definition display_timing.h:67
struct timing_entry hback_porch
Definition display_timing.h:68
struct timing_entry hactive
Definition display_timing.h:66
Definition display_timing.h:85
struct display_timing ** timings
Definition display_timing.h:89
unsigned int num_timings
Definition display_timing.h:86
unsigned int native_mode
Definition display_timing.h:87
Definition display_timing.h:40
u32 min
Definition display_timing.h:41
u32 max
Definition display_timing.h:43
u32 typ
Definition display_timing.h:42