Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
0004  *
0005  * generic videomode description
0006  */
0007 
0008 #ifndef __LINUX_VIDEOMODE_H
0009 #define __LINUX_VIDEOMODE_H
0010 
0011 #include <linux/types.h>
0012 #include <video/display_timing.h>
0013 
0014 /*
0015  * Subsystem independent description of a videomode.
0016  * Can be generated from struct display_timing.
0017  */
0018 struct videomode {
0019     unsigned long pixelclock;   /* pixelclock in Hz */
0020 
0021     u32 hactive;
0022     u32 hfront_porch;
0023     u32 hback_porch;
0024     u32 hsync_len;
0025 
0026     u32 vactive;
0027     u32 vfront_porch;
0028     u32 vback_porch;
0029     u32 vsync_len;
0030 
0031     enum display_flags flags; /* display flags */
0032 };
0033 
0034 /**
0035  * videomode_from_timing - convert display timing to videomode
0036  * @dt: display_timing structure
0037  * @vm: return value
0038  *
0039  * DESCRIPTION:
0040  * This function converts a struct display_timing to a struct videomode.
0041  */
0042 void videomode_from_timing(const struct display_timing *dt,
0043               struct videomode *vm);
0044 
0045 /**
0046  * videomode_from_timings - convert one display timings entry to videomode
0047  * @disp: structure with all possible timing entries
0048  * @vm: return value
0049  * @index: index into the list of display timings in devicetree
0050  *
0051  * DESCRIPTION:
0052  * This function converts one struct display_timing entry to a struct videomode.
0053  */
0054 int videomode_from_timings(const struct display_timings *disp,
0055               struct videomode *vm, unsigned int index);
0056 
0057 #endif