drm/exynos: set cursor plane in exynos_drm_crtc_init
authorAndrzej Hajda <a.hajda@samsung.com>
Wed, 20 Mar 2019 12:47:52 +0000 (13:47 +0100)
committerAndrzej Hajda <a.hajda@samsung.com>
Wed, 20 Mar 2019 12:52:04 +0000 (13:52 +0100)
The patch configures cursor plane in exynos_drm_crtc_init.
Since Exynos DRM does not support fast/async path for cursor update,
it must be disabled.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_fb.c

index ec1319781b8bb5430ce7d9041a777ce29a387301..303df018f0a1eafbac009d09b0de3cc2f425cfdb 100644 (file)
@@ -176,17 +176,19 @@ int exynos_drm_crtc_init(struct exynos_drm_crtc *exynos_crtc,
                         struct drm_device *drm_dev)
 {
        struct drm_crtc *crtc = &exynos_crtc->base;
-       struct drm_plane *primary = NULL, *plane;
+       struct drm_plane *primary = NULL, *cursor = NULL, *plane;
 
        drm_for_each_plane(plane, drm_dev) {
                if (plane->possible_crtcs != BIT(drm_dev->mode_config.num_crtc))
                        continue;
                if (!primary && plane->type == DRM_PLANE_TYPE_PRIMARY)
                        primary = plane;
+               if (!cursor && plane->type == DRM_PLANE_TYPE_CURSOR)
+                       cursor = plane;
        }
 
        drm_crtc_helper_add(crtc, &exynos_crtc_helper_funcs);
-       return drm_crtc_init_with_planes(drm_dev, crtc, primary, NULL,
+       return drm_crtc_init_with_planes(drm_dev, crtc, primary, cursor,
                                         &exynos_crtc_funcs, NULL);
 }
 
index 1f11ab0f8e9daffdaecc04f6b1ace3d799652145..d705e363f7039811188cbdf7382c5b56beedbe3c 100644 (file)
@@ -155,11 +155,19 @@ static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = {
        .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
 };
 
+int exynos_drm_atomic_helper_commit(struct drm_device *dev,
+                                   struct drm_atomic_state *state,
+                                   bool nonblock)
+{
+       state->legacy_cursor_update = false;
+       return drm_atomic_helper_commit(dev, state, nonblock);
+}
+
 static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
        .fb_create = exynos_user_fb_create,
        .output_poll_changed = drm_fb_helper_output_poll_changed,
        .atomic_check = drm_atomic_helper_check,
-       .atomic_commit = drm_atomic_helper_commit,
+       .atomic_commit = exynos_drm_atomic_helper_commit,
 };
 
 void exynos_drm_mode_config_init(struct drm_device *dev)