xref: /dflybsd-src/sys/dev/drm/i915/i915_gem_batch_pool.h (revision 71f41f3eaecc1bac4c44cc81622db5b5dddc7dc4)
119c468b4SFrançois Tigeot /*
219c468b4SFrançois Tigeot  * Copyright © 2014 Intel Corporation
319c468b4SFrançois Tigeot  *
419c468b4SFrançois Tigeot  * Permission is hereby granted, free of charge, to any person obtaining a
519c468b4SFrançois Tigeot  * copy of this software and associated documentation files (the "Software"),
619c468b4SFrançois Tigeot  * to deal in the Software without restriction, including without limitation
719c468b4SFrançois Tigeot  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
819c468b4SFrançois Tigeot  * and/or sell copies of the Software, and to permit persons to whom the
919c468b4SFrançois Tigeot  * Software is furnished to do so, subject to the following conditions:
1019c468b4SFrançois Tigeot  *
1119c468b4SFrançois Tigeot  * The above copyright notice and this permission notice (including the next
1219c468b4SFrançois Tigeot  * paragraph) shall be included in all copies or substantial portions of the
1319c468b4SFrançois Tigeot  * Software.
1419c468b4SFrançois Tigeot  *
1519c468b4SFrançois Tigeot  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1619c468b4SFrançois Tigeot  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1719c468b4SFrançois Tigeot  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1819c468b4SFrançois Tigeot  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919c468b4SFrançois Tigeot  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2019c468b4SFrançois Tigeot  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2119c468b4SFrançois Tigeot  * IN THE SOFTWARE.
2219c468b4SFrançois Tigeot  *
2319c468b4SFrançois Tigeot  */
2419c468b4SFrançois Tigeot 
2519c468b4SFrançois Tigeot #ifndef I915_GEM_BATCH_POOL_H
2619c468b4SFrançois Tigeot #define I915_GEM_BATCH_POOL_H
2719c468b4SFrançois Tigeot 
2819c468b4SFrançois Tigeot #include "i915_drv.h"
2919c468b4SFrançois Tigeot 
30*71f41f3eSFrançois Tigeot struct intel_engine_cs;
31*71f41f3eSFrançois Tigeot 
3219c468b4SFrançois Tigeot struct i915_gem_batch_pool {
33*71f41f3eSFrançois Tigeot 	struct intel_engine_cs *engine;
3419c468b4SFrançois Tigeot 	struct list_head cache_list[4];
3519c468b4SFrançois Tigeot };
3619c468b4SFrançois Tigeot 
3719c468b4SFrançois Tigeot /* i915_gem_batch_pool.c */
38*71f41f3eSFrançois Tigeot void i915_gem_batch_pool_init(struct intel_engine_cs *engine,
3919c468b4SFrançois Tigeot 			      struct i915_gem_batch_pool *pool);
4019c468b4SFrançois Tigeot void i915_gem_batch_pool_fini(struct i915_gem_batch_pool *pool);
4119c468b4SFrançois Tigeot struct drm_i915_gem_object*
4219c468b4SFrançois Tigeot i915_gem_batch_pool_get(struct i915_gem_batch_pool *pool, size_t size);
4319c468b4SFrançois Tigeot 
4419c468b4SFrançois Tigeot #endif /* I915_GEM_BATCH_POOL_H */
45