e4fa8457b2
The idea is that gem_prime_export is deprecated in favor of obj_funcs.export. That's much easier to do if both have matching function signatures. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Sean Paul <sean@poorly.run> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Zhenyu Wang <zhenyuw@linux.intel.com> Cc: Zhi Wang <zhi.a.wang@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com> Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Eric Anholt <eric@anholt.net> Cc: "Michel Dänzer" <michel.daenzer@amd.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Huang Rui <ray.huang@amd.com> Cc: Felix Kuehling <Felix.Kuehling@amd.com> Cc: Hawking Zhang <Hawking.Zhang@amd.com> Cc: Feifei Xu <Feifei.Xu@amd.com> Cc: Jim Qu <Jim.Qu@amd.com> Cc: Evan Quan <evan.quan@amd.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Thomas Zimmermann <tdz@users.sourceforge.net> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: Jilayne Lovejoy <opensource@jilayne.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Junwei Zhang <Jerry.Zhang@amd.com> Cc: intel-gvt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Cc: linux-tegra@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-10-daniel.vetter@ffwll.ch
51 lines
1.6 KiB
C
51 lines
1.6 KiB
C
/*
|
|
* Copyright (C) 2012 Russell King
|
|
*
|
|
* 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.
|
|
*/
|
|
#ifndef ARMADA_GEM_H
|
|
#define ARMADA_GEM_H
|
|
|
|
#include <drm/drm_gem.h>
|
|
|
|
/* GEM */
|
|
struct armada_gem_object {
|
|
struct drm_gem_object obj;
|
|
void *addr;
|
|
phys_addr_t phys_addr;
|
|
resource_size_t dev_addr;
|
|
bool mapped;
|
|
struct drm_mm_node *linear; /* for linear backed */
|
|
struct page *page; /* for page backed */
|
|
struct sg_table *sgt; /* for imported */
|
|
void (*update)(void *);
|
|
void *update_data;
|
|
};
|
|
|
|
extern const struct vm_operations_struct armada_gem_vm_ops;
|
|
|
|
#define drm_to_armada_gem(o) container_of(o, struct armada_gem_object, obj)
|
|
|
|
void armada_gem_free_object(struct drm_gem_object *);
|
|
int armada_gem_linear_back(struct drm_device *, struct armada_gem_object *);
|
|
void *armada_gem_map_object(struct drm_device *, struct armada_gem_object *);
|
|
struct armada_gem_object *armada_gem_alloc_private_object(struct drm_device *,
|
|
size_t);
|
|
int armada_gem_dumb_create(struct drm_file *, struct drm_device *,
|
|
struct drm_mode_create_dumb *);
|
|
struct dma_buf *armada_gem_prime_export(struct drm_gem_object *obj, int flags);
|
|
struct drm_gem_object *armada_gem_prime_import(struct drm_device *,
|
|
struct dma_buf *);
|
|
int armada_gem_map_import(struct armada_gem_object *);
|
|
|
|
static inline struct armada_gem_object *armada_gem_object_lookup(
|
|
struct drm_file *dfile, unsigned handle)
|
|
{
|
|
struct drm_gem_object *obj = drm_gem_object_lookup(dfile, handle);
|
|
|
|
return obj ? drm_to_armada_gem(obj) : NULL;
|
|
}
|
|
#endif
|