Message ID | 20240213-tidss-fixes-v1-1-d709e8dfa505@ideasonboard.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-63086-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp393591dyb; Tue, 13 Feb 2024 00:18:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUzjEeI9s5BioPK3JLXKUSC8dVq6CvD/dbOTn8yinKPtw06d5fDcNTEYJeoQEx8nWavDrHyFoBjDkSCCcjKPRkC4vlVGg== X-Google-Smtp-Source: AGHT+IFBcdo9/LmwvRuXc3DVT0OL3qzriI+qvidwfAdhGN3eiG8WUjLmJjVOMellclSrkIx3RtYW X-Received: by 2002:a0c:f5ca:0:b0:68c:a7df:ea88 with SMTP id q10-20020a0cf5ca000000b0068ca7dfea88mr9419511qvm.0.1707812326714; Tue, 13 Feb 2024 00:18:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707812326; cv=pass; d=google.com; s=arc-20160816; b=S5M6LbY1ErVVheqTVcIDNwpiOwjKxk89sAMAQU+0ZR8ABYS/Nge240CLabUHRwj4L2 lNRzAe8kkij6AwFztU4jR2rXw3l97qU1Hedpm8XjeWvnAaVHIg83Bbp3Jnde/HztbQla HVvuMX/gBT/PJyf5rG1jkliGWIVVgKfTQ/AlE/hrTQtKPPHhOClmbA0wpAHDnKz6+pjp nYEmL3zDR45e+vXvOjU7ihDBe7cHLiRRCezsJdSVTFPNVfJhf5uSepCIWfmnPc+9i+2E BASaoIiANCbS4g59kLF484NVMxl6kTI8PcXh+pZmwJB5Q7dEMyC/pltpFBlTLXo/HqiS r7HQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=JA97yuSNH6+my29xsxe715MvcHWDUwwVQ6wwvflMJEg=; fh=XYy2BJDXLaAtW0ijvCjjOxcshUBktap/ad7fsKVNb/g=; b=Nbe1oqwjhwvdnpq25ndhfxClvUlu8XAs/AlLFVGXMKebmrD6sben0ES2mZPm9U1jKW ssr8UM95+P4TvXRW6h/4UGA93jkiINj5tZ2pPv5McMlCrhTG9dUvkjx+QG2wRi2Q2uDz QN4RRGhkcIrbDq+yeN2OzYw3uGxt2Nw4fAQhxlgfVJysMbKq9mLRZC+hUXWnJVzfmvMD Bs4iz1g23WxF7DZ1+3lx+sCWUNSUgqougiJFm6QsncUvLMz/4LTfBmVe3GuqEKnSjsaW WXzzprEd7AeLalCjwByxe64myunlrYZlG5pvyskiZpOnMYZR7Ql+itH6PFTBGk71TgEA KmLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=jrgaoN5l; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-63086-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63086-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWAtrIINC8NdTgQcEpsBIyezfbMZ0EbCTcbh97RIQTqQuORtSC7JAvNdVOI/KADDTmlRAJMNtLYo2kROOIjMIRgnaVInA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id kk6-20020a056214508600b0068c71d0cf61si2347452qvb.446.2024.02.13.00.18.46 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 00:18:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63086-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=jrgaoN5l; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-63086-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63086-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 817491C21CB5 for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 08:18:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A66322EEB; Tue, 13 Feb 2024 08:17:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jrgaoN5l" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 413752232A for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 08:17:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707812230; cv=none; b=CcPNFDzvl1KSLEBP3HQDlsDiFMb99QtSxpq0wsSWaqtPL0+POVp3Znk0HKspriW6GR3frGdMXRFYQD9cLznREbPPQ28ptOP7ZLizKCu6c1q3WRymCQXzUUZI9UgFggshRKnyeHhLYcGzQf9G4RDulUlzvGk1O83GZpLMkh/52p0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707812230; c=relaxed/simple; bh=YsSXyUoBoQT0IwX3NdvoTnvhBuIOfrZ35XLfOOL2+Tw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kUdru8GJ51WAPBjKTZNLLA47mBNFsf2Nlyq5L3RDW4NHPOQOyVsay0kMLAxetuuZQ8BvVedng8iTFFopIVWrM8pjNqzwjkr+4jNknPyzvQCqPk+r7uCVWR7MESDHWaWXcmo+ozoItR6iyd9cPu9LK+jKFuKn4P8zY/Ek1JWYtdU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=jrgaoN5l; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from [127.0.1.1] (91-154-35-128.elisa-laajakaista.fi [91.154.35.128]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7053C13AB; Tue, 13 Feb 2024 09:17:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1707812224; bh=YsSXyUoBoQT0IwX3NdvoTnvhBuIOfrZ35XLfOOL2+Tw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jrgaoN5lVRxxcFXito+GQZkNpUXZvI0n/DOMbqAkOX0JgbGKs60bfZEFNCIVjA8S8 SJ/SVlYeaO2IAqjLTlqGbdazvFFk5EwlJXrPM9kaYHx17yHjQaC/gbAXn/m2MJhw9e ZsimXMe1awPF3DnXYbdVQ6sS7yrcGmW7K7Mt5UHw= From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Date: Tue, 13 Feb 2024 10:16:36 +0200 Subject: [PATCH 1/2] drm/tidss: Fix initial plane zpos values Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240213-tidss-fixes-v1-1-d709e8dfa505@ideasonboard.com> References: <20240213-tidss-fixes-v1-0-d709e8dfa505@ideasonboard.com> In-Reply-To: <20240213-tidss-fixes-v1-0-d709e8dfa505@ideasonboard.com> To: Jyri Sarha <jyri.sarha@iki.fi>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Sam Ravnborg <sam@ravnborg.org>, Devarsh Thakkar <devarsht@ti.com>, Aradhya Bhatia <a-bhatia1@ti.com>, Francesco Dolcini <francesco@dolcini.it> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2076; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=YsSXyUoBoQT0IwX3NdvoTnvhBuIOfrZ35XLfOOL2+Tw=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlyyV/yfb/cYWS5pNx0IA84/3kZKinY05RPOM0Z c0jEEyZaeiJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZcslfwAKCRD6PaqMvJYe 9Z3dEACXkwC3bLK5AqM40K1v8IGB7Z01jp9J0lLRqtHAvKMUoRyu0nFcj5knVSOW7Pzh5ZmFanC FenJi3nCboq/dMdOU0r1mqeZIOPm/SskViSpWJVRGGdcgAVYvniLqvorP3/dxjhQasCGhqpaykd mIis3vc8xc4E7pJUarely91uBOawwVgtRkcGSepEiqEWa7OhUJUIwzIDeOHCnc66t5MeFK89Oqj 3XeB4cG+sPbZVQn/VIiqmQek41L5QF5PoRaNi+saA6qGHD0JvGsbgwkxyuyh7I2XACIU1eHNdte AXa1GgL4fSjQmS4pr95zu5YU/kk/RE0z8jfYUf4OcVWnLWAfZNa4+BW6Ee5eoE+7V61FknkzIJg DKH78Zv+cM5JPwtWNFepCEr+tx8J7eNU5AwwpPveO4gLQvgdZkW3P5tXadxzf7nGlbn7O1+uIZY BbniXwuNK7j0wgLSmQpwlE/RelgZ8Cg3JMimRl59V6qzYqsUObUHbS5PBKVvlDuvvSqvqCnqamY DJWMgbMfveMdRSUh9yon/dWzDTrW+Q/PV6Op1UopN5APuR+jWnV6cIdj8bnfvyaYoOHFBrBQTlV SGaBzfohhivQeaGmiqT92jCNuwyW6DIVskGhO8XHq29MhAopUNh3LQatX7YJzE2OJj/8uiRElNh crqwdQLTCSDiVuw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790771018145510899 X-GMAIL-MSGID: 1790771018145510899 |
Series |
drm/tidss: Fixes for zpos and multi-display
|
|
Commit Message
Tomi Valkeinen
Feb. 13, 2024, 8:16 a.m. UTC
When the driver sets up the zpos property it sets the default zpos value
to the HW id of the plane. That is fine as such, but as on many DSS
versions the driver arranges the DRM planes in a different order than
the HW planes (to keep the non-scalable planes first), this leads to odd
initial zpos values. An example is J721e, where the initial zpos values
for DRM planes are 1, 3, 0, 2.
In theory the userspace should configure the zpos values properly when
using multiple planes, and in that sense the initial zpos values
shouldn't matter, but there's really no reason not to fix this and help
the userspace apps which don't handle zpos perfectly. In particular,
Weston seems to have issues dealing with the planes with the current
default zpos values.
So let's change the zpos values for the DRM planes to 0, 1, 2, 3.
Another option would be to configure the planes marked as primary planes
to zpos 0. On a two display system this would give us plane zpos values
of 0, 0, 1, 2. The end result and behavior would be very similar in this
option, and I'm not aware that this would actually help us in any way.
So, to keep the code simple, I opted for the 0, 1, 2, 3 values.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem")
---
drivers/gpu/drm/tidss/tidss_plane.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, 13 Feb 2024 10:16:36 +0200 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> wrote: > When the driver sets up the zpos property it sets the default zpos value > to the HW id of the plane. That is fine as such, but as on many DSS > versions the driver arranges the DRM planes in a different order than > the HW planes (to keep the non-scalable planes first), this leads to odd > initial zpos values. An example is J721e, where the initial zpos values > for DRM planes are 1, 3, 0, 2. > > In theory the userspace should configure the zpos values properly when > using multiple planes, and in that sense the initial zpos values > shouldn't matter, but there's really no reason not to fix this and help > the userspace apps which don't handle zpos perfectly. In particular, > Weston seems to have issues dealing with the planes with the current > default zpos values. > > So let's change the zpos values for the DRM planes to 0, 1, 2, 3. > > Another option would be to configure the planes marked as primary planes > to zpos 0. On a two display system this would give us plane zpos values > of 0, 0, 1, 2. The end result and behavior would be very similar in this > option, and I'm not aware that this would actually help us in any way. > So, to keep the code simple, I opted for the 0, 1, 2, 3 values. > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> > Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") Hi Tomi, have you reported this to Weston? What exactly is the problem? It doesn't seem like a good idea to work around userspace bugs (non-regression, I presume?) with kernel changes. Thanks, pq > --- > drivers/gpu/drm/tidss/tidss_plane.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c > index e1c0ef0c3894..68fed531f6a7 100644 > --- a/drivers/gpu/drm/tidss/tidss_plane.c > +++ b/drivers/gpu/drm/tidss/tidss_plane.c > @@ -213,7 +213,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, > > drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs); > > - drm_plane_create_zpos_property(&tplane->plane, hw_plane_id, 0, > + drm_plane_create_zpos_property(&tplane->plane, tidss->num_planes, 0, > num_planes - 1); > > ret = drm_plane_create_color_properties(&tplane->plane, >
Hi, On 13/02/2024 11:04, Pekka Paalanen wrote: > On Tue, 13 Feb 2024 10:16:36 +0200 > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> wrote: > >> When the driver sets up the zpos property it sets the default zpos value >> to the HW id of the plane. That is fine as such, but as on many DSS >> versions the driver arranges the DRM planes in a different order than >> the HW planes (to keep the non-scalable planes first), this leads to odd >> initial zpos values. An example is J721e, where the initial zpos values >> for DRM planes are 1, 3, 0, 2. >> >> In theory the userspace should configure the zpos values properly when >> using multiple planes, and in that sense the initial zpos values >> shouldn't matter, but there's really no reason not to fix this and help >> the userspace apps which don't handle zpos perfectly. In particular, >> Weston seems to have issues dealing with the planes with the current >> default zpos values. >> >> So let's change the zpos values for the DRM planes to 0, 1, 2, 3. >> >> Another option would be to configure the planes marked as primary planes >> to zpos 0. On a two display system this would give us plane zpos values >> of 0, 0, 1, 2. The end result and behavior would be very similar in this >> option, and I'm not aware that this would actually help us in any way. >> So, to keep the code simple, I opted for the 0, 1, 2, 3 values. >> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> >> Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") > > Hi Tomi, > > have you reported this to Weston? What exactly is the problem? I haven't. I'm quite unfamiliar with Weston, and Randolph from TI (cc'd) has been working on the Weston side of things. I also don't know if there's something TI specific here, as the use case is with non-mainline GPU drivers and non-mainline Mesa. I should have been a bit clearer in the patch description, as I didn't mean that upstream Weston has a bug (maybe it has, maybe it has not). The issue seen is that when Weston decides to use DRM planes for composition, the plane zpositions are not configured correctly (or at all?). Afaics, this leads to e.g. weston showing a window with a DRM "overlay" plane that is behind the "primary" root plane, so the window is not visible. And as Weston thinks that the area supposedly covered by the overlay plane does not need to be rendered on the root plane, there are also artifacts on that area. Also, the Weston I used is a bit older one (10.0.1), as I needed to go back in my buildroot versions to get all that non-mainline GPU stuff compiled and working. A more recent Weston may behave differently. > It doesn't seem like a good idea to work around userspace bugs > (non-regression, I presume?) with kernel changes. Presuming this is not related to any TI specific code, I guess it's a regression in the sense that at some point Weston added the support to use planes for composition, so previously with only a single plane per display there was no issue. I agree with you, this patch shouldn't be merged to "fix" issues with tidss + Weston. However, the current default zpos values really don't make sense, so I think this patch can stand on its own, and should be merged just to make the tidss behavior a bit saner. But even if this patch merged, the issue with Weston should be looked at (*poke* Randolph =). Tomi > > > Thanks, > pq > >> --- >> drivers/gpu/drm/tidss/tidss_plane.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c >> index e1c0ef0c3894..68fed531f6a7 100644 >> --- a/drivers/gpu/drm/tidss/tidss_plane.c >> +++ b/drivers/gpu/drm/tidss/tidss_plane.c >> @@ -213,7 +213,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, >> >> drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs); >> >> - drm_plane_create_zpos_property(&tplane->plane, hw_plane_id, 0, >> + drm_plane_create_zpos_property(&tplane->plane, tidss->num_planes, 0, >> num_planes - 1); >> >> ret = drm_plane_create_color_properties(&tplane->plane, >> >
On Tue, Feb 13, 2024 at 11:57:59AM +0200, Tomi Valkeinen wrote: > Hi, Hi, > > On 13/02/2024 11:04, Pekka Paalanen wrote: > > On Tue, 13 Feb 2024 10:16:36 +0200 > > Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> wrote: > > > > > When the driver sets up the zpos property it sets the default zpos value > > > to the HW id of the plane. That is fine as such, but as on many DSS > > > versions the driver arranges the DRM planes in a different order than > > > the HW planes (to keep the non-scalable planes first), this leads to odd > > > initial zpos values. An example is J721e, where the initial zpos values > > > for DRM planes are 1, 3, 0, 2. > > > > > > In theory the userspace should configure the zpos values properly when > > > using multiple planes, and in that sense the initial zpos values > > > shouldn't matter, but there's really no reason not to fix this and help > > > the userspace apps which don't handle zpos perfectly. In particular, > > > Weston seems to have issues dealing with the planes with the current > > > default zpos values. > > > > > > So let's change the zpos values for the DRM planes to 0, 1, 2, 3. > > > > > > Another option would be to configure the planes marked as primary planes > > > to zpos 0. On a two display system this would give us plane zpos values > > > of 0, 0, 1, 2. The end result and behavior would be very similar in this > > > option, and I'm not aware that this would actually help us in any way. > > > So, to keep the code simple, I opted for the 0, 1, 2, 3 values. > > > > > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> > > > Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") > > > > Hi Tomi, > > > > have you reported this to Weston? What exactly is the problem? > > I haven't. I'm quite unfamiliar with Weston, and Randolph from TI (cc'd) has > been working on the Weston side of things. I also don't know if there's > something TI specific here, as the use case is with non-mainline GPU drivers > and non-mainline Mesa. I should have been a bit clearer in the patch > description, as I didn't mean that upstream Weston has a bug (maybe it has, > maybe it has not). > > The issue seen is that when Weston decides to use DRM planes for > composition, the plane zpositions are not configured correctly (or at all?). > Afaics, this leads to e.g. weston showing a window with a DRM "overlay" > plane that is behind the "primary" root plane, so the window is not visible. > And as Weston thinks that the area supposedly covered by the overlay plane > does not need to be rendered on the root plane, there are also artifacts on > that area. > > Also, the Weston I used is a bit older one (10.0.1), as I needed to go back > in my buildroot versions to get all that non-mainline GPU stuff compiled and > working. A more recent Weston may behave differently. Right after Weston 10, we had a few minor changes related to the zpos-sorting list of planes and how we parse the plan list without having a temporary zpos ordered list to pick planes from. And there's another fix for missing out to set out the zpos for scanout to the minimum available - which seems like a good candidate to explain what happens in the issue described above. So if trying Weston again, please try with at least Weston 12, which should have those changes in. > > > It doesn't seem like a good idea to work around userspace bugs > > (non-regression, I presume?) with kernel changes. > > Presuming this is not related to any TI specific code, I guess it's a > regression in the sense that at some point Weston added the support to use > planes for composition, so previously with only a single plane per display > there was no issue. > > I agree with you, this patch shouldn't be merged to "fix" issues with tidss > + Weston. However, the current default zpos values really don't make sense, > so I think this patch can stand on its own, and should be merged just to > make the tidss behavior a bit saner. > > But even if this patch merged, the issue with Weston should be looked at > (*poke* Randolph =). > > Tomi > > > > > > > Thanks, > > pq > > > > > --- > > > drivers/gpu/drm/tidss/tidss_plane.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c > > > index e1c0ef0c3894..68fed531f6a7 100644 > > > --- a/drivers/gpu/drm/tidss/tidss_plane.c > > > +++ b/drivers/gpu/drm/tidss/tidss_plane.c > > > @@ -213,7 +213,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, > > > drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs); > > > - drm_plane_create_zpos_property(&tplane->plane, hw_plane_id, 0, > > > + drm_plane_create_zpos_property(&tplane->plane, tidss->num_planes, 0, > > > num_planes - 1); > > > ret = drm_plane_create_color_properties(&tplane->plane, > > > > > >
Hi, On Tue, 13 Feb 2024 at 10:18, Marius Vlad <marius.vlad@collabora.com> wrote: > On Tue, Feb 13, 2024 at 11:57:59AM +0200, Tomi Valkeinen wrote: > > I haven't. I'm quite unfamiliar with Weston, and Randolph from TI (cc'd) has > > been working on the Weston side of things. I also don't know if there's > > something TI specific here, as the use case is with non-mainline GPU drivers > > and non-mainline Mesa. I should have been a bit clearer in the patch > > description, as I didn't mean that upstream Weston has a bug (maybe it has, > > maybe it has not). Don't worry about it. We've had bugs in the past and I'm sure we'll have more. :) Either way, it's definitely better to have the kernel expose sensible behaviour rather than weird workarounds, unless they've been around for so long that they're basically baked into ABI. > > The issue seen is that when Weston decides to use DRM planes for > > composition, the plane zpositions are not configured correctly (or at all?). > > Afaics, this leads to e.g. weston showing a window with a DRM "overlay" > > plane that is behind the "primary" root plane, so the window is not visible. > > And as Weston thinks that the area supposedly covered by the overlay plane > > does not need to be rendered on the root plane, there are also artifacts on > > that area. > > > > Also, the Weston I used is a bit older one (10.0.1), as I needed to go back > > in my buildroot versions to get all that non-mainline GPU stuff compiled and > > working. A more recent Weston may behave differently. > > Right after Weston 10, we had a few minor changes related to the > zpos-sorting list of planes and how we parse the plan list without having > a temporary zpos ordered list to pick planes from. > > And there's another fix for missing out to set out the zpos for scanout > to the minimum available - which seems like a good candidate to explain > what happens in the issue described above. So if trying Weston again, > please try with at least Weston 12, which should have those changes > in. Specifically, you probably want commits 4cde507be6a1 and 58dde0e0c000. I think the window of breakage was small enough that - assuming either those commits or an upgrade to Weston 12/13 fixes it - we can just ask people to upgrade to a fixed Weston. > > Presuming this is not related to any TI specific code, I guess it's a > > regression in the sense that at some point Weston added the support to use > > planes for composition, so previously with only a single plane per display > > there was no issue. That point was 12 years ago, so not that novel. ;) Cheers, Daniel
Tomi, thank you for the fixes. On 13/02/24 13:46, Tomi Valkeinen wrote: > When the driver sets up the zpos property it sets the default zpos value > to the HW id of the plane. That is fine as such, but as on many DSS > versions the driver arranges the DRM planes in a different order than > the HW planes (to keep the non-scalable planes first), this leads to odd > initial zpos values. An example is J721e, where the initial zpos values > for DRM planes are 1, 3, 0, 2. > > In theory the userspace should configure the zpos values properly when > using multiple planes, and in that sense the initial zpos values > shouldn't matter, but there's really no reason not to fix this and help > the userspace apps which don't handle zpos perfectly. In particular, > Weston seems to have issues dealing with the planes with the current > default zpos values. > > So let's change the zpos values for the DRM planes to 0, 1, 2, 3. > > Another option would be to configure the planes marked as primary planes > to zpos 0. On a two display system this would give us plane zpos values > of 0, 0, 1, 2. The end result and behavior would be very similar in this > option, and I'm not aware that this would actually help us in any way. > So, to keep the code simple, I opted for the 0, 1, 2, 3 values. > > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> > Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com> > --- > drivers/gpu/drm/tidss/tidss_plane.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c > index e1c0ef0c3894..68fed531f6a7 100644 > --- a/drivers/gpu/drm/tidss/tidss_plane.c > +++ b/drivers/gpu/drm/tidss/tidss_plane.c > @@ -213,7 +213,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, > > drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs); > > - drm_plane_create_zpos_property(&tplane->plane, hw_plane_id, 0, > + drm_plane_create_zpos_property(&tplane->plane, tidss->num_planes, 0, > num_planes - 1); > > ret = drm_plane_create_color_properties(&tplane->plane, >
Hi, On 13/02/2024 13:39, Daniel Stone wrote: > Hi, > > On Tue, 13 Feb 2024 at 10:18, Marius Vlad <marius.vlad@collabora.com> wrote: >> On Tue, Feb 13, 2024 at 11:57:59AM +0200, Tomi Valkeinen wrote: >>> I haven't. I'm quite unfamiliar with Weston, and Randolph from TI (cc'd) has >>> been working on the Weston side of things. I also don't know if there's >>> something TI specific here, as the use case is with non-mainline GPU drivers >>> and non-mainline Mesa. I should have been a bit clearer in the patch >>> description, as I didn't mean that upstream Weston has a bug (maybe it has, >>> maybe it has not). > > Don't worry about it. We've had bugs in the past and I'm sure we'll > have more. :) Either way, it's definitely better to have the kernel > expose sensible behaviour rather than weird workarounds, unless > they've been around for so long that they're basically baked into ABI. Yeah, that's always a worry. I do hope that no user of tidss expects the plane zpos values to be the current funny ones. But we'll probably find out when I merge this =). >>> The issue seen is that when Weston decides to use DRM planes for >>> composition, the plane zpositions are not configured correctly (or at all?). >>> Afaics, this leads to e.g. weston showing a window with a DRM "overlay" >>> plane that is behind the "primary" root plane, so the window is not visible. >>> And as Weston thinks that the area supposedly covered by the overlay plane >>> does not need to be rendered on the root plane, there are also artifacts on >>> that area. >>> >>> Also, the Weston I used is a bit older one (10.0.1), as I needed to go back >>> in my buildroot versions to get all that non-mainline GPU stuff compiled and >>> working. A more recent Weston may behave differently. >> >> Right after Weston 10, we had a few minor changes related to the >> zpos-sorting list of planes and how we parse the plan list without having >> a temporary zpos ordered list to pick planes from. >> >> And there's another fix for missing out to set out the zpos for scanout >> to the minimum available - which seems like a good candidate to explain >> what happens in the issue described above. So if trying Weston again, >> please try with at least Weston 12, which should have those changes >> in. > > Specifically, you probably want commits 4cde507be6a1 and 58dde0e0c000. > I think the window of breakage was small enough that - assuming either > those commits or an upgrade to Weston 12/13 fixes it - we can just ask > people to upgrade to a fixed Weston. > >>> Presuming this is not related to any TI specific code, I guess it's a >>> regression in the sense that at some point Weston added the support to use >>> planes for composition, so previously with only a single plane per display >>> there was no issue. > > That point was 12 years ago, so not that novel. ;) Hmm, so do I understand it right, the plane code from 12 years back supposedly works ok, but somewhere around Weston 10 something broke, but was fixed with the commits you mention above? Tomi
Hi, On Fri, 16 Feb 2024 at 09:00, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> wrote: > On 13/02/2024 13:39, Daniel Stone wrote: > > Specifically, you probably want commits 4cde507be6a1 and 58dde0e0c000. > > I think the window of breakage was small enough that - assuming either > > those commits or an upgrade to Weston 12/13 fixes it - we can just ask > > people to upgrade to a fixed Weston. > > > >>> Presuming this is not related to any TI specific code, I guess it's a > >>> regression in the sense that at some point Weston added the support to use > >>> planes for composition, so previously with only a single plane per display > >>> there was no issue. > > > > That point was 12 years ago, so not that novel. ;) > > Hmm, so do I understand it right, the plane code from 12 years back > supposedly works ok, but somewhere around Weston 10 something broke, but > was fixed with the commits you mention above? We always had plane support but pre-zpos; we added support for zpos a couple/few releases ago, but then massively refactored it ... so it could've always been broken, or could've been broken for as long as we have zpos, or it could've just been a small window in between the refactor.
diff --git a/drivers/gpu/drm/tidss/tidss_plane.c b/drivers/gpu/drm/tidss/tidss_plane.c index e1c0ef0c3894..68fed531f6a7 100644 --- a/drivers/gpu/drm/tidss/tidss_plane.c +++ b/drivers/gpu/drm/tidss/tidss_plane.c @@ -213,7 +213,7 @@ struct tidss_plane *tidss_plane_create(struct tidss_device *tidss, drm_plane_helper_add(&tplane->plane, &tidss_plane_helper_funcs); - drm_plane_create_zpos_property(&tplane->plane, hw_plane_id, 0, + drm_plane_create_zpos_property(&tplane->plane, tidss->num_planes, 0, num_planes - 1); ret = drm_plane_create_color_properties(&tplane->plane,