18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: MIT */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright © 2020 Intel Corporation 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef __I915_GEM_GTT_H__ 78c2ecf20Sopenharmony_ci#define __I915_GEM_GTT_H__ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include <linux/io-mapping.h> 108c2ecf20Sopenharmony_ci#include <linux/types.h> 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <drm/drm_mm.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include "gt/intel_gtt.h" 158c2ecf20Sopenharmony_ci#include "i915_scatterlist.h" 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_cistruct drm_i915_gem_object; 188c2ecf20Sopenharmony_cistruct i915_address_space; 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciint __must_check i915_gem_gtt_prepare_pages(struct drm_i915_gem_object *obj, 218c2ecf20Sopenharmony_ci struct sg_table *pages); 228c2ecf20Sopenharmony_civoid i915_gem_gtt_finish_pages(struct drm_i915_gem_object *obj, 238c2ecf20Sopenharmony_ci struct sg_table *pages); 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ciint i915_gem_gtt_reserve(struct i915_address_space *vm, 268c2ecf20Sopenharmony_ci struct drm_mm_node *node, 278c2ecf20Sopenharmony_ci u64 size, u64 offset, unsigned long color, 288c2ecf20Sopenharmony_ci unsigned int flags); 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ciint i915_gem_gtt_insert(struct i915_address_space *vm, 318c2ecf20Sopenharmony_ci struct drm_mm_node *node, 328c2ecf20Sopenharmony_ci u64 size, u64 alignment, unsigned long color, 338c2ecf20Sopenharmony_ci u64 start, u64 end, unsigned int flags); 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci/* Flags used by pin/bind&friends. */ 368c2ecf20Sopenharmony_ci#define PIN_NOEVICT BIT_ULL(0) 378c2ecf20Sopenharmony_ci#define PIN_NOSEARCH BIT_ULL(1) 388c2ecf20Sopenharmony_ci#define PIN_NONBLOCK BIT_ULL(2) 398c2ecf20Sopenharmony_ci#define PIN_MAPPABLE BIT_ULL(3) 408c2ecf20Sopenharmony_ci#define PIN_ZONE_4G BIT_ULL(4) 418c2ecf20Sopenharmony_ci#define PIN_HIGH BIT_ULL(5) 428c2ecf20Sopenharmony_ci#define PIN_OFFSET_BIAS BIT_ULL(6) 438c2ecf20Sopenharmony_ci#define PIN_OFFSET_FIXED BIT_ULL(7) 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#define PIN_GLOBAL BIT_ULL(10) /* I915_VMA_GLOBAL_BIND */ 468c2ecf20Sopenharmony_ci#define PIN_USER BIT_ULL(11) /* I915_VMA_LOCAL_BIND */ 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ci#define PIN_OFFSET_MASK I915_GTT_PAGE_MASK 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ci#endif 51