linux/drivers/gpu/drm/tiny/ofdrm.c

// SPDX-License-Identifier: GPL-2.0-only

#include <linux/of_address.h>
#include <linux/pci.h>
#include <linux/platform_device.h>

#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_connector.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_device.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_shmem.h>
#include <drm/drm_format_helper.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_atomic_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_gem_shmem_helper.h>
#include <drm/drm_managed.h>
#include <drm/drm_modeset_helper_vtables.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_simple_kms_helper.h>

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

#define PCI_VENDOR_ID_ATI_R520
#define PCI_VENDOR_ID_ATI_R600

#define OFDRM_GAMMA_LUT_SIZE

/* Definitions used by the Avivo palette  */
#define AVIVO_DC_LUT_RW_SELECT
#define AVIVO_DC_LUT_RW_MODE
#define AVIVO_DC_LUT_RW_INDEX
#define AVIVO_DC_LUT_SEQ_COLOR
#define AVIVO_DC_LUT_PWL_DATA
#define AVIVO_DC_LUT_30_COLOR
#define AVIVO_DC_LUT_READ_PIPE_SELECT
#define AVIVO_DC_LUT_WRITE_EN_MASK
#define AVIVO_DC_LUT_AUTOFILL
#define AVIVO_DC_LUTA_CONTROL
#define AVIVO_DC_LUTA_BLACK_OFFSET_BLUE
#define AVIVO_DC_LUTA_BLACK_OFFSET_GREEN
#define AVIVO_DC_LUTA_BLACK_OFFSET_RED
#define AVIVO_DC_LUTA_WHITE_OFFSET_BLUE
#define AVIVO_DC_LUTA_WHITE_OFFSET_GREEN
#define AVIVO_DC_LUTA_WHITE_OFFSET_RED
#define AVIVO_DC_LUTB_CONTROL
#define AVIVO_DC_LUTB_BLACK_OFFSET_BLUE
#define AVIVO_DC_LUTB_BLACK_OFFSET_GREEN
#define AVIVO_DC_LUTB_BLACK_OFFSET_RED
#define AVIVO_DC_LUTB_WHITE_OFFSET_BLUE
#define AVIVO_DC_LUTB_WHITE_OFFSET_GREEN
#define AVIVO_DC_LUTB_WHITE_OFFSET_RED

enum ofdrm_model {};

/*
 * Helpers for display nodes
 */

static int display_get_validated_int(struct drm_device *dev, const char *name, uint32_t value)
{}

static int display_get_validated_int0(struct drm_device *dev, const char *name, uint32_t value)
{}

static const struct drm_format_info *display_get_validated_format(struct drm_device *dev,
								  u32 depth, bool big_endian)
{}

static int display_read_u32_of(struct drm_device *dev, struct device_node *of_node,
			       const char *name, u32 *value)
{}

static bool display_get_big_endian_of(struct drm_device *dev, struct device_node *of_node)
{}

static int display_get_width_of(struct drm_device *dev, struct device_node *of_node)
{}

static int display_get_height_of(struct drm_device *dev, struct device_node *of_node)
{}

static int display_get_depth_of(struct drm_device *dev, struct device_node *of_node)
{}

static int display_get_linebytes_of(struct drm_device *dev, struct device_node *of_node)
{}

static u64 display_get_address_of(struct drm_device *dev, struct device_node *of_node)
{}

static bool is_avivo(u32 vendor, u32 device)
{}

static enum ofdrm_model display_get_model_of(struct drm_device *dev, struct device_node *of_node)
{}

/*
 * Open Firmware display device
 */

struct ofdrm_device;

struct ofdrm_device_funcs {};

struct ofdrm_device {};

static struct ofdrm_device *ofdrm_device_of_dev(struct drm_device *dev)
{}

/*
 * Hardware
 */

#if defined(CONFIG_PCI)
static struct pci_dev *display_get_pci_dev_of(struct drm_device *dev, struct device_node *of_node)
{}

static void ofdrm_pci_release(void *data)
{}

static int ofdrm_device_init_pci(struct ofdrm_device *odev)
{}
#else
static int ofdrm_device_init_pci(struct ofdrm_device *odev)
{
	return 0;
}
#endif

/*
 *  OF display settings
 */

static struct resource *ofdrm_find_fb_resource(struct ofdrm_device *odev,
					       struct resource *fb_res)
{}

/*
 * Colormap / Palette
 */

static void __iomem *get_cmap_address_of(struct ofdrm_device *odev, struct device_node *of_node,
					 int bar_no, unsigned long offset, unsigned long size)
{}

static void __iomem *ofdrm_mach64_cmap_ioremap(struct ofdrm_device *odev,
					       struct device_node *of_node,
					       u64 fb_base)
{}

static void ofdrm_mach64_cmap_write(struct ofdrm_device *odev, unsigned char index,
				    unsigned char r, unsigned char g, unsigned char b)
{}

static void __iomem *ofdrm_rage128_cmap_ioremap(struct ofdrm_device *odev,
						struct device_node *of_node,
						u64 fb_base)
{}

static void ofdrm_rage128_cmap_write(struct ofdrm_device *odev, unsigned char index,
				     unsigned char r, unsigned char g, unsigned char b)
{}

static void __iomem *ofdrm_rage_m3a_cmap_ioremap(struct ofdrm_device *odev,
						 struct device_node *of_node,
						 u64 fb_base)
{}

static void ofdrm_rage_m3a_cmap_write(struct ofdrm_device *odev, unsigned char index,
				      unsigned char r, unsigned char g, unsigned char b)
{}

