Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+178 -93
+18 -19
drivers/gpu/drm/drm_dp_mst_topology.c
··· 1159 1159 drm_dp_put_port(port); 1160 1160 goto out; 1161 1161 } 1162 - 1163 - drm_mode_connector_set_tile_property(port->connector); 1164 - 1162 + if (port->port_num >= DP_MST_LOGICAL_PORT_0) { 1163 + port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc); 1164 + drm_mode_connector_set_tile_property(port->connector); 1165 + } 1165 1166 (*mstb->mgr->cbs->register_connector)(port->connector); 1166 1167 } 1168 + 1167 1169 out: 1168 1170 /* put reference to this port */ 1169 1171 drm_dp_put_port(port); ··· 1190 1188 port->ddps = conn_stat->displayport_device_plug_status; 1191 1189 1192 1190 if (old_ddps != port->ddps) { 1193 - dowork = true; 1194 1191 if (port->ddps) { 1192 + dowork = true; 1195 1193 } else { 1196 1194 port->available_pbn = 0; 1197 1195 } ··· 1296 1294 if (port->input) 1297 1295 continue; 1298 1296 1299 - if (!port->ddps) { 1300 - if (port->cached_edid) { 1301 - kfree(port->cached_edid); 1302 - port->cached_edid = NULL; 1303 - } 1297 + if (!port->ddps) 1304 1298 continue; 1305 - } 1306 1299 1307 1300 if (!port->available_pbn) 1308 1301 drm_dp_send_enum_path_resources(mgr, mstb, port); ··· 1307 1310 if (mstb_child) { 1308 1311 drm_dp_check_and_send_link_address(mgr, mstb_child); 1309 1312 drm_dp_put_mst_branch_device(mstb_child); 1310 - } 1311 - } else if (port->pdt == DP_PEER_DEVICE_SST_SINK || 1312 - port->pdt == DP_PEER_DEVICE_DP_LEGACY_CONV) { 1313 - if (!port->cached_edid) { 1314 - port->cached_edid = 1315 - drm_get_edid(port->connector, &port->aux.ddc); 1316 1313 } 1317 1314 } 1318 1315 } ··· 1327 1336 drm_dp_check_and_send_link_address(mgr, mstb); 1328 1337 drm_dp_put_mst_branch_device(mstb); 1329 1338 } 1330 - 1331 - (*mgr->cbs->hotplug)(mgr); 1332 1339 } 1333 1340 1334 1341 static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr, ··· 1586 1597 for (i = 0; i < txmsg->reply.u.link_addr.nports; i++) { 1587 1598 drm_dp_add_port(mstb, mgr->dev, &txmsg->reply.u.link_addr.ports[i]); 1588 1599 } 1600 + (*mgr->cbs->hotplug)(mgr); 1589 1601 } 1590 1602 } else { 1591 1603 mstb->link_address_sent = false; ··· 2283 2293 drm_dp_update_port(mstb, &msg.u.conn_stat); 2284 2294 2285 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); 2296 + (*mgr->cbs->hotplug)(mgr); 2297 + 2286 2298 } else if (msg.req_type == DP_RESOURCE_STATUS_NOTIFY) { 2287 2299 drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false); 2288 2300 if (!mstb) ··· 2371 2379 2372 2380 case DP_PEER_DEVICE_SST_SINK: 2373 2381 status = connector_status_connected; 2382 + /* for logical ports - cache the EDID */ 2383 + if (port->port_num >= 8 && !port->cached_edid) { 2384 + port->cached_edid = drm_get_edid(connector, &port->aux.ddc); 2385 + } 2374 2386 break; 2375 2387 case DP_PEER_DEVICE_DP_LEGACY_CONV: 2376 2388 if (port->ldps) ··· 2429 2433 2430 2434 if (port->cached_edid) 2431 2435 edid = drm_edid_duplicate(port->cached_edid); 2432 - 2436 + else { 2437 + edid = drm_get_edid(connector, &port->aux.ddc); 2438 + drm_mode_connector_set_tile_property(connector); 2439 + } 2433 2440 port->has_audio = drm_detect_monitor_audio(edid); 2434 2441 drm_dp_put_port(port); 2435 2442 return edid;
+70 -3
drivers/gpu/drm/drm_irq.c
··· 224 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 285 DRM_DEBUG_VBL("updating vblank count on crtc %u:" 228 286 " current=%u, diff=%u, hw=%u hw_last=%u\n", 229 287 pipe, vblank->count, diff, cur_vblank, vblank->last); ··· 1374 1316 spin_lock_irqsave(&dev->event_lock, irqflags); 1375 1317 1376 1318 spin_lock(&dev->vbl_lock); 1377 - vblank_disable_and_save(dev, pipe); 1319 + DRM_DEBUG_VBL("crtc %d, vblank enabled %d, inmodeset %d\n", 1320 + pipe, vblank->enabled, vblank->inmodeset); 1321 + 1322 + /* Avoid redundant vblank disables without previous drm_vblank_on(). */ 1323 + if (drm_core_check_feature(dev, DRIVER_ATOMIC) || !vblank->inmodeset) 1324 + vblank_disable_and_save(dev, pipe); 1325 + 1378 1326 wake_up(&vblank->queue); 1379 1327 1380 1328 /* ··· 1482 1418 return; 1483 1419 1484 1420 spin_lock_irqsave(&dev->vbl_lock, irqflags); 1421 + DRM_DEBUG_VBL("crtc %d, vblank enabled %d, inmodeset %d\n", 1422 + pipe, vblank->enabled, vblank->inmodeset); 1423 + 1485 1424 /* Drop our private "prevent drm_vblank_get" refcount */ 1486 1425 if (vblank->inmodeset) { 1487 1426 atomic_dec(&vblank->refcount); ··· 1497 1430 * re-enable interrupts if there are users left, or the 1498 1431 * user wishes vblank interrupts to be enabled all the time. 1499 1432 */ 1500 - if (atomic_read(&vblank->refcount) != 0 || 1501 - (!dev->vblank_disable_immediate && drm_vblank_offdelay == 0)) 1433 + if (atomic_read(&vblank->refcount) != 0 || drm_vblank_offdelay == 0) 1502 1434 WARN_ON(drm_vblank_enable(dev, pipe)); 1503 1435 spin_unlock_irqrestore(&dev->vbl_lock, irqflags); 1504 1436 } ··· 1592 1526 if (vblank->inmodeset) { 1593 1527 spin_lock_irqsave(&dev->vbl_lock, irqflags); 1594 1528 dev->vblank_disable_allowed = true; 1529 + drm_reset_vblank_timestamp(dev, pipe); 1595 1530 spin_unlock_irqrestore(&dev->vbl_lock, irqflags); 1596 1531 1597 1532 if (vblank->inmodeset & 0x2)
+1 -1
drivers/gpu/drm/exynos/Kconfig
··· 1 1 config DRM_EXYNOS 2 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 4 select DRM_KMS_HELPER 5 5 select DRM_KMS_FB_HELPER 6 6 select FB_CFB_FILLRECT
+3 -5
drivers/gpu/drm/exynos/exynos5433_drm_decon.c
··· 93 93 if (test_bit(BIT_SUSPENDED, &ctx->flags)) 94 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 97 val = VIDINTCON0_INTEN; 98 98 if (ctx->out_type == IFTYPE_I80) 99 99 val |= VIDINTCON0_FRAMEDONE; ··· 402 402 decon_enable_vblank(ctx->crtc); 403 403 404 404 decon_commit(ctx->crtc); 405 - 406 - set_bit(BIT_SUSPENDED, &ctx->flags); 407 405 } 408 406 409 407 static void decon_disable(struct exynos_drm_crtc *crtc) ··· 580 582 static int exynos5433_decon_suspend(struct device *dev) 581 583 { 582 584 struct decon_context *ctx = dev_get_drvdata(dev); 583 - int i; 585 + int i = ARRAY_SIZE(decon_clks_name); 584 586 585 - for (i = 0; i < ARRAY_SIZE(decon_clks_name); i++) 587 + while (--i >= 0) 586 588 clk_disable_unprepare(ctx->clks[i]); 587 589 588 590 return 0;
+1
drivers/gpu/drm/exynos/exynos_drm_dsi.c
··· 1782 1782 1783 1783 bridge = of_drm_find_bridge(dsi->bridge_node); 1784 1784 if (bridge) { 1785 + encoder->bridge = bridge; 1785 1786 drm_bridge_attach(drm_dev, bridge); 1786 1787 } 1787 1788
+1 -1
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
··· 50 50 if (vm_size > exynos_gem->size) 51 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 54 exynos_gem->dma_addr, exynos_gem->size, 55 55 &exynos_gem->dma_attrs); 56 56 if (ret < 0) {
+1 -1
drivers/gpu/drm/exynos/exynos_drm_fimc.c
··· 1723 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 1728 spin_lock_init(&ctx->lock); 1729 1729 platform_set_drvdata(pdev, ctx);
+3 -2
drivers/gpu/drm/exynos/exynos_drm_g2d.c
··· 1166 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 1171 if (copy_from_user(cmdlist->data + cmdlist->last, 1172 1172 (void __user *)cmd, ··· 1184 1184 if (req->cmd_buf_nr) { 1185 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 1190 if (copy_from_user(cmdlist->data + cmdlist->last, 1190 1191 (void __user *)cmd_buf,
+2 -2
drivers/gpu/drm/exynos/exynos_drm_gem.c
··· 218 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 223 return exynos_gem; 224 224 } ··· 335 335 if (vm_size > exynos_gem->size) 336 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 339 exynos_gem->dma_addr, exynos_gem->size, 340 340 &exynos_gem->dma_attrs); 341 341 if (ret < 0) {
+1 -1
drivers/gpu/drm/exynos/exynos_drm_gsc.c
··· 1723 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 1728 mutex_init(&ctx->lock); 1729 1729 platform_set_drvdata(pdev, ctx);
+16 -16
drivers/gpu/drm/exynos/exynos_drm_ipp.c
··· 208 208 * e.g PAUSE state, queue buf, command control. 209 209 */ 210 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 213 mutex_lock(&ippdrv->cmd_lock); 214 214 list_for_each_entry(c_node, &ippdrv->cmd_list, list) { ··· 388 388 } 389 389 property->prop_id = ret; 390 390 391 - DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[0x%x]\n", 392 - property->prop_id, property->cmd, (int)ippdrv); 391 + DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[%p]\n", 392 + property->prop_id, property->cmd, ippdrv); 393 393 394 394 /* stored property information and ippdrv in private data */ 395 395 c_node->property = *property; ··· 518 518 { 519 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 523 if (!m_node) { 524 524 DRM_ERROR("invalid dequeue node.\n"); ··· 562 562 m_node->buf_id = qbuf->buf_id; 563 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 566 DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]\n", qbuf->prop_id, m_node->buf_id); 567 567 568 568 for_each_ipp_planar(i) { ··· 582 582 583 583 buf_info->handles[i] = qbuf->handle[i]; 584 584 buf_info->base[i] = *addr; 585 - DRM_DEBUG_KMS("i[%d]base[0x%x]hd[0x%lx]\n", i, 586 - buf_info->base[i], buf_info->handles[i]); 585 + DRM_DEBUG_KMS("i[%d]base[%pad]hd[0x%lx]\n", i, 586 + &buf_info->base[i], buf_info->handles[i]); 587 587 } 588 588 } 589 589 ··· 664 664 665 665 mutex_lock(&c_node->event_lock); 666 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 670 * qbuf == NULL condition means all event deletion. ··· 755 755 756 756 /* find memory node from memory list */ 757 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 760 /* compare buffer id */ 761 761 if (m_node->buf_id == qbuf->buf_id) ··· 772 772 struct exynos_drm_ipp_ops *ops = NULL; 773 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 777 if (!m_node) { 778 778 DRM_ERROR("invalid queue node.\n"); ··· 1237 1237 m_node = list_first_entry(head, 1238 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 1242 ret = ipp_set_mem_node(ippdrv, c_node, m_node); 1243 1243 if (ret) { ··· 1610 1610 } 1611 1611 ippdrv->prop_list.ipp_id = ret; 1612 1612 1613 - DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]ipp_id[%d]\n", 1614 - count++, (int)ippdrv, ret); 1613 + DRM_DEBUG_KMS("count[%d]ippdrv[%p]ipp_id[%d]\n", 1614 + count++, ippdrv, ret); 1615 1615 1616 1616 /* store parent device for node */ 1617 1617 ippdrv->parent_dev = dev; ··· 1668 1668 1669 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 1673 return 0; 1674 1674 } ··· 1685 1685 mutex_lock(&ippdrv->cmd_lock); 1686 1686 list_for_each_entry_safe(c_node, tc_node, 1687 1687 &ippdrv->cmd_list, list) { 1688 - DRM_DEBUG_KMS("count[%d]ippdrv[0x%x]\n", 1689 - count++, (int)ippdrv); 1688 + DRM_DEBUG_KMS("count[%d]ippdrv[%p]\n", 1689 + count++, ippdrv); 1690 1690 1691 1691 if (c_node->filp == file) { 1692 1692 /*
+42 -30
drivers/gpu/drm/exynos/exynos_drm_mic.c
··· 18 18 #include <linux/of.h> 19 19 #include <linux/of_graph.h> 20 20 #include <linux/clk.h> 21 + #include <linux/component.h> 21 22 #include <drm/drmP.h> 22 23 #include <linux/mfd/syscon.h> 23 24 #include <linux/regmap.h> ··· 307 306 return ret; 308 307 } 309 308 310 - void mic_disable(struct drm_bridge *bridge) { } 309 + static void mic_disable(struct drm_bridge *bridge) { } 311 310 312 - void mic_post_disable(struct drm_bridge *bridge) 311 + static void mic_post_disable(struct drm_bridge *bridge) 313 312 { 314 313 struct exynos_mic *mic = bridge->driver_private; 315 314 int i; ··· 329 328 mutex_unlock(&mic_mutex); 330 329 } 331 330 332 - void mic_pre_enable(struct drm_bridge *bridge) 331 + static void mic_pre_enable(struct drm_bridge *bridge) 333 332 { 334 333 struct exynos_mic *mic = bridge->driver_private; 335 334 int ret, i; ··· 372 371 mutex_unlock(&mic_mutex); 373 372 } 374 373 375 - void mic_enable(struct drm_bridge *bridge) { } 374 + static void mic_enable(struct drm_bridge *bridge) { } 376 375 377 - void mic_destroy(struct drm_bridge *bridge) 376 + static const struct drm_bridge_funcs mic_bridge_funcs = { 377 + .disable = mic_disable, 378 + .post_disable = mic_post_disable, 379 + .pre_enable = mic_pre_enable, 380 + .enable = mic_enable, 381 + }; 382 + 383 + static int exynos_mic_bind(struct device *dev, struct device *master, 384 + void *data) 378 385 { 379 - struct exynos_mic *mic = bridge->driver_private; 386 + struct exynos_mic *mic = dev_get_drvdata(dev); 387 + int ret; 388 + 389 + mic->bridge.funcs = &mic_bridge_funcs; 390 + mic->bridge.of_node = dev->of_node; 391 + mic->bridge.driver_private = mic; 392 + ret = drm_bridge_add(&mic->bridge); 393 + if (ret) 394 + DRM_ERROR("mic: Failed to add MIC to the global bridge list\n"); 395 + 396 + return ret; 397 + } 398 + 399 + static void exynos_mic_unbind(struct device *dev, struct device *master, 400 + void *data) 401 + { 402 + struct exynos_mic *mic = dev_get_drvdata(dev); 380 403 int i; 381 404 382 405 mutex_lock(&mic_mutex); ··· 412 387 413 388 already_disabled: 414 389 mutex_unlock(&mic_mutex); 390 + 391 + drm_bridge_remove(&mic->bridge); 415 392 } 416 393 417 - static const struct drm_bridge_funcs mic_bridge_funcs = { 418 - .disable = mic_disable, 419 - .post_disable = mic_post_disable, 420 - .pre_enable = mic_pre_enable, 421 - .enable = mic_enable, 394 + static const struct component_ops exynos_mic_component_ops = { 395 + .bind = exynos_mic_bind, 396 + .unbind = exynos_mic_unbind, 422 397 }; 423 398 424 - int exynos_mic_probe(struct platform_device *pdev) 399 + static int exynos_mic_probe(struct platform_device *pdev) 425 400 { 426 401 struct device *dev = &pdev->dev; 427 402 struct exynos_mic *mic; ··· 460 435 goto err; 461 436 } 462 437 463 - mic->bridge.funcs = &mic_bridge_funcs; 464 - mic->bridge.of_node = dev->of_node; 465 - mic->bridge.driver_private = mic; 466 - ret = drm_bridge_add(&mic->bridge); 467 - if (ret) { 468 - DRM_ERROR("mic: Failed to add MIC to the global bridge list\n"); 469 - goto err; 470 - } 471 - 472 438 for (i = 0; i < NUM_CLKS; i++) { 473 - mic->clks[i] = of_clk_get_by_name(dev->of_node, clk_names[i]); 439 + mic->clks[i] = devm_clk_get(dev, clk_names[i]); 474 440 if (IS_ERR(mic->clks[i])) { 475 441 DRM_ERROR("mic: Failed to get clock (%s)\n", 476 442 clk_names[i]); ··· 470 454 } 471 455 } 472 456 457 + platform_set_drvdata(pdev, mic); 458 + 473 459 DRM_DEBUG_KMS("MIC has been probed\n"); 460 + return component_add(dev, &exynos_mic_component_ops); 474 461 475 462 err: 476 463 return ret; ··· 481 462 482 463 static int exynos_mic_remove(struct platform_device *pdev) 483 464 { 484 - struct exynos_mic *mic = platform_get_drvdata(pdev); 485 - int i; 486 - 487 - drm_bridge_remove(&mic->bridge); 488 - 489 - for (i = NUM_CLKS - 1; i > -1; i--) 490 - clk_put(mic->clks[i]); 491 - 465 + component_del(&pdev->dev, &exynos_mic_component_ops); 492 466 return 0; 493 467 } 494 468
+1 -1
drivers/gpu/drm/exynos/exynos_drm_rotator.c
··· 754 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 759 platform_set_drvdata(pdev, rot); 760 760
+5 -3
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 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 227 struct device_attribute *attr, char *buf) 228 228 { 229 229 struct vidi_context *ctx = dev_get_drvdata(dev); ··· 238 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 242 struct device_attribute *attr, 243 243 const char *buf, size_t len) 244 244 { ··· 294 294 } 295 295 296 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 300 if (!drm_edid_is_valid(raw_edid)) { 299 301 DRM_DEBUG_KMS("edid data is invalid.\n"); 300 302 return -EINVAL;
+4 -4
drivers/gpu/drm/nouveau/nouveau_display.c
··· 635 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 638 /* This should ensure we don't hit a locking problem when someone 643 639 * wakes us up via a connector. We should never go into suspend 644 640 * while the display is on anyways. ··· 643 647 return; 644 648 645 649 drm_helper_resume_force_mode(dev); 650 + 651 + /* Make sure that drm and hw vblank irqs get resumed if needed. */ 652 + for (head = 0; head < dev->mode_config.num_crtc; head++) 653 + drm_vblank_on(dev, head); 646 654 647 655 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 648 656 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
+2 -1
drivers/gpu/drm/qxl/qxl_ioctl.c
··· 168 168 cmd->command_size)) 169 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 173 if (!reloc_info) 173 174 return -ENOMEM; 174 175
+1 -1
drivers/gpu/drm/qxl/qxl_prime.c
··· 68 68 struct vm_area_struct *area) 69 69 { 70 70 WARN_ONCE(1, "not implemented"); 71 - return ENOSYS; 71 + return -ENOSYS; 72 72 }
+6 -2
drivers/gpu/drm/radeon/radeon_pm.c
··· 276 276 if (rdev->irq.installed) { 277 277 for (i = 0; i < rdev->num_crtc; i++) { 278 278 if (rdev->pm.active_crtcs & (1 << i)) { 279 - rdev->pm.req_vblank |= (1 << i); 280 - drm_vblank_get(rdev->ddev, i); 279 + /* This can fail if a modeset is in progress */ 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 }