All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@hotpop.com>
To: linux-fbdev-devel@lists.sourceforge.net,
	Komal Shah <komal_shah802003@yahoo.com>
Subject: Re: Fb rotation 2.6.x
Date: Wed, 16 Mar 2005 07:47:20 +0800	[thread overview]
Message-ID: <200503160747.20530.adaplas@hotpop.com> (raw)
In-Reply-To: <200503160450.48352.adaplas@hotpop.com>

On Wednesday 16 March 2005 04:50, Antonino A. Daplas wrote:
> On Tuesday 15 March 2005 16:58, Komal Shah wrote:
>
> Sometimes people use multiple fbdevs mapped to different consoles, so a
> set_par() is called for each fb_info mapped for each console.
>
> I guess I can add an "already_initialized" flag so fbcon doesn't do
> multiple set_pars().
>

>
> What fields do you use in var that is important for rotation? Is it
> var->rotate? If that is the case, just add those fields in struct display
> in fbcon.h, and update the functions display_to_var() and var_to_display()
> in fbcon.c to also include the said fields.

Try the attached patch.  It adds var->rotate to the set of parameters saved
by fbcon.  The patch also includes minimizing the number of set_pars done
during init.  Let me know if there are still set_pars that escaped.

BTW, the patch is against my tree, but it should apply reasonably well to
any recent 2.6 kernel + a few rejects which you can easily apply by hand.

Tony

diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
--- a/drivers/video/console/fbcon.c	2004-11-21 22:54:54 +08:00
+++ b/drivers/video/console/fbcon.c	2005-03-16 07:39:24 +08:00
@@ -599,9 +599,10 @@
 
 	ops->currcon = fg_console;
 
-	if (info->fbops->fb_set_par)
+	if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT))
 		info->fbops->fb_set_par(info);
 
+	ops->flags |= FBCON_FLAGS_INIT;
 	ops->graphics = 0;
 
 	if (vc)
@@ -703,6 +704,7 @@
 	disp->green = var->green;
 	disp->blue = var->blue;
 	disp->transp = var->transp;
+	disp->rotate = var->rotate;
 	disp->mode = fb_match_mode(var, &info->modelist);
 	if (disp->mode == NULL)
 		/* This should not happen */
@@ -726,6 +728,7 @@
 	var->green = disp->green;
 	var->blue = disp->blue;
 	var->transp = disp->transp;
+	var->rotate = disp->rotate;
 }
 
 static const char *fbcon_startup(void)
@@ -898,6 +901,7 @@
 static void fbcon_init(struct vc_data *vc, int init)
 {
 	struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
+	struct fbcon_ops *ops;
 	struct vc_data **default_mode = vc->vc_display_fg;
 	struct vc_data *svc = *default_mode;
 	struct display *t, *p = &fb_display[vc->vc_num];
@@ -948,6 +952,8 @@
 	new_cols = info->var.xres / vc->vc_font.width;
 	new_rows = info->var.yres / vc->vc_font.height;
 	vc_resize(vc, new_cols, new_rows);
+
+	ops = info->fbcon_par;
 	/*
 	 * We must always set the mode. The mode of the previous console
 	 * driver could be in the same resolution but we are using different
@@ -955,10 +961,14 @@
 	 *
 	 * We need to do it in fbcon_init() to prevent screen corruption.
 	 */
-	if (CON_IS_VISIBLE(vc) && info->fbops->fb_set_par)
-		info->fbops->fb_set_par(info);
+	if (CON_IS_VISIBLE(vc)) {
+		if (info->fbops->fb_set_par && 
+		    !(ops->flags & FBCON_FLAGS_INIT))
+			info->fbops->fb_set_par(info);
+		ops->flags |= FBCON_FLAGS_INIT;
+	}
 
-	((struct fbcon_ops *) info->fbcon_par)->graphics = 0;
+	ops->graphics = 0;
 
 	if ((cap & FBINFO_HWACCEL_COPYAREA) &&
 	    !(cap & FBINFO_HWACCEL_DISABLED))
diff -Nru a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
--- a/drivers/video/console/fbcon.h	2004-11-21 22:26:19 +08:00
+++ b/drivers/video/console/fbcon.h	2005-03-16 07:39:24 +08:00
@@ -18,6 +18,8 @@
 
 #include <asm/io.h>
 
+#define FBCON_FLAGS_INIT 1
+
    /*
     *    This is the interface between the low-level console driver and the
     *    low-level frame buffer device
@@ -41,6 +43,7 @@
     u32 grayscale;
     u32 nonstd;
     u32 accel_flags;
+    u32 rotate;
     struct fb_bitfield red;
     struct fb_bitfield green;
     struct fb_bitfield blue;
@@ -68,6 +71,7 @@
 	int    cursor_reset;
 	int    blank_state;
 	int    graphics;
+	int    flags;
 	char  *cursor_data;
 };
     /*




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

  reply	other threads:[~2005-03-15 23:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-15  8:58 Fb rotation 2.6.x Komal Shah
2005-03-15 20:50 ` Antonino A. Daplas
2005-03-15 23:47   ` Antonino A. Daplas [this message]
2005-03-16 13:59     ` Komal Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200503160747.20530.adaplas@hotpop.com \
    --to=adaplas@hotpop.com \
    --cc=komal_shah802003@yahoo.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.