linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Missing radeonfb_setup
@ 2003-11-13  4:43 John Zielinski
  0 siblings, 0 replies; 3+ messages in thread
From: John Zielinski @ 2003-11-13  4:43 UTC (permalink / raw)
  To: linux-fbdev-devel

Changing monitor_layout and mode_option to fixed length arrays was 
causing problems for me.  Looks like it might have been because the 
arrays were uninitialized.  The following patch adds the radeonfb_setup 
function while leaving those variables as pointers:

http://www.undead.cc/linux/patch.radeon_setup

I didn't include the change to the default video mode as I'm still 
mucking around with that.  Also, I left the default video mode code as 
is as the changes in the update looked wrong.

Also, here's a patch to fix some compiler warnings.  Most were harmless 
but the one about xtal was indeed a bug.  Can someone let me know if I 
got the fix for that one right:

http://www.undead.cc/linux/patch.fixwarnings

I'm also having a cursor problem.  It makes the character it's over 
disappear when it flashes active.  So I have the character then the 
cursor then the character then the cursor, etc.  This is very 
distracting since it's the line cursor and not the block cursor.  How do 
I go about fixing this?

One more thing, which patch added the CONFIG_FB_RADEON_I2C menu choice?  
I had to add that one myself to get it?

John





-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Missing radeonfb_setup
@ 2003-10-28 21:55 Javier Villavicencio
  2003-10-29  9:19 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Javier Villavicencio @ 2003-10-28 21:55 UTC (permalink / raw)
  To: linux-fbdev-devel

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

Simple patch to the new radeon fb driver to make it set modes/resolutions,
and take the other parameters.
Extracted some code from the matroxfb driver. Added radeonfb_setup function.

Also, with the new fbdev driver and with or without this little fix, tested in -test8 and
-test9 I cannot get my console framebuffer back when I switch from X, system working ok,
but the console is distorted. I have a Radeon 9600 Pro.

Salu2.

Javier Villavicencio.



[-- Attachment #2: radeonfb_setup.diff --]
[-- Type: text/x-diff, Size: 5424 bytes --]

diff -urN linux.radeonfb/drivers/video/aty/radeon_base.c linux-2.6.0-test9/drivers/video/aty/radeon_base.c
--- linux.radeonfb/drivers/video/aty/radeon_base.c	2003-10-27 06:23:11.799945343 -0300
+++ linux-2.6.0-test9/drivers/video/aty/radeon_base.c	2003-10-27 06:04:24.973721058 -0300
@@ -236,8 +236,8 @@
  * globals
  */
         
-static char *mode_option;
-static char *monitor_layout;
+static char mode_option[64]; 		/* "radeonfb:mode_option:xxxxx" or "radeonfb:xxxxx" */
+static char monitor_layout[64];		/* "radeonfb:mode_layout:xxxxx" */
 static int noaccel = 0;
 static int nomodeset = 0;
 static int ignore_edid = 0;
@@ -2367,6 +2367,40 @@
 #endif /* CONFIG_PM */
 };
 
+int __init radeonfb_setup (char *options) {
+	char *this_opt;
+
+	if (!options || !*options)
+		return 0;
+
+	while ((this_opt = strsep(&options, ",")) != NULL) {
+		if (!*this_opt) continue;
+
+		printk("radeonfb_setup: option %s\n", this_opt);
+		
+		if (!strncmp(this_opt, "noaccel:", 8))
+			noaccel = simple_strtoul(this_opt+8, NULL, 0);
+		else if (!strncmp(this_opt, "nomodeset:", 10))
+			nomodeset = simple_strtoul(this_opt+10, NULL, 0);
+		else if (!strncmp(this_opt, "panel_yres:", 11))
+			panel_yres = simple_strtoul(this_opt+11, NULL, 0);
+		else if (!strncmp(this_opt, "force_dfp:", 9))
+		        force_dfp = simple_strtoul(this_opt+9, NULL, 0);
+		else if (!strncmp(this_opt, "ignore_edid:", 11))
+			ignore_edid = simple_strtoul(this_opt+11, NULL, 0);
+		else if (!strncmp(this_opt, "force_measure_pll:", 17))
+			force_measure_pll = simple_strtoul(this_opt+17, NULL, 0);
+		else if (!strncmp(this_opt, "nomtrr:", 7))
+			nomtrr = simple_strtoul(this_opt+7, NULL, 0);
+		else if (!strncmp(this_opt, "monitor_layout:", 15))
+			strlcpy(monitor_layout, this_opt+15, sizeof(monitor_layout));
+		else if (!strncmp(this_opt, "mode_option:", 12))
+			strlcpy(mode_option, this_opt+12, sizeof(mode_option));
+                else 
+			strlcpy(mode_option, this_opt, sizeof(mode_option));
+	}
+	return 0;
+}
 
 int __init radeonfb_init (void)
 {
@@ -2406,6 +2440,6 @@
 MODULE_PARM_DESC(nomtrr, "bool: disable use of MTRR registers");
 #endif
 module_param(panel_yres, int, 0);
-MODULE_PARM_DESC(force_dfp, "int: set panel yres");
+MODULE_PARM_DESC(panel_yres, "int: set panel yres");
 module_param(mode_option, charp, 0);
 MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" ");
