1 // SPDX-License-Identifier: MIT 2 /* Copyright © 2024 Intel Corporation */ 3 4 #include "gem/i915_gem_mman.h" 5 #include "gem/i915_gem_object.h" 6 #include "gem/i915_gem_object_frontbuffer.h" 7 #include "i915_debugfs.h" 8 #include "intel_bo.h" 9 10 bool intel_bo_is_tiled(struct drm_gem_object *obj) 11 { 12 return i915_gem_object_is_tiled(to_intel_bo(obj)); 13 } 14 15 bool intel_bo_is_userptr(struct drm_gem_object *obj) 16 { 17 return i915_gem_object_is_userptr(to_intel_bo(obj)); 18 } 19 20 bool intel_bo_is_shmem(struct drm_gem_object *obj) 21 { 22 return i915_gem_object_is_shmem(to_intel_bo(obj)); 23 } 24 25 bool intel_bo_is_protected(struct drm_gem_object *obj) 26 { 27 return i915_gem_object_is_protected(to_intel_bo(obj)); 28 } 29 30 void intel_bo_flush_if_display(struct drm_gem_object *obj) 31 { 32 i915_gem_object_flush_if_display(to_intel_bo(obj)); 33 } 34 35 int intel_bo_fb_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) 36 { 37 return i915_gem_fb_mmap(to_intel_bo(obj), vma); 38 } 39 40 int intel_bo_read_from_page(struct drm_gem_object *obj, u64 offset, void *dst, int size) 41 { 42 return i915_gem_object_read_from_page(to_intel_bo(obj), offset, dst, size); 43 } 44 45 struct intel_frontbuffer *intel_bo_get_frontbuffer(struct drm_gem_object *obj) 46 { 47 return i915_gem_object_get_frontbuffer(to_intel_bo(obj)); 48 } 49 50 struct intel_frontbuffer *intel_bo_set_frontbuffer(struct drm_gem_object *obj, 51 struct intel_frontbuffer *front) 52 { 53 return i915_gem_object_set_frontbuffer(to_intel_bo(obj), front); 54 } 55 56 void intel_bo_describe(struct seq_file *m, struct drm_gem_object *obj) 57 { 58 i915_debugfs_describe_obj(m, to_intel_bo(obj)); 59 } 60