1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* Copyright 2019 Linaro, Ltd, Rob Herring <robh@kernel.org> */ 3 4 #ifndef __PANFROST_GEM_H__ 5 #define __PANFROST_GEM_H__ 6 7 #include <drm/drm_gem_shmem_helper.h> 8 #include <drm/drm_mm.h> 9 10 struct panfrost_gem_object { 11 struct drm_gem_shmem_object base; 12 13 struct drm_mm_node node; 14 bool is_mapped; 15 }; 16 17 static inline 18 struct panfrost_gem_object *to_panfrost_bo(struct drm_gem_object *obj) 19 { 20 return container_of(to_drm_gem_shmem_obj(obj), struct panfrost_gem_object, base); 21 } 22 23 struct drm_gem_object *panfrost_gem_create_object(struct drm_device *dev, size_t size); 24 25 struct drm_gem_object * 26 panfrost_gem_prime_import_sg_table(struct drm_device *dev, 27 struct dma_buf_attachment *attach, 28 struct sg_table *sgt); 29 30 #endif /* __PANFROST_GEM_H__ */ 31