Commit c7af0ff0 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/device: import pciid list and integrate quirks with it

PCI IDs taken from the NVIDIA binary driver, with permission.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 7e8820fe
......@@ -132,16 +132,8 @@ get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask)
struct nouveau_drm *drm = nouveau_drm(dev);
struct nvkm_device *device = nvxx_device(&drm->device);
/* Zotac FX5200 */
if (nv_device_match(device, 0x0322, 0x19da, 0x1035) ||
nv_device_match(device, 0x0322, 0x19da, 0x2035)) {
*pin_mask = 0xc;
return false;
}
/* MSI nForce2 IGP */
if (nv_device_match(device, 0x01f0, 0x1462, 0x5710)) {
*pin_mask = 0xc;
if (device->quirk && device->quirk->tv_pin_mask) {
*pin_mask = device->quirk->tv_pin_mask;
return false;
}
......
......@@ -153,6 +153,9 @@ struct nvkm_device_func {
};
struct nvkm_device_quirk {
u8 tv_pin_mask;
u8 tv_gpio;
bool War00C800_0;
};
struct nvkm_device_chip {
......@@ -217,14 +220,6 @@ int nvkm_device_list(u64 *name, int size);
_temp; \
})
static inline bool
nv_device_match(struct nvkm_device *device, u16 dev, u16 ven, u16 sub)
{
return device->pdev->device == dev &&
device->pdev->subsystem_vendor == ven &&
device->pdev->subsystem_device == sub;
}
static inline bool
nv_device_is_pci(struct nvkm_device *device)
{
......
......@@ -61,11 +61,11 @@ nvkm_gpio_find(struct nvkm_gpio *gpio, int idx, u8 tag, u8 line,
return 0;
/* Apple iMac G4 NV18 */
if (nv_device_match(device, 0x0189, 0x10de, 0x0010)) {
if (device->quirk && device->quirk->tv_gpio) {
if (tag == DCB_GPIO_TVDAC0) {
*func = (struct dcb_gpio_func) {
.func = DCB_GPIO_TVDAC0,
.line = 4,
.line = device->quirk->tv_gpio,
.log[0] = 0,
.log[1] = 1,
};
......
......@@ -26,7 +26,6 @@
#include "priv.h"
#include "fuc/gf119.fuc4.h"
#include <core/device.h>
#include <core/option.h>
#include <subdev/timer.h>
......@@ -78,9 +77,8 @@ gk104_pmu_pgob(struct nvkm_pmu *pmu, bool enable)
nvkm_mask(device, 0x000200, 0x00001000, 0x00001000);
nvkm_rd32(device, 0x000200);
if (nv_device_match(device, 0x11fc, 0x17aa, 0x2211) /* Lenovo W541 */
|| nv_device_match(device, 0x11fc, 0x17aa, 0x221e) /* Lenovo W541 */
|| nvkm_boolopt(device->cfgopt, "War00C800_0", false)) {
if ( nvkm_boolopt(device->cfgopt, "War00C800_0",
device->quirk ? device->quirk->War00C800_0 : false)) {
nvkm_info(&pmu->subdev, "hw bug workaround enabled\n");
switch (device->chipset) {
case 0xe4:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment