Lines Matching refs:rdev
63 struct radeon_device *rdev = dev->dev_private; in radeon_driver_unload_kms() local
65 if (rdev == NULL) in radeon_driver_unload_kms()
68 if (rdev->rmmio == NULL) in radeon_driver_unload_kms()
76 radeon_acpi_fini(rdev); in radeon_driver_unload_kms()
78 radeon_modeset_fini(rdev); in radeon_driver_unload_kms()
79 radeon_device_fini(rdev); in radeon_driver_unload_kms()
81 if (rdev->agp) in radeon_driver_unload_kms()
82 arch_phys_wc_del(rdev->agp->agp_mtrr); in radeon_driver_unload_kms()
83 kfree(rdev->agp); in radeon_driver_unload_kms()
84 rdev->agp = NULL; in radeon_driver_unload_kms()
87 kfree(rdev); in radeon_driver_unload_kms()
107 struct radeon_device *rdev = dev->dev_private; in radeon_driver_load_kms() local
111 rdev->hose = pdev->sysdata; in radeon_driver_load_kms()
115 rdev->agp = radeon_agp_head_init(dev); in radeon_driver_load_kms()
116 if (rdev->agp) { in radeon_driver_load_kms()
117 rdev->agp->agp_mtrr = arch_phys_wc_add( in radeon_driver_load_kms()
118 rdev->agp->agp_info.aper_base, in radeon_driver_load_kms()
119 rdev->agp->agp_info.aper_size * in radeon_driver_load_kms()
144 r = radeon_device_init(rdev, dev, pdev, flags); in radeon_driver_load_kms()
154 r = radeon_modeset_init(rdev); in radeon_driver_load_kms()
162 acpi_status = radeon_acpi_init(rdev); in radeon_driver_load_kms()
200 struct radeon_device *rdev = dev->dev_private; in radeon_set_filp_rights() local
202 mutex_lock(&rdev->gem.mutex); in radeon_set_filp_rights()
213 mutex_unlock(&rdev->gem.mutex); in radeon_set_filp_rights()
233 struct radeon_device *rdev = dev->dev_private; in radeon_info_ioctl() local
235 struct radeon_mode_info *minfo = &rdev->mode_info; in radeon_info_ioctl()
251 *value = rdev->num_gb_pipes; in radeon_info_ioctl()
254 *value = rdev->num_z_pipes; in radeon_info_ioctl()
258 if ((rdev->family >= CHIP_CEDAR) && (rdev->family <= CHIP_HEMLOCK)) in radeon_info_ioctl()
261 *value = rdev->accel_working; in radeon_info_ioctl()
268 for (i = 0, found = 0; i < rdev->num_crtc; i++) { in radeon_info_ioctl()
283 if (rdev->family == CHIP_HAWAII) { in radeon_info_ioctl()
284 if (rdev->accel_working) { in radeon_info_ioctl()
285 if (rdev->new_fw) in radeon_info_ioctl()
293 *value = rdev->accel_working; in radeon_info_ioctl()
297 if (rdev->family >= CHIP_BONAIRE) in radeon_info_ioctl()
298 *value = rdev->config.cik.tile_config; in radeon_info_ioctl()
299 else if (rdev->family >= CHIP_TAHITI) in radeon_info_ioctl()
300 *value = rdev->config.si.tile_config; in radeon_info_ioctl()
301 else if (rdev->family >= CHIP_CAYMAN) in radeon_info_ioctl()
302 *value = rdev->config.cayman.tile_config; in radeon_info_ioctl()
303 else if (rdev->family >= CHIP_CEDAR) in radeon_info_ioctl()
304 *value = rdev->config.evergreen.tile_config; in radeon_info_ioctl()
305 else if (rdev->family >= CHIP_RV770) in radeon_info_ioctl()
306 *value = rdev->config.rv770.tile_config; in radeon_info_ioctl()
307 else if (rdev->family >= CHIP_R600) in radeon_info_ioctl()
308 *value = rdev->config.r600.tile_config; in radeon_info_ioctl()
329 radeon_set_filp_rights(dev, &rdev->hyperz_filp, filp, value); in radeon_info_ioctl()
341 radeon_set_filp_rights(dev, &rdev->cmask_filp, filp, value); in radeon_info_ioctl()
345 if (rdev->asic->get_xclk) in radeon_info_ioctl()
346 *value = radeon_get_xclk(rdev) * 10; in radeon_info_ioctl()
348 *value = rdev->clock.spll.reference_freq * 10; in radeon_info_ioctl()
351 if (rdev->family >= CHIP_BONAIRE) in radeon_info_ioctl()
352 *value = rdev->config.cik.max_backends_per_se * in radeon_info_ioctl()
353 rdev->config.cik.max_shader_engines; in radeon_info_ioctl()
354 else if (rdev->family >= CHIP_TAHITI) in radeon_info_ioctl()
355 *value = rdev->config.si.max_backends_per_se * in radeon_info_ioctl()
356 rdev->config.si.max_shader_engines; in radeon_info_ioctl()
357 else if (rdev->family >= CHIP_CAYMAN) in radeon_info_ioctl()
358 *value = rdev->config.cayman.max_backends_per_se * in radeon_info_ioctl()
359 rdev->config.cayman.max_shader_engines; in radeon_info_ioctl()
360 else if (rdev->family >= CHIP_CEDAR) in radeon_info_ioctl()
361 *value = rdev->config.evergreen.max_backends; in radeon_info_ioctl()
362 else if (rdev->family >= CHIP_RV770) in radeon_info_ioctl()
363 *value = rdev->config.rv770.max_backends; in radeon_info_ioctl()
364 else if (rdev->family >= CHIP_R600) in radeon_info_ioctl()
365 *value = rdev->config.r600.max_backends; in radeon_info_ioctl()
371 if (rdev->family >= CHIP_BONAIRE) in radeon_info_ioctl()
372 *value = rdev->config.cik.max_tile_pipes; in radeon_info_ioctl()
373 else if (rdev->family >= CHIP_TAHITI) in radeon_info_ioctl()
374 *value = rdev->config.si.max_tile_pipes; in radeon_info_ioctl()
375 else if (rdev->family >= CHIP_CAYMAN) in radeon_info_ioctl()
376 *value = rdev->config.cayman.max_tile_pipes; in radeon_info_ioctl()
377 else if (rdev->family >= CHIP_CEDAR) in radeon_info_ioctl()
378 *value = rdev->config.evergreen.max_tile_pipes; in radeon_info_ioctl()
379 else if (rdev->family >= CHIP_RV770) in radeon_info_ioctl()
380 *value = rdev->config.rv770.max_tile_pipes; in radeon_info_ioctl()
381 else if (rdev->family >= CHIP_R600) in radeon_info_ioctl()
382 *value = rdev->config.r600.max_tile_pipes; in radeon_info_ioctl()
391 if (rdev->family >= CHIP_BONAIRE) in radeon_info_ioctl()
392 *value = rdev->config.cik.backend_map; in radeon_info_ioctl()
393 else if (rdev->family >= CHIP_TAHITI) in radeon_info_ioctl()
394 *value = rdev->config.si.backend_map; in radeon_info_ioctl()
395 else if (rdev->family >= CHIP_CAYMAN) in radeon_info_ioctl()
396 *value = rdev->config.cayman.backend_map; in radeon_info_ioctl()
397 else if (rdev->family >= CHIP_CEDAR) in radeon_info_ioctl()
398 *value = rdev->config.evergreen.backend_map; in radeon_info_ioctl()
399 else if (rdev->family >= CHIP_RV770) in radeon_info_ioctl()
400 *value = rdev->config.rv770.backend_map; in radeon_info_ioctl()
401 else if (rdev->family >= CHIP_R600) in radeon_info_ioctl()
402 *value = rdev->config.r600.backend_map; in radeon_info_ioctl()
409 if (rdev->family < CHIP_CAYMAN) in radeon_info_ioctl()
415 if (rdev->family < CHIP_CAYMAN) in radeon_info_ioctl()
420 if (rdev->family >= CHIP_BONAIRE) in radeon_info_ioctl()
421 *value = rdev->config.cik.max_cu_per_sh; in radeon_info_ioctl()
422 else if (rdev->family >= CHIP_TAHITI) in radeon_info_ioctl()
423 *value = rdev->config.si.max_cu_per_sh; in radeon_info_ioctl()
424 else if (rdev->family >= CHIP_CAYMAN) in radeon_info_ioctl()
425 *value = rdev->config.cayman.max_pipes_per_simd; in radeon_info_ioctl()
426 else if (rdev->family >= CHIP_CEDAR) in radeon_info_ioctl()
427 *value = rdev->config.evergreen.max_pipes; in radeon_info_ioctl()
428 else if (rdev->family >= CHIP_RV770) in radeon_info_ioctl()
429 *value = rdev->config.rv770.max_pipes; in radeon_info_ioctl()
430 else if (rdev->family >= CHIP_R600) in radeon_info_ioctl()
431 *value = rdev->config.r600.max_pipes; in radeon_info_ioctl()
437 if (rdev->family < CHIP_R600) { in radeon_info_ioctl()
443 value64 = radeon_get_gpu_clock_counter(rdev); in radeon_info_ioctl()
446 if (rdev->family >= CHIP_BONAIRE) in radeon_info_ioctl()
447 *value = rdev->config.cik.max_shader_engines; in radeon_info_ioctl()
448 else if (rdev->family >= CHIP_TAHITI) in radeon_info_ioctl()
449 *value = rdev->config.si.max_shader_engines; in radeon_info_ioctl()
450 else if (rdev->family >= CHIP_CAYMAN) in radeon_info_ioctl()
451 *value = rdev->config.cayman.max_shader_engines; in radeon_info_ioctl()
452 else if (rdev->family >= CHIP_CEDAR) in radeon_info_ioctl()
453 *value = rdev->config.evergreen.num_ses; in radeon_info_ioctl()
458 if (rdev->family >= CHIP_BONAIRE) in radeon_info_ioctl()
459 *value = rdev->config.cik.max_sh_per_se; in radeon_info_ioctl()
460 else if (rdev->family >= CHIP_TAHITI) in radeon_info_ioctl()
461 *value = rdev->config.si.max_sh_per_se; in radeon_info_ioctl()
466 *value = rdev->fastfb_working; in radeon_info_ioctl()
476 *value = rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready; in radeon_info_ioctl()
479 *value = rdev->ring[R600_RING_TYPE_DMA_INDEX].ready; in radeon_info_ioctl()
480 *value |= rdev->ring[CAYMAN_RING_TYPE_DMA1_INDEX].ready; in radeon_info_ioctl()
483 *value = rdev->ring[R600_RING_TYPE_UVD_INDEX].ready; in radeon_info_ioctl()
486 *value = rdev->ring[TN_RING_TYPE_VCE1_INDEX].ready; in radeon_info_ioctl()
493 if (rdev->family >= CHIP_BONAIRE) { in radeon_info_ioctl()
494 value = rdev->config.cik.tile_mode_array; in radeon_info_ioctl()
496 } else if (rdev->family >= CHIP_TAHITI) { in radeon_info_ioctl()
497 value = rdev->config.si.tile_mode_array; in radeon_info_ioctl()
505 if (rdev->family >= CHIP_BONAIRE) { in radeon_info_ioctl()
506 value = rdev->config.cik.macrotile_mode_array; in radeon_info_ioctl()
517 if (rdev->family >= CHIP_BONAIRE) { in radeon_info_ioctl()
518 *value = rdev->config.cik.backend_enable_mask; in radeon_info_ioctl()
519 } else if (rdev->family >= CHIP_TAHITI) { in radeon_info_ioctl()
520 *value = rdev->config.si.backend_enable_mask; in radeon_info_ioctl()
527 if ((rdev->pm.pm_method == PM_METHOD_DPM) && in radeon_info_ioctl()
528 rdev->pm.dpm_enabled) in radeon_info_ioctl()
529 *value = rdev->pm.dpm.dyn_state.max_clock_voltage_on_ac.sclk * 10; in radeon_info_ioctl()
531 *value = rdev->pm.default_sclk * 10; in radeon_info_ioctl()
534 *value = rdev->vce.fw_version; in radeon_info_ioctl()
537 *value = rdev->vce.fb_version; in radeon_info_ioctl()
542 value64 = atomic64_read(&rdev->num_bytes_moved); in radeon_info_ioctl()
547 man = ttm_manager_type(&rdev->mman.bdev, TTM_PL_VRAM); in radeon_info_ioctl()
553 man = ttm_manager_type(&rdev->mman.bdev, TTM_PL_TT); in radeon_info_ioctl()
557 if (rdev->family >= CHIP_BONAIRE) in radeon_info_ioctl()
558 *value = rdev->config.cik.active_cus; in radeon_info_ioctl()
559 else if (rdev->family >= CHIP_TAHITI) in radeon_info_ioctl()
560 *value = rdev->config.si.active_cus; in radeon_info_ioctl()
561 else if (rdev->family >= CHIP_CAYMAN) in radeon_info_ioctl()
562 *value = rdev->config.cayman.active_simds; in radeon_info_ioctl()
563 else if (rdev->family >= CHIP_CEDAR) in radeon_info_ioctl()
564 *value = rdev->config.evergreen.active_simds; in radeon_info_ioctl()
565 else if (rdev->family >= CHIP_RV770) in radeon_info_ioctl()
566 *value = rdev->config.rv770.active_simds; in radeon_info_ioctl()
567 else if (rdev->family >= CHIP_R600) in radeon_info_ioctl()
568 *value = rdev->config.r600.active_simds; in radeon_info_ioctl()
574 if (rdev->asic->pm.get_temperature) in radeon_info_ioctl()
575 *value = radeon_get_temperature(rdev); in radeon_info_ioctl()
581 if (rdev->pm.dpm_enabled) in radeon_info_ioctl()
582 *value = radeon_dpm_get_current_sclk(rdev) / 100; in radeon_info_ioctl()
584 *value = rdev->pm.current_sclk / 100; in radeon_info_ioctl()
588 if (rdev->pm.dpm_enabled) in radeon_info_ioctl()
589 *value = radeon_dpm_get_current_mclk(rdev) / 100; in radeon_info_ioctl()
591 *value = rdev->pm.current_mclk / 100; in radeon_info_ioctl()
598 if (radeon_get_allowed_info_register(rdev, *value, value)) in radeon_info_ioctl()
605 *value = atomic_read(&rdev->gpu_reset_counter); in radeon_info_ioctl()
629 struct radeon_device *rdev = dev->dev_private; in radeon_driver_open_kms() local
643 if (rdev->family >= CHIP_CAYMAN) { in radeon_driver_open_kms()
651 if (rdev->accel_working) { in radeon_driver_open_kms()
653 r = radeon_vm_init(rdev, vm); in radeon_driver_open_kms()
657 r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); in radeon_driver_open_kms()
663 vm->ib_bo_va = radeon_vm_bo_add(rdev, vm, in radeon_driver_open_kms()
664 rdev->ring_tmp_bo.bo); in radeon_driver_open_kms()
670 r = radeon_vm_bo_set_addr(rdev, vm->ib_bo_va, in radeon_driver_open_kms()
685 radeon_vm_fini(rdev, vm); in radeon_driver_open_kms()
707 struct radeon_device *rdev = dev->dev_private; in radeon_driver_postclose_kms() local
711 mutex_lock(&rdev->gem.mutex); in radeon_driver_postclose_kms()
712 if (rdev->hyperz_filp == file_priv) in radeon_driver_postclose_kms()
713 rdev->hyperz_filp = NULL; in radeon_driver_postclose_kms()
714 if (rdev->cmask_filp == file_priv) in radeon_driver_postclose_kms()
715 rdev->cmask_filp = NULL; in radeon_driver_postclose_kms()
716 mutex_unlock(&rdev->gem.mutex); in radeon_driver_postclose_kms()
718 radeon_uvd_free_handles(rdev, file_priv); in radeon_driver_postclose_kms()
719 radeon_vce_free_handles(rdev, file_priv); in radeon_driver_postclose_kms()
722 if (rdev->family >= CHIP_CAYMAN && file_priv->driver_priv) { in radeon_driver_postclose_kms()
727 if (rdev->accel_working) { in radeon_driver_postclose_kms()
728 r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false); in radeon_driver_postclose_kms()
731 radeon_vm_bo_rmv(rdev, vm->ib_bo_va); in radeon_driver_postclose_kms()
732 radeon_bo_unreserve(rdev->ring_tmp_bo.bo); in radeon_driver_postclose_kms()
734 radeon_vm_fini(rdev, vm); in radeon_driver_postclose_kms()
761 struct radeon_device *rdev = dev->dev_private; in radeon_get_vblank_counter_kms() local
763 if (pipe >= rdev->num_crtc) { in radeon_get_vblank_counter_kms()
776 if (rdev->mode_info.crtcs[pipe]) { in radeon_get_vblank_counter_kms()
781 count = radeon_get_vblank_counter(rdev, pipe); in radeon_get_vblank_counter_kms()
789 &rdev->mode_info.crtcs[pipe]->base.hwmode); in radeon_get_vblank_counter_kms()
790 } while (count != radeon_get_vblank_counter(rdev, pipe)); in radeon_get_vblank_counter_kms()
810 count = radeon_get_vblank_counter(rdev, pipe); in radeon_get_vblank_counter_kms()
829 struct radeon_device *rdev = dev->dev_private; in radeon_enable_vblank_kms() local
833 if (pipe >= rdev->num_crtc) { in radeon_enable_vblank_kms()
838 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_enable_vblank_kms()
839 rdev->irq.crtc_vblank_int[pipe] = true; in radeon_enable_vblank_kms()
840 r = radeon_irq_set(rdev); in radeon_enable_vblank_kms()
841 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_enable_vblank_kms()
856 struct radeon_device *rdev = dev->dev_private; in radeon_disable_vblank_kms() local
859 if (pipe >= rdev->num_crtc) { in radeon_disable_vblank_kms()
864 spin_lock_irqsave(&rdev->irq.lock, irqflags); in radeon_disable_vblank_kms()
865 rdev->irq.crtc_vblank_int[pipe] = false; in radeon_disable_vblank_kms()
866 radeon_irq_set(rdev); in radeon_disable_vblank_kms()
867 spin_unlock_irqrestore(&rdev->irq.lock, irqflags); in radeon_disable_vblank_kms()