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 X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AC39C3A5A9 for ; Mon, 4 May 2020 12:07:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E6756206A4 for ; Mon, 4 May 2020 12:07:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6756206A4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6CA336E061; Mon, 4 May 2020 12:07:30 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id AD9C56E061 for ; Mon, 4 May 2020 12:07:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id F35E9AD17; Mon, 4 May 2020 12:07:28 +0000 (UTC) Subject: Re: [PATCH] drm/ast: Don't check new mode if CRTC is being disabled To: Emil Velikov References: <20200430091330.9824-1-tzimmermann@suse.de> From: Thomas Zimmermann Autocrypt: addr=tz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BnCH+R dhgATnWWGKdDegUR5BkDfDg5O/FISymJBHx2Dyoklv5g4BzkgqTqwmaYzsl8UxZKvbaxq0zb ehDda8lvhFXodNFMAgTLJlLuDYOGLK2AwbrS3Sp0AEbkpdJBb44qVlGm5bApZouHeJ/+n+7r 12+lqdsAEQEAAYkBPAQYAQgAJhYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojBQJbOdLgAhsMBQkD wmcAAAoJEGgNwR1TC3ojpfcIAInwP5OlcEKokTnHCiDTz4Ony4GnHRP2fXATQZCKxmu4AJY2 h9ifw9Nf2TjCZ6AMvC3thAN0rFDj55N9l4s1CpaDo4J+0fkrHuyNacnT206CeJV1E7NYntxU n+LSiRrOdywn6erjxRi9EYTVLCHcDhBEjKmFZfg4AM4GZMWX1lg0+eHbd5oL1as28WvvI/uI aMyV8RbyXot1r/8QLlWldU3NrTF5p7TMU2y3ZH2mf5suSKHAMtbE4jKJ8ZHFOo3GhLgjVrBW HE9JXO08xKkgD+w6v83+nomsEuf6C6LYrqY/tsZvyEX6zN8CtirPdPWu/VXNRYAl/lat7lSI 3H26qrE= Message-ID: <1f8ac420-00ff-f911-b91a-6013f2bcafa5@suse.de> Date: Mon, 4 May 2020 14:07:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: 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: cogarre@gmail.com, ML dri-devel , Gerd Hoffmann , Dave Airlie , Sam Ravnborg , Emil Velikov Content-Type: multipart/mixed; boundary="===============1803078318==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============1803078318== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="whJ9tKT3s8KXSxUZuuvkScQauV5M0RTsu" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --whJ9tKT3s8KXSxUZuuvkScQauV5M0RTsu Content-Type: multipart/mixed; boundary="Y6UXMEsiss6FOtmK0sXpo1d7T1Z9Z9uzy"; protected-headers="v1" From: Thomas Zimmermann To: Emil Velikov Cc: cogarre@gmail.com, ML dri-devel , Gerd Hoffmann , Dave Airlie , Sam Ravnborg , Emil Velikov Message-ID: <1f8ac420-00ff-f911-b91a-6013f2bcafa5@suse.de> Subject: Re: [PATCH] drm/ast: Don't check new mode if CRTC is being disabled References: <20200430091330.9824-1-tzimmermann@suse.de> In-Reply-To: --Y6UXMEsiss6FOtmK0sXpo1d7T1Z9Z9uzy Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Emil Am 01.05.20 um 15:20 schrieb Emil Velikov: > Hi Thomas, >=20 > Couple of fly-by ideas/suggestions. >=20 > On Thu, 30 Apr 2020 at 10:13, Thomas Zimmermann w= rote: >> >> Suspending failed because there's no mode if the CRTC is being >> disabled. Early-out in this case. This fixes runtime PM for ast. >> >> Signed-off-by: Thomas Zimmermann >> --- >> drivers/gpu/drm/ast/ast_mode.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_= mode.c >> index 7a9f20a2fd303..089b7d9a0cf3f 100644 >> --- a/drivers/gpu/drm/ast/ast_mode.c >> +++ b/drivers/gpu/drm/ast/ast_mode.c >> @@ -801,6 +801,9 @@ static int ast_crtc_helper_atomic_check(struct drm= _crtc *crtc, >> return -EINVAL; > Unrelated: > This feels quite dirty. If AST1180 does not support atomic modeset > simply remove the DRIVER_ATOMIC bit. > You can do that at runtime, via drm_device::driver_features in say, > ast_detect_chip()? The line you commented on dates back to non-atomic modesetting, but I don't know what the story behind AST1180 is. It is explicitly disabled in the list of PCI IDs, but the driver has plenty of code for it. It looks as if the chip can only do pageflipping with a pre-set video mode. As it is right now, the AST1180 code could probably be deleted entirely. >=20 > The drm_driver::driver_features is immutable, or it ought to be. >=20 >> } >> >> + if (!state->enable) >> + return 0; /* no checks required if CRTC is being disab= led */ >> + > I cannot think of a reason why a driver would need to perform > crtc_atomic_check, if the crtc is being disabled. > Can you spot any? If not, this should be better served in core, which > calls this callback. > Correct? Ast is a bit of a special case, because it tests the incoming mode against a list of re-defined modes. With the crtc being disabled, the incoming mode is 0 in all fields. Obviously that's not a valid mode, and we need that additional test here. In the general case, I'd see 'crtc check' as part of the larger atomic infrastructure. I can imagine that configurations require the CRTC to be enabled before other HW blocks work. So a driver might have a reason to run crtc's check even for disabled crtcs (at least to verify that the crtc is not disabled). I don't think this can be handled in the core easi= ly. Best regards Thomas >=20 > HTH > -Emil > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --Y6UXMEsiss6FOtmK0sXpo1d7T1Z9Z9uzy-- --whJ9tKT3s8KXSxUZuuvkScQauV5M0RTsu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl6wBX4ACgkQaA3BHVML eiPTHQf8DZ+EBlTaTSSJeXE3yyxTNb5KZtJ4h94lieN+1ECTQsKv2Bo0hXDqHANC mg7dleOgD5ykyjMIclj1jCXHzHnl87uwh3gtG0NNTAq2N1LSmcEdX+sRUK+pxFBQ Bj39IKIuc50elzw11lgMHPSxFDT4JyFW/2iD3h79SJSDlZ6LDxHh319lJ9IWnw3+ /cRjaDFfcqx7AAasbTDFRMKTWyqYXlZK+7efjUA7x/a1GkeEWwGat+Yr2rUv/pvd fUWIBYqFXFfyGO1vrSh5oexQxJYz89rdv7sA69DClh4gCRgAUQoyNNex6frmWMqT liVipmlzLWdDuW6E9CMVme8+9wAONA== =THII -----END PGP SIGNATURE----- --whJ9tKT3s8KXSxUZuuvkScQauV5M0RTsu-- --===============1803078318== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1803078318==--