Pull drm updates from Dave Airlie:
"This is the main drm pull, it has a shared branch with some alsa
crossover but everything should be acked by relevant people.
New drivers:
- ATMEL HLCDC driver
- designware HDMI core support (used in multiple SoCs).
core:
- lots more atomic modesetting work, properties and atomic ioctl
(hidden under option)
- bridge rework allows support for Samsung exynos chromebooks to
work finally.
- some more panels supported
i915:
- atomic plane update support
- DSI uses shared DSI infrastructure
- Skylake basic support is all merged now
- component framework used for i915/snd-hda interactions
- write-combine cpu memory mappings
- engine init code refactored
- full ppgtt enabled where execlists are enabled.
- cherryview rps/gpu turbo and pipe CRC support.
radeon:
- indirect draw support for evergreen/cayman
- SMC and manual fan control for SI/CI
- Displayport audio support
amdkfd:
- SDMA usermode queue support
- replace suballocator usage with more suitable one
- rework for allowing interfacing to more than radeon
nouveau:
- major renaming in prep for later splitting work
- merge arm platform driver into nouveau
- GK20A reclocking support
msm:
- conversion to atomic modesetting
- YUV support for mdp4/5
- eDP support
- hw cursor for mdp5
tegra:
- conversion to atomic modesetting
- better suspend/resume support for child devices
rcar-du:
- interlaced support
imx:
- move to using dw_hdmi shared support
- mode_fixup support
sti:
- DVO support
- HDMI infoframe support
exynos:
- refactoring and cleanup, removed lots of internal unnecessary
abstraction
- exynos7 DECON display controller support
Along with the usual bunch of fixes, cleanups etc"
* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (724 commits)
drm/radeon: fix voltage setup on hawaii
drm/radeon/dp: Set EDP_CONFIGURATION_SET for bridge chips if necessary
drm/radeon: only enable kv/kb dpm interrupts once v3
drm/radeon: workaround for CP HW bug on CIK
drm/radeon: Don't try to enable write-combining without PAT
drm/radeon: use 0-255 rather than 0-100 for pwm fan range
drm/i915: Clamp efficient frequency to valid range
drm/i915: Really ignore long HPD pulses on eDP
drm/exynos: Add DECON driver
drm/i915: Correct the base value while updating LP_OUTPUT_HOLD in MIPI_PORT_CTRL
drm/i915: Insert a command barrier on BLT/BSD cache flushes
drm/i915: Drop vblank wait from intel_dp_link_down
drm/exynos: fix NULL pointer reference
drm/exynos: remove exynos_plane_dpms
drm/exynos: remove mode property of exynos crtc
drm/exynos: Remove exynos_plane_dpms() call with no effect
drm/i915: Squelch overzealous uncore reset WARN_ON
drm/i915: Take runtime pm reference on hangcheck_info
drm/i915: Correct the IOSF Dev_FN field for IOSF transfers
drm/exynos: fix DMA_ATTR_NO_KERNEL_MAPPING usage
...
148 lines
4.1 KiB
C
148 lines
4.1 KiB
C
/*
|
|
* Copyright 2014 Advanced Micro Devices, Inc.
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
* to deal in the Software without restriction, including without limitation
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/moduleparam.h>
|
|
#include <linux/device.h>
|
|
#include "kfd_priv.h"
|
|
|
|
#define KFD_DRIVER_AUTHOR "AMD Inc. and others"
|
|
|
|
#define KFD_DRIVER_DESC "Standalone HSA driver for AMD's GPUs"
|
|
#define KFD_DRIVER_DATE "20150122"
|
|
#define KFD_DRIVER_MAJOR 0
|
|
#define KFD_DRIVER_MINOR 7
|
|
#define KFD_DRIVER_PATCHLEVEL 1
|
|
|
|
const struct kfd2kgd_calls *kfd2kgd;
|
|
static const struct kgd2kfd_calls kgd2kfd = {
|
|
.exit = kgd2kfd_exit,
|
|
.probe = kgd2kfd_probe,
|
|
.device_init = kgd2kfd_device_init,
|
|
.device_exit = kgd2kfd_device_exit,
|
|
.interrupt = kgd2kfd_interrupt,
|
|
.suspend = kgd2kfd_suspend,
|
|
.resume = kgd2kfd_resume,
|
|
};
|
|
|
|
int sched_policy = KFD_SCHED_POLICY_HWS;
|
|
module_param(sched_policy, int, 0444);
|
|
MODULE_PARM_DESC(sched_policy,
|
|
"Scheduling policy (0 = HWS (Default), 1 = HWS without over-subscription, 2 = Non-HWS (Used for debugging only)");
|
|
|
|
int max_num_of_queues_per_device = KFD_MAX_NUM_OF_QUEUES_PER_DEVICE_DEFAULT;
|
|
module_param(max_num_of_queues_per_device, int, 0444);
|
|
MODULE_PARM_DESC(max_num_of_queues_per_device,
|
|
"Maximum number of supported queues per device (1 = Minimum, 4096 = default)");
|
|
|
|
bool kgd2kfd_init(unsigned interface_version,
|
|
const struct kfd2kgd_calls *f2g,
|
|
const struct kgd2kfd_calls **g2f)
|
|
{
|
|
/*
|
|
* Only one interface version is supported,
|
|
* no kfd/kgd version skew allowed.
|
|
*/
|
|
if (interface_version != KFD_INTERFACE_VERSION)
|
|
return false;
|
|
|
|
/* Protection against multiple amd kgd loads */
|
|
if (kfd2kgd)
|
|
return true;
|
|
|
|
kfd2kgd = f2g;
|
|
*g2f = &kgd2kfd;
|
|
|
|
return true;
|
|
}
|
|
EXPORT_SYMBOL(kgd2kfd_init);
|
|
|
|
void kgd2kfd_exit(void)
|
|
{
|
|
}
|
|
|
|
static int __init kfd_module_init(void)
|
|
{
|
|
int err;
|
|
|
|
kfd2kgd = NULL;
|
|
|
|
/* Verify module parameters */
|
|
if ((sched_policy < KFD_SCHED_POLICY_HWS) ||
|
|
(sched_policy > KFD_SCHED_POLICY_NO_HWS)) {
|
|
pr_err("kfd: sched_policy has invalid value\n");
|
|
return -1;
|
|
}
|
|
|
|
/* Verify module parameters */
|
|
if ((max_num_of_queues_per_device < 1) ||
|
|
(max_num_of_queues_per_device >
|
|
KFD_MAX_NUM_OF_QUEUES_PER_DEVICE)) {
|
|
pr_err("kfd: max_num_of_queues_per_device must be between 1 to KFD_MAX_NUM_OF_QUEUES_PER_DEVICE\n");
|
|
return -1;
|
|
}
|
|
|
|
err = kfd_pasid_init();
|
|
if (err < 0)
|
|
goto err_pasid;
|
|
|
|
err = kfd_chardev_init();
|
|
if (err < 0)
|
|
goto err_ioctl;
|
|
|
|
err = kfd_topology_init();
|
|
if (err < 0)
|
|
goto err_topology;
|
|
|
|
kfd_process_create_wq();
|
|
|
|
dev_info(kfd_device, "Initialized module\n");
|
|
|
|
return 0;
|
|
|
|
err_topology:
|
|
kfd_chardev_exit();
|
|
err_ioctl:
|
|
kfd_pasid_exit();
|
|
err_pasid:
|
|
return err;
|
|
}
|
|
|
|
static void __exit kfd_module_exit(void)
|
|
{
|
|
kfd_process_destroy_wq();
|
|
kfd_topology_shutdown();
|
|
kfd_chardev_exit();
|
|
kfd_pasid_exit();
|
|
dev_info(kfd_device, "Removed module\n");
|
|
}
|
|
|
|
module_init(kfd_module_init);
|
|
module_exit(kfd_module_exit);
|
|
|
|
MODULE_AUTHOR(KFD_DRIVER_AUTHOR);
|
|
MODULE_DESCRIPTION(KFD_DRIVER_DESC);
|
|
MODULE_LICENSE("GPL and additional rights");
|
|
MODULE_VERSION(__stringify(KFD_DRIVER_MAJOR) "."
|
|
__stringify(KFD_DRIVER_MINOR) "."
|
|
__stringify(KFD_DRIVER_PATCHLEVEL));
|