@@ -536,7 +536,9 @@ static void etnaviv_free_obj(struct drm_gem_object *obj)
drm_gem_free_mmap_offset(obj);
- if (obj->import_attach) {
+ if (etnaviv_obj->ops) {
+ etnaviv_obj->ops->release(etnaviv_obj);
+ } else if (obj->import_attach) {
if (etnaviv_obj->vaddr)
dma_buf_vunmap(obj->import_attach->dmabuf,
etnaviv_obj->vaddr);
@@ -21,8 +21,11 @@
#include <linux/reservation.h>
#include "etnaviv_drv.h"
+struct etnaviv_gem_ops;
+
struct etnaviv_gem_object {
struct drm_gem_object base;
+ const struct etnaviv_gem_ops *ops;
uint32_t flags;
@@ -64,6 +67,10 @@ struct etnaviv_gem_object {
};
#define to_etnaviv_bo(x) container_of(x, struct etnaviv_gem_object, base)
+struct etnaviv_gem_ops {
+ void (*release)(struct etnaviv_gem_object *);
+};
+
static inline bool is_active(struct etnaviv_gem_object *etnaviv_obj)
{
return etnaviv_obj->gpu != NULL;