提交 c7af0ff0 编写于 作者: B 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: NBen Skeggs <bskeggs@redhat.com>
上级 7e8820fe
...@@ -132,16 +132,8 @@ get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask) ...@@ -132,16 +132,8 @@ get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask)
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->device);
/* Zotac FX5200 */ if (device->quirk && device->quirk->tv_pin_mask) {
if (nv_device_match(device, 0x0322, 0x19da, 0x1035) || *pin_mask = device->quirk->tv_pin_mask;
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;
return false; return false;
} }
......
...@@ -153,6 +153,9 @@ struct nvkm_device_func { ...@@ -153,6 +153,9 @@ struct nvkm_device_func {
}; };
struct nvkm_device_quirk { struct nvkm_device_quirk {
u8 tv_pin_mask;
u8 tv_gpio;
bool War00C800_0;
}; };
struct nvkm_device_chip { struct nvkm_device_chip {
...@@ -217,14 +220,6 @@ int nvkm_device_list(u64 *name, int size); ...@@ -217,14 +220,6 @@ int nvkm_device_list(u64 *name, int size);
_temp; \ _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 static inline bool
nv_device_is_pci(struct nvkm_device *device) 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, ...@@ -61,11 +61,11 @@ nvkm_gpio_find(struct nvkm_gpio *gpio, int idx, u8 tag, u8 line,
return 0; return 0;
/* Apple iMac G4 NV18 */ /* Apple iMac G4 NV18 */
if (nv_device_match(device, 0x0189, 0x10de, 0x0010)) { if (device->quirk && device->quirk->tv_gpio) {
if (tag == DCB_GPIO_TVDAC0) { if (tag == DCB_GPIO_TVDAC0) {
*func = (struct dcb_gpio_func) { *func = (struct dcb_gpio_func) {
.func = DCB_GPIO_TVDAC0, .func = DCB_GPIO_TVDAC0,
.line = 4, .line = device->quirk->tv_gpio,
.log[0] = 0, .log[0] = 0,
.log[1] = 1, .log[1] = 1,
}; };
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "priv.h" #include "priv.h"
#include "fuc/gf119.fuc4.h" #include "fuc/gf119.fuc4.h"
#include <core/device.h>
#include <core/option.h> #include <core/option.h>
#include <subdev/timer.h> #include <subdev/timer.h>
...@@ -78,9 +77,8 @@ gk104_pmu_pgob(struct nvkm_pmu *pmu, bool enable) ...@@ -78,9 +77,8 @@ gk104_pmu_pgob(struct nvkm_pmu *pmu, bool enable)
nvkm_mask(device, 0x000200, 0x00001000, 0x00001000); nvkm_mask(device, 0x000200, 0x00001000, 0x00001000);
nvkm_rd32(device, 0x000200); nvkm_rd32(device, 0x000200);
if (nv_device_match(device, 0x11fc, 0x17aa, 0x2211) /* Lenovo W541 */ if ( nvkm_boolopt(device->cfgopt, "War00C800_0",
|| nv_device_match(device, 0x11fc, 0x17aa, 0x221e) /* Lenovo W541 */ device->quirk ? device->quirk->War00C800_0 : false)) {
|| nvkm_boolopt(device->cfgopt, "War00C800_0", false)) {
nvkm_info(&pmu->subdev, "hw bug workaround enabled\n"); nvkm_info(&pmu->subdev, "hw bug workaround enabled\n");
switch (device->chipset) { switch (device->chipset) {
case 0xe4: case 0xe4:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册