Merge branch 'linux-4.8' of git://github.com/skeggsb/linux into drm-next
[deliverable/linux.git] / drivers / gpu / drm / sti / sti_hqvdp.c
index 1c06a50fddcaa3e4c8e8f87c53b5414df53b264f..b03232247966df15d0bb0c1e8ee1a694a9f0e5ec 100644 (file)
@@ -1234,6 +1234,33 @@ static const struct drm_plane_helper_funcs sti_hqvdp_helpers_funcs = {
        .atomic_disable = sti_hqvdp_atomic_disable,
 };
 
+static void sti_hqvdp_destroy(struct drm_plane *drm_plane)
+{
+       DRM_DEBUG_DRIVER("\n");
+
+       drm_plane_helper_disable(drm_plane);
+       drm_plane_cleanup(drm_plane);
+}
+
+static int sti_hqvdp_late_register(struct drm_plane *drm_plane)
+{
+       struct sti_plane *plane = to_sti_plane(drm_plane);
+       struct sti_hqvdp *hqvdp = to_sti_hqvdp(plane);
+
+       return hqvdp_debugfs_init(hqvdp, drm_plane->dev->primary);
+}
+
+struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = {
+       .update_plane = drm_atomic_helper_update_plane,
+       .disable_plane = drm_atomic_helper_disable_plane,
+       .destroy = sti_hqvdp_destroy,
+       .set_property = sti_plane_set_property,
+       .reset = drm_atomic_helper_plane_reset,
+       .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
+       .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
+       .late_register = sti_hqvdp_late_register,
+};
+
 static struct drm_plane *sti_hqvdp_create(struct drm_device *drm_dev,
                                          struct device *dev, int desc)
 {
@@ -1246,7 +1273,7 @@ static struct drm_plane *sti_hqvdp_create(struct drm_device *drm_dev,
        sti_hqvdp_init(hqvdp);
 
        res = drm_universal_plane_init(drm_dev, &hqvdp->plane.drm_plane, 1,
-                                      &sti_plane_helpers_funcs,
+                                      &sti_hqvdp_plane_helpers_funcs,
                                       hqvdp_supported_formats,
                                       ARRAY_SIZE(hqvdp_supported_formats),
                                       DRM_PLANE_TYPE_OVERLAY, NULL);
@@ -1259,9 +1286,6 @@ static struct drm_plane *sti_hqvdp_create(struct drm_device *drm_dev,
 
        sti_plane_init_property(&hqvdp->plane, DRM_PLANE_TYPE_OVERLAY);
 
-       if (hqvdp_debugfs_init(hqvdp, drm_dev->primary))
-               DRM_ERROR("HQVDP debugfs setup failed\n");
-
        return &hqvdp->plane.drm_plane;
 }
 
@@ -1339,6 +1363,7 @@ static int sti_hqvdp_probe(struct platform_device *pdev)
        vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0);
        if (vtg_np)
                hqvdp->vtg = of_vtg_find(vtg_np);
+       of_node_put(vtg_np);
 
        platform_set_drvdata(pdev, hqvdp);
 
This page took 0.028098 seconds and 5 git commands to generate.