From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Antonino A. Daplas" Subject: [PATCH 10/33] uvesafb: the driver core Date: Thu, 26 Jul 2007 20:04:47 +0800 Message-ID: <46A88DDF.3090801@gmail.com> Reply-To: linux-fbdev-devel@lists.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1IE2tj-0000ul-Cy for linux-fbdev-devel@lists.sourceforge.net; Thu, 26 Jul 2007 05:56:55 -0700 Received: from nz-out-0506.google.com ([64.233.162.237]) by mail.sourceforge.net with esmtp (Exim 4.44) id 1IE2tj-0007th-2B for linux-fbdev-devel@lists.sourceforge.net; Thu, 26 Jul 2007 05:56:55 -0700 Received: by nz-out-0506.google.com with SMTP id f1so1351458nzc for ; Thu, 26 Jul 2007 05:56:54 -0700 (PDT) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-fbdev-devel-bounces@lists.sourceforge.net Errors-To: linux-fbdev-devel-bounces@lists.sourceforge.net To: Andrew Morton Cc: Michal Januszewski , Linux Fbdev development list From: Michal Januszewski uvesafb is an enhanced version of vesafb. It uses a userspace helper (v86d) to execute calls to the x86 Video BIOS functions. The driver is not limited to any specific arch and whether it works on a given arch or not depends on that arch being supported by the userspace daemon. It has been tested on x86_32 and x86_64. A single BIOS call is represented by an instance of the uvesafb_ktask structure. This structure contains a buffer, a completion struct and a uvesafb_task substructure, containing the values of the x86 registers, a flags field and a field indicating the length of the buffer. Whenever a BIOS call is made in the driver, uvesafb_exec() builds a message using the uvesafb_task substructure and the contents of the buffer. This message is then assigned a random ack number and sent to the userspace daemon using the connector interface. The message's sequence number is used as an index for the uvfb_tasks array, which provides a mapping from the messages coming from userspace to the in-kernel uvesafb_ktask structs. The userspace daemon performs the requested operation and sends a reply in the form of a uvesafb_task struct and, optionally, a buffer. The seq and ack numbers in the reply should be exactly the same as those in the request. Each message from userspace is processed by uvesafb_cn_callback() and after passing a few sanity checks leads to the completion of a BIOS call request. Signed-off-by: Michal Januszewski Signed-off-by: Antonino Daplas --- drivers/video/Kconfig | 18 drivers/video/Makefile | 1 drivers/video/uvesafb.c | 2032 +++++++++++++++++++++++++++++++++++++++++++++++ include/video/Kbuild | 2 include/video/uvesafb.h | 193 ++++ 5 files changed, 2245 insertions(+), 1 deletions(-) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 7e26d62..85f68cc 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -591,6 +591,24 @@ config FB_TGA Say Y if you have one of those. +config FB_UVESA + tristate "Userspace VESA VGA graphics support" + depends on FB && CONNECTOR + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + select FB_MODE_HELPERS + help + This is the frame buffer driver for generic VBE 2.0 compliant + graphic cards. It can also take advantage of VBE 3.0 features, + such as refresh rate adjustment. + + This driver generally provides more features than vesafb but + requires a userspace helper application called 'v86d'. See + for more information. + + If unsure, say N. + config FB_VESA bool "VESA VGA graphics support" depends on (FB = y) && X86 diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 06eec7b..67dc278 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -115,6 +115,7 @@ obj-$(CONFIG_FB_XILINX) += xil obj-$(CONFIG_FB_OMAP) += omap/ # Platform or fallback drivers go here +obj-$(CONFIG_FB_UVESA) += uvesafb.o obj-$(CONFIG_FB_VESA) += vesafb.o obj-$(CONFIG_FB_IMAC) += imacfb.o obj-$(CONFIG_FB_VGA16) += vga16fb.o diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c new file mode 100644 index 0000000..9c21791 --- /dev/null +++ b/drivers/video/uvesafb.c @@ -0,0 +1,2032 @@ +/* + * A framebuffer driver for VBE 2.0+ compliant video cards + * + * (c) 2007 Michal Januszewski + * Loosely based upon the vesafb driver. + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include