1 /* 2 * Copyright (C) 2018 DisplayLink (UK) Ltd. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License as 6 * published by the Free Software Foundation; either version 2 of the 7 * License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, but 10 * WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 17 * 02111-1307, USA. 18 */ 19 20 #ifndef META_KMS_UTILS_H 21 #define META_KMS_UTILS_H 22 23 #include <stddef.h> 24 #include <stdint.h> 25 #include <xf86drmMode.h> 26 27 #include "core/util-private.h" 28 29 typedef struct _MetaDrmFormatBuf 30 { 31 char s[5]; 32 } MetaDrmFormatBuf; 33 34 META_EXPORT_TEST 35 float meta_calculate_drm_mode_refresh_rate (const drmModeModeInfo *drm_mode); 36 37 META_EXPORT_TEST 38 int64_t meta_calculate_drm_mode_vblank_duration_us (const drmModeModeInfo *drm_mode); 39 40 const char * meta_drm_format_to_string (MetaDrmFormatBuf *tmp, 41 uint32_t drm_format); 42 43 #endif /* META_KMS_UTILS_H */ 44