From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1QZvLF-0002k2-Kk for mharc-grub-devel@gnu.org; Thu, 23 Jun 2011 21:37:53 -0400 Received: from eggs.gnu.org ([140.186.70.92]:51306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZvLB-0002jp-KZ for grub-devel@gnu.org; Thu, 23 Jun 2011 21:37:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZvLA-0006rZ-Hl for grub-devel@gnu.org; Thu, 23 Jun 2011 21:37:49 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:56164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZvLA-0006rR-Ak for grub-devel@gnu.org; Thu, 23 Jun 2011 21:37:48 -0400 Received: by wwf22 with SMTP id 22so1985202wwf.30 for ; Thu, 23 Jun 2011 18:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:x-enigmail-version:content-type; bh=x45m8DcBKQIUh8Dlcc/zPexQ5EJwpTcQXvwkC6JIJno=; b=ETH++rxjZLUB1t8m6NTzVpXdqh30yS3L8G8ORiDTPvLJIJE9rgP+u6ReTM9B3Yrf0b ORMDzAiJSARqT5SsJELTfr/5YLFZujpDC6TkMJn8QwQZigVKIlunv1OdDuhXypja8i+Y Tr2mjvvgfSfwFxCLbaQy+FXrMJ7JDz6FrMJIY= 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=rJohJ5EOKj2jsq0wCIrCiMB9GB4oV+W/7n0QM7CewjfVRdF4WKACMtTXW7B/evIu9b 0Ryz3/RMWiHFRyPoT72iqHh3O1HokGGBi2AoWYUOWmjIgcqCuzsQaNQWHv9VQRVSimvG LaTFccS1XSqgJ03mAxnJgMR843us8N3UMLPzs= Received: by 10.216.122.10 with SMTP id s10mr98133weh.34.1308879467310; Thu, 23 Jun 2011 18:37:47 -0700 (PDT) Received: from debian.x201.phnet (32-1.203-62.cust.bluewin.ch [62.203.1.32]) by mx.google.com with ESMTPS id w10sm1138965weq.27.2011.06.23.18.37.43 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Jun 2011 18:37:44 -0700 (PDT) Message-ID: <4E03EA66.8000500@gmail.com> Date: Fri, 24 Jun 2011 03:37:42 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110606 Iceowl/1.0b2 Icedove/3.1.10 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: [PATCH] Indicate current video mode in videoinfo References: <20110114203520.GA15515@riva.ucam.org> In-Reply-To: <20110114203520.GA15515@riva.ucam.org> X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig7F778C4D2F7B4532568DB58A" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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: Fri, 24 Jun 2011 01:37:51 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7F778C4D2F7B4532568DB58A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Go ahead On 14.01.2011 21:35, Colin Watson wrote: > This would make debugging video problems a bit easier. > > 2011-01-14 Colin Watson > > * grub-core/commands/videoinfo.c (hook): Indicate current video > mode with `*'. > (grub_cmd_videoinfo): Fetch current video mode. > > =3D=3D=3D modified file 'grub-core/commands/videoinfo.c' > --- grub-core/commands/videoinfo.c 2010-09-15 12:37:28 +0000 > +++ grub-core/commands/videoinfo.c 2011-01-14 20:34:26 +0000 > @@ -26,6 +26,7 @@ > #include > =20 > static unsigned height, width, depth;=20 > +static struct grub_video_mode_info *current_mode; > =20 > static int > hook (const struct grub_video_mode_info *info) > @@ -39,7 +40,13 @@ hook (const struct grub_video_mode_info > if (info->mode_number =3D=3D GRUB_VIDEO_MODE_NUMBER_INVALID) > grub_printf (" "); > else > - grub_printf (" 0x%03x ", info->mode_number); > + { > + if (current_mode && info->mode_number =3D=3D current_mode->mode_= number) > + grub_printf ("*"); > + else > + grub_printf (" "); > + grub_printf (" 0x%03x ", info->mode_number); > + } > grub_printf ("%4d x %4d x %2d ", info->width, info->height, info->b= pp); > =20 > if (info->mode_type & GRUB_VIDEO_MODE_TYPE_PURE_TEXT) > @@ -120,6 +127,8 @@ grub_cmd_videoinfo (grub_command_t cmd _ > =20 > FOR_VIDEO_ADAPTERS (adapter) > { > + struct grub_video_mode_info info; > + > grub_printf ("Adapter '%s':\n", adapter->name); > =20 > if (!adapter->iterate) > @@ -128,7 +137,17 @@ grub_cmd_videoinfo (grub_command_t cmd _ > continue; > } > =20 > - if (adapter->id !=3D id) > + current_mode =3D NULL; > + > + if (adapter->id =3D=3D id) > + { > + if (grub_video_get_info (&info) =3D=3D GRUB_ERR_NONE) > + current_mode =3D &info; > + else > + /* Don't worry about errors. */ > + grub_errno =3D GRUB_ERR_NONE; > + } > + else > { > if (adapter->init ()) > { > @@ -143,6 +162,8 @@ grub_cmd_videoinfo (grub_command_t cmd _ > =20 > adapter->iterate (hook); > =20 > + current_mode =3D NULL; > + > if (adapter->id !=3D id) > { > if (adapter->fini ()) > > Thanks, > --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig7F778C4D2F7B4532568DB58A 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.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk4D6mYACgkQNak7dOguQgkNVgD7B8+LrdXSIBiZZfdGhiPuq/Ls VmyNgtD/cMc+8LOwvaYA/0UH8T0MsDDS30DV0cP+OIXIVpzeUXhFkQHWjacMu6eD =Rf8q -----END PGP SIGNATURE----- --------------enig7F778C4D2F7B4532568DB58A--