#include <linux/compat.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/vga_switcheroo.h>
#include <linux/mmu_notifier.h>
#include <linux/pci.h>
#include <drm/drm_aperture.h>
#include <drm/drm_drv.h>
#include <drm/drm_file.h>
#include <drm/drm_gem.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_pciids.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_vblank.h>
#include <drm/radeon_drm.h>
#include "radeon_drv.h"
#include "radeon.h"
#include "radeon_kms.h"
#include "radeon_ttm.h"
#include "radeon_device.h"
#include "radeon_prime.h"
#define KMS_DRIVER_MAJOR …
#define KMS_DRIVER_MINOR …
#define KMS_DRIVER_PATCHLEVEL …
int radeon_no_wb;
int radeon_modeset = …;
int radeon_dynclks = …;
int radeon_r4xx_atom;
int radeon_agpmode = …;
int radeon_vram_limit;
int radeon_gart_size = …;
int radeon_benchmarking;
int radeon_testing;
int radeon_connector_table;
int radeon_tv = …;
int radeon_audio = …;
int radeon_disp_priority;
int radeon_hw_i2c;
int radeon_pcie_gen2 = …;
int radeon_msi = …;
int radeon_lockup_timeout = …;
int radeon_fastfb;
int radeon_dpm = …;
int radeon_aspm = …;
int radeon_runtime_pm = …;
int radeon_hard_reset;
int radeon_vm_size = …;
int radeon_vm_block_size = …;
int radeon_deep_color;
int radeon_use_pflipirq = …;
int radeon_bapm = …;
int radeon_backlight = …;
int radeon_auxch = …;
int radeon_uvd = …;
int radeon_vce = …;
MODULE_PARM_DESC(…) …;
module_param_named(no_wb, radeon_no_wb, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(modeset, radeon_modeset, int, 0400);
MODULE_PARM_DESC(…) …;
module_param_named(dynclks, radeon_dynclks, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(r4xx_atom, radeon_r4xx_atom, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(vramlimit, radeon_vram_limit, int, 0600);
MODULE_PARM_DESC(…) …;
module_param_named(agpmode, radeon_agpmode, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(gartsize, radeon_gart_size, int, 0600);
MODULE_PARM_DESC(…) …;
module_param_named(benchmark, radeon_benchmarking, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(test, radeon_testing, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(connector_table, radeon_connector_table, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(tv, radeon_tv, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(audio, radeon_audio, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(disp_priority, radeon_disp_priority, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(hw_i2c, radeon_hw_i2c, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(pcie_gen2, radeon_pcie_gen2, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(msi, radeon_msi, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(lockup_timeout, radeon_lockup_timeout, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(fastfb, radeon_fastfb, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(dpm, radeon_dpm, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(aspm, radeon_aspm, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(runpm, radeon_runtime_pm, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(hard_reset, radeon_hard_reset, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(vm_size, radeon_vm_size, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(vm_block_size, radeon_vm_block_size, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(deep_color, radeon_deep_color, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(use_pflipirq, radeon_use_pflipirq, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(bapm, radeon_bapm, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(backlight, radeon_backlight, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(auxch, radeon_auxch, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(uvd, radeon_uvd, int, 0444);
MODULE_PARM_DESC(…) …;
module_param_named(vce, radeon_vce, int, 0444);
int radeon_si_support = …;
MODULE_PARM_DESC(…) …;
module_param_named(si_support, radeon_si_support, int, 0444);
int radeon_cik_support = …;
MODULE_PARM_DESC(…) …;
module_param_named(cik_support, radeon_cik_support, int, 0444);
static struct pci_device_id pciidlist[] = …;
MODULE_DEVICE_TABLE(pci, pciidlist);
static const struct drm_driver kms_driver;
static int radeon_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{ … }
static void
radeon_pci_remove(struct pci_dev *pdev)
{ … }
static void
radeon_pci_shutdown(struct pci_dev *pdev)
{ … }
static int radeon_pmops_suspend(struct device *dev)
{ … }
static int radeon_pmops_resume(struct device *dev)
{ … }
static int radeon_pmops_freeze(struct device *dev)
{ … }
static int radeon_pmops_thaw(struct device *dev)
{ … }
static int radeon_pmops_runtime_suspend(struct device *dev)
{ … }
static int radeon_pmops_runtime_resume(struct device *dev)
{ … }
static int radeon_pmops_runtime_idle(struct device *dev)
{ … }
long radeon_drm_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg)
{ … }
#ifdef CONFIG_COMPAT
static long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{ … }
#endif
static const struct dev_pm_ops radeon_pm_ops = …;
static const struct file_operations radeon_driver_kms_fops = …;
static const struct drm_ioctl_desc radeon_ioctls_kms[] = …;
static const struct drm_driver kms_driver = …;
static struct pci_driver radeon_kms_pci_driver = …;
static int __init radeon_module_init(void)
{ … }
static void __exit radeon_module_exit(void)
{ … }
module_init(…) …;
module_exit(radeon_module_exit);
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;