From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Nfbak-0003gt-Jb for mharc-grub-devel@gnu.org; Thu, 11 Feb 2010 11:08:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nfbaj-0003gQ-5v for grub-devel@gnu.org; Thu, 11 Feb 2010 11:08:33 -0500 Received: from [199.232.76.173] (port=48583 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nfbai-0003fz-Fp for grub-devel@gnu.org; Thu, 11 Feb 2010 11:08:32 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nfbah-0007pt-0K for grub-devel@gnu.org; Thu, 11 Feb 2010 11:08:32 -0500 Received: from mail-bw0-f219.google.com ([209.85.218.219]:49130) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nfbag-0007pX-75 for grub-devel@gnu.org; Thu, 11 Feb 2010 11:08:30 -0500 Received: by bwz19 with SMTP id 19so450047bwz.8 for ; Thu, 11 Feb 2010 08:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=7kRNtCGl+Q9TFfr6+msuMZekv8qt2siRG3wkCwxSqv4=; b=i8KILcZ107O2i7Wc9NUvyZq8X96R4cZMUWvl3bzMw8WqLjgneLHAvUpagzibe3WtIc dEbsznFK7JaopmCYmvzLW/IPbjp7DYYu6yJtwQ290PZFOkro2f+IWlt5vELoBCGMNeN1 PTGyPgkPY4FGeSjfgmcfAURS0KumBMsCqHBvU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=n0zegftALyw7cUDfAxAYr+Uxt9GhHG/OrGlnPZ1BBIZ0XQRKzYGhbnSbtIyggeMHBN g+G9IZmTZbHStowayEqK0oQZdh2j7Sbab7TnFJVWsYRlt28dUMQ1nXDW67ifqig0xr5O iv2Gbe4DuP4N9lkW7e7hMiDSURUd5/4pgo/Ww= Received: by 10.204.151.216 with SMTP id d24mr51753bkw.1.1265904508544; Thu, 11 Feb 2010 08:08:28 -0800 (PST) Received: from debian.bg45.phnet (gprs39.swisscom-mobile.ch [193.247.250.39]) by mx.google.com with ESMTPS id 14sm1136740bwz.9.2010.02.11.08.08.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Feb 2010 08:08:27 -0800 (PST) Message-ID: <4B742B70.3080303@gmail.com> Date: Thu, 11 Feb 2010 17:08:16 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <4B736F82.7010005@gmail.com> In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig67D8589688E01C64DBE11849" X-detected-operating-system: by monty-python.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: Thu, 11 Feb 2010 16:08:33 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig67D8589688E01C64DBE11849 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Michal Suchanek wrote: > 2010/2/11 Vladimir '=CF=86-coder/phcoder' Serbinenko : > =20 >> Michal Suchanek wrote: >> =20 >>> Hello >>> >>> Sending a preliminary framebuffer rotation patch. >>> >>> You can use videotest to see 4 tiles rotated from the same bitmap dat= a. >>> >>> >>> =20 >> +char leaf_data[] =3D { 0x00, 0x0f, 0xe0, 0x00, >> + 0x00, 0x7f, 0xfc, 0x00, >> + 0x01, 0xff, 0xff, 0x00, >> + 0x03, 0xff, 0xff, 0x80, >> This is a blob. Could it be generated automatically at build time? >> =20 > > How less of a blob it would be if it was included as a bitmap? > > =20 It's not easily editable in current form. > This is just a shape used for the video tests. > > There are some X tools for working with bitmaps/pixmaps which could > generate this from a viewable file but they are usually not available > on Windows and other non-X platforms AFAIK. > > =20 Using XBM is fine (it's easily editable in either gimp or emacs) and you should be able to #include "leaf1.xbm" >> + >> + sans =3D grub_font_get ("Helvetica Bold 14"); >> Please use free font rather than Helvetica >> =20 > > I am pretty sure I did not choose the fonts, they must have been there > before I started with modifications to the tests. > > =20 Ok, it has to be fixed in mainstream then. >> Could you split addition of videotests from the rest of the patch? >> - unsigned int x; >> - unsigned int y; >> - unsigned int width; >> - unsigned int height; >> + int x; >> + int y; >> + int width; >> + int height; >> Why do you need negative values? >> =20 > > I don't need the negative values everywhere but this change was to > align the typing so that casts are not required. > > =20 Perhaps few casts together with appropiate checks when casting is better than potentially exposing the whole code to the values it's not intended for. >> +/* Supported operations are simple and easy to understand. >> + * MIRROR | swap image across (around) the vertical axis >> + * FLIP - swap image across the horizontal axis - upside down >> + * SWAP / swap image across the x=3Dy axis - swap the x and y coo= rdinates >> 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 an= d >> =20 > > Obviously it is a group,=20 > any set of transforms closed on composition is. > > =20 Not true. Consider an example of empty set: it has no identity element. Less trivial counter-example: set of transformations: (x,y)->(kx,ky), 0 And according to Wikipedia it's actually called D4. > > =20 There are 2 conventions for naming dihedral groups: 1) Geometrical: since dihedral group is a symetry group of a regular n-gone it's called D_n 2) Algebraical: since dihedral group has 2n elements it's called D_{2n} Sometimes these conventions bear to confusion. >> compute transformations for mathematicians. Perhaps another >> representation of D_8 would result in more efficient code? >> =20 > > If you have clearer explanation or more efficient code please share. > > =20 I was thinking of using 2 generators instead of 3: 1) standard generators: s=3Drot90 or rot270, t=3Dany reflection. Then all= elements are s^k or s^k*t. It makes computation of composition easier. Rules on generators are: s^n=3Dt^2=3D1 tst=3Ds^{-1} 2) or using 2 reflections. E.g. u=3D| and v=3D/. You already figured how = to generate with u=3D|, v=3D/, w=3D- But w=3Duvuv Then rules of computation are: u^2=3Dv^2=3D(uv)^4=3D1 >> +static inline long >> +grub_min (long x, long y) >> +{ >> + if (x > y) >> + return y; >> + else >> + return x; >> +} >> + >> Same here >> + >> + int transform; >> I would prefer an enum >> =20 > > This is a bit field. How does it transform into an enum? > =20 enum my_bitfield { MY_BITFIELD_NONE=3D0, MY_BITFIELD_BIT0 =3D 1 << 0, MY_BITFIELD_BIT1 =3D 1 << 1, MY_BITFIELD_BIT2 =3D 1 << 2 }; > I would rather get a patch with minimal changes first so that it's > obvious what it does. > > I can look into separating this later. > > =20 ok --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig67D8589688E01C64DBE11849 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAkt0K3YACgkQNak7dOguQgn26gD+NOIRHSDF+2cZtA33eIkVtR9Y izw3w7J+XbqE43gW0pUBAKAr8Vd/6sBBfwEPOFqsPIEVCZxkR9sT++f1NLlXTMVx =AAu1 -----END PGP SIGNATURE----- --------------enig67D8589688E01C64DBE11849--