static void __iomem *ofdrm_rage_m3b_cmap_ioremap(struct ofdrm_device *odev,
						 struct device_node *of_node,
						 u64 fb_base)
{}

static void ofdrm_rage_m3b_cmap_write(struct ofdrm_device *odev, unsigned char index,
				      unsigned char r, unsigned char g, unsigned char b)
{}

static void __iomem *ofdrm_radeon_cmap_ioremap(struct ofdrm_device *odev,
					       struct device_node *of_node,
					       u64 fb_base)
{}

static void __iomem *ofdrm_gxt2000_cmap_ioremap(struct ofdrm_device *odev,
						struct device_node *of_node,
						u64 fb_base)
{}

static void ofdrm_gxt2000_cmap_write(struct ofdrm_device *odev, unsigned char index,
				     unsigned char r, unsigned char g, unsigned char b)
{}

static void __iomem *ofdrm_avivo_cmap_ioremap(struct ofdrm_device *odev,
					      struct device_node *of_node,
					      u64 fb_base)
{}

static void ofdrm_avivo_cmap_write(struct ofdrm_device *odev, unsigned char index,
				   unsigned char r, unsigned char g, unsigned char b)
{}

static void __iomem *ofdrm_qemu_cmap_ioremap(struct ofdrm_device *odev,
					     struct device_node *of_node,
					     u64 fb_base)
{}

static void ofdrm_qemu_cmap_write(struct ofdrm_device *odev, unsigned char index,
				  unsigned char r, unsigned char g, unsigned char b)
{}

static void ofdrm_device_set_gamma_linear(struct ofdrm_device *odev,
					  const struct drm_format_info *format)
{}

static void ofdrm_device_set_gamma(struct ofdrm_device *odev,
				   const struct drm_format_info *format,
				   struct drm_color_lut *lut)
{}

/*
 * Modesetting
 */

struct ofdrm_crtc_state {};

static struct ofdrm_crtc_state *to_ofdrm_crtc_state(struct drm_crtc_state *base)
{}

static void ofdrm_crtc_state_destroy(struct ofdrm_crtc_state *ofdrm_crtc_state)
{}

static const uint64_t ofdrm_primary_plane_format_modifiers[] =;

static int ofdrm_primary_plane_helper_atomic_check(struct drm_plane *plane,
						   struct drm_atomic_state *new_state)
{}

static void ofdrm_primary_plane_helper_atomic_update(struct drm_plane *plane,
						     struct drm_atomic_state *state)
{}

static void ofdrm_primary_plane_helper_atomic_disable(struct drm_plane *plane,
						      struct drm_atomic_state *state)
{}

static const struct drm_plane_helper_funcs ofdrm_primary_plane_helper_funcs =;

static const struct drm_plane_funcs ofdrm_primary_plane_funcs =;

static enum drm_mode_status ofdrm_crtc_helper_mode_valid(struct drm_crtc *crtc,
							 const struct drm_display_mode *mode)
{}

static int ofdrm_crtc_helper_atomic_check(struct drm_crtc *crtc,
					  struct drm_atomic_state *new_state)
{}

static void ofdrm_crtc_helper_atomic_flush(struct drm_crtc *crtc, struct drm_atomic_state *state)
{}

/*
 * The CRTC is always enabled. Screen updates are performed by
 * the primary plane's atomic_update function. Disabling clears
 * the screen in the primary plane's atomic_disable function.
 */
static const struct drm_crtc_helper_funcs ofdrm_crtc_helper_funcs =;

static void ofdrm_crtc_reset(struct drm_crtc *crtc)
{}

static struct drm_crtc_state *ofdrm_crtc_atomic_duplicate_state(struct drm_crtc *crtc)
{}

static void ofdrm_crtc_atomic_destroy_state(struct drm_crtc *crtc,
					    struct drm_crtc_state *crtc_state)
{}

static const struct drm_crtc_funcs ofdrm_crtc_funcs =;

static int ofdrm_connector_helper_get_modes(struct drm_connector *connector)
{}

static const struct drm_connector_helper_funcs ofdrm_connector_helper_funcs =;

static const struct drm_connector_funcs ofdrm_connector_funcs =;

static const struct drm_mode_config_funcs ofdrm_mode_config_funcs =;

/*
 * Init / Cleanup
 */

static const struct ofdrm_device_funcs ofdrm_unknown_device_funcs =;

static const struct ofdrm_device_funcs ofdrm_mach64_device_funcs =;

static const struct ofdrm_device_funcs ofdrm_rage128_device_funcs =;

static const struct ofdrm_device_funcs ofdrm_rage_m3a_device_funcs =;

static const struct ofdrm_device_funcs ofdrm_rage_m3b_device_funcs =;

static const struct ofdrm_device_funcs ofdrm_radeon_device_funcs =;

static const struct ofdrm_device_funcs ofdrm_gxt2000_device_funcs =;

static const struct ofdrm_device_funcs ofdrm_avivo_device_funcs =;

static const struct ofdrm_device_funcs ofdrm_qemu_device_funcs =;

static struct drm_display_mode ofdrm_mode(unsigned int width, unsigned int height)
{}

static struct ofdrm_device *ofdrm_device_create(struct drm_driver *drv,
						struct platform_device *pdev)
{}

/*
 * DRM driver
 */

DEFINE_DRM_GEM_FOPS(ofdrm_fops);

static struct drm_driver ofdrm_driver =;

/*
 * Platform driver
 */

static int ofdrm_probe(struct platform_device *pdev)
{}

static void ofdrm_remove(struct platform_device *pdev)
{}

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

static struct platform_driver ofdrm_platform_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();