From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antonino Daplas Subject: Re: Portrait display mode Date: 12 Sep 2002 03:50:23 +0800 Sender: linux-fbdev-devel-admin@lists.sourceforge.net Message-ID: <1031773864.562.3.camel@daplas> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-LdIWIMCTX3kuF0Jcc13C" Return-path: Received: from [203.167.79.9] (helo=willow.compass.com.ph) by usw-sf-list1.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 17pDU8-0000OZ-00 for ; Wed, 11 Sep 2002 12:49:12 -0700 In-Reply-To: Errors-To: linux-fbdev-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: Geert Uytterhoeven Cc: otto.wyss@bluewin.ch, fbdev --=-LdIWIMCTX3kuF0Jcc13C Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, 2002-09-11 at 14:38, Geert Uytterhoeven wrote: > > > turnable display I rather see this feature implemented. I even may help but can > > > spend much time. How difficult would it be? > > > > > It should not be too difficult to add per-driver support once the > > Can't this be moved up to generic code, so we don't have to modify all drivers? > I have thought about that, but since the patch was preliminary, I chose not to disrupt the framework yet. The tricky part in making the support generic is display panning. Here is my train of thought. Moving support into fbgen might involve a few assumptions. Firstly, info->var is assumed to be device specific (ie, it does not care about the orientation). Secondly, the display->var as well as those received from other sources (such as in an ioctl call) are partly device independent. When a structure var is passed to the driver, it will undergo conversion so the structure is sane from the driver's perspective. The same is done vice-versa. I've introduced two (exportable) functions, convert_var_to_physical(), and convert_var_to_logical() that should do that. All fbops functions should be passed with device-specific var except for fb_set_var since I'm not too sure where to look for specific entry points for fb_set_var. I guess fb_check_var and fb_pan_display are the most critical ones, since the other fbops functions do not look at the framelengths, nor the offsets. With the changes, drivers that support fbcon_accel and gen_* functions should have support for console rotation automatically. For those that support fbcon_accel, but not gen_* functions, the driver should not look at display->var anymore, but look instead into info->var. If possible, use the convert_to_var functions when passing/getting information to/from structure display. For those, that don't support fbcon_accel, behaviour should remain as usual. I'm not too sure if this is the correct way of doing this, but it's the best I can think of at the moment without causing very intrusive changes. Attached is a patch (fb_rotate2.diff). Please apply the patches I have sent previously before applying this patch. Tony --=-LdIWIMCTX3kuF0Jcc13C Content-Disposition: attachment; filename=fb_rotate2.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/x-patch; name=fb_rotate2.diff; charset=ISO-8859-1 diff -Naur linux-2.5.33/drivers/video/Config.in linux/drivers/video/Config.= in --- linux-2.5.33/drivers/video/Config.in Wed Sep 11 18:28:40 2002 +++ linux/drivers/video/Config.in Wed Sep 11 18:34:23 2002 @@ -227,7 +227,6 @@ tristate ' 24 bpp packed pixels support' CONFIG_FBCON_CFB24 tristate ' 32 bpp packed pixels support' CONFIG_FBCON_CFB32 tristate ' Hardware acceleration support' CONFIG_FBCON_ACCEL - dep_tristate ' Console Display Rotation support' CONFIG_FBCON_ROT= ATE $CONFIG_FBCON_ACCEL=09 tristate ' Amiga bitplanes support' CONFIG_FBCON_AFB tristate ' Amiga interleaved bitplanes support' CONFIG_FBCON_ILBM tristate ' Atari interleaved bitplanes (2 planes) support' CONFIG= _FBCON_IPLAN2P2 @@ -368,13 +367,6 @@ "$CONFIG_FB_CLPS711X" =3D "m" -o "$CONFIG_FB_3DFX" =3D "m" -o \ "$CONFIG_FB_RIVA" =3D "m" -o "$CONFIG_FB_SGIVW" =3D "m" ]; then=20 define_tristate CONFIG_FBCON_ACCEL m - fi =20 - fi - if [ "$CONFIG_FB_VESA" =3D "y" ]; then - define_tristate CONFIG_FBCON_ROTATE y - else - if [ "$CONFIG_FB_VESA" =3D "m" ]; then=20 - define_tristate CONFIG_FBCON_ROTATE m fi =20 fi if [ "$CONFIG_FB_AMIGA" =3D "y" ]; then diff -Naur linux-2.5.33/drivers/video/Makefile linux/drivers/video/Makefile --- linux-2.5.33/drivers/video/Makefile Wed Sep 11 18:28:49 2002 +++ linux/drivers/video/Makefile Wed Sep 11 18:36:23 2002 @@ -68,7 +68,7 @@ obj-$(CONFIG_FB_S3TRIO) +=3D S3triofb.o obj-$(CONFIG_FB_TGA) +=3D tgafb.o obj-$(CONFIG_FB_VESA) +=3D vesafb.o cfbfillrect.o cfbcopyarea.= o cfbimgblt.o=20 -obj-$(CONFIG_FB_VGA16) +=3D vga16fb.o fbcon-vga-planes.o +obj-$(CONFIG_FB_VGA16) +=3D vga16fb.o fbcon-vga-planes.o=20 obj-$(CONFIG_FB_VIRGE) +=3D virgefb.o obj-$(CONFIG_FB_G364) +=3D g364fb.o cfbfillrect.o cfbcopyarea.= o cfbimgblt.o obj-$(CONFIG_FB_FM2) +=3D fm2fb.o cfbfillrect.o cfbcopyarea.o= cfbimgblt.o @@ -117,8 +117,7 @@ obj-$(CONFIG_FBCON_MFB) +=3D fbcon-mfb.o obj-$(CONFIG_FBCON_HGA) +=3D fbcon-hga.o obj-$(CONFIG_FBCON_STI) +=3D fbcon-sti.o -obj-$(CONFIG_FBCON_ACCEL) +=3D fbcon-accel.o -obj-$(CONFIG_FBCON_ROTATE) +=3D fbcon-rotate.o=20 +obj-$(CONFIG_FBCON_ACCEL) +=3D fbcon-accel.o fbcon-rotate.o =20 include $(TOPDIR)/Rules.make =20 diff -Naur linux-2.5.33/drivers/video/cfbcopyarea.c linux/drivers/video/cfb= copyarea.c --- linux-2.5.33/drivers/video/cfbcopyarea.c Wed Sep 11 18:29:01 2002 +++ linux/drivers/video/cfbcopyarea.c Wed Sep 11 18:30:53 2002 @@ -28,7 +28,6 @@ #include #include