blob: 986ed6ff635a20ef3deabb52b6e111cfac394267 [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 Vetter949619f2016-08-29 10:27:51 +020030#include <drm/drm_mode_object.h>
Daniel Vetter52217192016-08-12 22:48:50 +020031#include <drm/drm_connector.h>
Daniel Vetter7520a272016-08-15 16:07:02 +020032
Daniel Vetter55310002014-01-23 15:52:20 +010033/*
34 * Note on terminology: here, for brevity and convenience, we refer to connector
35 * control chips as 'CRTCs'. They can control any type of connector, VGA, LVDS,
36 * DVI, etc. And 'screen' refers to the whole of the visible display, which
37 * may span multiple monitors (and therefore multiple CRTC and connector
38 * structures).
39 */
40
Daniel Vetter30ecad72015-12-09 09:29:36 +010041/**
42 * enum drm_mode_status - hardware support status of a mode
43 * @MODE_OK: Mode OK
44 * @MODE_HSYNC: hsync out of range
45 * @MODE_VSYNC: vsync out of range
46 * @MODE_H_ILLEGAL: mode has illegal horizontal timings
47 * @MODE_V_ILLEGAL: mode has illegal horizontal timings
48 * @MODE_BAD_WIDTH: requires an unsupported linepitch
49 * @MODE_NOMODE: no mode with a matching name
50 * @MODE_NO_INTERLACE: interlaced mode not supported
51 * @MODE_NO_DBLESCAN: doublescan mode not supported
52 * @MODE_NO_VSCAN: multiscan mode not supported
53 * @MODE_MEM: insufficient video memory
54 * @MODE_VIRTUAL_X: mode width too large for specified virtual size
55 * @MODE_VIRTUAL_Y: mode height too large for specified virtual size
56 * @MODE_MEM_VIRT: insufficient video memory given virtual size
57 * @MODE_NOCLOCK: no fixed clock available
58 * @MODE_CLOCK_HIGH: clock required is too high
59 * @MODE_CLOCK_LOW: clock required is too low
60 * @MODE_CLOCK_RANGE: clock/mode isn't in a ClockRange
61 * @MODE_BAD_HVALUE: horizontal timing was out of range
62 * @MODE_BAD_VVALUE: vertical timing was out of range
63 * @MODE_BAD_VSCAN: VScan value out of range
64 * @MODE_HSYNC_NARROW: horizontal sync too narrow
65 * @MODE_HSYNC_WIDE: horizontal sync too wide
66 * @MODE_HBLANK_NARROW: horizontal blanking too narrow
67 * @MODE_HBLANK_WIDE: horizontal blanking too wide
68 * @MODE_VSYNC_NARROW: vertical sync too narrow
69 * @MODE_VSYNC_WIDE: vertical sync too wide
70 * @MODE_VBLANK_NARROW: vertical blanking too narrow
71 * @MODE_VBLANK_WIDE: vertical blanking too wide
72 * @MODE_PANEL: exceeds panel dimensions
73 * @MODE_INTERLACE_WIDTH: width too large for interlaced mode
74 * @MODE_ONE_WIDTH: only one width is supported
75 * @MODE_ONE_HEIGHT: only one height is supported
76 * @MODE_ONE_SIZE: only one resolution is supported
77 * @MODE_NO_REDUCED: monitor doesn't accept reduced blanking
78 * @MODE_NO_STEREO: stereo modes not supported
Ville Syrjälä5ba89402015-12-10 22:39:08 +020079 * @MODE_STALE: mode has become stale
Daniel Vetter30ecad72015-12-09 09:29:36 +010080 * @MODE_BAD: unspecified reason
81 * @MODE_ERROR: error condition
82 *
83 * This enum is used to filter out modes not supported by the driver/hardware
84 * combination.
85 */
Daniel Vetter55310002014-01-23 15:52:20 +010086enum drm_mode_status {
Daniel Vetter30ecad72015-12-09 09:29:36 +010087 MODE_OK = 0,
88 MODE_HSYNC,
89 MODE_VSYNC,
90 MODE_H_ILLEGAL,
91 MODE_V_ILLEGAL,
92 MODE_BAD_WIDTH,
93 MODE_NOMODE,
94 MODE_NO_INTERLACE,
95 MODE_NO_DBLESCAN,
96 MODE_NO_VSCAN,
97 MODE_MEM,
98 MODE_VIRTUAL_X,
99 MODE_VIRTUAL_Y,
100 MODE_MEM_VIRT,
101 MODE_NOCLOCK,
102 MODE_CLOCK_HIGH,
103 MODE_CLOCK_LOW,
104 MODE_CLOCK_RANGE,
105 MODE_BAD_HVALUE,
106 MODE_BAD_VVALUE,
107 MODE_BAD_VSCAN,
108 MODE_HSYNC_NARROW,
109 MODE_HSYNC_WIDE,
110 MODE_HBLANK_NARROW,
111 MODE_HBLANK_WIDE,
112 MODE_VSYNC_NARROW,
113 MODE_VSYNC_WIDE,
114 MODE_VBLANK_NARROW,
115 MODE_VBLANK_WIDE,
116 MODE_PANEL,
117 MODE_INTERLACE_WIDTH,
118 MODE_ONE_WIDTH,
119 MODE_ONE_HEIGHT,
120 MODE_ONE_SIZE,
121 MODE_NO_REDUCED,
122 MODE_NO_STEREO,
Ville Syrjälä5ba89402015-12-10 22:39:08 +0200123 MODE_STALE = -3,
Daniel Vetter30ecad72015-12-09 09:29:36 +0100124 MODE_BAD = -2,
125 MODE_ERROR = -1
Daniel Vetter55310002014-01-23 15:52:20 +0100126};
127
128#define DRM_MODE_TYPE_CLOCK_CRTC_C (DRM_MODE_TYPE_CLOCK_C | \
129 DRM_MODE_TYPE_CRTC_C)
130
131#define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \
132 .name = nm, .status = 0, .type = (t), .clock = (c), \
133 .hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
134 .htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
135 .vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
136 .vscan = (vs), .flags = (f), \
137 .base.type = DRM_MODE_OBJECT_MODE
138
139#define CRTC_INTERLACE_HALVE_V (1 << 0) /* halve V values for interlacing */
140#define CRTC_STEREO_DOUBLE (1 << 1) /* adjust timings for stereo modes */
Gustavo Padovanecb7e162014-12-01 15:40:09 -0800141#define CRTC_NO_DBLSCAN (1 << 2) /* don't adjust doublescan */
142#define CRTC_NO_VSCAN (1 << 3) /* don't adjust doublescan */
Damien Lespiau498b8732015-02-16 15:12:31 +0000143#define CRTC_STEREO_DOUBLE_ONLY (CRTC_STEREO_DOUBLE | CRTC_NO_DBLSCAN | CRTC_NO_VSCAN)
Daniel Vetter55310002014-01-23 15:52:20 +0100144
145#define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF
146
Daniel Vetter30ecad72015-12-09 09:29:36 +0100147/**
148 * struct drm_display_mode - DRM kernel-internal display mode structure
149 * @hdisplay: horizontal display size
150 * @hsync_start: horizontal sync start
151 * @hsync_end: horizontal sync end
152 * @htotal: horizontal total size
153 * @hskew: horizontal skew?!
154 * @vdisplay: vertical display size
155 * @vsync_start: vertical sync start
156 * @vsync_end: vertical sync end
157 * @vtotal: vertical total size
158 * @vscan: vertical scan?!
159 * @crtc_hdisplay: hardware mode horizontal display size
160 * @crtc_hblank_start: hardware mode horizontal blank start
161 * @crtc_hblank_end: hardware mode horizontal blank end
162 * @crtc_hsync_start: hardware mode horizontal sync start
163 * @crtc_hsync_end: hardware mode horizontal sync end
164 * @crtc_htotal: hardware mode horizontal total size
165 * @crtc_hskew: hardware mode horizontal skew?!
166 * @crtc_vdisplay: hardware mode vertical display size
167 * @crtc_vblank_start: hardware mode vertical blank start
168 * @crtc_vblank_end: hardware mode vertical blank end
169 * @crtc_vsync_start: hardware mode vertical sync start
170 * @crtc_vsync_end: hardware mode vertical sync end
171 * @crtc_vtotal: hardware mode vertical total size
172 *
173 * The horizontal and vertical timings are defined per the following diagram.
174 *
Daniel Vetterda5335b2016-05-31 22:55:13 +0200175 * ::
176 *
Daniel Vetter30ecad72015-12-09 09:29:36 +0100177 *
178 * Active Front Sync Back
179 * Region Porch Porch
180 * <-----------------------><----------------><-------------><-------------->
181 * //////////////////////|
182 * ////////////////////// |
183 * ////////////////////// |.................. ................
184 * _______________
185 * <----- [hv]display ----->
186 * <------------- [hv]sync_start ------------>
187 * <--------------------- [hv]sync_end --------------------->
188 * <-------------------------------- [hv]total ----------------------------->*
189 *
190 * This structure contains two copies of timings. First are the plain timings,
191 * which specify the logical mode, as it would be for a progressive 1:1 scanout
192 * at the refresh rate userspace can observe through vblank timestamps. Then
193 * there's the hardware timings, which are corrected for interlacing,
194 * double-clocking and similar things. They are provided as a convenience, and
195 * can be appropriately computed using drm_mode_set_crtcinfo().
196 */
Daniel Vetter55310002014-01-23 15:52:20 +0100197struct drm_display_mode {
Daniel Vetter30ecad72015-12-09 09:29:36 +0100198 /**
199 * @head:
200 *
201 * struct list_head for mode lists.
202 */
Daniel Vetter55310002014-01-23 15:52:20 +0100203 struct list_head head;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100204
205 /**
206 * @base:
207 *
208 * A display mode is a normal modeset object, possibly including public
209 * userspace id.
210 *
211 * FIXME:
212 *
213 * This can probably be removed since the entire concept of userspace
214 * managing modes explicitly has never landed in upstream kernel mode
215 * setting support.
216 */
Daniel Vetter55310002014-01-23 15:52:20 +0100217 struct drm_mode_object base;
218
Daniel Vetter30ecad72015-12-09 09:29:36 +0100219 /**
220 * @name:
221 *
222 * Human-readable name of the mode, filled out with drm_mode_set_name().
223 */
Daniel Vetter55310002014-01-23 15:52:20 +0100224 char name[DRM_DISPLAY_MODE_LEN];
225
Daniel Vetter30ecad72015-12-09 09:29:36 +0100226 /**
227 * @status:
228 *
229 * Status of the mode, used to filter out modes not supported by the
230 * hardware. See enum &drm_mode_status.
231 */
Daniel Vetter55310002014-01-23 15:52:20 +0100232 enum drm_mode_status status;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100233
234 /**
235 * @type:
236 *
237 * A bitmask of flags, mostly about the source of a mode. Possible flags
238 * are:
239 *
240 * - DRM_MODE_TYPE_BUILTIN: Meant for hard-coded modes, effectively
241 * unused.
242 * - DRM_MODE_TYPE_PREFERRED: Preferred mode, usually the native
243 * resolution of an LCD panel. There should only be one preferred
244 * mode per connector at any given time.
245 * - DRM_MODE_TYPE_DRIVER: Mode created by the driver, which is all of
246 * them really. Drivers must set this bit for all modes they create
247 * and expose to userspace.
248 *
249 * Plus a big list of flags which shouldn't be used at all, but are
250 * still around since these flags are also used in the userspace ABI:
251 *
252 * - DRM_MODE_TYPE_DEFAULT: Again a leftover, use
253 * DRM_MODE_TYPE_PREFERRED instead.
254 * - DRM_MODE_TYPE_CLOCK_C and DRM_MODE_TYPE_CRTC_C: Define leftovers
255 * which are stuck around for hysterical raisins only. No one has an
256 * idea what they were meant for. Don't use.
257 * - DRM_MODE_TYPE_USERDEF: Mode defined by userspace, again a vestige
258 * from older kms designs where userspace had to first add a custom
259 * mode to the kernel's mode list before it could use it. Don't use.
260 */
Daniel Vetter55310002014-01-23 15:52:20 +0100261 unsigned int type;
262
Daniel Vetter30ecad72015-12-09 09:29:36 +0100263 /**
264 * @clock:
265 *
266 * Pixel clock in kHz.
267 */
Daniel Vetter55310002014-01-23 15:52:20 +0100268 int clock; /* in kHz */
269 int hdisplay;
270 int hsync_start;
271 int hsync_end;
272 int htotal;
273 int hskew;
274 int vdisplay;
275 int vsync_start;
276 int vsync_end;
277 int vtotal;
278 int vscan;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100279 /**
280 * @flags:
281 *
282 * Sync and timing flags:
283 *
284 * - DRM_MODE_FLAG_PHSYNC: horizontal sync is active high.
285 * - DRM_MODE_FLAG_NHSYNC: horizontal sync is active low.
286 * - DRM_MODE_FLAG_PVSYNC: vertical sync is active high.
287 * - DRM_MODE_FLAG_NVSYNC: vertical sync is active low.
288 * - DRM_MODE_FLAG_INTERLACE: mode is interlaced.
289 * - DRM_MODE_FLAG_DBLSCAN: mode uses doublescan.
290 * - DRM_MODE_FLAG_CSYNC: mode uses composite sync.
291 * - DRM_MODE_FLAG_PCSYNC: composite sync is active high.
292 * - DRM_MODE_FLAG_NCSYNC: composite sync is active low.
293 * - DRM_MODE_FLAG_HSKEW: hskew provided (not used?).
294 * - DRM_MODE_FLAG_BCAST: not used?
295 * - DRM_MODE_FLAG_PIXMUX: not used?
296 * - DRM_MODE_FLAG_DBLCLK: double-clocked mode.
297 * - DRM_MODE_FLAG_CLKDIV2: half-clocked mode.
298 *
299 * Additionally there's flags to specify how 3D modes are packed:
300 *
301 * - DRM_MODE_FLAG_3D_NONE: normal, non-3D mode.
302 * - DRM_MODE_FLAG_3D_FRAME_PACKING: 2 full frames for left and right.
303 * - DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE: interleaved like fields.
304 * - DRM_MODE_FLAG_3D_LINE_ALTERNATIVE: interleaved lines.
305 * - DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL: side-by-side full frames.
306 * - DRM_MODE_FLAG_3D_L_DEPTH: ?
307 * - DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH: ?
308 * - DRM_MODE_FLAG_3D_TOP_AND_BOTTOM: frame split into top and bottom
309 * parts.
310 * - DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF: frame split into left and
311 * right parts.
312 */
Daniel Vetter55310002014-01-23 15:52:20 +0100313 unsigned int flags;
314
Daniel Vetter30ecad72015-12-09 09:29:36 +0100315 /**
316 * @width_mm:
317 *
318 * Addressable size of the output in mm, projectors should set this to
319 * 0.
320 */
Daniel Vetter55310002014-01-23 15:52:20 +0100321 int width_mm;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100322
323 /**
324 * @height_mm:
325 *
326 * Addressable size of the output in mm, projectors should set this to
327 * 0.
328 */
Daniel Vetter55310002014-01-23 15:52:20 +0100329 int height_mm;
330
Daniel Vetter30ecad72015-12-09 09:29:36 +0100331 /**
332 * @crtc_clock:
333 *
334 * Actual pixel or dot clock in the hardware. This differs from the
335 * logical @clock when e.g. using interlacing, double-clocking, stereo
336 * modes or other fancy stuff that changes the timings and signals
337 * actually sent over the wire.
338 *
339 * This is again in kHz.
340 *
341 * Note that with digital outputs like HDMI or DP there's usually a
342 * massive confusion between the dot clock and the signal clock at the
343 * bit encoding level. Especially when a 8b/10b encoding is used and the
344 * difference is exactly a factor of 10.
345 */
346 int crtc_clock;
Daniel Vetter55310002014-01-23 15:52:20 +0100347 int crtc_hdisplay;
348 int crtc_hblank_start;
349 int crtc_hblank_end;
350 int crtc_hsync_start;
351 int crtc_hsync_end;
352 int crtc_htotal;
353 int crtc_hskew;
354 int crtc_vdisplay;
355 int crtc_vblank_start;
356 int crtc_vblank_end;
357 int crtc_vsync_start;
358 int crtc_vsync_end;
359 int crtc_vtotal;
360
Daniel Vetter30ecad72015-12-09 09:29:36 +0100361 /**
362 * @private:
363 *
364 * Pointer for driver private data. This can only be used for mode
365 * objects passed to drivers in modeset operations. It shouldn't be used
366 * by atomic drivers since they can store any additional data by
367 * subclassing state structures.
368 */
Daniel Vetter55310002014-01-23 15:52:20 +0100369 int *private;
Daniel Vetter30ecad72015-12-09 09:29:36 +0100370
371 /**
372 * @private_flags:
373 *
374 * Similar to @private, but just an integer.
375 */
Daniel Vetter55310002014-01-23 15:52:20 +0100376 int private_flags;
377
Daniel Vetter30ecad72015-12-09 09:29:36 +0100378 /**
379 * @vrefresh:
380 *
381 * Vertical refresh rate, for debug output in human readable form. Not
382 * used in a functional way.
383 *
384 * This value is in Hz.
385 */
386 int vrefresh;
387
388 /**
389 * @hsync:
390 *
391 * Horizontal refresh rate, for debug output in human readable form. Not
392 * used in a functional way.
393 *
394 * This value is in kHz.
395 */
396 int hsync;
397
398 /**
399 * @picture_aspect_ratio:
400 *
401 * Field for setting the HDMI picture aspect ratio of a mode.
402 */
Daniel Vetter55310002014-01-23 15:52:20 +0100403 enum hdmi_picture_aspect picture_aspect_ratio;
404};
405
Daniel Vetterafb21ea62016-08-31 18:09:04 +0200406#define obj_to_mode(x) container_of(x, struct drm_display_mode, base)
407
Daniel Vetterf5aabb92014-01-23 20:05:00 +0100408/**
409 * drm_mode_is_stereo - check for stereo mode flags
410 * @mode: drm_display_mode to check
411 *
412 * Returns:
413 * True if the mode is one of the stereo modes (like side-by-side), false if
414 * not.
415 */
Daniel Vetter55310002014-01-23 15:52:20 +0100416static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode)
417{
418 return mode->flags & DRM_MODE_FLAG_3D_MASK;
419}
420
421struct drm_connector;
422struct drm_cmdline_mode;
423
424struct drm_display_mode *drm_mode_create(struct drm_device *dev);
425void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
Daniel Stone934a8a82015-05-22 13:34:48 +0100426void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
Lothar Waßmannd72daa02016-07-12 15:30:02 +0200427 const struct drm_display_mode *in);
Daniel Stone934a8a82015-05-22 13:34:48 +0100428int drm_mode_convert_umode(struct drm_display_mode *out,
429 const struct drm_mode_modeinfo *in);
Daniel Vetter55310002014-01-23 15:52:20 +0100430void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
431void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
432
433struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
434 int hdisplay, int vdisplay, int vrefresh,
435 bool reduced, bool interlaced,
436 bool margins);
437struct drm_display_mode *drm_gtf_mode(struct drm_device *dev,
438 int hdisplay, int vdisplay, int vrefresh,
439 bool interlaced, int margins);
440struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
441 int hdisplay, int vdisplay,
442 int vrefresh, bool interlaced,
443 int margins,
444 int GTF_M, int GTF_2C,
445 int GTF_K, int GTF_2J);
Daniel Vetterba0c2422014-01-23 16:28:50 +0100446void drm_display_mode_from_videomode(const struct videomode *vm,
447 struct drm_display_mode *dmode);
Steve Longerbeamd490f452014-12-18 18:00:22 -0800448void drm_display_mode_to_videomode(const struct drm_display_mode *dmode,
449 struct videomode *vm);
Lothar Waßmannd72daa02016-07-12 15:30:02 +0200450void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags);
Daniel Vetter55310002014-01-23 15:52:20 +0100451int of_get_drm_display_mode(struct device_node *np,
Lothar Waßmannfafc79e2016-07-12 15:30:03 +0200452 struct drm_display_mode *dmode, u32 *bus_flags,
Daniel Vetter55310002014-01-23 15:52:20 +0100453 int index);
454
455void drm_mode_set_name(struct drm_display_mode *mode);
Daniel Vetter55310002014-01-23 15:52:20 +0100456int drm_mode_hsync(const struct drm_display_mode *mode);
457int drm_mode_vrefresh(const struct drm_display_mode *mode);
458
459void drm_mode_set_crtcinfo(struct drm_display_mode *p,
460 int adjust_flags);
461void drm_mode_copy(struct drm_display_mode *dst,
462 const struct drm_display_mode *src);
463struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
464 const struct drm_display_mode *mode);
465bool drm_mode_equal(const struct drm_display_mode *mode1,
466 const struct drm_display_mode *mode2);
Ville Syrjälä4c6bcf42015-11-16 21:05:12 +0200467bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1,
468 const struct drm_display_mode *mode2);
Daniel Vetter55310002014-01-23 15:52:20 +0100469bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1,
470 const struct drm_display_mode *mode2);
471
472/* for use by the crtc helper probe functions */
Ville Syrjäläabc0b142014-12-17 13:56:23 +0200473enum drm_mode_status drm_mode_validate_basic(const struct drm_display_mode *mode);
Ville Syrjälä05acaec2014-12-17 13:56:22 +0200474enum drm_mode_status drm_mode_validate_size(const struct drm_display_mode *mode,
475 int maxX, int maxY);
Daniel Vetter55310002014-01-23 15:52:20 +0100476void drm_mode_prune_invalid(struct drm_device *dev,
477 struct list_head *mode_list, bool verbose);
478void drm_mode_sort(struct list_head *mode_list);
Ville Syrjälä6af3e652015-12-03 23:14:14 +0200479void drm_mode_connector_list_update(struct drm_connector *connector);
Daniel Vetter55310002014-01-23 15:52:20 +0100480
481/* parsing cmdline modes */
482bool
483drm_mode_parse_command_line_for_connector(const char *mode_option,
484 struct drm_connector *connector,
485 struct drm_cmdline_mode *mode);
486struct drm_display_mode *
487drm_mode_create_from_cmdline_mode(struct drm_device *dev,
488 struct drm_cmdline_mode *cmd);
489
490#endif /* __DRM_MODES_H__ */