]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
drm/scheduler: remove unused parameter
[linux.git] / drivers / gpu / drm / amd / display / amdgpu_dm / amdgpu_dm_irq.c
index 422055080df4a1b59b5fa4c66a12d6b5bd90f5ac..4be21bf5474981a8b954f4b1fb6b5c6a283cc82b 100644 (file)
@@ -51,11 +51,6 @@ struct amdgpu_dm_irq_handler_data {
        enum dc_irq_source irq_source;
 };
 
-struct amdgpu_dm_timer_handler_data {
-       struct handler_common_data hcd;
-       struct delayed_work d_work;
-};
-
 #define DM_IRQ_TABLE_LOCK(adev, flags) \
        spin_lock_irqsave(&adev->dm.irq_handler_list_table_lock, flags)
 
@@ -169,62 +164,6 @@ static struct list_head *remove_irq_handler(struct amdgpu_device *adev,
        return hnd_list;
 }
 
-/* If 'handler_in == NULL' then remove ALL handlers. */
-static void remove_timer_handler(struct amdgpu_device *adev,
-                                struct amdgpu_dm_timer_handler_data *handler_in)
-{
-       struct amdgpu_dm_timer_handler_data *handler_temp;
-       struct list_head *handler_list;
-       struct list_head *entry, *tmp;
-       unsigned long irq_table_flags;
-       bool handler_removed = false;
-
-       DM_IRQ_TABLE_LOCK(adev, irq_table_flags);
-
-       handler_list = &adev->dm.timer_handler_list;
-
-       list_for_each_safe(entry, tmp, handler_list) {
-               /* Note that list_for_each_safe() guarantees that
-                * handler_temp is NOT null. */
-               handler_temp = list_entry(entry,
-                               struct amdgpu_dm_timer_handler_data, hcd.list);
-
-               if (handler_in == NULL || handler_in == handler_temp) {
-                       list_del(&handler_temp->hcd.list);
-                       DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
-
-                       DRM_DEBUG_KMS("DM_IRQ: removing timer handler: %p\n",
-                                       handler_temp);
-
-                       if (handler_in == NULL) {
-                               /* Since it is still in the queue, it must
-                                * be cancelled. */
-                               cancel_delayed_work_sync(&handler_temp->d_work);
-                       }
-
-                       kfree(handler_temp);
-                       handler_removed = true;
-
-                       DM_IRQ_TABLE_LOCK(adev, irq_table_flags);
-               }
-
-               /* Remove ALL handlers. */
-               if (handler_in == NULL)
-                       continue;
-
-               /* Remove a SPECIFIC handler.
-                * Found our handler - we can stop here. */
-               if (handler_in == handler_temp)
-                       break;
-       }
-
-       DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
-
-       if (handler_in != NULL && handler_removed == false)
-               DRM_ERROR("DM_IRQ: handler: %p is not in the list!\n",
-                               handler_in);
-}
-
 static bool
 validate_irq_registration_params(struct dc_interrupt_params *int_params,
                                 void (*ih)(void *))
@@ -382,16 +321,6 @@ int amdgpu_dm_irq_init(struct amdgpu_device *adev)
                INIT_LIST_HEAD(&adev->dm.irq_handler_list_high_tab[src]);
        }
 
-       INIT_LIST_HEAD(&adev->dm.timer_handler_list);
-
-       /* allocate and initialize the workqueue for DM timer */
-       adev->dm.timer_workqueue = create_singlethread_workqueue(
-                       "dm_timer_queue");
-       if (adev->dm.timer_workqueue == NULL) {
-               DRM_ERROR("DM_IRQ: unable to create timer queue!\n");
-               return -1;
-       }
-
        return 0;
 }
 
@@ -400,21 +329,17 @@ void amdgpu_dm_irq_fini(struct amdgpu_device *adev)
 {
        int src;
        struct irq_list_head *lh;
+       unsigned long irq_table_flags;
        DRM_DEBUG_KMS("DM_IRQ: releasing resources.\n");
-
        for (src = 0; src < DAL_IRQ_SOURCES_NUMBER; src++) {
-
+               DM_IRQ_TABLE_LOCK(adev, irq_table_flags);
                /* The handler was removed from the table,
                 * it means it is safe to flush all the 'work'
                 * (because no code can schedule a new one). */
                lh = &adev->dm.irq_handler_list_low_tab[src];
+               DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
                flush_work(&lh->work);
        }
-
-       /* Cancel ALL timers and release handlers (if any). */
-       remove_timer_handler(adev, NULL);
-       /* Release the queue itself. */
-       destroy_workqueue(adev->dm.timer_workqueue);
 }
 
 int amdgpu_dm_irq_suspend(struct amdgpu_device *adev)
This page took 0.027529 seconds and 4 git commands to generate.