From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F4018C433F5 for ; Mon, 7 Feb 2022 22:05:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E080310E255; Mon, 7 Feb 2022 22:05:52 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2DBCD10E255 for ; Mon, 7 Feb 2022 22:05:52 +0000 (UTC) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9B22D499; Mon, 7 Feb 2022 23:05:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1644271550; bh=tW9q9g69CXOS6X66C07+I/Jek9gx1lUfNc6/1P6Br7o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hlBtGWg7RfR/3NR3ywyG8n8lddfxgSgM+9b8fZZ7cI8bAAAWyTqtpMnDWNbbpEZZj HmqQQsHtveX/ou4m70m0jR/1eydQq2ojqYS55GSjA4O7o4AK0XZFaeT67d/Hc/78ul clsgbCwWK9BaWVtFOmnd76OlSnezB4PqKKS3F81Q= Date: Tue, 8 Feb 2022 00:05:48 +0200 From: Laurent Pinchart To: Maxime Ripard Subject: Re: [PATCH 07/23] drm/object: Add default zpos value at reset Message-ID: References: <20220207163515.1038648-1-maxime@cerno.tech> <20220207163515.1038648-8-maxime@cerno.tech> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220207163515.1038648-8-maxime@cerno.tech> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dom Cobley , Tim Gover , Dave Stevenson , David Airlie , dri-devel@lists.freedesktop.org, Thomas Zimmermann , Daniel Vetter , Phil Elwell Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Maxime and Dave, Thank you for the patch. On Mon, Feb 07, 2022 at 05:34:59PM +0100, Maxime Ripard wrote: > From: Dave Stevenson > > 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. > > Signed-off-by: Dave Stevenson > Signed-off-by: Maxime Ripard Looks reasonable. Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/drm_atomic_state_helper.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c > index ddcf5c2c8e6a..1412cee404ca 100644 > --- 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_destroy_state); > 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); > -- Regards, Laurent Pinchart