Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon: change rdev->ddev to rdev_to_drm(rdev)

This patch changes the way "drm_device" is accessed. It uses "rdev_to_drm(rdev)"
instead of accessing the struct member directly.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Wu Hoi Pok <wuhoipok@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Wu Hoi Pok and committed by
Alex Deucher
fb1b5e1d a6e23bec

+159 -159
+1 -1
drivers/gpu/drm/radeon/atombios_encoders.c
··· 2179 2179 void 2180 2180 radeon_atom_encoder_init(struct radeon_device *rdev) 2181 2181 { 2182 - struct drm_device *dev = rdev->ddev; 2182 + struct drm_device *dev = rdev_to_drm(rdev); 2183 2183 struct drm_encoder *encoder; 2184 2184 2185 2185 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
+7 -7
drivers/gpu/drm/radeon/cik.c
··· 7585 7585 DRM_DEBUG("IH: IH event w/o asserted irq bit?\n"); 7586 7586 7587 7587 if (rdev->irq.crtc_vblank_int[0]) { 7588 - drm_handle_vblank(rdev->ddev, 0); 7588 + drm_handle_vblank(rdev_to_drm(rdev), 0); 7589 7589 rdev->pm.vblank_sync = true; 7590 7590 wake_up(&rdev->irq.vblank_queue); 7591 7591 } ··· 7615 7615 DRM_DEBUG("IH: IH event w/o asserted irq bit?\n"); 7616 7616 7617 7617 if (rdev->irq.crtc_vblank_int[1]) { 7618 - drm_handle_vblank(rdev->ddev, 1); 7618 + drm_handle_vblank(rdev_to_drm(rdev), 1); 7619 7619 rdev->pm.vblank_sync = true; 7620 7620 wake_up(&rdev->irq.vblank_queue); 7621 7621 } ··· 7645 7645 DRM_DEBUG("IH: IH event w/o asserted irq bit?\n"); 7646 7646 7647 7647 if (rdev->irq.crtc_vblank_int[2]) { 7648 - drm_handle_vblank(rdev->ddev, 2); 7648 + drm_handle_vblank(rdev_to_drm(rdev), 2); 7649 7649 rdev->pm.vblank_sync = true; 7650 7650 wake_up(&rdev->irq.vblank_queue); 7651 7651 } ··· 7675 7675 DRM_DEBUG("IH: IH event w/o asserted irq bit?\n"); 7676 7676 7677 7677 if (rdev->irq.crtc_vblank_int[3]) { 7678 - drm_handle_vblank(rdev->ddev, 3); 7678 + drm_handle_vblank(rdev_to_drm(rdev), 3); 7679 7679 rdev->pm.vblank_sync = true; 7680 7680 wake_up(&rdev->irq.vblank_queue); 7681 7681 } ··· 7705 7705 DRM_DEBUG("IH: IH event w/o asserted irq bit?\n"); 7706 7706 7707 7707 if (rdev->irq.crtc_vblank_int[4]) { 7708 - drm_handle_vblank(rdev->ddev, 4); 7708 + drm_handle_vblank(rdev_to_drm(rdev), 4); 7709 7709 rdev->pm.vblank_sync = true; 7710 7710 wake_up(&rdev->irq.vblank_queue); 7711 7711 } ··· 7735 7735 DRM_DEBUG("IH: IH event w/o asserted irq bit?\n"); 7736 7736 7737 7737 if (rdev->irq.crtc_vblank_int[5]) { 7738 - drm_handle_vblank(rdev->ddev, 5); 7738 + drm_handle_vblank(rdev_to_drm(rdev), 5); 7739 7739 rdev->pm.vblank_sync = true; 7740 7740 wake_up(&rdev->irq.vblank_queue); 7741 7741 } ··· 8581 8581 /* Initialize surface registers */ 8582 8582 radeon_surface_init(rdev); 8583 8583 /* Initialize clocks */ 8584 - radeon_get_clock_info(rdev->ddev); 8584 + radeon_get_clock_info(rdev_to_drm(rdev)); 8585 8585 8586 8586 /* Fence driver */ 8587 8587 radeon_fence_driver_init(rdev);
+1 -1
drivers/gpu/drm/radeon/dce6_afmt.c
··· 91 91 pin = &rdev->audio.pin[i]; 92 92 pin_count = 0; 93 93 94 - list_for_each_entry(encoder, &rdev->ddev->mode_config.encoder_list, head) { 94 + list_for_each_entry(encoder, &rdev_to_drm(rdev)->mode_config.encoder_list, head) { 95 95 if (radeon_encoder_is_digital(encoder)) { 96 96 radeon_encoder = to_radeon_encoder(encoder); 97 97 dig = radeon_encoder->enc_priv;
+6 -6
drivers/gpu/drm/radeon/evergreen.c
··· 1673 1673 */ 1674 1674 void evergreen_pm_prepare(struct radeon_device *rdev) 1675 1675 { 1676 - struct drm_device *ddev = rdev->ddev; 1676 + struct drm_device *ddev = rdev_to_drm(rdev); 1677 1677 struct drm_crtc *crtc; 1678 1678 struct radeon_crtc *radeon_crtc; 1679 1679 u32 tmp; ··· 1698 1698 */ 1699 1699 void evergreen_pm_finish(struct radeon_device *rdev) 1700 1700 { 1701 - struct drm_device *ddev = rdev->ddev; 1701 + struct drm_device *ddev = rdev_to_drm(rdev); 1702 1702 struct drm_crtc *crtc; 1703 1703 struct radeon_crtc *radeon_crtc; 1704 1704 u32 tmp; ··· 1763 1763 */ 1764 1764 void evergreen_hpd_init(struct radeon_device *rdev) 1765 1765 { 1766 - struct drm_device *dev = rdev->ddev; 1766 + struct drm_device *dev = rdev_to_drm(rdev); 1767 1767 struct drm_connector *connector; 1768 1768 unsigned enabled = 0; 1769 1769 u32 tmp = DC_HPDx_CONNECTION_TIMER(0x9c4) | ··· 1804 1804 */ 1805 1805 void evergreen_hpd_fini(struct radeon_device *rdev) 1806 1806 { 1807 - struct drm_device *dev = rdev->ddev; 1807 + struct drm_device *dev = rdev_to_drm(rdev); 1808 1808 struct drm_connector *connector; 1809 1809 unsigned disabled = 0; 1810 1810 ··· 4753 4753 event_name = "vblank"; 4754 4754 4755 4755 if (rdev->irq.crtc_vblank_int[crtc_idx]) { 4756 - drm_handle_vblank(rdev->ddev, crtc_idx); 4756 + drm_handle_vblank(rdev_to_drm(rdev), crtc_idx); 4757 4757 rdev->pm.vblank_sync = true; 4758 4758 wake_up(&rdev->irq.vblank_queue); 4759 4759 } ··· 5211 5211 /* Initialize surface registers */ 5212 5212 radeon_surface_init(rdev); 5213 5213 /* Initialize clocks */ 5214 - radeon_get_clock_info(rdev->ddev); 5214 + radeon_get_clock_info(rdev_to_drm(rdev)); 5215 5215 /* Fence driver */ 5216 5216 radeon_fence_driver_init(rdev); 5217 5217 /* initialize AGP */
+1 -1
drivers/gpu/drm/radeon/ni.c
··· 2360 2360 /* Initialize surface registers */ 2361 2361 radeon_surface_init(rdev); 2362 2362 /* Initialize clocks */ 2363 - radeon_get_clock_info(rdev->ddev); 2363 + radeon_get_clock_info(rdev_to_drm(rdev)); 2364 2364 /* Fence driver */ 2365 2365 radeon_fence_driver_init(rdev); 2366 2366 /* initialize memory controller */
+12 -12
drivers/gpu/drm/radeon/r100.c
··· 459 459 */ 460 460 void r100_pm_prepare(struct radeon_device *rdev) 461 461 { 462 - struct drm_device *ddev = rdev->ddev; 462 + struct drm_device *ddev = rdev_to_drm(rdev); 463 463 struct drm_crtc *crtc; 464 464 struct radeon_crtc *radeon_crtc; 465 465 u32 tmp; ··· 490 490 */ 491 491 void r100_pm_finish(struct radeon_device *rdev) 492 492 { 493 - struct drm_device *ddev = rdev->ddev; 493 + struct drm_device *ddev = rdev_to_drm(rdev); 494 494 struct drm_crtc *crtc; 495 495 struct radeon_crtc *radeon_crtc; 496 496 u32 tmp; ··· 603 603 */ 604 604 void r100_hpd_init(struct radeon_device *rdev) 605 605 { 606 - struct drm_device *dev = rdev->ddev; 606 + struct drm_device *dev = rdev_to_drm(rdev); 607 607 struct drm_connector *connector; 608 608 unsigned enable = 0; 609 609 ··· 626 626 */ 627 627 void r100_hpd_fini(struct radeon_device *rdev) 628 628 { 629 - struct drm_device *dev = rdev->ddev; 629 + struct drm_device *dev = rdev_to_drm(rdev); 630 630 struct drm_connector *connector; 631 631 unsigned disable = 0; 632 632 ··· 798 798 /* Vertical blank interrupts */ 799 799 if (status & RADEON_CRTC_VBLANK_STAT) { 800 800 if (rdev->irq.crtc_vblank_int[0]) { 801 - drm_handle_vblank(rdev->ddev, 0); 801 + drm_handle_vblank(rdev_to_drm(rdev), 0); 802 802 rdev->pm.vblank_sync = true; 803 803 wake_up(&rdev->irq.vblank_queue); 804 804 } ··· 807 807 } 808 808 if (status & RADEON_CRTC2_VBLANK_STAT) { 809 809 if (rdev->irq.crtc_vblank_int[1]) { 810 - drm_handle_vblank(rdev->ddev, 1); 810 + drm_handle_vblank(rdev_to_drm(rdev), 1); 811 811 rdev->pm.vblank_sync = true; 812 812 wake_up(&rdev->irq.vblank_queue); 813 813 } ··· 1471 1471 header = radeon_get_ib_value(p, h_idx); 1472 1472 crtc_id = radeon_get_ib_value(p, h_idx + 5); 1473 1473 reg = R100_CP_PACKET0_GET_REG(header); 1474 - crtc = drm_crtc_find(p->rdev->ddev, p->filp, crtc_id); 1474 + crtc = drm_crtc_find(rdev_to_drm(p->rdev), p->filp, crtc_id); 1475 1475 if (!crtc) { 1476 1476 DRM_ERROR("cannot find crtc %d\n", crtc_id); 1477 1477 return -ENOENT; ··· 3059 3059 void r100_debugfs_rbbm_init(struct radeon_device *rdev) 3060 3060 { 3061 3061 #if defined(CONFIG_DEBUG_FS) 3062 - struct dentry *root = rdev->ddev->primary->debugfs_root; 3062 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 3063 3063 3064 3064 debugfs_create_file("r100_rbbm_info", 0444, root, rdev, 3065 3065 &r100_debugfs_rbbm_info_fops); ··· 3069 3069 void r100_debugfs_cp_init(struct radeon_device *rdev) 3070 3070 { 3071 3071 #if defined(CONFIG_DEBUG_FS) 3072 - struct dentry *root = rdev->ddev->primary->debugfs_root; 3072 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 3073 3073 3074 3074 debugfs_create_file("r100_cp_ring_info", 0444, root, rdev, 3075 3075 &r100_debugfs_cp_ring_info_fops); ··· 3081 3081 void r100_debugfs_mc_info_init(struct radeon_device *rdev) 3082 3082 { 3083 3083 #if defined(CONFIG_DEBUG_FS) 3084 - struct dentry *root = rdev->ddev->primary->debugfs_root; 3084 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 3085 3085 3086 3086 debugfs_create_file("r100_mc_info", 0444, root, rdev, 3087 3087 &r100_debugfs_mc_info_fops); ··· 3947 3947 RREG32(R_0007C0_CP_STAT)); 3948 3948 } 3949 3949 /* post */ 3950 - radeon_combios_asic_init(rdev->ddev); 3950 + radeon_combios_asic_init(rdev_to_drm(rdev)); 3951 3951 /* Resume clock after posting */ 3952 3952 r100_clock_startup(rdev); 3953 3953 /* Initialize surface registers */ ··· 4056 4056 /* Set asic errata */ 4057 4057 r100_errata(rdev); 4058 4058 /* Initialize clocks */ 4059 - radeon_get_clock_info(rdev->ddev); 4059 + radeon_get_clock_info(rdev_to_drm(rdev)); 4060 4060 /* initialize AGP */ 4061 4061 if (rdev->flags & RADEON_IS_AGP) { 4062 4062 r = radeon_agp_init(rdev);
+3 -3
drivers/gpu/drm/radeon/r300.c
··· 616 616 static void rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev) 617 617 { 618 618 #if defined(CONFIG_DEBUG_FS) 619 - struct dentry *root = rdev->ddev->primary->debugfs_root; 619 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 620 620 621 621 debugfs_create_file("rv370_pcie_gart_info", 0444, root, rdev, 622 622 &rv370_debugfs_pcie_gart_info_fops); ··· 1452 1452 RREG32(R_0007C0_CP_STAT)); 1453 1453 } 1454 1454 /* post */ 1455 - radeon_combios_asic_init(rdev->ddev); 1455 + radeon_combios_asic_init(rdev_to_drm(rdev)); 1456 1456 /* Resume clock after posting */ 1457 1457 r300_clock_startup(rdev); 1458 1458 /* Initialize surface registers */ ··· 1538 1538 /* Set asic errata */ 1539 1539 r300_errata(rdev); 1540 1540 /* Initialize clocks */ 1541 - radeon_get_clock_info(rdev->ddev); 1541 + radeon_get_clock_info(rdev_to_drm(rdev)); 1542 1542 /* initialize AGP */ 1543 1543 if (rdev->flags & RADEON_IS_AGP) { 1544 1544 r = radeon_agp_init(rdev);
+3 -3
drivers/gpu/drm/radeon/r420.c
··· 322 322 if (rdev->is_atom_bios) { 323 323 atom_asic_init(rdev->mode_info.atom_context); 324 324 } else { 325 - radeon_combios_asic_init(rdev->ddev); 325 + radeon_combios_asic_init(rdev_to_drm(rdev)); 326 326 } 327 327 /* Resume clock after posting */ 328 328 r420_clock_resume(rdev); ··· 414 414 return -EINVAL; 415 415 416 416 /* Initialize clocks */ 417 - radeon_get_clock_info(rdev->ddev); 417 + radeon_get_clock_info(rdev_to_drm(rdev)); 418 418 /* initialize AGP */ 419 419 if (rdev->flags & RADEON_IS_AGP) { 420 420 r = radeon_agp_init(rdev); ··· 493 493 void r420_debugfs_pipes_info_init(struct radeon_device *rdev) 494 494 { 495 495 #if defined(CONFIG_DEBUG_FS) 496 - struct dentry *root = rdev->ddev->primary->debugfs_root; 496 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 497 497 498 498 debugfs_create_file("r420_pipes_info", 0444, root, rdev, 499 499 &r420_debugfs_pipes_info_fops);
+1 -1
drivers/gpu/drm/radeon/r520.c
··· 287 287 atom_asic_init(rdev->mode_info.atom_context); 288 288 } 289 289 /* Initialize clocks */ 290 - radeon_get_clock_info(rdev->ddev); 290 + radeon_get_clock_info(rdev_to_drm(rdev)); 291 291 /* initialize AGP */ 292 292 if (rdev->flags & RADEON_IS_AGP) { 293 293 r = radeon_agp_init(rdev);
+6 -6
drivers/gpu/drm/radeon/r600.c
··· 950 950 951 951 void r600_hpd_init(struct radeon_device *rdev) 952 952 { 953 - struct drm_device *dev = rdev->ddev; 953 + struct drm_device *dev = rdev_to_drm(rdev); 954 954 struct drm_connector *connector; 955 955 unsigned enable = 0; 956 956 ··· 1017 1017 1018 1018 void r600_hpd_fini(struct radeon_device *rdev) 1019 1019 { 1020 - struct drm_device *dev = rdev->ddev; 1020 + struct drm_device *dev = rdev_to_drm(rdev); 1021 1021 struct drm_connector *connector; 1022 1022 unsigned disable = 0; 1023 1023 ··· 3280 3280 /* Initialize surface registers */ 3281 3281 radeon_surface_init(rdev); 3282 3282 /* Initialize clocks */ 3283 - radeon_get_clock_info(rdev->ddev); 3283 + radeon_get_clock_info(rdev_to_drm(rdev)); 3284 3284 /* Fence driver */ 3285 3285 radeon_fence_driver_init(rdev); 3286 3286 if (rdev->flags & RADEON_IS_AGP) { ··· 4136 4136 DRM_DEBUG("IH: D1 vblank - IH event w/o asserted irq bit?\n"); 4137 4137 4138 4138 if (rdev->irq.crtc_vblank_int[0]) { 4139 - drm_handle_vblank(rdev->ddev, 0); 4139 + drm_handle_vblank(rdev_to_drm(rdev), 0); 4140 4140 rdev->pm.vblank_sync = true; 4141 4141 wake_up(&rdev->irq.vblank_queue); 4142 4142 } ··· 4166 4166 DRM_DEBUG("IH: D2 vblank - IH event w/o asserted irq bit?\n"); 4167 4167 4168 4168 if (rdev->irq.crtc_vblank_int[1]) { 4169 - drm_handle_vblank(rdev->ddev, 1); 4169 + drm_handle_vblank(rdev_to_drm(rdev), 1); 4170 4170 rdev->pm.vblank_sync = true; 4171 4171 wake_up(&rdev->irq.vblank_queue); 4172 4172 } ··· 4358 4358 static void r600_debugfs_mc_info_init(struct radeon_device *rdev) 4359 4359 { 4360 4360 #if defined(CONFIG_DEBUG_FS) 4361 - struct dentry *root = rdev->ddev->primary->debugfs_root; 4361 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 4362 4362 4363 4363 debugfs_create_file("r600_mc_info", 0444, root, rdev, 4364 4364 &r600_debugfs_mc_info_fops);
+1 -1
drivers/gpu/drm/radeon/r600_cs.c
··· 884 884 crtc_id = radeon_get_ib_value(p, h_idx + 2 + 7 + 1); 885 885 reg = R600_CP_PACKET0_GET_REG(header); 886 886 887 - crtc = drm_crtc_find(p->rdev->ddev, p->filp, crtc_id); 887 + crtc = drm_crtc_find(rdev_to_drm(p->rdev), p->filp, crtc_id); 888 888 if (!crtc) { 889 889 DRM_ERROR("cannot find crtc %d\n", crtc_id); 890 890 return -ENOENT;
+2 -2
drivers/gpu/drm/radeon/r600_dpm.c
··· 153 153 154 154 u32 r600_dpm_get_vblank_time(struct radeon_device *rdev) 155 155 { 156 - struct drm_device *dev = rdev->ddev; 156 + struct drm_device *dev = rdev_to_drm(rdev); 157 157 struct drm_crtc *crtc; 158 158 struct radeon_crtc *radeon_crtc; 159 159 u32 vblank_in_pixels; ··· 180 180 181 181 u32 r600_dpm_get_vrefresh(struct radeon_device *rdev) 182 182 { 183 - struct drm_device *dev = rdev->ddev; 183 + struct drm_device *dev = rdev_to_drm(rdev); 184 184 struct drm_crtc *crtc; 185 185 struct radeon_crtc *radeon_crtc; 186 186 u32 vrefresh = 0;
+1 -1
drivers/gpu/drm/radeon/r600_hdmi.c
··· 116 116 { 117 117 struct radeon_device *rdev = container_of(work, struct radeon_device, 118 118 audio_work); 119 - struct drm_device *dev = rdev->ddev; 119 + struct drm_device *dev = rdev_to_drm(rdev); 120 120 struct r600_audio_pin audio_status = r600_audio_status(rdev); 121 121 struct drm_encoder *encoder; 122 122 bool changed = false;
+5 -5
drivers/gpu/drm/radeon/radeon_acpi.c
··· 405 405 if (req.pending & ATIF_DGPU_DISPLAY_EVENT) { 406 406 if ((rdev->flags & RADEON_IS_PX) && 407 407 radeon_atpx_dgpu_req_power_for_displays()) { 408 - pm_runtime_get_sync(rdev->ddev->dev); 408 + pm_runtime_get_sync(rdev_to_drm(rdev)->dev); 409 409 /* Just fire off a uevent and let userspace tell us what to do */ 410 - drm_helper_hpd_irq_event(rdev->ddev); 411 - pm_runtime_mark_last_busy(rdev->ddev->dev); 412 - pm_runtime_put_autosuspend(rdev->ddev->dev); 410 + drm_helper_hpd_irq_event(rdev_to_drm(rdev)); 411 + pm_runtime_mark_last_busy(rdev_to_drm(rdev)->dev); 412 + pm_runtime_put_autosuspend(rdev_to_drm(rdev)->dev); 413 413 } 414 414 } 415 415 /* TODO: check other events */ ··· 736 736 struct radeon_encoder *target = NULL; 737 737 738 738 /* Find the encoder controlling the brightness */ 739 - list_for_each_entry(tmp, &rdev->ddev->mode_config.encoder_list, 739 + list_for_each_entry(tmp, &rdev_to_drm(rdev)->mode_config.encoder_list, 740 740 head) { 741 741 struct radeon_encoder *enc = to_radeon_encoder(tmp); 742 742
+1 -1
drivers/gpu/drm/radeon/radeon_agp.c
··· 161 161 162 162 static int radeon_agp_head_acquire(struct radeon_device *rdev) 163 163 { 164 - struct drm_device *dev = rdev->ddev; 164 + struct drm_device *dev = rdev_to_drm(rdev); 165 165 struct pci_dev *pdev = to_pci_dev(dev->dev); 166 166 167 167 if (!rdev->agp)
+1 -1
drivers/gpu/drm/radeon/radeon_atombios.c
··· 187 187 188 188 if (i2c.valid) { 189 189 sprintf(stmp, "0x%x", i2c.i2c_id); 190 - rdev->i2c_bus[i] = radeon_i2c_create(rdev->ddev, &i2c, stmp); 190 + rdev->i2c_bus[i] = radeon_i2c_create(rdev_to_drm(rdev), &i2c, stmp); 191 191 } 192 192 gpio = (ATOM_GPIO_I2C_ASSIGMENT *) 193 193 ((u8 *)gpio + sizeof(ATOM_GPIO_I2C_ASSIGMENT));
+2 -2
drivers/gpu/drm/radeon/radeon_audio.c
··· 196 196 return; 197 197 198 198 if (rdev->mode_info.mode_config_initialized) { 199 - list_for_each_entry(encoder, &rdev->ddev->mode_config.encoder_list, head) { 199 + list_for_each_entry(encoder, &rdev_to_drm(rdev)->mode_config.encoder_list, head) { 200 200 if (radeon_encoder_is_digital(encoder)) { 201 201 radeon_encoder = to_radeon_encoder(encoder); 202 202 dig = radeon_encoder->enc_priv; ··· 760 760 if (!rdev->audio.enabled || !rdev->mode_info.mode_config_initialized) 761 761 return 0; 762 762 763 - list_for_each_entry(encoder, &rdev->ddev->mode_config.encoder_list, head) { 763 + list_for_each_entry(encoder, &rdev_to_drm(rdev)->mode_config.encoder_list, head) { 764 764 if (!radeon_encoder_is_digital(encoder)) 765 765 continue; 766 766 radeon_encoder = to_radeon_encoder(encoder);
+6 -6
drivers/gpu/drm/radeon/radeon_combios.c
··· 372 372 int edid_info, size; 373 373 struct edid *edid; 374 374 unsigned char *raw; 375 - edid_info = combios_get_table_offset(rdev->ddev, COMBIOS_HARDCODED_EDID_TABLE); 375 + edid_info = combios_get_table_offset(rdev_to_drm(rdev), COMBIOS_HARDCODED_EDID_TABLE); 376 376 if (!edid_info) 377 377 return false; 378 378 ··· 642 642 643 643 static struct radeon_i2c_bus_rec radeon_combios_get_i2c_info_from_table(struct radeon_device *rdev) 644 644 { 645 - struct drm_device *dev = rdev->ddev; 645 + struct drm_device *dev = rdev_to_drm(rdev); 646 646 struct radeon_i2c_bus_rec i2c; 647 647 u16 offset; 648 648 u8 id, blocks, clk, data; ··· 670 670 671 671 void radeon_combios_i2c_init(struct radeon_device *rdev) 672 672 { 673 - struct drm_device *dev = rdev->ddev; 673 + struct drm_device *dev = rdev_to_drm(rdev); 674 674 struct radeon_i2c_bus_rec i2c; 675 675 676 676 /* actual hw pads ··· 812 812 813 813 bool radeon_combios_sideport_present(struct radeon_device *rdev) 814 814 { 815 - struct drm_device *dev = rdev->ddev; 815 + struct drm_device *dev = rdev_to_drm(rdev); 816 816 u16 igp_info; 817 817 818 818 /* sideport is AMD only */ ··· 915 915 enum radeon_tv_std 916 916 radeon_combios_get_tv_info(struct radeon_device *rdev) 917 917 { 918 - struct drm_device *dev = rdev->ddev; 918 + struct drm_device *dev = rdev_to_drm(rdev); 919 919 uint16_t tv_info; 920 920 enum radeon_tv_std tv_std = TV_STD_NTSC; 921 921 ··· 2637 2637 2638 2638 void radeon_combios_get_power_modes(struct radeon_device *rdev) 2639 2639 { 2640 - struct drm_device *dev = rdev->ddev; 2640 + struct drm_device *dev = rdev_to_drm(rdev); 2641 2641 u16 offset, misc, misc2 = 0; 2642 2642 u8 rev, tmp; 2643 2643 int state_index = 0;
+5 -5
drivers/gpu/drm/radeon/radeon_device.c
··· 760 760 if (rdev->is_atom_bios) 761 761 atom_asic_init(rdev->mode_info.atom_context); 762 762 else 763 - radeon_combios_asic_init(rdev->ddev); 763 + radeon_combios_asic_init(rdev_to_drm(rdev)); 764 764 return true; 765 765 } else { 766 766 dev_err(rdev->dev, "Card not posted and no BIOS - ignoring\n"); ··· 980 980 return -ENOMEM; 981 981 982 982 rdev->mode_info.atom_card_info = atom_card_info; 983 - atom_card_info->dev = rdev->ddev; 983 + atom_card_info->dev = rdev_to_drm(rdev); 984 984 atom_card_info->reg_read = cail_reg_read; 985 985 atom_card_info->reg_write = cail_reg_write; 986 986 /* needed for iio ops */ ··· 1005 1005 1006 1006 mutex_init(&rdev->mode_info.atom_context->mutex); 1007 1007 mutex_init(&rdev->mode_info.atom_context->scratch_mutex); 1008 - radeon_atom_initialize_bios_scratch_regs(rdev->ddev); 1008 + radeon_atom_initialize_bios_scratch_regs(rdev_to_drm(rdev)); 1009 1009 atom_allocate_fb_scratch(rdev->mode_info.atom_context); 1010 1010 return 0; 1011 1011 } ··· 1049 1049 */ 1050 1050 int radeon_combios_init(struct radeon_device *rdev) 1051 1051 { 1052 - radeon_combios_initialize_bios_scratch_regs(rdev->ddev); 1052 + radeon_combios_initialize_bios_scratch_regs(rdev_to_drm(rdev)); 1053 1053 return 0; 1054 1054 } 1055 1055 ··· 1847 1847 1848 1848 downgrade_write(&rdev->exclusive_lock); 1849 1849 1850 - drm_helper_resume_force_mode(rdev->ddev); 1850 + drm_helper_resume_force_mode(rdev_to_drm(rdev)); 1851 1851 1852 1852 /* set the power state here in case we are a PX system or headless */ 1853 1853 if ((rdev->pm.pm_method == PM_METHOD_DPM) && rdev->pm.dpm_enabled)
+37 -37
drivers/gpu/drm/radeon/radeon_display.c
··· 302 302 if ((radeon_use_pflipirq == 2) && ASIC_IS_DCE4(rdev)) 303 303 return; 304 304 305 - spin_lock_irqsave(&rdev->ddev->event_lock, flags); 305 + spin_lock_irqsave(&rdev_to_drm(rdev)->event_lock, flags); 306 306 if (radeon_crtc->flip_status != RADEON_FLIP_SUBMITTED) { 307 307 DRM_DEBUG_DRIVER("radeon_crtc->flip_status = %d != " 308 308 "RADEON_FLIP_SUBMITTED(%d)\n", 309 309 radeon_crtc->flip_status, 310 310 RADEON_FLIP_SUBMITTED); 311 - spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 311 + spin_unlock_irqrestore(&rdev_to_drm(rdev)->event_lock, flags); 312 312 return; 313 313 } 314 314 ··· 334 334 */ 335 335 if (update_pending && 336 336 (DRM_SCANOUTPOS_VALID & 337 - radeon_get_crtc_scanoutpos(rdev->ddev, crtc_id, 337 + radeon_get_crtc_scanoutpos(rdev_to_drm(rdev), crtc_id, 338 338 GET_DISTANCE_TO_VBLANKSTART, 339 339 &vpos, &hpos, NULL, NULL, 340 340 &rdev->mode_info.crtcs[crtc_id]->base.hwmode)) && ··· 347 347 */ 348 348 update_pending = 0; 349 349 } 350 - spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 350 + spin_unlock_irqrestore(&rdev_to_drm(rdev)->event_lock, flags); 351 351 if (!update_pending) 352 352 radeon_crtc_handle_flip(rdev, crtc_id); 353 353 } ··· 370 370 if (radeon_crtc == NULL) 371 371 return; 372 372 373 - spin_lock_irqsave(&rdev->ddev->event_lock, flags); 373 + spin_lock_irqsave(&rdev_to_drm(rdev)->event_lock, flags); 374 374 work = radeon_crtc->flip_work; 375 375 if (radeon_crtc->flip_status != RADEON_FLIP_SUBMITTED) { 376 376 DRM_DEBUG_DRIVER("radeon_crtc->flip_status = %d != " 377 377 "RADEON_FLIP_SUBMITTED(%d)\n", 378 378 radeon_crtc->flip_status, 379 379 RADEON_FLIP_SUBMITTED); 380 - spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 380 + spin_unlock_irqrestore(&rdev_to_drm(rdev)->event_lock, flags); 381 381 return; 382 382 } 383 383 ··· 389 389 if (work->event) 390 390 drm_crtc_send_vblank_event(&radeon_crtc->base, work->event); 391 391 392 - spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); 392 + spin_unlock_irqrestore(&rdev_to_drm(rdev)->event_lock, flags); 393 393 394 394 drm_crtc_vblank_put(&radeon_crtc->base); 395 395 radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id); ··· 408 408 struct radeon_flip_work *work = 409 409 container_of(__work, struct radeon_flip_work, flip_work); 410 410 struct radeon_device *rdev = work->rdev; 411 - struct drm_device *dev = rdev->ddev; 411 + struct drm_device *dev = rdev_to_drm(rdev); 412 412 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[work->crtc_id]; 413 413 414 414 struct drm_crtc *crtc = &radeon_crtc->base; ··· 1401 1401 1402 1402 if (rdev->is_atom_bios) { 1403 1403 rdev->mode_info.coherent_mode_property = 1404 - drm_property_create_range(rdev->ddev, 0 , "coherent", 0, 1); 1404 + drm_property_create_range(rdev_to_drm(rdev), 0, "coherent", 0, 1); 1405 1405 if (!rdev->mode_info.coherent_mode_property) 1406 1406 return -ENOMEM; 1407 1407 } ··· 1409 1409 if (!ASIC_IS_AVIVO(rdev)) { 1410 1410 sz = ARRAY_SIZE(radeon_tmds_pll_enum_list); 1411 1411 rdev->mode_info.tmds_pll_property = 1412 - drm_property_create_enum(rdev->ddev, 0, 1412 + drm_property_create_enum(rdev_to_drm(rdev), 0, 1413 1413 "tmds_pll", 1414 1414 radeon_tmds_pll_enum_list, sz); 1415 1415 } 1416 1416 1417 1417 rdev->mode_info.load_detect_property = 1418 - drm_property_create_range(rdev->ddev, 0, "load detection", 0, 1); 1418 + drm_property_create_range(rdev_to_drm(rdev), 0, "load detection", 0, 1); 1419 1419 if (!rdev->mode_info.load_detect_property) 1420 1420 return -ENOMEM; 1421 1421 1422 - drm_mode_create_scaling_mode_property(rdev->ddev); 1422 + drm_mode_create_scaling_mode_property(rdev_to_drm(rdev)); 1423 1423 1424 1424 sz = ARRAY_SIZE(radeon_tv_std_enum_list); 1425 1425 rdev->mode_info.tv_std_property = 1426 - drm_property_create_enum(rdev->ddev, 0, 1426 + drm_property_create_enum(rdev_to_drm(rdev), 0, 1427 1427 "tv standard", 1428 1428 radeon_tv_std_enum_list, sz); 1429 1429 1430 1430 sz = ARRAY_SIZE(radeon_underscan_enum_list); 1431 1431 rdev->mode_info.underscan_property = 1432 - drm_property_create_enum(rdev->ddev, 0, 1432 + drm_property_create_enum(rdev_to_drm(rdev), 0, 1433 1433 "underscan", 1434 1434 radeon_underscan_enum_list, sz); 1435 1435 1436 1436 rdev->mode_info.underscan_hborder_property = 1437 - drm_property_create_range(rdev->ddev, 0, 1437 + drm_property_create_range(rdev_to_drm(rdev), 0, 1438 1438 "underscan hborder", 0, 128); 1439 1439 if (!rdev->mode_info.underscan_hborder_property) 1440 1440 return -ENOMEM; 1441 1441 1442 1442 rdev->mode_info.underscan_vborder_property = 1443 - drm_property_create_range(rdev->ddev, 0, 1443 + drm_property_create_range(rdev_to_drm(rdev), 0, 1444 1444 "underscan vborder", 0, 128); 1445 1445 if (!rdev->mode_info.underscan_vborder_property) 1446 1446 return -ENOMEM; 1447 1447 1448 1448 sz = ARRAY_SIZE(radeon_audio_enum_list); 1449 1449 rdev->mode_info.audio_property = 1450 - drm_property_create_enum(rdev->ddev, 0, 1450 + drm_property_create_enum(rdev_to_drm(rdev), 0, 1451 1451 "audio", 1452 1452 radeon_audio_enum_list, sz); 1453 1453 1454 1454 sz = ARRAY_SIZE(radeon_dither_enum_list); 1455 1455 rdev->mode_info.dither_property = 1456 - drm_property_create_enum(rdev->ddev, 0, 1456 + drm_property_create_enum(rdev_to_drm(rdev), 0, 1457 1457 "dither", 1458 1458 radeon_dither_enum_list, sz); 1459 1459 1460 1460 sz = ARRAY_SIZE(radeon_output_csc_enum_list); 1461 1461 rdev->mode_info.output_csc_property = 1462 - drm_property_create_enum(rdev->ddev, 0, 1462 + drm_property_create_enum(rdev_to_drm(rdev), 0, 1463 1463 "output_csc", 1464 1464 radeon_output_csc_enum_list, sz); 1465 1465 ··· 1578 1578 int i; 1579 1579 int ret; 1580 1580 1581 - drm_mode_config_init(rdev->ddev); 1581 + drm_mode_config_init(rdev_to_drm(rdev)); 1582 1582 rdev->mode_info.mode_config_initialized = true; 1583 1583 1584 - rdev->ddev->mode_config.funcs = &radeon_mode_funcs; 1584 + rdev_to_drm(rdev)->mode_config.funcs = &radeon_mode_funcs; 1585 1585 1586 1586 if (radeon_use_pflipirq == 2 && rdev->family >= CHIP_R600) 1587 - rdev->ddev->mode_config.async_page_flip = true; 1587 + rdev_to_drm(rdev)->mode_config.async_page_flip = true; 1588 1588 1589 1589 if (ASIC_IS_DCE5(rdev)) { 1590 - rdev->ddev->mode_config.max_width = 16384; 1591 - rdev->ddev->mode_config.max_height = 16384; 1590 + rdev_to_drm(rdev)->mode_config.max_width = 16384; 1591 + rdev_to_drm(rdev)->mode_config.max_height = 16384; 1592 1592 } else if (ASIC_IS_AVIVO(rdev)) { 1593 - rdev->ddev->mode_config.max_width = 8192; 1594 - rdev->ddev->mode_config.max_height = 8192; 1593 + rdev_to_drm(rdev)->mode_config.max_width = 8192; 1594 + rdev_to_drm(rdev)->mode_config.max_height = 8192; 1595 1595 } else { 1596 - rdev->ddev->mode_config.max_width = 4096; 1597 - rdev->ddev->mode_config.max_height = 4096; 1596 + rdev_to_drm(rdev)->mode_config.max_width = 4096; 1597 + rdev_to_drm(rdev)->mode_config.max_height = 4096; 1598 1598 } 1599 1599 1600 - rdev->ddev->mode_config.preferred_depth = 24; 1601 - rdev->ddev->mode_config.prefer_shadow = 1; 1600 + rdev_to_drm(rdev)->mode_config.preferred_depth = 24; 1601 + rdev_to_drm(rdev)->mode_config.prefer_shadow = 1; 1602 1602 1603 - rdev->ddev->mode_config.fb_modifiers_not_supported = true; 1603 + rdev_to_drm(rdev)->mode_config.fb_modifiers_not_supported = true; 1604 1604 1605 1605 ret = radeon_modeset_create_props(rdev); 1606 1606 if (ret) { ··· 1618 1618 1619 1619 /* allocate crtcs */ 1620 1620 for (i = 0; i < rdev->num_crtc; i++) { 1621 - radeon_crtc_init(rdev->ddev, i); 1621 + radeon_crtc_init(rdev_to_drm(rdev), i); 1622 1622 } 1623 1623 1624 1624 /* okay we should have all the bios connectors */ 1625 - ret = radeon_setup_enc_conn(rdev->ddev); 1625 + ret = radeon_setup_enc_conn(rdev_to_drm(rdev)); 1626 1626 if (!ret) { 1627 1627 return ret; 1628 1628 } ··· 1639 1639 /* setup afmt */ 1640 1640 radeon_afmt_init(rdev); 1641 1641 1642 - drm_kms_helper_poll_init(rdev->ddev); 1642 + drm_kms_helper_poll_init(rdev_to_drm(rdev)); 1643 1643 1644 1644 /* do pm late init */ 1645 1645 ret = radeon_pm_late_init(rdev); ··· 1650 1650 void radeon_modeset_fini(struct radeon_device *rdev) 1651 1651 { 1652 1652 if (rdev->mode_info.mode_config_initialized) { 1653 - drm_kms_helper_poll_fini(rdev->ddev); 1653 + drm_kms_helper_poll_fini(rdev_to_drm(rdev)); 1654 1654 radeon_hpd_fini(rdev); 1655 - drm_helper_force_disable_all(rdev->ddev); 1655 + drm_helper_force_disable_all(rdev_to_drm(rdev)); 1656 1656 radeon_afmt_fini(rdev); 1657 - drm_mode_config_cleanup(rdev->ddev); 1657 + drm_mode_config_cleanup(rdev_to_drm(rdev)); 1658 1658 rdev->mode_info.mode_config_initialized = false; 1659 1659 } 1660 1660
+13 -13
drivers/gpu/drm/radeon/radeon_fbdev.c
··· 67 67 int height = mode_cmd->height; 68 68 u32 cpp; 69 69 70 - info = drm_get_format_info(rdev->ddev, mode_cmd); 70 + info = drm_get_format_info(rdev_to_drm(rdev), mode_cmd); 71 71 cpp = info->cpp[0]; 72 72 73 73 /* need to align pitch with crtc limits */ ··· 148 148 struct radeon_device *rdev = fb_helper->dev->dev_private; 149 149 int ret; 150 150 151 - ret = pm_runtime_get_sync(rdev->ddev->dev); 151 + ret = pm_runtime_get_sync(rdev_to_drm(rdev)->dev); 152 152 if (ret < 0 && ret != -EACCES) 153 153 goto err_pm_runtime_mark_last_busy; 154 154 155 155 return 0; 156 156 157 157 err_pm_runtime_mark_last_busy: 158 - pm_runtime_mark_last_busy(rdev->ddev->dev); 159 - pm_runtime_put_autosuspend(rdev->ddev->dev); 158 + pm_runtime_mark_last_busy(rdev_to_drm(rdev)->dev); 159 + pm_runtime_put_autosuspend(rdev_to_drm(rdev)->dev); 160 160 return ret; 161 161 } 162 162 ··· 165 165 struct drm_fb_helper *fb_helper = info->par; 166 166 struct radeon_device *rdev = fb_helper->dev->dev_private; 167 167 168 - pm_runtime_mark_last_busy(rdev->ddev->dev); 169 - pm_runtime_put_autosuspend(rdev->ddev->dev); 168 + pm_runtime_mark_last_busy(rdev_to_drm(rdev)->dev); 169 + pm_runtime_put_autosuspend(rdev_to_drm(rdev)->dev); 170 170 171 171 return 0; 172 172 } ··· 236 236 ret = -ENOMEM; 237 237 goto err_radeon_fbdev_destroy_pinned_object; 238 238 } 239 - ret = radeon_framebuffer_init(rdev->ddev, fb, &mode_cmd, gobj); 239 + ret = radeon_framebuffer_init(rdev_to_drm(rdev), fb, &mode_cmd, gobj); 240 240 if (ret) { 241 241 DRM_ERROR("failed to initialize framebuffer %d\n", ret); 242 242 goto err_kfree; ··· 374 374 fb_helper = kzalloc(sizeof(*fb_helper), GFP_KERNEL); 375 375 if (!fb_helper) 376 376 return; 377 - drm_fb_helper_prepare(rdev->ddev, fb_helper, bpp_sel, &radeon_fbdev_fb_helper_funcs); 377 + drm_fb_helper_prepare(rdev_to_drm(rdev), fb_helper, bpp_sel, &radeon_fbdev_fb_helper_funcs); 378 378 379 - ret = drm_client_init(rdev->ddev, &fb_helper->client, "radeon-fbdev", 379 + ret = drm_client_init(rdev_to_drm(rdev), &fb_helper->client, "radeon-fbdev", 380 380 &radeon_fbdev_client_funcs); 381 381 if (ret) { 382 - drm_err(rdev->ddev, "Failed to register client: %d\n", ret); 382 + drm_err(rdev_to_drm(rdev), "Failed to register client: %d\n", ret); 383 383 goto err_drm_client_init; 384 384 } 385 385 ··· 394 394 395 395 void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state) 396 396 { 397 - if (rdev->ddev->fb_helper) 398 - drm_fb_helper_set_suspend(rdev->ddev->fb_helper, state); 397 + if (rdev_to_drm(rdev)->fb_helper) 398 + drm_fb_helper_set_suspend(rdev_to_drm(rdev)->fb_helper, state); 399 399 } 400 400 401 401 bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo *robj) 402 402 { 403 - struct drm_fb_helper *fb_helper = rdev->ddev->fb_helper; 403 + struct drm_fb_helper *fb_helper = rdev_to_drm(rdev)->fb_helper; 404 404 struct drm_gem_object *gobj; 405 405 406 406 if (!fb_helper)
+4 -4
drivers/gpu/drm/radeon/radeon_fence.c
··· 150 150 rdev->fence_context + ring, 151 151 seq); 152 152 radeon_fence_ring_emit(rdev, ring, *fence); 153 - trace_radeon_fence_emit(rdev->ddev, ring, (*fence)->seq); 153 + trace_radeon_fence_emit(rdev_to_drm(rdev), ring, (*fence)->seq); 154 154 radeon_fence_schedule_check(rdev, ring); 155 155 return 0; 156 156 } ··· 489 489 if (!target_seq[i]) 490 490 continue; 491 491 492 - trace_radeon_fence_wait_begin(rdev->ddev, i, target_seq[i]); 492 + trace_radeon_fence_wait_begin(rdev_to_drm(rdev), i, target_seq[i]); 493 493 radeon_irq_kms_sw_irq_get(rdev, i); 494 494 } 495 495 ··· 511 511 continue; 512 512 513 513 radeon_irq_kms_sw_irq_put(rdev, i); 514 - trace_radeon_fence_wait_end(rdev->ddev, i, target_seq[i]); 514 + trace_radeon_fence_wait_end(rdev_to_drm(rdev), i, target_seq[i]); 515 515 } 516 516 517 517 return r; ··· 995 995 void radeon_debugfs_fence_init(struct radeon_device *rdev) 996 996 { 997 997 #if defined(CONFIG_DEBUG_FS) 998 - struct dentry *root = rdev->ddev->primary->debugfs_root; 998 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 999 999 1000 1000 debugfs_create_file("radeon_gpu_reset", 0444, root, rdev, 1001 1001 &radeon_debugfs_gpu_reset_fops);
+1 -1
drivers/gpu/drm/radeon/radeon_gem.c
··· 899 899 void radeon_gem_debugfs_init(struct radeon_device *rdev) 900 900 { 901 901 #if defined(CONFIG_DEBUG_FS) 902 - struct dentry *root = rdev->ddev->primary->debugfs_root; 902 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 903 903 904 904 debugfs_create_file("radeon_gem_info", 0444, root, rdev, 905 905 &radeon_debugfs_gem_info_fops);
+1 -1
drivers/gpu/drm/radeon/radeon_i2c.c
··· 1011 1011 struct radeon_i2c_bus_rec *rec, 1012 1012 const char *name) 1013 1013 { 1014 - struct drm_device *dev = rdev->ddev; 1014 + struct drm_device *dev = rdev_to_drm(rdev); 1015 1015 int i; 1016 1016 1017 1017 for (i = 0; i < RADEON_MAX_I2C_BUS; i++) {
+1 -1
drivers/gpu/drm/radeon/radeon_ib.c
··· 309 309 static void radeon_debugfs_sa_init(struct radeon_device *rdev) 310 310 { 311 311 #if defined(CONFIG_DEBUG_FS) 312 - struct dentry *root = rdev->ddev->primary->debugfs_root; 312 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 313 313 314 314 debugfs_create_file("radeon_sa_info", 0444, root, rdev, 315 315 &radeon_debugfs_sa_info_fops);
+6 -6
drivers/gpu/drm/radeon/radeon_irq_kms.c
··· 80 80 { 81 81 struct radeon_device *rdev = container_of(work, struct radeon_device, 82 82 hotplug_work.work); 83 - struct drm_device *dev = rdev->ddev; 83 + struct drm_device *dev = rdev_to_drm(rdev); 84 84 struct drm_mode_config *mode_config = &dev->mode_config; 85 85 struct drm_connector *connector; 86 86 ··· 101 101 { 102 102 struct radeon_device *rdev = container_of(work, struct radeon_device, 103 103 dp_work); 104 - struct drm_device *dev = rdev->ddev; 104 + struct drm_device *dev = rdev_to_drm(rdev); 105 105 struct drm_mode_config *mode_config = &dev->mode_config; 106 106 struct drm_connector *connector; 107 107 ··· 197 197 198 198 static int radeon_irq_install(struct radeon_device *rdev, int irq) 199 199 { 200 - struct drm_device *dev = rdev->ddev; 200 + struct drm_device *dev = rdev_to_drm(rdev); 201 201 int ret; 202 202 203 203 if (irq == IRQ_NOTCONNECTED) ··· 218 218 219 219 static void radeon_irq_uninstall(struct radeon_device *rdev) 220 220 { 221 - struct drm_device *dev = rdev->ddev; 221 + struct drm_device *dev = rdev_to_drm(rdev); 222 222 struct pci_dev *pdev = to_pci_dev(dev->dev); 223 223 224 224 radeon_driver_irq_uninstall_kms(dev); ··· 322 322 spin_lock_init(&rdev->irq.lock); 323 323 324 324 /* Disable vblank irqs aggressively for power-saving */ 325 - rdev->ddev->vblank_disable_immediate = true; 325 + rdev_to_drm(rdev)->vblank_disable_immediate = true; 326 326 327 - r = drm_vblank_init(rdev->ddev, rdev->num_crtc); 327 + r = drm_vblank_init(rdev_to_drm(rdev), rdev->num_crtc); 328 328 if (r) { 329 329 return r; 330 330 }
+1 -1
drivers/gpu/drm/radeon/radeon_object.c
··· 150 150 bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL); 151 151 if (bo == NULL) 152 152 return -ENOMEM; 153 - drm_gem_private_object_init(rdev->ddev, &bo->tbo.base, size); 153 + drm_gem_private_object_init(rdev_to_drm(rdev), &bo->tbo.base, size); 154 154 bo->rdev = rdev; 155 155 bo->surface_reg = -1; 156 156 INIT_LIST_HEAD(&bo->list);
+10 -10
drivers/gpu/drm/radeon/radeon_pm.c
··· 282 282 283 283 if (rdev->irq.installed) { 284 284 i = 0; 285 - drm_for_each_crtc(crtc, rdev->ddev) { 285 + drm_for_each_crtc(crtc, rdev_to_drm(rdev)) { 286 286 if (rdev->pm.active_crtcs & (1 << i)) { 287 287 /* This can fail if a modeset is in progress */ 288 288 if (drm_crtc_vblank_get(crtc) == 0) ··· 299 299 300 300 if (rdev->irq.installed) { 301 301 i = 0; 302 - drm_for_each_crtc(crtc, rdev->ddev) { 302 + drm_for_each_crtc(crtc, rdev_to_drm(rdev)) { 303 303 if (rdev->pm.req_vblank & (1 << i)) { 304 304 rdev->pm.req_vblank &= ~(1 << i); 305 305 drm_crtc_vblank_put(crtc); ··· 671 671 char *buf) 672 672 { 673 673 struct radeon_device *rdev = dev_get_drvdata(dev); 674 - struct drm_device *ddev = rdev->ddev; 674 + struct drm_device *ddev = rdev_to_drm(rdev); 675 675 int temp; 676 676 677 677 /* Can't get temperature when the card is off */ ··· 715 715 struct device_attribute *attr, char *buf) 716 716 { 717 717 struct radeon_device *rdev = dev_get_drvdata(dev); 718 - struct drm_device *ddev = rdev->ddev; 718 + struct drm_device *ddev = rdev_to_drm(rdev); 719 719 u32 sclk = 0; 720 720 721 721 /* Can't get clock frequency when the card is off */ ··· 740 740 struct device_attribute *attr, char *buf) 741 741 { 742 742 struct radeon_device *rdev = dev_get_drvdata(dev); 743 - struct drm_device *ddev = rdev->ddev; 743 + struct drm_device *ddev = rdev_to_drm(rdev); 744 744 u16 vddc = 0; 745 745 746 746 /* Can't get vddc when the card is off */ ··· 1692 1692 1693 1693 static void radeon_pm_compute_clocks_old(struct radeon_device *rdev) 1694 1694 { 1695 - struct drm_device *ddev = rdev->ddev; 1695 + struct drm_device *ddev = rdev_to_drm(rdev); 1696 1696 struct drm_crtc *crtc; 1697 1697 struct radeon_crtc *radeon_crtc; 1698 1698 ··· 1765 1765 1766 1766 static void radeon_pm_compute_clocks_dpm(struct radeon_device *rdev) 1767 1767 { 1768 - struct drm_device *ddev = rdev->ddev; 1768 + struct drm_device *ddev = rdev_to_drm(rdev); 1769 1769 struct drm_crtc *crtc; 1770 1770 struct radeon_crtc *radeon_crtc; 1771 1771 struct radeon_connector *radeon_connector; ··· 1826 1826 */ 1827 1827 for (crtc = 0; (crtc < rdev->num_crtc) && in_vbl; crtc++) { 1828 1828 if (rdev->pm.active_crtcs & (1 << crtc)) { 1829 - vbl_status = radeon_get_crtc_scanoutpos(rdev->ddev, 1829 + vbl_status = radeon_get_crtc_scanoutpos(rdev_to_drm(rdev), 1830 1830 crtc, 1831 1831 USE_REAL_VBLANKSTART, 1832 1832 &vpos, &hpos, NULL, NULL, ··· 1918 1918 static int radeon_debugfs_pm_info_show(struct seq_file *m, void *unused) 1919 1919 { 1920 1920 struct radeon_device *rdev = m->private; 1921 - struct drm_device *ddev = rdev->ddev; 1921 + struct drm_device *ddev = rdev_to_drm(rdev); 1922 1922 1923 1923 if ((rdev->flags & RADEON_IS_PX) && 1924 1924 (ddev->switch_power_state != DRM_SWITCH_POWER_ON)) { ··· 1955 1955 static void radeon_debugfs_pm_init(struct radeon_device *rdev) 1956 1956 { 1957 1957 #if defined(CONFIG_DEBUG_FS) 1958 - struct dentry *root = rdev->ddev->primary->debugfs_root; 1958 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 1959 1959 1960 1960 debugfs_create_file("radeon_pm_info", 0444, root, rdev, 1961 1961 &radeon_debugfs_pm_info_fops);
+1 -1
drivers/gpu/drm/radeon/radeon_ring.c
··· 550 550 { 551 551 #if defined(CONFIG_DEBUG_FS) 552 552 const char *ring_name = radeon_debugfs_ring_idx_to_name(ring->idx); 553 - struct dentry *root = rdev->ddev->primary->debugfs_root; 553 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 554 554 555 555 if (ring_name) 556 556 debugfs_create_file(ring_name, 0444, root, ring,
+3 -3
drivers/gpu/drm/radeon/radeon_ttm.c
··· 682 682 683 683 /* No others user of address space so set it to 0 */ 684 684 r = ttm_device_init(&rdev->mman.bdev, &radeon_bo_driver, rdev->dev, 685 - rdev->ddev->anon_inode->i_mapping, 686 - rdev->ddev->vma_offset_manager, 685 + rdev_to_drm(rdev)->anon_inode->i_mapping, 686 + rdev_to_drm(rdev)->vma_offset_manager, 687 687 rdev->need_swiotlb, 688 688 dma_addressing_limited(&rdev->pdev->dev)); 689 689 if (r) { ··· 890 890 static void radeon_ttm_debugfs_init(struct radeon_device *rdev) 891 891 { 892 892 #if defined(CONFIG_DEBUG_FS) 893 - struct drm_minor *minor = rdev->ddev->primary; 893 + struct drm_minor *minor = rdev_to_drm(rdev)->primary; 894 894 struct dentry *root = minor->debugfs_root; 895 895 896 896 debugfs_create_file("radeon_vram", 0444, root, rdev,
+3 -3
drivers/gpu/drm/radeon/rs400.c
··· 379 379 static void rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev) 380 380 { 381 381 #if defined(CONFIG_DEBUG_FS) 382 - struct dentry *root = rdev->ddev->primary->debugfs_root; 382 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 383 383 384 384 debugfs_create_file("rs400_gart_info", 0444, root, rdev, 385 385 &rs400_debugfs_gart_info_fops); ··· 474 474 RREG32(R_0007C0_CP_STAT)); 475 475 } 476 476 /* post */ 477 - radeon_combios_asic_init(rdev->ddev); 477 + radeon_combios_asic_init(rdev_to_drm(rdev)); 478 478 /* Resume clock after posting */ 479 479 r300_clock_startup(rdev); 480 480 /* Initialize surface registers */ ··· 552 552 return -EINVAL; 553 553 554 554 /* Initialize clocks */ 555 - radeon_get_clock_info(rdev->ddev); 555 + radeon_get_clock_info(rdev_to_drm(rdev)); 556 556 /* initialize memory controller */ 557 557 rs400_mc_init(rdev); 558 558 /* Fence driver */
+7 -7
drivers/gpu/drm/radeon/rs600.c
··· 321 321 322 322 void rs600_pm_prepare(struct radeon_device *rdev) 323 323 { 324 - struct drm_device *ddev = rdev->ddev; 324 + struct drm_device *ddev = rdev_to_drm(rdev); 325 325 struct drm_crtc *crtc; 326 326 struct radeon_crtc *radeon_crtc; 327 327 u32 tmp; ··· 339 339 340 340 void rs600_pm_finish(struct radeon_device *rdev) 341 341 { 342 - struct drm_device *ddev = rdev->ddev; 342 + struct drm_device *ddev = rdev_to_drm(rdev); 343 343 struct drm_crtc *crtc; 344 344 struct radeon_crtc *radeon_crtc; 345 345 u32 tmp; ··· 408 408 409 409 void rs600_hpd_init(struct radeon_device *rdev) 410 410 { 411 - struct drm_device *dev = rdev->ddev; 411 + struct drm_device *dev = rdev_to_drm(rdev); 412 412 struct drm_connector *connector; 413 413 unsigned enable = 0; 414 414 ··· 435 435 436 436 void rs600_hpd_fini(struct radeon_device *rdev) 437 437 { 438 - struct drm_device *dev = rdev->ddev; 438 + struct drm_device *dev = rdev_to_drm(rdev); 439 439 struct drm_connector *connector; 440 440 unsigned disable = 0; 441 441 ··· 797 797 /* Vertical blank interrupts */ 798 798 if (G_007EDC_LB_D1_VBLANK_INTERRUPT(rdev->irq.stat_regs.r500.disp_int)) { 799 799 if (rdev->irq.crtc_vblank_int[0]) { 800 - drm_handle_vblank(rdev->ddev, 0); 800 + drm_handle_vblank(rdev_to_drm(rdev), 0); 801 801 rdev->pm.vblank_sync = true; 802 802 wake_up(&rdev->irq.vblank_queue); 803 803 } ··· 806 806 } 807 807 if (G_007EDC_LB_D2_VBLANK_INTERRUPT(rdev->irq.stat_regs.r500.disp_int)) { 808 808 if (rdev->irq.crtc_vblank_int[1]) { 809 - drm_handle_vblank(rdev->ddev, 1); 809 + drm_handle_vblank(rdev_to_drm(rdev), 1); 810 810 rdev->pm.vblank_sync = true; 811 811 wake_up(&rdev->irq.vblank_queue); 812 812 } ··· 1133 1133 return -EINVAL; 1134 1134 1135 1135 /* Initialize clocks */ 1136 - radeon_get_clock_info(rdev->ddev); 1136 + radeon_get_clock_info(rdev_to_drm(rdev)); 1137 1137 /* initialize memory controller */ 1138 1138 rs600_mc_init(rdev); 1139 1139 r100_debugfs_rbbm_init(rdev);
+1 -1
drivers/gpu/drm/radeon/rs690.c
··· 845 845 return -EINVAL; 846 846 847 847 /* Initialize clocks */ 848 - radeon_get_clock_info(rdev->ddev); 848 + radeon_get_clock_info(rdev_to_drm(rdev)); 849 849 /* initialize memory controller */ 850 850 rs690_mc_init(rdev); 851 851 rv515_debugfs(rdev);
+2 -2
drivers/gpu/drm/radeon/rv515.c
··· 255 255 void rv515_debugfs(struct radeon_device *rdev) 256 256 { 257 257 #if defined(CONFIG_DEBUG_FS) 258 - struct dentry *root = rdev->ddev->primary->debugfs_root; 258 + struct dentry *root = rdev_to_drm(rdev)->primary->debugfs_root; 259 259 260 260 debugfs_create_file("rv515_pipes_info", 0444, root, rdev, 261 261 &rv515_debugfs_pipes_info_fops); ··· 636 636 if (radeon_boot_test_post_card(rdev) == false) 637 637 return -EINVAL; 638 638 /* Initialize clocks */ 639 - radeon_get_clock_info(rdev->ddev); 639 + radeon_get_clock_info(rdev_to_drm(rdev)); 640 640 /* initialize AGP */ 641 641 if (rdev->flags & RADEON_IS_AGP) { 642 642 r = radeon_agp_init(rdev);
+1 -1
drivers/gpu/drm/radeon/rv770.c
··· 1935 1935 /* Initialize surface registers */ 1936 1936 radeon_surface_init(rdev); 1937 1937 /* Initialize clocks */ 1938 - radeon_get_clock_info(rdev->ddev); 1938 + radeon_get_clock_info(rdev_to_drm(rdev)); 1939 1939 /* Fence driver */ 1940 1940 radeon_fence_driver_init(rdev); 1941 1941 /* initialize AGP */
+2 -2
drivers/gpu/drm/radeon/si.c
··· 6277 6277 event_name = "vblank"; 6278 6278 6279 6279 if (rdev->irq.crtc_vblank_int[crtc_idx]) { 6280 - drm_handle_vblank(rdev->ddev, crtc_idx); 6280 + drm_handle_vblank(rdev_to_drm(rdev), crtc_idx); 6281 6281 rdev->pm.vblank_sync = true; 6282 6282 wake_up(&rdev->irq.vblank_queue); 6283 6283 } ··· 6839 6839 /* Initialize surface registers */ 6840 6840 radeon_surface_init(rdev); 6841 6841 /* Initialize clocks */ 6842 - radeon_get_clock_info(rdev->ddev); 6842 + radeon_get_clock_info(rdev_to_drm(rdev)); 6843 6843 6844 6844 /* Fence driver */ 6845 6845 radeon_fence_driver_init(rdev);