Commit 7982471d authored by Tomohito Esaki's avatar Tomohito Esaki Committed by Laurent Pinchart
Browse files

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: default avatarYoshihito Ogawa <yoshihito.ogawa.kc@renesas.com>
Reported-by: default avatarKoji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: default avatarTomohito Esaki <etom@igel.co.jp>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarDaniel Stone <daniels@collabora.com>
[Turn continue into if ... else ...]
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
parent 4dc55525
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -785,14 +785,16 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp)

		drm_plane_create_alpha_property(&plane->plane);

		if (type == DRM_PLANE_TYPE_PRIMARY)
			continue;

		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;
}
+8 −6
Original line number Diff line number Diff line
@@ -392,13 +392,15 @@ 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;

		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;
}