diff -urN linux.radeonfb/drivers/video/aty/radeon_monitor.c linux-2.6.0-test9/drivers/video/aty/radeon_monitor.c
--- linux.radeonfb/drivers/video/aty/radeon_monitor.c	2003-10-27 06:23:11.804944612 -0300
+++ linux-2.6.0-test9/drivers/video/aty/radeon_monitor.c	2003-10-27 06:15:41.079084942 -0300
@@ -7,10 +7,22 @@
 #endif /* CONFIG_PPC_OF */
 
 static struct fb_var_screeninfo radeonfb_default_var = {
-        640, 480, 640, 480, 0, 0, 8, 0,
-        {0, 6, 0}, {0, 6, 0}, {0, 6, 0}, {0, 0, 0},
-        0, 0, -1, -1, 0, 39721, 40, 24, 32, 11, 96, 2,
-        0, FB_VMODE_NONINTERLACED
+        640,480,640,480,/* W,H, W, H (virtual) load xres,xres_virtual*/
+        0,0,            /* virtual -> visible no offset */
+        8,              /* depth -> load bits_per_pixel */
+        0,              /* greyscale ? */
+        {0,0,0},        /* R */
+        {0,0,0},        /* G */
+        {0,0,0},        /* B */
+        {0,0,0},        /* transparency */
+        0,              /* standard pixel format */
+        FB_ACTIVATE_NOW,
+        -1,-1,
+        FB_ACCELF_TEXT, /* accel flags */
+        39721L,48L,16L,33L,10L,
+        96L,2L,~0,      /* No sync info */
+        FB_VMODE_NONINTERLACED,
+        0, {0,0,0,0,0}
 };
 
 static char *radeon_get_mon_name(int type)
@@ -288,7 +300,7 @@
  * Parse the "monitor_layout" string if any. This code is mostly
  * copied from XFree's radeon driver
  */
-static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo, const char *monitor_layout)
+static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo, const char monitor_layout[64])
 {
 	char s1[5], s2[5];
 	int i = 0, second = 0;
@@ -348,7 +360,7 @@
  * driver
  */
 void __devinit radeon_probe_screens(struct radeonfb_info *rinfo,
-				    const char *monitor_layout, int ignore_edid)
+				    const char monitor_layout[64], int ignore_edid)
 {
 	int ddc_crt2_used = 0;
 	int tmp, i;
@@ -584,7 +596,7 @@
  * Build the modedb for head 1 (head 2 will come later), check panel infos
  * from either BIOS or EDID, and pick up the default mode
  */
-void __devinit radeon_check_modes(struct radeonfb_info *rinfo, const char *mode_option)
+void __devinit radeon_check_modes(struct radeonfb_info *rinfo, const char mode_option[64])
 {
 	int has_default_mode = 0;
 
@@ -698,11 +710,12 @@
 		struct fb_videomode default_mode;
 		if (has_default_mode)
 			radeon_var_to_videomode(&default_mode, &rinfo->info.var);
-		else
-			radeon_var_to_videomode(&default_mode, &radeonfb_default_var);
-		if (fb_find_mode(&rinfo->info.var, &rinfo->info, mode_option,
-				 rinfo->mon1_modedb, rinfo->mon1_dbsize, &default_mode, 8) == 0)
+		else {
+			printk("radeonfb: mode_option %s \n", mode_option);
+			fb_find_mode(&radeonfb_default_var, &rinfo->info, mode_option[0]?mode_option:NULL, 
+				     rinfo->mon1_modedb, rinfo->mon1_dbsize, &default_mode, 8);
 			rinfo->info.var = radeonfb_default_var;
+			radeon_var_to_videomode(&default_mode, &radeonfb_default_var);
+		}
 	}
-
 }


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-13  4:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-13  4:43 Missing radeonfb_setup John Zielinski
  -- strict thread matches above, loose matches on Subject: below --
2003-10-28 21:55 Javier Villavicencio
2003-10-29  9:19 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).