linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pvr2fb: New framebuffer_alloc API and class_dev changes
@ 2003-09-15 21:51 Kronos
  2003-09-15 22:06 ` Paul Mundt
  0 siblings, 1 reply; 2+ messages in thread
From: Kronos @ 2003-09-15 21:51 UTC (permalink / raw)
  To: lethal; +Cc: linux-fbdev-devel, James Simmons

Hi,
this patch converts driver/video/amifb.c to framebuffer_alloc. Also,
something went wrong in the last merge, this patch makes it compile
again:

======== drivers/video/pvr2fb.c 1.17 ========
D 1.17 03/09/12 22:26:04+02:00 kronos@kronoz.cjb.net 19 18 4/8/796
P drivers/video/pvr2fb.c
C - make it compile again. something went wrong in the merge from 1.14.1.1 to 1.6
C - switch to framebuffer_alloc
------------------------------------------------

===== drivers/video/pvr2fb.c 1.16 vs 1.17 =====
--- 1.16/drivers/video/pvr2fb.c	Mon Jul 14 20:09:25 2003
+++ 1.17/drivers/video/pvr2fb.c	Fri Sep 12 22:26:04 2003
@@ -419,7 +419,7 @@
 
 	if (var->vmode & FB_VMODE_YWRAP) {
 		if (var->xoffset || var->yoffset < 0 || 
-		    var->yoffset >= var->yres_virtual)
+		    var->yoffset >= var->yres_virtual) {
 			var->xoffset = var->yoffset = 0;
 		} else {
 			if (var->xoffset > var->xres_virtual - var->xres ||
@@ -461,6 +461,7 @@
 				DPRINTK("invalid hsync total for NTSC\n");
 				return -EINVAL;
 			}
+		}
 	}
 	/* Check memory sizes */
 	line_length = get_line_length(var->xres_virtual, var->bits_per_pixel);
@@ -609,17 +610,14 @@
 	if (!MACH_DREAMCAST)
 		return -ENXIO;
 
-	fb_info = kmalloc(sizeof(struct fb_info) + sizeof(struct pvr2fb_par) +
-			  sizeof(u32) * 16, GFP_KERNEL);
+	fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par) + sizeof(u32) * 16, NULL);
 	
 	if (!fb_info) {
 		printk(KERN_ERR "Failed to allocate memory for fb_info\n");
 		return -ENOMEM;
 	}
 
-	memset(fb_info, 0, sizeof(fb_info) + sizeof(struct pvr2fb_par) + sizeof(u32) * 16);
-
-	currentpar = (struct pvr2fb_par *)(fb_info + 1);
+	currentpar = fb_info->par;
 
 	/* Make a guess at the monitor based on the attached cable */
 	if (pvr2_init_cable() == CT_VGA) {
@@ -665,7 +663,6 @@
 
 	fb_info->fbops		= &pvr2fb_ops;
 	fb_info->fix		= pvr2_fix;
-	fb_info->par		= currentpar;
 	fb_info->pseudo_palette	= (void *)(fb_info->par + 1);
 	fb_info->flags		= FBINFO_FLAG_DEFAULT;
 
@@ -723,7 +720,6 @@
 	}
 #endif
 	unregister_framebuffer(fb_info);
-	kfree(fb_info);
 }
 
 static int __init pvr2_get_param(const struct pvr2_params *p, const char *s,


Luca 
-- 
Reply-To: kronos@kronoz.cjb.net
Home: http://kronoz.cjb.net
Non sempre quello che viene dopo e` progresso.
Alessandro Manzoni


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

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

end of thread, other threads:[~2003-09-15 22:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-15 21:51 [PATCH] pvr2fb: New framebuffer_alloc API and class_dev changes Kronos
2003-09-15 22:06 ` Paul Mundt

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).