linux/drivers/gpu/drm/panfrost/panfrost_drv.c

// SPDX-License-Identifier: GPL-2.0
/* Copyright 2018 Marty E. Plummer <[email protected]> */
/* Copyright 2019 Linaro, Ltd., Rob Herring <[email protected]> */
/* Copyright 2019 Collabora ltd. */

#include <linux/module.h>
#include <linux/of.h>
#include <linux/pagemap.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <drm/panfrost_drm.h>
#include <drm/drm_drv.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_syncobj.h>
#include <drm/drm_utils.h>

#include "panfrost_device.h"
#include "panfrost_gem.h"
#include "panfrost_mmu.h"
#include "panfrost_job.h"
#include "panfrost_gpu.h"
#include "panfrost_perfcnt.h"

static bool unstable_ioctls;
module_param_unsafe(unstable_ioctls, bool, 0600);

static int panfrost_ioctl_get_param(struct drm_device *ddev, void *data, struct drm_file *file)
{}

static int panfrost_ioctl_create_bo(struct drm_device *dev, void *data,
		struct drm_file *file)
{}

/**
 * panfrost_lookup_bos() - Sets up job->bo[] with the GEM objects
 * referenced by the job.
 * @dev: DRM device
 * @file_priv: DRM file for this fd
 * @args: IOCTL args
 * @job: job being set up
 *
 * Resolve handles from userspace to BOs and attach them to job.
 *
 * Note that this function doesn't need to unreference the BOs on
 * failure, because that will happen at panfrost_job_cleanup() time.
 */
static int
panfrost_lookup_bos(struct drm_device *dev,
		  struct drm_file *file_priv,
		  struct drm_panfrost_submit *args,
		  struct panfrost_job *job)
{}

/**
 * panfrost_copy_in_sync() - Sets up job->deps with the sync objects
 * referenced by the job.
 * @dev: DRM device
 * @file_priv: DRM file for this fd
 * @args: IOCTL args
 * @job: job being set up
 *
 * Resolve syncobjs from userspace to fences and attach them to job.
 *
 * Note that this function doesn't need to unreference the fences on
 * failure, because that will happen at panfrost_job_cleanup() time.
 */
static int
panfrost_copy_in_sync(struct drm_device *dev,
		  struct drm_file *file_priv,
		  struct drm_panfrost_submit *args,
		  struct panfrost_job *job)
{}

static int panfrost_ioctl_submit(struct drm_device *dev, void *data,
		struct drm_file *file)
{}

static int
panfrost_ioctl_wait_bo(struct drm_device *dev, void *data,
		       struct drm_file *file_priv)
{}

static int panfrost_ioctl_mmap_bo(struct drm_device *dev, void *data,
		      struct drm_file *file_priv)
{}

static int panfrost_ioctl_get_bo_offset(struct drm_device *dev, void *data,
			    struct drm_file *file_priv)
{}

static int panfrost_ioctl_madvise(struct drm_device *dev, void *data,
				  struct drm_file *file_priv)
{}

int panfrost_unstable_ioctl_check(void)
{}

static int
panfrost_open(struct drm_device *dev, struct drm_file *file)
{}

static void
panfrost_postclose(struct drm_device *dev, struct drm_file *file)
{}

static const struct drm_ioctl_desc panfrost_drm_driver_ioctls[] =;

static void panfrost_gpu_show_fdinfo(struct panfrost_device *pfdev,
				     struct panfrost_file_priv *panfrost_priv,
				     struct drm_printer *p)
{}

static void panfrost_show_fdinfo(struct drm_printer *p, struct drm_file *file)
{}

static const struct file_operations panfrost_drm_driver_fops =;

/*
 * Panfrost driver version:
 * - 1.0 - initial interface
 * - 1.1 - adds HEAP and NOEXEC flags for CREATE_BO
 * - 1.2 - adds AFBC_FEATURES query
 */
static const struct drm_driver panfrost_drm_driver =;

static int panfrost_probe(struct platform_device *pdev)
{}

static void panfrost_remove(struct platform_device *pdev)
{}

static ssize_t profiling_show(struct device *dev,
			      struct device_attribute *attr, char *buf)
{}

static ssize_t profiling_store(struct device *dev,
			       struct device_attribute *attr,
			       const char *buf, size_t len)
{}

static DEVICE_ATTR_RW(profiling);

static struct attribute *panfrost_attrs[] =;

ATTRIBUTE_GROUPS();

/*
 * The OPP core wants the supply names to be NULL terminated, but we need the
 * correct num_supplies value for regulator core. Hence, we NULL terminate here
 * and then initialize num_supplies with ARRAY_SIZE - 1.
 */
static const char * const default_supplies[] =;
static const struct panfrost_compatible default_data =;

static const struct panfrost_compatible amlogic_data =;

/*
 * The old data with two power supplies for MT8183 is here only to
 * keep retro-compatibility with older devicetrees, as DVFS will
 * not work with this one.
 *
 * On new devicetrees please use the _b variant with a single and
 * coupled regulators instead.
 */
static const char * const mediatek_mt8183_supplies[] =;
static const char * const mediatek_mt8183_pm_domains[] =;
static const struct panfrost_compatible mediatek_mt8183_data =;

static const char * const mediatek_mt8183_b_supplies[] =;
static const struct panfrost_compatible mediatek_mt8183_b_data =;

static const char * const mediatek_mt8186_pm_domains[] =;
static const struct panfrost_compatible mediatek_mt8186_data =;

/* MT8188 uses the same power domains and power supplies as MT8183 */
static const struct panfrost_compatible mediatek_mt8188_data =;

static const char * const mediatek_mt8192_supplies[] =;
static const char * const mediatek_mt8192_pm_domains[] =;
static const struct panfrost_compatible mediatek_mt8192_data =;

static const struct of_device_id dt_match[] =;
MODULE_DEVICE_TABLE(of, dt_match);

static struct platform_driver panfrost_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_SOFTDEP();