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

drm: rcar-du: Set primary plane zpos immutably at initializing

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>

authored by

Tomohito Esaki and committed by
Laurent Pinchart
7982471d 4dc55525

+17 -13
+9 -7
drivers/gpu/drm/rcar-du/rcar_du_plane.c
··· 785 785 786 786 drm_plane_create_alpha_property(&plane->plane); 787 787 788 - if (type == DRM_PLANE_TYPE_PRIMARY) 789 - continue; 790 - 791 - drm_object_attach_property(&plane->plane.base, 792 - rcdu->props.colorkey, 793 - RCAR_DU_COLORKEY_NONE); 794 - drm_plane_create_zpos_property(&plane->plane, 1, 1, 7); 788 + if (type == DRM_PLANE_TYPE_PRIMARY) { 789 + drm_plane_create_zpos_immutable_property(&plane->plane, 790 + 0); 791 + } else { 792 + drm_object_attach_property(&plane->plane.base, 793 + rcdu->props.colorkey, 794 + RCAR_DU_COLORKEY_NONE); 795 + drm_plane_create_zpos_property(&plane->plane, 1, 1, 7); 796 + } 795 797 } 796 798 797 799 return 0;
+8 -6
drivers/gpu/drm/rcar-du/rcar_du_vsp.c
··· 392 392 drm_plane_helper_add(&plane->plane, 393 393 &rcar_du_vsp_plane_helper_funcs); 394 394 395 - if (type == DRM_PLANE_TYPE_PRIMARY) 396 - continue; 397 - 398 - drm_plane_create_alpha_property(&plane->plane); 399 - drm_plane_create_zpos_property(&plane->plane, 1, 1, 400 - vsp->num_planes - 1); 395 + if (type == DRM_PLANE_TYPE_PRIMARY) { 396 + drm_plane_create_zpos_immutable_property(&plane->plane, 397 + 0); 398 + } else { 399 + drm_plane_create_alpha_property(&plane->plane); 400 + drm_plane_create_zpos_property(&plane->plane, 1, 1, 401 + vsp->num_planes - 1); 402 + } 401 403 } 402 404 403 405 return 0;