Commit acae116c authored by Francisco Jerez's avatar Francisco Jerez Committed by Ben Skeggs

drm/nouveau: Use a helper function to match PCI device/subsystem IDs.

Signed-off-by: default avatarFrancisco Jerez <currojerez@riseup.net>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 44a1246f
...@@ -4381,11 +4381,8 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b ...@@ -4381,11 +4381,8 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b
* *
* For the moment, a quirk will do :) * For the moment, a quirk will do :)
*/ */
if ((dev->pdev->device == 0x01d7) && if (nv_match_device(dev, 0x01d7, 0x1028, 0x01c2))
(dev->pdev->subsystem_vendor == 0x1028) &&
(dev->pdev->subsystem_device == 0x01c2)) {
bios->fp.duallink_transition_clk = 80000; bios->fp.duallink_transition_clk = 80000;
}
/* set dual_link flag for EDID case */ /* set dual_link flag for EDID case */
if (pxclk && (chip_version < 0x25 || chip_version > 0x28)) if (pxclk && (chip_version < 0x25 || chip_version > 0x28))
...@@ -5814,9 +5811,7 @@ parse_dcb_gpio_table(struct nvbios *bios) ...@@ -5814,9 +5811,7 @@ parse_dcb_gpio_table(struct nvbios *bios)
*/ */
/* Apple iMac G4 NV18 */ /* Apple iMac G4 NV18 */
if (dev->pdev->device == 0x0189 && if (nv_match_device(dev, 0x0189, 0x10de, 0x0010)) {
dev->pdev->subsystem_vendor == 0x10de &&
dev->pdev->subsystem_device == 0x0010) {
struct dcb_gpio_entry *gpio = new_gpio_entry(bios); struct dcb_gpio_entry *gpio = new_gpio_entry(bios);
gpio->tag = DCB_GPIO_TVDAC0; gpio->tag = DCB_GPIO_TVDAC0;
...@@ -5898,9 +5893,7 @@ apply_dcb_connector_quirks(struct nvbios *bios, int idx) ...@@ -5898,9 +5893,7 @@ apply_dcb_connector_quirks(struct nvbios *bios, int idx)
struct drm_device *dev = bios->dev; struct drm_device *dev = bios->dev;
/* Gigabyte NX85T */ /* Gigabyte NX85T */
if ((dev->pdev->device == 0x0421) && if (nv_match_device(dev, 0x0421, 0x1458, 0x344c)) {
(dev->pdev->subsystem_vendor == 0x1458) &&
(dev->pdev->subsystem_device == 0x344c)) {
if (cte->type == DCB_CONNECTOR_HDMI_1) if (cte->type == DCB_CONNECTOR_HDMI_1)
cte->type = DCB_CONNECTOR_DVI_I; cte->type = DCB_CONNECTOR_DVI_I;
} }
...@@ -6321,9 +6314,7 @@ apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf) ...@@ -6321,9 +6314,7 @@ apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf)
* nasty problems until this is sorted (assuming it's not a * nasty problems until this is sorted (assuming it's not a
* VBIOS bug). * VBIOS bug).
*/ */
if ((dev->pdev->device == 0x040d) && if (nv_match_device(dev, 0x040d, 0x1028, 0x019b)) {
(dev->pdev->subsystem_vendor == 0x1028) &&
(dev->pdev->subsystem_device == 0x019b)) {
if (*conn == 0x02026312 && *conf == 0x00000020) if (*conn == 0x02026312 && *conf == 0x00000020)
return false; return false;
} }
......
...@@ -1389,6 +1389,15 @@ nv_two_reg_pll(struct drm_device *dev) ...@@ -1389,6 +1389,15 @@ nv_two_reg_pll(struct drm_device *dev)
return false; return false;
} }
static inline bool
nv_match_device(struct drm_device *dev, unsigned device,
unsigned sub_vendor, unsigned sub_device)
{
return dev->pdev->device == device &&
dev->pdev->subsystem_vendor == sub_vendor &&
dev->pdev->subsystem_device == sub_device;
}
#define NV_SW 0x0000506e #define NV_SW 0x0000506e
#define NV_SW_DMA_SEMAPHORE 0x00000060 #define NV_SW_DMA_SEMAPHORE 0x00000060
#define NV_SW_SEMAPHORE_OFFSET 0x00000064 #define NV_SW_SEMAPHORE_OFFSET 0x00000064
......
...@@ -121,18 +121,14 @@ static bool ...@@ -121,18 +121,14 @@ static bool
get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask) get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask)
{ {
/* Zotac FX5200 */ /* Zotac FX5200 */
if (dev->pdev->device == 0x0322 && if (nv_match_device(dev, 0x0322, 0x19da, 0x1035) ||
dev->pdev->subsystem_vendor == 0x19da && nv_match_device(dev, 0x0322, 0x19da, 0x2035)) {
(dev->pdev->subsystem_device == 0x1035 ||
dev->pdev->subsystem_device == 0x2035)) {
*pin_mask = 0xc; *pin_mask = 0xc;
return false; return false;
} }
/* MSI nForce2 IGP */ /* MSI nForce2 IGP */
if (dev->pdev->device == 0x01f0 && if (nv_match_device(dev, 0x01f0, 0x1462, 0x5710)) {
dev->pdev->subsystem_vendor == 0x1462 &&
dev->pdev->subsystem_device == 0x5710) {
*pin_mask = 0xc; *pin_mask = 0xc;
return false; return false;
} }
......
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