xref: /dflybsd-src/sys/dev/drm/i915/i915_gem.h (revision 3f2dd94a569761201b5b0a18b2f697f97fe1b9dc)
18621f407SFrançois Tigeot /*
28621f407SFrançois Tigeot  * Copyright © 2016 Intel Corporation
38621f407SFrançois Tigeot  *
48621f407SFrançois Tigeot  * Permission is hereby granted, free of charge, to any person obtaining a
58621f407SFrançois Tigeot  * copy of this software and associated documentation files (the "Software"),
68621f407SFrançois Tigeot  * to deal in the Software without restriction, including without limitation
78621f407SFrançois Tigeot  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
88621f407SFrançois Tigeot  * and/or sell copies of the Software, and to permit persons to whom the
98621f407SFrançois Tigeot  * Software is furnished to do so, subject to the following conditions:
108621f407SFrançois Tigeot  *
118621f407SFrançois Tigeot  * The above copyright notice and this permission notice (including the next
128621f407SFrançois Tigeot  * paragraph) shall be included in all copies or substantial portions of the
138621f407SFrançois Tigeot  * Software.
148621f407SFrançois Tigeot  *
158621f407SFrançois Tigeot  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
168621f407SFrançois Tigeot  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
178621f407SFrançois Tigeot  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
188621f407SFrançois Tigeot  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
198621f407SFrançois Tigeot  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
208621f407SFrançois Tigeot  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
218621f407SFrançois Tigeot  * IN THE SOFTWARE.
228621f407SFrançois Tigeot  *
238621f407SFrançois Tigeot  */
248621f407SFrançois Tigeot 
258621f407SFrançois Tigeot #ifndef __I915_GEM_H__
268621f407SFrançois Tigeot #define __I915_GEM_H__
278621f407SFrançois Tigeot 
28*3f2dd94aSFrançois Tigeot #include <linux/bug.h>
29*3f2dd94aSFrançois Tigeot 
308621f407SFrançois Tigeot #ifdef CONFIG_DRM_I915_DEBUG_GEM
318621f407SFrançois Tigeot #define GEM_BUG_ON(expr) BUG_ON(expr)
32a85cb24fSFrançois Tigeot #define GEM_WARN_ON(expr) WARN_ON(expr)
33a85cb24fSFrançois Tigeot 
34a85cb24fSFrançois Tigeot #define GEM_DEBUG_DECL(var) var
35a85cb24fSFrançois Tigeot #define GEM_DEBUG_EXEC(expr) expr
36a85cb24fSFrançois Tigeot #define GEM_DEBUG_BUG_ON(expr) GEM_BUG_ON(expr)
37a85cb24fSFrançois Tigeot 
388621f407SFrançois Tigeot #else
39a85cb24fSFrançois Tigeot #define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
40a85cb24fSFrançois Tigeot #define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
41a85cb24fSFrançois Tigeot 
42a85cb24fSFrançois Tigeot #define GEM_DEBUG_DECL(var)
43a85cb24fSFrançois Tigeot #define GEM_DEBUG_EXEC(expr) do { } while (0)
44a85cb24fSFrançois Tigeot #define GEM_DEBUG_BUG_ON(expr)
458621f407SFrançois Tigeot #endif
468621f407SFrançois Tigeot 
474be47400SFrançois Tigeot #define I915_NUM_ENGINES 5
484be47400SFrançois Tigeot 
498621f407SFrançois Tigeot #endif /* __I915_GEM_H__ */
50