linux/drivers/gpu/drm/gma500/psb_drv.c

// SPDX-License-Identifier: GPL-2.0-only
/**************************************************************************
 * Copyright (c) 2007-2011, Intel Corporation.
 * All Rights Reserved.
 * Copyright (c) 2008, Tungsten Graphics, Inc. Cedar Park, TX., USA.
 * All Rights Reserved.
 *
 **************************************************************************/

#include <linux/aperture.h>
#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/pm_runtime.h>
#include <linux/spinlock.h>
#include <linux/delay.h>

#include <asm/set_memory.h>

#include <acpi/video.h>

#include <drm/drm.h>
#include <drm/drm_drv.h>
#include <drm/drm_file.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_pciids.h>
#include <drm/drm_vblank.h>

#include "framebuffer.h"
#include "gem.h"
#include "intel_bios.h"
#include "mid_bios.h"
#include "power.h"
#include "psb_drv.h"
#include "psb_intel_reg.h"
#include "psb_irq.h"
#include "psb_reg.h"

static const struct drm_driver driver;
static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);

/*
 * The table below contains a mapping of the PCI vendor ID and the PCI Device ID
 * to the different groups of PowerVR 5-series chip designs
 *
 * 0x8086 = Intel Corporation
 *
 * PowerVR SGX535    - Poulsbo    - Intel GMA 500, Intel Atom Z5xx
 * PowerVR SGX535    - Moorestown - Intel GMA 600
 * PowerVR SGX535    - Oaktrail   - Intel GMA 600, Intel Atom Z6xx, E6xx
 * PowerVR SGX545    - Cedartrail - Intel GMA 3600, Intel Atom D2500, N2600
 * PowerVR SGX545    - Cedartrail - Intel GMA 3650, Intel Atom D2550, D2700,
 *                                  N2800
 */
static const struct pci_device_id pciidlist[] =;
MODULE_DEVICE_TABLE(pci, pciidlist);

/*
 * Standard IOCTLs.
 */
static const struct drm_ioctl_desc psb_ioctls[] =;

/**
 *	psb_spank		-	reset the 2D engine
 *	@dev_priv: our PSB DRM device
 *
 *	Soft reset the graphics engine and then reload the necessary registers.
 */
static void psb_spank(struct drm_psb_private *dev_priv)
{}

static int psb_do_init(struct drm_device *dev)
{}

static void psb_driver_unload(struct drm_device *dev)
{}

static void psb_device_release(void *data)
{}

static int psb_driver_load(struct drm_device *dev, unsigned long flags)
{}

/*
 * Hardware for gma500 is a hybrid device, which both acts as a PCI
 * device (for legacy vga functionality) but also more like an
 * integrated display on a SoC where the framebuffer simply
 * resides in main memory and not in a special PCI bar (that
 * internally redirects to a stolen range of main memory) like all
 * other integrated PCI display devices implement it.
 *
 * To catch all cases we need to remove conflicting firmware devices
 * for the stolen system memory and for the VGA functionality. As we
 * currently cannot easily find the framebuffer's location in stolen
 * memory, we remove all framebuffers here.
 *
 * TODO: Refactor psb_driver_load() to map vdc_reg earlier. Then
 *       we might be able to read the framebuffer range from the
 *       device.
 */
static int gma_remove_conflicting_framebuffers(struct pci_dev *pdev,
					       const struct drm_driver *req_driver)
{}

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

static void psb_pci_remove(struct pci_dev *pdev)
{}

static DEFINE_RUNTIME_DEV_PM_OPS(psb_pm_ops, gma_power_suspend, gma_power_resume, NULL);

static const struct file_operations psb_gem_fops =;

static const struct drm_driver driver =;

static struct pci_driver psb_pci_driver =;

static int __init psb_init(void)
{}

static void __exit psb_exit(void)
{}

late_initcall(psb_init);
module_exit(psb_exit);

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