diff options
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_plane.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_plane.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 14 |
6 files changed, 8 insertions, 25 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index e39fcef2e033..7316fc7fa0bd 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c | |||
@@ -196,7 +196,7 @@ void rcar_du_crtc_route_output(struct drm_crtc *crtc, | |||
196 | 196 | ||
197 | static unsigned int plane_zpos(struct rcar_du_plane *plane) | 197 | static unsigned int plane_zpos(struct rcar_du_plane *plane) |
198 | { | 198 | { |
199 | return to_rcar_plane_state(plane->plane.state)->zpos; | 199 | return plane->plane.state->normalized_zpos; |
200 | } | 200 | } |
201 | 201 | ||
202 | static const struct rcar_du_format_info * | 202 | static const struct rcar_du_format_info * |
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h b/drivers/gpu/drm/rcar-du/rcar_du_drv.h index ed35467d96cf..c843c3134498 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h | |||
@@ -92,7 +92,6 @@ struct rcar_du_device { | |||
92 | struct { | 92 | struct { |
93 | struct drm_property *alpha; | 93 | struct drm_property *alpha; |
94 | struct drm_property *colorkey; | 94 | struct drm_property *colorkey; |
95 | struct drm_property *zpos; | ||
96 | } props; | 95 | } props; |
97 | 96 | ||
98 | unsigned int dpad0_source; | 97 | unsigned int dpad0_source; |
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 6bb032d8ac6b..f03eb55318c1 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c | |||
@@ -527,11 +527,6 @@ static int rcar_du_properties_init(struct rcar_du_device *rcdu) | |||
527 | if (rcdu->props.colorkey == NULL) | 527 | if (rcdu->props.colorkey == NULL) |
528 | return -ENOMEM; | 528 | return -ENOMEM; |
529 | 529 | ||
530 | rcdu->props.zpos = | ||
531 | drm_property_create_range(rcdu->ddev, 0, "zpos", 1, 7); | ||
532 | if (rcdu->props.zpos == NULL) | ||
533 | return -ENOMEM; | ||
534 | |||
535 | return 0; | 530 | return 0; |
536 | } | 531 | } |
537 | 532 | ||
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index bfe31ca870cc..a74f8ed8ca2e 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c | |||
@@ -652,7 +652,7 @@ static void rcar_du_plane_reset(struct drm_plane *plane) | |||
652 | state->source = RCAR_DU_PLANE_MEMORY; | 652 | state->source = RCAR_DU_PLANE_MEMORY; |
653 | state->alpha = 255; | 653 | state->alpha = 255; |
654 | state->colorkey = RCAR_DU_COLORKEY_NONE; | 654 | state->colorkey = RCAR_DU_COLORKEY_NONE; |
655 | state->zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; | 655 | state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; |
656 | 656 | ||
657 | plane->state = &state->state; | 657 | plane->state = &state->state; |
658 | plane->state->plane = plane; | 658 | plane->state->plane = plane; |
@@ -670,8 +670,6 @@ static int rcar_du_plane_atomic_set_property(struct drm_plane *plane, | |||
670 | rstate->alpha = val; | 670 | rstate->alpha = val; |
671 | else if (property == rcdu->props.colorkey) | 671 | else if (property == rcdu->props.colorkey) |
672 | rstate->colorkey = val; | 672 | rstate->colorkey = val; |
673 | else if (property == rcdu->props.zpos) | ||
674 | rstate->zpos = val; | ||
675 | else | 673 | else |
676 | return -EINVAL; | 674 | return -EINVAL; |
677 | 675 | ||
@@ -690,8 +688,6 @@ static int rcar_du_plane_atomic_get_property(struct drm_plane *plane, | |||
690 | *val = rstate->alpha; | 688 | *val = rstate->alpha; |
691 | else if (property == rcdu->props.colorkey) | 689 | else if (property == rcdu->props.colorkey) |
692 | *val = rstate->colorkey; | 690 | *val = rstate->colorkey; |
693 | else if (property == rcdu->props.zpos) | ||
694 | *val = rstate->zpos; | ||
695 | else | 691 | else |
696 | return -EINVAL; | 692 | return -EINVAL; |
697 | 693 | ||
@@ -763,8 +759,7 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp) | |||
763 | drm_object_attach_property(&plane->plane.base, | 759 | drm_object_attach_property(&plane->plane.base, |
764 | rcdu->props.colorkey, | 760 | rcdu->props.colorkey, |
765 | RCAR_DU_COLORKEY_NONE); | 761 | RCAR_DU_COLORKEY_NONE); |
766 | drm_object_attach_property(&plane->plane.base, | 762 | drm_plane_create_zpos_property(&plane->plane, 1, 1, 7); |
767 | rcdu->props.zpos, 1); | ||
768 | } | 763 | } |
769 | 764 | ||
770 | return 0; | 765 | return 0; |
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.h b/drivers/gpu/drm/rcar-du/rcar_du_plane.h index b18b7b25dbfa..8b91dd3a46e4 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.h | |||
@@ -51,7 +51,6 @@ static inline struct rcar_du_plane *to_rcar_plane(struct drm_plane *plane) | |||
51 | * @hwindex: 0-based hardware plane index, -1 means unused | 51 | * @hwindex: 0-based hardware plane index, -1 means unused |
52 | * @alpha: value of the plane alpha property | 52 | * @alpha: value of the plane alpha property |
53 | * @colorkey: value of the plane colorkey property | 53 | * @colorkey: value of the plane colorkey property |
54 | * @zpos: value of the plane zpos property | ||
55 | */ | 54 | */ |
56 | struct rcar_du_plane_state { | 55 | struct rcar_du_plane_state { |
57 | struct drm_plane_state state; | 56 | struct drm_plane_state state; |
@@ -62,7 +61,6 @@ struct rcar_du_plane_state { | |||
62 | 61 | ||
63 | unsigned int alpha; | 62 | unsigned int alpha; |
64 | unsigned int colorkey; | 63 | unsigned int colorkey; |
65 | unsigned int zpos; | ||
66 | }; | 64 | }; |
67 | 65 | ||
68 | static inline struct rcar_du_plane_state * | 66 | static inline struct rcar_du_plane_state * |
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c index 6ac717f2056f..83ebd162f3ef 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c | |||
@@ -43,12 +43,12 @@ void rcar_du_vsp_enable(struct rcar_du_crtc *crtc) | |||
43 | .src_y = 0, | 43 | .src_y = 0, |
44 | .src_w = mode->hdisplay << 16, | 44 | .src_w = mode->hdisplay << 16, |
45 | .src_h = mode->vdisplay << 16, | 45 | .src_h = mode->vdisplay << 16, |
46 | .zpos = 0, | ||
46 | }, | 47 | }, |
47 | .format = rcar_du_format_info(DRM_FORMAT_ARGB8888), | 48 | .format = rcar_du_format_info(DRM_FORMAT_ARGB8888), |
48 | .source = RCAR_DU_PLANE_VSPD1, | 49 | .source = RCAR_DU_PLANE_VSPD1, |
49 | .alpha = 255, | 50 | .alpha = 255, |
50 | .colorkey = 0, | 51 | .colorkey = 0, |
51 | .zpos = 0, | ||
52 | }; | 52 | }; |
53 | 53 | ||
54 | if (rcdu->info->gen >= 3) | 54 | if (rcdu->info->gen >= 3) |
@@ -152,7 +152,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane) | |||
152 | .pixelformat = 0, | 152 | .pixelformat = 0, |
153 | .pitch = fb->pitches[0], | 153 | .pitch = fb->pitches[0], |
154 | .alpha = state->alpha, | 154 | .alpha = state->alpha, |
155 | .zpos = state->zpos, | 155 | .zpos = state->state.zpos, |
156 | }; | 156 | }; |
157 | unsigned int i; | 157 | unsigned int i; |
158 | 158 | ||
@@ -267,7 +267,7 @@ static void rcar_du_vsp_plane_reset(struct drm_plane *plane) | |||
267 | return; | 267 | return; |
268 | 268 | ||
269 | state->alpha = 255; | 269 | state->alpha = 255; |
270 | state->zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; | 270 | state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1; |
271 | 271 | ||
272 | plane->state = &state->state; | 272 | plane->state = &state->state; |
273 | plane->state->plane = plane; | 273 | plane->state->plane = plane; |
@@ -282,8 +282,6 @@ static int rcar_du_vsp_plane_atomic_set_property(struct drm_plane *plane, | |||
282 | 282 | ||
283 | if (property == rcdu->props.alpha) | 283 | if (property == rcdu->props.alpha) |
284 | rstate->alpha = val; | 284 | rstate->alpha = val; |
285 | else if (property == rcdu->props.zpos) | ||
286 | rstate->zpos = val; | ||
287 | else | 285 | else |
288 | return -EINVAL; | 286 | return -EINVAL; |
289 | 287 | ||
@@ -300,8 +298,6 @@ static int rcar_du_vsp_plane_atomic_get_property(struct drm_plane *plane, | |||
300 | 298 | ||
301 | if (property == rcdu->props.alpha) | 299 | if (property == rcdu->props.alpha) |
302 | *val = rstate->alpha; | 300 | *val = rstate->alpha; |
303 | else if (property == rcdu->props.zpos) | ||
304 | *val = rstate->zpos; | ||
305 | else | 301 | else |
306 | return -EINVAL; | 302 | return -EINVAL; |
307 | 303 | ||
@@ -381,8 +377,8 @@ int rcar_du_vsp_init(struct rcar_du_vsp *vsp) | |||
381 | 377 | ||
382 | drm_object_attach_property(&plane->plane.base, | 378 | drm_object_attach_property(&plane->plane.base, |
383 | rcdu->props.alpha, 255); | 379 | rcdu->props.alpha, 255); |
384 | drm_object_attach_property(&plane->plane.base, | 380 | drm_plane_create_zpos_property(&plane->plane, 1, 1, |
385 | rcdu->props.zpos, 1); | 381 | vsp->num_planes - 1); |
386 | } | 382 | } |
387 | 383 | ||
388 | return 0; | 384 | return 0; |