From: Antonino Daplas <adaplas@pol.net>
To: fbdev <linux-fbdev-devel@lists.sourceforge.net>
Subject: Problem with cfb_imageblit
Date: 24 May 2002 21:19:09 +0800 [thread overview]
Message-ID: <1022214909.540.1.camel@daplas> (raw)
Hi,
I have an unusual problem with cfb_imageblit. I'm not too sure if this
is unique to my system. I get garbage pixels. For example the
underscore character (_) appears like this magnified:
01234567
0
.
.
.
13 *******
14 *
15 ** <-- belongs to apostrophe char
It seems that the image is off by one bit and one row of pixels so it
also includes the first row of pixels of the next character (`) in
fontdata.
Looking at the code in cfbimgblt.c, I cannot find any obvious mistake,
so I made a dump of the variables during the loop iteration. Here's
what I get:
/* bpp = 8, 8x16 font, caret (^) bitmap */
pad 0 /* no excess pixels */
10 /* initial content of *src */
i 0, j 2, k 4, l 7
i 0, j 2, k 3, l 6
i 0, j 2, k 2, l 5
i 0, j 2, k 1, l 4
i 0, j 1, k 4, l 3
i 0, j 1, k 3, l 2
i 0, j 1, k 2, l 1
i 0, j 1, k 1, l 0 /* everything is okay until ... */
38 l 7 /* l = 7, and new content of *src = 0x38 */
i 1, j 2, k 4, l 0 <--- l = 0?!?! I'm confused here ...
6c l 7 /* so, src is again updated (*src = 0x6c)*/
i 1, j 2, k 3, l 7 /* at this point, we're off by 9 bits */
i 1, j 2, k 2, l 6
i 1, j 2, k 1, l 5
i 1, j 1, k 4, l 4
i 1, j 1, k 3, l 3
i 1, j 1, k 2, l 2
i 1, j 1, k 1, l 1
i 2, j 2, k 4, l 0
c6 l 7
i 2, j 2, k 3, l 7 /* the algo is now doing what it should */
i 2, j 2, k 2, l 6 /* and continues to do so till the end */
i 2, j 2, k 1, l 5
i 2, j 1, k 4, l 4
i 2, j 1, k 3, l 3
i 2, j 1, k 2, l 2
i 2, j 1, k 1, l 1
i 3, j 2, k 4, l 0
0 l 7
<<< cut >>>
I'm not too sure why 'l' did not retain it's assignment. This happens
only after the first iteration of 'i'. I've tried using different
compilers (gcc-2.95.3 and gcc-3.0.4). I've changed the declaration of
'l' to static and volatile, and changed its placement, but I still get
the same result.
Just to prove that cfb_imageblit is correct, I used 'k' and 'j' instead
of 'l' in the test_bit() part. It's slower, but it proves that the
algorithm of cfb_imageblit is correct.
for (i = 0; i < image->height; i++) {
dst = (unsigned long *) dst1;
for (j = image->width/ppw; j > 0; j--) {
mask = 0;
for (k = ppw; k > 0; k--) {
if (test_bit((j*ppw - (ppw-k) - 1), src))
mask |= (tmp >> (p->var.bits_per_pixel*(k-1)));
}
fb_writel((mask & eorx)^bgx, dst);
dst++;
}
src++;
l =- pad;
dst1 += p->fix.line_length;
}
Any comments?
Tony
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
next reply other threads:[~2002-05-24 13:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-24 13:19 Antonino Daplas [this message]
2002-05-24 17:30 ` Problem with cfb_imageblit Andrey Ulanov
2002-05-24 23:24 ` Antonino Daplas
2002-05-28 17:29 ` James Simmons
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=1022214909.540.1.camel@daplas \
--to=adaplas@pol.net \
--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 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).