From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jyri Sarha Subject: Re: [PATCH 3/4] drm/omapdrm: Work-a-round for errata i734 (LCD1 Gamma) in DSS dispc Date: Mon, 23 May 2016 12:50:43 +0300 Message-ID: <5742D273.5020204@ti.com> References: <573F0F48.7090902@ti.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1189627943==" Return-path: Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F5F16E543 for ; Mon, 23 May 2016 09:50:57 +0000 (UTC) In-Reply-To: <573F0F48.7090902@ti.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Tomi Valkeinen , dri-devel@lists.freedesktop.org Cc: peter.ujfalusi@ti.com, laurent.pinchart@ideasonboard.com List-Id: dri-devel@lists.freedesktop.org --===============1189627943== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3M12HeRL2RlEjNIKdSnjCO0oPKwGGrwEv" --3M12HeRL2RlEjNIKdSnjCO0oPKwGGrwEv Content-Type: multipart/mixed; boundary="QklgfAnlshLKqWldm8Pmi1i5d5v4HiTN7" From: Jyri Sarha To: Tomi Valkeinen , dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, daniel@ffwll.ch, peter.ujfalusi@ti.com, bparrot@ti.com, laurent.pinchart@ideasonboard.com Message-ID: <5742D273.5020204@ti.com> Subject: Re: [PATCH 3/4] drm/omapdrm: Work-a-round for errata i734 (LCD1 Gamma) in DSS dispc References: <573F0F48.7090902@ti.com> In-Reply-To: <573F0F48.7090902@ti.com> --QklgfAnlshLKqWldm8Pmi1i5d5v4HiTN7 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 05/20/16 16:21, Tomi Valkeinen wrote: >> > + >> > +static int dispc_errata_i734_wa_init(void) >> > +{ >> > + size_t buff_size =3D i734.ovli.width * i734.ovli.height * > "buf_size" would match the other names =3D). >=20 > Usually I try to do only simple initializations when declaring the > locals. This is a bit on the complex side, and also there's a check > below that can make all this init calculation not needed. >=20 Compiler optimizations should delay the initialization to happen only if it is needed. I usually try to keep the functions as compact as possible so that they fit on the screen at once. But I think it is better to move the size also inside the struct i734_buf so it we only need to calculate the size once and functions become even smaller :). =2E.. >> > + >> > +static void dispc_errata_i734_wa(void) >> > +{ >> > + u32 vsync_irq =3D dispc_mgr_get_vsync_irq(OMAP_DSS_CHANNEL_LCD); >> > + u32 framedone_irq =3D dispc_mgr_get_framedone_irq(OMAP_DSS_CHANNEL= _LCD); >> > + u32 gatestate =3D REG_GET(DISPC_CONTROL, 8, 4); > Here too, too complex initializations. Especially doing register > reads/writes should be something done in the "real" code. The bits you > read might not even be valid on some platforms which don't have the i73= 4. >=20 You are right about the register read. Compiler should not optimize the register access. But - but with your permission - I'll keep the IRQ mask initializations as they are quite constant in nature anyway. BR, Jyri --QklgfAnlshLKqWldm8Pmi1i5d5v4HiTN7-- --3M12HeRL2RlEjNIKdSnjCO0oPKwGGrwEv 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.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXQtJ5AAoJEJA2s1DX1hlB06UP/1QKZUcO/1hchRUOzAupW8tr cFy8OOo3kTBwL26QwmMtflwm3GZWHq/nX6zfXbFuHE7/rMaRQg6fv0U4Vi4Ecqpu 98uXbr3tffR7Asd2z4KoOugUctpvEoPJm/R/3pf2AcLlyH7/lWMQwx4uWfMDyIO3 7Si/UUtsOOjIe93xjbAUohkmJat8/i1AgA3zmWx2BBRekBMWSmoMkqsmBKpNkN3m ZR2SX44Md+FULx2cnCGeUvLTMLUir8Xkh8Nq3gjbdmfS/FayfWSKbbFOkP8UiA9B 6wlvlqEYai6bTMGim0hkOXajGL2jqZhWbZbxC/Vxhe9kvSipzihwu01yfTJ8qeGT +hlzKXrOnYMhi6hpof7DyHrB9Ca7kCdC1GpQD7qk9C8H0hUXvie7iMm0yNGqtR6h 9ZoMhpsLqlFhJBT9tGatyEmu9elh6FQMP80Dnjj0l9dSn7p3Ur09M0Zy4iddenM5 01Cce+fwJPE7RrDmbRn/EXufZ3arR2noI1hfQIY/ffQlDePzQbG6gj4OAX1z6VOe ft1WYwUQ9J+6fEOY9jVAmlwbXJBUOdc0QjpG9krMVtNUEZV/ki2lqpkQbjVwx/OQ UpdUpBw2J++MHH6soQj1MAREGUGCLajQCsGtgl8zC2XL+at5gaWNoqItL1wZDOvc rtCo8Niclzuzewch4JOE =3yq4 -----END PGP SIGNATURE----- --3M12HeRL2RlEjNIKdSnjCO0oPKwGGrwEv-- --===============1189627943== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1189627943==--