From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajAXl-0006Ia-Ma for qemu-devel@nongnu.org; Thu, 24 Mar 2016 15:03:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajAXg-000319-Mp for qemu-devel@nongnu.org; Thu, 24 Mar 2016 15:03:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajAXg-00030e-FV for qemu-devel@nongnu.org; Thu, 24 Mar 2016 15:03:36 -0400 References: <1458843489-14104-1-git-send-email-dhannawatpooja1@gmail.com> From: Eric Blake Message-ID: <56F43A06.9090700@redhat.com> Date: Thu, 24 Mar 2016 13:03:34 -0600 MIME-Version: 1.0 In-Reply-To: <1458843489-14104-1-git-send-email-dhannawatpooja1@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IcARmIWjAbqjkDbJjORRrgqsjHl30Xkp0" Subject: Re: [Qemu-devel] [PATCH v4] blizzard: Remove support for DEPTH != 32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pooja Dhannawat , qemu-devel@nongnu.org Cc: kraxel@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IcARmIWjAbqjkDbJjORRrgqsjHl30Xkp0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/24/2016 12:18 PM, Pooja Dhannawat wrote: > Removing support for DEPTH !=3D 32 from blizzard template header > and file that includes it, as macro DEPTH =3D=3D 32 only used. >=20 > Signed-off-by: Pooja Dhannawat > --- > #define DEPTH 32 > #include "blizzard_template.h" > =20 > + assert(surface_bits_per_pixel(surface) =3D=3D 32) So this confirms that we only ever cared about DEPTH =3D=3D 32. > + > + s->line_fn_tab[0] =3D blizzard_draw_fn_32; > + s->line_fn_tab[1] =3D blizzard_draw_fn_r_32; But now we are in the situation of having to look in the blizzard_template.h file... > +++ b/hw/display/blizzard_template.h > @@ -19,31 +19,7 @@ > */ > =20 > #define SKIP_PIXEL(to) (to +=3D deststep) > +#if DEPTH =3D=3D 32 > # define PIXEL_TYPE uint32_t > # define COPY_PIXEL(to, from) do { *to =3D from; SKIP_PIXEL(to); } wh= ile (0) > # define COPY_PIXEL1(to, from) (*to++ =3D from) > @@ -58,9 +34,6 @@ > static void glue(blizzard_draw_line16_, DEPTH)(PIXEL_TYPE *dest, > const uint16_t *src, unsigned int width) =2E..and to reconstruct the results of the glue() macros to find the actual function definitions that we are using. I think this patch is okay as a first step, but I think we can go one step further in a followup patch: remove the glue() magic, delete blizzard_template.h, and just declare the used functions directly in blizzard.c. > @@ -74,7 +47,6 @@ static void glue(blizzard_draw_line16_, DEPTH)(PIXEL_= TYPE *dest, > data >>=3D 5; > COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b)); And even without getting rid of the .h, there are some cleanups you can do now that DEPTH is a constant. For example, this line can shorten to: COPY_PIXEL1(dest, rgb_to_pixel32(r, g, b)); which in turn becomes a bit more legible as: *dest++ =3D rgb_to_pixel32(r, g, b); Since what you have is incrementally better, I'm fine if you add: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IcARmIWjAbqjkDbJjORRrgqsjHl30Xkp0 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW9DoGAAoJEKeha0olJ0Nqax4H/1pSOGMAZxhaf2ltHWbahZUw 0MXOBV2a8SamztvTCRq9bsQ/LdN6KxSgYGq30Dj8MtLdmp8BPWs1sf+cxdc6dPYj EBVHgPldwoVXQ0VAJ+X4Xd/w5AmilNLPoxqdX1DFXWYY04uySSKgMJ/WZJec03Hq P0VCSr0zlAJ1UMNL9M1orwjfTFSyrzKG/zVByaxzYk2Xzt0qRAWx3V0NRe/j7T4c WnDxqEbIsajeeYxdUZ3qho3OR16nxrWQS9UA9GLmBeOvbL07yLsDZAhueFpHyhC+ EGwZ9m2OdjIMXnj8sxmLz+w4WDxmISP1O9RzGaOM/a4r+6io2fDLuWqDC1usvVA= =2rbx -----END PGP SIGNATURE----- --IcARmIWjAbqjkDbJjORRrgqsjHl30Xkp0--