From 20ea6adbf199097c4f5f591ffee088340630dae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 16 May 2022 23:40:32 +0200 Subject: bcm27xx: add support for linux v5.15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build system: x86_64 Build-tested: bcm2708, bcm2709, bcm2710, bcm2711 Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B Signed-off-by: Marty Jones Signed-off-by: Álvaro Fernández Rojas --- ...rm-object-Add-default-zpos-value-at-reset.patch | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 target/linux/bcm27xx/patches-5.15/950-0779-drm-object-Add-default-zpos-value-at-reset.patch (limited to 'target/linux/bcm27xx/patches-5.15/950-0779-drm-object-Add-default-zpos-value-at-reset.patch') diff --git a/target/linux/bcm27xx/patches-5.15/950-0779-drm-object-Add-default-zpos-value-at-reset.patch b/target/linux/bcm27xx/patches-5.15/950-0779-drm-object-Add-default-zpos-value-at-reset.patch new file mode 100644 index 0000000000..ff0e2ccf71 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.15/950-0779-drm-object-Add-default-zpos-value-at-reset.patch @@ -0,0 +1,54 @@ +From 69b992bf70df1892cfc8ccff07a79e8ea91e2902 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Mon, 21 Feb 2022 10:59:03 +0100 +Subject: [PATCH] drm/object: Add default zpos value at reset + +Upstream commit 1a7998dab5dd3d11bada7e3921781922082e7fe6 + +The drm_plane_create_zpos_property() function asks for an initial value, +and will set the associated plane state variable with that value if a +state is present. + +However, that function is usually called at a time where there's no +state yet. Since the drm_plane_state reset helper doesn't take care of +reading that value when it's called, it means that in most cases the +initial value will be 0, or the drivers will have to work around it. + +Let's add some code in __drm_atomic_helper_plane_state_reset() to get +the initial zpos value if the property has been attached in order to fix +this. + +Reviewed-by: Harry Wentland +Reviewed-by: Laurent Pinchart +Signed-off-by: Dave Stevenson +Signed-off-by: Maxime Ripard +Link: https://patchwork.freedesktop.org/patch/msgid/20220221095918.18763-8-maxime@cerno.tech +--- + drivers/gpu/drm/drm_atomic_state_helper.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/gpu/drm/drm_atomic_state_helper.c ++++ b/drivers/gpu/drm/drm_atomic_state_helper.c +@@ -243,11 +243,22 @@ EXPORT_SYMBOL(drm_atomic_helper_crtc_des + void __drm_atomic_helper_plane_state_reset(struct drm_plane_state *plane_state, + struct drm_plane *plane) + { ++ u64 val; ++ + plane_state->plane = plane; + plane_state->rotation = DRM_MODE_ROTATE_0; + + plane_state->alpha = DRM_BLEND_ALPHA_OPAQUE; + plane_state->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI; ++ ++ if (plane->zpos_property) { ++ if (!drm_object_property_get_default_value(&plane->base, ++ plane->zpos_property, ++ &val)) { ++ plane_state->zpos = val; ++ plane_state->normalized_zpos = val; ++ } ++ } + } + EXPORT_SYMBOL(__drm_atomic_helper_plane_state_reset); + -- cgit v1.2.3