All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Knut Petersen <Knut_Petersen@t-online.de>
Cc: linux-fbdev-devel@lists.sourceforge.net
Subject: Re: 2 more fbcon rotation bugs
Date: Tue, 22 Nov 2005 15:48:16 +0800	[thread overview]
Message-ID: <4382CD40.8000507@gmail.com> (raw)
In-Reply-To: <4382BBE3.9020002@t-online.de>

Knut Petersen wrote:
> Hi Antonino,
> 
>>> Any idea where to start? Can you reproduce the odd behaviour?
>>>   
>>
>> This one I cannot reproduce. Have you tried reproducing it with vesafb?
>> Any message in the log, such as a kernel oops?  Your description sounds
>> like a corruption of cursor->mask and cursor->image.data.
>>  
>>
> I found the bug, it is specific to cyblafb.
> 
> The problem is that the 16x30 font causes the cyblafb imageblit to fall
> back to
> cfb_imageblit for rotation 1 and 3 while the accelerated copyarea
> function is
> still used. That breaks the private sync mechanism of cyblafb and causes
> the
> erroneous behaviour.

Shouldn't the accelerator be intelligent enough to handle bitmaps with
variable widths?  Will something like the one attached work?

Tony

diff --git a/drivers/video/cyblafb.c b/drivers/video/cyblafb.c
index 03fbe83..175f4d4 100644
--- a/drivers/video/cyblafb.c
+++ b/drivers/video/cyblafb.c
@@ -364,17 +364,12 @@ static void cyblafb_imageblit(struct fb_
 			      const struct fb_image *image)
 {
 
-	u32 fgcol, bgcol;
-
-	int i;
+	u32 fgcol, bgcol, *data = (u32 *) image->data;
 	int bpp = info->var.bits_per_pixel;
 	int index = 0;
-	int index_end=image->height * image->width / 8;
-	int width_dds=image->width / 32;
-	int width_dbs=image->width % 32;
 
-	if (image->depth != 1 || bpp < 8 || bpp > 32 || bpp % 8 != 0 ||
-	    image->width % 8 != 0 || image->width == 0 || image->height == 0) {
+	if (image->depth != 1 || bpp < 8 || bpp > 32 ||
+	    image->width == 0 || image->height == 0) {
 		cfb_imageblit(info,image);
 		return;
 	}
@@ -403,32 +398,18 @@ static void cyblafb_imageblit(struct fb_
 
 	cyblafb_sync(info);
 
+	index = (image->width + 31) & ~31;
+	index *= image->height;
+	index >>= 5;
+
 	out32(GE60,fgcol);
 	out32(GE64,bgcol);
 	out32(GE44,0xa0000000 | 1<<20 | 1<<19);
 	out32(GE08,point(image->dx,image->dy));
 	out32(GE0C,point(image->dx+image->width-1,image->dy+image->height-1));
 
-	while(index < index_end) {
-		const char *p = image->data + index;
-		for(i=0;i<width_dds;i++) {
-			out32(GE9C,*(u32*)p);
-			p+=4;
-			index+=4;
-		}
-		switch(width_dbs) {
-		case 0: break;
-		case 8:	out32(GE9C,*(u8*)p);
-			index+=1;
-			break;
-		case 16: out32(GE9C,*(u16*)p);
-			index+=2;
-			break;
-		case 24: out32(GE9C,*(u16*)p | *(u8*)(p+2)<<16);
-			index+=3;
-			break;
-		}
-	}
+	while (index--)
+		out32(GE9C, *data++);
 }
 
 //==========================================================
@@ -1319,6 +1300,17 @@ static int __devinit cybla_pci_probe(str
 
 	fb_alloc_cmap(&info->cmap,256,0);
 
+	info->pixmap.addr = kmalloc(8 * 1024, GFP_KERNEL);
+	
+	if (!info->pixmap.addr)
+		goto errout_pixmap;
+
+	info->pixmap.scan_align = 4;
+	info->pixmap.buf_align = 4;
+	info->pixmap.access_align = 32;
+	info->pixmap.size = 8 * 1024;
+	info->pixmap.flags = FB_PIXMAP_SYSTEM;
+
 	if (register_framebuffer(info)) {
 		output("Could not register CyBla framebuffer\n");
 		goto errout_register;
@@ -1333,6 +1325,8 @@ static int __devinit cybla_pci_probe(str
 	return 0;
 
  errout_register:
+	kfree(info->pixmap.addr);
+ errout_pixmap:
  errout_findmode:
 	iounmap(info->screen_base);
  errout_smem_remap:
@@ -1362,6 +1356,7 @@ static void __devexit cybla_pci_remove(s
 	release_mem_region(info->fix.smem_start,info->fix.smem_len);
 	release_mem_region(info->fix.mmio_start,info->fix.mmio_len);
 	fb_dealloc_cmap(&info->cmap);
+	kfree(info->pixmap.addr);
 	framebuffer_release(info);
 	output("CyblaFB version %s normal exit.\n",VERSION);
 }


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click

  reply	other threads:[~2005-11-22  7:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-18 15:23 2 more fbcon rotation bugs Knut Petersen
2005-11-18 20:23 ` Antonino A. Daplas
2005-11-19 10:12   ` Knut Petersen
2005-11-19 10:48     ` Antonino A. Daplas
2005-11-19 11:35     ` Antonino A. Daplas
2005-11-20  3:48     ` Antonino A. Daplas
2005-11-20  9:03       ` Knut Petersen
2005-11-20  9:58         ` Geert Uytterhoeven
2005-11-20 22:04         ` Antonino A. Daplas
2005-11-22  6:34   ` Knut Petersen
2005-11-22  7:48     ` Antonino A. Daplas [this message]
2005-11-22  8:01       ` Knut Petersen

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=4382CD40.8000507@gmail.com \
    --to=adaplas@gmail.com \
    --cc=Knut_Petersen@t-online.de \
    --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.