aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-11-13 14:29:34 -0500
committerDave Airlie <airlied@redhat.com>2017-11-13 14:29:34 -0500
commitecc325bb76707370cfa6f34ef8574c7ee7577a23 (patch)
tree6786599c463db2473b58513825109bd11f7199dc /drivers
parent9c117313afbaba6f7613fa2b305b7da5d6058fb1 (diff)
parent44419ce7d77e03692ed8fe799688d8dc43f9266e (diff)
Merge tag 'drm-misc-fixes-2017-11-13' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
Driver Changes: - qxl: Use a shadow bo as primary and blit to it to fix flicker (Gerd) - rockchip: Convert psr spinlock to mutex (Emil) Cc: Emil Renner Berthing <kernel@esmil.dk> Cc: Gerd Hoffmann <kraxel@redhat.com> * tag 'drm-misc-fixes-2017-11-13' of git://anongit.freedesktop.org/drm/drm-misc: drm/rockchip: analogix_dp: Use mutex rather than spinlock
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/rockchip/analogix_dp-rockchip.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 4d3f6ad0abdd..93b7102dd008 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -72,7 +72,7 @@ struct rockchip_dp_device {
72 struct reset_control *rst; 72 struct reset_control *rst;
73 73
74 struct work_struct psr_work; 74 struct work_struct psr_work;
75 spinlock_t psr_lock; 75 struct mutex psr_lock;
76 unsigned int psr_state; 76 unsigned int psr_state;
77 77
78 const struct rockchip_dp_chip_data *data; 78 const struct rockchip_dp_chip_data *data;
@@ -83,21 +83,20 @@ struct rockchip_dp_device {
83static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled) 83static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled)
84{ 84{
85 struct rockchip_dp_device *dp = to_dp(encoder); 85 struct rockchip_dp_device *dp = to_dp(encoder);
86 unsigned long flags;
87 86
88 if (!analogix_dp_psr_supported(dp->dev)) 87 if (!analogix_dp_psr_supported(dp->dev))
89 return; 88 return;
90 89
91 DRM_DEV_DEBUG(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit"); 90 DRM_DEV_DEBUG(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit");
92 91
93 spin_lock_irqsave(&dp->psr_lock, flags); 92 mutex_lock(&dp->psr_lock);
94 if (enabled) 93 if (enabled)
95 dp->psr_state = EDP_VSC_PSR_STATE_ACTIVE; 94 dp->psr_state = EDP_VSC_PSR_STATE_ACTIVE;
96 else 95 else
97 dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE; 96 dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE;
98 97
99 schedule_work(&dp->psr_work); 98 schedule_work(&dp->psr_work);
100 spin_unlock_irqrestore(&dp->psr_lock, flags); 99 mutex_unlock(&dp->psr_lock);
101} 100}
102 101
103static void analogix_dp_psr_work(struct work_struct *work) 102static void analogix_dp_psr_work(struct work_struct *work)
@@ -105,7 +104,6 @@ static void analogix_dp_psr_work(struct work_struct *work)
105 struct rockchip_dp_device *dp = 104 struct rockchip_dp_device *dp =
106 container_of(work, typeof(*dp), psr_work); 105 container_of(work, typeof(*dp), psr_work);
107 int ret; 106 int ret;
108 unsigned long flags;
109 107
110 ret = rockchip_drm_wait_vact_end(dp->encoder.crtc, 108 ret = rockchip_drm_wait_vact_end(dp->encoder.crtc,
111 PSR_WAIT_LINE_FLAG_TIMEOUT_MS); 109 PSR_WAIT_LINE_FLAG_TIMEOUT_MS);
@@ -114,12 +112,12 @@ static void analogix_dp_psr_work(struct work_struct *work)
114 return; 112 return;
115 } 113 }
116 114
117 spin_lock_irqsave(&dp->psr_lock, flags); 115 mutex_lock(&dp->psr_lock);
118 if (dp->psr_state == EDP_VSC_PSR_STATE_ACTIVE) 116 if (dp->psr_state == EDP_VSC_PSR_STATE_ACTIVE)
119 analogix_dp_enable_psr(dp->dev); 117 analogix_dp_enable_psr(dp->dev);
120 else 118 else
121 analogix_dp_disable_psr(dp->dev); 119 analogix_dp_disable_psr(dp->dev);
122 spin_unlock_irqrestore(&dp->psr_lock, flags); 120 mutex_unlock(&dp->psr_lock);
123} 121}
124 122
125static int rockchip_dp_pre_init(struct rockchip_dp_device *dp) 123static int rockchip_dp_pre_init(struct rockchip_dp_device *dp)
@@ -381,7 +379,7 @@ static int rockchip_dp_bind(struct device *dev, struct device *master,
381 dp->plat_data.power_off = rockchip_dp_powerdown; 379 dp->plat_data.power_off = rockchip_dp_powerdown;
382 dp->plat_data.get_modes = rockchip_dp_get_modes; 380 dp->plat_data.get_modes = rockchip_dp_get_modes;
383 381
384 spin_lock_init(&dp->psr_lock); 382 mutex_init(&dp->psr_lock);
385 dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE; 383 dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE;
386 INIT_WORK(&dp->psr_work, analogix_dp_psr_work); 384 INIT_WORK(&dp->psr_work, analogix_dp_psr_work);
387 385