/* * Copyright (C) 2013 Pengutronix * Author: Lucas Stach * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ #ifndef __DRM_ADRENO_H__ #define __DRM_ADRENO_H__ #include struct adreno_gpu; #define ADRENO_SUBMIT_MAX_CMDS 4 struct adreno_submit { unsigned int nr_cmds; struct { uint32_t type; uint32_t size; /* in dwords */ uint32_t iova; } cmd[ADRENO_SUBMIT_MAX_CMDS]; uint32_t fence; }; struct adreno_context { int dummy; }; struct adreno_gpu_funcs { int (*get_param)(struct adreno_gpu *gpu, uint32_t param, uint64_t *value); int (*hw_init)(struct adreno_gpu *gpu); int (*pm_suspend)(struct adreno_gpu *gpu); int (*pm_resume)(struct adreno_gpu *gpu); int (*submit)(struct adreno_gpu *gpu, struct adreno_submit *submit, struct adreno_context *ctx); void (*flush)(struct adreno_gpu *gpu); void (*idle)(struct adreno_gpu *gpu); irqreturn_t (*irq)(struct adreno_gpu *irq); uint32_t (*last_fence)(struct adreno_gpu *gpu); void (*recover)(struct adreno_gpu *gpu); void (*destroy)(struct adreno_gpu *gpu); #ifdef CONFIG_DEBUG_FS /* show GPU status in debugfs: */ void (*show)(struct adreno_gpu *gpu, struct seq_file *m); #endif }; struct adreno_gem { void *priv; struct drm_gem_object *(*gem_new)(void *gem_priv, uint32_t size, uint32_t flags); int (*gem_get_iova_locked)(void *gem_priv, struct drm_gem_object *obj, uint32_t *iova); int (*gem_get_iova)(void *gem_priv, struct drm_gem_object *obj, uint32_t *iova); void (*gem_put_iova)(void *gem_priv, struct drm_gem_object *obj); void *(*gem_vaddr_locked)(void *gem_priv, struct drm_gem_object *obj); void *(*gem_vaddr)(void *gem_priv, struct drm_gem_object *obj); void (*gem_retire)(void *gem_priv); }; const char *adreno_get_name(struct adreno_gpu *gpu); #endif /* __DRM_ADRENO_H__ */