linux/drivers/gpu/drm/vc4/vc4_drv.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2014-2015 Broadcom
 * Copyright (C) 2013 Red Hat
 */

/**
 * DOC: Broadcom VC4 Graphics Driver
 *
 * The Broadcom VideoCore 4 (present in the Raspberry Pi) contains a
 * OpenGL ES 2.0-compatible 3D engine called V3D, and a highly
 * configurable display output pipeline that supports HDMI, DSI, DPI,
 * and Composite TV output.
 *
 * The 3D engine also has an interface for submitting arbitrary
 * compute shader-style jobs using the same shader processor as is
 * used for vertex and fragment shaders in GLES 2.0.  However, given
 * that the hardware isn't able to expose any standard interfaces like
 * OpenGL compute shaders or OpenCL, it isn't supported by this
 * driver.
 */

#include <linux/clk.h>
#include <linux/component.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>

#include <drm/drm_aperture.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_dma.h>
#include <drm/drm_vblank.h>

#include <soc/bcm2835/raspberrypi-firmware.h>

#include "uapi/drm/vc4_drm.h"

#include "vc4_drv.h"
#include "vc4_regs.h"

#define DRIVER_NAME
#define DRIVER_DESC
#define DRIVER_DATE
#define DRIVER_MAJOR
#define DRIVER_MINOR
#define DRIVER_PATCHLEVEL

/* Helper function for mapping the regs on a platform device. */
void __iomem *vc4_ioremap_regs(struct platform_device *pdev, int index)
{}

int vc4_dumb_fixup_args(struct drm_mode_create_dumb *args)
{}

static int vc5_dumb_create(struct drm_file *file_priv,
			   struct drm_device *dev,
			   struct drm_mode_create_dumb *args)
{}

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

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

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

DEFINE_DRM_GEM_FOPS(vc4_drm_fops);

static const struct drm_ioctl_desc vc4_drm_ioctls[] =;

const struct drm_driver vc4_drm_driver =;

const struct drm_driver vc5_drm_driver =;

static void vc4_match_add_drivers(struct device *dev,
				  struct component_match **match,
				  struct platform_driver *const *drivers,
				  int count)
{}

static void vc4_component_unbind_all(void *ptr)
{}

static const struct of_device_id vc4_dma_range_matches[] =;

static int vc4_drm_bind(struct device *dev)
{}

static void vc4_drm_unbind(struct device *dev)
{}

static const struct component_master_ops vc4_drm_ops =;

/*
 * This list determines the binding order of our components, and we have
 * a few constraints:
 *   - The TXP driver needs to be bound before the PixelValves (CRTC)
 *     but after the HVS to set the possible_crtc field properly
 *   - The HDMI driver needs to be bound after the HVS so that we can
 *     lookup the HVS maximum core clock rate and figure out if we
 *     support 4kp60 or not.
 */
static struct platform_driver *const component_drivers[] =;

static int vc4_platform_drm_probe(struct platform_device *pdev)
{}

static void vc4_platform_drm_remove(struct platform_device *pdev)
{}

static void vc4_platform_drm_shutdown(struct platform_device *pdev)
{}

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

static struct platform_driver vc4_platform_driver =;

static int __init vc4_drm_register(void)
{}

static void __exit vc4_drm_unregister(void)
{}

module_init();
module_exit(vc4_drm_unregister);

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