drm/radeon: Remove references to struct drm_device.pdev
Using struct drm_device.pdev is deprecated. Convert radeon to struct drm_device.dev. No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201201103542.2182-17-tzimmermann@suse.de
This commit is contained in:
parent
abe3910886
commit
d86a41267b
@ -2062,9 +2062,9 @@ atombios_apply_encoder_quirks(struct drm_encoder *encoder,
|
||||
struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
|
||||
|
||||
/* Funky macbooks */
|
||||
if ((dev->pdev->device == 0x71C5) &&
|
||||
(dev->pdev->subsystem_vendor == 0x106b) &&
|
||||
(dev->pdev->subsystem_device == 0x0080)) {
|
||||
if ((rdev->pdev->device == 0x71C5) &&
|
||||
(rdev->pdev->subsystem_vendor == 0x106b) &&
|
||||
(rdev->pdev->subsystem_device == 0x0080)) {
|
||||
if (radeon_encoder->devices & ATOM_DEVICE_LCD1_SUPPORT) {
|
||||
uint32_t lvtma_bit_depth_control = RREG32(AVIVO_LVTMA_BIT_DEPTH_CONTROL);
|
||||
|
||||
|
@ -2612,7 +2612,6 @@ int r100_asic_reset(struct radeon_device *rdev, bool hard)
|
||||
|
||||
void r100_set_common_regs(struct radeon_device *rdev)
|
||||
{
|
||||
struct drm_device *dev = rdev->ddev;
|
||||
bool force_dac2 = false;
|
||||
u32 tmp;
|
||||
|
||||
@ -2630,7 +2629,7 @@ void r100_set_common_regs(struct radeon_device *rdev)
|
||||
* don't report it in the bios connector
|
||||
* table.
|
||||
*/
|
||||
switch (dev->pdev->device) {
|
||||
switch (rdev->pdev->device) {
|
||||
/* RN50 */
|
||||
case 0x515e:
|
||||
case 0x5969:
|
||||
@ -2640,17 +2639,17 @@ void r100_set_common_regs(struct radeon_device *rdev)
|
||||
case 0x5159:
|
||||
case 0x515a:
|
||||
/* DELL triple head servers */
|
||||
if ((dev->pdev->subsystem_vendor == 0x1028 /* DELL */) &&
|
||||
((dev->pdev->subsystem_device == 0x016c) ||
|
||||
(dev->pdev->subsystem_device == 0x016d) ||
|
||||
(dev->pdev->subsystem_device == 0x016e) ||
|
||||
(dev->pdev->subsystem_device == 0x016f) ||
|
||||
(dev->pdev->subsystem_device == 0x0170) ||
|
||||
(dev->pdev->subsystem_device == 0x017d) ||
|
||||
(dev->pdev->subsystem_device == 0x017e) ||
|
||||
(dev->pdev->subsystem_device == 0x0183) ||
|
||||
(dev->pdev->subsystem_device == 0x018a) ||
|
||||
(dev->pdev->subsystem_device == 0x019a)))
|
||||
if ((rdev->pdev->subsystem_vendor == 0x1028 /* DELL */) &&
|
||||
((rdev->pdev->subsystem_device == 0x016c) ||
|
||||
(rdev->pdev->subsystem_device == 0x016d) ||
|
||||
(rdev->pdev->subsystem_device == 0x016e) ||
|
||||
(rdev->pdev->subsystem_device == 0x016f) ||
|
||||
(rdev->pdev->subsystem_device == 0x0170) ||
|
||||
(rdev->pdev->subsystem_device == 0x017d) ||
|
||||
(rdev->pdev->subsystem_device == 0x017e) ||
|
||||
(rdev->pdev->subsystem_device == 0x0183) ||
|
||||
(rdev->pdev->subsystem_device == 0x018a) ||
|
||||
(rdev->pdev->subsystem_device == 0x019a)))
|
||||
force_dac2 = true;
|
||||
break;
|
||||
}
|
||||
|
@ -2622,14 +2622,14 @@ void r100_pll_errata_after_index(struct radeon_device *rdev);
|
||||
(rdev->family == CHIP_RV410) || \
|
||||
(rdev->family == CHIP_RS400) || \
|
||||
(rdev->family == CHIP_RS480))
|
||||
#define ASIC_IS_X2(rdev) ((rdev->ddev->pdev->device == 0x9441) || \
|
||||
(rdev->ddev->pdev->device == 0x9443) || \
|
||||
(rdev->ddev->pdev->device == 0x944B) || \
|
||||
(rdev->ddev->pdev->device == 0x9506) || \
|
||||
(rdev->ddev->pdev->device == 0x9509) || \
|
||||
(rdev->ddev->pdev->device == 0x950F) || \
|
||||
(rdev->ddev->pdev->device == 0x689C) || \
|
||||
(rdev->ddev->pdev->device == 0x689D))
|
||||
#define ASIC_IS_X2(rdev) ((rdev->pdev->device == 0x9441) || \
|
||||
(rdev->pdev->device == 0x9443) || \
|
||||
(rdev->pdev->device == 0x944B) || \
|
||||
(rdev->pdev->device == 0x9506) || \
|
||||
(rdev->pdev->device == 0x9509) || \
|
||||
(rdev->pdev->device == 0x950F) || \
|
||||
(rdev->pdev->device == 0x689C) || \
|
||||
(rdev->pdev->device == 0x689D))
|
||||
#define ASIC_IS_AVIVO(rdev) ((rdev->family >= CHIP_RS600))
|
||||
#define ASIC_IS_DCE2(rdev) ((rdev->family == CHIP_RS600) || \
|
||||
(rdev->family == CHIP_RS690) || \
|
||||
@ -2652,14 +2652,14 @@ void r100_pll_errata_after_index(struct radeon_device *rdev);
|
||||
#define ASIC_IS_DCE83(rdev) ((rdev->family == CHIP_KABINI) || \
|
||||
(rdev->family == CHIP_MULLINS))
|
||||
|
||||
#define ASIC_IS_LOMBOK(rdev) ((rdev->ddev->pdev->device == 0x6849) || \
|
||||
(rdev->ddev->pdev->device == 0x6850) || \
|
||||
(rdev->ddev->pdev->device == 0x6858) || \
|
||||
(rdev->ddev->pdev->device == 0x6859) || \
|
||||
(rdev->ddev->pdev->device == 0x6840) || \
|
||||
(rdev->ddev->pdev->device == 0x6841) || \
|
||||
(rdev->ddev->pdev->device == 0x6842) || \
|
||||
(rdev->ddev->pdev->device == 0x6843))
|
||||
#define ASIC_IS_LOMBOK(rdev) ((rdev->pdev->device == 0x6849) || \
|
||||
(rdev->pdev->device == 0x6850) || \
|
||||
(rdev->pdev->device == 0x6858) || \
|
||||
(rdev->pdev->device == 0x6859) || \
|
||||
(rdev->pdev->device == 0x6840) || \
|
||||
(rdev->pdev->device == 0x6841) || \
|
||||
(rdev->pdev->device == 0x6842) || \
|
||||
(rdev->pdev->device == 0x6843))
|
||||
|
||||
/*
|
||||
* BIOS helpers.
|
||||
|
@ -284,46 +284,47 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
|
||||
uint16_t *line_mux,
|
||||
struct radeon_hpd *hpd)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev->dev);
|
||||
|
||||
/* Asus M2A-VM HDMI board lists the DVI port as HDMI */
|
||||
if ((dev->pdev->device == 0x791e) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1043) &&
|
||||
(dev->pdev->subsystem_device == 0x826d)) {
|
||||
if ((pdev->device == 0x791e) &&
|
||||
(pdev->subsystem_vendor == 0x1043) &&
|
||||
(pdev->subsystem_device == 0x826d)) {
|
||||
if ((*connector_type == DRM_MODE_CONNECTOR_HDMIA) &&
|
||||
(supported_device == ATOM_DEVICE_DFP3_SUPPORT))
|
||||
*connector_type = DRM_MODE_CONNECTOR_DVID;
|
||||
}
|
||||
|
||||
/* Asrock RS600 board lists the DVI port as HDMI */
|
||||
if ((dev->pdev->device == 0x7941) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1849) &&
|
||||
(dev->pdev->subsystem_device == 0x7941)) {
|
||||
if ((pdev->device == 0x7941) &&
|
||||
(pdev->subsystem_vendor == 0x1849) &&
|
||||
(pdev->subsystem_device == 0x7941)) {
|
||||
if ((*connector_type == DRM_MODE_CONNECTOR_HDMIA) &&
|
||||
(supported_device == ATOM_DEVICE_DFP3_SUPPORT))
|
||||
*connector_type = DRM_MODE_CONNECTOR_DVID;
|
||||
}
|
||||
|
||||
/* MSI K9A2GM V2/V3 board has no HDMI or DVI */
|
||||
if ((dev->pdev->device == 0x796e) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1462) &&
|
||||
(dev->pdev->subsystem_device == 0x7302)) {
|
||||
if ((pdev->device == 0x796e) &&
|
||||
(pdev->subsystem_vendor == 0x1462) &&
|
||||
(pdev->subsystem_device == 0x7302)) {
|
||||
if ((supported_device == ATOM_DEVICE_DFP2_SUPPORT) ||
|
||||
(supported_device == ATOM_DEVICE_DFP3_SUPPORT))
|
||||
return false;
|
||||
}
|
||||
|
||||
/* a-bit f-i90hd - ciaranm on #radeonhd - this board has no DVI */
|
||||
if ((dev->pdev->device == 0x7941) &&
|
||||
(dev->pdev->subsystem_vendor == 0x147b) &&
|
||||
(dev->pdev->subsystem_device == 0x2412)) {
|
||||
if ((pdev->device == 0x7941) &&
|
||||
(pdev->subsystem_vendor == 0x147b) &&
|
||||
(pdev->subsystem_device == 0x2412)) {
|
||||
if (*connector_type == DRM_MODE_CONNECTOR_DVII)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Falcon NW laptop lists vga ddc line for LVDS */
|
||||
if ((dev->pdev->device == 0x5653) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1462) &&
|
||||
(dev->pdev->subsystem_device == 0x0291)) {
|
||||
if ((pdev->device == 0x5653) &&
|
||||
(pdev->subsystem_vendor == 0x1462) &&
|
||||
(pdev->subsystem_device == 0x0291)) {
|
||||
if (*connector_type == DRM_MODE_CONNECTOR_LVDS) {
|
||||
i2c_bus->valid = false;
|
||||
*line_mux = 53;
|
||||
@ -331,26 +332,26 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
|
||||
}
|
||||
|
||||
/* HIS X1300 is DVI+VGA, not DVI+DVI */
|
||||
if ((dev->pdev->device == 0x7146) &&
|
||||
(dev->pdev->subsystem_vendor == 0x17af) &&
|
||||
(dev->pdev->subsystem_device == 0x2058)) {
|
||||
if ((pdev->device == 0x7146) &&
|
||||
(pdev->subsystem_vendor == 0x17af) &&
|
||||
(pdev->subsystem_device == 0x2058)) {
|
||||
if (supported_device == ATOM_DEVICE_DFP1_SUPPORT)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Gigabyte X1300 is DVI+VGA, not DVI+DVI */
|
||||
if ((dev->pdev->device == 0x7142) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1458) &&
|
||||
(dev->pdev->subsystem_device == 0x2134)) {
|
||||
if ((pdev->device == 0x7142) &&
|
||||
(pdev->subsystem_vendor == 0x1458) &&
|
||||
(pdev->subsystem_device == 0x2134)) {
|
||||
if (supported_device == ATOM_DEVICE_DFP1_SUPPORT)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* Funky macbooks */
|
||||
if ((dev->pdev->device == 0x71C5) &&
|
||||
(dev->pdev->subsystem_vendor == 0x106b) &&
|
||||
(dev->pdev->subsystem_device == 0x0080)) {
|
||||
if ((pdev->device == 0x71C5) &&
|
||||
(pdev->subsystem_vendor == 0x106b) &&
|
||||
(pdev->subsystem_device == 0x0080)) {
|
||||
if ((supported_device == ATOM_DEVICE_CRT1_SUPPORT) ||
|
||||
(supported_device == ATOM_DEVICE_DFP2_SUPPORT))
|
||||
return false;
|
||||
@ -366,27 +367,27 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
|
||||
}
|
||||
|
||||
/* ASUS HD 3600 XT board lists the DVI port as HDMI */
|
||||
if ((dev->pdev->device == 0x9598) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1043) &&
|
||||
(dev->pdev->subsystem_device == 0x01da)) {
|
||||
if ((pdev->device == 0x9598) &&
|
||||
(pdev->subsystem_vendor == 0x1043) &&
|
||||
(pdev->subsystem_device == 0x01da)) {
|
||||
if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) {
|
||||
*connector_type = DRM_MODE_CONNECTOR_DVII;
|
||||
}
|
||||
}
|
||||
|
||||
/* ASUS HD 3600 board lists the DVI port as HDMI */
|
||||
if ((dev->pdev->device == 0x9598) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1043) &&
|
||||
(dev->pdev->subsystem_device == 0x01e4)) {
|
||||
if ((pdev->device == 0x9598) &&
|
||||
(pdev->subsystem_vendor == 0x1043) &&
|
||||
(pdev->subsystem_device == 0x01e4)) {
|
||||
if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) {
|
||||
*connector_type = DRM_MODE_CONNECTOR_DVII;
|
||||
}
|
||||
}
|
||||
|
||||
/* ASUS HD 3450 board lists the DVI port as HDMI */
|
||||
if ((dev->pdev->device == 0x95C5) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1043) &&
|
||||
(dev->pdev->subsystem_device == 0x01e2)) {
|
||||
if ((pdev->device == 0x95C5) &&
|
||||
(pdev->subsystem_vendor == 0x1043) &&
|
||||
(pdev->subsystem_device == 0x01e2)) {
|
||||
if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) {
|
||||
*connector_type = DRM_MODE_CONNECTOR_DVII;
|
||||
}
|
||||
@ -411,9 +412,9 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
|
||||
* with different crtcs which isn't possible on the hardware
|
||||
* side and leaves no crtcs for LVDS or VGA.
|
||||
*/
|
||||
if (((dev->pdev->device == 0x95c4) || (dev->pdev->device == 0x9591)) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1025) &&
|
||||
(dev->pdev->subsystem_device == 0x013c)) {
|
||||
if (((pdev->device == 0x95c4) || (pdev->device == 0x9591)) &&
|
||||
(pdev->subsystem_vendor == 0x1025) &&
|
||||
(pdev->subsystem_device == 0x013c)) {
|
||||
if ((*connector_type == DRM_MODE_CONNECTOR_DVII) &&
|
||||
(supported_device == ATOM_DEVICE_DFP1_SUPPORT)) {
|
||||
/* actually it's a DVI-D port not DVI-I */
|
||||
@ -425,9 +426,9 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
|
||||
/* XFX Pine Group device rv730 reports no VGA DDC lines
|
||||
* even though they are wired up to record 0x93
|
||||
*/
|
||||
if ((dev->pdev->device == 0x9498) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1682) &&
|
||||
(dev->pdev->subsystem_device == 0x2452) &&
|
||||
if ((pdev->device == 0x9498) &&
|
||||
(pdev->subsystem_vendor == 0x1682) &&
|
||||
(pdev->subsystem_device == 0x2452) &&
|
||||
(i2c_bus->valid == false) &&
|
||||
!(supported_device & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT))) {
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
@ -435,11 +436,11 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
|
||||
}
|
||||
|
||||
/* Fujitsu D3003-S2 board lists DVI-I as DVI-D and VGA */
|
||||
if (((dev->pdev->device == 0x9802) ||
|
||||
(dev->pdev->device == 0x9805) ||
|
||||
(dev->pdev->device == 0x9806)) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1734) &&
|
||||
(dev->pdev->subsystem_device == 0x11bd)) {
|
||||
if (((pdev->device == 0x9802) ||
|
||||
(pdev->device == 0x9805) ||
|
||||
(pdev->device == 0x9806)) &&
|
||||
(pdev->subsystem_vendor == 0x1734) &&
|
||||
(pdev->subsystem_device == 0x11bd)) {
|
||||
if (*connector_type == DRM_MODE_CONNECTOR_VGA) {
|
||||
*connector_type = DRM_MODE_CONNECTOR_DVII;
|
||||
*line_mux = 0x3103;
|
||||
|
@ -528,7 +528,7 @@ static bool legacy_read_disabled_bios(struct radeon_device *rdev)
|
||||
crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL);
|
||||
fp2_gen_cntl = 0;
|
||||
|
||||
if (rdev->ddev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) {
|
||||
if (rdev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) {
|
||||
fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL);
|
||||
}
|
||||
|
||||
@ -565,7 +565,7 @@ static bool legacy_read_disabled_bios(struct radeon_device *rdev)
|
||||
(RADEON_CRTC_SYNC_TRISTAT |
|
||||
RADEON_CRTC_DISPLAY_DIS)));
|
||||
|
||||
if (rdev->ddev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) {
|
||||
if (rdev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) {
|
||||
WREG32(RADEON_FP2_GEN_CNTL, (fp2_gen_cntl & ~RADEON_FP2_ON));
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@ static bool legacy_read_disabled_bios(struct radeon_device *rdev)
|
||||
WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl);
|
||||
}
|
||||
WREG32(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl);
|
||||
if (rdev->ddev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) {
|
||||
if (rdev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) {
|
||||
WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl);
|
||||
}
|
||||
return r;
|
||||
|
@ -894,13 +894,13 @@ struct radeon_encoder_primary_dac *radeon_combios_get_primary_dac_info(struct
|
||||
|
||||
/* quirks */
|
||||
/* Radeon 7000 (RV100) */
|
||||
if (((dev->pdev->device == 0x5159) &&
|
||||
(dev->pdev->subsystem_vendor == 0x174B) &&
|
||||
(dev->pdev->subsystem_device == 0x7c28)) ||
|
||||
if (((rdev->pdev->device == 0x5159) &&
|
||||
(rdev->pdev->subsystem_vendor == 0x174B) &&
|
||||
(rdev->pdev->subsystem_device == 0x7c28)) ||
|
||||
/* Radeon 9100 (R200) */
|
||||
((dev->pdev->device == 0x514D) &&
|
||||
(dev->pdev->subsystem_vendor == 0x174B) &&
|
||||
(dev->pdev->subsystem_device == 0x7149))) {
|
||||
((rdev->pdev->device == 0x514D) &&
|
||||
(rdev->pdev->subsystem_vendor == 0x174B) &&
|
||||
(rdev->pdev->subsystem_device == 0x7149))) {
|
||||
/* vbios value is bad, use the default */
|
||||
found = 0;
|
||||
}
|
||||
@ -2221,20 +2221,21 @@ static bool radeon_apply_legacy_quirks(struct drm_device *dev,
|
||||
struct radeon_i2c_bus_rec *ddc_i2c,
|
||||
struct radeon_hpd *hpd)
|
||||
{
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
|
||||
/* Certain IBM chipset RN50s have a BIOS reporting two VGAs,
|
||||
one with VGA DDC and one with CRT2 DDC. - kill the CRT2 DDC one */
|
||||
if (dev->pdev->device == 0x515e &&
|
||||
dev->pdev->subsystem_vendor == 0x1014) {
|
||||
if (rdev->pdev->device == 0x515e &&
|
||||
rdev->pdev->subsystem_vendor == 0x1014) {
|
||||
if (*legacy_connector == CONNECTOR_CRT_LEGACY &&
|
||||
ddc_i2c->mask_clk_reg == RADEON_GPIO_CRT2_DDC)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* X300 card with extra non-existent DVI port */
|
||||
if (dev->pdev->device == 0x5B60 &&
|
||||
dev->pdev->subsystem_vendor == 0x17af &&
|
||||
dev->pdev->subsystem_device == 0x201e && bios_index == 2) {
|
||||
if (rdev->pdev->device == 0x5B60 &&
|
||||
rdev->pdev->subsystem_vendor == 0x17af &&
|
||||
rdev->pdev->subsystem_device == 0x201e && bios_index == 2) {
|
||||
if (*legacy_connector == CONNECTOR_DVI_I_LEGACY)
|
||||
return false;
|
||||
}
|
||||
@ -2244,22 +2245,24 @@ static bool radeon_apply_legacy_quirks(struct drm_device *dev,
|
||||
|
||||
static bool radeon_apply_legacy_tv_quirks(struct drm_device *dev)
|
||||
{
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
|
||||
/* Acer 5102 has non-existent TV port */
|
||||
if (dev->pdev->device == 0x5975 &&
|
||||
dev->pdev->subsystem_vendor == 0x1025 &&
|
||||
dev->pdev->subsystem_device == 0x009f)
|
||||
if (rdev->pdev->device == 0x5975 &&
|
||||
rdev->pdev->subsystem_vendor == 0x1025 &&
|
||||
rdev->pdev->subsystem_device == 0x009f)
|
||||
return false;
|
||||
|
||||
/* HP dc5750 has non-existent TV port */
|
||||
if (dev->pdev->device == 0x5974 &&
|
||||
dev->pdev->subsystem_vendor == 0x103c &&
|
||||
dev->pdev->subsystem_device == 0x280a)
|
||||
if (rdev->pdev->device == 0x5974 &&
|
||||
rdev->pdev->subsystem_vendor == 0x103c &&
|
||||
rdev->pdev->subsystem_device == 0x280a)
|
||||
return false;
|
||||
|
||||
/* MSI S270 has non-existent TV port */
|
||||
if (dev->pdev->device == 0x5955 &&
|
||||
dev->pdev->subsystem_vendor == 0x1462 &&
|
||||
dev->pdev->subsystem_device == 0x0131)
|
||||
if (rdev->pdev->device == 0x5955 &&
|
||||
rdev->pdev->subsystem_vendor == 0x1462 &&
|
||||
rdev->pdev->subsystem_device == 0x0131)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -2413,9 +2416,9 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev)
|
||||
/* RV100 board with external TDMS bit mis-set.
|
||||
* Actually uses internal TMDS, clear the bit.
|
||||
*/
|
||||
if (dev->pdev->device == 0x5159 &&
|
||||
dev->pdev->subsystem_vendor == 0x1014 &&
|
||||
dev->pdev->subsystem_device == 0x029A) {
|
||||
if (rdev->pdev->device == 0x5159 &&
|
||||
rdev->pdev->subsystem_vendor == 0x1014 &&
|
||||
rdev->pdev->subsystem_device == 0x029A) {
|
||||
tmp &= ~(1 << 4);
|
||||
}
|
||||
if ((tmp >> 4) & 0x1) {
|
||||
@ -2707,9 +2710,9 @@ void radeon_combios_get_power_modes(struct radeon_device *rdev)
|
||||
/* boards with a thermal chip, but no overdrive table */
|
||||
|
||||
/* Asus 9600xt has an f75375 on the monid bus */
|
||||
if ((dev->pdev->device == 0x4152) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1043) &&
|
||||
(dev->pdev->subsystem_device == 0xc002)) {
|
||||
if ((rdev->pdev->device == 0x4152) &&
|
||||
(rdev->pdev->subsystem_vendor == 0x1043) &&
|
||||
(rdev->pdev->subsystem_device == 0xc002)) {
|
||||
i2c_bus = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0);
|
||||
rdev->pm.i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus);
|
||||
if (rdev->pm.i2c_bus) {
|
||||
|
@ -130,8 +130,7 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p)
|
||||
* IGP chips to avoid image corruptions
|
||||
*/
|
||||
if (p->ring == R600_RING_TYPE_UVD_INDEX &&
|
||||
(i <= 0 || pci_find_capability(p->rdev->ddev->pdev,
|
||||
PCI_CAP_ID_AGP) ||
|
||||
(i <= 0 || pci_find_capability(p->rdev->pdev, PCI_CAP_ID_AGP) ||
|
||||
p->rdev->family == CHIP_RS780 ||
|
||||
p->rdev->family == CHIP_RS880)) {
|
||||
|
||||
|
@ -1562,6 +1562,7 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend,
|
||||
bool fbcon, bool freeze)
|
||||
{
|
||||
struct radeon_device *rdev;
|
||||
struct pci_dev *pdev;
|
||||
struct drm_crtc *crtc;
|
||||
struct drm_connector *connector;
|
||||
int i, r;
|
||||
@ -1571,6 +1572,7 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend,
|
||||
}
|
||||
|
||||
rdev = dev->dev_private;
|
||||
pdev = to_pci_dev(dev->dev);
|
||||
|
||||
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
||||
return 0;
|
||||
@ -1636,14 +1638,14 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend,
|
||||
|
||||
radeon_agp_suspend(rdev);
|
||||
|
||||
pci_save_state(dev->pdev);
|
||||
pci_save_state(pdev);
|
||||
if (freeze && rdev->family >= CHIP_CEDAR && !(rdev->flags & RADEON_IS_IGP)) {
|
||||
rdev->asic->asic_reset(rdev, true);
|
||||
pci_restore_state(dev->pdev);
|
||||
pci_restore_state(pdev);
|
||||
} else if (suspend) {
|
||||
/* Shut down the device */
|
||||
pci_disable_device(dev->pdev);
|
||||
pci_set_power_state(dev->pdev, PCI_D3hot);
|
||||
pci_disable_device(pdev);
|
||||
pci_set_power_state(pdev, PCI_D3hot);
|
||||
}
|
||||
|
||||
if (fbcon) {
|
||||
@ -1665,6 +1667,7 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon)
|
||||
{
|
||||
struct drm_connector *connector;
|
||||
struct radeon_device *rdev = dev->dev_private;
|
||||
struct pci_dev *pdev = to_pci_dev(dev->dev);
|
||||
struct drm_crtc *crtc;
|
||||
int r;
|
||||
|
||||
@ -1675,9 +1678,9 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon)
|
||||
console_lock();
|
||||
}
|
||||
if (resume) {
|
||||
pci_set_power_state(dev->pdev, PCI_D0);
|
||||
pci_restore_state(dev->pdev);
|
||||
if (pci_enable_device(dev->pdev)) {
|
||||
pci_set_power_state(pdev, PCI_D0);
|
||||
pci_restore_state(pdev);
|
||||
if (pci_enable_device(pdev)) {
|
||||
if (fbcon)
|
||||
console_unlock();
|
||||
return -1;
|
||||
|
@ -1317,7 +1317,7 @@ radeon_user_framebuffer_create(struct drm_device *dev,
|
||||
|
||||
obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
|
||||
if (obj == NULL) {
|
||||
dev_err(&dev->pdev->dev, "No GEM object associated to handle 0x%08X, "
|
||||
dev_err(dev->dev, "No GEM object associated to handle 0x%08X, "
|
||||
"can't create framebuffer\n", mode_cmd->handles[0]);
|
||||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
|
@ -342,14 +342,13 @@ static int radeon_pci_probe(struct pci_dev *pdev,
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
dev->pdev = pdev;
|
||||
#ifdef __alpha__
|
||||
dev->hose = pdev->sysdata;
|
||||
#endif
|
||||
|
||||
pci_set_drvdata(pdev, dev);
|
||||
|
||||
if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
|
||||
if (pci_find_capability(pdev, PCI_CAP_ID_AGP))
|
||||
dev->agp = drm_agp_init(dev);
|
||||
if (dev->agp) {
|
||||
dev->agp->agp_mtrr = arch_phys_wc_add(
|
||||
|
@ -290,7 +290,7 @@ static int radeonfb_create(struct drm_fb_helper *helper,
|
||||
DRM_INFO("fb depth is %d\n", fb->format->depth);
|
||||
DRM_INFO(" pitch is %d\n", fb->pitches[0]);
|
||||
|
||||
vga_switcheroo_client_fb_set(rdev->ddev->pdev, info);
|
||||
vga_switcheroo_client_fb_set(rdev->pdev, info);
|
||||
return 0;
|
||||
|
||||
out:
|
||||
|
@ -651,7 +651,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data,
|
||||
}
|
||||
|
||||
if (args->offset < RADEON_VA_RESERVED_SIZE) {
|
||||
dev_err(&dev->pdev->dev,
|
||||
dev_err(dev->dev,
|
||||
"offset 0x%lX is in reserved area 0x%X\n",
|
||||
(unsigned long)args->offset,
|
||||
RADEON_VA_RESERVED_SIZE);
|
||||
@ -665,7 +665,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data,
|
||||
*/
|
||||
invalid_flags = RADEON_VM_PAGE_VALID | RADEON_VM_PAGE_SYSTEM;
|
||||
if ((args->flags & invalid_flags)) {
|
||||
dev_err(&dev->pdev->dev, "invalid flags 0x%08X vs 0x%08X\n",
|
||||
dev_err(dev->dev, "invalid flags 0x%08X vs 0x%08X\n",
|
||||
args->flags, invalid_flags);
|
||||
args->operation = RADEON_VA_RESULT_ERROR;
|
||||
return -EINVAL;
|
||||
@ -676,7 +676,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data,
|
||||
case RADEON_VA_UNMAP:
|
||||
break;
|
||||
default:
|
||||
dev_err(&dev->pdev->dev, "unsupported operation %d\n",
|
||||
dev_err(dev->dev, "unsupported operation %d\n",
|
||||
args->operation);
|
||||
args->operation = RADEON_VA_RESULT_ERROR;
|
||||
return -EINVAL;
|
||||
|
@ -919,7 +919,7 @@ struct radeon_i2c_chan *radeon_i2c_create(struct drm_device *dev,
|
||||
i2c->rec = *rec;
|
||||
i2c->adapter.owner = THIS_MODULE;
|
||||
i2c->adapter.class = I2C_CLASS_DDC;
|
||||
i2c->adapter.dev.parent = &dev->pdev->dev;
|
||||
i2c->adapter.dev.parent = dev->dev;
|
||||
i2c->dev = dev;
|
||||
i2c_set_adapdata(&i2c->adapter, i2c);
|
||||
mutex_init(&i2c->mutex);
|
||||
|
@ -314,7 +314,7 @@ int radeon_irq_kms_init(struct radeon_device *rdev)
|
||||
INIT_WORK(&rdev->audio_work, r600_audio_update_hdmi);
|
||||
|
||||
rdev->irq.installed = true;
|
||||
r = drm_irq_install(rdev->ddev, rdev->ddev->pdev->irq);
|
||||
r = drm_irq_install(rdev->ddev, rdev->pdev->irq);
|
||||
if (r) {
|
||||
rdev->irq.installed = false;
|
||||
flush_delayed_work(&rdev->hotplug_work);
|
||||
|
@ -105,6 +105,7 @@ done_free:
|
||||
*/
|
||||
int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(dev->dev);
|
||||
struct radeon_device *rdev;
|
||||
int r, acpi_status;
|
||||
|
||||
@ -115,9 +116,9 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
|
||||
dev->dev_private = (void *)rdev;
|
||||
|
||||
/* update BUS flag */
|
||||
if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) {
|
||||
if (pci_find_capability(pdev, PCI_CAP_ID_AGP)) {
|
||||
flags |= RADEON_IS_AGP;
|
||||
} else if (pci_is_pcie(dev->pdev)) {
|
||||
} else if (pci_is_pcie(pdev)) {
|
||||
flags |= RADEON_IS_PCIE;
|
||||
} else {
|
||||
flags |= RADEON_IS_PCI;
|
||||
@ -126,7 +127,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
|
||||
if ((radeon_runtime_pm != 0) &&
|
||||
radeon_has_atpx() &&
|
||||
((flags & RADEON_IS_IGP) == 0) &&
|
||||
!pci_is_thunderbolt_attached(dev->pdev))
|
||||
!pci_is_thunderbolt_attached(pdev))
|
||||
flags |= RADEON_IS_PX;
|
||||
|
||||
/* radeon_device_init should report only fatal error
|
||||
@ -135,9 +136,9 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
|
||||
* properly initialize the GPU MC controller and permit
|
||||
* VRAM allocation
|
||||
*/
|
||||
r = radeon_device_init(rdev, dev, dev->pdev, flags);
|
||||
r = radeon_device_init(rdev, dev, pdev, flags);
|
||||
if (r) {
|
||||
dev_err(&dev->pdev->dev, "Fatal error during GPU init\n");
|
||||
dev_err(dev->dev, "Fatal error during GPU init\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -147,7 +148,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
|
||||
*/
|
||||
r = radeon_modeset_init(rdev);
|
||||
if (r)
|
||||
dev_err(&dev->pdev->dev, "Fatal error during modeset init\n");
|
||||
dev_err(dev->dev, "Fatal error during modeset init\n");
|
||||
|
||||
/* Call ACPI methods: require modeset init
|
||||
* but failure is not fatal
|
||||
@ -155,8 +156,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
|
||||
if (!r) {
|
||||
acpi_status = radeon_acpi_init(rdev);
|
||||
if (acpi_status)
|
||||
dev_dbg(&dev->pdev->dev,
|
||||
"Error during ACPI methods call\n");
|
||||
dev_dbg(dev->dev, "Error during ACPI methods call\n");
|
||||
}
|
||||
|
||||
if (radeon_is_px(dev)) {
|
||||
@ -239,7 +239,7 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
|
||||
|
||||
switch (info->request) {
|
||||
case RADEON_INFO_DEVICE_ID:
|
||||
*value = dev->pdev->device;
|
||||
*value = to_pci_dev(dev->dev)->device;
|
||||
break;
|
||||
case RADEON_INFO_NUM_GB_PIPES:
|
||||
*value = rdev->num_gb_pipes;
|
||||
|
@ -974,9 +974,9 @@ static void radeon_legacy_tmds_ext_mode_set(struct drm_encoder *encoder,
|
||||
|
||||
/* XXX: these are oem specific */
|
||||
if (ASIC_IS_R300(rdev)) {
|
||||
if ((dev->pdev->device == 0x4850) &&
|
||||
(dev->pdev->subsystem_vendor == 0x1028) &&
|
||||
(dev->pdev->subsystem_device == 0x2001)) /* Dell Inspiron 8600 */
|
||||
if ((rdev->pdev->device == 0x4850) &&
|
||||
(rdev->pdev->subsystem_vendor == 0x1028) &&
|
||||
(rdev->pdev->subsystem_device == 0x2001)) /* Dell Inspiron 8600 */
|
||||
fp2_gen_cntl |= R300_FP2_DVO_CLOCK_MODE_SINGLE;
|
||||
else
|
||||
fp2_gen_cntl |= RADEON_FP2_PAD_FLOP_EN | R300_FP2_DVO_CLOCK_MODE_SINGLE;
|
||||
|
@ -223,16 +223,15 @@ static void rs780_preset_starting_fbdiv(struct radeon_device *rdev)
|
||||
static void rs780_voltage_scaling_init(struct radeon_device *rdev)
|
||||
{
|
||||
struct igp_power_info *pi = rs780_get_pi(rdev);
|
||||
struct drm_device *dev = rdev->ddev;
|
||||
u32 fv_throt_pwm_fb_div_range[3];
|
||||
u32 fv_throt_pwm_range[4];
|
||||
|
||||
if (dev->pdev->device == 0x9614) {
|
||||
if (rdev->pdev->device == 0x9614) {
|
||||
fv_throt_pwm_fb_div_range[0] = RS780D_FVTHROTPWMFBDIVRANGEREG0_DFLT;
|
||||
fv_throt_pwm_fb_div_range[1] = RS780D_FVTHROTPWMFBDIVRANGEREG1_DFLT;
|
||||
fv_throt_pwm_fb_div_range[2] = RS780D_FVTHROTPWMFBDIVRANGEREG2_DFLT;
|
||||
} else if ((dev->pdev->device == 0x9714) ||
|
||||
(dev->pdev->device == 0x9715)) {
|
||||
} else if ((rdev->pdev->device == 0x9714) ||
|
||||
(rdev->pdev->device == 0x9715)) {
|
||||
fv_throt_pwm_fb_div_range[0] = RS880D_FVTHROTPWMFBDIVRANGEREG0_DFLT;
|
||||
fv_throt_pwm_fb_div_range[1] = RS880D_FVTHROTPWMFBDIVRANGEREG1_DFLT;
|
||||
fv_throt_pwm_fb_div_range[2] = RS880D_FVTHROTPWMFBDIVRANGEREG2_DFLT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user