From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antonino Daplas Subject: cfbimgblt.c Date: 22 Aug 2002 07:23:19 +0800 Sender: linux-fbdev-devel-admin@lists.sourceforge.net Message-ID: <1029972099.551.3.camel@daplas> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-RjBUSP1HtfCkvcvSxmRI" Return-path: Received: from [203.167.79.9] (helo=willow.compass.com.ph) by usw-sf-list1.sourceforge.net with esmtp (Exim 3.31-VA-mm2 #1 (Debian)) id 17hep8-0002AZ-00 for ; Wed, 21 Aug 2002 16:23:38 -0700 Received: from [202.70.99.5] (AP-202-70-99-5.compass.com.ph [202.70.99.5]) by willow.compass.com.ph (8.9.3/8.9.3) with ESMTP id HAA93544 for ; Thu, 22 Aug 2002 07:23:33 +0800 (PHT) (envelope-from adaplas@pol.net) Errors-To: linux-fbdev-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: fbdev --=-RjBUSP1HtfCkvcvSxmRI Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, I want to address some of the limitations of cfbimgblt.c, but unfortunately I ended up practically rewriting the whole code. In theory, the code (slow_imageblit): a. supports all possible bit depths b. should be able to handle destination writes that are not aligned by an unsigned long c. should be able to handle fix->line_length not a multiple of an unsigned long d. framebuffer access is always the size of an unsigned long and aligned e. preliminary code for drawing the logo. f. added Paul Mackerra's endianness patch (plus some of my own), but I have no big-endian machine, so it's untested, and perhaps incorrect. The only tests I've done for slow_imageblit is at 8, 16, 24, and 32 bpp, and forcibly misaligning image->dx by 1 pixel. The code is slow, so I included fast_imageblit for 8, 16 and 32 bpp which is an implementation of fbcon-cfb8/16/32.c. Tony --=-RjBUSP1HtfCkvcvSxmRI Content-Disposition: attachment; filename=cfbimgblt.c Content-Transfer-Encoding: quoted-printable Content-Type: text/x-c; name=cfbimgblt.c; charset=ISO-8859-1 /* * Generic BitBLT function for frame buffer with packed pixels of any dept= h. * * Copyright (C) June 1999 James Simmons * * This file is subject to the terms and conditions of the GNU General Pub= lic * License. See the file COPYING in the main directory of this archive fo= r * more details. * * NOTES: * * This function copys a image from system memory to video memory. The * image can be a bitmap where each 0 represents the background color and * each 1 represents the foreground color. Great for font handling. It can * also be a color image. This is determined by image_depth. The color ima= ge * must be laid out exactly in the same format as the framebuffer. Yes I k= now * their are cards with hardware that coverts images of various depths to = the * framebuffer depth. But not every card has this. All images must be roun= ded * up to the nearest byte. For example a bitmap 12 bits wide must be two=20 * bytes width.=20 * * FIXME * The code for 24 bit is horrible. It copies byte by byte size instead of * longs like the other sizes. Needs to be optimized. * =20 * Tony:=20 * Incorporate mask tables similar to fbcon-cfb*.c in 2.4 API. This speed= s=20 * up the code significantly. * =20 * Code for depths not multiples of BITS_PER_LONG is still kludgy, which i= s * still processed a bit at a time. =20 * * Also need to add code to deal with cards endians that are different tha= n * the native cpu endians. I also need to deal with MSB position in the wo= rd. * */ #include #include #include #include