1 /*
2 * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24 /*
25 * Copyright (c) 2012 Intel Corporation. All rights reserved.
26 */
27
28 #include "drmP.h"
29
30 void
drm_debug_print(int cmn_err,const char * func,int line,const char * fmt,...)31 drm_debug_print(int cmn_err, const char *func, int line, const char *fmt, ...)
32 {
33 va_list ap;
34 char format[256];
35
36 (void) snprintf(format, sizeof (format), "[drm:%s:%d] %s",
37 func, line, fmt);
38
39 va_start(ap, fmt);
40 vcmn_err(cmn_err, format, ap);
41 va_end(ap);
42 }
43
44 void
drm_debug(const char * fmt,...)45 drm_debug(const char *fmt, ...)
46 {
47 va_list ap;
48
49 va_start(ap, fmt);
50 vcmn_err(CE_NOTE, fmt, ap);
51 va_end(ap);
52 }
53
54 void
drm_error(const char * fmt,...)55 drm_error(const char *fmt, ...)
56 {
57 va_list ap;
58
59 va_start(ap, fmt);
60 vcmn_err(CE_WARN, fmt, ap);
61 va_end(ap);
62 }
63
64 void
drm_info(const char * fmt,...)65 drm_info(const char *fmt, ...)
66 {
67 va_list ap;
68
69 va_start(ap, fmt);
70 vcmn_err(CE_NOTE, fmt, ap);
71 va_end(ap);
72 }
73