]> Git Repo - linux.git/commitdiff
Merge drm/drm-next into drm-xe-next
authorLucas De Marchi <[email protected]>
Fri, 16 Aug 2024 17:05:54 +0000 (10:05 -0700)
committerLucas De Marchi <[email protected]>
Fri, 16 Aug 2024 17:33:54 +0000 (10:33 -0700)
Get drm-xe-next on v6.11-rc2 and synchronized with drm-intel-next for
the display side. This resolves the current conflict for the
enable_display module parameter and allows further pending refactors.

Signed-off-by: Lucas De Marchi <[email protected]>
1  2 
drivers/gpu/drm/xe/display/xe_display.c
drivers/gpu/drm/xe/xe_vm.c

index 56a940b39412ca6e56d252a7da473e627bb33f0f,0e4adde84cb297e8ab4423531831944dc29cc4c4..982b9c5b440f22829641044489f7f7748e507857
@@@ -23,6 -23,7 +23,7 @@@
  #include "intel_display_types.h"
  #include "intel_dmc.h"
  #include "intel_dp.h"
+ #include "intel_encoder.h"
  #include "intel_fbdev.h"
  #include "intel_hdcp.h"
  #include "intel_hotplug.h"
@@@ -45,7 -46,7 +46,7 @@@ static bool has_display(struct xe_devic
   */
  bool xe_display_driver_probe_defer(struct pci_dev *pdev)
  {
 -      if (!xe_modparam.enable_display)
 +      if (!xe_modparam.probe_display)
                return 0;
  
        return intel_display_driver_probe_defer(pdev);
@@@ -61,7 -62,7 +62,7 @@@
   */
  void xe_display_driver_set_hooks(struct drm_driver *driver)
  {
 -      if (!xe_modparam.enable_display)
 +      if (!xe_modparam.probe_display)
                return;
  
        driver->driver_features |= DRIVER_MODESET | DRIVER_ATOMIC;
@@@ -103,7 -104,7 +104,7 @@@ static void xe_display_fini_nommio(stru
  {
        struct xe_device *xe = to_xe_device(dev);
  
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        intel_power_domains_cleanup(xe);
  
  int xe_display_init_nommio(struct xe_device *xe)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return 0;
  
        /* Fake uncore lock */
  static void xe_display_fini_noirq(void *arg)
  {
        struct xe_device *xe = arg;
+       struct intel_display *display = &xe->display;
  
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        intel_display_driver_remove_noirq(xe);
+       intel_opregion_cleanup(display);
  }
  
  int xe_display_init_noirq(struct xe_device *xe)
  {
+       struct intel_display *display = &xe->display;
        int err;
  
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return 0;
  
        intel_display_driver_early_probe(xe);
  
        /* Early display init.. */
-       intel_opregion_setup(xe);
+       intel_opregion_setup(display);
  
        /*
         * Fill the dram structure to get the system dram info. This will be
        intel_display_device_info_runtime_init(xe);
  
        err = intel_display_driver_probe_noirq(xe);
-       if (err)
+       if (err) {
+               intel_opregion_cleanup(display);
                return err;
+       }
  
        return devm_add_action_or_reset(xe->drm.dev, xe_display_fini_noirq, xe);
  }
@@@ -166,7 -172,7 +172,7 @@@ static void xe_display_fini_noaccel(voi
  {
        struct xe_device *xe = arg;
  
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        intel_display_driver_remove_nogem(xe);
@@@ -176,7 -182,7 +182,7 @@@ int xe_display_init_noaccel(struct xe_d
  {
        int err;
  
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return 0;
  
        err = intel_display_driver_probe_nogem(xe);
  
  int xe_display_init(struct xe_device *xe)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return 0;
  
        return intel_display_driver_probe(xe);
  
  void xe_display_fini(struct xe_device *xe)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        intel_hpd_poll_fini(xe);
  
  void xe_display_register(struct xe_device *xe)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        intel_display_driver_register(xe);
  
  void xe_display_unregister(struct xe_device *xe)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        intel_unregister_dsm_handler();
  
  void xe_display_driver_remove(struct xe_device *xe)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        intel_display_driver_remove(xe);
  
  void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        if (master_ctl & DISPLAY_IRQ)
  
  void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir)
  {
 -      if (!xe->info.enable_display)
+       struct intel_display *display = &xe->display;
 +      if (!xe->info.probe_display)
                return;
  
        if (gu_misc_iir & GU_MISC_GSE)
-               intel_opregion_asle_intr(xe);
+               intel_opregion_asle_intr(display);
  }
  
  void xe_display_irq_reset(struct xe_device *xe)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        gen11_display_irq_reset(xe);
  
  void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        if (gt->info.id == XE_GT0)
                gen11_de_irq_postinstall(xe);
  }
  
- static void intel_suspend_encoders(struct xe_device *xe)
- {
-       struct drm_device *dev = &xe->drm;
-       struct intel_encoder *encoder;
-       if (has_display(xe))
-               return;
-       drm_modeset_lock_all(dev);
-       for_each_intel_encoder(dev, encoder)
-               if (encoder->suspend)
-                       encoder->suspend(encoder);
-       drm_modeset_unlock_all(dev);
- }
  static bool suspend_to_idle(void)
  {
  #if IS_ENABLED(CONFIG_ACPI_SLEEP)
  
  void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
  {
+       struct intel_display *display = &xe->display;
        bool s2idle = suspend_to_idle();
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        /*
  
        intel_hpd_cancel_work(xe);
  
-       intel_suspend_encoders(xe);
+       intel_encoder_suspend_all(&xe->display);
  
-       intel_opregion_suspend(xe, s2idle ? PCI_D1 : PCI_D3cold);
+       intel_opregion_suspend(display, s2idle ? PCI_D1 : PCI_D3cold);
  
        intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
  
  void xe_display_pm_suspend_late(struct xe_device *xe)
  {
        bool s2idle = suspend_to_idle();
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        intel_power_domains_suspend(xe, s2idle);
  
  void xe_display_pm_resume_early(struct xe_device *xe)
  {
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                return;
  
        intel_display_power_resume_early(xe);
  
  void xe_display_pm_resume(struct xe_device *xe, bool runtime)
  {
 -      if (!xe->info.enable_display)
+       struct intel_display *display = &xe->display;
 +      if (!xe->info.probe_display)
                return;
  
        intel_dmc_resume(xe);
        if (has_display(xe))
                drm_kms_helper_poll_enable(&xe->drm);
  
-       intel_opregion_resume(xe);
+       intel_opregion_resume(display);
  
        intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
  
@@@ -385,7 -381,7 +381,7 @@@ int xe_display_probe(struct xe_device *
  {
        int err;
  
 -      if (!xe->info.enable_display)
 +      if (!xe->info.probe_display)
                goto no_display;
  
        intel_display_device_probe(xe);
                return 0;
  
  no_display:
 -      xe->info.enable_display = false;
 +      xe->info.probe_display = false;
        unset_display_features(xe);
        return 0;
  }
index d6386be79e91772d699ed3e398c151e583e43eab,b715883f40d838d3dc58c0b2b97d42ada923db40..f54594db643e07e27ec41ae501e37f278aa27d65
@@@ -275,8 -275,6 +275,8 @@@ out_up_write
   * xe_vm_remove_compute_exec_queue() - Remove compute exec queue from VM
   * @vm: The VM.
   * @q: The exec_queue
 + *
 + * Note that this function might be called multiple times on the same queue.
   */
  void xe_vm_remove_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q)
  {
                return;
  
        down_write(&vm->lock);
 -      list_del(&q->lr.link);
 -      --vm->preempt.num_exec_queues;
 +      if (!list_empty(&q->lr.link)) {
 +              list_del_init(&q->lr.link);
 +              --vm->preempt.num_exec_queues;
 +      }
        if (q->lr.pfence) {
                dma_fence_enable_sw_signaling(q->lr.pfence);
                dma_fence_put(q->lr.pfence);
@@@ -1195,7 -1191,7 +1195,7 @@@ static const struct drm_gpuvm_ops gpuvm
        .vm_free = xe_vm_free,
  };
  
 -static u64 pde_encode_pat_index(struct xe_device *xe, u16 pat_index)
 +static u64 pde_encode_pat_index(u16 pat_index)
  {
        u64 pte = 0;
  
        return pte;
  }
  
 -static u64 pte_encode_pat_index(struct xe_device *xe, u16 pat_index,
 -                              u32 pt_level)
 +static u64 pte_encode_pat_index(u16 pat_index, u32 pt_level)
  {
        u64 pte = 0;
  
@@@ -1249,11 -1246,12 +1249,11 @@@ static u64 pte_encode_ps(u32 pt_level
  static u64 xelp_pde_encode_bo(struct xe_bo *bo, u64 bo_offset,
                              const u16 pat_index)
  {
 -      struct xe_device *xe = xe_bo_device(bo);
        u64 pde;
  
        pde = xe_bo_addr(bo, bo_offset, XE_PAGE_SIZE);
        pde |= XE_PAGE_PRESENT | XE_PAGE_RW;
 -      pde |= pde_encode_pat_index(xe, pat_index);
 +      pde |= pde_encode_pat_index(pat_index);
  
        return pde;
  }
  static u64 xelp_pte_encode_bo(struct xe_bo *bo, u64 bo_offset,
                              u16 pat_index, u32 pt_level)
  {
 -      struct xe_device *xe = xe_bo_device(bo);
        u64 pte;
  
        pte = xe_bo_addr(bo, bo_offset, XE_PAGE_SIZE);
        pte |= XE_PAGE_PRESENT | XE_PAGE_RW;
 -      pte |= pte_encode_pat_index(xe, pat_index, pt_level);
 +      pte |= pte_encode_pat_index(pat_index, pt_level);
        pte |= pte_encode_ps(pt_level);
  
        if (xe_bo_is_vram(bo) || xe_bo_is_stolen_devmem(bo))
  static u64 xelp_pte_encode_vma(u64 pte, struct xe_vma *vma,
                               u16 pat_index, u32 pt_level)
  {
 -      struct xe_device *xe = xe_vma_vm(vma)->xe;
 -
        pte |= XE_PAGE_PRESENT;
  
        if (likely(!xe_vma_read_only(vma)))
                pte |= XE_PAGE_RW;
  
 -      pte |= pte_encode_pat_index(xe, pat_index, pt_level);
 +      pte |= pte_encode_pat_index(pat_index, pt_level);
        pte |= pte_encode_ps(pt_level);
  
        if (unlikely(xe_vma_is_null(vma)))
@@@ -1302,7 -1303,7 +1302,7 @@@ static u64 xelp_pte_encode_addr(struct 
  
        pte = addr;
        pte |= XE_PAGE_PRESENT | XE_PAGE_RW;
 -      pte |= pte_encode_pat_index(xe, pat_index, pt_level);
 +      pte |= pte_encode_pat_index(pat_index, pt_level);
        pte |= pte_encode_ps(pt_level);
  
        if (devmem)
@@@ -1401,6 -1402,8 +1401,8 @@@ struct xe_vm *xe_vm_create(struct xe_de
        init_rwsem(&vm->userptr.notifier_lock);
        spin_lock_init(&vm->userptr.invalidated_lock);
  
+       ttm_lru_bulk_move_init(&vm->lru_bulk_move);
        INIT_WORK(&vm->destroy_work, vm_destroy_work_func);
  
        INIT_LIST_HEAD(&vm->preempt.exec_queues);
@@@ -1526,6 -1529,7 +1528,7 @@@ err_no_resv
        mutex_destroy(&vm->snap_mutex);
        for_each_tile(tile, xe, id)
                xe_range_fence_tree_fini(&vm->rftree[id]);
+       ttm_lru_bulk_move_fini(&xe->ttm, &vm->lru_bulk_move);
        kfree(vm);
        if (flags & XE_VM_FLAG_LR_MODE)
                xe_pm_runtime_put(xe);
@@@ -1669,6 -1673,7 +1672,7 @@@ static void vm_destroy_work_func(struc
                XE_WARN_ON(vm->pt_root[id]);
  
        trace_xe_vm_free(vm);
+       ttm_lru_bulk_move_fini(&xe->ttm, &vm->lru_bulk_move);
  
        if (vm->xef)
                xe_file_put(vm->xef);
This page took 0.087097 seconds and 4 git commands to generate.