From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NfP4o-0002hV-Ux for mharc-grub-devel@gnu.org; Wed, 10 Feb 2010 21:46:47 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfP4m-0002fI-S2 for grub-devel@gnu.org; Wed, 10 Feb 2010 21:46:44 -0500 Received: from [199.232.76.173] (port=44402 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfP4m-0002f9-91 for grub-devel@gnu.org; Wed, 10 Feb 2010 21:46:44 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfP4k-0005G0-V0 for grub-devel@gnu.org; Wed, 10 Feb 2010 21:46:44 -0500 Received: from mail-bw0-f219.google.com ([209.85.218.219]:47903) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfP4j-0005Fk-DV for grub-devel@gnu.org; Wed, 10 Feb 2010 21:46:41 -0500 Received: by bwz19 with SMTP id 19so666834bwz.8 for ; Wed, 10 Feb 2010 18:46:40 -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=GqB594WD6e73Ta7DGBCJopE0O8C0Yg0T9Q5kgCF0BTM=; b=p1pecSTMyq6eMP9ESyVkiWZhQUFGPGJ1oWRMKAoDWyDg28mmVa0bHsWrqxFIlQLBGt Ix7+FRqVIxDaY+tDWS5UFloEh+trdRxPTZu+qOCgF8ac014u8f5SgQIZZ/VFQaTE26OC B7laI10K+ZZivg5CwzWs6TzZK2UrKZ5XmKX5o= 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=YuvCUUmPl6KtdSTvqd050LAPeP+6vA1M/AoRBblC2GC4Nmn3M66GehHf1ChKrHIebY +eVtsEC3xIers1NYpleX8pS0MFEmjqn4fhG58AgsREpv6lV4Z3ouiWDn2mPtTdNXBpqx OUnxalaUIMwHCxod1IhV2dWuz1c/XDojpNrVk= Received: by 10.204.2.206 with SMTP id 14mr738862bkk.189.1265856399857; Wed, 10 Feb 2010 18:46:39 -0800 (PST) Received: from debian.bg45.phnet (gprs27.swisscom-mobile.ch [193.247.250.27]) by mx.google.com with ESMTPS id 16sm846352bwz.7.2010.02.10.18.46.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Feb 2010 18:46:38 -0800 (PST) Message-ID: <4B736F82.7010005@gmail.com> Date: Thu, 11 Feb 2010 03:46:26 +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 GRUB 2 References: In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig07E6341AF66D5318FBC0EB2F" 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 02:46:45 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig07E6341AF66D5318FBC0EB2F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Michal Suchanek wrote: > Hello > > Sending a preliminary framebuffer rotation patch. > > You can use videotest to see 4 tiles rotated from the same bitmap data.= > > =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? + + sans =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? - 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? +/* 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 coordi= nates 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) +{ + if (x > y) + return y; + else + return x; +} + Same here + + int transform; I would prefer an enum Skipping term/gfxterm.c since it has to be adjusted for gfxmenu-related gfxterm.c updates. - set_pixel (dst, x + i, y + j, dst_color); - } + if (transform & FB_TRAN_SWAP) + set_pixel (dst, x + j*dy, y + i*dx, dst_color); + else + set_pixel (dst, x + i*dx, y + j*dy, dst_color); + } Could you split it into 4 functions? I understand it's the slow fallback function but still it should be kept as fast as possible. Perhaps you could consider compiling same file with different #define's to obtain function variants grub_err_t -grub_video_fb_set_viewport (unsigned int x, unsigned int y, - unsigned int width, unsigned int height) +grub_video_fb_set_viewport (int x, int y, int width, int height) { You don't check for x < 0 and y < 0 > Known issues: > > - font glyphs and terminal do not rotate properly > - no accelerated blitters for rotated modes, at least the 1bit blitter > should work > > =20 > To be done > > - split out signed rectangle patch that changes graphics coordinates > from unsigned to signed > - make up some naming scheme and rename functions and macros accordingl= y > - make up some acceptable way to specify framebnuffer rotation in the > environment like gfxmode > > Thanks > > Michal > =20 > -----------------------------------------------------------------------= - > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig07E6341AF66D5318FBC0EB2F 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 iF4EAREKAAYFAktzb4gACgkQNak7dOguQgniegD+I2JhpIXF7Ra2b85GOq31MGgq UDlX4No2xJji/hSUvYIBAKj1NN8hIbAzCdJGA5snM+lUdQmPAPf23OvcR5T3mK5L =baaJ -----END PGP SIGNATURE----- --------------enig07E6341AF66D5318FBC0EB2F--