From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH 02/23] drm: omapdrm: fb: Don't store format BPP for each plane Date: Tue, 10 May 2016 10:14:17 +0300 Message-ID: <57318A49.20306@ti.com> References: <1461702945-14185-1-git-send-email-laurent.pinchart@ideasonboard.com> <57277593.10303@ti.com> <3238575.Acs1L0uYI1@avalon> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1375805457==" Return-path: Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 310A16E58B for ; Tue, 10 May 2016 07:14:24 +0000 (UTC) In-Reply-To: <3238575.Acs1L0uYI1@avalon> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Laurent Pinchart , Rob Clark Cc: "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org --===============1375805457== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="suL958Guk9UcjenhlIdvqHxmLpt4NqmCt" --suL958Guk9UcjenhlIdvqHxmLpt4NqmCt Content-Type: multipart/mixed; boundary="DsjuB3u987FuOqxFrHa8htmJfXesx9Irq" From: Tomi Valkeinen To: Laurent Pinchart , Rob Clark Cc: "dri-devel@lists.freedesktop.org" Message-ID: <57318A49.20306@ti.com> Subject: Re: [PATCH 02/23] drm: omapdrm: fb: Don't store format BPP for each plane References: <1461702945-14185-1-git-send-email-laurent.pinchart@ideasonboard.com> <57277593.10303@ti.com> <3238575.Acs1L0uYI1@avalon> In-Reply-To: <3238575.Acs1L0uYI1@avalon> --DsjuB3u987FuOqxFrHa8htmJfXesx9Irq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/05/16 23:57, Laurent Pinchart wrote: >> fwiw, I guess a lot of data from that table could these days be >> replaced w/ some of the drm format helpers >> (drm_format_num_planes()/drm_format_plane_cpp()/drm_format_{horz,vert}= _chrom >> a_subsampling()/etc) >=20 > I don't like those helpers as they're inefficient. Drivers often need t= o know=20 > multiple pieces of information about a format, and the API forces look-= ups for=20 > every piece of information needed. >=20 > Would it make sense to add a drm_format_info() function that returns a = pointer=20 > to a data structure that describes the format, and reimplement the exis= ting=20 > helpers on top of that ? I do like that idea. A table implementation might possibly be faster even with the current API. Those big switch-cases compile into a big pile of if-else-if-else-ifs, whereas a for loop would compile into just a few instructions. But just guessing here =3D). In theory, the table could be sorted, making the lookup much faster, but I'm not sure if that's worth the effort. Tomi --DsjuB3u987FuOqxFrHa8htmJfXesx9Irq-- --suL958Guk9UcjenhlIdvqHxmLpt4NqmCt 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 iQIcBAEBCAAGBQJXMYpJAAoJEPo9qoy8lh71T6UQAI3hzBPtpdQDL39pkocd4ACx NAM/HQmdt74fD1CE8Gm3L/QE26JrLnHwaTqXCw5j37O0Sgu+x3D4aHPWw892JFj7 LRqT7ODv2PgJVTTWjzmZmITn4HOMMSK9tOU61JirCGF4FwwE3iRmK1GidztRoVkL 0pF/mlttV0gMK2OhqWsllJUmyswhCaR6flIrJSOmZwN5CKYi9hFjZKhNVKwkND/p GKrFazJSDI40Hqng8GLChUEd9l9c1ifuXnfupQcyNXGu69cE0X/ktjWLza5Mvl0q OzqLO7i/Ot5NASpDMKztNjLOjNjDMeRv0KGdqh7CMJ5u8vTiAvjI4VJ0gZO1gop+ 22gYWFZuR3vshZxvRQqkj5rWptKJjfvzThlfTOkNjwZfTpMA+Uy6OOz1B8GDzKOg T8TNCRkzO1+gndVSMJ9ZdiRmLSUfBEKiEemKIiR4MCEdUapRDbLMEUW0JKx5WlEj Cl1yHS9PCsbFgdZlu1otb++bykMTIdhN7Aa1Ygg1wypJulYaKpqzz6NPHVNt2l/G +kAHl5VLHeo6AKHbe+tcmQ5d76MgXaShYiOgEE6Rx3xJpwzENOvVqLp3CFcLRRom awfb1QfLVijdsVUx6Wy543XsSXivmRAnHCONZH0LhEctF3lbdSIgpWCeWxgxuRVI QUB2T7hbzJIN2u0c3Utg =6Qzi -----END PGP SIGNATURE----- --suL958Guk9UcjenhlIdvqHxmLpt4NqmCt-- --===============1375805457== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1375805457==--