From: Tomi Valkeinen Subject: Re: [PATCH v3 02/11] drm/tilcdc: implement palette loading for rev1 Date: Thu, 24 Nov 2016 12:25:52 +0200 Message-ID: <00d18d98-e73d-ee8d-32f0-5abb560f9743@ti.com> References: <86120d29-a78b-fdbd-5294-0487ffd0fbb7@ti.com> <22b1ba7e-5bd1-7c78-9b14-617843a67b2e@ti.com> <8abccc43-5b8c-b31b-8978-9f7fd2c03d5a@ti.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1798114142==" Return-path: Received: from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id B93AB6E880 for ; Thu, 24 Nov 2016 10:26:00 +0000 (UTC) In-Reply-To: <8abccc43-5b8c-b31b-8978-9f7fd2c03d5a@ti.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Jyri Sarha , dri-devel@lists.freedesktop.org Cc: khilman@baylibre.com, bgolaszewski@baylibre.com, laurent.pinchart@ideasonboard.com List-Id: dri-devel@lists.freedesktop.org --===============1798114142== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cF6h7uiDOjG9c5SPaJJSGJtl7MG4f9Naw" --cF6h7uiDOjG9c5SPaJJSGJtl7MG4f9Naw Content-Type: multipart/mixed; boundary="GgusrLwOhWagnkSdOoD0fllfmm182o9uJ"; protected-headers="v1" From: Tomi Valkeinen To: Jyri Sarha , dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, daniel@ffwll.ch, laurent.pinchart@ideasonboard.com, robdclark@gmail.com, bgolaszewski@baylibre.com, khilman@baylibre.com Message-ID: <00d18d98-e73d-ee8d-32f0-5abb560f9743@ti.com> Subject: Re: [PATCH v3 02/11] drm/tilcdc: implement palette loading for rev1 References: <86120d29-a78b-fdbd-5294-0487ffd0fbb7@ti.com> <22b1ba7e-5bd1-7c78-9b14-617843a67b2e@ti.com> <8abccc43-5b8c-b31b-8978-9f7fd2c03d5a@ti.com> In-Reply-To: <8abccc43-5b8c-b31b-8978-9f7fd2c03d5a@ti.com> --GgusrLwOhWagnkSdOoD0fllfmm182o9uJ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 24/11/16 12:03, Jyri Sarha wrote: > On 11/24/16 11:43, Tomi Valkeinen wrote: >> What is the difference? If mode changes, you need to disable and enabl= e >> the crtc, right? What other cases there are to enable the display? Aft= er >> blank? Then the display has been off, and I presume palette has to be >> loaded. >=20 > At the moment the palette or register values do not appear to vanish > ever. But that is probably due to PM not doing much to optimize the LCD= C > power consumption. If runtime PM for the device goes to suspend, you have to presume the IP has lost all context. That may not always happen, but that's what the driver has to presume, unless there's a way for the driver to verify whether the context has been lost or not. > Anyway, if simple enable is enough to turn on the display - all video > timings, frame buffer dma addresses etc. are already in the registers -= > then I think it is safe to assume that the palette is still in there to= o. As long as the driver makes sure the device doesn't go to suspend (by having called pm_runtime_get). > Then it is a different issue, that I should probably put the same > functionality into PM runtime_suspend() and runtime_resume() callbacks,= > that is currently in suspend() and resume() callbacks, to be ready if P= M > ever does anything more for LCDC that it does today. I could of course > add a test if the registers are still intact before doing a restore. You can do things in resume callback, but I think quite often it's simplest to just do those things when enabling the display. The device never goes to suspend if the display is enabled. And if you disable the display, the device should go to suspend, so usually enable is called after the device has been in suspend. So, I haven't looked at the tilcdc code in detail in this regard, but my guess is that runtime PM resume could be used to set hardcoded things to registers, stuff that you always know how they are set. Everything else can be just programmed at enable. Looking at the registers to find out if they're intact is fine, but it's just an optimization. Tomi --GgusrLwOhWagnkSdOoD0fllfmm182o9uJ-- --cF6h7uiDOjG9c5SPaJJSGJtl7MG4f9Naw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYNsAwAAoJEPo9qoy8lh718h0P/175Itsvknwm+CvF0b1z1qCo Vbh2m5A0uUJ8FXEY3WGMEdqANMrPTtxMKvvMxctz2FAXvubSSAB3s18cXjgAD2sa 43vTfZVbhWArbxt/buEWNvUbeqg08AYG7cdgT+18y7VjEfyEzPiWZOqShWcK9yY6 dzCtcbiS5Jx5vr7WQpJc85P1NfkHkHIw/Drokyr2RKENAuQUXxZseBl5b/fyB76Q 38rA6Y5rZLNaMM8aCGOswQ1QNfS5JhjmhTOt7j6yFvvW6OJa9xIXxc06yFd+nhrT YHw+CN6rc/uJwf7XPuOaungfAA5GmZtBJ3pJmkzbVGR2f6TgnD84Gg3uxyZF9YAO g+M+jxyk3EOJRgLeC+P5X0BO4puSiCPypvbgH8AAq/go2qMY3R+sofIS8mZ6uc9A DL6rdEcKH0c3t9QSNELIgMWK3M5KApnUb+legQvK/qJOjtXckWHGOiiF3AkPWNpQ PNDPumbEyy3zjgWntgdKO51XRO98XppoSQBomIGk8qjwT6cLV1McKFhNpwWrhYyN HwsWzePhdp5XjnkEPrLhRyq/mXyfYnoSX3L/Zy38yApGDWHs//US1/D6zFGnEEGU qdcL4KeSBf+WAuEYu4wyUUkxjV5us7gqUdKFjyo2IF2qZC9sHLED9Me6dVOcLOCR cdtpwXjjDFgMtO4Ke61H =E8iE -----END PGP SIGNATURE----- --cF6h7uiDOjG9c5SPaJJSGJtl7MG4f9Naw-- --===============1798114142== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1798114142==--