diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-02-17 14:45:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-02-17 14:45:10 -0500 |
commit | 35683dd326b89751b5b45cb188978c83b22729c5 (patch) | |
tree | 72f62a54047fd6b51da0a46ef6223dca3994375f | |
parent | a9f70bd4e787191ca27941e4dd9c1de00593fb58 (diff) | |
parent | dada168b3b76439d83aff34f8fbd9c512c2d136a (diff) |
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
"This has two main sets of fixes:
- A bunch of Exynos fixes, mainly for their MIC component.
- vblank regression fixes from Mario, apparantly some changes in 4.4
caused some vblank breakage on radeon/nouveau, this set fixes all
the issues seen.
There is also a revert of one of the MST changse, that I was
overzealous in including, that broke 30" MST monitors, and two qxl
fixes"
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
drm/qxl: fix erroneous return value
drm/nouveau/display: Enable vblank irqs after display engine is on again.
drm/radeon/pm: Handle failure of drm_vblank_get.
drm: Fix treatment of drm_vblank_offdelay in drm_vblank_on() (v2)
drm: Fix drm_vblank_pre/post_modeset regression from Linux 4.4
drm: Prevent vblank counter bumps > 1 with active vblank clients. (v2)
drm: No-Op redundant calls to drm_vblank_off() (v2)
drm/qxl: use kmalloc_array to alloc reloc_info in qxl_process_single_command
Revert "drm/dp/mst: change MST detection scheme"
drm/exynos/decon: fix disable clocks order
drm/exynos: fix incorrect cpu address for dma_mmap_attrs()
drm/exynos: exynos5433_decon: fix wrong state in decon_vblank_enable
drm/exynos: exynos5433_decon: fix wrong state assignment in decon_enable
drm/exynos: dsi: restore support for drm bridge
drm/exynos: mic: make all functions static
drm/exynos: mic: convert to component framework
drm/exynos: mic: use devm_clk interface
drm/exynos: fix types for compilation on 64bit architectures
drm/exynos: ipp: fix incorrect format specifiers in debug messages
drm/exynos: depend on ARCH_EXYNOS for DRM_EXYNOS
-rw-r--r-- | drivers/gpu/drm/drm_dp_mst_topology.c | 37 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 73 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/Kconfig | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_dsi.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fimc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_g2d.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.c | 32 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_mic.c | 72 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_rotator.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_vidi.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_ioctl.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_prime.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 8 |
18 files changed, 178 insertions, 93 deletions
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 8ae13de272c4..27fbd79d0daf 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c | |||
@@ -1159,11 +1159,13 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, | |||
1159 | drm_dp_put_port(port); | 1159 | drm_dp_put_port(port); |
1160 | goto out; | 1160 | goto out; |
1161 | } | 1161 | } |
1162 | 1162 | if (port->port_num >= DP_MST_LOGICAL_PORT_0) { | |
1163 | drm_mode_connector_set_tile_property(port->connector); | 1163 | port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc); |
1164 | 1164 | drm_mode_connector_set_tile_property(port->connector); | |
1165 | } | ||
1165 | (*mstb->mgr->cbs->register_connector)(port->connector); | 1166 | (*mstb->mgr->cbs->register_connector)(port->connector); |
1166 | } | 1167 | } |
1168 | |||
1167 | out: | 1169 | out: |
1168 | /* put reference to this port */ | 1170 | /* put reference to this port */ |
1169 | drm_dp_put_port(port); | 1171 | drm_dp_put_port(port); |
@@ -1188,8 +1190,8 @@ static void drm_dp_update_port(struct drm_dp_mst_branch *mstb, | |||
1188 | port->ddps = conn_stat->displayport_device_plug_status; | 1190 | port->ddps = conn_stat->displayport_device_plug_status; |
1189 | 1191 | ||
1190 | if (old_ddps != port->ddps) { | 1192 | if (old_ddps != port->ddps) { |
1191 | dowork = true; | ||
1192 | if (port->ddps) { | 1193 | if (port->ddps) { |
1194 | dowork = true; | ||
1193 | } else { | 1195 | } else { |
1194 | port->available_pbn = 0; | 1196 | port->available_pbn = 0; |
1195 | } | 1197 | } |
@@ -1294,13 +1296,8 @@ static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *m | |||
1294 | if (port->input) | 1296 | if (port->input) |
1295 | continue; | 1297 | continue; |
1296 | 1298 | ||
1297 | if (!port->ddps) { | 1299 | if (!port->ddps) |
1298 | if (port->cached_edid) { | ||
1299 | kfree(port->cached_edid); | ||
1300 | port->cached_edid = NULL; | ||
1301 | } | ||
1302 | continue; | 1300 | continue; |
1303 | } | ||
1304 | 1301 | ||
1305 | if (!port->available_pbn) | 1302 | if (!port->available_pbn) |
1306 | drm_dp_send_enum_path_resources(mgr, mstb, port); | 1303 | drm_dp_send_enum_path_resources(mgr, mstb, port); |
@@ -1311,12 +1308,6 @@ static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *m | |||
1311 | drm_dp_check_and_send_link_address(mgr, mstb_child); | 1308 | drm_dp_check_and_send_link_address(mgr, mstb_child); |
1312 | drm_dp_put_mst_branch_device(mstb_child); | 1309 | drm_dp_put_mst_branch_device(mstb_child); |
1313 | } | 1310 | } |
1314 | } else if (port->pdt == DP_PEER_DEVICE_SST_SINK || | ||
1315 | port->pdt == DP_PEER_DEVICE_DP_LEGACY_CONV) { | ||
1316 | if (!port->cached_edid) { | ||
1317 | port->cached_edid = | ||
1318 | drm_get_edid(port->connector, &port->aux.ddc); | ||
1319 | } | ||
1320 | } | 1311 | } |
1321 | } | 1312 | } |
1322 | } | 1313 | } |
@@ -1336,8 +1327,6 @@ static void drm_dp_mst_link_probe_work(struct work_struct *work) | |||
1336 | drm_dp_check_and_send_link_address(mgr, mstb); | 1327 | drm_dp_check_and_send_link_address(mgr, mstb); |
1337 | drm_dp_put_mst_branch_device(mstb); | 1328 | drm_dp_put_mst_branch_device(mstb); |
1338 | } | 1329 | } |
1339 | |||
1340 | (*mgr->cbs->hotplug)(mgr); | ||
1341 | } | 1330 | } |
1342 | 1331 | ||
1343 | static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr, | 1332 | static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr, |
@@ -1597,6 +1586,7 @@ static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, | |||
1597 | for (i = 0; i < txmsg->reply.u.link_addr.nports; i++) { | 1586 | for (i = 0; i < txmsg->reply.u.link_addr.nports; i++) { |
1598 | drm_dp_add_port(mstb, mgr->dev, &txmsg->reply.u.link_addr.ports[i]); | 1587 | drm_dp_add_port(mstb, mgr->dev, &txmsg->reply.u.link_addr.ports[i]); |
1599 | } | 1588 | } |
1589 | (*mgr->cbs->hotplug)(mgr); | ||
1600 | } | 1590 | } |
1601 | } else { | 1591 | } else { |
1602 | mstb->link_address_sent = false; | 1592 | mstb->link_address_sent = false; |
@@ -2293,6 +2283,8 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr) | |||
2293 | drm_dp_update_port(mstb, &msg.u.conn_stat); | 2283 | drm_dp_update_port(mstb, &msg.u.conn_stat); |
2294 | 2284 | ||
2295 | DRM_DEBUG_KMS("Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", msg.u.conn_stat.port_number, msg.u.conn_stat.legacy_device_plug_status, msg.u.conn_stat.displayport_device_plug_status, msg.u.conn_stat.message_capability_status, msg.u.conn_stat.input_port, msg.u.conn_stat.peer_device_type); | 2285 | DRM_DEBUG_KMS("Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", msg.u.conn_stat.port_number, msg.u.conn_stat.legacy_device_plug_status, msg.u.conn_stat.displayport_device_plug_status, msg.u.conn_stat.message_capability_status, msg.u.conn_stat.input_port, msg.u.conn_stat.peer_device_type); |
2286 | (*mgr->cbs->hotplug)(mgr); | ||
2287 | |||
2296 | } else if (msg.req_type == DP_RESOURCE_STATUS_NOTIFY) { | 2288 | } else if (msg.req_type == DP_RESOURCE_STATUS_NOTIFY) { |
2297 | drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false); | 2289 | drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false); |
2298 | if (!mstb) | 2290 | if (!mstb) |
@@ -2379,6 +2371,10 @@ enum drm_connector_status drm_dp_mst_detect_port(struct drm_connector *connector | |||
2379 | 2371 | ||
2380 | case DP_PEER_DEVICE_SST_SINK: | 2372 | case DP_PEER_DEVICE_SST_SINK: |
2381 | status = connector_status_connected; | 2373 | status = connector_status_connected; |
2374 | /* for logical ports - cache the EDID */ | ||
2375 | if (port->port_num >= 8 && !port->cached_edid) { | ||
2376 | port->cached_edid = drm_get_edid(connector, &port->aux.ddc); | ||
2377 | } | ||
2382 | break; | 2378 | break; |
2383 | case DP_PEER_DEVICE_DP_LEGACY_CONV: | 2379 | case DP_PEER_DEVICE_DP_LEGACY_CONV: |
2384 | if (port->ldps) | 2380 | if (port->ldps) |
@@ -2433,7 +2429,10 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_ | |||
2433 | 2429 | ||
2434 | if (port->cached_edid) | 2430 | if (port->cached_edid) |
2435 | edid = drm_edid_duplicate(port->cached_edid); | 2431 | edid = drm_edid_duplicate(port->cached_edid); |
2436 | 2432 | else { | |
2433 | edid = drm_get_edid(connector, &port->aux.ddc); | ||
2434 | drm_mode_connector_set_tile_property(connector); | ||
2435 | } | ||
2437 | port->has_audio = drm_detect_monitor_audio(edid); | 2436 | port->has_audio = drm_detect_monitor_audio(edid); |
2438 | drm_dp_put_port(port); | 2437 | drm_dp_put_port(port); |
2439 | return edid; | 2438 | return edid; |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index d12a4efa651b..1fe14579e8c9 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -224,6 +224,64 @@ static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, | |||
224 | diff = (flags & DRM_CALLED_FROM_VBLIRQ) != 0; | 224 | diff = (flags & DRM_CALLED_FROM_VBLIRQ) != 0; |
225 | } | 225 | } |
226 | 226 | ||
227 | /* | ||
228 | * Within a drm_vblank_pre_modeset - drm_vblank_post_modeset | ||
229 | * interval? If so then vblank irqs keep running and it will likely | ||
230 | * happen that the hardware vblank counter is not trustworthy as it | ||
231 | * might reset at some point in that interval and vblank timestamps | ||
232 | * are not trustworthy either in that interval. Iow. this can result | ||
233 | * in a bogus diff >> 1 which must be avoided as it would cause | ||
234 | * random large forward jumps of the software vblank counter. | ||
235 | */ | ||
236 | if (diff > 1 && (vblank->inmodeset & 0x2)) { | ||
237 | DRM_DEBUG_VBL("clamping vblank bump to 1 on crtc %u: diffr=%u" | ||
238 | " due to pre-modeset.\n", pipe, diff); | ||
239 | diff = 1; | ||
240 | } | ||
241 | |||
242 | /* | ||
243 | * FIMXE: Need to replace this hack with proper seqlocks. | ||
244 | * | ||
245 | * Restrict the bump of the software vblank counter to a safe maximum | ||
246 | * value of +1 whenever there is the possibility that concurrent readers | ||
247 | * of vblank timestamps could be active at the moment, as the current | ||
248 | * implementation of the timestamp caching and updating is not safe | ||
249 | * against concurrent readers for calls to store_vblank() with a bump | ||
250 | * of anything but +1. A bump != 1 would very likely return corrupted | ||
251 | * timestamps to userspace, because the same slot in the cache could | ||
252 | * be concurrently written by store_vblank() and read by one of those | ||
253 | * readers without the read-retry logic detecting the collision. | ||
254 | * | ||
255 | * Concurrent readers can exist when we are called from the | ||
256 | * drm_vblank_off() or drm_vblank_on() functions and other non-vblank- | ||
257 | * irq callers. However, all those calls to us are happening with the | ||
258 | * vbl_lock locked to prevent drm_vblank_get(), so the vblank refcount | ||
259 | * can't increase while we are executing. Therefore a zero refcount at | ||
260 | * this point is safe for arbitrary counter bumps if we are called | ||
261 | * outside vblank irq, a non-zero count is not 100% safe. Unfortunately | ||
262 | * we must also accept a refcount of 1, as whenever we are called from | ||
263 | * drm_vblank_get() -> drm_vblank_enable() the refcount will be 1 and | ||
264 | * we must let that one pass through in order to not lose vblank counts | ||
265 | * during vblank irq off - which would completely defeat the whole | ||
266 | * point of this routine. | ||
267 | * | ||
268 | * Whenever we are called from vblank irq, we have to assume concurrent | ||
269 | * readers exist or can show up any time during our execution, even if | ||
270 | * the refcount is currently zero, as vblank irqs are usually only | ||
271 | * enabled due to the presence of readers, and because when we are called | ||
272 | * from vblank irq we can't hold the vbl_lock to protect us from sudden | ||
273 | * bumps in vblank refcount. Therefore also restrict bumps to +1 when | ||
274 | * called from vblank irq. | ||
275 | */ | ||
276 | if ((diff > 1) && (atomic_read(&vblank->refcount) > 1 || | ||
277 | (flags & DRM_CALLED_FROM_VBLIRQ))) { | ||
278 | DRM_DEBUG_VBL("clamping vblank bump to 1 on crtc %u: diffr=%u " | ||
279 | "refcount %u, vblirq %u\n", pipe, diff, | ||
280 | atomic_read(&vblank->refcount), | ||
281 | (flags & DRM_CALLED_FROM_VBLIRQ) != 0); | ||
282 | diff = 1; | ||
283 | } | ||
284 | |||
227 | DRM_DEBUG_VBL("updating vblank count on crtc %u:" | 285 | DRM_DEBUG_VBL("updating vblank count on crtc %u:" |
228 | " current=%u, diff=%u, hw=%u hw_last=%u\n", | 286 | " current=%u, diff=%u, hw=%u hw_last=%u\n", |
229 | pipe, vblank->count, diff, cur_vblank, vblank->last); | 287 | pipe, vblank->count, diff, cur_vblank, vblank->last); |
@@ -1316,7 +1374,13 @@ void drm_vblank_off(struct drm_device *dev, unsigned int pipe) | |||
1316 | spin_lock_irqsave(&dev->event_lock, irqflags); | 1374 | spin_lock_irqsave(&dev->event_lock, irqflags); |
1317 | 1375 | ||
1318 | spin_lock(&dev->vbl_lock); | 1376 | spin_lock(&dev->vbl_lock); |
1319 | vblank_disable_and_save(dev, pipe); | 1377 | DRM_DEBUG_VBL("crtc %d, vblank enabled %d, inmodeset %d\n", |
1378 | pipe, vblank->enabled, vblank->inmodeset); | ||
1379 | |||
1380 | /* Avoid redundant vblank disables without previous drm_vblank_on(). */ | ||
1381 | if (drm_core_check_feature(dev, DRIVER_ATOMIC) || !vblank->inmodeset) | ||
1382 | vblank_disable_and_save(dev, pipe); | ||
1383 | |||
1320 | wake_up(&vblank->queue); | 1384 | wake_up(&vblank->queue); |
1321 | 1385 | ||
1322 | /* | 1386 | /* |
@@ -1418,6 +1482,9 @@ void drm_vblank_on(struct drm_device *dev, unsigned int pipe) | |||
1418 | return; | 1482 | return; |
1419 | 1483 | ||
1420 | spin_lock_irqsave(&dev->vbl_lock, irqflags); | 1484 | spin_lock_irqsave(&dev->vbl_lock, irqflags); |
1485 | DRM_DEBUG_VBL("crtc %d, vblank enabled %d, inmodeset %d\n", | ||
1486 | pipe, vblank->enabled, vblank->inmodeset); | ||
1487 | |||
1421 | /* Drop our private "prevent drm_vblank_get" refcount */ | 1488 | /* Drop our private "prevent drm_vblank_get" refcount */ |
1422 | if (vblank->inmodeset) { | 1489 | if (vblank->inmodeset) { |
1423 | atomic_dec(&vblank->refcount); | 1490 | atomic_dec(&vblank->refcount); |
@@ -1430,8 +1497,7 @@ void drm_vblank_on(struct drm_device *dev, unsigned int pipe) | |||
1430 | * re-enable interrupts if there are users left, or the | 1497 | * re-enable interrupts if there are users left, or the |
1431 | * user wishes vblank interrupts to be enabled all the time. | 1498 | * user wishes vblank interrupts to be enabled all the time. |
1432 | */ | 1499 | */ |
1433 | if (atomic_read(&vblank->refcount) != 0 || | 1500 | if (atomic_read(&vblank->refcount) != 0 || drm_vblank_offdelay == 0) |
1434 | (!dev->vblank_disable_immediate && drm_vblank_offdelay == 0)) | ||
1435 | WARN_ON(drm_vblank_enable(dev, pipe)); | 1501 | WARN_ON(drm_vblank_enable(dev, pipe)); |
1436 | spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | 1502 | spin_unlock_irqrestore(&dev->vbl_lock, irqflags); |
1437 | } | 1503 | } |
@@ -1526,6 +1592,7 @@ void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe) | |||
1526 | if (vblank->inmodeset) { | 1592 | if (vblank->inmodeset) { |
1527 | spin_lock_irqsave(&dev->vbl_lock, irqflags); | 1593 | spin_lock_irqsave(&dev->vbl_lock, irqflags); |
1528 | dev->vblank_disable_allowed = true; | 1594 | dev->vblank_disable_allowed = true; |
1595 | drm_reset_vblank_timestamp(dev, pipe); | ||
1529 | spin_unlock_irqrestore(&dev->vbl_lock, irqflags); | 1596 | spin_unlock_irqrestore(&dev->vbl_lock, irqflags); |
1530 | 1597 | ||
1531 | if (vblank->inmodeset & 0x2) | 1598 | if (vblank->inmodeset & 0x2) |
diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index 83efca941388..f17d39279596 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config DRM_EXYNOS | 1 | config DRM_EXYNOS |
2 | tristate "DRM Support for Samsung SoC EXYNOS Series" | 2 | tristate "DRM Support for Samsung SoC EXYNOS Series" |
3 | depends on OF && DRM && (PLAT_SAMSUNG || ARCH_MULTIPLATFORM) | 3 | depends on OF && DRM && (ARCH_S3C64XX || ARCH_EXYNOS || ARCH_MULTIPLATFORM) |
4 | select DRM_KMS_HELPER | 4 | select DRM_KMS_HELPER |
5 | select DRM_KMS_FB_HELPER | 5 | select DRM_KMS_FB_HELPER |
6 | select FB_CFB_FILLRECT | 6 | select FB_CFB_FILLRECT |
diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c index 1bf6a21130c7..162ab93e99cb 100644 --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c | |||
@@ -93,7 +93,7 @@ static int decon_enable_vblank(struct exynos_drm_crtc *crtc) | |||
93 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) | 93 | if (test_bit(BIT_SUSPENDED, &ctx->flags)) |
94 | return -EPERM; | 94 | return -EPERM; |
95 | 95 | ||
96 | if (test_and_set_bit(BIT_IRQS_ENABLED, &ctx->flags)) { | 96 | if (!test_and_set_bit(BIT_IRQS_ENABLED, &ctx->flags)) { |
97 | val = VIDINTCON0_INTEN; | 97 | val = VIDINTCON0_INTEN; |
98 | if (ctx->out_type == IFTYPE_I80) | 98 | if (ctx->out_type == IFTYPE_I80) |
99 | val |= VIDINTCON0_FRAMEDONE; | 99 | val |= VIDINTCON0_FRAMEDONE; |
@@ -402,8 +402,6 @@ static void decon_enable(struct exynos_drm_crtc *crtc) | |||
402 | decon_enable_vblank(ctx->crtc); | 402 | decon_enable_vblank(ctx->crtc); |
403 | 403 | ||
404 | decon_commit(ctx->crtc); | 404 | decon_commit(ctx->crtc); |
405 | |||
406 | set_bit(BIT_SUSPENDED, &ctx->flags); | ||
407 | } | 405 | } |
408 | 406 | ||
409 | static void decon_disable(struct exynos_drm_crtc *crtc) | 407 | static void decon_disable(struct exynos_drm_crtc *crtc) |
@@ -582,9 +580,9 @@ out: | |||
582 | static int exynos5433_decon_suspend(struct device *dev) | 580 | static int exynos5433_decon_suspend(struct device *dev) |
583 | { | 581 | { |
584 | struct decon_context *ctx = dev_get_drvdata(dev); | 582 | struct decon_context *ctx = dev_get_drvdata(dev); |
585 | int i; | 583 | int i = ARRAY_SIZE(decon_clks_name); |
586 | 584 | ||
587 | for (i = 0; i < ARRAY_SIZE(decon_clks_name); i++) | 585 | while (--i >= 0) |
588 | clk_disable_unprepare(ctx->clks[i]); | 586 | clk_disable_unprepare(ctx->clks[i]); |
589 | 587 | ||
590 | return 0; | 588 | return 0; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index e977a81af2e6..26e81d191f56 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c | |||
@@ -1782,6 +1782,7 @@ static int exynos_dsi_bind(struct device *dev, struct device *master, | |||
1782 | 1782 | ||
1783 | bridge = of_drm_find_bridge(dsi->bridge_node); | 1783 | bridge = of_drm_find_bridge(dsi->bridge_node); |
1784 | if (bridge) { | 1784 | if (bridge) { |
1785 | encoder->bridge = bridge; | ||
1785 | drm_bridge_attach(drm_dev, bridge); | 1786 | drm_bridge_attach(drm_dev, bridge); |
1786 | } | 1787 | } |
1787 | 1788 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index f6118baa8e3e..8baabd813ff5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c | |||
@@ -50,7 +50,7 @@ static int exynos_drm_fb_mmap(struct fb_info *info, | |||
50 | if (vm_size > exynos_gem->size) | 50 | if (vm_size > exynos_gem->size) |
51 | return -EINVAL; | 51 | return -EINVAL; |
52 | 52 | ||
53 | ret = dma_mmap_attrs(helper->dev->dev, vma, exynos_gem->pages, | 53 | ret = dma_mmap_attrs(helper->dev->dev, vma, exynos_gem->cookie, |
54 | exynos_gem->dma_addr, exynos_gem->size, | 54 | exynos_gem->dma_addr, exynos_gem->size, |
55 | &exynos_gem->dma_attrs); | 55 | &exynos_gem->dma_attrs); |
56 | if (ret < 0) { | 56 | if (ret < 0) { |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index c747824f3c98..8a4f4a0211d0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c | |||
@@ -1723,7 +1723,7 @@ static int fimc_probe(struct platform_device *pdev) | |||
1723 | goto err_put_clk; | 1723 | goto err_put_clk; |
1724 | } | 1724 | } |
1725 | 1725 | ||
1726 | DRM_DEBUG_KMS("id[%d]ippdrv[0x%x]\n", ctx->id, (int)ippdrv); | 1726 | DRM_DEBUG_KMS("id[%d]ippdrv[%p]\n", ctx->id, ippdrv); |
1727 | 1727 | ||
1728 | spin_lock_init(&ctx->lock); | 1728 | spin_lock_init(&ctx->lock); |
1729 | platform_set_drvdata(pdev, ctx); | 1729 | platform_set_drvdata(pdev, ctx); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index c17efdb238a6..8dfe6e113a88 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c | |||
@@ -1166,7 +1166,7 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, | |||
1166 | goto err_free_event; | 1166 | goto err_free_event; |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | cmd = (struct drm_exynos_g2d_cmd *)(uint32_t)req->cmd; | 1169 | cmd = (struct drm_exynos_g2d_cmd *)(unsigned long)req->cmd; |
1170 | 1170 | ||
1171 | if (copy_from_user(cmdlist->data + cmdlist->last, | 1171 | if (copy_from_user(cmdlist->data + cmdlist->last, |
1172 | (void __user *)cmd, | 1172 | (void __user *)cmd, |
@@ -1184,7 +1184,8 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data, | |||
1184 | if (req->cmd_buf_nr) { | 1184 | if (req->cmd_buf_nr) { |
1185 | struct drm_exynos_g2d_cmd *cmd_buf; | 1185 | struct drm_exynos_g2d_cmd *cmd_buf; |
1186 | 1186 | ||
1187 | cmd_buf = (struct drm_exynos_g2d_cmd *)(uint32_t)req->cmd_buf; | 1187 | cmd_buf = (struct drm_exynos_g2d_cmd *) |
1188 | (unsigned long)req->cmd_buf; | ||
1188 | 1189 | ||
1189 | if (copy_from_user(cmdlist->data + cmdlist->last, | 1190 | if (copy_from_user(cmdlist->data + cmdlist->last, |
1190 | (void __user *)cmd_buf, | 1191 | (void __user *)cmd_buf, |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 32358c5e3db4..26b5e4bd55b6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c | |||
@@ -218,7 +218,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev, | |||
218 | return ERR_PTR(ret); | 218 | return ERR_PTR(ret); |
219 | } | 219 | } |
220 | 220 | ||
221 | DRM_DEBUG_KMS("created file object = 0x%x\n", (unsigned int)obj->filp); | 221 | DRM_DEBUG_KMS("created file object = %p\n", obj->filp); |
222 | 222 | ||
223 | return exynos_gem; | 223 | return exynos_gem; |
224 | } | 224 | } |
@@ -335,7 +335,7 @@ static int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem *exynos_gem, | |||
335 | if (vm_size > exynos_gem->size) | 335 | if (vm_size > exynos_gem->size) |
336 | return -EINVAL; | 336 | return -EINVAL; |
337 | 337 | ||
338 | ret = dma_mmap_attrs(drm_dev->dev, vma, exynos_gem->pages, | 338 | ret = dma_mmap_attrs(drm_dev->dev, vma, exynos_gem->cookie, |
339 | exynos_gem->dma_addr, exynos_gem->size, | 339 | exynos_gem->dma_addr, exynos_gem->size, |
340 | &exynos_gem->dma_attrs); | 340 | &exynos_gem->dma_attrs); |
341 | if (ret < 0) { | 341 | if (ret < 0) { |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 7aecd23cfa11..5d20da8f957e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c | |||
@@ -1723,7 +1723,7 @@ static int gsc_probe(struct platform_device *pdev) | |||
1723 | return ret; | 1723 | return ret; |
1724 | } | 1724 | } |
1725 | 1725 | ||
1726 | DRM_DEBUG_KMS("id[%d]ippdrv[0x%x]\n", ctx->id, (int)ippdrv); | 1726 | DRM_DEBUG_KMS("id[%d]ippdrv[%p]\n", ctx->id, ippdrv); |
1727 | 1727 | ||
1728 | mutex_init(&ctx->lock); | 1728 | mutex_init(&ctx->lock); |
1729 | platform_set_drvdata(pdev, ctx); | 1729 | platform_set_drvdata(pdev, ctx); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 67d24236e745..95eeb9116f10 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -208,7 +208,7 @@ static struct exynos_drm_ippdrv *ipp_find_drv_by_handle(u32 prop_id) | |||
208 | * e.g PAUSE state, queue buf, command control. | 208 | * e.g PAUSE state, queue buf, command control. |
209 | */ | 209 | */ |
210 | list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { | 210 | list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) { |
211 | DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n", count++, (int)ippdrv); | 211 | DRM_DEBUG_KMS("count[%d]ippdrv[%p]\n", count++, ippdrv); |
212 | 212 | ||
213 | mutex_lock(&ippdrv->cmd_lock); | 213 | mutex_lock(&ippdrv->cmd_lock); |
214 | list_for_each_entry(c_node, &ippdrv->cmd_list, list) { | 214 | list_for_each_entry(c_node, &ippdrv->cmd_list, list) { |
@@ -388,8 +388,8 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data, | |||
388 | } | 388 | } |
389 | property->prop_id = ret; | 389 | property->prop_id = ret; |
390 | 390 | ||
391 | DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[0x%x]\n", | 391 | DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[%p]\n", |
392 | property->prop_id, property->cmd, (int)ippdrv); | 392 | property->prop_id, property->cmd, ippdrv); |
393 | 393 | ||
394 | /* stored property information and ippdrv in private data */ | 394 | /* stored property information and ippdrv in private data */ |
395 | c_node->property = *property; | 395 | c_node->property = *property; |
@@ -518,7 +518,7 @@ static int ipp_put_mem_node(struct drm_device *drm_dev, | |||
518 | { | 518 | { |
519 | int i; | 519 | int i; |
520 | 520 | ||
521 | DRM_DEBUG_KMS("node[0x%x]\n", (int)m_node); | 521 | DRM_DEBUG_KMS("node[%p]\n", m_node); |
522 | 522 | ||
523 | if (!m_node) { | 523 | if (!m_node) { |
524 | DRM_ERROR("invalid dequeue node.\n"); | 524 | DRM_ERROR("invalid dequeue node.\n"); |
@@ -562,7 +562,7 @@ static struct drm_exynos_ipp_mem_node | |||
562 | m_node->buf_id = qbuf->buf_id; | 562 | m_node->buf_id = qbuf->buf_id; |
563 | INIT_LIST_HEAD(&m_node->list); | 563 | INIT_LIST_HEAD(&m_node->list); |
564 | 564 | ||
565 | DRM_DEBUG_KMS("m_node[0x%x]ops_id[%d]\n", (int)m_node, qbuf->ops_id); | 565 | DRM_DEBUG_KMS("m_node[%p]ops_id[%d]\n", m_node, qbuf->ops_id); |
566 | DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]\n", qbuf->prop_id, m_node->buf_id); | 566 | DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]\n", qbuf->prop_id, m_node->buf_id); |
567 | 567 | ||
568 | for_each_ipp_planar(i) { | 568 | for_each_ipp_planar(i) { |
@@ -582,8 +582,8 @@ static struct drm_exynos_ipp_mem_node | |||
582 | 582 | ||
583 | buf_info->handles[i] = qbuf->handle[i]; | 583 | buf_info->handles[i] = qbuf->handle[i]; |
584 | buf_info->base[i] = *addr; | 584 | buf_info->base[i] = *addr; |
585 | DRM_DEBUG_KMS("i[%d]base[0x%x]hd[0x%lx]\n", i, | 585 | DRM_DEBUG_KMS("i[%d]base[%pad]hd[0x%lx]\n", i, |
586 | buf_info->base[i], buf_info->handles[i]); | 586 | &buf_info->base[i], buf_info->handles[i]); |
587 | } | 587 | } |
588 | } | 588 | } |
589 | 589 | ||
@@ -664,7 +664,7 @@ static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node, | |||
664 | 664 | ||
665 | mutex_lock(&c_node->event_lock); | 665 | mutex_lock(&c_node->event_lock); |
666 | list_for_each_entry_safe(e, te, &c_node->event_list, base.link) { | 666 | list_for_each_entry_safe(e, te, &c_node->event_list, base.link) { |
667 | DRM_DEBUG_KMS("count[%d]e[0x%x]\n", count++, (int)e); | 667 | DRM_DEBUG_KMS("count[%d]e[%p]\n", count++, e); |
668 | 668 | ||
669 | /* | 669 | /* |
670 | * qbuf == NULL condition means all event deletion. | 670 | * qbuf == NULL condition means all event deletion. |
@@ -755,7 +755,7 @@ static struct drm_exynos_ipp_mem_node | |||
755 | 755 | ||
756 | /* find memory node from memory list */ | 756 | /* find memory node from memory list */ |
757 | list_for_each_entry(m_node, head, list) { | 757 | list_for_each_entry(m_node, head, list) { |
758 | DRM_DEBUG_KMS("count[%d]m_node[0x%x]\n", count++, (int)m_node); | 758 | DRM_DEBUG_KMS("count[%d]m_node[%p]\n", count++, m_node); |
759 | 759 | ||
760 | /* compare buffer id */ | 760 | /* compare buffer id */ |
761 | if (m_node->buf_id == qbuf->buf_id) | 761 | if (m_node->buf_id == qbuf->buf_id) |
@@ -772,7 +772,7 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv *ippdrv, | |||
772 | struct exynos_drm_ipp_ops *ops = NULL; | 772 | struct exynos_drm_ipp_ops *ops = NULL; |
773 | int ret = 0; | 773 | int ret = 0; |
774 | 774 | ||
775 | DRM_DEBUG_KMS("node[0x%x]\n", (int)m_node); | 775 | DRM_DEBUG_KMS("node[%p]\n", m_node); |
776 | 776 | ||
777 | if (!m_node) { | 777 | if (!m_node) { |
778 | DRM_ERROR("invalid queue node.\n"); | 778 | DRM_ERROR("invalid queue node.\n"); |
@@ -1237,7 +1237,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, | |||
1237 | m_node = list_first_entry(head, | 1237 | m_node = list_first_entry(head, |
1238 | struct drm_exynos_ipp_mem_node, list); | 1238 | struct drm_exynos_ipp_mem_node, list); |
1239 | 1239 | ||
1240 | DRM_DEBUG_KMS("m_node[0x%x]\n", (int)m_node); | 1240 | DRM_DEBUG_KMS("m_node[%p]\n", m_node); |
1241 | 1241 | ||
1242 | ret = ipp_set_mem_node(ippdrv, c_node, m_node); | 1242 | ret = ipp_set_mem_node(ippdrv, c_node, m_node); |
1243 | if (ret) { | 1243 | if (ret) { |
@@ -1610,8 +1610,8 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev) | |||
1610 | } | 1610 | } |
1611 | ippdrv->prop_list.ipp_id = ret; | 1611 | ippdrv->prop_list.ipp_id = ret; |
1612 | 1612 | ||
1613 | DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]ipp_id[%d]\n", | 1613 | DRM_DEBUG_KMS("count[%d]ippdrv[%p]ipp_id[%d]\n", |
1614 | count++, (int)ippdrv, ret); | 1614 | count++, ippdrv, ret); |
1615 | 1615 | ||
1616 | /* store parent device for node */ | 1616 | /* store parent device for node */ |
1617 | ippdrv->parent_dev = dev; | 1617 | ippdrv->parent_dev = dev; |
@@ -1668,7 +1668,7 @@ static int ipp_subdrv_open(struct drm_device *drm_dev, struct device *dev, | |||
1668 | 1668 | ||
1669 | file_priv->ipp_dev = dev; | 1669 | file_priv->ipp_dev = dev; |
1670 | 1670 | ||
1671 | DRM_DEBUG_KMS("done priv[0x%x]\n", (int)dev); | 1671 | DRM_DEBUG_KMS("done priv[%p]\n", dev); |
1672 | 1672 | ||
1673 | return 0; | 1673 | return 0; |
1674 | } | 1674 | } |
@@ -1685,8 +1685,8 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev, | |||
1685 | mutex_lock(&ippdrv->cmd_lock); | 1685 | mutex_lock(&ippdrv->cmd_lock); |
1686 | list_for_each_entry_safe(c_node, tc_node, | 1686 | list_for_each_entry_safe(c_node, tc_node, |
1687 | &ippdrv->cmd_list, list) { | 1687 | &ippdrv->cmd_list, list) { |
1688 | DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n", | 1688 | DRM_DEBUG_KMS("count[%d]ippdrv[%p]\n", |
1689 | count++, (int)ippdrv); | 1689 | count++, ippdrv); |
1690 | 1690 | ||
1691 | if (c_node->filp == file) { | 1691 | if (c_node->filp == file) { |
1692 | /* | 1692 | /* |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c index 4eaef36aec5a..9869d70e9e54 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/of.h> | 18 | #include <linux/of.h> |
19 | #include <linux/of_graph.h> | 19 | #include <linux/of_graph.h> |
20 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
21 | #include <linux/component.h> | ||
21 | #include <drm/drmP.h> | 22 | #include <drm/drmP.h> |
22 | #include <linux/mfd/syscon.h> | 23 | #include <linux/mfd/syscon.h> |
23 | #include <linux/regmap.h> | 24 | #include <linux/regmap.h> |
@@ -306,9 +307,9 @@ exit: | |||
306 | return ret; | 307 | return ret; |
307 | } | 308 | } |
308 | 309 | ||
309 | void mic_disable(struct drm_bridge *bridge) { } | 310 | static void mic_disable(struct drm_bridge *bridge) { } |
310 | 311 | ||
311 | void mic_post_disable(struct drm_bridge *bridge) | 312 | static void mic_post_disable(struct drm_bridge *bridge) |
312 | { | 313 | { |
313 | struct exynos_mic *mic = bridge->driver_private; | 314 | struct exynos_mic *mic = bridge->driver_private; |
314 | int i; | 315 | int i; |
@@ -328,7 +329,7 @@ already_disabled: | |||
328 | mutex_unlock(&mic_mutex); | 329 | mutex_unlock(&mic_mutex); |
329 | } | 330 | } |
330 | 331 | ||
331 | void mic_pre_enable(struct drm_bridge *bridge) | 332 | static void mic_pre_enable(struct drm_bridge *bridge) |
332 | { | 333 | { |
333 | struct exynos_mic *mic = bridge->driver_private; | 334 | struct exynos_mic *mic = bridge->driver_private; |
334 | int ret, i; | 335 | int ret, i; |
@@ -371,11 +372,35 @@ already_enabled: | |||
371 | mutex_unlock(&mic_mutex); | 372 | mutex_unlock(&mic_mutex); |
372 | } | 373 | } |
373 | 374 | ||
374 | void mic_enable(struct drm_bridge *bridge) { } | 375 | static void mic_enable(struct drm_bridge *bridge) { } |
375 | 376 | ||
376 | void mic_destroy(struct drm_bridge *bridge) | 377 | static const struct drm_bridge_funcs mic_bridge_funcs = { |
378 | .disable = mic_disable, | ||
379 | .post_disable = mic_post_disable, | ||
380 | .pre_enable = mic_pre_enable, | ||
381 | .enable = mic_enable, | ||
382 | }; | ||
383 | |||
384 | static int exynos_mic_bind(struct device *dev, struct device *master, | ||
385 | void *data) | ||
377 | { | 386 | { |
378 | struct exynos_mic *mic = bridge->driver_private; | 387 | struct exynos_mic *mic = dev_get_drvdata(dev); |
388 | int ret; | ||
389 | |||
390 | mic->bridge.funcs = &mic_bridge_funcs; | ||
391 | mic->bridge.of_node = dev->of_node; | ||
392 | mic->bridge.driver_private = mic; | ||
393 | ret = drm_bridge_add(&mic->bridge); | ||
394 | if (ret) | ||
395 | DRM_ERROR("mic: Failed to add MIC to the global bridge list\n"); | ||
396 | |||
397 | return ret; | ||
398 | } | ||
399 | |||
400 | static void exynos_mic_unbind(struct device *dev, struct device *master, | ||
401 | void *data) | ||
402 | { | ||
403 | struct exynos_mic *mic = dev_get_drvdata(dev); | ||
379 | int i; | 404 | int i; |
380 | 405 | ||
381 | mutex_lock(&mic_mutex); | 406 | mutex_lock(&mic_mutex); |
@@ -387,16 +412,16 @@ void mic_destroy(struct drm_bridge *bridge) | |||
387 | 412 | ||
388 | already_disabled: | 413 | already_disabled: |
389 | mutex_unlock(&mic_mutex); | 414 | mutex_unlock(&mic_mutex); |
415 | |||
416 | drm_bridge_remove(&mic->bridge); | ||
390 | } | 417 | } |
391 | 418 | ||
392 | static const struct drm_bridge_funcs mic_bridge_funcs = { | 419 | static const struct component_ops exynos_mic_component_ops = { |
393 | .disable = mic_disable, | 420 | .bind = exynos_mic_bind, |
394 | .post_disable = mic_post_disable, | 421 | .unbind = exynos_mic_unbind, |
395 | .pre_enable = mic_pre_enable, | ||
396 | .enable = mic_enable, | ||
397 | }; | 422 | }; |
398 | 423 | ||
399 | int exynos_mic_probe(struct platform_device *pdev) | 424 | static int exynos_mic_probe(struct platform_device *pdev) |
400 | { | 425 | { |
401 | struct device *dev = &pdev->dev; | 426 | struct device *dev = &pdev->dev; |
402 | struct exynos_mic *mic; | 427 | struct exynos_mic *mic; |
@@ -435,17 +460,8 @@ int exynos_mic_probe(struct platform_device *pdev) | |||
435 | goto err; | 460 | goto err; |
436 | } | 461 | } |
437 | 462 | ||
438 | mic->bridge.funcs = &mic_bridge_funcs; | ||
439 | mic->bridge.of_node = dev->of_node; | ||
440 | mic->bridge.driver_private = mic; | ||
441 | ret = drm_bridge_add(&mic->bridge); | ||
442 | if (ret) { | ||
443 | DRM_ERROR("mic: Failed to add MIC to the global bridge list\n"); | ||
444 | goto err; | ||
445 | } | ||
446 | |||
447 | for (i = 0; i < NUM_CLKS; i++) { | 463 | for (i = 0; i < NUM_CLKS; i++) { |
448 | mic->clks[i] = of_clk_get_by_name(dev->of_node, clk_names[i]); | 464 | mic->clks[i] = devm_clk_get(dev, clk_names[i]); |
449 | if (IS_ERR(mic->clks[i])) { | 465 | if (IS_ERR(mic->clks[i])) { |
450 | DRM_ERROR("mic: Failed to get clock (%s)\n", | 466 | DRM_ERROR("mic: Failed to get clock (%s)\n", |
451 | clk_names[i]); | 467 | clk_names[i]); |
@@ -454,7 +470,10 @@ int exynos_mic_probe(struct platform_device *pdev) | |||
454 | } | 470 | } |
455 | } | 471 | } |
456 | 472 | ||
473 | platform_set_drvdata(pdev, mic); | ||
474 | |||
457 | DRM_DEBUG_KMS("MIC has been probed\n"); | 475 | DRM_DEBUG_KMS("MIC has been probed\n"); |
476 | return component_add(dev, &exynos_mic_component_ops); | ||
458 | 477 | ||
459 | err: | 478 | err: |
460 | return ret; | 479 | return ret; |
@@ -462,14 +481,7 @@ err: | |||
462 | 481 | ||
463 | static int exynos_mic_remove(struct platform_device *pdev) | 482 | static int exynos_mic_remove(struct platform_device *pdev) |
464 | { | 483 | { |
465 | struct exynos_mic *mic = platform_get_drvdata(pdev); | 484 | component_del(&pdev->dev, &exynos_mic_component_ops); |
466 | int i; | ||
467 | |||
468 | drm_bridge_remove(&mic->bridge); | ||
469 | |||
470 | for (i = NUM_CLKS - 1; i > -1; i--) | ||
471 | clk_put(mic->clks[i]); | ||
472 | |||
473 | return 0; | 485 | return 0; |
474 | } | 486 | } |
475 | 487 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index bea0f7826d30..ce59f4443394 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c | |||
@@ -754,7 +754,7 @@ static int rotator_probe(struct platform_device *pdev) | |||
754 | goto err_ippdrv_register; | 754 | goto err_ippdrv_register; |
755 | } | 755 | } |
756 | 756 | ||
757 | DRM_DEBUG_KMS("ippdrv[0x%x]\n", (int)ippdrv); | 757 | DRM_DEBUG_KMS("ippdrv[%p]\n", ippdrv); |
758 | 758 | ||
759 | platform_set_drvdata(pdev, rot); | 759 | platform_set_drvdata(pdev, rot); |
760 | 760 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 62ac4e5fa51d..b605bd7395ec 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -223,7 +223,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work) | |||
223 | } | 223 | } |
224 | } | 224 | } |
225 | 225 | ||
226 | static int vidi_show_connection(struct device *dev, | 226 | static ssize_t vidi_show_connection(struct device *dev, |
227 | struct device_attribute *attr, char *buf) | 227 | struct device_attribute *attr, char *buf) |
228 | { | 228 | { |
229 | struct vidi_context *ctx = dev_get_drvdata(dev); | 229 | struct vidi_context *ctx = dev_get_drvdata(dev); |
@@ -238,7 +238,7 @@ static int vidi_show_connection(struct device *dev, | |||
238 | return rc; | 238 | return rc; |
239 | } | 239 | } |
240 | 240 | ||
241 | static int vidi_store_connection(struct device *dev, | 241 | static ssize_t vidi_store_connection(struct device *dev, |
242 | struct device_attribute *attr, | 242 | struct device_attribute *attr, |
243 | const char *buf, size_t len) | 243 | const char *buf, size_t len) |
244 | { | 244 | { |
@@ -294,7 +294,9 @@ int vidi_connection_ioctl(struct drm_device *drm_dev, void *data, | |||
294 | } | 294 | } |
295 | 295 | ||
296 | if (vidi->connection) { | 296 | if (vidi->connection) { |
297 | struct edid *raw_edid = (struct edid *)(uint32_t)vidi->edid; | 297 | struct edid *raw_edid; |
298 | |||
299 | raw_edid = (struct edid *)(unsigned long)vidi->edid; | ||
298 | if (!drm_edid_is_valid(raw_edid)) { | 300 | if (!drm_edid_is_valid(raw_edid)) { |
299 | DRM_DEBUG_KMS("edid data is invalid.\n"); | 301 | DRM_DEBUG_KMS("edid data is invalid.\n"); |
300 | return -EINVAL; | 302 | return -EINVAL; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 24be27d3cd18..20935eb2a09e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -635,10 +635,6 @@ nouveau_display_resume(struct drm_device *dev, bool runtime) | |||
635 | nv_crtc->lut.depth = 0; | 635 | nv_crtc->lut.depth = 0; |
636 | } | 636 | } |
637 | 637 | ||
638 | /* Make sure that drm and hw vblank irqs get resumed if needed. */ | ||
639 | for (head = 0; head < dev->mode_config.num_crtc; head++) | ||
640 | drm_vblank_on(dev, head); | ||
641 | |||
642 | /* This should ensure we don't hit a locking problem when someone | 638 | /* This should ensure we don't hit a locking problem when someone |
643 | * wakes us up via a connector. We should never go into suspend | 639 | * wakes us up via a connector. We should never go into suspend |
644 | * while the display is on anyways. | 640 | * while the display is on anyways. |
@@ -648,6 +644,10 @@ nouveau_display_resume(struct drm_device *dev, bool runtime) | |||
648 | 644 | ||
649 | drm_helper_resume_force_mode(dev); | 645 | drm_helper_resume_force_mode(dev); |
650 | 646 | ||
647 | /* Make sure that drm and hw vblank irqs get resumed if needed. */ | ||
648 | for (head = 0; head < dev->mode_config.num_crtc; head++) | ||
649 | drm_vblank_on(dev, head); | ||
650 | |||
651 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | 651 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
652 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 652 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
653 | 653 | ||
diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c index 2ae8577497ca..7c2e78201ead 100644 --- a/drivers/gpu/drm/qxl/qxl_ioctl.c +++ b/drivers/gpu/drm/qxl/qxl_ioctl.c | |||
@@ -168,7 +168,8 @@ static int qxl_process_single_command(struct qxl_device *qdev, | |||
168 | cmd->command_size)) | 168 | cmd->command_size)) |
169 | return -EFAULT; | 169 | return -EFAULT; |
170 | 170 | ||
171 | reloc_info = kmalloc(sizeof(struct qxl_reloc_info) * cmd->relocs_num, GFP_KERNEL); | 171 | reloc_info = kmalloc_array(cmd->relocs_num, |
172 | sizeof(struct qxl_reloc_info), GFP_KERNEL); | ||
172 | if (!reloc_info) | 173 | if (!reloc_info) |
173 | return -ENOMEM; | 174 | return -ENOMEM; |
174 | 175 | ||
diff --git a/drivers/gpu/drm/qxl/qxl_prime.c b/drivers/gpu/drm/qxl/qxl_prime.c index 3d031b50a8fd..9f029dda1f07 100644 --- a/drivers/gpu/drm/qxl/qxl_prime.c +++ b/drivers/gpu/drm/qxl/qxl_prime.c | |||
@@ -68,5 +68,5 @@ int qxl_gem_prime_mmap(struct drm_gem_object *obj, | |||
68 | struct vm_area_struct *area) | 68 | struct vm_area_struct *area) |
69 | { | 69 | { |
70 | WARN_ONCE(1, "not implemented"); | 70 | WARN_ONCE(1, "not implemented"); |
71 | return ENOSYS; | 71 | return -ENOSYS; |
72 | } | 72 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 460c8f2989da..248c5a9fb0b6 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -276,8 +276,12 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) | |||
276 | if (rdev->irq.installed) { | 276 | if (rdev->irq.installed) { |
277 | for (i = 0; i < rdev->num_crtc; i++) { | 277 | for (i = 0; i < rdev->num_crtc; i++) { |
278 | if (rdev->pm.active_crtcs & (1 << i)) { | 278 | if (rdev->pm.active_crtcs & (1 << i)) { |
279 | rdev->pm.req_vblank |= (1 << i); | 279 | /* This can fail if a modeset is in progress */ |
280 | drm_vblank_get(rdev->ddev, i); | 280 | if (drm_vblank_get(rdev->ddev, i) == 0) |
281 | rdev->pm.req_vblank |= (1 << i); | ||
282 | else | ||
283 | DRM_DEBUG_DRIVER("crtc %d no vblank, can glitch\n", | ||
284 | i); | ||
281 | } | 285 | } |
282 | } | 286 | } |
283 | } | 287 | } |