From mboxrd@z Thu Jan 1 00:00:00 1970 From: eric@anholt.net (Eric Anholt) Date: Thu, 22 Feb 2018 12:30:54 -0800 Subject: [PATCH 3/3] drm/pl111: Use max memory bandwidth for resolution In-Reply-To: <20180206121854.4407-4-linus.walleij@linaro.org> References: <20180206121854.4407-1-linus.walleij@linaro.org> <20180206121854.4407-4-linus.walleij@linaro.org> Message-ID: <87k1v4sr5t.fsf@anholt.net> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Linus Walleij writes: > We were previously selecting 1024x768 and 32BPP as the default > set-up for the PL111 consumers. > > This does not work on elder systems: the device tree bindings > support a property "max-memory-bandwidth" in bytes/second that > states that if you exceed this the memory bus will saturate. > The result is flickering and unstable images. > > Parse the "max-memory-bandwidth" and respect it when > intializing the driver. On the RealView PB11MP, Versatile and > Integrator/CP we get a nice console as default with this code. > > Signed-off-by: Linus Walleij > --- > ChangeLog v1->v2: > - Exploit the new .mode_valid() callback we added to the > simple KMS helper. > - Use the hardcoded bits per pixel per variant instead of > trying to be heuristic about this setting for now. > --- > drivers/gpu/drm/pl111/pl111_display.c | 30 ++++++++++++++++++++++++++++++ > drivers/gpu/drm/pl111/pl111_drm.h | 1 + > drivers/gpu/drm/pl111/pl111_drv.c | 6 ++++++ > 3 files changed, 37 insertions(+) > > diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c > index d75923896609..a1ca9e1ffe15 100644 > --- a/drivers/gpu/drm/pl111/pl111_display.c > +++ b/drivers/gpu/drm/pl111/pl111_display.c > + if (bw > priv->memory_bw) { > + DRM_DEBUG("%d x %d @ %d Hz, %d cpp, bw %llu too fast\n", > + mode->hdisplay, mode->vdisplay, mode->clock, cpp, bw); > + > + return MODE_BAD; > + } Oh, hey, on platforms with no memory-bandwidth property, we should make sure not to reject all modes :) -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 832 bytes Desc: not available URL: From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH 3/3] drm/pl111: Use max memory bandwidth for resolution Date: Thu, 22 Feb 2018 12:30:54 -0800 Message-ID: <87k1v4sr5t.fsf@anholt.net> References: <20180206121854.4407-1-linus.walleij@linaro.org> <20180206121854.4407-4-linus.walleij@linaro.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1930676706==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id D0E886EC60 for ; Thu, 22 Feb 2018 20:30:56 +0000 (UTC) In-Reply-To: <20180206121854.4407-4-linus.walleij@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Linus Walleij , Daniel Vetter , Jani Nikula , Sean Paul , Peter Ujfalusi , Tomi Valkeinen Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1930676706== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Linus Walleij writes: > We were previously selecting 1024x768 and 32BPP as the default > set-up for the PL111 consumers. > > This does not work on elder systems: the device tree bindings > support a property "max-memory-bandwidth" in bytes/second that > states that if you exceed this the memory bus will saturate. > The result is flickering and unstable images. > > Parse the "max-memory-bandwidth" and respect it when > intializing the driver. On the RealView PB11MP, Versatile and > Integrator/CP we get a nice console as default with this code. > > Signed-off-by: Linus Walleij > --- > ChangeLog v1->v2: > - Exploit the new .mode_valid() callback we added to the > simple KMS helper. > - Use the hardcoded bits per pixel per variant instead of > trying to be heuristic about this setting for now. > --- > drivers/gpu/drm/pl111/pl111_display.c | 30 ++++++++++++++++++++++++++++++ > drivers/gpu/drm/pl111/pl111_drm.h | 1 + > drivers/gpu/drm/pl111/pl111_drv.c | 6 ++++++ > 3 files changed, 37 insertions(+) > > diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c > index d75923896609..a1ca9e1ffe15 100644 > --- a/drivers/gpu/drm/pl111/pl111_display.c > +++ b/drivers/gpu/drm/pl111/pl111_display.c > + if (bw > priv->memory_bw) { > + DRM_DEBUG("%d x %d @ %d Hz, %d cpp, bw %llu too fast\n", > + mode->hdisplay, mode->vdisplay, mode->clock, cpp, bw); > + > + return MODE_BAD; > + } Oh, hey, on platforms with no memory-bandwidth property, we should make sure not to reject all modes :) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlqPKH4ACgkQtdYpNtH8 nuiV+BAAoiWCoIV3nWUdOwyXM9fZUI6Hve0+0J7qrkfRLzV1miT4H5I9vTKXNWKJ XhyTvyUPBWGpUJBSCKKHmPQ6DWjBPJRqUMMF+Bzlhlylyw74uPyCqkByIPGyqy0M pIMB/IZupHhCFNQhzImh/dS8HwATHluPGMygM6u5GQb0LI/xDd+Vy2xzaO89GHl3 GIbgzj08mYVvsm7pxiU/GWMRBgTFI4Z2T5aC35lZCP8IaksMlf7I1U5/9g+3xRPX 7nsgFkjqqKsqyimgKdpv/tG3YkzL9nVWNqbjvxRGsRwIwuToyPgF3iuRj1bYI7cQ 4b+yEwanTsZGlQQ+IGZ9HyF/LPi1npOCa3cqebGJfgTy7X0QcUmEYAhBAfciq2Up a015Hu873/8UI3uA1ouP+WFrPfwLWhbZyhMF7GiaI6EGI/S897IA9dsHsXmg2mUs 23XuHcXARlgNneTiNv07svfxu2uErv+xsTMXRLqmOzZtskkvRCBYHa7MxukkU6Nk 98VZayPb62uGD81pJTbkvVIDsYb9iMnOg1+MzzgiH+gDV+GhyR3R/A2x9NiI84F4 XbB2M7pekhw4FzuU2evdKLnhIiu/o1VYIVN6cYWOQHdBXDmWWnqMcokdccVBOr9S VzTE9Fjb18xfMrLa9Mr5+UewZVr8PBl9PFhzgwYqMEHxwBpDKJY= =ZWXN -----END PGP SIGNATURE----- --=-=-=-- --===============1930676706== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1930676706==--