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

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright 2012-2019 Red Hat
 *
 * This file is subject to the terms and conditions of the GNU General
 * Public License version 2. See the file COPYING in the main
 * directory of this archive for more details.
 *
 * Authors: Matthew Garrett
 *	    Dave Airlie
 *	    Gerd Hoffmann
 *
 * Portions of this code derived from cirrusfb.c:
 * drivers/video/cirrusfb.c - driver for Cirrus Logic chipsets
 *
 * Copyright 1999-2001 Jeff Garzik <[email protected]>
 */

#include <linux/iosys-map.h>
#include <linux/module.h>
#include <linux/pci.h>

#include <video/cirrus.h>
#include <video/vga.h>

#include <drm/drm_aperture.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_connector.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_edid.h>
#include <drm/drm_fbdev_shmem.h>
#include <drm/drm_file.h>
#include <drm/drm_format_helper.h>
#include <drm/drm_fourcc.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_ioctl.h>
#include <drm/drm_managed.h>
#include <drm/drm_modeset_helper_vtables.h>
#include <drm/drm_module.h>
#include <drm/drm_probe_helper.h>

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

#define CIRRUS_MAX_PITCH
#define CIRRUS_VRAM_SIZE

struct cirrus_device {};

#define to_cirrus(_dev)

struct cirrus_primary_plane_state {};

static inline struct cirrus_primary_plane_state *
to_cirrus_primary_plane_state(struct drm_plane_state *plane_state)
{
	return container_of(plane_state, struct cirrus_primary_plane_state, base.base);
};

/* ------------------------------------------------------------------ */
/*
 * The meat of this driver. The core passes us a mode and we have to program
 * it. The modesetting here is the bare minimum required to satisfy the qemu
 * emulation of this hardware, and running this against a real device is
 * likely to result in an inadequately programmed mode. We've already had
 * the opportunity to modify the mode, so whatever we receive here should
 * be something that can be correctly programmed and displayed
 */

#define SEQ_INDEX
#define SEQ_DATA

static u8 rreg_seq(struct cirrus_device *cirrus, u8 reg)
{}

static void wreg_seq(struct cirrus_device *cirrus, u8 reg, u8 val)
{}

#define CRT_INDEX
#define CRT_DATA

static u8 rreg_crt(struct cirrus_device *cirrus, u8 reg)
{}

static void wreg_crt(struct cirrus_device *cirrus, u8 reg, u8 val)
{}

#define GFX_INDEX
#define GFX_DATA

static void wreg_gfx(struct cirrus_device *cirrus, u8 reg, u8 val)
{}

#define VGA_DAC_MASK

static void wreg_hdr(struct cirrus_device *cirrus, u8 val)
{}

static const struct drm_format_info *cirrus_convert_to(struct drm_framebuffer *fb)
{}

static const struct drm_format_info *cirrus_format(struct drm_framebuffer *fb)
{}

static int cirrus_pitch(struct drm_framebuffer *fb)
{}

static void cirrus_set_start_address(struct cirrus_device *cirrus, u32 offset)
{}

static void cirrus_mode_set(struct cirrus_device *cirrus,
			    struct drm_display_mode *mode)
{}

static void cirrus_format_set(struct cirrus_device *cirrus,
			      const struct drm_format_info *format)
{}

static void cirrus_pitch_set(struct cirrus_device *cirrus, unsigned int pitch)
{}

/* ------------------------------------------------------------------ */
/* cirrus display pipe						      */

static const uint32_t cirrus_primary_plane_formats[] =;

static const uint64_t cirrus_primary_plane_format_modifiers[] =;

static int cirrus_primary_plane_helper_atomic_check(struct drm_plane *plane,
						    struct drm_atomic_state *state)
{}

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

static const struct drm_plane_helper_funcs cirrus_primary_plane_helper_funcs =;

static struct drm_plane_state *
cirrus_primary_plane_atomic_duplicate_state(struct drm_plane *plane)
{}

static void cirrus_primary_plane_atomic_destroy_state(struct drm_plane *plane,
						      struct drm_plane_state *plane_state)
{}

static void cirrus_reset_primary_plane(struct drm_plane *plane)
{}

static const struct drm_plane_funcs cirrus_primary_plane_funcs =;

static int cirrus_crtc_helper_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state)
{}

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

static const struct drm_crtc_helper_funcs cirrus_crtc_helper_funcs =;

static const struct drm_crtc_funcs cirrus_crtc_funcs =;

static const struct drm_encoder_funcs cirrus_encoder_funcs =;

static int cirrus_connector_helper_get_modes(struct drm_connector *connector)
{}

static const struct drm_connector_helper_funcs cirrus_connector_helper_funcs =;

static const struct drm_connector_funcs cirrus_connector_funcs =;

static int cirrus_pipe_init(struct cirrus_device *cirrus)
{}

/* ------------------------------------------------------------------ */
/* cirrus framebuffers & mode config				      */

static enum drm_mode_status cirrus_mode_config_mode_valid(struct drm_device *dev,
							  const struct drm_display_mode *mode)
{}

static const struct drm_mode_config_funcs cirrus_mode_config_funcs =;

static int cirrus_mode_config_init(struct cirrus_device *cirrus)
{}

/* ------------------------------------------------------------------ */

DEFINE_DRM_GEM_FOPS(cirrus_fops);

static const struct drm_driver cirrus_driver =;

static int cirrus_pci_probe(struct pci_dev *pdev,
			    const struct pci_device_id *ent)
{}

static void cirrus_pci_remove(struct pci_dev *pdev)
{}

static void cirrus_pci_shutdown(struct pci_dev *pdev)
{}

static const struct pci_device_id pciidlist[] =;

static struct pci_driver cirrus_pci_driver =;

drm_module_pci_driver()

MODULE_DEVICE_TABLE(pci, pciidlist);
MODULE_DESCRIPTION();
MODULE_LICENSE();