#include <linux/bitops.h>
#include <linux/host1x.h>
#include <linux/idr.h>
#include <linux/iommu.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_debugfs.h>
#include <drm/drm_drv.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_prime.h>
#include <drm/drm_vblank.h>
#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)
#include <asm/dma-iommu.h>
#endif
#include "dc.h"
#include "drm.h"
#include "gem.h"
#include "uapi.h"
#define DRIVER_NAME …
#define DRIVER_DESC …
#define DRIVER_DATE …
#define DRIVER_MAJOR …
#define DRIVER_MINOR …
#define DRIVER_PATCHLEVEL …
#define CARVEOUT_SZ …
#define CDMA_GATHER_FETCHES_MAX_NB …
static int tegra_atomic_check(struct drm_device *drm,
struct drm_atomic_state *state)
{ … }
static const struct drm_mode_config_funcs tegra_drm_mode_config_funcs = …;
static void tegra_atomic_post_commit(struct drm_device *drm,
struct drm_atomic_state *old_state)
{ … }
static void tegra_atomic_commit_tail(struct drm_atomic_state *old_state)
{ … }
static const struct drm_mode_config_helper_funcs
tegra_drm_mode_config_helpers = …;
static int tegra_drm_open(struct drm_device *drm, struct drm_file *filp)
{ … }
static void tegra_drm_context_free(struct tegra_drm_context *context)
{ … }
static int host1x_reloc_copy_from_user(struct host1x_reloc *dest,
struct drm_tegra_reloc __user *src,
struct drm_device *drm,
struct drm_file *file)
{ … }
int tegra_drm_submit(struct tegra_drm_context *context,
struct drm_tegra_submit *args, struct drm_device *drm,
struct drm_file *file)
{ … }
#ifdef CONFIG_DRM_TEGRA_STAGING
static int tegra_gem_create(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_gem_mmap(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_syncpt_read(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_syncpt_incr(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_syncpt_wait(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_client_open(struct tegra_drm_file *fpriv,
struct tegra_drm_client *client,
struct tegra_drm_context *context)
{ … }
static int tegra_open_channel(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_close_channel(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_get_syncpt(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_submit(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_get_syncpt_base(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_gem_set_tiling(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_gem_get_tiling(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_gem_set_flags(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
static int tegra_gem_get_flags(struct drm_device *drm, void *data,
struct drm_file *file)
{ … }
#endif
static const struct drm_ioctl_desc tegra_drm_ioctls[] = …;
static const struct file_operations tegra_drm_fops = …;
static int tegra_drm_context_cleanup(int id, void *p, void *data)
{ … }
static void tegra_drm_postclose(struct drm_device *drm, struct drm_file *file)
{ … }
#ifdef CONFIG_DEBUG_FS
static int tegra_debugfs_framebuffers(struct seq_file *s, void *data)
{ … }
static int tegra_debugfs_iova(struct seq_file *s, void *data)
{ … }
static struct drm_info_list tegra_debugfs_list[] = …;
static void tegra_debugfs_init(struct drm_minor *minor)
{ … }
#endif
static const struct drm_driver tegra_drm_driver = …;
int tegra_drm_register_client(struct tegra_drm *tegra,
struct tegra_drm_client *client)
{ … }
int tegra_drm_unregister_client(struct tegra_drm *tegra,
struct tegra_drm_client *client)
{ … }
int host1x_client_iommu_attach(struct host1x_client *client)
{ … }
void host1x_client_iommu_detach(struct host1x_client *client)
{ … }
void *tegra_drm_alloc(struct tegra_drm *tegra, size_t size, dma_addr_t *dma)
{ … }
void tegra_drm_free(struct tegra_drm *tegra, size_t size, void *virt,
dma_addr_t dma)
{ … }
static bool host1x_drm_wants_iommu(struct host1x_device *dev)
{ … }
static int host1x_drm_probe(struct host1x_device *dev)
{ … }
static int host1x_drm_remove(struct host1x_device *dev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int host1x_drm_suspend(struct device *dev)
{ … }
static int host1x_drm_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(host1x_drm_pm_ops, host1x_drm_suspend,
host1x_drm_resume);
static const struct of_device_id host1x_drm_subdevs[] = …;
static struct host1x_driver host1x_drm_driver = …;
static struct platform_driver * const drivers[] = …;
static int __init host1x_drm_init(void)
{ … }
module_init(…) …;
static void __exit host1x_drm_exit(void)
{ … }
module_exit(host1x_drm_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;