#include <linux/dma-buf.h>
#include <linux/iommu.h>
#include <linux/vmalloc.h>
#include <drm/drm.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_gem.h>
#include <drm/drm_gem_dma_helper.h>
#include <drm/drm_prime.h>
#include <drm/drm_vma_manager.h>
#include "rockchip_drm_drv.h"
#include "rockchip_drm_gem.h"
static int rockchip_gem_iommu_map(struct rockchip_gem_object *rk_obj)
{ … }
static int rockchip_gem_iommu_unmap(struct rockchip_gem_object *rk_obj)
{ … }
static int rockchip_gem_get_pages(struct rockchip_gem_object *rk_obj)
{ … }
static void rockchip_gem_put_pages(struct rockchip_gem_object *rk_obj)
{ … }
static int rockchip_gem_alloc_iommu(struct rockchip_gem_object *rk_obj,
bool alloc_kmap)
{ … }
static int rockchip_gem_alloc_dma(struct rockchip_gem_object *rk_obj,
bool alloc_kmap)
{ … }
static int rockchip_gem_alloc_buf(struct rockchip_gem_object *rk_obj,
bool alloc_kmap)
{ … }
static void rockchip_gem_free_iommu(struct rockchip_gem_object *rk_obj)
{ … }
static void rockchip_gem_free_dma(struct rockchip_gem_object *rk_obj)
{ … }
static void rockchip_gem_free_buf(struct rockchip_gem_object *rk_obj)
{ … }
static int rockchip_drm_gem_object_mmap_iommu(struct drm_gem_object *obj,
struct vm_area_struct *vma)
{ … }
static int rockchip_drm_gem_object_mmap_dma(struct drm_gem_object *obj,
struct vm_area_struct *vma)
{ … }
static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
struct vm_area_struct *vma)
{ … }
static void rockchip_gem_release_object(struct rockchip_gem_object *rk_obj)
{ … }
static const struct drm_gem_object_funcs rockchip_gem_object_funcs = …;
static struct rockchip_gem_object *
rockchip_gem_alloc_object(struct drm_device *drm, unsigned int size)
{ … }
struct rockchip_gem_object *
rockchip_gem_create_object(struct drm_device *drm, unsigned int size,
bool alloc_kmap)
{ … }
void rockchip_gem_free_object(struct drm_gem_object *obj)
{ … }
static struct rockchip_gem_object *
rockchip_gem_create_with_handle(struct drm_file *file_priv,
struct drm_device *drm, unsigned int size,
unsigned int *handle)
{ … }
int rockchip_gem_dumb_create(struct drm_file *file_priv,
struct drm_device *dev,
struct drm_mode_create_dumb *args)
{ … }
struct sg_table *rockchip_gem_prime_get_sg_table(struct drm_gem_object *obj)
{ … }
static int
rockchip_gem_iommu_map_sg(struct drm_device *drm,
struct dma_buf_attachment *attach,
struct sg_table *sg,
struct rockchip_gem_object *rk_obj)
{ … }
static int
rockchip_gem_dma_map_sg(struct drm_device *drm,
struct dma_buf_attachment *attach,
struct sg_table *sg,
struct rockchip_gem_object *rk_obj)
{ … }
struct drm_gem_object *
rockchip_gem_prime_import_sg_table(struct drm_device *drm,
struct dma_buf_attachment *attach,
struct sg_table *sg)
{ … }
int rockchip_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map)
{ … }
void rockchip_gem_prime_vunmap(struct drm_gem_object *obj,
struct iosys_map *map)
{ … }