Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp591510rwb; Thu, 18 Aug 2022 08:49:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR7z9tVXaOnKVijkxMXvvmzGkpMs5jukk3U5bucteLmmCEL6Oz17EEl5C/gEgRaXk18VZpN+ X-Received: by 2002:a50:aa82:0:b0:445:dbba:6cb1 with SMTP id q2-20020a50aa82000000b00445dbba6cb1mr2791156edc.267.1660837778738; Thu, 18 Aug 2022 08:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660837778; cv=none; d=google.com; s=arc-20160816; b=rr59oOlrb5pxiqSXa/9YmzsPYRdVKlsv3148QsMM7kZE77614ww1G3kWL3wqpu6Lua m4ETsCWJztJeiavXNU3PTPwvA8t73ZmTcMH9tUQnwmfTcrGvn7xuPuywxZl/GEenoAJY EWvbzgwtfyggIo7DsWFs/8sgURpd4DYXfoBNuknprSfct1MHTICMA1DFw21mtRg4UVCo XdIt+ou6w6Ll6csurtcd0LYLF4jHU1Hl0xwbWl8s+XYd7zrDnFx3Lf1jPHj6My2Y1gP9 B/WShuxsnIhJneTgiuA7HJhF0YTdKf1ZCkjCrWH5ekIRqld4pUTeiUGuQsYwAU8D+HVD Kjkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=zsZN0+/dvwoQ1eBJsmGkPBClTq6+A6mbZvTtkF8HBEY=; b=tG89/5mSI6YDlcFlscHfPJM5Dq8E96boPhdguiYL2u57/td3rUOrbpuYvUUBY5fM+l Ey9ADsFroIcNbj0Il4Q70+enO3tW3ZxUXu+1ieJtCZ9oWCUEzyQ2rdUtNAW4k0YeKsw9 NE4WfHOb2G+/ug98bYJyY23KtNG3aN4F1J7tvbPVdJcW4yXXNids2pa7uGt6qKieS1Ud ob7QMyXLmU5SfIKfHqT7+16bfp80697umZPWTJwUGHDMFu4mezeTzclt+0GvyCPvZ13D DznzVqfIZFf68e4TSsAudOPe99jeqXO0R2GoNtohTiK1fnIjMElKvafw2h3VZUUojDcr yeNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=BMiP2oaA; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=wxtGJPea; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a1709060b0b00b0070b60b92455si1173015ejg.240.2022.08.18.08.49.11; Thu, 18 Aug 2022 08:49:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=BMiP2oaA; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=wxtGJPea; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343506AbiHRPbL (ORCPT + 99 others); Thu, 18 Aug 2022 11:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239670AbiHRPbJ (ORCPT ); Thu, 18 Aug 2022 11:31:09 -0400 Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E7349AF80 for ; Thu, 18 Aug 2022 08:31:08 -0700 (PDT) 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 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="neorrh2qu6ghuw3r" Content-Disposition: inline In-Reply-To: <9daca9bf-838e-c3eb-51de-1cf5188a9341@tronnes.org> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --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--