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 69E74C433EF for ; Wed, 9 Feb 2022 07:33:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 872CE10E38F; Wed, 9 Feb 2022 07:33:06 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8EB1110E38F for ; Wed, 9 Feb 2022 07:33:05 +0000 (UTC) Received: from [192.168.1.111] (91-156-85-209.elisa-laajakaista.fi [91.156.85.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EFC2393; Wed, 9 Feb 2022 08:33:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1644391983; bh=o3UQSb7ttWdgg2eQaFijw6jTZjJsbnGqgRrtULINB6k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Lm3zp5TasVn1VJIlHbR306ld3K91M24XcRP53uq/wm+Xvf6OqT0iKtsTOndKbeMTt L9SJitwb8aQAh9uRLEvl5tYurInUSH4t63adxCQ7RzBQW4lqxmsVJVZ/i8XSp/SRMN 6fou5oc4NCgCp4Qx3+YUr0Mk8JEGUg8DVJpvzJVU= Message-ID: Date: Wed, 9 Feb 2022 09:33:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 14/23] drm/omap: plane: Fix zpos initial value mismatch Content-Language: en-US To: Maxime Ripard , Daniel Vetter , David Airlie References: <20220207163515.1038648-1-maxime@cerno.tech> <20220207163515.1038648-15-maxime@cerno.tech> From: Tomi Valkeinen In-Reply-To: <20220207163515.1038648-15-maxime@cerno.tech> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 , dri-devel@lists.freedesktop.org, Thomas Zimmermann , Phil Elwell Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 07/02/2022 18:35, Maxime Ripard wrote: > While the omap_plane_init() function calls > drm_plane_create_zpos_property() with an initial value of 0, > omap_plane_reset() will force it to another value depending on the plane > type. > > Fix the discrepancy by setting the initial zpos value to the same value > in the drm_plane_create_zpos_property() call. > > Cc: Tomi Valkeinen > Signed-off-by: Maxime Ripard > --- > drivers/gpu/drm/omapdrm/omap_plane.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c > index b35205c4e979..e67baf9a942c 100644 > --- a/drivers/gpu/drm/omapdrm/omap_plane.c > +++ b/drivers/gpu/drm/omapdrm/omap_plane.c > @@ -533,6 +533,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev, > unsigned int num_planes = dispc_get_num_ovls(priv->dispc); > struct drm_plane *plane; > struct omap_plane *omap_plane; > + unsigned int zpos; > int ret; > u32 nformats; > const u32 *formats; > @@ -564,7 +565,16 @@ struct drm_plane *omap_plane_init(struct drm_device *dev, > drm_plane_helper_add(plane, &omap_plane_helper_funcs); > > omap_plane_install_properties(plane, &plane->base); > - drm_plane_create_zpos_property(plane, 0, 0, num_planes - 1); > + > + /* > + * Set the zpos default depending on whether we are a primary or overlay > + * plane. > + */ > + if (plane->type == DRM_PLANE_TYPE_PRIMARY) > + zpos = 0; > + else > + zpos = omap_plane->id; > + drm_plane_create_zpos_property(plane, zpos, 0, num_planes - 1); > drm_plane_create_alpha_property(plane); > drm_plane_create_blend_mode_property(plane, BIT(DRM_MODE_BLEND_PREMULTI) | > BIT(DRM_MODE_BLEND_COVERAGE)); Reviewed-by: Tomi Valkeinen Tomi