blob: fed9fe81590c2855750cf34230bdae55d5b541da [file] [log] [blame]
Daniel Vetter55310002014-01-23 15:52:20 +01001/*
2 * Copyright © 2006 Keith Packard
3 * Copyright © 2007-2008 Dave Airlie
4 * Copyright © 2007-2008 Intel Corporation
5 * Jesse Barnes <jesse.barnes@intel.com>
6 * Copyright © 2014 Intel Corporation
7 * Daniel Vetter <daniel.vetter@ffwll.ch>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */
27#ifndef __DRM_MODES_H__
28#define __DRM_MODES_H__
29
Daniel Vetter7520a272016-08-15 16:07:02 +020030#include <drm/drm_modeset.h>
31
Daniel Vetter55310002014-01-23 15:52:20 +010032/*
33 * Note on terminology: here, for brevity and convenience, we refer to connector
34 * control chips as 'CRTCs'. They can control any type of connector, VGA, LVDS,
35 * DVI, etc. And 'screen' refers to the whole of the visible display, which
36 * may span multiple monitors (and therefore multiple CRTC and connector
37 * structures).
38 */
39
Daniel Vetter30ecad72015-12-09 09:29:36 +010040/**
41 * enum drm_mode_status - hardware support status of a mode
42 * @MODE_OK: Mode OK
43 * @MODE_HSYNC: hsync out of range
44 * @MODE_VSYNC: vsync out of range
45 * @MODE_H_ILLEGAL: mode has illegal horizontal timings
46 * @MODE_V_ILLEGAL: mode has illegal horizontal timings
47 * @MODE_BAD_WIDTH: requires an unsupported linepitch
48 * @MODE_NOMODE: no mode with a matching name
49 * @MODE_NO_INTERLACE: interlaced mode not supported
50 * @MODE_NO_DBLESCAN: doublescan mode not supported
51 * @MODE_NO_VSCAN: multiscan mode not supported
52 * @MODE_MEM: insufficient video memory
53 * @MODE_VIRTUAL_X: mode width too large for specified virtual size
54 * @MODE_VIRTUAL_Y: mode height too large for specified virtual size
55 * @MODE_MEM_VIRT: insufficient video memory given virtual size
56 * @MODE_NOCLOCK: no fixed clock available
57 * @MODE_CLOCK_HIGH: clock required is too high
58 * @MODE_CLOCK_LOW: clock required is too low
59 * @MODE_CLOCK_RANGE: clock/mode isn't in a ClockRange
60 * @MODE_BAD_HVALUE: horizontal timing was out of range
61 * @MODE_BAD_VVALUE: vertical timing was out of range
62 * @MODE_BAD_VSCAN: VScan value out of range
63 * @MODE_HSYNC_NARROW: horizontal sync too narrow
64 * @MODE_HSYNC_WIDE: horizontal sync too wide
65 * @MODE_HBLANK_NARROW: horizontal blanking too narrow
66 * @MODE_HBLANK_WIDE: horizontal blanking too wide
67 * @MODE_VSYNC_NARROW: vertical sync too narrow
68 * @MODE_VSYNC_WIDE: vertical sync too wide
69 * @MODE_VBLANK_NARROW: vertical blanking too narrow
70 * @MODE_VBLANK_WIDE: vertical blanking too wide
71 * @MODE_PANEL: exceeds panel dimensions
72 * @MODE_INTERLACE_WIDTH: width too large for interlaced mode
73 * @MODE_ONE_WIDTH: only one width is supported
74 * @MODE_ONE_HEIGHT: only one height is supported
75 * @MODE_ONE_SIZE: only one resolution is supported
76 * @MODE_NO_REDUCED: monitor doesn't accept reduced blanking
77 * @MODE_NO_STEREO: stereo modes not supported
Ville Syrjälä5ba89402015-12-10 22:39:08 +020078 * @MODE_STALE: mode has become stale
Daniel Vetter30ecad72015-12-09 09:29:36 +010079 * @MODE_BAD: unspecified reason
80 * @MODE_ERROR: error condition
81 *
82 * This enum is used to filter out modes not supported by the driver/hardware
83 * combination.
84 */
Daniel Vetter55310002014-01-23 15:52:20 +010085enum drm_mode_status {
Daniel Vetter30ecad72015-12-09 09:29:36 +010086 MODE_OK = 0,
87 MODE_HSYNC,
88 MODE_VSYNC,
89 MODE_H_ILLEGAL,
90 MODE_V_ILLEGAL,
91 MODE_BAD_WIDTH,
92 MODE_NOMODE,
93 MODE_NO_INTERLACE,
94 MODE_NO_DBLESCAN,
95 MODE_NO_VSCAN,
96 MODE_MEM,
97 MODE_VIRTUAL_X,
98 MODE_VIRTUAL_Y,
99 MODE_MEM_VIRT,
100 MODE_NOCLOCK,
101 MODE_CLOCK_HIGH,
102 MODE_CLOCK_LOW,
103 MODE_CLOCK_RANGE,
104 MODE_BAD_HVALUE,
105 MODE_BAD_VVALUE,
106 MODE_BAD_VSCAN,
107 MODE_HSYNC_NARROW,
108 MODE_HSYNC_WIDE,
109 MODE_HBLANK_NARROW,
110 MODE_HBLANK_WIDE,
111 MODE_VSYNC_NARROW,
112 MODE_VSYNC_WIDE,
113 MODE_VBLANK_NARROW,
114 MODE_VBLANK_WIDE,
115 MODE_PANEL,
116 MODE_INTERLACE_WIDTH,
117 MODE_ONE_WIDTH,
118 MODE_ONE_HEIGHT,
119 MODE_ONE_SIZE,
120 MODE_NO_REDUCED,
121 MODE_NO_STEREO,
Ville Syrjälä5ba89402015-12-10 22:39:08 +0200122 MODE_STALE = -3,
Daniel Vetter30ecad72015-12-09 09:29:36 +0100123 MODE_BAD = -2,
124 MODE_ERROR = -1
Daniel Vetter55310002014-01-23 15:52:20 +0100125};
126
127#define DRM_MODE_TYPE_CLOCK_CRTC_C (DRM_MODE_TYPE_CLOCK_C | \
128 DRM_MODE_TYPE_CRTC_C)
129
130#define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \
131 .name = nm, .status = 0, .type = (t), .clock = (c), \
132 .hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
133 .htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
134 .vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
135 .vscan = (vs), .flags = (f), \
136 .base.type = DRM_MODE_OBJECT_MODE
137
138#define CRTC_INTERLACE_HALVE_V (1 << 0) /* halve V values for interlacing */
139#define CRTC_STEREO_DOUBLE (1 << 1) /* adjust timings for stereo modes */
Gustavo Padovanecb7e162014-12-01 15:40:09 -0800140#define CRTC_NO_DBLSCAN (1 << 2) /* don't adjust doublescan */
141#define CRTC_NO_VSCAN (1 << 3) /* don't adjust doublescan */
Damien Lespiau498b8732015-02-16 15:12:31 +0000142#define CRTC_STEREO_DOUBLE_ONLY (CRTC_STEREO_DOUBLE | CRTC_NO_DBLSCAN | CRTC_NO_VSCAN)
Daniel Vetter55310002014-01-23 15:52:20 +0100143
144#define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF
145
Daniel Vetter30ecad72015-12-09 09:29:36 +0100146/**
147 * struct drm_display_mode - DRM kernel-internal display mode structure
148 * @hdisplay: horizontal display size
149 * @hsync_start: horizontal sync start
150 * @hsync_end: horizontal sync end
151 * @htotal: horizontal total size
152 * @hskew: horizontal skew?!
153 * @vdisplay: vertical display size
154 * @vsync_start: vertical sync start
155 * @vsync_end: vertical sync end
156 * @vtotal: vertical total size
157 * @vscan: vertical scan?!
158 * @crtc_hdisplay: hardware mode horizontal display size
159 * @crtc_hblank_start: hardware mode horizontal blank start
160 * @crtc_hblank_end: hardware mode horizontal blank end
161 * @crtc_hsync_start: hardware mode horizontal sync start
162 * @crtc_hsync_end: hardware mode horizontal sync end
163 * @crtc_htotal: hardware mode horizontal total size
164 * @crtc_hskew: hardware mode horizontal skew?!
165 * @crtc_vdisplay: hardware mode vertical display size
166 * @crtc_vblank_start: hardware mode vertical blank start
167 * @crtc_vblank_end: hardware mode vertical blank end
168 * @crtc_vsync_start: hardware mode vertical sync start
169 * @crtc_vsync_end: hardware mode vertical sync end
170 * @crtc_vtotal: hardware mode vertical total size
171 *
172 * The horizontal and vertical timings are defined per the following diagram.
173 *
Daniel Vetterda5335b2016-05-31 22:55:13 +0200174 * ::
175 *
Daniel Vetter30ecad72015-12-09 09:29:36 +0100176 *
177 * Active Front Sync Back
178 * Region Porch Porch
179 * <-----------------------><----------------><-------------><-------------->
180 * //////////////////////|
181 * ////////////////////// |
182 * ////////////////////// |.................. ................
183 * _______________
184 * <----- [hv]display ----->
185 * <------------- [hv]sync_start ------------>
186 * <--------------------- [hv]sync_end --------------------->
187 * <-------------------------------- [hv]total ----------------------------->*
188 *
189 * This structure contains two copies of timings. First are the plain timings,
190 * which specify the logical mode, as it would be for a progressive 1:1 scanout
191 * at the refresh rate userspace can observe through vblank timestamps. Then
192 * there's the hardware timings, which are corrected for interlacing,
193 * double-clocking and similar things. They are provided as a convenience, and
194 * can be appropriately computed using drm_mode_set_crtcinfo().
195 */
Daniel Vetter55310002014-01-23 15:52:20 +0100196struct drm_display_mode {
Daniel Vetter30ecad72015-12-09 09:29:36 +0100197 /**
198 * @head:
199 *
200 * struct list_head for mode lists.
201 */
Daniel Vetter55310002014-01-23 15:52:20 +0100202 struct list_head head;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100203
204 /**
205 * @base:
206 *
207 * A display mode is a normal modeset object, possibly including public
208 * userspace id.
209 *
210 * FIXME:
211 *
212 * This can probably be removed since the entire concept of userspace
213 * managing modes explicitly has never landed in upstream kernel mode
214 * setting support.
215 */
Daniel Vetter55310002014-01-23 15:52:20 +0100216 struct drm_mode_object base;
217
Daniel Vetter30ecad72015-12-09 09:29:36 +0100218 /**
219 * @name:
220 *
221 * Human-readable name of the mode, filled out with drm_mode_set_name().
222 */
Daniel Vetter55310002014-01-23 15:52:20 +0100223 char name[DRM_DISPLAY_MODE_LEN];
224
Daniel Vetter30ecad72015-12-09 09:29:36 +0100225 /**
226 * @status:
227 *
228 * Status of the mode, used to filter out modes not supported by the
229 * hardware. See enum &drm_mode_status.
230 */
Daniel Vetter55310002014-01-23 15:52:20 +0100231 enum drm_mode_status status;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100232
233 /**
234 * @type:
235 *
236 * A bitmask of flags, mostly about the source of a mode. Possible flags
237 * are:
238 *
239 * - DRM_MODE_TYPE_BUILTIN: Meant for hard-coded modes, effectively
240 * unused.
241 * - DRM_MODE_TYPE_PREFERRED: Preferred mode, usually the native
242 * resolution of an LCD panel. There should only be one preferred
243 * mode per connector at any given time.
244 * - DRM_MODE_TYPE_DRIVER: Mode created by the driver, which is all of
245 * them really. Drivers must set this bit for all modes they create
246 * and expose to userspace.
247 *
248 * Plus a big list of flags which shouldn't be used at all, but are
249 * still around since these flags are also used in the userspace ABI:
250 *
251 * - DRM_MODE_TYPE_DEFAULT: Again a leftover, use
252 * DRM_MODE_TYPE_PREFERRED instead.
253 * - DRM_MODE_TYPE_CLOCK_C and DRM_MODE_TYPE_CRTC_C: Define leftovers
254 * which are stuck around for hysterical raisins only. No one has an
255 * idea what they were meant for. Don't use.
256 * - DRM_MODE_TYPE_USERDEF: Mode defined by userspace, again a vestige
257 * from older kms designs where userspace had to first add a custom
258 * mode to the kernel's mode list before it could use it. Don't use.
259 */
Daniel Vetter55310002014-01-23 15:52:20 +0100260 unsigned int type;
261
Daniel Vetter30ecad72015-12-09 09:29:36 +0100262 /**
263 * @clock:
264 *
265 * Pixel clock in kHz.
266 */
Daniel Vetter55310002014-01-23 15:52:20 +0100267 int clock; /* in kHz */
268 int hdisplay;
269 int hsync_start;
270 int hsync_end;
271 int htotal;
272 int hskew;
273 int vdisplay;
274 int vsync_start;
275 int vsync_end;
276 int vtotal;
277 int vscan;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100278 /**
279 * @flags:
280 *
281 * Sync and timing flags:
282 *
283 * - DRM_MODE_FLAG_PHSYNC: horizontal sync is active high.
284 * - DRM_MODE_FLAG_NHSYNC: horizontal sync is active low.
285 * - DRM_MODE_FLAG_PVSYNC: vertical sync is active high.
286 * - DRM_MODE_FLAG_NVSYNC: vertical sync is active low.
287 * - DRM_MODE_FLAG_INTERLACE: mode is interlaced.
288 * - DRM_MODE_FLAG_DBLSCAN: mode uses doublescan.
289 * - DRM_MODE_FLAG_CSYNC: mode uses composite sync.
290 * - DRM_MODE_FLAG_PCSYNC: composite sync is active high.
291 * - DRM_MODE_FLAG_NCSYNC: composite sync is active low.
292 * - DRM_MODE_FLAG_HSKEW: hskew provided (not used?).
293 * - DRM_MODE_FLAG_BCAST: not used?
294 * - DRM_MODE_FLAG_PIXMUX: not used?
295 * - DRM_MODE_FLAG_DBLCLK: double-clocked mode.
296 * - DRM_MODE_FLAG_CLKDIV2: half-clocked mode.
297 *
298 * Additionally there's flags to specify how 3D modes are packed:
299 *
300 * - DRM_MODE_FLAG_3D_NONE: normal, non-3D mode.
301 * - DRM_MODE_FLAG_3D_FRAME_PACKING: 2 full frames for left and right.
302 * - DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE: interleaved like fields.
303 * - DRM_MODE_FLAG_3D_LINE_ALTERNATIVE: interleaved lines.
304 * - DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL: side-by-side full frames.
305 * - DRM_MODE_FLAG_3D_L_DEPTH: ?
306 * - DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH: ?
307 * - DRM_MODE_FLAG_3D_TOP_AND_BOTTOM: frame split into top and bottom
308 * parts.
309 * - DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF: frame split into left and
310 * right parts.
311 */
Daniel Vetter55310002014-01-23 15:52:20 +0100312 unsigned int flags;
313
Daniel Vetter30ecad72015-12-09 09:29:36 +0100314 /**
315 * @width_mm:
316 *
317 * Addressable size of the output in mm, projectors should set this to
318 * 0.
319 */
Daniel Vetter55310002014-01-23 15:52:20 +0100320 int width_mm;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100321
322 /**
323 * @height_mm:
324 *
325 * Addressable size of the output in mm, projectors should set this to
326 * 0.
327 */
Daniel Vetter55310002014-01-23 15:52:20 +0100328 int height_mm;
329
Daniel Vetter30ecad72015-12-09 09:29:36 +0100330 /**
331 * @crtc_clock:
332 *
333 * Actual pixel or dot clock in the hardware. This differs from the
334 * logical @clock when e.g. using interlacing, double-clocking, stereo
335 * modes or other fancy stuff that changes the timings and signals
336 * actually sent over the wire.
337 *
338 * This is again in kHz.
339 *
340 * Note that with digital outputs like HDMI or DP there's usually a
341 * massive confusion between the dot clock and the signal clock at the
342 * bit encoding level. Especially when a 8b/10b encoding is used and the
343 * difference is exactly a factor of 10.
344 */
345 int crtc_clock;
Daniel Vetter55310002014-01-23 15:52:20 +0100346 int crtc_hdisplay;
347 int crtc_hblank_start;
348 int crtc_hblank_end;
349 int crtc_hsync_start;
350 int crtc_hsync_end;
351 int crtc_htotal;
352 int crtc_hskew;
353 int crtc_vdisplay;
354 int crtc_vblank_start;
355 int crtc_vblank_end;
356 int crtc_vsync_start;
357 int crtc_vsync_end;
358 int crtc_vtotal;
359
Daniel Vetter30ecad72015-12-09 09:29:36 +0100360 /**
361 * @private:
362 *
363 * Pointer for driver private data. This can only be used for mode
364 * objects passed to drivers in modeset operations. It shouldn't be used
365 * by atomic drivers since they can store any additional data by
366 * subclassing state structures.
367 */
Daniel Vetter55310002014-01-23 15:52:20 +0100368 int *private;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100369
370 /**
371 * @private_flags:
372 *
373 * Similar to @private, but just an integer.
374 */
Daniel Vetter55310002014-01-23 15:52:20 +0100375 int private_flags;
376
Daniel Vetter30ecad72015-12-09 09:29:36 +0100377 /**
378 * @vrefresh:
379 *
380 * Vertical refresh rate, for debug output in human readable form. Not
381 * used in a functional way.
382 *
383 * This value is in Hz.
384 */
385 int vrefresh;
386
387 /**
388 * @hsync:
389 *
390 * Horizontal refresh rate, for debug output in human readable form. Not
391 * used in a functional way.
392 *
393 * This value is in kHz.
394 */
395 int hsync;
396
397 /**
398 * @picture_aspect_ratio:
399 *
400 * Field for setting the HDMI picture aspect ratio of a mode.
401 */
Daniel Vetter55310002014-01-23 15:52:20 +0100402 enum hdmi_picture_aspect picture_aspect_ratio;
403};
404
405/* mode specified on the command line */
406struct drm_cmdline_mode {
407 bool specified;
408 bool refresh_specified;
409 bool bpp_specified;
410 int xres, yres;
411 int bpp;
412 int refresh;
413 bool rb;
414 bool interlace;
415 bool cvt;
416 bool margins;
417 enum drm_connector_force force;
418};
419
Daniel Vetterf5aabb92014-01-23 20:05:00 +0100420/**
421 * drm_mode_is_stereo - check for stereo mode flags
422 * @mode: drm_display_mode to check
423 *
424 * Returns:
425 * True if the mode is one of the stereo modes (like side-by-side), false if
426 * not.
427 */
Daniel Vetter55310002014-01-23 15:52:20 +0100428static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode)
429{
430 return mode->flags & DRM_MODE_FLAG_3D_MASK;
431}
432
433struct drm_connector;
434struct drm_cmdline_mode;
435
436struct drm_display_mode *drm_mode_create(struct drm_device *dev);
437void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
Daniel Stone934a8a82015-05-22 13:34:48 +0100438void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
Lothar Waßmannd72daa02016-07-12 15:30:02 +0200439 const struct drm_display_mode *in);
Daniel Stone934a8a82015-05-22 13:34:48 +0100440int drm_mode_convert_umode(struct drm_display_mode *out,
441 const struct drm_mode_modeinfo *in);
Daniel Vetter55310002014-01-23 15:52:20 +0100442void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
443void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
444
445struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
446 int hdisplay, int vdisplay, int vrefresh,
447 bool reduced, bool interlaced,
448 bool margins);
449struct drm_display_mode *drm_gtf_mode(struct drm_device *dev,
450 int hdisplay, int vdisplay, int vrefresh,
451 bool interlaced, int margins);
452struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
453 int hdisplay, int vdisplay,
454 int vrefresh, bool interlaced,
455 int margins,
456 int GTF_M, int GTF_2C,
457 int GTF_K, int GTF_2J);
Daniel Vetterba0c2422014-01-23 16:28:50 +0100458void drm_display_mode_from_videomode(const struct videomode *vm,
459 struct drm_display_mode *dmode);
Steve Longerbeamd490f452014-12-18 18:00:22 -0800460void drm_display_mode_to_videomode(const struct drm_display_mode *dmode,
461 struct videomode *vm);
Lothar Waßmannd72daa02016-07-12 15:30:02 +0200462void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags);
Daniel Vetter55310002014-01-23 15:52:20 +0100463int of_get_drm_display_mode(struct device_node *np,
Lothar Waßmannfafc79e2016-07-12 15:30:03 +0200464 struct drm_display_mode *dmode, u32 *bus_flags,
Daniel Vetter55310002014-01-23 15:52:20 +0100465 int index);
466
467void drm_mode_set_name(struct drm_display_mode *mode);
Daniel Vetter55310002014-01-23 15:52:20 +0100468int drm_mode_hsync(const struct drm_display_mode *mode);
469int drm_mode_vrefresh(const struct drm_display_mode *mode);
470
471void drm_mode_set_crtcinfo(struct drm_display_mode *p,
472 int adjust_flags);
473void drm_mode_copy(struct drm_display_mode *dst,
474 const struct drm_display_mode *src);
475struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
476 const struct drm_display_mode *mode);
477bool drm_mode_equal(const struct drm_display_mode *mode1,
478 const struct drm_display_mode *mode2);
Ville Syrjälä4c6bcf42015-11-16 21:05:12 +0200479bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1,
480 const struct drm_display_mode *mode2);
Daniel Vetter55310002014-01-23 15:52:20 +0100481bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1,
482 const struct drm_display_mode *mode2);
483
484/* for use by the crtc helper probe functions */
Ville Syrjäläabc0b142014-12-17 13:56:23 +0200485enum drm_mode_status drm_mode_validate_basic(const struct drm_display_mode *mode);
Ville Syrjälä05acaec2014-12-17 13:56:22 +0200486enum drm_mode_status drm_mode_validate_size(const struct drm_display_mode *mode,
487 int maxX, int maxY);
Daniel Vetter55310002014-01-23 15:52:20 +0100488void drm_mode_prune_invalid(struct drm_device *dev,
489 struct list_head *mode_list, bool verbose);
490void drm_mode_sort(struct list_head *mode_list);
Ville Syrjälä6af3e652015-12-03 23:14:14 +0200491void drm_mode_connector_list_update(struct drm_connector *connector);
Daniel Vetter55310002014-01-23 15:52:20 +0100492
493/* parsing cmdline modes */
494bool
495drm_mode_parse_command_line_for_connector(const char *mode_option,
496 struct drm_connector *connector,
497 struct drm_cmdline_mode *mode);
498struct drm_display_mode *
499drm_mode_create_from_cmdline_mode(struct drm_device *dev,
500 struct drm_cmdline_mode *cmd);
501
502#endif /* __DRM_MODES_H__ */