]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm: rcar-du: Set primary plane zpos immutably at initializing
authorTomohito Esaki <etom@igel.co.jp>
Wed, 1 Apr 2020 06:11:00 +0000 (15:11 +0900)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 13 May 2020 23:10:52 +0000 (02:10 +0300)
According to drm_plane_create_zpos_property() function documentation,
all planes zpos range should be set if zpos property is supported.
However, the rcar-du driver didn't set primary plane zpos range. Since
the primary plane's zpos is fixed, set it immutably.

Reported-by: Yoshihito Ogawa <yoshihito.ogawa.kc@renesas.com>
Reported-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
[Turn continue into if ... else ...]
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
drivers/gpu/drm/rcar-du/rcar_du_plane.c
drivers/gpu/drm/rcar-du/rcar_du_vsp.c

index c6430027169fc8a0daa6973876bfe7c52dab6376..a0021fc25b27c12054b5fd29bfbcc9e9a8f9b164 100644 (file)
@@ -785,13 +785,15 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp)
 
                drm_plane_create_alpha_property(&plane->plane);
 
-               if (type == DRM_PLANE_TYPE_PRIMARY)
-                       continue;
-
-               drm_object_attach_property(&plane->plane.base,
-                                          rcdu->props.colorkey,
-                                          RCAR_DU_COLORKEY_NONE);
-               drm_plane_create_zpos_property(&plane->plane, 1, 1, 7);
+               if (type == DRM_PLANE_TYPE_PRIMARY) {
+                       drm_plane_create_zpos_immutable_property(&plane->plane,
+                                                                0);
+               } else {
+                       drm_object_attach_property(&plane->plane.base,
+                                                  rcdu->props.colorkey,
+                                                  RCAR_DU_COLORKEY_NONE);
+                       drm_plane_create_zpos_property(&plane->plane, 1, 1, 7);
+               }
        }
 
        return 0;
index 5e4faf258c31a6b9042a4c47958449469348da3b..f1a81c9b184d4c427b2de1df4ac588e966c92142 100644 (file)
@@ -392,12 +392,14 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp, struct device_node *np,
                drm_plane_helper_add(&plane->plane,
                                     &rcar_du_vsp_plane_helper_funcs);
 
-               if (type == DRM_PLANE_TYPE_PRIMARY)
-                       continue;
-
-               drm_plane_create_alpha_property(&plane->plane);
-               drm_plane_create_zpos_property(&plane->plane, 1, 1,
-                                              vsp->num_planes - 1);
+               if (type == DRM_PLANE_TYPE_PRIMARY) {
+                       drm_plane_create_zpos_immutable_property(&plane->plane,
+                                                                0);
+               } else {
+                       drm_plane_create_alpha_property(&plane->plane);
+                       drm_plane_create_zpos_property(&plane->plane, 1, 1,
+                                                      vsp->num_planes - 1);
+               }
        }
 
        return 0;