From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8852 invoked by alias); 23 May 2005 21:47:51 -0000 Mailing-List: contact ecos-devel-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@sources.redhat.com Received: (qmail 8328 invoked by uid 22791); 23 May 2005 21:47:32 -0000 Received: from mailout09.sul.t-online.com (HELO mailout09.sul.t-online.com) (194.25.134.84) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 23 May 2005 21:47:32 +0000 Received: from fwd17.aul.t-online.de by mailout09.sul.t-online.com with smtp id 1DaKlm-0003RB-00; Mon, 23 May 2005 23:47:30 +0200 Received: from www.neundorf.net (SOm0uiZ-QeA4owTQl6MELQBBFgvEseanZeBvYA5ypTjhTr9rt4ed4Z@[84.184.59.165]) by fwd17.sul.t-online.de with smtp id 1DaKlX-0xDZ0i0; Mon, 23 May 2005 23:47:15 +0200 Received: (qmail 16373 invoked from network); 23 May 2005 22:25:29 -0000 Received: from unknown (HELO hammer.neundorf.net) (192.168.0.10) by marathon.neundorf.net with SMTP; 23 May 2005 22:25:29 -0000 From: Alexander Neundorf Reply-To: neundorf@kde.org To: ecos-devel@ecos.sourceware.org Subject: [PATCH] supprt for qvfb Date: Mon, 23 May 2005 21:47:00 -0000 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_h9kkCid2irR8F+H" Message-Id: <200505232347.13311.neundorf@kde.org> X-ID: SOm0uiZ-QeA4owTQl6MELQBBFgvEseanZeBvYA5ypTjhTr9rt4ed4Z@t-dialin.net X-TOI-MSGID: 04568da8-dc79-4e49-97c3-4159b60b2195 X-SW-Source: 2005-05/txt/msg00013.txt.bz2 --Boundary-00=_h9kkCid2irR8F+H Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 452 Hi, attached you can find a package for the ecos synthetic target which adds support for the virtual framebuffer provided by qvfb (http://doc.trolltech.com/3.3/emb-qvfb.html) Please add it to cvs or let me know what you'd like to have changed. Bye Alex -- Work: alexander.neundorf@jenoptik.com - http://www.jenoptik-los.de Home: neundorf@kde.org - http://www.kde.org alex@neundorf.net - http://www.neundorf.net --Boundary-00=_h9kkCid2irR8F+H Content-Type: text/x-csrc; charset="us-ascii"; name="qvfb.diff.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="qvfb.diff.c" Content-length: 15824 diff -Nrbup packages/ecos.db /usr/src/ecos.qvfb/packages/ecos.db --- packages/ecos.db 2005-05-23 23:34:05.000000000 +0200 +++ /usr/src/ecos.qvfb/packages/ecos.db 2005-05-23 23:15:22.000000000 +0200 @@ -2353,6 +2353,16 @@ package CYGPKG_MICROWINDOWS { description "Microwindows." } +package CYGPKG_QVFB { + alias { "Synthetic target framebuffer support via QVFB" qvfb } + directory services/gfx/qvfb + script qvfb.cdl + description " +This package provides support for a framebuffer for the synthetic target via +accessing the Qt QVFB virtual framebuffer." +} + + package CYGPKG_HAL_SH_SH7750_DREAMCAST { alias { "SEGA Dreamcast" hal_sh_dreamcast sh_dreamcast_hal } directory hal/sh/dreamcast diff -Nrbup packages/services/gfx/qvfb/current/ChangeLog /usr/src/ecos.qvfb/packages/services/gfx/qvfb/current/ChangeLog --- packages/services/gfx/qvfb/current/ChangeLog 1970-01-01 01:00:00.000000000 +0100 +++ /usr/src/ecos.qvfb/packages/services/gfx/qvfb/current/ChangeLog 2005-05-23 22:44:47.000000000 +0200 @@ -0,0 +1,40 @@ +2005-05-23 Alexander Neundorf + + * Initial import of the qvfb package, featuring support + for the virtual framebuffer provided by QVFB for the synthetic + target. + +//=========================================================================== +//####ECOSGPLCOPYRIGHTBEGIN#### +// ------------------------------------------- +// This file is part of eCos, the Embedded Configurable Operating System. +// Copyright (C) 2005 Alexander Neundorf +// +// eCos is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the Free +// Software Foundation; either version 2 or (at your option) any later version. +// +// eCos is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +// for more details. +// +// You should have received a copy of the GNU General Public License along +// with eCos; if not, write to the Free Software Foundation, Inc., +// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +// +// As a special exception, if other files instantiate templates or use macros +// or inline functions from this file, or you compile this file and link it +// with other works to produce a work based on this file, this file does not +// by itself cause the resulting work to be covered by the GNU General Public +// License. However the source code for this file must still be made available +// in accordance with section (3) of the GNU General Public License. +// +// This exception does not invalidate any other reasons why a work based on +// this file might be covered by the GNU General Public License. +// +// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. +// at http://sources.redhat.com/ecos/ecos-license/ +// ------------------------------------------- +//####ECOSGPLCOPYRIGHTEND#### +//=========================================================================== diff -Nrbup packages/services/gfx/qvfb/current/cdl/qvfb.cdl /usr/src/ecos.qvfb/packages/services/gfx/qvfb/current/cdl/qvfb.cdl --- packages/services/gfx/qvfb/current/cdl/qvfb.cdl 1970-01-01 01:00:00.000000000 +0100 +++ /usr/src/ecos.qvfb/packages/services/gfx/qvfb/current/cdl/qvfb.cdl 2005-05-23 22:10:01.000000000 +0200 @@ -0,0 +1,82 @@ +# ==================================================================== +# +# qvfb.cdl +# +# Synthetic target Qt virtual frame buffer package. +# +# ==================================================================== +#####ECOSGPLCOPYRIGHTBEGIN#### +## ------------------------------------------- +## This file is part of eCos, the Embedded Configurable Operating System. +## Copyright (C) 2005 Alexander Neundorf +## +## eCos is free software; you can redistribute it and/or modify it under +## the terms of the GNU General Public License as published by the Free +## Software Foundation; either version 2 or (at your option) any later version. +## +## eCos is distributed in the hope that it will be useful, but WITHOUT ANY +## WARRANTY; without even the implied warranty of MERCHANTABILITY or +## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +## for more details. +## +## You should have received a copy of the GNU General Public License along +## with eCos; if not, write to the Free Software Foundation, Inc., +## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +## +## As a special exception, if other files instantiate templates or use macros +## or inline functions from this file, or you compile this file and link it +## with other works to produce a work based on this file, this file does not +## by itself cause the resulting work to be covered by the GNU General Public +## License. However the source code for this file must still be made available +## in accordance with section (3) of the GNU General Public License. +## +## This exception does not invalidate any other reasons why a work based on +## this file might be covered by the GNU General Public License. +## +## ------------------------------------------- +#####ECOSGPLCOPYRIGHTEND#### + +cdl_package CYGPKG_QVFB { + display "Synthetic target framebuffer support via QVFB" + + requires CYGPKG_HAL_SYNTH + + compile -library=libextras.a qvfb.c + + description " + This package provides support for a graphics framebuffer for the + synthetic target. This is done by accessing the virtual framebuffer + provided by the QVfb server (coming with the Qt toolkit by Trolltech). + You can use it to simulate framebuffers with arbitrary sizes and + 1/4/8/12/16/32 bpp color depth." + + + cdl_component CYGPKG_QVFB_OPTIONS { + display "Build options" + flavor none + description " + Package-specific build options including control over compiler + flags used only in building this package." + + cdl_option CYGPKG_QVFB_CFLAGS_ADD { + display "Additional compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building this package. These flags are used in addition + to the set of global flags." + } + cdl_option CYGPKG_QVFB_CFLAGS_REMOVE { + display "Suppressed compiler flags" + flavor data + no_define + default_value { "" } + description " + This option modifies the set of compiler flags for + building this package. These flags are removed from + the set of global flags if present." + } + } +} diff -Nrbup packages/services/gfx/qvfb/current/doc/qvfb.txt /usr/src/ecos.qvfb/packages/services/gfx/qvfb/current/doc/qvfb.txt --- packages/services/gfx/qvfb/current/doc/qvfb.txt 1970-01-01 01:00:00.000000000 +0100 +++ /usr/src/ecos.qvfb/packages/services/gfx/qvfb/current/doc/qvfb.txt 2005-05-23 23:01:28.000000000 +0200 @@ -0,0 +1,48 @@ +The QVFB packages provides support for using the virtual framebuffer +provided by the QVFB tool, which comes with the Qt toolkit by +Trolltech (http://www.trolltech.com). With QVFB you can simulate +a framebuffer device under X11. +Visit http://doc.trolltech.com/3.3/emb-qvfb.html for more details about the +QVFB server. To build the Qt QVFB server, enter /tools/qvfb/ +and enter make. Do this in your normal Qt build tree, not in a Qt/Embedded build tree, +since the QVFB server is a normal Qt application. +In the QVFB server you can adjust the resolution and bit depth of the framebuffer. +It supports standard and custom resolutions and 1/4/8/12/16/32 bpp color depths. + +Here comes a very simple and boring example: + +#include + +int draw_something() +{ + char* fb=qvfb_connect(0x62062182); + if (data==0) + return -1; + + int bpp=qvfb_depth(); + + int width=qvfb_width(); + int height=qvfb_height(); + + int linestep=qvfb_linestep(); + + //set the whole framebuffer to 0, i.e. black + memset(fb, 0, width*height*(bpp/8)); + + //draw some very boring white lines + for (int i=0; i + +#include "qvfb.h" + +struct QVFbHeader +{ + int width; + int height; + int depth; + int linestep; + int dataoffset; + int update_x1; + int update_y1; + int update_x2; + int update_y2; + char dirty; + int numcols; +}; + +struct QVFbHeader* qvfb_header=NULL; + +char* qvfb_connect(unsigned int ipckey) +{ + int sid=0; + if (qvfb_header) + return qvfb_header; + sid=cyg_hal_sys_shmget(ipckey, 0, 0); + if (sid<0) + return NULL; + char* qvfb_buf=(char*)cyg_hal_sys_shmat(sid, 0, 0); + if (!qvfb_buf) + return NULL; + + qvfb_header=(struct QVFbHeader*)qvfb_buf; + return qvfb_buf+qvfb_header->dataoffset; +} + +void qvfb_update() +{ + if (!qvfb_header) + return; + qvfb_header->update_x1=0; + qvfb_header->update_y1=0; + qvfb_header->update_x2=qvfb_header->width; + qvfb_header->update_y2=qvfb_header->height; + qvfb_header->dirty=0xff; +} + +void qvfb_update_rect(int x1, int y1, int x2, int y2) +{ + if (!qvfb_header) + return; + qvfb_header->update_x1=x1; + qvfb_header->update_y1=y1; + qvfb_header->update_x2=x2; + qvfb_header->update_y2=y2; + qvfb_header->dirty=0xff; +} + +void qvfb_disconnect() +{ + if (!qvfb_header) + return; + cyg_hal_sys_shmdt(qvfb_header); + qvfb_header=NULL; +} + +int qvfb_width() +{ + if (!qvfb_header) + return -1; + return qvfb_header->width; +} + +int qvfb_height() +{ + if (!qvfb_header) + return -1; + return qvfb_header->height; +} + +int qvfb_depth() +{ + if (!qvfb_header) + return -1; + return qvfb_header->depth; +} + +int qvfb_linestep() +{ + if (!qvfb_header) + return -1; + return qvfb_header->linestep; +} --Boundary-00=_h9kkCid2irR8F+H--