aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-08-15 08:31:31 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-08-26 01:11:11 -0400
commitacae116ce16833859eb4eb929de571b9a800d685 (patch)
tree89e549206060cd54fd35ed0ca24c899bc7a57fdd /drivers
parent44a1246f320312b84134a962caf3bf6af989e193 (diff)
drm/nouveau: Use a helper function to match PCI device/subsystem IDs.
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c17
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h9
-rw-r--r--drivers/gpu/drm/nouveau/nv17_tv.c10
3 files changed, 16 insertions, 20 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index e10d851a7240..b54597f6eadf 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -4381,11 +4381,8 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b
4381 * 4381 *
4382 * For the moment, a quirk will do :) 4382 * For the moment, a quirk will do :)
4383 */ 4383 */
4384 if ((dev->pdev->device == 0x01d7) && 4384 if (nv_match_device(dev, 0x01d7, 0x1028, 0x01c2))
4385 (dev->pdev->subsystem_vendor == 0x1028) &&
4386 (dev->pdev->subsystem_device == 0x01c2)) {
4387 bios->fp.duallink_transition_clk = 80000; 4385 bios->fp.duallink_transition_clk = 80000;
4388 }
4389 4386
4390 /* set dual_link flag for EDID case */ 4387 /* set dual_link flag for EDID case */
4391 if (pxclk && (chip_version < 0x25 || chip_version > 0x28)) 4388 if (pxclk && (chip_version < 0x25 || chip_version > 0x28))
@@ -5814,9 +5811,7 @@ parse_dcb_gpio_table(struct nvbios *bios)
5814 */ 5811 */
5815 5812
5816 /* Apple iMac G4 NV18 */ 5813 /* Apple iMac G4 NV18 */
5817 if (dev->pdev->device == 0x0189 && 5814 if (nv_match_device(dev, 0x0189, 0x10de, 0x0010)) {
5818 dev->pdev->subsystem_vendor == 0x10de &&
5819 dev->pdev->subsystem_device == 0x0010) {
5820 struct dcb_gpio_entry *gpio = new_gpio_entry(bios); 5815 struct dcb_gpio_entry *gpio = new_gpio_entry(bios);
5821 5816
5822 gpio->tag = DCB_GPIO_TVDAC0; 5817 gpio->tag = DCB_GPIO_TVDAC0;
@@ -5898,9 +5893,7 @@ apply_dcb_connector_quirks(struct nvbios *bios, int idx)
5898 struct drm_device *dev = bios->dev; 5893 struct drm_device *dev = bios->dev;
5899 5894
5900 /* Gigabyte NX85T */ 5895 /* Gigabyte NX85T */
5901 if ((dev->pdev->device == 0x0421) && 5896 if (nv_match_device(dev, 0x0421, 0x1458, 0x344c)) {
5902 (dev->pdev->subsystem_vendor == 0x1458) &&
5903 (dev->pdev->subsystem_device == 0x344c)) {
5904 if (cte->type == DCB_CONNECTOR_HDMI_1) 5897 if (cte->type == DCB_CONNECTOR_HDMI_1)
5905 cte->type = DCB_CONNECTOR_DVI_I; 5898 cte->type = DCB_CONNECTOR_DVI_I;
5906 } 5899 }
@@ -6321,9 +6314,7 @@ apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf)
6321 * nasty problems until this is sorted (assuming it's not a 6314 * nasty problems until this is sorted (assuming it's not a
6322 * VBIOS bug). 6315 * VBIOS bug).
6323 */ 6316 */
6324 if ((dev->pdev->device == 0x040d) && 6317 if (nv_match_device(dev, 0x040d, 0x1028, 0x019b)) {
6325 (dev->pdev->subsystem_vendor == 0x1028) &&
6326 (dev->pdev->subsystem_device == 0x019b)) {
6327 if (*conn == 0x02026312 && *conf == 0x00000020) 6318 if (*conn == 0x02026312 && *conf == 0x00000020)
6328 return false; 6319 return false;
6329 } 6320 }
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 1e093a069b7b..b1be617373b6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -1389,6 +1389,15 @@ nv_two_reg_pll(struct drm_device *dev)
1389 return false; 1389 return false;
1390} 1390}
1391 1391
1392static inline bool
1393nv_match_device(struct drm_device *dev, unsigned device,
1394 unsigned sub_vendor, unsigned sub_device)
1395{
1396 return dev->pdev->device == device &&
1397 dev->pdev->subsystem_vendor == sub_vendor &&
1398 dev->pdev->subsystem_device == sub_device;
1399}
1400
1392#define NV_SW 0x0000506e 1401#define NV_SW 0x0000506e
1393#define NV_SW_DMA_SEMAPHORE 0x00000060 1402#define NV_SW_DMA_SEMAPHORE 0x00000060
1394#define NV_SW_SEMAPHORE_OFFSET 0x00000064 1403#define NV_SW_SEMAPHORE_OFFSET 0x00000064
diff --git a/drivers/gpu/drm/nouveau/nv17_tv.c b/drivers/gpu/drm/nouveau/nv17_tv.c
index eefa5c856932..13cdc05b7c2d 100644
--- a/drivers/gpu/drm/nouveau/nv17_tv.c
+++ b/drivers/gpu/drm/nouveau/nv17_tv.c
@@ -121,18 +121,14 @@ static bool
121get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask) 121get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask)
122{ 122{
123 /* Zotac FX5200 */ 123 /* Zotac FX5200 */
124 if (dev->pdev->device == 0x0322 && 124 if (nv_match_device(dev, 0x0322, 0x19da, 0x1035) ||
125 dev->pdev->subsystem_vendor == 0x19da && 125 nv_match_device(dev, 0x0322, 0x19da, 0x2035)) {
126 (dev->pdev->subsystem_device == 0x1035 ||
127 dev->pdev->subsystem_device == 0x2035)) {
128 *pin_mask = 0xc; 126 *pin_mask = 0xc;
129 return false; 127 return false;
130 } 128 }
131 129
132 /* MSI nForce2 IGP */ 130 /* MSI nForce2 IGP */
133 if (dev->pdev->device == 0x01f0 && 131 if (nv_match_device(dev, 0x01f0, 0x1462, 0x5710)) {
134 dev->pdev->subsystem_vendor == 0x1462 &&
135 dev->pdev->subsystem_device == 0x5710) {
136 *pin_mask = 0xc; 132 *pin_mask = 0xc;
137 return false; 133 return false;
138 } 134 }