hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/gpu/drm/rcar-du/rcar_du_plane.c
....@@ -1,22 +1,18 @@
1
+// SPDX-License-Identifier: GPL-2.0+
12 /*
23 * rcar_du_plane.c -- R-Car Display Unit Planes
34 *
45 * Copyright (C) 2013-2015 Renesas Electronics Corporation
56 *
67 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
128 */
139
14
-#include <drm/drmP.h>
1510 #include <drm/drm_atomic.h>
1611 #include <drm/drm_atomic_helper.h>
1712 #include <drm/drm_crtc.h>
18
-#include <drm/drm_crtc_helper.h>
13
+#include <drm/drm_device.h>
1914 #include <drm/drm_fb_cma_helper.h>
15
+#include <drm/drm_fourcc.h>
2016 #include <drm/drm_gem_cma_helper.h>
2117 #include <drm/drm_plane_helper.h>
2218
....@@ -690,14 +686,12 @@
690686 if (state == NULL)
691687 return;
692688
689
+ __drm_atomic_helper_plane_reset(plane, &state->state);
690
+
693691 state->hwindex = -1;
694692 state->source = RCAR_DU_PLANE_MEMORY;
695693 state->colorkey = RCAR_DU_COLORKEY_NONE;
696694 state->state.zpos = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : 1;
697
-
698
- plane->state = &state->state;
699
- plane->state->alpha = DRM_BLEND_ALPHA_OPAQUE;
700
- plane->state->plane = plane;
701695 }
702696
703697 static int rcar_du_plane_atomic_set_property(struct drm_plane *plane,
....@@ -789,14 +783,17 @@
789783 drm_plane_helper_add(&plane->plane,
790784 &rcar_du_plane_helper_funcs);
791785
792
- if (type == DRM_PLANE_TYPE_PRIMARY)
793
- continue;
794
-
795
- drm_object_attach_property(&plane->plane.base,
796
- rcdu->props.colorkey,
797
- RCAR_DU_COLORKEY_NONE);
798786 drm_plane_create_alpha_property(&plane->plane);
799
- drm_plane_create_zpos_property(&plane->plane, 1, 1, 7);
787
+
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
+ }
800797 }
801798
802799 return 0;