vfs: check userland buffers before reading them.
[haiku.git] / headers / private / graphics / common / validate_display_mode.h
blobe0fa3d8e1ab61a96f3bb61357db6bf331647ae31
1 /*
2 * Copyright 2011, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _VALIDATE_DISPLAY_MODE_H
6 #define _VALIDATE_DISPLAY_MODE_H
9 #include <Accelerant.h>
11 #include "edid.h"
13 struct timing_constraints {
14 uint16 resolution;
16 uint16 min_before_sync;
17 uint16 max_sync_start;
18 uint16 min_sync_length;
19 uint16 max_sync_length;
20 uint16 min_after_sync;
21 uint16 max_total;
24 struct display_constraints {
25 uint16 min_h_display;
26 uint16 max_h_display;
27 uint16 min_v_display;
28 uint16 max_v_display;
30 uint32 min_pixel_clock;
31 uint32 max_pixel_clock;
33 timing_constraints horizontal_timing;
34 timing_constraints vertical_timing;
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
43 bool sanitize_display_mode(display_mode& mode,
44 const display_constraints& constraints, const edid1_info* edidInfo);
45 bool is_display_mode_within_bounds(display_mode& mode, const display_mode& low,
46 const display_mode& high);
49 #ifdef __cplusplus
51 #endif
54 #endif /* _VALIDATE_DISPLAY_MODE_H */