• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 Google LLC
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #ifndef DRM_UTIL_H_
7 #define DRM_UTIL_H_
8 
9 #pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
10 #pragma GCC diagnostic ignored "-Wmissing-field-initializers"
11 #pragma GCC diagnostic ignored "-Wlanguage-extension-token"
12 #pragma GCC diagnostic ignored "-Wgnu-statement-expression"
13 
14 #include "linux/overflow.h"
15 
16 void _drm_log(const char *fmt, ...);
17 #define drm_log(fmt, ...) _drm_log("%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__)
18 
19 #if 0
20 #define drm_dbg drm_log
21 #else
22 #define drm_dbg(fmt, ...)                                                                \
23    do {                                                                                  \
24    } while (0)
25 #endif
26 
27 #define VOID2U64(x) ((uint64_t)(unsigned long)(x))
28 #define U642VOID(x) ((void *)(unsigned long)(x))
29 
30 #ifndef NSEC_PER_SEC
31 #define NSEC_PER_SEC 1000000000ull
32 #endif
33 
34 #endif /* DRM_UTIL_H_ */
35