Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NhPyq-0006s7-4K for mharc-grub-devel@gnu.org; Tue, 16 Feb 2010 11:08:56 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NhPyo-0006rn-Md for grub-devel@gnu.org; Tue, 16 Feb 2010 11:08:54 -0500 Received: from [140.186.70.92] (port=41189 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhPyn-0006rC-CH for grub-devel@gnu.org; Tue, 16 Feb 2010 11:08:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NhPyj-0000UT-VT for grub-devel@gnu.org; Tue, 16 Feb 2010 11:08:51 -0500 Received: from mail-yx0-f175.google.com ([209.85.210.175]:57519) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NhPyj-0000UJ-SC for grub-devel@gnu.org; Tue, 16 Feb 2010 11:08:49 -0500 Received: by yxe5 with SMTP id 5so5219040yxe.24 for ; Tue, 16 Feb 2010 08:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type:content-transfer-encoding; bh=wS/isld2BOmq1nbfyd3/66sp0f64YAOiU6Vbl/5mph4=; b=kDquBcHE5xRKGNtn6EgiMxwsV2qHVxAkPAR/aRx8b8zTPAg3Px5MPbVfK3mgT0ouxd as7HDTHM3yTbVtmsAZ/iXexP6PbA0GTTcSFG9IfUCL2t3hvFi8m3wxv5QUG8M0T0wjWN AM9nCHOf4YyIh67ZsHJzbBcNoNb6wgQvKDRYA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=D//fjzsNrw4bUshNFSWO4HpP+h9E4Ag747ThadkwSgINfl6dFAnfOL10THxhrlP6iG 9rBO8/XgVa7kpqV6r54RRyasCIhiKP2KaMzt8Osv40UQJmK2Zx88/QKORTR3p68ou8x3 bUaL0CwoLQbz5RrrudeUB9w3x/GXW3TjzN87w= MIME-Version: 1.0 Sender: hramrach@gmail.com Received: by 10.239.188.129 with SMTP id p1mr687531hbh.190.1266336528328; Tue, 16 Feb 2010 08:08:48 -0800 (PST) In-Reply-To: <4B736F82.7010005@gmail.com> References: <4B736F82.7010005@gmail.com> From: Michal Suchanek Date: Tue, 16 Feb 2010 17:08:28 +0100 X-Google-Sender-Auth: a2ae12709fdf50e1 Message-ID: To: The development of GNU GRUB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [RFC] Framebuffer rotation patch X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 16:08:55 -0000 2010/2/11 Vladimir '=CF=86-coder/phcoder' Serbinenko : > Michal Suchanek wrote: >> Hello >> >> Sending a preliminary framebuffer rotation patch. >> >> You can use videotest to see 4 tiles rotated from the same bitmap data. >> >> > +char leaf_data[] =3D { 0x00, 0x0f, 0xe0, 0x00, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0= x00, 0x7f, 0xfc, 0x00, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0= x01, 0xff, 0xff, 0x00, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0= x03, 0xff, 0xff, 0x80, > This is a blob. Could it be generated automatically at build time? > + > + =C2=A0sans =3D grub_font_get ("Helvetica Bold 14"); > Please use free font rather than Helvetica > Could you split addition of videotests from the rest of the patch? > - =C2=A0 =C2=A0unsigned int x; > - =C2=A0 =C2=A0unsigned int y; > - =C2=A0 =C2=A0unsigned int width; > - =C2=A0 =C2=A0unsigned int height; > + =C2=A0 =C2=A0int x; > + =C2=A0 =C2=A0int y; > + =C2=A0 =C2=A0int width; > + =C2=A0 =C2=A0int height; > Why do you need negative values? > +/* Supported operations are simple and easy to understand. > + * MIRROR =C2=A0| =C2=A0swap image across (around) the vertical axis > + * FLIP =C2=A0 =C2=A0- =C2=A0swap image across the horizontal axis - ups= ide down > + * SWAP =C2=A0 =C2=A0/ =C2=A0swap image across the x=3Dy axis - swap the= x and y coordinates > It's just a D_8 group. Could you add a comment to functions what they do > in group theoretical sense? It would make the code easier to follow and > compute transformations for mathematicians. Perhaps another > representation of D_8 would result in more efficient code? > +static inline void grub_swap_int(int *a, int *b) { int tmp =3D *a; *a = =3D > *b; *b =3D tmp; } > +static inline void grub_swap_unsigned(unsigned *a, unsigned *b) { > unsigned tmp =3D *a; *a =3D *b; *b =3D tmp; } > + > With typeof macro this can be made type-neutral avoiding potential mistak= es. > +static inline long > +grub_min (long x, long y) > +{ > + =C2=A0if (x > y) > + =C2=A0 =C2=A0return y; > + =C2=A0else > + =C2=A0 =C2=A0return x; > +} > + I don't see how typeof would be used. As I understand the docs it can only set types relative to something what is already defined (and in some cases actually dereference/call it) and there is nothing defined at the point these functions are declared to copy the type from. Still the grub_min being long is somewhat suspicious. iirc I just reused an existing function or copied grub_max. If declaring it as long can cause problems then its utility as a general purpose function is dubious. Thanks Michal