From 0ab17499b18f4b990600be177058957ab1681808 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 2 Jul 2018 17:27:46 +0100 Subject: drm/armada: add drm_atomic_helper_shutdown() call in tear-down Ensure that the hardware is disabled prior to tearing down the modeset support. Signed-off-by: Russell King --- drivers/gpu/drm/armada/armada_drv.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/gpu/drm/armada/armada_drv.c') diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index e660c5ca52ae..e524bfff1c49 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -171,6 +171,8 @@ static void armada_drm_unbind(struct device *dev) drm_dev_unregister(&priv->drm); + drm_atomic_helper_shutdown(&priv->drm); + component_unbind_all(dev, &priv->drm); drm_mode_config_cleanup(&priv->drm); -- cgit v1.2.3 From f54a5990c32978dcb84ef1d38d22457bf3129797 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 21 Jan 2019 07:01:57 +0100 Subject: drm/armada: replace the simple-framebuffer If there's a simple-framebuffer carried over from boot firmware, it's going to stop working once we setup the LCDC for use via DRM. Kick it off from the hardware. Signed-off-by: Lubomir Rintel Signed-off-by: Russell King --- drivers/gpu/drm/armada/armada_drv.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/gpu/drm/armada/armada_drv.c') diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index e524bfff1c49..05fab5cb5c2d 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -100,6 +100,17 @@ static int armada_drm_bind(struct device *dev) return ret; } + /* Remove early framebuffers */ + ret = drm_fb_helper_remove_conflicting_framebuffers(NULL, + "armada-drm-fb", + false); + if (ret) { + dev_err(dev, "[" DRM_NAME ":%s] can't kick out simple-fb: %d\n", + __func__, ret); + kfree(priv); + return ret; + } + priv->drm.dev_private = priv; dev_set_drvdata(dev, &priv->drm); -- cgit v1.2.3 From 989b9a7dd4ab40eb63026754b10527bf1d03bf86 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 24 Jan 2019 09:56:46 +0000 Subject: drm/armada: use for_each_endpoint_of_node() to walk crtc endpoints Rather than having a nested set of for_each_child_of_node() walkers, use the graph walker to iterate through the endpoints for CRTCs. Signed-off-by: Russell King --- drivers/gpu/drm/armada/armada_drv.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/drm/armada/armada_drv.c') diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 05fab5cb5c2d..1cfabcd6a629 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -204,11 +204,11 @@ static int compare_dev_name(struct device *dev, void *data) } static void armada_add_endpoints(struct device *dev, - struct component_match **match, struct device_node *port) + struct component_match **match, struct device_node *dev_node) { struct device_node *ep, *remote; - for_each_child_of_node(port, ep) { + for_each_endpoint_of_node(dev_node, ep) { remote = of_graph_get_remote_port_parent(ep); if (!remote || !of_device_is_available(remote)) { of_node_put(remote); @@ -242,7 +242,6 @@ static int armada_drm_probe(struct platform_device *pdev) if (dev->platform_data) { char **devices = dev->platform_data; - struct device_node *port; struct device *d; int i; @@ -258,10 +257,8 @@ static int armada_drm_probe(struct platform_device *pdev) for (i = 0; devices[i]; i++) { d = bus_find_device_by_name(&platform_bus_type, NULL, devices[i]); - if (d && d->of_node) { - for_each_child_of_node(d->of_node, port) - armada_add_endpoints(dev, &match, port); - } + if (d && d->of_node) + armada_add_endpoints(dev, &match, d->of_node); put_device(d); } } -- cgit v1.2.3 From 837567c1e9d587c0b438263c9cfd32de46640e16 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 24 Jan 2019 14:18:17 +0000 Subject: drm/armada: no need to check parent of remote There's no need to check the parent of the remote device to check whether it is available or not, the remote is the device itself. Signed-off-by: Russell King --- drivers/gpu/drm/armada/armada_drv.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'drivers/gpu/drm/armada/armada_drv.c') diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 1cfabcd6a629..f1729398b1bd 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -210,17 +210,9 @@ static void armada_add_endpoints(struct device *dev, for_each_endpoint_of_node(dev_node, ep) { remote = of_graph_get_remote_port_parent(ep); - if (!remote || !of_device_is_available(remote)) { - of_node_put(remote); - continue; - } else if (!of_device_is_available(remote->parent)) { - dev_warn(dev, "parent device of %pOF is not available\n", - remote); - of_node_put(remote); - continue; - } - - drm_of_component_match_add(dev, match, compare_of, remote); + if (remote && of_device_is_available(remote)) + drm_of_component_match_add(dev, match, compare_of, + remote); of_node_put(remote); } } -- cgit v1.2.3