用户空间程序一般通过mmap访问framebuffer;一般先调用ioctl获得framebuffer的信息
case FBIOGET_VSCREENINFO:
printk("height: %d width:%d\n",info->var.height,info->var.width);
return copy_to_user(argp, &info->var,
sizeof(var)) ? -EFAULT : 0;
case FBIOGET_FSCREENINFO:
printk("fix->line_length: %d,smem_len:%d\n",info-
>fix.line_length,info->fix.smem_len);
return copy_to_user(argp, &info->fix,
sizeof(fix)) ? -EFAULT : 0;
经过跟踪发现,我使用的驱动info->fix.line_length没有初试化,所以在s3c2410_probe中添加了
fbinfo->fix.visual = FB_VISUAL_TRUECOLOR;
fbinfo->fix.line_length = (240*16)/8;
现在显示正常,用directfb的测试程序./df_dok进行测试,发现一个问题: 2.6.10效率反而高一些.
using 2.6.23
Anti-aliased Text 3.000 secs ( 3350.400
KChars/sec)
Anti-aliased Text (blend) 3.000 secs ( 3092.400
KChars/sec)
Fill Rectangle 3.033 secs ( 108.713
MPixel/sec)
Fill Rectangle (blend) 5.278 secs ( 2.231
MPixel/sec)
Fill Rectangles [10] 3.216 secs ( 109.850
MPixel/sec)
Fill Rectangles [10] (blend) 26.209 secs ( 2.246
MPixel/sec)
Fill Triangles 3.010 secs ( 69.443
MPixel/sec)
Fill Triangles (blend) 4.028 secs ( 2.192
MPixel/sec)
Draw Rectangle 3.007 secs ( 8.779
KRects/sec)
Draw Rectangle (blend) 3.062 secs ( 1.077
KRects/sec)
Draw Lines [10] 3.034 secs ( 26.367
KLines/sec)
Draw Lines [10] (blend) 3.105 secs ( 4.830
KLines/sec)
(!) [ 803: 0.000] --> Caught signal 8 (sent by pfb_ioctl cmd is
0x4601
using 2.6.10
Anti-aliased Text 3.000 secs ( 3487.200
KChars/sec)
Anti-aliased Text (blend) 3.000 secs ( 3224.400
KChars/sec)
Fill Rectangle 3.010 secs ( 109.544
MPixel/sec)
Fill Rectangle (blend) 5.240 secs ( 2.247
MPixel/sec)
Fill Rectangles [10] 3.195 secs ( 110.572
MPixel/sec)
Fill Rectangles [10] (blend) 26.210 secs ( 2.246
MPixel/sec)
Fill Triangles 3.025 secs ( 71.045
MPixel/sec)
Fill Triangles (blend) 3.970 secs ( 2.224
MPixel/sec)
Draw Rectangle 3.000 secs ( 8.966
KRects/sec)
Draw Rectangle (blend) 3.035 secs ( 1.120
KRects/sec)
Draw Lines [10] 3.035 secs ( 27.018
KLines/sec)
Draw Lines [10] (blend) 3.175 secs ( 5.039
KLines/sec)
(!) [ 45: 0.000] --> Caught signal 8 (sent by pid 45, uid 0) <--