Lines Matching refs:dev
410 void intel_detect_pch (struct drm_device *dev)
412 struct drm_i915_private *dev_priv = dev->dev_private;
420 if (INTEL_INFO(dev)->num_pipes == 0) {
447 WARN_ON(!IS_GEN5(dev));
451 WARN_ON(!(IS_GEN6(dev) || IS_IVYBRIDGE(dev)));
456 WARN_ON(!(IS_GEN6(dev) || IS_IVYBRIDGE(dev)));
460 WARN_ON(!IS_HASWELL(dev));
461 WARN_ON(IS_ULT(dev));
465 WARN_ON(!IS_HASWELL(dev));
466 WARN_ON(!IS_ULT(dev));
472 bool i915_semaphore_is_enabled(struct drm_device *dev)
474 if (INTEL_INFO(dev)->gen < 6)
482 if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped)
489 static int i915_drm_freeze(struct drm_device *dev)
491 struct drm_i915_private *dev_priv = dev->dev_private;
499 intel_set_power_well(dev, true);
501 drm_kms_helper_poll_disable(dev);
503 /* XXX FIXME: pci_save_state(dev->pdev); */
506 if (drm_core_check_feature(dev, DRIVER_MODESET) && dev_priv->gtt.total !=0) {
508 if (i915_gem_idle(dev, 0))
514 (void) drm_irq_uninstall(dev);
520 list_for_each_entry(crtc, struct drm_crtc, &dev->mode_config.crtc_list, head)
523 intel_modeset_suspend_hw(dev);
527 (void) i915_save_state(dev);
533 i915_suspend(struct drm_device *dev)
535 struct drm_i915_private *dev_priv = dev->dev_private;
543 if (!dev || !dev_priv) {
544 DRM_ERROR("dev: %p, dev_priv: %p\n", dev, dev_priv);
549 error = i915_drm_freeze(dev);
557 __i915_drm_thaw(struct drm_device *dev)
559 struct drm_i915_private *dev_priv = dev->dev_private;
563 (void) i915_restore_state(dev);
566 if (drm_core_check_feature(dev, DRIVER_MODESET) && dev_priv->gtt.total !=0) {
567 intel_init_pch_refclk(dev);
569 mutex_lock(&dev->struct_mutex);
572 error = i915_gem_init_hw(dev);
573 mutex_unlock(&dev->struct_mutex);
576 (void) drm_irq_install(dev);
578 intel_modeset_init_hw(dev);
579 drm_modeset_lock_all(dev);
580 intel_modeset_setup_hw_state(dev, true);
581 drm_modeset_unlock_all(dev);
589 intel_hpd_init(dev);
601 i915_drm_thaw(struct drm_device *dev)
603 struct drm_i915_private *dev_priv = dev->dev_private;
607 intel_gt_sanitize(dev);
608 if (drm_core_check_feature(dev, DRIVER_MODESET) &&
610 mutex_lock(&dev->struct_mutex);
611 i915_gem_restore_gtt_mappings(dev);
612 mutex_unlock(&dev->struct_mutex);
614 __i915_drm_thaw(dev);
620 i915_resume(struct drm_device *dev)
622 struct drm_i915_private *dev_priv = dev->dev_private;
625 intel_gt_sanitize(dev);
626 if (drm_core_check_feature(dev, DRIVER_MODESET) &&
628 mutex_lock(&dev->struct_mutex);
629 i915_gem_restore_gtt_mappings(dev);
630 mutex_unlock(&dev->struct_mutex);
633 ret = __i915_drm_thaw(dev);
637 drm_kms_helper_poll_enable(dev);
641 static int i8xx_do_reset(struct drm_device *dev)
643 struct drm_i915_private *dev_priv = dev->dev_private;
645 if (IS_I85X(dev))
651 if (IS_I830(dev) || IS_845G(dev)) {
671 static int i965_reset_complete(struct drm_device *dev)
674 (void) pci_read_config_byte(dev->pdev, I965_GDRST, &gdrst);
678 static int i965_do_reset(struct drm_device *dev)
688 pci_read_config_byte(dev->pdev, I965_GDRST, &gdrst);
689 pci_write_config_byte(dev->pdev, I965_GDRST,
692 ret = wait_for(i965_reset_complete(dev), 500);
697 pci_read_config_byte(dev->pdev, I965_GDRST, &gdrst);
698 pci_write_config_byte(dev->pdev, I965_GDRST,
702 return wait_for(i965_reset_complete(dev), 500);
705 static int ironlake_do_reset(struct drm_device *dev)
707 struct drm_i915_private *dev_priv = dev->dev_private;
727 static int gen6_do_reset(struct drm_device *dev)
729 struct drm_i915_private *dev_priv = dev->dev_private;
762 int intel_gpu_reset(struct drm_device *dev)
764 switch (INTEL_INFO(dev)->gen) {
766 case 6: return gen6_do_reset(dev);
767 case 5: return ironlake_do_reset(dev);
768 case 4: return i965_do_reset(dev);
769 case 2: return i8xx_do_reset(dev);
776 * @dev: drm device to reset
789 int i915_reset(struct drm_device *dev)
791 drm_i915_private_t *dev_priv = dev->dev_private;
799 mutex_lock(&dev->struct_mutex);
801 i915_gem_reset(dev);
809 mutex_unlock(&dev->struct_mutex);
812 ret = intel_gpu_reset(dev);
830 mutex_unlock(&dev->struct_mutex);
848 if (drm_core_check_feature(dev, DRIVER_MODESET) ||
855 i915_gem_init_swizzling(dev);
860 i915_gem_context_init(dev);
862 ret = dev_priv->mm.aliasing_ppgtt->enable(dev);
864 i915_gem_cleanup_aliasing_ppgtt(dev);
873 mutex_unlock(&dev->struct_mutex);
875 (void) drm_irq_uninstall(dev);
876 if (drm_irq_install(dev)) {
880 intel_hpd_init(dev);
882 mutex_unlock(&dev->struct_mutex);
935 struct drm_device *dev;
947 dev = ddi_get_soft_state(i915_statep, item);
948 if (!dev) {
953 dev->devinfo = dip;
958 ret = drm_init(dev, &driver);
965 dev = ddi_get_soft_state(i915_statep, item);
966 if (!dev) {
971 return (i915_resume(dev));
981 struct drm_device *dev;
985 dev = ddi_get_soft_state(i915_statep, item);
986 if (!dev) {
993 drm_exit(dev);
998 return (i915_suspend(dev));
1014 if (!minor->dev || !minor->dev->devinfo)
1019 *result = (void *)minor->dev->devinfo;
1023 *result = (void *)(uintptr_t)ddi_get_instance(minor->dev->devinfo);
1033 struct drm_device *dev;
1038 dev = ddi_get_soft_state(i915_statep, ddi_get_instance(dip));
1040 if (!dev)
1043 dev_priv = dev->dev_private;
1051 mutex_lock(&dev->struct_mutex);
1052 ret = i915_gpu_idle(dev);
1055 i915_gem_retire_requests(dev);
1056 mutex_unlock(&dev->struct_mutex);
1059 intel_fbdev_fini(dev);
1061 drm_kms_helper_poll_fini(dev);
1062 mutex_lock(&dev->struct_mutex);
1064 list_for_each_entry(crtc, struct drm_crtc, &dev->mode_config.crtc_list, head) {
1072 intel_disable_fbc(dev);
1074 intel_disable_gt_powersave(dev);
1076 ironlake_teardown_rc6(dev);
1078 mutex_unlock(&dev->struct_mutex);
1079 drm_mode_config_cleanup(dev);
1081 mutex_lock(&dev->struct_mutex);
1082 i915_gem_free_all_phys_object(dev);
1083 i915_gem_cleanup_ringbuffer(dev);
1084 i915_gem_context_fini(dev);
1085 mutex_unlock(&dev->struct_mutex);
1087 i915_gem_cleanup_aliasing_ppgtt(dev);
1088 i915_gem_cleanup_stolen(dev);
1090 intel_cleanup_overlay(dev);
1092 i915_gem_lastclose(dev);
1095 teardown_scratch_page(dev);
1107 if (dev->old_gtt) {
1108 intel_rw_gtt(dev, dev->old_gtt_size,
1109 0, (void *) dev->old_gtt, 1);
1110 kmem_free(dev->old_gtt, dev->old_gtt_size);
1181 ((HAS_FORCE_WAKE((dev_priv)->dev)) && \
1197 if (HAS_FPGA_DBG_UNCLAIMED(dev_priv->dev) &&
1208 if (HAS_FPGA_DBG_UNCLAIMED(dev_priv->dev) &&
1219 if (IS_GEN5(dev_priv->dev))
1240 if (IS_GEN5(dev_priv->dev))
1261 if (IS_GEN5(dev_priv->dev))
1282 if (IS_GEN5(dev_priv->dev))
1309 if (IS_GEN5(dev_priv->dev))
1331 if (IS_GEN5(dev_priv->dev))
1353 if (IS_GEN5(dev_priv->dev))
1375 if (IS_GEN5(dev_priv->dev))
1416 struct drm_i915_private *dev_priv = dev->dev_private;
1423 (1 << INTEL_INFO(dev)->gen & entry->gen_bitmask))
1451 void i915_gem_chipset_flush(struct drm_device *dev)
1453 if (INTEL_INFO(dev)->gen < 6)
1454 drm_agp_chipset_flush(dev);
1457 void i915_driver_agp_support_detect(struct drm_device *dev, unsigned long flags)