* [PATCH 1/2] drm/amd/display: Remove unsued mutex and spinlock.
@ 2018-01-19 21:35 Andrey Grodzovsky
[not found] ` <1516397706-31747-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Andrey Grodzovsky @ 2018-01-19 21:35 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, sw.dl.display.sudo-5C7GfCeVMHo
Cc: =harry.wentland-5C7GfCeVMHo, Andrey Grodzovsky
They seem to be obsolete.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ------
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 9 ---------
2 files changed, 15 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index ebcad30..1e21904 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -410,12 +410,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
/* Zero all the fields */
memset(&init_data, 0, sizeof(init_data));
- /* initialize DAL's lock (for SYNC context use) */
- spin_lock_init(&adev->dm.dal_lock);
-
- /* initialize DAL's mutex */
- mutex_init(&adev->dm.dal_mutex);
-
if(amdgpu_dm_irq_init(adev)) {
DRM_ERROR("amdgpu: failed to initialize DM IRQ support.\n");
goto error;
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index 996ab81..55ac296 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -85,8 +85,6 @@ struct amdgpu_display_manager {
struct dal *dal;
struct dc *dc;
struct cgs_device *cgs_device;
- /* lock to be used when DAL is called from SYNC IRQ context */
- spinlock_t dal_lock;
struct amdgpu_device *adev; /*AMD base driver*/
struct drm_device *ddev; /*DRM base driver*/
@@ -123,13 +121,6 @@ struct amdgpu_display_manager {
struct list_head timer_handler_list;
struct workqueue_struct *timer_workqueue;
- /* Use dal_mutex for any activity which is NOT syncronized by
- * DRM mode setting locks.
- * For example: amdgpu_dm_hpd_low_irq() calls into DAL *without*
- * DRM mode setting locks being acquired. This is where dal_mutex
- * is acquired before calling into DAL. */
- struct mutex dal_mutex;
-
struct backlight_device *backlight_dev;
const struct dc_link *backlight_link;
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] drm/amd/display: Remove timer handler.
[not found] ` <1516397706-31747-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
@ 2018-01-19 21:35 ` Andrey Grodzovsky
[not found] ` <1516397706-31747-2-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Andrey Grodzovsky @ 2018-01-19 21:35 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, sw.dl.display.sudo-5C7GfCeVMHo
Cc: =harry.wentland-5C7GfCeVMHo, Andrey Grodzovsky
Dead code, looks obsolete.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 4 --
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 76 ----------------------
2 files changed, 80 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index 55ac296..9902132 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -117,10 +117,6 @@ struct amdgpu_display_manager {
/* this spin lock synchronizes access to 'irq_handler_list_table' */
spinlock_t irq_handler_list_table_lock;
- /* Timer-related data. */
- struct list_head timer_handler_list;
- struct workqueue_struct *timer_workqueue;
-
struct backlight_device *backlight_dev;
const struct dc_link *backlight_link;
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
index 1874b6c..0ee425b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
@@ -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;
}
@@ -410,11 +339,6 @@ void amdgpu_dm_irq_fini(struct amdgpu_device *adev)
lh = &adev->dm.irq_handler_list_low_tab[src];
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)
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] drm/amd/display: Remove timer handler.
[not found] ` <1516397706-31747-2-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
@ 2018-01-23 15:29 ` Harry Wentland
0 siblings, 0 replies; 3+ messages in thread
From: Harry Wentland @ 2018-01-23 15:29 UTC (permalink / raw)
To: Andrey Grodzovsky, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
sw.dl.display.sudo-5C7GfCeVMHo
Cc: =harry.wentland-5C7GfCeVMHo
On 2018-01-19 04:35 PM, Andrey Grodzovsky wrote:
> Dead code, looks obsolete.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Good cleanup. Thanks.
Series is
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 4 --
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 76 ----------------------
> 2 files changed, 80 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> index 55ac296..9902132 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> @@ -117,10 +117,6 @@ struct amdgpu_display_manager {
> /* this spin lock synchronizes access to 'irq_handler_list_table' */
> spinlock_t irq_handler_list_table_lock;
>
> - /* Timer-related data. */
> - struct list_head timer_handler_list;
> - struct workqueue_struct *timer_workqueue;
> -
> struct backlight_device *backlight_dev;
>
> const struct dc_link *backlight_link;
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
> index 1874b6c..0ee425b 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
> @@ -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;
> }
>
> @@ -410,11 +339,6 @@ void amdgpu_dm_irq_fini(struct amdgpu_device *adev)
> lh = &adev->dm.irq_handler_list_low_tab[src];
> 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)
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-23 15:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 21:35 [PATCH 1/2] drm/amd/display: Remove unsued mutex and spinlock Andrey Grodzovsky
[not found] ` <1516397706-31747-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2018-01-19 21:35 ` [PATCH 2/2] drm/amd/display: Remove timer handler Andrey Grodzovsky
[not found] ` <1516397706-31747-2-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2018-01-23 15:29 ` Harry Wentland
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.