mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
drm/tidss: Rename 'wait_lock' to 'irq_lock'
The 'wait_lock' name seems to be a copy-paste from omapdrm, and makes no sense here. Rename it to 'irq_lock'. Also clarify the related comment to make it clear what it protects, and drop any comments related to 'wait_list' which doesn't exist in tidss. Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Reviewed-by: Aradhya Bhatia <aradhya.bhatia@linux.dev> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241021-tidss-irq-fix-v1-7-82ddaec94e4a@ideasonboard.com
This commit is contained in:
@@ -2769,10 +2769,10 @@ static void dispc_softreset_k2g(struct dispc_device *dispc)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&dispc->tidss->wait_lock, flags);
|
||||
spin_lock_irqsave(&dispc->tidss->irq_lock, flags);
|
||||
dispc_set_irqenable(dispc, 0);
|
||||
dispc_read_and_clear_irqstatus(dispc);
|
||||
spin_unlock_irqrestore(&dispc->tidss->wait_lock, flags);
|
||||
spin_unlock_irqrestore(&dispc->tidss->irq_lock, flags);
|
||||
|
||||
for (unsigned int vp_idx = 0; vp_idx < dispc->feat->num_vps; ++vp_idx)
|
||||
VP_REG_FLD_MOD(dispc, vp_idx, DISPC_VP_CONTROL, 0, 0, 0);
|
||||
|
||||
@@ -140,7 +140,7 @@ static int tidss_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, tidss);
|
||||
|
||||
spin_lock_init(&tidss->wait_lock);
|
||||
spin_lock_init(&tidss->irq_lock);
|
||||
|
||||
ret = dispc_init(tidss);
|
||||
if (ret) {
|
||||
|
||||
@@ -29,8 +29,9 @@ struct tidss_device {
|
||||
|
||||
unsigned int irq;
|
||||
|
||||
spinlock_t wait_lock; /* protects the irq masks */
|
||||
dispc_irq_t irq_mask; /* enabled irqs in addition to wait_list */
|
||||
/* protects the irq masks field and irqenable/irqstatus registers */
|
||||
spinlock_t irq_lock;
|
||||
dispc_irq_t irq_mask; /* enabled irqs */
|
||||
};
|
||||
|
||||
#define to_tidss(__dev) container_of(__dev, struct tidss_device, ddev)
|
||||
|
||||
@@ -15,10 +15,9 @@
|
||||
#include "tidss_irq.h"
|
||||
#include "tidss_plane.h"
|
||||
|
||||
/* call with wait_lock and dispc runtime held */
|
||||
static void tidss_irq_update(struct tidss_device *tidss)
|
||||
{
|
||||
assert_spin_locked(&tidss->wait_lock);
|
||||
assert_spin_locked(&tidss->irq_lock);
|
||||
|
||||
dispc_set_irqenable(tidss->dispc, tidss->irq_mask);
|
||||
}
|
||||
@@ -31,11 +30,11 @@ void tidss_irq_enable_vblank(struct drm_crtc *crtc)
|
||||
u32 hw_videoport = tcrtc->hw_videoport;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&tidss->wait_lock, flags);
|
||||
spin_lock_irqsave(&tidss->irq_lock, flags);
|
||||
tidss->irq_mask |= DSS_IRQ_VP_VSYNC_EVEN(hw_videoport) |
|
||||
DSS_IRQ_VP_VSYNC_ODD(hw_videoport);
|
||||
tidss_irq_update(tidss);
|
||||
spin_unlock_irqrestore(&tidss->wait_lock, flags);
|
||||
spin_unlock_irqrestore(&tidss->irq_lock, flags);
|
||||
}
|
||||
|
||||
void tidss_irq_disable_vblank(struct drm_crtc *crtc)
|
||||
@@ -46,11 +45,11 @@ void tidss_irq_disable_vblank(struct drm_crtc *crtc)
|
||||
u32 hw_videoport = tcrtc->hw_videoport;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&tidss->wait_lock, flags);
|
||||
spin_lock_irqsave(&tidss->irq_lock, flags);
|
||||
tidss->irq_mask &= ~(DSS_IRQ_VP_VSYNC_EVEN(hw_videoport) |
|
||||
DSS_IRQ_VP_VSYNC_ODD(hw_videoport));
|
||||
tidss_irq_update(tidss);
|
||||
spin_unlock_irqrestore(&tidss->wait_lock, flags);
|
||||
spin_unlock_irqrestore(&tidss->irq_lock, flags);
|
||||
}
|
||||
|
||||
static irqreturn_t tidss_irq_handler(int irq, void *arg)
|
||||
@@ -60,9 +59,9 @@ static irqreturn_t tidss_irq_handler(int irq, void *arg)
|
||||
unsigned int id;
|
||||
dispc_irq_t irqstatus;
|
||||
|
||||
spin_lock(&tidss->wait_lock);
|
||||
spin_lock(&tidss->irq_lock);
|
||||
irqstatus = dispc_read_and_clear_irqstatus(tidss->dispc);
|
||||
spin_unlock(&tidss->wait_lock);
|
||||
spin_unlock(&tidss->irq_lock);
|
||||
|
||||
for (id = 0; id < tidss->num_crtcs; id++) {
|
||||
struct drm_crtc *crtc = tidss->crtcs[id];
|
||||
@@ -95,9 +94,9 @@ void tidss_irq_resume(struct tidss_device *tidss)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&tidss->wait_lock, flags);
|
||||
spin_lock_irqsave(&tidss->irq_lock, flags);
|
||||
tidss_irq_update(tidss);
|
||||
spin_unlock_irqrestore(&tidss->wait_lock, flags);
|
||||
spin_unlock_irqrestore(&tidss->irq_lock, flags);
|
||||
}
|
||||
|
||||
int tidss_irq_install(struct drm_device *ddev, unsigned int irq)
|
||||
|
||||
Reference in New Issue
Block a user