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 }; 15 16 static inline 17 struct panfrost_gem_object *to_panfrost_bo(struct drm_gem_object *obj) 18 { 19 return container_of(to_drm_gem_shmem_obj(obj), struct panfrost_gem_object, base); 20 } 21 22 struct drm_gem_object *panfrost_gem_create_object(struct drm_device *dev, size_t size); 23 24 struct drm_gem_object * 25 panfrost_gem_prime_import_sg_table(struct drm_device *dev, 26 struct dma_buf_attachment *attach, 27 struct sg_table *sgt); 28 29 #endif /* __PANFROST_GEM_H__ */ 30