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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 33507C00140 for ; Thu, 18 Aug 2022 15:35:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VVQT2vH8q4ibs3x5hDceoAkiCZXWrYfDclu7LNsr66Q=; b=FSuVgX3m2MPJ1tMAy5mcPTmgeq awmjEx8ZQngraPrd43eEJ//s6wV0oTrYPEKKf5XKgIaOyDC/XAsI2hzPARw4KRgN0rXnC1Gts6Oee PsxonrTtG91CaVJmvPNwFuNSF+K0FNbpI5XswGZYsww96HBqZjTnNJptEUY1PcHBmGziigkUrVzqY PruTD9n4S1oY1IvAwdPWbPm27ndUptB4H6dXpo+/bnnSLxxLIW9DgyGs/2vS9aJtrHfyfOTf3tjGK 5wTxcf77IG4/sAGK1kO7O6s0EdwjM3cRAjKqVNTNBpnHkvs27aPAPJllTmLMMfHdZbmj4pxcgGgHK /tzzvLuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOhXC-006fyn-IK; Thu, 18 Aug 2022 15:34:15 +0000 Received: from wnew2-smtp.messagingengine.com ([64.147.123.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOhUC-006eNo-Cc; Thu, 18 Aug 2022 15:31:10 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 9B5D92B05ADE; Thu, 18 Aug 2022 11:31:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 18 Aug 2022 11:31:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1660836665; x=1660843865; bh=zsZN0+/dvw oQ1eBJsmGkPBClTq6+A6mbZvTtkF8HBEY=; b=BMiP2oaAOwbNtZZLLkDUVMmYY0 RONK7KgiEuxuKSpy29xDAffJAjJ//MxoOfyJ7z1PgFPhtU5yaFfSLExBbFZiRSkT mFwEIaB1C70toP9zCEJxKi7iIa6CeTw4nAkxOArZHavQLc1XsxBPgkX3+UvUbc6z pZcYemBlWY12iE/uGW2O1DGwdPviDTDgDOTWMSCRpiLxI9g8s8LtUaGARWberwba ZyOzY3rpaPkIC6ToN01G4p/005OMe0YIjBsGQ+/Fsq9Re5oygKLYA9y0E8tyuyOD CNjL2nBgcT2neTJNUsh+g6VZK2mjTxPvcCI9Lukvqvxr+xJxM9q1gtu9BZGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660836665; x=1660843865; bh=zsZN0+/dvwoQ1eBJsmGkPBClTq6+ A6mbZvTtkF8HBEY=; b=wxtGJPeahDRmQybRntrvlGpL29icAnQ2KJUUR/750Dbj RTpbASl5qveK0yvvFsPZ6PUdrQT9NVmCBI1Ez1yAHJXi/rjEDHiuCj+xcCNVg9On arMZo1tw0FEhao2iyb2gWvlBB0QTtVYIaL69vHSsgEZ5ZNF/y8roJHvhAu09PBlP lmAhz8WdhPVN9pjbb18dsGLY1UDq6O4nPa29UNltwcRXaTHEM8FAYy/1KsQmt4c7 NuLFwnfHAB7OoPm/W+r12dqzYe/UhergwWfAvZktZ/9KrJ2OfqLvMkLvhdeyij+w Ts1fbl49nMfed+UFlxccB7JIToXT+R49JTtl28PaRg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehledgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtudenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeevuddthffgfeeiffejgfeghfeludegkedtgefgffejtdegtddvleduvdfh teehveenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggt hh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 Aug 2022 11:31:03 -0400 (EDT) Date: Thu, 18 Aug 2022 17:31:01 +0200 From: Maxime Ripard To: Noralf =?utf-8?Q?Tr=C3=B8nnes?= Cc: Jernej Skrabec , Martin Blumenstingl , Chen-Yu Tsai , Philipp Zabel , Jerome Brunet , Samuel Holland , Thomas Zimmermann , Daniel Vetter , Emma Anholt , David Airlie , Maarten Lankhorst , Kevin Hilman , Neil Armstrong , linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Phil Elwell , Mateusz Kwiatkowski , linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven , Dave Stevenson , linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org, Dom Cobley Subject: Re: [PATCH v1 05/35] drm/connector: Add TV standard property Message-ID: <20220818153101.c25x33vkl6qboswe@houat> References: <20220728-rpi-analog-tv-properties-v1-5-3d53ae722097@cerno.tech> <9fdecae2-80ad-6212-0522-7dccf9fb57be@tronnes.org> <20220816082612.grebxql5ynnfnvfd@houat> <20220816094922.oqhrhefv327zo2ou@houat> <20220817114605.jpb3tlnoseyvf65d@houat> <30f3005d-0acc-e5af-10ca-cf46f18b3478@tronnes.org> <133c2a1d-0b4c-cef9-11fe-9ce9985253d6@tronnes.org> <9daca9bf-838e-c3eb-51de-1cf5188a9341@tronnes.org> MIME-Version: 1.0 In-Reply-To: <9daca9bf-838e-c3eb-51de-1cf5188a9341@tronnes.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220818_083108_525615_56809D3F X-CRM114-Status: GOOD ( 35.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5116581274005400842==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5116581274005400842== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="neorrh2qu6ghuw3r" Content-Disposition: inline --neorrh2qu6ghuw3r Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 18, 2022 at 05:01:38PM +0200, Noralf Tr=F8nnes wrote: >=20 >=20 > Den 18.08.2022 01.23, skrev Noralf Tr=F8nnes: > >=20 > >=20 > > Den 17.08.2022 15.11, skrev Noralf Tr=F8nnes: > >> > >> > >> Den 17.08.2022 13.46, skrev Maxime Ripard: > >>> On Tue, Aug 16, 2022 at 09:35:24PM +0200, Noralf Tr=F8nnes wrote: > >>>> Den 16.08.2022 11.49, skrev Maxime Ripard: > >>>>> On Tue, Aug 16, 2022 at 11:42:20AM +0200, Noralf Tr=F8nnes wrote: > >>>>>> Den 16.08.2022 10.26, skrev Maxime Ripard: > >>>>>>> Hi, > >>>>>>> > >>>>>>> On Mon, Aug 08, 2022 at 02:44:56PM +0200, Noralf Tr=F8nnes wrote: > >>>>>>>> Den 29.07.2022 18.34, skrev Maxime Ripard: > >>>>>>>>> The TV mode property has been around for a while now to select = and get the > >>>>>>>>> current TV mode output on an analog TV connector. > >>>>>>>>> > >>>>>>>>> Despite that property name being generic, its content isn't and= has been > >>>>>>>>> driver-specific which makes it hard to build any generic behavi= our on top > >>>>>>>>> of it, both in kernel and user-space. > >>>>>>>>> > >>>>>>>>> Let's create a new bitmask tv norm property, that can contain a= ny of the > >>>>>>>>> analog TV standards currently supported by kernel drivers. Each= driver can > >>>>>>>>> then pass in a bitmask of the modes it supports. > >>>>>>>>> > >>>>>>>>> We'll then be able to phase out the older tv mode property. > >>>>>>>>> > >>>>>>>>> Signed-off-by: Maxime Ripard > >>>>>>>>> > >=20 > >>>> How do you test the property? I've used modetest but I can only chan= ge > >>>> to a tv.mode that matches the current display mode. I can't switch f= rom > >>>> ntsc to pal for instance. > >>> > >>> Yep, if you want to change from PAL to NTSC, it will require a new mo= de. > >>> > >> > >> So userspace has to check tv.mode first and then create a display mode > >> the driver will accept if switching to a different display mode is > >> necessary? In other words, userspace can't discover from the kernel > >> which display modes a certain tv.mode/norm provides before it is > >> selected? If so, maybe libdrm should have some function(s) to deal with > >> switching between modes that require a different display mode since > >> knowledge about which display modes a tv.mode supports is needed before > >> hand. > >> > >=20 > > I haven't used vc4 on Pi4 in mainline before and have finally gotten it > > to work. > >=20 > > I see that the connector reports 2 modes that together fit all tv.norms > > so userspace doesn't have to contruct a display mode, but it does need > > to know which display mode belongs to a certain tv.norm. > >=20 > > When I try to use modetest I'm unable to set a mode: > >=20 > > pi@pi4t:~ $ modetest -M vc4 -s 45:720x480i > > setting mode 720x480i-29.97Hz on connectors 45, crtc 68 > > failed to set mode: Function not implemented > >=20 > > The errno is misleading, modetest does a drmModeDirtyFB before checking > > the error returned by drmModeSetCrtc. > >=20 > > Setting the property succeeds, but the modeset still fails: > >=20 > > pi@pi4t:~ $ modetest -M vc4 -s 45:720x480i -w 45:"tv norm":2 > > setting mode 720x480i-29.97Hz on connectors 45, crtc 68 > > failed to set mode: Function not implemented > >=20 > > pi@pi4t:~ $ modetest -M vc4 -c > > 37 tv norm: > > flags: bitmask > > values: NTSC-443=3D0x1 NTSC-J=3D0x2 NTSC-M=3D0x4 PAL-B= =3D0x10 > > PAL-M=3D0x200 PAL-N=3D0x400 SECAM-B=3D0x2000 > > value: 2 > >=20 > > Here's the log, can you see if there's anything obvious in there: > > https://gist.github.com/notro/a079498bf6b64327105752b2bafa8858 > >=20 >=20 > I'm one step closer as I now have fbcon working, I had forgotten to add > enable_tvout=3D1 and I had disable_fw_kms_setup=3D1 which disables the > video=3D mode on the kernel commandline. >=20 > modetest still fails though, after alot of printk sprinkling, I've > tracked it down to the drm_mode_equal test in > drm_atomic_helper_connector_tv_check(). The aspect ratios differ: >=20 > [ 61.336295] drm_atomic_helper_connector_tv_check: > mode->picture_aspect_ratio=3D1 > [ 61.336301] drm_atomic_helper_connector_tv_check: > &crtc_state->mode->picture_aspect_ratio=3D0 I haven't seen this when testing, but I'll have a look, thanks! Maxime --neorrh2qu6ghuw3r Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYv5bNQAKCRDj7w1vZxhR xdaLAQDfZ8rnYBDZfyN3qNMxZCR7YqMUNw8GId3H6w/a4n0wnwD9GeUKIJz3PUw0 hmv+huFdsLIyqvj6T79wwzxtYJk+3gY= =PX5K -----END PGP SIGNATURE----- --neorrh2qu6ghuw3r-- --===============5116581274005400842== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5116581274005400842==--