summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2011-04-10 13:24:47 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2011-04-10 14:43:41 +0200
commit89500c583e0f1dc1b4ffdf72914e08e505e427e0 (patch)
treeb073036cc61aa34ca5ac9eec4d617366e0dcb3d5 /meta-oe/recipes-graphics
parente66079da37992abd54486488aa06a99bf7a4198c (diff)
downloadmeta-openembedded-89500c583e0f1dc1b4ffdf72914e08e505e427e0.tar.gz
recipes,classes: import a lot of recipes from meta-shr
* tested on shr-lite-image for om-gta02 and nokia900 (with meta-shr layer)
Diffstat (limited to 'meta-oe/recipes-graphics')
-rw-r--r--meta-oe/recipes-graphics/drm/libdrm-2.4.24/glamo.patch1095
-rw-r--r--meta-oe/recipes-graphics/drm/libdrm-2.4.24/installtests.patch43
-rw-r--r--meta-oe/recipes-graphics/drm/libdrm_2.4.24.bb39
-rw-r--r--meta-oe/recipes-graphics/mesa/README12
-rw-r--r--meta-oe/recipes-graphics/mesa/mesa-7.10.2.inc19
-rw-r--r--meta-oe/recipes-graphics/mesa/mesa-7.10.2/glamo.patch2425
-rw-r--r--meta-oe/recipes-graphics/mesa/mesa-7.10.2/uclibc.patch26
-rw-r--r--meta-oe/recipes-graphics/mesa/mesa-common.inc53
-rw-r--r--meta-oe/recipes-graphics/mesa/mesa-dri.inc10
-rw-r--r--meta-oe/recipes-graphics/mesa/mesa-dri_7.10.2.bb4
-rw-r--r--meta-oe/recipes-graphics/mesa/mesa-xlib.inc2
-rw-r--r--meta-oe/recipes-graphics/mesa/mesa-xlib_7.10.2.bb4
-rw-r--r--meta-oe/recipes-graphics/mesa/mesa_7.10.2.bb6
-rw-r--r--meta-oe/recipes-graphics/tasks/task-fonts-truetype.bb40
-rw-r--r--meta-oe/recipes-graphics/ttf-fonts/ttf-liberation_0.2.bb23
-rw-r--r--meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/iphone3g/pointercal.xinput1
-rw-r--r--meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/nokia900/pointercal.xinput2
-rw-r--r--meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta01/pointercal.xinput2
-rw-r--r--meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta02/pointercal.xinput2
-rw-r--r--meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput1
-rw-r--r--meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb21
-rw-r--r--meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator.inc8
-rw-r--r--meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator_0.6.1.bb17
-rw-r--r--meta-oe/recipes-graphics/xorg-app/rgb_1.0.4.bb10
-rw-r--r--meta-oe/recipes-graphics/xorg-app/xinput_1.5.3.bb8
-rw-r--r--meta-oe/recipes-graphics/xorg-app/xorg-app-common.inc15
-rw-r--r--meta-oe/recipes-graphics/xorg-doc/xorg-doc-common.inc12
-rw-r--r--meta-oe/recipes-graphics/xorg-doc/xorg-sgml-doctools_1.7.bb8
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-input-keyboard_1.6.0.bb17
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-input-mouse_1.7.0.bb17
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/10-x11-input-tslib.fdi11
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/99-xf86-input-tslib.rules5
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/double-free-crash.patch20
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/xserver-174-XGetPointerControl.patch34
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb32
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb9
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo/0001-glamo-drm-define-GLAMO_CMDQ_MAX_COUNT-instead-of-mag.patch66
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb19
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xorg-driver-common.inc40
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xorg-driver-input.inc4
-rw-r--r--meta-oe/recipes-graphics/xorg-driver/xorg-driver-video.inc4
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/liblbxutil-1.1.0/mkg3states-1.1.patch55
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/liblbxutil_1.1.0.bb14
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/keysymdef_include.patch19
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/x11_disable_makekeys.patch29
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/keysymdef_include.patch19
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/x11_disable_makekeys.patch29
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libx11.inc52
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libx11_1.4.1.bb12
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libx11_1.4.3.bb12
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libxaw_1.0.9.bb28
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libxfixes_5.0.bb22
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libxi_1.4.2.bb21
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libxkbui_1.0.2.bb10
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/libxt_1.1.1.bb37
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/pixman_0.20.0.bb4
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/pixman_0.21.4.bb4
-rw-r--r--meta-oe/recipes-graphics/xorg-lib/xorg-lib-common.inc1
-rw-r--r--meta-oe/recipes-graphics/xorg-proto/fixesproto_5.0.bb21
-rw-r--r--meta-oe/recipes-graphics/xorg-proto/xextproto_7.2.0.bb19
-rw-r--r--meta-oe/recipes-graphics/xorg-proto/xorg-proto-common.inc4
-rw-r--r--meta-oe/recipes-graphics/xorg-proto/xproto_7.0.21.bb16
-rw-r--r--meta-oe/recipes-graphics/xorg-util/util-macros_1.13.0.bb15
-rw-r--r--meta-oe/recipes-graphics/xorg-util/xorg-util-common.inc11
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xorg-xserver-common.inc112
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.10.0.901/hack-assume-pixman-supports-overlapped-blt.patch14
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.10.0.901/hack-fbdev-ignore-return-mode.patch39
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/dolt-fix.patch22
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/hack-assume-pixman-supports-overlapped-blt.patch14
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/hack-fbdev-ignore-return-mode.patch39
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/randr-support.patch102
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/am3517-evm/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/am37x-evm/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/archos5/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/archos5it/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/at91sam9263ek/xorg.conf11
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/at91sam9g45ek/xorg.conf23
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/babbage/xorg.conf56
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/beagleboard/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/bug/xorg.conf75
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/bug20/xorg.conf37
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/cm-t35/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/dm37x-evm/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/eee701/xorg.conf97
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/htcdream/xorg.conf69
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/htcleo/xorg.conf73
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/igep0020/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/ion/xorg.conf51
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/iphone3g/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/mh355/xorg.conf47
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/nokia800/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/nokia900/xorg.conf62
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/om-gta01/xorg.conf49
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/om-gta02/xorg.conf55
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3-pandora/xorg.conf24
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3-touchbook/xorg.conf25
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3evm/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom2/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom36x/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/overo/xorg.conf29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/palmpre/xorg.conf58
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/ronetix-pm9263/xorg.conf47
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/spitz/xorg.conf49
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/vortex86sx/xorg.conf13
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xilinx-ml507/xorg.conf39
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xilinx-virtex5/xorg.conf38
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xorg.conf0
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf_0.1.bb17
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_1.10.0.901.bb29
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_1.9.4.bb31
-rw-r--r--meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_git.bb38
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/89xTs_Calibrate.xinput_calibrator.patch12
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/89xdgautostart.sh9
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/90xXWindowManager.patch11
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.dpi.for.gta.patch29
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.nocursor.for.gta.patch20
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.xserver-system.patch12
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.n900.patch17
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/gplv2-license.patch353
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/setDPI.sh92
-rw-r--r--meta-oe/recipes-graphics/xserver-common/xserver-common_1.34.bb38
-rw-r--r--meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/gplv2-license.patch353
-rwxr-xr-xmeta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm44
-rw-r--r--meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init_2.0.bb27
126 files changed, 7570 insertions, 6 deletions
diff --git a/meta-oe/recipes-graphics/drm/libdrm-2.4.24/glamo.patch b/meta-oe/recipes-graphics/drm/libdrm-2.4.24/glamo.patch
new file mode 100644
index 000000000..b397ded58
--- /dev/null
+++ b/meta-oe/recipes-graphics/drm/libdrm-2.4.24/glamo.patch
@@ -0,0 +1,1095 @@
1diff --git a/Makefile.am b/Makefile.am
2index 25d1747..f384228 100644
3--- a/Makefile.am
4+++ b/Makefile.am
5@@ -41,7 +41,11 @@ if HAVE_RADEON
6 RADEON_SUBDIR = radeon
7 endif
8
9-SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) tests include
10+if HAVE_GLAMO
11+GLAMO_SUBDIR = glamo
12+endif
13+
14+SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(GLAMO_SUBDIR) tests include
15
16 libdrm_la_LTLIBRARIES = libdrm.la
17 libdrm_ladir = $(libdir)
18diff --git a/configure.ac b/configure.ac
19index 62db817..0b2a33e 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -73,6 +73,11 @@ AC_ARG_ENABLE(nouveau-experimental-api,
23 [NOUVEAU=$enableval], [NOUVEAU=no])
24
25
26+AC_ARG_ENABLE(glamo-experimental-api,
27+ AS_HELP_STRING([--enable-glamo-experimental-api],
28+ [Enable support for Glamo's KMS API (default: disabled)]),
29+ [GLAMO=$enableval], [GLAMO=no])
30+
31 dnl ===========================================================================
32 dnl check compiler flags
33 AC_DEFUN([LIBDRM_CC_TRY_FLAG], [
34@@ -169,6 +174,11 @@ if test "x$NOUVEAU" = xyes; then
35 AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau (nvidia) support])
36 fi
37
38+AM_CONDITIONAL(HAVE_GLAMO, [test "x$GLAMO" = xyes])
39+if test "x$GLAMO" = xyes; then
40+ AC_DEFINE(HAVE_GLAMO, 1, [Have glamo support])
41+fi
42+
43 PKG_CHECK_MODULES(CAIRO, cairo, [HAVE_CAIRO=yes], [HAVE_CAIRO=no])
44 if test "x$HAVE_CAIRO" = xyes; then
45 AC_DEFINE(HAVE_CAIRO, 1, [Have cairo support])
46@@ -262,6 +272,8 @@ AC_OUTPUT([
47 radeon/libdrm_radeon.pc
48 nouveau/Makefile
49 nouveau/libdrm_nouveau.pc
50+ glamo/Makefile
51+ glamo/libdrm_glamo.pc
52 tests/Makefile
53 tests/modeprint/Makefile
54 tests/modetest/Makefile
55diff --git a/glamo/Makefile.am b/glamo/Makefile.am
56new file mode 100644
57index 0000000..1f17aa3
58--- /dev/null
59+++ b/glamo/Makefile.am
60@@ -0,0 +1,52 @@
61+# Copyright (c) 2009 Thomas Whtie <taw@bitwiz.org.uk>
62+# Based on libdrm-glamo Copyright © 2008 Jérôme Glisse
63+#
64+# Permission is hereby granted, free of charge, to any person obtaining a
65+# copy of this software and associated documentation files (the "Software"),
66+# to deal in the Software without restriction, including without limitation
67+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
68+# and/or sell copies of the Software, and to permit persons to whom the
69+# Software is furnished to do so, subject to the following conditions:
70+#
71+# The above copyright notice and this permission notice (including the next
72+# paragraph) shall be included in all copies or substantial portions of the
73+# Software.
74+#
75+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
78+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
80+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
81+# IN THE SOFTWARE.
82+#
83+# Authors:
84+# Jérôme Glisse <glisse@freedesktop.org>
85+# Thomas White <taw@bitwiz.org.uk>
86+
87+AM_CFLAGS = \
88+ $(WARN_CFLAGS) \
89+ -I$(top_srcdir) \
90+ -I$(top_srcdir)/glamo \
91+ $(PTHREADSTUBS_CFLAGS) \
92+ -I$(top_srcdir)/include/drm
93+
94+libdrm_glamo_la_LTLIBRARIES = libdrm_glamo.la
95+libdrm_glamo_ladir = $(libdir)
96+libdrm_glamo_la_LDFLAGS = -version-number 1:0:0 -no-undefined
97+libdrm_glamo_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
98+
99+libdrm_glamo_la_SOURCES = \
100+ glamo_bo_gem.c \
101+ glamo_track.c
102+
103+libdrm_glamoincludedir = ${includedir}/libdrm
104+libdrm_glamoinclude_HEADERS = \
105+ glamo_bo.h \
106+ glamo_bo_gem.h \
107+ glamo_track.h
108+
109+pkgconfigdir = @pkgconfigdir@
110+pkgconfig_DATA = libdrm_glamo.pc
111+
112+EXTRA_DIST = libdrm_glamo.pc.in
113diff --git a/glamo/glamo_bo.h b/glamo/glamo_bo.h
114new file mode 100644
115index 0000000..8ef2a18
116--- /dev/null
117+++ b/glamo/glamo_bo.h
118@@ -0,0 +1,183 @@
119+/*
120+ * Copyright (c) 2009 Thomas White
121+ *
122+ * Heavily based on radeon_bo.h
123+ * Copyright © 2008 Jérôme Glisse
124+ * All Rights Reserved.
125+ *
126+ * Permission is hereby granted, free of charge, to any person obtaining
127+ * a copy of this software and associated documentation files (the
128+ * "Software"), to deal in the Software without restriction, including
129+ * without limitation the rights to use, copy, modify, merge, publish,
130+ * distribute, sub license, and/or sell copies of the Software, and to
131+ * permit persons to whom the Software is furnished to do so, subject to
132+ * the following conditions:
133+ *
134+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
135+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
136+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
137+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
138+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
139+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
140+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
141+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
142+ *
143+ * The above copyright notice and this permission notice (including the
144+ * next paragraph) shall be included in all copies or substantial portions
145+ * of the Software.
146+ */
147+/*
148+ * Authors:
149+ * Jérôme Glisse <glisse@freedesktop.org>
150+ * Thomas White <taw@bitwiz.org.uk>
151+ */
152+#ifndef GLAMO_BO_H
153+#define GLAMO_BO_H
154+
155+#include <stdio.h>
156+#include <stdint.h>
157+#include "glamo_track.h"
158+
159+/* bo object */
160+#define GLAMO_BO_FLAGS_MACRO_TILE 1
161+#define GLAMO_BO_FLAGS_MICRO_TILE 2
162+
163+struct glamo_bo_manager;
164+
165+struct glamo_bo {
166+ uint32_t alignment;
167+ uint32_t handle;
168+ uint32_t size;
169+ uint32_t domains;
170+ uint32_t flags;
171+ unsigned cref;
172+#ifdef GLAMO_BO_TRACK
173+ struct glamo_track *track;
174+#endif
175+ struct glamo_bo_manager *bom;
176+ void *virtual;
177+ uint32_t space_accounted;
178+};
179+
180+/* bo functions */
181+struct glamo_bo_funcs {
182+ struct glamo_bo *(*bo_open)(struct glamo_bo_manager *bom,
183+ uint32_t handle,
184+ uint32_t size,
185+ uint32_t alignment,
186+ uint32_t domains,
187+ uint32_t flags);
188+ void (*bo_ref)(struct glamo_bo *bo);
189+ struct glamo_bo *(*bo_unref)(struct glamo_bo *bo);
190+ int (*bo_map)(struct glamo_bo *bo, int write);
191+ int (*bo_unmap)(struct glamo_bo *bo);
192+ int (*bo_wait)(struct glamo_bo *bo);
193+};
194+
195+struct glamo_bo_manager {
196+ struct glamo_bo_funcs *funcs;
197+ int fd;
198+ struct glamo_tracker tracker;
199+};
200+
201+static inline void _glamo_bo_debug(struct glamo_bo *bo,
202+ const char *op,
203+ const char *file,
204+ const char *func,
205+ int line)
206+{
207+ fprintf(stderr, "%s %p 0x%08X 0x%08X 0x%08X [%s %s %d]\n",
208+ op, (void *)bo, bo->handle, bo->size, bo->cref, file, func, line);
209+}
210+
211+static inline struct glamo_bo *_glamo_bo_open(struct glamo_bo_manager *bom,
212+ uint32_t handle,
213+ uint32_t size,
214+ uint32_t alignment,
215+ uint32_t domains,
216+ uint32_t flags,
217+ const char *file,
218+ const char *func,
219+ int line)
220+{
221+ struct glamo_bo *bo;
222+
223+ bo = bom->funcs->bo_open(bom, handle, size, alignment, domains, flags);
224+#ifdef GLAMO_BO_TRACK
225+ if (bo) {
226+ bo->track = glamo_tracker_add_track(&bom->tracker, bo->handle);
227+ glamo_track_add_event(bo->track, file, func, "open", line);
228+ }
229+#endif
230+ return bo;
231+}
232+
233+static inline void _glamo_bo_ref(struct glamo_bo *bo,
234+ const char *file,
235+ const char *func,
236+ int line)
237+{
238+ bo->cref++;
239+#ifdef GLAMO_BO_TRACK
240+ glamo_track_add_event(bo->track, file, func, "ref", line);
241+#endif
242+ bo->bom->funcs->bo_ref(bo);
243+}
244+
245+static inline struct glamo_bo *_glamo_bo_unref(struct glamo_bo *bo,
246+ const char *file,
247+ const char *func,
248+ int line)
249+{
250+ bo->cref--;
251+#ifdef GLAMO_BO_TRACK
252+ glamo_track_add_event(bo->track, file, func, "unref", line);
253+ if (bo->cref <= 0) {
254+ glamo_tracker_remove_track(&bo->bom->tracker, bo->track);
255+ bo->track = NULL;
256+ }
257+#endif
258+ return bo->bom->funcs->bo_unref(bo);
259+}
260+
261+static inline int _glamo_bo_map(struct glamo_bo *bo,
262+ int write,
263+ const char *file,
264+ const char *func,
265+ int line)
266+{
267+ return bo->bom->funcs->bo_map(bo, write);
268+}
269+
270+static inline int _glamo_bo_unmap(struct glamo_bo *bo,
271+ const char *file,
272+ const char *func,
273+ int line)
274+{
275+ return bo->bom->funcs->bo_unmap(bo);
276+}
277+
278+static inline int _glamo_bo_wait(struct glamo_bo *bo,
279+ const char *file,
280+ const char *func,
281+ int line)
282+{
283+ return bo->bom->funcs->bo_wait(bo);
284+}
285+
286+#define glamo_bo_open(bom, h, s, a, d, f)\
287+ _glamo_bo_open(bom, h, s, a, d, f, __FILE__, __FUNCTION__, __LINE__)
288+#define glamo_bo_ref(bo)\
289+ _glamo_bo_ref(bo, __FILE__, __FUNCTION__, __LINE__)
290+#define glamo_bo_unref(bo)\
291+ _glamo_bo_unref(bo, __FILE__, __FUNCTION__, __LINE__)
292+#define glamo_bo_map(bo, w)\
293+ _glamo_bo_map(bo, w, __FILE__, __FUNCTION__, __LINE__)
294+#define glamo_bo_unmap(bo)\
295+ _glamo_bo_unmap(bo, __FILE__, __FUNCTION__, __LINE__)
296+#define glamo_bo_debug(bo, opcode)\
297+ _glamo_bo_debug(bo, opcode, __FILE__, __FUNCTION__, __LINE__)
298+#define glamo_bo_wait(bo) \
299+ _glamo_bo_wait(bo, __FILE__, __func__, __LINE__)
300+
301+#endif
302diff --git a/glamo/glamo_bo_gem.c b/glamo/glamo_bo_gem.c
303new file mode 100644
304index 0000000..38a4436
305--- /dev/null
306+++ b/glamo/glamo_bo_gem.c
307@@ -0,0 +1,336 @@
308+/*
309+ * Copyright © 2009 Thomas White
310+ *
311+ * Based on radeon_bo_gem.c, to which the following notice applies:
312+ *
313+ * Copyright © 2008 Dave Airlie
314+ * Copyright © 2008 Jérôme Glisse
315+ * All Rights Reserved.
316+ *
317+ * Permission is hereby granted, free of charge, to any person obtaining
318+ * a copy of this software and associated documentation files (the
319+ * "Software"), to deal in the Software without restriction, including
320+ * without limitation the rights to use, copy, modify, merge, publish,
321+ * distribute, sub license, and/or sell copies of the Software, and to
322+ * permit persons to whom the Software is furnished to do so, subject to
323+ * the following conditions:
324+ *
325+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
326+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
327+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
328+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
329+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
330+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
331+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
332+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
333+ *
334+ * The above copyright notice and this permission notice (including the
335+ * next paragraph) shall be included in all copies or substantial portions
336+ * of the Software.
337+ */
338+/*
339+ * Authors:
340+ * Dave Airlie
341+ * Jérôme Glisse <glisse@freedesktop.org>
342+ *
343+ *
344+ * Memory mapping functions are based on intel_bufmgr_gem.c, to which the
345+ * following notice applies:
346+ *
347+ * Copyright © 2007 Red Hat Inc.
348+ * Copyright © 2007 Intel Corporation
349+ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
350+ * All Rights Reserved.
351+ *
352+ * Permission is hereby granted, free of charge, to any person obtaining a
353+ * copy of this software and associated documentation files (the
354+ * "Software"), to deal in the Software without restriction, including
355+ * without limitation the rights to use, copy, modify, merge, publish,
356+ * distribute, sub license, and/or sell copies of the Software, and to
357+ * permit persons to whom the Software is furnished to do so, subject to
358+ * the following conditions:
359+ *
360+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
361+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
362+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
363+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
364+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
365+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
366+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
367+ *
368+ * The above copyright notice and this permission notice (including the
369+ * next paragraph) shall be included in all copies or substantial portions
370+ * of the Software.
371+ *
372+ *
373+ **************************************************************************/
374+/*
375+ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
376+ * Keith Whitwell <keithw-at-tungstengraphics-dot-com>
377+ * Eric Anholt <eric@anholt.net>
378+ * Dave Airlie <airlied@linux.ie>
379+ */
380+
381+#ifdef HAVE_CONFIG_H
382+#include "config.h"
383+#endif
384+
385+#include <stdio.h>
386+#include <stdint.h>
387+#include <stdlib.h>
388+#include <string.h>
389+#include <sys/mman.h>
390+#include <sys/ioctl.h>
391+#include <errno.h>
392+
393+#include "xf86drm.h"
394+#include "drm.h"
395+#include "glamo_drm.h"
396+#include "glamo_bo.h"
397+#include "glamo_bo_gem.h"
398+
399+struct glamo_bo_gem {
400+ struct glamo_bo base;
401+ uint32_t name;
402+ int map_count;
403+};
404+
405+struct bo_manager_gem {
406+ struct glamo_bo_manager base;
407+};
408+
409+static struct glamo_bo *bo_open(struct glamo_bo_manager *bom,
410+ uint32_t handle,
411+ uint32_t size,
412+ uint32_t alignment,
413+ uint32_t domains,
414+ uint32_t flags)
415+{
416+ struct glamo_bo_gem *bo;
417+ int r;
418+
419+ bo = (struct glamo_bo_gem*)calloc(1, sizeof(struct glamo_bo_gem));
420+ if (bo == NULL) {
421+ return NULL;
422+ }
423+
424+ bo->base.bom = bom;
425+ bo->base.handle = 0;
426+ bo->base.size = size;
427+ bo->base.alignment = alignment;
428+ bo->base.domains = domains;
429+ bo->base.flags = flags;
430+ bo->base.cref = 0;
431+ bo->map_count = 0;
432+ bo->base.virtual = NULL;
433+ if (handle) {
434+ struct drm_gem_open open_arg;
435+
436+ memset(&open_arg, 0, sizeof(open_arg));
437+ open_arg.name = handle;
438+ r = ioctl(bom->fd, DRM_IOCTL_GEM_OPEN, &open_arg);
439+ if (r != 0) {
440+ free(bo);
441+ return NULL;
442+ }
443+ bo->base.handle = open_arg.handle;
444+ bo->base.size = open_arg.size;
445+ bo->name = handle;
446+ } else {
447+ struct drm_glamo_gem_create args;
448+
449+ args.size = size;
450+ args.alignment = alignment;
451+ args.initial_domain = bo->base.domains;
452+ args.no_backing_store = 0;
453+ args.handle = 0;
454+ r = drmCommandWriteRead(bom->fd, DRM_GLAMO_GEM_CREATE,
455+ &args, sizeof(args));
456+ bo->base.handle = args.handle;
457+ if (r) {
458+ fprintf(stderr, "Failed to allocate :\n");
459+ fprintf(stderr, " size : %d bytes\n", size);
460+ fprintf(stderr, " alignment : %d bytes\n", alignment);
461+ free(bo);
462+ return NULL;
463+ }
464+ }
465+ glamo_bo_ref((struct glamo_bo*)bo);
466+ return (struct glamo_bo*)bo;
467+}
468+
469+static void bo_ref(struct glamo_bo *bo)
470+{
471+}
472+
473+static struct glamo_bo *bo_unref(struct glamo_bo *bo)
474+{
475+ struct glamo_bo_gem *bo_gem = (struct glamo_bo_gem*)bo;
476+ struct drm_gem_close args;
477+
478+ if (bo == NULL) {
479+ return NULL;
480+ }
481+ if (bo->cref) {
482+ return bo;
483+ }
484+ if (bo_gem->map_count) {
485+ munmap(bo->virtual, bo->size);
486+ }
487+
488+ /* close object */
489+ args.handle = bo->handle;
490+ ioctl(bo->bom->fd, DRM_IOCTL_GEM_CLOSE, &args);
491+ memset(bo_gem, 0, sizeof(struct glamo_bo_gem));
492+ free(bo_gem);
493+ return NULL;
494+}
495+
496+static int bo_map(struct glamo_bo *bo, int write)
497+{
498+ struct glamo_bo_gem *bo_gem;
499+ struct glamo_bo_manager *bufmgr;
500+ int ret;
501+
502+ bo_gem = (struct glamo_bo_gem *)bo;
503+ bufmgr = (struct glamo_bo_manager*)bo->bom;
504+
505+ /* Get a mapping of the buffer if we haven't before. */
506+ if (bo->virtual == NULL) {
507+
508+ struct drm_glamo_gem_mmap mmap_arg;
509+
510+ memset(&mmap_arg, 0, sizeof(mmap_arg));
511+ mmap_arg.handle = bo->handle;
512+
513+ /* Get the fake offset back... */
514+ ret = ioctl(bufmgr->fd, DRM_IOCTL_GLAMO_GEM_MMAP, &mmap_arg);
515+ if (ret != 0) {
516+ fprintf(stderr,
517+ "%s:%d: Error preparing BO map %d (%d): %s .\n",
518+ __FILE__, __LINE__,
519+ bo->handle, bo_gem->name,
520+ strerror(errno));
521+ return ret;
522+ }
523+ /* and mmap it */
524+ bo->virtual = mmap(0, bo->size, PROT_READ | PROT_WRITE,
525+ MAP_SHARED, bufmgr->fd,
526+ mmap_arg.offset);
527+ if (bo->virtual == MAP_FAILED) {
528+ fprintf(stderr,
529+ "%s:%d: Error mapping buffer %d (%d): %s .\n",
530+ __FILE__, __LINE__,
531+ bo->handle, bo_gem->name,
532+ strerror(errno));
533+ return errno;
534+ }
535+ }
536+ bo_gem->map_count++;
537+
538+ return 0;
539+}
540+
541+static int bo_unmap(struct glamo_bo *bo)
542+{
543+ struct glamo_bo_gem *bo_gem = (struct glamo_bo_gem*)bo;
544+
545+ if ( bo_gem->map_count == 0 ) {
546+ fprintf(stderr, "Not unmapping %p, because its map count"
547+ " is already zero.\n", bo_gem);
548+ return 0;
549+ }
550+
551+ if (--bo_gem->map_count > 0) {
552+ return 0;
553+ }
554+ munmap(bo->virtual, bo->size);
555+ bo->virtual = NULL;
556+ return 0;
557+}
558+
559+static int bo_wait(struct glamo_bo *bo)
560+{
561+ struct drm_glamo_gem_wait_rendering args;
562+ int ret;
563+
564+ args.handle = bo->handle;
565+ args.have_handle = 1;
566+ do {
567+ ret = drmCommandWriteRead(bo->bom->fd,
568+ DRM_GLAMO_GEM_WAIT_RENDERING,
569+ &args, sizeof(args));
570+ } while (ret == -EAGAIN);
571+ return ret;
572+}
573+
574+static struct glamo_bo_funcs bo_gem_funcs = {
575+ bo_open,
576+ bo_ref,
577+ bo_unref,
578+ bo_map,
579+ bo_unmap,
580+ bo_wait
581+};
582+
583+struct glamo_bo_manager *glamo_bo_manager_gem_ctor(int fd)
584+{
585+ struct bo_manager_gem *bomg;
586+
587+ bomg = (struct bo_manager_gem*)calloc(1, sizeof(struct bo_manager_gem));
588+ if (bomg == NULL) return NULL;
589+
590+ bomg->base.funcs = &bo_gem_funcs;
591+ bomg->base.fd = fd;
592+ return (struct glamo_bo_manager*)bomg;
593+}
594+
595+void glamo_bo_manager_gem_dtor(struct glamo_bo_manager *bom)
596+{
597+ struct bo_manager_gem *bomg = (struct bo_manager_gem*)bom;
598+
599+ if (bom == NULL) return;
600+ free(bomg);
601+}
602+
603+uint32_t glamo_gem_get_name(struct glamo_bo *bo)
604+{
605+ struct glamo_bo_gem *bo_gem = (struct glamo_bo_gem*)bo;
606+ return bo_gem->name;
607+}
608+
609+int glamo_gem_name_buffer(struct glamo_bo *bo, uint32_t *name)
610+{
611+ struct drm_gem_flink flink;
612+ int r;
613+
614+ if ( !bo ) {
615+ fprintf(stderr, "No buffer object!\n");
616+ return -1;
617+ }
618+
619+ flink.handle = bo->handle;
620+ r = ioctl(bo->bom->fd, DRM_IOCTL_GEM_FLINK, &flink);
621+ if (r) return r;
622+
623+ *name = flink.name;
624+ return 0;
625+}
626+
627+int glamo_bo_subdata(struct glamo_bo *bo, unsigned long offset,
628+ unsigned long size, const void *data)
629+{
630+ int ret;
631+
632+ if (size == 0 || data == NULL)
633+ return 0;
634+
635+ ret = bo_map(bo, 1);
636+ if ( ret ) return ret;
637+
638+ memcpy((unsigned char *)bo->virtual + offset, data, size);
639+
640+ bo_unmap(bo);
641+
642+ return 0;
643+}
644diff --git a/glamo/glamo_bo_gem.h b/glamo/glamo_bo_gem.h
645new file mode 100644
646index 0000000..05b5fb9
647--- /dev/null
648+++ b/glamo/glamo_bo_gem.h
649@@ -0,0 +1,43 @@
650+/*
651+ * Copyright © 2008 Dave Airlie
652+ * Copyright © 2008 Jérôme Glisse
653+ * All Rights Reserved.
654+ *
655+ * Permission is hereby granted, free of charge, to any person obtaining
656+ * a copy of this software and associated documentation files (the
657+ * "Software"), to deal in the Software without restriction, including
658+ * without limitation the rights to use, copy, modify, merge, publish,
659+ * distribute, sub license, and/or sell copies of the Software, and to
660+ * permit persons to whom the Software is furnished to do so, subject to
661+ * the following conditions:
662+ *
663+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
664+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
665+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
666+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
667+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
668+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
669+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
670+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
671+ *
672+ * The above copyright notice and this permission notice (including the
673+ * next paragraph) shall be included in all copies or substantial portions
674+ * of the Software.
675+ */
676+/*
677+ * Authors:
678+ * Dave Airlie
679+ * Jérôme Glisse <glisse@freedesktop.org>
680+ */
681+#ifndef GLAMO_BO_GEM_H
682+#define GLAMO_BO_GEM_H
683+
684+#include "glamo_bo.h"
685+
686+struct glamo_bo_manager *glamo_bo_manager_gem_ctor(int fd);
687+void glamo_bo_manager_gem_dtor(struct glamo_bo_manager *bom);
688+int glamo_gem_name_buffer(struct glamo_bo *bo, uint32_t *name);
689+uint32_t glamo_gem_get_name(struct glamo_bo *bo);
690+extern int glamo_bo_subdata(struct glamo_bo *bo, unsigned long offset,
691+ unsigned long size, const void *data);
692+#endif
693diff --git a/glamo/glamo_track.c b/glamo/glamo_track.c
694new file mode 100644
695index 0000000..27ffe41
696--- /dev/null
697+++ b/glamo/glamo_track.c
698@@ -0,0 +1,140 @@
699+/*
700+ * Copyright © 2008 Jérôme Glisse
701+ * All Rights Reserved.
702+ *
703+ * Permission is hereby granted, free of charge, to any person obtaining
704+ * a copy of this software and associated documentation files (the
705+ * "Software"), to deal in the Software without restriction, including
706+ * without limitation the rights to use, copy, modify, merge, publish,
707+ * distribute, sub license, and/or sell copies of the Software, and to
708+ * permit persons to whom the Software is furnished to do so, subject to
709+ * the following conditions:
710+ *
711+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
712+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
713+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
714+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
715+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
716+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
717+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
718+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
719+ *
720+ * The above copyright notice and this permission notice (including the
721+ * next paragraph) shall be included in all copies or substantial portions
722+ * of the Software.
723+ */
724+/*
725+ * Authors:
726+ * Jérôme Glisse <glisse@freedesktop.org>
727+ */
728+#include <stdio.h>
729+#include <stdlib.h>
730+#include <string.h>
731+#include "glamo_track.h"
732+
733+void glamo_track_add_event(struct glamo_track *track,
734+ const char *file,
735+ const char *func,
736+ const char *op,
737+ unsigned line)
738+{
739+ struct glamo_track_event *event;
740+
741+ if (track == NULL) {
742+ return;
743+ }
744+ event = (void*)calloc(1,sizeof(struct glamo_track_event));
745+ if (event == NULL) {
746+ return;
747+ }
748+ event->line = line;
749+ event->file = strdup(file);
750+ event->func = strdup(func);
751+ event->op = strdup(op);
752+ if (event->file == NULL || event->func == NULL || event->op == NULL) {
753+ free(event->file);
754+ free(event->func);
755+ free(event->op);
756+ free(event);
757+ return;
758+ }
759+ event->next = track->events;
760+ track->events = event;
761+}
762+
763+struct glamo_track *glamo_tracker_add_track(struct glamo_tracker *tracker,
764+ unsigned key)
765+{
766+ struct glamo_track *track;
767+
768+ track = (struct glamo_track*)calloc(1, sizeof(struct glamo_track));
769+ if (track) {
770+ track->next = tracker->tracks.next;
771+ track->prev = &tracker->tracks;
772+ tracker->tracks.next = track;
773+ if (track->next) {
774+ track->next->prev = track;
775+ }
776+ track->key = key;
777+ track->events = NULL;
778+ }
779+ return track;
780+}
781+
782+void glamo_tracker_remove_track(struct glamo_tracker *tracker,
783+ struct glamo_track *track)
784+{
785+ struct glamo_track_event *event;
786+ void *tmp;
787+
788+ if (track == NULL) {
789+ return;
790+ }
791+ track->prev->next = track->next;
792+ if (track->next) {
793+ track->next->prev = track->prev;
794+ }
795+ track->next = track->prev = NULL;
796+ event = track->events;
797+ while (event) {
798+ tmp = event;
799+ free(event->file);
800+ free(event->func);
801+ free(event->op);
802+ event = event->next;
803+ free(tmp);
804+ }
805+ track->events = NULL;
806+ free(track);
807+}
808+
809+void glamo_tracker_print(struct glamo_tracker *tracker, FILE *file)
810+{
811+ struct glamo_track *track;
812+ struct glamo_track_event *event;
813+ void *tmp;
814+
815+ track = tracker->tracks.next;
816+ while (track) {
817+ event = track->events;
818+ fprintf(file, "[0x%08X] :\n", track->key);
819+ while (event) {
820+ tmp = event;
821+ fprintf(file, " [0x%08X:%s](%s:%s:%d)\n",
822+ track->key, event->op, event->file,
823+ event->func, event->line);
824+ free(event->file);
825+ free(event->func);
826+ free(event->op);
827+ event->file = NULL;
828+ event->func = NULL;
829+ event->op = NULL;
830+ event = event->next;
831+ free(tmp);
832+ }
833+ track->events = NULL;
834+ tmp = track;
835+ track = track->next;
836+ free(tmp);
837+ }
838+}
839diff --git a/glamo/glamo_track.h b/glamo/glamo_track.h
840new file mode 100644
841index 0000000..fedead7
842--- /dev/null
843+++ b/glamo/glamo_track.h
844@@ -0,0 +1,64 @@
845+/*
846+ * Copyright © 2008 Jérôme Glisse
847+ * All Rights Reserved.
848+ *
849+ * Permission is hereby granted, free of charge, to any person obtaining
850+ * a copy of this software and associated documentation files (the
851+ * "Software"), to deal in the Software without restriction, including
852+ * without limitation the rights to use, copy, modify, merge, publish,
853+ * distribute, sub license, and/or sell copies of the Software, and to
854+ * permit persons to whom the Software is furnished to do so, subject to
855+ * the following conditions:
856+ *
857+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
858+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
859+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
860+ * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
861+ * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
862+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
863+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
864+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
865+ *
866+ * The above copyright notice and this permission notice (including the
867+ * next paragraph) shall be included in all copies or substantial portions
868+ * of the Software.
869+ */
870+/*
871+ * Authors:
872+ * Jérôme Glisse <glisse@freedesktop.org>
873+ */
874+#ifndef GLAMO_TRACK_H
875+#define GLAMO_TRACK_H
876+
877+struct glamo_track_event {
878+ struct glamo_track_event *next;
879+ char *file;
880+ char *func;
881+ char *op;
882+ unsigned line;
883+};
884+
885+struct glamo_track {
886+ struct glamo_track *next;
887+ struct glamo_track *prev;
888+ unsigned key;
889+ struct glamo_track_event *events;
890+};
891+
892+struct glamo_tracker {
893+ struct glamo_track tracks;
894+};
895+
896+void glamo_track_add_event(struct glamo_track *track,
897+ const char *file,
898+ const char *func,
899+ const char *op,
900+ unsigned line);
901+struct glamo_track *glamo_tracker_add_track(struct glamo_tracker *tracker,
902+ unsigned key);
903+void glamo_tracker_remove_track(struct glamo_tracker *tracker,
904+ struct glamo_track *track);
905+void glamo_tracker_print(struct glamo_tracker *tracker,
906+ FILE *file);
907+
908+#endif
909diff --git a/glamo/libdrm_glamo.pc.in b/glamo/libdrm_glamo.pc.in
910new file mode 100644
911index 0000000..d4d8e70
912--- /dev/null
913+++ b/glamo/libdrm_glamo.pc.in
914@@ -0,0 +1,10 @@
915+prefix=@prefix@
916+exec_prefix=@exec_prefix@
917+libdir=@libdir@
918+includedir=@includedir@
919+
920+Name: libdrm_glamo
921+Description: Userspace interface to kernel DRM services for Glamo
922+Version: 1.0.1
923+Libs: -L${libdir} -ldrm_glamo
924+Cflags: -I${includedir} -I${includedir}/libdrm
925diff --git a/include/drm/Makefile.am b/include/drm/Makefile.am
926index 43695bd..f3f7edf 100644
927--- a/include/drm/Makefile.am
928+++ b/include/drm/Makefile.am
929@@ -35,6 +35,7 @@ klibdrminclude_HEADERS = \
930 savage_drm.h \
931 sis_drm.h \
932 via_drm.h \
933+ glamo_drm.h \
934 mach64_drm.h
935
936
937diff --git a/include/drm/glamo_drm.h b/include/drm/glamo_drm.h
938new file mode 100644
939index 0000000..7629ebc
940--- /dev/null
941+++ b/include/drm/glamo_drm.h
942@@ -0,0 +1,153 @@
943+/* glamo_drm.h -- Public header for the Glamo driver
944+ *
945+ * Copyright 2009 Thomas White
946+ * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
947+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
948+ * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
949+ * All rights reserved.
950+ *
951+ * Permission is hereby granted, free of charge, to any person obtaining a
952+ * copy of this software and associated documentation files (the "Software"),
953+ * to deal in the Software without restriction, including without limitation
954+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
955+ * and/or sell copies of the Software, and to permit persons to whom the
956+ * Software is furnished to do so, subject to the following conditions:
957+ *
958+ * The above copyright notice and this permission notice (including the next
959+ * paragraph) shall be included in all copies or substantial portions of the
960+ * Software.
961+ *
962+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
963+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
964+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
965+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
966+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
967+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
968+ * DEALINGS IN THE SOFTWARE.
969+ *
970+ * Authors:
971+ * Thomas White <taw@bitwiz.org.uk>
972+ * Kevin E. Martin <martin@valinux.com>
973+ * Gareth Hughes <gareth@valinux.com>
974+ * Keith Whitwell <keith@tungstengraphics.com>
975+ */
976+
977+#ifndef __GLAMO_DRM_H__
978+#define __GLAMO_DRM_H__
979+
980+#include "drm.h"
981+
982+#define GLAMO_GEM_DOMAIN_VRAM (0x1)
983+
984+/* Glamo specific ioctls */
985+#define DRM_GLAMO_CMDBUF 0x01
986+#define DRM_GLAMO_SWAP 0x02
987+#define DRM_GLAMO_CMDBURST 0x03
988+
989+#define DRM_GLAMO_GEM_INFO 0x1c
990+#define DRM_GLAMO_GEM_CREATE 0x1d
991+#define DRM_GLAMO_GEM_MMAP 0x1e
992+#define DRM_GLAMO_GEM_PIN 0x1f
993+#define DRM_GLAMO_GEM_UNPIN 0x20
994+#define DRM_GLAMO_GEM_PREAD 0x21
995+#define DRM_GLAMO_GEM_PWRITE 0x22
996+#define DRM_GLAMO_GEM_WAIT_RENDERING 0x24
997+
998+#define DRM_IOCTL_GLAMO_CMDBUF DRM_IOW(DRM_COMMAND_BASE + DRM_GLAMO_CMDBUF, drm_glamo_cmd_buffer_t)
999+#define DRM_IOCTL_GLAMO_SWAP DRM_IO(DRM_COMMAND_BASE + DRM_GLAMO_SWAP)
1000+#define DRM_IOCTL_GLAMO_CMDBURST DRM_IOW(DRM_COMMAND_BASE + DRM_GLAMO_CMDBURST, drm_glamo_cmd_burst_t)
1001+
1002+#define DRM_IOCTL_GLAMO_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_INFO, struct drm_glamo_gem_info)
1003+#define DRM_IOCTL_GLAMO_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_CREATE, struct drm_glamo_gem_create)
1004+#define DRM_IOCTL_GLAMO_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_MMAP, struct drm_glamo_gem_mmap)
1005+#define DRM_IOCTL_GLAMO_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_PIN, struct drm_glamo_gem_pin)
1006+#define DRM_IOCTL_GLAMO_GEM_UNPIN DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_UNPIN, struct drm_glamo_gem_unpin)
1007+#define DRM_IOCTL_GLAMO_GEM_PREAD DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_PREAD, struct drm_glamo_gem_pread)
1008+#define DRM_IOCTL_GLAMO_GEM_PWRITE DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_PWRITE, struct drm_glamo_gem_pwrite)
1009+#define DRM_IOCTL_GLAMO_GEM_WAIT_RENDERING DRM_IOW(DRM_COMMAND_BASE + DRM_GLAMO_GEM_WAIT_RENDERING, struct drm_glamo_gem_wait_rendering)
1010+
1011+
1012+/* Simple command submission - a list of 16-bit address-data pairs */
1013+typedef struct drm_glamo_cmd_buffer {
1014+ unsigned int bufsz; /* Size of buffer, in bytes */
1015+ char *buf; /* Buffer of stuff to go onto the ring buffer */
1016+ unsigned int *obj_pos; /* Offsets (in bytes) at which to put objs */
1017+ uint32_t *objs; /* List of buffer object (handles) to use */
1018+ unsigned int nobjs; /* Number of objects referenced */
1019+ int nbox;
1020+ struct drm_clip_rect *boxes;
1021+} drm_glamo_cmd_buffer_t;
1022+
1023+
1024+/* Burst command submission - base address and data:
1025+ * - Data can be 32-bit (more easily)
1026+ * - Easier for the kernel to validate */
1027+typedef struct drm_glamo_cmd_burst {
1028+ uint16_t base; /* Base address (command) */
1029+ int bufsz; /* Size of data, in bytes */
1030+ uint16_t *data; /* Pointer to data */
1031+ unsigned int *obj_pos; /* Offsets (in bytes) at which to put objs */
1032+ uint32_t *objs; /* List of buffer object (handles) to use */
1033+ unsigned int nobjs; /* Number of objects referenced */
1034+} drm_glamo_cmd_burst_t;
1035+
1036+struct drm_glamo_gem_info {
1037+ uint64_t vram_start;
1038+ uint64_t vram_size;
1039+};
1040+
1041+struct drm_glamo_gem_create {
1042+ uint64_t size;
1043+ uint64_t alignment;
1044+ uint32_t handle;
1045+ uint32_t initial_domain; // to allow VRAM to be created
1046+ uint32_t no_backing_store;
1047+};
1048+
1049+struct drm_glamo_gem_mmap {
1050+ uint32_t handle; /* Handle goes in... */
1051+ uint64_t offset; /* ...offset comes out */
1052+};
1053+
1054+struct drm_glamo_gem_wait_rendering {
1055+ uint32_t handle;
1056+ int have_handle;
1057+};
1058+
1059+struct drm_glamo_gem_pin {
1060+ uint32_t handle;
1061+ uint32_t pin_domain;
1062+ uint64_t alignment;
1063+ uint64_t offset;
1064+};
1065+
1066+struct drm_glamo_gem_unpin {
1067+ uint32_t handle;
1068+ uint32_t pad;
1069+};
1070+
1071+struct drm_glamo_gem_pread {
1072+ /** Handle for the object being read. */
1073+ uint32_t handle;
1074+ uint32_t pad;
1075+ /** Offset into the object to read from */
1076+ uint64_t offset;
1077+ /** Length of data to read */
1078+ uint64_t size;
1079+ /** Pointer to write the data into. */
1080+ uint64_t data_ptr; /* void *, but pointers are not 32/64 compatible */
1081+};
1082+
1083+struct drm_glamo_gem_pwrite {
1084+ /** Handle for the object being written to. */
1085+ uint32_t handle;
1086+ uint32_t pad;
1087+ /** Offset into the object to write to */
1088+ uint64_t offset;
1089+ /** Length of data to write */
1090+ uint64_t size;
1091+ /** Pointer to read the data from. */
1092+ uint64_t data_ptr; /* void *, but pointers are not 32/64 compatible */
1093+};
1094+
1095+#endif
diff --git a/meta-oe/recipes-graphics/drm/libdrm-2.4.24/installtests.patch b/meta-oe/recipes-graphics/drm/libdrm-2.4.24/installtests.patch
new file mode 100644
index 000000000..9d6a168bb
--- /dev/null
+++ b/meta-oe/recipes-graphics/drm/libdrm-2.4.24/installtests.patch
@@ -0,0 +1,43 @@
1Index: libdrm-2.4.7/tests/Makefile.am
2===================================================================
3--- libdrm-2.4.7.orig/tests/Makefile.am 2009-04-09 20:16:35.000000000 +0100
4+++ libdrm-2.4.7/tests/Makefile.am 2009-04-17 12:35:14.000000000 +0100
5@@ -6,10 +6,11 @@
6
7 LDADD = $(top_builddir)/libdrm.la
8
9-check_PROGRAMS = \
10+bin_PROGRAMS = \
11 dristat \
12 drmstat
13
14+check_PROGRAMS =
15 SUBDIRS =
16
17 if HAVE_LIBKMS
18Index: libdrm-2.4.7/tests/modeprint/Makefile.am
19===================================================================
20--- libdrm-2.4.7.orig/tests/modeprint/Makefile.am 2009-02-17 19:52:37.000000000 +0000
21+++ libdrm-2.4.7/tests/modeprint/Makefile.am 2009-04-17 12:35:32.000000000 +0100
22@@ -3,7 +3,7 @@
23 -I$(top_srcdir)/libdrm/intel/ \
24 -I$(top_srcdir)/libdrm
25
26-noinst_PROGRAMS = \
27+bin_PROGRAMS = \
28 modeprint
29
30 modeprint_SOURCES = \
31Index: libdrm-2.4.7/tests/modetest/Makefile.am
32===================================================================
33--- libdrm-2.4.7.orig/tests/modetest/Makefile.am 2009-02-17 19:52:37.000000000 +0000
34+++ libdrm-2.4.7/tests/modetest/Makefile.am 2009-04-17 12:35:42.000000000 +0100
35@@ -4,7 +4,7 @@
36 -I$(top_srcdir)/libdrm \
37 $(CAIRO_CFLAGS)
38
39-noinst_PROGRAMS = \
40+bin_PROGRAMS = \
41 modetest
42
43 modetest_SOURCES = \
diff --git a/meta-oe/recipes-graphics/drm/libdrm_2.4.24.bb b/meta-oe/recipes-graphics/drm/libdrm_2.4.24.bb
new file mode 100644
index 000000000..0a2365ec3
--- /dev/null
+++ b/meta-oe/recipes-graphics/drm/libdrm_2.4.24.bb
@@ -0,0 +1,39 @@
1SUMMARY = "Userspace interface to the kernel DRM services"
2DESCRIPTION = "The runtime library for accessing the kernel DRM services. DRM \
3stands for \"Direct Rendering Manager\", which is the kernel portion of the \
4\"Direct Rendering Infrastructure\" (DRI). DRI is required for many hardware \
5accelerated OpenGL drivers."
6HOMEPAGE = "http://dri.freedesktop.org"
7SECTION = "x11/base"
8LICENSE = "MIT"
9LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71"
10SRC_URI = "http://dri.freedesktop.org/libdrm/libdrm-${PV}.tar.bz2"
11PROVIDES = "drm"
12DEPENDS = "libpthread-stubs udev cairo virtual/libx11"
13
14inherit autotools pkgconfig
15
16PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-kms ${@base_contains('MACHINE_FEATURES', 'x86', '${PN}-intel', '',d)}"
17FILES_${PN}-tests = "${bindir}/dr* ${bindir}/mode*"
18FILES_${PN}-drivers = "${libdir}/libdrm_*.so.*"
19FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
20FILES_${PN}-kms = "${libdir}/libkms*.so.*"
21
22LEAD_SONAME = "libdrm.so"
23
24EXTRA_OECONF_append = " ${@base_contains('MACHINE_FEATURES', 'x86', '', '--disable-intel --disable-radeon',d)}"
25EXTRA_OECONF_append_shr = " --enable-glamo-experimental-api"
26
27PR = "r8"
28
29SRC_URI += "file://installtests.patch"
30SRC_URI += "file://glamo.patch"
31
32SRC_URI[md5sum] = "8d802bf3b368f9fac0d7d17516a9436f"
33SRC_URI[sha256sum] = "c7012381f64458af9f291d913309448aac7dd23a28dc86c6970e4bf38effb6a5"
34
35do_compile_prepend_libc-uclibc() {
36 eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/intel.c', d)}"
37 eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/vmwgfx.c', d)}"
38 eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/nouveau.c', d)}"
39}
diff --git a/meta-oe/recipes-graphics/mesa/README b/meta-oe/recipes-graphics/mesa/README
new file mode 100644
index 000000000..3c6de3ee4
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/README
@@ -0,0 +1,12 @@
1mesa-common.inc
2* Settings shared by ALL recipes
3
4mesa-${PV}.inc
5* Settings for particular version, mostly checksums and additional patches
6* Patches are stored mesa-${PV} dir and -dri and xlib has adjusted FILESPATHPKG
7
8mesa-dri.inc
9* Setting shared by ALL dri recipes - defines what is mesa-dri
10
11mesa-xlib.inc
12* Setting shared by ALL xlib recipes - defines what is mesa-xlib
diff --git a/meta-oe/recipes-graphics/mesa/mesa-7.10.2.inc b/meta-oe/recipes-graphics/mesa/mesa-7.10.2.inc
new file mode 100644
index 000000000..f49f49598
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/mesa-7.10.2.inc
@@ -0,0 +1,19 @@
1SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2;name=archive \
2 file://glamo.patch \
3 file://uclibc.patch \
4 "
5
6DEPENDS += "talloc"
7
8SRC_URI[archive.md5sum] = "f5de82852f1243f42cc004039e10b771"
9SRC_URI[archive.sha256sum] = "8ced2678ce11cf30804694a92ea3ca6b82f158ae8995bdc626c7e85aac71c7c1"
10
11EXTRA_OECONF += " --disable-gallium"
12
13#needs more testing and updated glamo.patch before making default
14DEFAULT_PREFERENCE = "-2"
15
16do_configure_prepend() {
17 #check for python not python2, because python-native does not stage python2 binary/link
18 sed -i 's/AC_CHECK_PROGS(\[PYTHON2\], \[python2 python\])/AC_CHECK_PROGS(\[PYTHON2\], \[python python\])/g' ${S}/configure.ac
19}
diff --git a/meta-oe/recipes-graphics/mesa/mesa-7.10.2/glamo.patch b/meta-oe/recipes-graphics/mesa/mesa-7.10.2/glamo.patch
new file mode 100644
index 000000000..5aa45d57e
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/mesa-7.10.2/glamo.patch
@@ -0,0 +1,2425 @@
1git diff upstream/7.10 and gitorious/7.10
2
3http://gitorious.org/mesa/mesa/commits/7.10
4
5diff --git a/configs/autoconf.in b/configs/autoconf.in
6index e2d70c6..5874955 100644
7--- a/configs/autoconf.in
8+++ b/configs/autoconf.in
9@@ -120,7 +120,7 @@ OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
10 $(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@
11 EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
12 GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
13- $(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
14+ $(EXTRA_LIB_PATH) @GLU_LIB_DEPS@ -lstdc++
15 GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLUT_MESA_DEPS@ \
16 $(EXTRA_LIB_PATH) @GLUT_LIB_DEPS@
17 GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
18diff --git a/src/mesa/drivers/dri/glamo/Makefile b/src/mesa/drivers/dri/glamo/Makefile
19new file mode 100644
20index 0000000..e77193d
21--- /dev/null
22+++ b/src/mesa/drivers/dri/glamo/Makefile
23@@ -0,0 +1,22 @@
24+# src/mesa/drivers/dri/glamo/Makefile
25+
26+TOP = ../../../../..
27+include $(TOP)/configs/current
28+
29+LIBNAME = glamo_dri.so
30+
31+DRIVER_SOURCES = \
32+ glamo_screen.c glamo_context.c glamo_state.c glamo_fbo.c glamo_tris.c \
33+ glamo_cmdq.c glamo_render.c
34+
35+C_SOURCES = \
36+ $(COMMON_SOURCES) \
37+ $(DRIVER_SOURCES)
38+
39+ASM_SOURCES =
40+
41+DRI_LIB_DEPS += -ldrm_glamo
42+
43+include ../Makefile.template
44+
45+symlinks:
46diff --git a/src/mesa/drivers/dri/glamo/glamo_cmdq.c b/src/mesa/drivers/dri/glamo/glamo_cmdq.c
47new file mode 100644
48index 0000000..1334f8e
49--- /dev/null
50+++ b/src/mesa/drivers/dri/glamo/glamo_cmdq.c
51@@ -0,0 +1,110 @@
52+/*
53+ * Command queue submission via DRM
54+ *
55+ * Copyright 2009 Thomas White <taw@bitwiz.org.uk>
56+ *
57+ * This program is free software; you can redistribute it and/or
58+ * modify it under the terms of the GNU General Public License as
59+ * published by the Free Software Foundation; either version 2 of
60+ * the License, or (at your option) any later version.
61+ *
62+ * This program is distributed in the hope that it will be useful,
63+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
64+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65+ * GNU General Public License for more details.
66+ *
67+ * You should have received a copy of the GNU General Public License
68+ * along with this program; if not, write to the Free Software
69+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
70+ * MA 02111-1307 USA
71+ */
72+
73+
74+#include <stdint.h>
75+#include <stdlib.h>
76+#include <drm.h>
77+#include <glamo_drm.h>
78+#include <glamo_bo.h>
79+
80+#include "glamo_context.h"
81+#include "glamo_cmdq.h"
82+
83+
84+/* Submit the prepared command sequence to the kernel */
85+void glamoDRMDispatch(glamoContext *gCtx)
86+{
87+ drm_glamo_cmd_burst_t burst;
88+ int r;
89+
90+ burst.base = gCtx->cmd_burst_base;
91+ burst.data = gCtx->cmdq_drm;
92+ burst.bufsz = gCtx->cmdq_drm_used * 2; /* -> bytes */
93+ burst.nobjs = gCtx->cmdq_obj_used;
94+ burst.objs = gCtx->cmdq_objs;
95+ burst.obj_pos = gCtx->cmdq_obj_pos;
96+
97+ r = drmCommandWrite(gCtx->drm_fd, DRM_GLAMO_CMDBURST,
98+ &burst, sizeof(burst));
99+ if ( r != 0 ) {
100+ fprintf(stderr, "DRM_GLAMO_CMDBURST failed\n");
101+ }
102+
103+ /* Reset counts to zero for the next sequence */
104+ gCtx->cmdq_obj_used = 0;
105+ gCtx->cmdq_drm_used = 0;
106+}
107+
108+
109+void glamoDRMAddData(glamoContext *gCtx, uint32_t val, int len)
110+{
111+ if ( gCtx->cmdq_drm_used+4 > gCtx->cmdq_drm_size ) {
112+ fprintf(stderr, "Burst command too large\n");
113+ return;
114+ }
115+
116+ /* Record command */
117+ if ( len == 2 ) {
118+ gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = val & 0xffff;
119+ } else if ( len == 4 ) {
120+ gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = val & 0x0000ffff;
121+ gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = val & 0xffff0000;
122+ } else {
123+ fprintf(stderr, "Wrong command length!\n");
124+ }
125+}
126+
127+
128+void glamoDRMAddBO(glamoContext *gCtx, struct glamo_bo *bo)
129+{
130+ if ( gCtx->cmdq_drm_used+4 > gCtx->cmdq_drm_size ) {
131+ fprintf(stderr, "Burst command too large\n");
132+ return;
133+ }
134+
135+ /* Record object position */
136+ gCtx->cmdq_objs[gCtx->cmdq_obj_used] = bo->handle;
137+ /* -> bytes */
138+ gCtx->cmdq_obj_pos[gCtx->cmdq_obj_used] = gCtx->cmdq_drm_used * 2;
139+ gCtx->cmdq_obj_used++;
140+
141+ /* Record command */
142+ gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = 0x0000;
143+ gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = 0x0000;
144+}
145+
146+
147+void glamoDRMStartBurst(glamoContext *gCtx, uint16_t base)
148+{
149+ gCtx->cmd_burst_base = base;
150+}
151+
152+
153+void glamoInitCmdqCache(glamoContext *gCtx)
154+{
155+ gCtx->cmdq_objs = malloc(1024);
156+ gCtx->cmdq_obj_pos = malloc(1024);
157+ gCtx->cmdq_obj_used = 0;
158+ gCtx->cmdq_drm_used = 0;
159+ gCtx->cmdq_drm_size = 4 * 1024;
160+ gCtx->cmdq_drm = malloc(gCtx->cmdq_drm_size);
161+}
162diff --git a/src/mesa/drivers/dri/glamo/glamo_cmdq.h b/src/mesa/drivers/dri/glamo/glamo_cmdq.h
163new file mode 100644
164index 0000000..7420d7b
165--- /dev/null
166+++ b/src/mesa/drivers/dri/glamo/glamo_cmdq.h
167@@ -0,0 +1,33 @@
168+/*
169+ * Command queue submission via DRM
170+ *
171+ * Copyright 2009 Thomas White <taw@bitwiz.org.uk>
172+ *
173+ * This program is free software; you can redistribute it and/or
174+ * modify it under the terms of the GNU General Public License as
175+ * published by the Free Software Foundation; either version 2 of
176+ * the License, or (at your option) any later version.
177+ *
178+ * This program is distributed in the hope that it will be useful,
179+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
180+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
181+ * GNU General Public License for more details.
182+ *
183+ * You should have received a copy of the GNU General Public License
184+ * along with this program; if not, write to the Free Software
185+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
186+ * MA 02111-1307 USA
187+ */
188+
189+
190+#include <stdint.h>
191+#include <glamo_bo.h>
192+
193+#include "glamo_context.h"
194+
195+
196+extern void glamoDRMDispatch(glamoContext *gCtx);
197+extern void glamoDRMAddBO(glamoContext *gCtx, struct glamo_bo *bo);
198+extern void glamoDRMAddData(glamoContext *gCtx, uint32_t val, int len);
199+extern void glamoDRMStartBurst(glamoContext *gCtx, uint16_t base);
200+extern void glamoInitCmdqCache(glamoContext *gCtx);
201diff --git a/src/mesa/drivers/dri/glamo/glamo_context.c b/src/mesa/drivers/dri/glamo/glamo_context.c
202new file mode 100644
203index 0000000..39eb4e7
204--- /dev/null
205+++ b/src/mesa/drivers/dri/glamo/glamo_context.c
206@@ -0,0 +1,360 @@
207+/*
208+ * Direct Rendering Support for SMedia Glamo 336x/337x
209+ *
210+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
211+ * Roughly based on sis_context.c (c) 2003 Eric Anholt
212+ * and radeon_common_context.c
213+ *
214+ * Permission is hereby granted, free of charge, to any person obtaining a
215+ * copy of this software and associated documentation files (the "Software"),
216+ * to deal in the Software without restriction, including without limitation
217+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
218+ * and/or sell copies of the Software, and to permit persons to whom the
219+ * Software is furnished to do so, subject to the following conditions:
220+ *
221+ * The above copyright notice and this permission notice shall be included
222+ * in all copies or substantial portions of the Software.
223+ *
224+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
225+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
226+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
227+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
228+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
229+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
230+ */
231+
232+
233+#include "dri_util.h"
234+#include "drirenderbuffer.h"
235+#include "utils.h"
236+
237+#include "swrast/swrast.h"
238+#include "swrast_setup/swrast_setup.h"
239+#include "drivers/common/driverfuncs.h"
240+#include "vbo/vbo.h"
241+#include "tnl/tnl.h"
242+#include "tnl/t_pipeline.h"
243+#include "main/state.h"
244+
245+#include "glamo_context.h"
246+#include "glamo_screen.h"
247+#include "glamo_state.h"
248+#include "glamo_fbo.h"
249+#include "glamo_tris.h"
250+#include "glamo_render.h"
251+#include "glamo_cmdq.h"
252+
253+#include <glamo_bo.h>
254+#include <glamo_bo_gem.h>
255+#include <glamo_drm.h>
256+
257+
258+#define DRIVER_DATE "20090913"
259+
260+
261+static inline struct glamo_renderbuffer *glamo_get_renderbuffer(
262+ struct gl_framebuffer *fb,
263+ int att_index)
264+{
265+ if ( att_index >= 0 ) {
266+ struct glamo_renderbuffer *gr;
267+ gr = glamo_renderbuffer(fb->Attachment[att_index].Renderbuffer);
268+ return gr;
269+ } else {
270+ return NULL;
271+ }
272+}
273+
274+
275+static const GLubyte *glamoGetString(struct gl_context *ctx, GLenum name)
276+{
277+ static char buffer[128];
278+
279+ switch (name) {
280+ case GL_VENDOR:
281+ return (GLubyte *)"Thomas White";
282+ case GL_RENDERER: {
283+ driGetRendererString(buffer, "Glamo", DRIVER_DATE, 0);
284+ return (GLubyte *) buffer;
285+ }
286+ default:
287+ return 0;
288+ }
289+}
290+
291+
292+/* Called when Mesa needs to know the size of the framebuffer */
293+static void glamoBufferSize(struct gl_framebuffer *buffer,
294+ GLuint *width, GLuint *height)
295+{
296+ GET_CURRENT_CONTEXT(ctx);
297+ glamoContextPtr glamo = GLAMO_CONTEXT(ctx);
298+
299+ *width = glamo->driDrawable->w;
300+ *height = glamo->driDrawable->h;
301+}
302+
303+
304+GLboolean glamoCreateContext(const struct gl_config *glVisual,
305+ __DRIcontext *driContextPriv,
306+ void *sharedContextPrivate)
307+{
308+ struct gl_context *ctx, *shareCtx;
309+ __DRIscreen *sPriv = driContextPriv->driScreenPriv;
310+ glamoContextPtr context;
311+ glamoScreenPtr glamoScreen;
312+ struct dd_function_table functions;
313+
314+ context = (glamoContextPtr)CALLOC(sizeof(*context));
315+ if ( context == NULL ) return GL_FALSE;
316+
317+ _mesa_init_driver_functions(&functions);
318+
319+ /* Allocate the Mesa context */
320+ if ( sharedContextPrivate )
321+ shareCtx = ((glamoContextPtr)sharedContextPrivate)->glCtx;
322+ else
323+ shareCtx = NULL;
324+ context->glCtx = _mesa_create_context(glVisual, shareCtx,
325+ &functions, (void *)context);
326+ if ( context->glCtx == NULL ) {
327+ FREE(context);
328+ return GL_FALSE;
329+ }
330+ driContextPriv->driverPrivate = context;
331+ ctx = context->glCtx;
332+
333+ glamoScreen = context->glamoScreen = (glamoScreenPtr)sPriv->private;
334+
335+ ctx->Driver.GetString = glamoGetString;
336+ ctx->Driver.GetBufferSize = glamoBufferSize;
337+
338+ context->driContext = driContextPriv;
339+ context->driScreen = sPriv;
340+ context->driDrawable = NULL;
341+ context->drm_fd = sPriv->fd;
342+
343+ /* Initialize the software rasterizer and helper modules. */
344+ _swrast_CreateContext(ctx);
345+ _vbo_CreateContext(ctx);
346+ _tnl_CreateContext(ctx);
347+ _swsetup_CreateContext(ctx);
348+
349+ /* Install our pipeline (see glamo_render.c) */
350+ _tnl_install_pipeline(ctx, glamo_pipeline);
351+
352+ _swrast_allow_pixel_fog(ctx, GL_TRUE);
353+ _swrast_allow_vertex_fog(ctx, GL_FALSE);
354+ _tnl_allow_pixel_fog(ctx, GL_TRUE);
355+ _tnl_allow_vertex_fog(ctx, GL_FALSE);
356+
357+ glamoInitCmdqCache(context);
358+ glamoInitStateFuncs(ctx);
359+ glamoInitTriFuncs(ctx);
360+
361+ return GL_TRUE;
362+}
363+
364+
365+void glamoDestroyContext(__DRIcontext *driContextPriv)
366+{
367+ glamoContextPtr context;
368+
369+ context = (glamoContextPtr)driContextPriv->driverPrivate;
370+ assert(context != NULL);
371+
372+ if ( context != NULL ) {
373+
374+ _swsetup_DestroyContext(context->glCtx);
375+ _tnl_DestroyContext(context->glCtx);
376+ _vbo_DestroyContext(context->glCtx);
377+ _swrast_DestroyContext(context->glCtx);
378+
379+ _mesa_destroy_context(context->glCtx);
380+
381+ }
382+
383+ FREE(context);
384+}
385+
386+
387+void glamo_update_renderbuffers(__DRIcontext *context,
388+ __DRIdrawable *drawable)
389+{
390+ unsigned int attachments[10];
391+ __DRIbuffer *buffers;
392+ __DRIscreen *screen;
393+ int i, count;
394+ struct glamo_framebuffer *draw;
395+ glamoContextPtr glamo;
396+ struct glamo_bo *bo;
397+
398+ draw = drawable->driverPrivate;
399+ screen = context->driScreenPriv;
400+ glamo = (glamoContextPtr)context->driverPrivate;
401+ i = 0;
402+ if ( draw->color_rb[0] ) {
403+ attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
404+ }
405+ if ( draw->color_rb[1] ) {
406+ attachments[i++] = __DRI_BUFFER_BACK_LEFT;
407+ }
408+
409+ buffers = screen->dri2.loader->getBuffers(drawable,
410+ &drawable->w,
411+ &drawable->h,
412+ attachments, i,
413+ &count,
414+ drawable->loaderPrivate);
415+ if ( buffers == NULL ) return;
416+
417+ /* Set one cliprect to cover the whole drawable */
418+ drawable->x = 0;
419+ drawable->y = 0;
420+ drawable->backX = 0;
421+ drawable->backY = 0;
422+ drawable->numClipRects = 1;
423+ drawable->pClipRects[0].x1 = 0;
424+ drawable->pClipRects[0].y1 = 0;
425+ drawable->pClipRects[0].x2 = drawable->w;
426+ drawable->pClipRects[0].y2 = drawable->h;
427+ drawable->numBackClipRects = 1;
428+ drawable->pBackClipRects[0].x1 = 0;
429+ drawable->pBackClipRects[0].y1 = 0;
430+ drawable->pBackClipRects[0].x2 = drawable->w;
431+ drawable->pBackClipRects[0].y2 = drawable->h;
432+
433+ /* For each attachment */
434+ for ( i=0; i<count; i++ ) {
435+
436+ struct glamo_renderbuffer *grb;
437+
438+ switch ( buffers[i].attachment ) {
439+ case __DRI_BUFFER_FRONT_LEFT:
440+ grb = draw->color_rb[0];
441+ break;
442+ case __DRI_BUFFER_BACK_LEFT:
443+ grb = draw->color_rb[1];
444+ break;
445+ case __DRI_BUFFER_DEPTH:
446+ grb = glamo_get_renderbuffer(&draw->base, BUFFER_DEPTH);
447+ break;
448+ case __DRI_BUFFER_STENCIL:
449+ grb = glamo_get_renderbuffer(&draw->base,
450+ BUFFER_STENCIL);
451+ break;
452+ case __DRI_BUFFER_FAKE_FRONT_LEFT:
453+ grb = draw->color_rb[0];
454+ break;
455+ case __DRI_BUFFER_ACCUM:
456+ default:
457+ fprintf(stderr,
458+ "Unhandled buffer attach event,"
459+ " attachment type %d\n", buffers[i].attachment);
460+ return;
461+ }
462+
463+ if ( grb == NULL ) {
464+ /* Don't know how to handle this type of buffer */
465+ continue;
466+ }
467+
468+ if ( grb->bo ) {
469+ uint32_t name = glamo_gem_get_name(grb->bo);
470+ if ( name == buffers[i].name ) {
471+ /* Buffer already attached. No action needed */
472+ continue;
473+ }
474+ }
475+
476+ grb->cpp = buffers[i].cpp;
477+ grb->pitch = buffers[i].pitch;
478+ grb->width = drawable->w;
479+ grb->height = drawable->h;
480+
481+ bo = glamo_bo_open(glamo->glamoScreen->bom, buffers[i].name,
482+ 0, 0, GLAMO_GEM_DOMAIN_VRAM,
483+ buffers[i].flags);
484+ if ( bo == NULL ) {
485+ fprintf(stderr, "Failed to attach buffer %d\n",
486+ buffers[i].name);
487+ }
488+
489+ glamo_renderbuffer_set_bo(grb, bo);
490+ glamo_bo_unref(bo);
491+
492+ }
493+
494+ driUpdateFramebufferSize(glamo->glCtx, drawable);
495+}
496+
497+
498+GLboolean glamoMakeCurrent(__DRIcontext *driContextPriv,
499+ __DRIdrawable *driDrawPriv,
500+ __DRIdrawable *driReadPriv)
501+{
502+ struct glamo_framebuffer *draw_fb;
503+ struct gl_framebuffer *read_fb;
504+ glamoContextPtr glamo;
505+
506+ if ( driContextPriv == NULL ) {
507+ _mesa_make_current(NULL, NULL, NULL);
508+ return GL_TRUE;
509+ }
510+
511+ /* The Glamo context we're switching to */
512+ glamo = (glamoContextPtr)driContextPriv->driverPrivate;
513+
514+ glamo->driDrawable = driDrawPriv;
515+
516+ /* These two will probably be the same */
517+ draw_fb = (struct glamo_framebuffer *)driDrawPriv->driverPrivate;
518+ read_fb = (struct gl_framebuffer *)driReadPriv->driverPrivate;
519+
520+ glamo_update_renderbuffers(driContextPriv, driDrawPriv);
521+ if (driDrawPriv != driReadPriv)
522+ glamo_update_renderbuffers(driContextPriv, driReadPriv);
523+
524+ _mesa_make_current(glamo->glCtx, &draw_fb->base, read_fb);
525+ _mesa_update_state(glamo->glCtx);
526+
527+ return GL_TRUE;
528+}
529+
530+
531+GLboolean glamoUnbindContext(__DRIcontext *driContextPriv)
532+{
533+ return GL_TRUE;
534+}
535+
536+
537+/* Convert IEEE754 32-bit float to Glamo's signed 24-bit float */
538+uint32_t float7s16(GLfloat in)
539+{
540+ uint32_t a, b;
541+ uint32_t sign, expo, mant; /* Sign, exponent, significand */
542+
543+ a = *(uint32_t *)&in;
544+
545+ /* This is bad */
546+ if ( a & 0x40000000 ) {
547+ printf(stderr, "Warning: Exponent won't fit into 7 bits\n");
548+ }
549+
550+ /* This hopefully isn't a big problem */
551+ if ( a & 0x0000007f ) {
552+ printf(stderr, "Warning: Precision lost in FP conversion\n");
553+ }
554+
555+ /* Separate out the right bits */
556+ mant = a & 0x007fff80; /* Bits 7-22 (bits 0-6 are lost) */
557+ expo = a & 0x3f800000; /* Bits 23-29 (bit 30 is lost) */
558+ sign = a & 0x80000000; /* Bit 31 */
559+
560+ /* Shift and recombine */
561+ b = sign >> 8; /* Fills bit 23 */
562+ b |= expo >> 7; /* Fills bits 16-22 */
563+ b |= mant >> 7; /* Fills bits 0-15 */
564+
565+ return b;
566+}
567diff --git a/src/mesa/drivers/dri/glamo/glamo_context.h b/src/mesa/drivers/dri/glamo/glamo_context.h
568new file mode 100644
569index 0000000..8de3946
570--- /dev/null
571+++ b/src/mesa/drivers/dri/glamo/glamo_context.h
572@@ -0,0 +1,106 @@
573+/*
574+ * Direct Rendering Support for SMedia Glamo 336x/337x
575+ *
576+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
577+ * Roughly based on sis_context.h (c) 2003 Eric Anholt
578+ *
579+ * Permission is hereby granted, free of charge, to any person obtaining a
580+ * copy of this software and associated documentation files (the "Software"),
581+ * to deal in the Software without restriction, including without limitation
582+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
583+ * and/or sell copies of the Software, and to permit persons to whom the
584+ * Software is furnished to do so, subject to the following conditions:
585+ *
586+ * The above copyright notice and this permission notice shall be included
587+ * in all copies or substantial portions of the Software.
588+ *
589+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
590+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
591+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
592+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
593+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
594+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
595+ */
596+
597+#ifndef __GLAMO_CONTEXT_H
598+#define __GLAMO_CONTEXT_H
599+
600+
601+#include "dri_util.h"
602+#include "utils.h"
603+#include "tnl/t_vertex.h"
604+
605+#include "glamo_screen.h"
606+
607+
608+typedef struct glamo_context glamoContext;
609+typedef struct glamo_context *glamoContextPtr;
610+
611+struct glamo_context {
612+
613+ struct gl_context *glCtx; /* Must be first in this structure */
614+
615+ int drm_fd; /* DRM fd */
616+
617+ __DRIcontext *driContext; /* DRI context */
618+ __DRIscreen *driScreen; /* DRI screen */
619+ __DRIdrawable *driDrawable; /* DRI drawable bound to this ctx */
620+
621+ glamoScreenPtr glamoScreen; /* Screen private DRI data */
622+
623+ driOptionCache optionCache;
624+
625+ uint16_t *cmdq_drm; /* Command queue cache */
626+ uint16_t cmd_burst_base;
627+ int cmdq_drm_used;
628+ int cmdq_drm_size;
629+ int cmdq_obj_used;
630+ uint32_t *cmdq_objs;
631+ unsigned int *cmdq_obj_pos;
632+
633+ /* Information about the current primitive */
634+ struct {
635+ GLuint id;
636+ uint32_t primitive; /* Current hardware primitive type */
637+ struct glamo_bo *vb_bo;
638+ uint8_t *vb;
639+ unsigned int start_offset; /* Byte offset of start */
640+ unsigned int current_offset; /* Byte offset of next vertex */
641+ unsigned int count; /* Number of vertices */
642+ } prim;
643+
644+ /* Current vertex format and attributes */
645+ int vertex_size;
646+ struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
647+
648+ /* State */
649+ GLuint new_state; /* State which must be updated */
650+ uint16_t col_clear;
651+
652+};
653+
654+#define GLAMO_CONTEXT(ctx) ((glamoContextPtr)(ctx->DriverCtx))
655+
656+#define TAG(x) glamo##x
657+#include "tnl_dd/t_dd_vertex.h"
658+#undef TAG
659+
660+extern GLboolean glamoCreateContext(const struct gl_config *glVis,
661+ __DRIcontext *driContextPriv,
662+ void *sharedContextPrivate);
663+extern void glamoDestroyContext(__DRIcontext *dcp);
664+extern GLboolean glamoMakeCurrent(__DRIcontext *driContextPriv,
665+ __DRIdrawable *driDrawPriv,
666+ __DRIdrawable *driReadPriv);
667+extern GLboolean glamoUnbindContext(__DRIcontext *driContextPriv);
668+extern void glamo_update_renderbuffers(__DRIcontext *context,
669+ __DRIdrawable *drawable);
670+
671+#define GLAMO_PACKCOLOR565(r, g, b) \
672+ ((((r) & 0xf8) << 8) \
673+ | (((g) & 0xfc) << 3) \
674+ | (((b) & 0xf8) >> 3))
675+
676+extern uint32_t float7s16(GLfloat in);
677+
678+#endif /* __GLAMO_CONTEXT_H */
679diff --git a/src/mesa/drivers/dri/glamo/glamo_fbo.c b/src/mesa/drivers/dri/glamo/glamo_fbo.c
680new file mode 100644
681index 0000000..e25ca31
682--- /dev/null
683+++ b/src/mesa/drivers/dri/glamo/glamo_fbo.c
684@@ -0,0 +1,130 @@
685+/*
686+ * Direct Rendering Support for SMedia Glamo 336x/337x
687+ *
688+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
689+ * Roughly based on radeon_fbo.c (c) 2008 Red Hat Inc
690+ *
691+ * Permission is hereby granted, free of charge, to any person obtaining a
692+ * copy of this software and associated documentation files (the "Software"),
693+ * to deal in the Software without restriction, including without limitation
694+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
695+ * and/or sell copies of the Software, and to permit persons to whom the
696+ * Software is furnished to do so, subject to the following conditions:
697+ *
698+ * The above copyright notice and this permission notice shall be included
699+ * in all copies or substantial portions of the Software.
700+ *
701+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
702+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
703+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
704+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
705+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
706+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
707+ */
708+
709+
710+#include "main/imports.h"
711+#include "main/macros.h"
712+#include "main/mtypes.h"
713+#include "main/formats.h"
714+#include "main/fbobject.h"
715+#include "main/framebuffer.h"
716+#include "main/renderbuffer.h"
717+#include "main/context.h"
718+#include "dri_util.h"
719+
720+/* This comes from libdrm_glamo */
721+#include <glamo_bo.h>
722+
723+#include "glamo_fbo.h"
724+
725+
726+static void glamo_delete_renderbuffer(struct gl_renderbuffer *rb)
727+{
728+ struct glamo_renderbuffer *grb = glamo_renderbuffer(rb);
729+
730+ ASSERT(grb);
731+
732+ if ( grb && grb->bo ) {
733+ glamo_bo_unref(grb->bo);
734+ }
735+ free(grb);
736+}
737+
738+
739+static void *glamo_get_pointer(struct gl_context *ctx, struct gl_renderbuffer *rb,
740+ GLint x, GLint y)
741+{
742+ return NULL; /* Can't be directly addressed */
743+}
744+
745+
746+/* Called for each hardware renderbuffer when a _window_ is resized.
747+ * Just update fields.
748+ * Not used for user-created renderbuffers!
749+ */
750+static GLboolean glamo_alloc_window_storage(struct gl_context *ctx,
751+ struct gl_renderbuffer *rb,
752+ GLenum internalFormat,
753+ GLuint width, GLuint height)
754+{
755+ ASSERT(rb->Name == 0);
756+ rb->Width = width;
757+ rb->Height = height;
758+ rb->Format = internalFormat;
759+ return GL_TRUE;
760+}
761+
762+
763+/* Create a buffer, such as a colour or depth buffer */
764+struct glamo_renderbuffer *glamo_create_renderbuffer(GLenum format,
765+ __DRIdrawable *driDrawPriv)
766+{
767+ struct glamo_renderbuffer *grb;
768+
769+ grb = CALLOC_STRUCT(glamo_renderbuffer);
770+ if ( !grb ) return NULL;
771+
772+ _mesa_init_renderbuffer(&grb->base, 0);
773+ grb->base.ClassID = GLAMO_RB_CLASS;
774+
775+ switch (format) {
776+ case GL_RGB5:
777+ grb->base.Format = MESA_FORMAT_RGB565;
778+ grb->base._BaseFormat = GL_RGB;
779+
780+ grb->base.DataType = GL_UNSIGNED_BYTE;
781+ break;
782+ case GL_DEPTH_COMPONENT16:
783+ grb->base.DataType = GL_UNSIGNED_SHORT;
784+ grb->base._BaseFormat = GL_DEPTH_COMPONENT;
785+ break;
786+ default:
787+ fprintf(stderr, "%s: Unknown format 0x%04x\n", __FUNCTION__, format);
788+ _mesa_delete_renderbuffer(&grb->base);
789+ return NULL;
790+ }
791+
792+ grb->dPriv = driDrawPriv;
793+ grb->base.InternalFormat = format;
794+
795+ grb->base.Delete = glamo_delete_renderbuffer;
796+ grb->base.AllocStorage = glamo_alloc_window_storage;
797+ grb->base.GetPointer = glamo_get_pointer;
798+
799+ return grb;
800+}
801+
802+
803+void glamo_renderbuffer_set_bo(struct glamo_renderbuffer *grb,
804+ struct glamo_bo *bo)
805+{
806+ struct glamo_bo *old;
807+ old = grb->bo;
808+ grb->bo = bo;
809+ glamo_bo_ref(bo);
810+ if ( old ) glamo_bo_unref(old);
811+}
812+
813+
814+/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
815diff --git a/src/mesa/drivers/dri/glamo/glamo_fbo.h b/src/mesa/drivers/dri/glamo/glamo_fbo.h
816new file mode 100644
817index 0000000..48210dd
818--- /dev/null
819+++ b/src/mesa/drivers/dri/glamo/glamo_fbo.h
820@@ -0,0 +1,77 @@
821+/*
822+ * Direct Rendering Support for SMedia Glamo 336x/337x
823+ *
824+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
825+ *
826+ * Permission is hereby granted, free of charge, to any person obtaining a
827+ * copy of this software and associated documentation files (the "Software"),
828+ * to deal in the Software without restriction, including without limitation
829+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
830+ * and/or sell copies of the Software, and to permit persons to whom the
831+ * Software is furnished to do so, subject to the following conditions:
832+ *
833+ * The above copyright notice and this permission notice shall be included
834+ * in all copies or substantial portions of the Software.
835+ *
836+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
837+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
838+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
839+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
840+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
841+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
842+ */
843+
844+#ifndef __GLAMO_FBO_H
845+#define __GLAMO_FBO_H
846+
847+
848+#include "main/mtypes.h"
849+#include "dri_util.h"
850+
851+
852+/* This is just a marker so we can tell a Glamo renderbuffer from a Mesa one */
853+#define GLAMO_RB_CLASS (0xdeadbeef)
854+
855+
856+struct glamo_renderbuffer
857+{
858+ struct gl_renderbuffer base; /* Must be first */
859+ struct glamo_bo *bo;
860+ unsigned int cpp;
861+ unsigned int pitch;
862+ unsigned int width;
863+ unsigned int height;
864+
865+ __DRIdrawable *dPriv;
866+};
867+
868+
869+struct glamo_framebuffer
870+{
871+ struct gl_framebuffer base;
872+ struct glamo_renderbuffer *color_rb[2];
873+};
874+
875+
876+/* This is just a small wrapper function to return NULL if the gl_renderbuffer
877+ * is not a glamo_renderbuffer */
878+static inline struct glamo_renderbuffer
879+ *glamo_renderbuffer(struct gl_renderbuffer *rb)
880+{
881+ struct glamo_renderbuffer *grb = (struct glamo_renderbuffer *)rb;
882+ if ( grb && grb->base.ClassID == GLAMO_RB_CLASS )
883+ return grb;
884+ else
885+ return NULL;
886+}
887+
888+
889+extern struct glamo_renderbuffer *glamo_create_renderbuffer(GLenum format,
890+ __DRIdrawable *driDrawPriv);
891+
892+extern void glamo_renderbuffer_set_bo(struct glamo_renderbuffer *grb,
893+ struct glamo_bo *bo);
894+
895+#endif /* __GLAMO_FBO_H */
896+
897+/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
898diff --git a/src/mesa/drivers/dri/glamo/glamo_regs.h b/src/mesa/drivers/dri/glamo/glamo_regs.h
899new file mode 100644
900index 0000000..02b2294
901--- /dev/null
902+++ b/src/mesa/drivers/dri/glamo/glamo_regs.h
903@@ -0,0 +1,174 @@
904+#ifndef _GLAMO_REGS_H
905+#define _GLAMO_REGS_H
906+
907+/* Smedia Glamo 336x/337x driver
908+ *
909+ * (C) 2007 by OpenMoko, Inc.
910+ * Author: Harald Welte <laforge@openmoko.org>
911+ * All rights reserved.
912+ *
913+ * Modified for Glamo Mesa driver by Thomas White <taw@bitwiz.org.uk>
914+ *
915+ * This program is free software; you can redistribute it and/or
916+ * modify it under the terms of the GNU General Public License as
917+ * published by the Free Software Foundation; either version 2 of
918+ * the License, or (at your option) any later version.
919+ *
920+ * This program is distributed in the hope that it will be useful,
921+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
922+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
923+ * GNU General Public License for more details.
924+ *
925+ * You should have received a copy of the GNU General Public License
926+ * along with this program; if not, write to the Free Software
927+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
928+ * MA 02111-1307 USA
929+ */
930+
931+enum glamo_regster_offsets {
932+ GLAMO_REGOFS_GENERIC = 0x0000,
933+ GLAMO_REGOFS_HOSTBUS = 0x0200,
934+ GLAMO_REGOFS_MEMORY = 0x0300,
935+ GLAMO_REGOFS_VIDCAP = 0x0400,
936+ GLAMO_REGOFS_ISP = 0x0500,
937+ GLAMO_REGOFS_JPEG = 0x0800,
938+ GLAMO_REGOFS_MPEG = 0x0c00,
939+ GLAMO_REGOFS_LCD = 0x1100,
940+ GLAMO_REGOFS_MMC = 0x1400,
941+ GLAMO_REGOFS_MPROC0 = 0x1500,
942+ GLAMO_REGOFS_MPROC1 = 0x1580,
943+ GLAMO_REGOFS_CMDQUEUE = 0x1600,
944+ GLAMO_REGOFS_RISC = 0x1680,
945+ GLAMO_REGOFS_2D = 0x1700,
946+ GLAMO_REGOFS_3D = 0x1b00,
947+};
948+
949+
950+#define REG_MPEG(x) (GLAMO_REGOFS_MPEG+(x))
951+
952+enum glamo_register_mpeg {
953+ //
954+ GLAMO_REG_MPEG_DC_ADDRL = REG_MPEG(0x3c),
955+ GLAMO_REG_MPEG_DC_ADDRH = REG_MPEG(0x3e),
956+ GLAMO_REG_MPEG_AC_ADDRL = REG_MPEG(0x40),
957+ GLAMO_REG_MPEG_AC_ADDRH = REG_MPEG(0x42),
958+ //
959+ GLAMO_REG_MPEG_SAFE_1 = REG_MPEG(0x60),
960+ GLAMO_REG_MPEG_SAFE_2 = REG_MPEG(0x62),
961+ GLAMO_REG_MPEG_SAFE_3 = REG_MPEG(0x64),
962+ //
963+ GLAMO_REG_MPEG_DEC_OUT0_Y_ADDRL = REG_MPEG(0x6e),
964+ GLAMO_REG_MPEG_DEC_OUT0_Y_ADDRH = REG_MPEG(0x70),
965+ GLAMO_REG_MPEG_DEC_OUT0_U_ADDRL = REG_MPEG(0x72),
966+ GLAMO_REG_MPEG_DEC_OUT0_U_ADDRH = REG_MPEG(0x74),
967+ GLAMO_REG_MPEG_DEC_OUT0_V_ADDRL = REG_MPEG(0x76),
968+ GLAMO_REG_MPEG_DEC_OUT0_V_ADDRH = REG_MPEG(0x78),
969+ GLAMO_REG_MPEG_DEC_OUT1_Y_ADDRL = REG_MPEG(0x7a),
970+ GLAMO_REG_MPEG_DEC_OUT1_Y_ADDRH = REG_MPEG(0x7c),
971+ GLAMO_REG_MPEG_DEC_OUT1_U_ADDRL = REG_MPEG(0x7e),
972+ GLAMO_REG_MPEG_DEC_OUT1_U_ADDRH = REG_MPEG(0x80),
973+ GLAMO_REG_MPEG_DEC_OUT1_V_ADDRL = REG_MPEG(0x82),
974+ GLAMO_REG_MPEG_DEC_OUT1_V_ADDRH = REG_MPEG(0x84),
975+ GLAMO_REG_MPEG_DEC_OUT2_Y_ADDRL = REG_MPEG(0x86),
976+ GLAMO_REG_MPEG_DEC_OUT2_Y_ADDRH = REG_MPEG(0x88),
977+ GLAMO_REG_MPEG_DEC_OUT2_U_ADDRL = REG_MPEG(0x8a),
978+ GLAMO_REG_MPEG_DEC_OUT2_U_ADDRH = REG_MPEG(0x8c),
979+ GLAMO_REG_MPEG_DEC_OUT2_V_ADDRL = REG_MPEG(0x8e),
980+ GLAMO_REG_MPEG_DEC_OUT2_V_ADDRH = REG_MPEG(0x90),
981+ GLAMO_REG_MPEG_DEC_WIDTH = REG_MPEG(0x92),
982+ GLAMO_REG_MPEG_DEC_HEIGHT = REG_MPEG(0x94),
983+ GLAMO_REG_MPEG_SPECIAL = REG_MPEG(0x96),
984+ GLAMO_REG_MPEG_DEC_IN_ADDRL = REG_MPEG(0x98),
985+ GLAMO_REG_MPEG_DEC_IN_ADDRH = REG_MPEG(0x9a),
986+ //
987+ GLAMO_REG_MPEG_DEBLK_THRESHOLD = REG_MPEG(0xc0),
988+ //
989+ GLAMO_REG_MPEG_DEC_STATUS = REG_MPEG(0xc8),
990+ GLAMO_REG_MPEG_DEC_RB0 = REG_MPEG(0xca),
991+ GLAMO_REG_MPEG_DEC_RB1 = REG_MPEG(0xcc),
992+};
993+
994+
995+#define REG_2D(x) (GLAMO_REGOFS_2D+(x))
996+
997+enum glamo_register_2d {
998+ GLAMO_REG_2D_SRC_ADDRL = REG_2D(0x00),
999+ GLAMO_REG_2D_SRC_ADDRH = REG_2D(0x02),
1000+ GLAMO_REG_2D_SRC_PITCH = REG_2D(0x04),
1001+ GLAMO_REG_2D_SRC_X = REG_2D(0x06),
1002+ GLAMO_REG_2D_SRC_Y = REG_2D(0x08),
1003+ GLAMO_REG_2D_DST_X = REG_2D(0x0a),
1004+ GLAMO_REG_2D_DST_Y = REG_2D(0x0c),
1005+ GLAMO_REG_2D_DST_ADDRL = REG_2D(0x0e),
1006+ GLAMO_REG_2D_DST_ADDRH = REG_2D(0x10),
1007+ GLAMO_REG_2D_DST_PITCH = REG_2D(0x12),
1008+ GLAMO_REG_2D_DST_HEIGHT = REG_2D(0x14),
1009+ GLAMO_REG_2D_RECT_WIDTH = REG_2D(0x16),
1010+ GLAMO_REG_2D_RECT_HEIGHT = REG_2D(0x18),
1011+ GLAMO_REG_2D_PAT_ADDRL = REG_2D(0x1a),
1012+ GLAMO_REG_2D_PAT_ADDRH = REG_2D(0x1c),
1013+ GLAMO_REG_2D_PAT_FG = REG_2D(0x1e),
1014+ GLAMO_REG_2D_PAT_BG = REG_2D(0x20),
1015+ GLAMO_REG_2D_SRC_FG = REG_2D(0x22),
1016+ GLAMO_REG_2D_SRC_BG = REG_2D(0x24),
1017+ GLAMO_REG_2D_MASK1 = REG_2D(0x26),
1018+ GLAMO_REG_2D_MASK2 = REG_2D(0x28),
1019+ GLAMO_REG_2D_MASK3 = REG_2D(0x2a),
1020+ GLAMO_REG_2D_MASK4 = REG_2D(0x2c),
1021+ GLAMO_REG_2D_ROT_X = REG_2D(0x2e),
1022+ GLAMO_REG_2D_ROT_Y = REG_2D(0x30),
1023+ GLAMO_REG_2D_LEFT_CLIP = REG_2D(0x32),
1024+ GLAMO_REG_2D_TOP_CLIP = REG_2D(0x34),
1025+ GLAMO_REG_2D_RIGHT_CLIP = REG_2D(0x36),
1026+ GLAMO_REG_2D_BOTTOM_CLIP = REG_2D(0x38),
1027+ GLAMO_REG_2D_COMMAND1 = REG_2D(0x3A),
1028+ GLAMO_REG_2D_COMMAND2 = REG_2D(0x3C),
1029+ GLAMO_REG_2D_COMMAND3 = REG_2D(0x3E),
1030+ GLAMO_REG_2D_SAFE = REG_2D(0x40),
1031+ GLAMO_REG_2D_STATUS = REG_2D(0x42),
1032+ GLAMO_REG_2D_ID1 = REG_2D(0x44),
1033+ GLAMO_REG_2D_ID2 = REG_2D(0x46),
1034+ GLAMO_REG_2D_ID3 = REG_2D(0x48),
1035+};
1036+
1037+
1038+/* No offset this time */
1039+#define REG_3D(x) (x)
1040+
1041+enum glamo_register_3d
1042+{
1043+ /* Fire the engine */
1044+ G3D_FIRE = REG_3D(0x2058),
1045+
1046+ /* Streams of vertex/colour/normal/texcoord data */
1047+ G3D_ACTIVE_STREAMS = REG_3D(0x1f00),
1048+ G3D_LAST_STREAM__VCOLFMT = REG_3D(0x2030),
1049+ G3D_STREAM_MODE_0 = REG_3D(0x1f10),
1050+ G3D_STREAM_BASE_0 = REG_3D(0x1f14),
1051+ G3D_STREAM_MODE_1 = REG_3D(0x1f18),
1052+ G3D_STREAM_BASE_1 = REG_3D(0x1f1c),
1053+ G3D_STREAM_MODE_2 = REG_3D(0x1f20),
1054+ G3D_STREAM_BASE_2 = REG_3D(0x1f24),
1055+ G3D_STREAM_MODE_3 = REG_3D(0x1f28),
1056+ G3D_STREAM_BASE_3 = REG_3D(0x1f2c),
1057+ G3D_STREAM_MODE_4 = REG_3D(0x1f30),
1058+ G3D_STREAM_BASE_4 = REG_3D(0x1f34),
1059+ G3D_STREAM_MODE_5 = REG_3D(0x1f38),
1060+ G3D_STREAM_BASE_5 = REG_3D(0x1f3c),
1061+ G3D_STREAM_MODE_6 = REG_3D(0x1f40),
1062+ G3D_STREAM_BASE_6 = REG_3D(0x1f44),
1063+ G3D_STREAM_MODE_7 = REG_3D(0x1f48),
1064+ G3D_STREAM_BASE_7 = REG_3D(0x1f4c),
1065+
1066+ /* Modelview*projection matrix */
1067+ G3D_MATRIX_MVP = REG_3D(0x26a0), /* .. 0x27df */
1068+
1069+ /* Modelview matrix */
1070+ G3D_MATRIX_MV = REG_3D(0x26e0), /* .. 0x270f */
1071+
1072+ /* Inverse MVP, 3x3 only */
1073+ G3D_MATRIX_IMVP = REG_3D(0x2710), /* .. 0x2733 */
1074+
1075+};
1076+
1077+#endif /* _GLAMO_REGS_H */
1078diff --git a/src/mesa/drivers/dri/glamo/glamo_render.c b/src/mesa/drivers/dri/glamo/glamo_render.c
1079new file mode 100644
1080index 0000000..d8b21d5
1081--- /dev/null
1082+++ b/src/mesa/drivers/dri/glamo/glamo_render.c
1083@@ -0,0 +1,230 @@
1084+/*
1085+ * Direct Rendering Support for SMedia Glamo 336x/337x
1086+ *
1087+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
1088+ *
1089+ * Permission is hereby granted, free of charge, to any person obtaining a
1090+ * copy of this software and associated documentation files (the "Software"),
1091+ * to deal in the Software without restriction, including without limitation
1092+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1093+ * and/or sell copies of the Software, and to permit persons to whom the
1094+ * Software is furnished to do so, subject to the following conditions:
1095+ *
1096+ * The above copyright notice and this permission notice shall be included
1097+ * in all copies or substantial portions of the Software.
1098+ *
1099+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1100+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1101+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1102+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1103+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1104+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1105+ *
1106+ *
1107+ * Based on intel_render.c, to which the following notice applies:
1108+ *
1109+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
1110+ * All Rights Reserved.
1111+ *
1112+ * Permission is hereby granted, free of charge, to any person obtaining a
1113+ * copy of this software and associated documentation files (the
1114+ * "Software"), to deal in the Software without restriction, including
1115+ * without limitation the rights to use, copy, modify, merge, publish,
1116+ * distribute, sub license, and/or sell copies of the Software, and to
1117+ * permit persons to whom the Software is furnished to do so, subject to
1118+ * the following conditions:
1119+ *
1120+ * The above copyright notice and this permission notice (including the
1121+ * next paragraph) shall be included in all copies or substantial portions
1122+ * of the Software.
1123+ *
1124+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1125+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1126+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
1127+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
1128+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1129+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1130+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1131+ *
1132+ */
1133+
1134+
1135+/*
1136+ * Render unclipped vertex buffers by emitting vertices directly to
1137+ * dma buffers. Use strip/fan hardware acceleration where possible.
1138+ *
1139+ */
1140+#include "main/glheader.h"
1141+#include "main/context.h"
1142+#include "main/macros.h"
1143+#include "main/imports.h"
1144+#include "main/mtypes.h"
1145+#include "main/enums.h"
1146+
1147+#include "tnl/t_context.h"
1148+#include "tnl/t_vertex.h"
1149+#include "tnl/t_pipeline.h"
1150+#include "math/m_xform.h"
1151+
1152+#include "glamo_context.h"
1153+#include "glamo_tris.h"
1154+#include "glamo_regs.h"
1155+
1156+/*
1157+ * Render unclipped vertex buffers by emitting vertices directly to
1158+ * VRAM buffers. Use strip/fan hardware primitives where possible.
1159+ * Try to simulate missing primitives with indexed vertices.
1160+ */
1161+#define HAVE_POINTS 1
1162+#define HAVE_LINES 1
1163+#define HAVE_LINE_STRIPS 0
1164+#define HAVE_TRIANGLES 1
1165+#define HAVE_TRI_STRIPS 0
1166+#define HAVE_TRI_STRIP_1 0
1167+#define HAVE_TRI_FANS 0
1168+#define HAVE_POLYGONS 0
1169+#define HAVE_QUADS 0
1170+#define HAVE_QUAD_STRIPS 0
1171+#define HAVE_ELTS 0
1172+
1173+
1174+static void glamoFlushPrim(struct glamo_context *gCtx)
1175+{
1176+ printf("glamoFlushPrim: %i vertices, %i %i\n", gCtx->prim.count,
1177+ gCtx->prim.start_offset, gCtx->prim.current_offset);
1178+
1179+ if ( gCtx->prim.vb_bo == NULL ) return;
1180+
1181+ /* Upload to hardware */
1182+ glamo_bo_subdata(gCtx->prim.vb_bo, 0, gCtx->prim.current_offset,
1183+ gCtx->prim.vb);
1184+
1185+ /* Dispatch to the hardware */
1186+ glamoDRMStartBurst(gCtx, G3D_STREAM_MODE_0);
1187+ glamoDRMAddData(gCtx, 0x000f0300, 4);
1188+ glamoDRMAddBO(gCtx, gCtx->prim.vb_bo);
1189+ glamoDRMDispatch(gCtx);
1190+
1191+ /* Please use a new BO for the next buffer */
1192+ gCtx->prim.vb_bo = NULL;
1193+
1194+ /* Continue from new start */
1195+ gCtx->prim.start_offset = gCtx->prim.current_offset;
1196+}
1197+
1198+
1199+static inline GLuint glamoGetVBMax(struct glamo_context *gCtx)
1200+{
1201+ return GLAMO_VB_SIZE / gCtx->vertex_size;
1202+}
1203+
1204+
1205+static inline GLuint glamoGetCurrentMax(struct glamo_context *gCtx)
1206+{
1207+ /* How many more vertices can be accommodated?
1208+ * Each vertex takes up 4x 32-bit fixed point values */
1209+ return (GLAMO_VB_SIZE - gCtx->prim.current_offset) / gCtx->vertex_size;
1210+}
1211+
1212+
1213+#define LOCAL_VARS \
1214+ struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
1215+
1216+#define INIT(prim)
1217+
1218+#define FLUSH() glamoFlushPrim(gCtx)
1219+
1220+#define GET_SUBSEQUENT_VB_MAX_VERTS() glamoGetVBMax(gCtx)
1221+#define GET_CURRENT_VB_MAX_VERTS() glamoGetCurrentMax(gCtx)
1222+
1223+#define ALLOC_VERTS(nr) glamoGetPrimSpace(gCtx, nr)
1224+
1225+#define EMIT_VERTS(ctx, j, nr, buf) \
1226+ _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf)
1227+
1228+#define TAG(x) glamo_##x
1229+#include "tnl_dd/t_dd_dmatmp.h"
1230+
1231+
1232+/**********************************************************************/
1233+/* Render pipeline stage */
1234+/**********************************************************************/
1235+
1236+static void glamoFireEngine(struct glamo_context *gCtx)
1237+{
1238+ glamoDRMStartBurst(gCtx, G3D_FIRE);
1239+ glamoDRMAddData(gCtx, 0, 2); /* Fire! */
1240+ glamoDRMDispatch(gCtx);
1241+}
1242+
1243+
1244+static GLboolean glamoRunRender(struct gl_context *ctx,
1245+ struct tnl_pipeline_stage *stage)
1246+{
1247+ TNLcontext *tnl = TNL_CONTEXT(ctx);
1248+ struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
1249+ struct vertex_buffer *VB = &tnl->vb;
1250+ GLuint i;
1251+
1252+ printf("glamoRunRender\n");
1253+
1254+ /* Don't handle clipping */
1255+ if ( !glamo_validate_render(ctx, VB) ) {
1256+ return GL_TRUE; /* Failed */
1257+ }
1258+
1259+ /* Validate GPU state */
1260+ if ( gCtx->new_state ) {
1261+ if ( !glamoValidateState(ctx, gCtx->new_state) ) {
1262+ printf("Couldn't validate state...\n");
1263+ }
1264+ } /* else nothing to update */
1265+
1266+ tnl->clipspace.new_inputs |= VERT_BIT_POS;
1267+
1268+ tnl->Driver.Render.Start(ctx);
1269+
1270+ for ( i=0; i<VB->PrimitiveCount; i++ ) {
1271+
1272+ GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
1273+ GLuint start = VB->Primitive[i].start;
1274+ GLuint length = VB->Primitive[i].count;
1275+
1276+ if (!length) continue;
1277+
1278+ glamo_render_tab_verts[prim & PRIM_MODE_MASK](ctx, start,
1279+ start + length, prim);
1280+
1281+ }
1282+
1283+ tnl->Driver.Render.Finish(ctx);
1284+
1285+ glamoFireEngine(gCtx);
1286+
1287+ return GL_FALSE; /* Ok */
1288+}
1289+
1290+
1291+static const struct tnl_pipeline_stage _glamo_render_stage = {
1292+ "glamo render",
1293+ NULL,
1294+ NULL,
1295+ NULL,
1296+ NULL,
1297+ glamoRunRender
1298+};
1299+
1300+
1301+const struct tnl_pipeline_stage *glamo_pipeline[] = {
1302+ &_tnl_vertex_transform_stage,
1303+ &_tnl_normal_transform_stage,
1304+ &_tnl_lighting_stage,
1305+ &_tnl_fog_coordinate_stage,
1306+ &_tnl_texgen_stage,
1307+ &_tnl_texture_transform_stage,
1308+ &_tnl_point_attenuation_stage,
1309+ &_tnl_vertex_program_stage,
1310+ &_glamo_render_stage, /* ADD: unclipped rastersetup-to-dma */
1311+ &_tnl_render_stage,
1312+ 0,
1313+};
1314diff --git a/src/mesa/drivers/dri/glamo/glamo_render.h b/src/mesa/drivers/dri/glamo/glamo_render.h
1315new file mode 100644
1316index 0000000..99c36a8
1317--- /dev/null
1318+++ b/src/mesa/drivers/dri/glamo/glamo_render.h
1319@@ -0,0 +1,31 @@
1320+/*
1321+ * Direct Rendering Support for SMedia Glamo 336x/337x
1322+ *
1323+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
1324+ *
1325+ * Permission is hereby granted, free of charge, to any person obtaining a
1326+ * copy of this software and associated documentation files (the "Software"),
1327+ * to deal in the Software without restriction, including without limitation
1328+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1329+ * and/or sell copies of the Software, and to permit persons to whom the
1330+ * Software is furnished to do so, subject to the following conditions:
1331+ *
1332+ * The above copyright notice and this permission notice shall be included
1333+ * in all copies or substantial portions of the Software.
1334+ *
1335+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1336+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1337+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1338+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1339+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1340+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1341+ */
1342+
1343+#ifndef __GLAMO_RENDER_H
1344+#define __GLAMO_RENDER_H
1345+
1346+#include "main/mtypes.h"
1347+
1348+extern const struct tnl_pipeline_stage *glamo_pipeline[];
1349+
1350+#endif /* __GLAMO_RENDER_H */
1351diff --git a/src/mesa/drivers/dri/glamo/glamo_screen.c b/src/mesa/drivers/dri/glamo/glamo_screen.c
1352new file mode 100644
1353index 0000000..cc8a730
1354--- /dev/null
1355+++ b/src/mesa/drivers/dri/glamo/glamo_screen.c
1356@@ -0,0 +1,250 @@
1357+/*
1358+ * Direct Rendering Support for SMedia Glamo 336x/337x
1359+ *
1360+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
1361+ * Roughly based on sis_screen.c (c) 2003 Eric Anholt
1362+ *
1363+ * Permission is hereby granted, free of charge, to any person obtaining a
1364+ * copy of this software and associated documentation files (the "Software"),
1365+ * to deal in the Software without restriction, including without limitation
1366+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1367+ * and/or sell copies of the Software, and to permit persons to whom the
1368+ * Software is furnished to do so, subject to the following conditions:
1369+ *
1370+ * The above copyright notice and this permission notice shall be included
1371+ * in all copies or substantial portions of the Software.
1372+ *
1373+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1374+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1375+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1376+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1377+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1378+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1379+ */
1380+
1381+
1382+#include "dri_util.h"
1383+#include "utils.h"
1384+#include "xmlconfig.h"
1385+#include "GL/internal/dri_interface.h"
1386+#include "main/framebuffer.h"
1387+#include "main/renderbuffer.h"
1388+
1389+#include "glamo_screen.h"
1390+#include "glamo_context.h"
1391+#include "glamo_fbo.h"
1392+
1393+/* This comes from libdrm_glamo */
1394+#include <glamo_bo_gem.h>
1395+
1396+
1397+static int glamoInitDriver(__DRIscreen *psp)
1398+{
1399+ return 0;
1400+}
1401+
1402+
1403+static glamoScreenPtr glamoCreateScreen(__DRIscreen *sPriv)
1404+{
1405+ glamoScreenPtr glamoScreen;
1406+
1407+ /* Allocate the private area */
1408+ glamoScreen = (glamoScreenPtr)CALLOC(sizeof(*glamoScreen));
1409+ if ( glamoScreen == NULL )
1410+ return NULL;
1411+
1412+ glamoScreen->driScreen = sPriv;
1413+
1414+ /* This is our link to the kernel's memory manager, via libdrm */
1415+ glamoScreen->bom = glamo_bo_manager_gem_ctor(sPriv->fd);
1416+
1417+ return glamoScreen;
1418+}
1419+
1420+
1421+static void glamoDestroyScreen(__DRIscreen *sPriv)
1422+{
1423+ glamoScreenPtr glamoScreen = (glamoScreenPtr)sPriv->private;
1424+
1425+ if ( glamoScreen == NULL )
1426+ return;
1427+
1428+ FREE(glamoScreen);
1429+ sPriv->private = NULL;
1430+}
1431+
1432+
1433+static const __DRIconfig **glamoInitScreen(__DRIscreen *sPriv)
1434+{
1435+ __DRIconfig **configs;
1436+ uint8_t depth_bits_array[2];
1437+ uint8_t stencil_bits_array[2];
1438+ uint8_t msaa_samples_array[1];
1439+ static const GLenum db_modes[] = { GLX_SWAP_COPY_OML, GLX_NONE };
1440+
1441+ /* Driver initialisation */
1442+ if ( glamoInitDriver(sPriv) ) {
1443+ return NULL;
1444+ }
1445+
1446+ /* Screen-specific initialisation */
1447+ sPriv->private = glamoCreateScreen(sPriv);
1448+ if ( !sPriv->private ) {
1449+ glamoDestroyScreen(sPriv);
1450+ return NULL;
1451+ }
1452+
1453+ depth_bits_array[0] = 0;
1454+ stencil_bits_array[0] = 0;
1455+ depth_bits_array[1] = 16;
1456+ stencil_bits_array[1] = 0;
1457+ msaa_samples_array[0] = 0;
1458+
1459+ configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
1460+ depth_bits_array, stencil_bits_array, 2,
1461+ db_modes, 2, msaa_samples_array, 1, GL_TRUE);
1462+
1463+ if ( configs == NULL ) {
1464+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
1465+ return NULL;
1466+ }
1467+
1468+ return (const __DRIconfig **)configs;
1469+}
1470+
1471+
1472+static const __DRIconfig **glamoInitScreen2(__DRIscreen *sPriv)
1473+{
1474+ __DRIconfig **configs;
1475+ uint8_t depth_bits_array[2];
1476+ uint8_t stencil_bits_array[2];
1477+ uint8_t msaa_samples_array[1];
1478+ static const GLenum db_modes[] = { GLX_SWAP_COPY_OML, GLX_NONE };
1479+
1480+ /* Driver initialisation */
1481+ if ( glamoInitDriver(sPriv) ) {
1482+ return NULL;
1483+ }
1484+
1485+ /* Screen-specific initialisation */
1486+ sPriv->private = glamoCreateScreen(sPriv);
1487+ if ( !sPriv->private ) {
1488+ glamoDestroyScreen(sPriv);
1489+ return NULL;
1490+ }
1491+
1492+ depth_bits_array[0] = 0;
1493+ stencil_bits_array[0] = 0;
1494+ depth_bits_array[1] = 16;
1495+ stencil_bits_array[1] = 0;
1496+ msaa_samples_array[0] = 0;
1497+
1498+ configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
1499+ depth_bits_array, stencil_bits_array, 2,
1500+ db_modes, 2, msaa_samples_array, 1, GL_TRUE);
1501+
1502+ if ( configs == NULL ) {
1503+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
1504+ return NULL;
1505+ }
1506+
1507+ return (const __DRIconfig **)configs;
1508+}
1509+
1510+
1511+/* Allocate buffers for a context. This is where the fun starts... */
1512+static GLboolean glamoCreateBuffer(__DRIscreen *driScrnPriv,
1513+ __DRIdrawable *driDrawPriv,
1514+ const struct gl_config *mesaVis,
1515+ GLboolean isPixmap)
1516+{
1517+ struct glamo_framebuffer *gfb;
1518+ GLenum rgbFormat;
1519+
1520+ if ( isPixmap ) return GL_FALSE; /* not implemented */
1521+
1522+ gfb = CALLOC_STRUCT(glamo_framebuffer);
1523+ if ( !gfb ) return GL_FALSE;
1524+
1525+ _mesa_initialize_window_framebuffer(&gfb->base, mesaVis);
1526+
1527+ /* we only support this one format at the moment */
1528+ rgbFormat = GL_RGB5;
1529+
1530+ /* Front color renderbuffer */
1531+ gfb->color_rb[0] = glamo_create_renderbuffer(rgbFormat, driDrawPriv);
1532+ _mesa_add_renderbuffer(&gfb->base, BUFFER_FRONT_LEFT,
1533+ &gfb->color_rb[0]->base);
1534+
1535+ /* Back color renderbuffer, if requested */
1536+ if ( mesaVis->doubleBufferMode ) {
1537+ gfb->color_rb[1] = glamo_create_renderbuffer(rgbFormat, driDrawPriv);
1538+ _mesa_add_renderbuffer(&gfb->base, BUFFER_BACK_LEFT,
1539+ &gfb->color_rb[1]->base);
1540+ }
1541+
1542+ if ( mesaVis->depthBits == 16 ) {
1543+ struct glamo_renderbuffer *depth;
1544+ depth = glamo_create_renderbuffer(GL_DEPTH_COMPONENT16, driDrawPriv);
1545+ _mesa_add_renderbuffer(&gfb->base, BUFFER_DEPTH, &depth->base);
1546+ }
1547+
1548+ /* Add software renderbuffers for the things we can't support in hardware */
1549+ _mesa_add_soft_renderbuffers(&gfb->base,
1550+ GL_FALSE, /* color */
1551+ GL_FALSE, /* depth */
1552+ mesaVis->stencilBits > 0, /* stencil, if required */
1553+ mesaVis->accumRedBits > 0, /* accum, if required */
1554+ GL_FALSE, /* alpha */
1555+ GL_FALSE /* aux */
1556+ );
1557+ driDrawPriv->driverPrivate = (void *)gfb;
1558+
1559+ return (driDrawPriv->driverPrivate != NULL);
1560+}
1561+
1562+
1563+static void glamoDestroyBuffer(__DRIdrawable *driDrawPriv)
1564+{
1565+}
1566+
1567+
1568+static void glamoSwapBuffers(__DRIdrawable *driDrawPriv)
1569+{
1570+ printf("glamoSwapBuffers\n"); fflush(stdout);
1571+}
1572+
1573+
1574+/*
1575+ * Mesa entry points
1576+ *
1577+ * See src/mesa/drivers/dri/common/dri_util.h for information about these
1578+ */
1579+const struct __DriverAPIRec driDriverAPI = {
1580+ .InitScreen = glamoInitScreen,
1581+ .DestroyScreen = glamoDestroyScreen,
1582+ .CreateContext = glamoCreateContext,
1583+ .DestroyContext = glamoDestroyContext,
1584+ .CreateBuffer = glamoCreateBuffer,
1585+ .DestroyBuffer = glamoDestroyBuffer,
1586+ .SwapBuffers = glamoSwapBuffers,
1587+ .MakeCurrent = glamoMakeCurrent,
1588+ .UnbindContext = glamoUnbindContext,
1589+ .GetSwapInfo = NULL, /* Not used */
1590+ .WaitForMSC = NULL,
1591+ .WaitForSBC = NULL,
1592+ .SwapBuffersMSC = NULL,
1593+ .CopySubBuffer = NULL,
1594+ .GetDrawableMSC = NULL, /* Not used */
1595+ .InitScreen2 = glamoInitScreen2, /* For DRI2 */
1596+};
1597+
1598+/* This is the table of extensions that the loader will dlsym() for. */
1599+PUBLIC const __DRIextension *__driDriverExtensions[] = {
1600+ &driCoreExtension.base,
1601+ &driLegacyExtension.base,
1602+ &driDRI2Extension.base,
1603+ NULL
1604+};
1605+
1606+/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
1607diff --git a/src/mesa/drivers/dri/glamo/glamo_screen.h b/src/mesa/drivers/dri/glamo/glamo_screen.h
1608new file mode 100644
1609index 0000000..3f2eb5f
1610--- /dev/null
1611+++ b/src/mesa/drivers/dri/glamo/glamo_screen.h
1612@@ -0,0 +1,44 @@
1613+/*
1614+ * Direct Rendering Support for SMedia Glamo 336x/337x
1615+ *
1616+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
1617+ * Roughly based on sis_screen.h (c) 2003 Eric Anholt
1618+ *
1619+ * Permission is hereby granted, free of charge, to any person obtaining a
1620+ * copy of this software and associated documentation files (the "Software"),
1621+ * to deal in the Software without restriction, including without limitation
1622+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1623+ * and/or sell copies of the Software, and to permit persons to whom the
1624+ * Software is furnished to do so, subject to the following conditions:
1625+ *
1626+ * The above copyright notice and this permission notice shall be included
1627+ * in all copies or substantial portions of the Software.
1628+ *
1629+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1630+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1631+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1632+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1633+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1634+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1635+ */
1636+
1637+#ifndef __GLAMO_SCREEN_H
1638+#define __GLAMO_SCREEN_H
1639+
1640+#include "xmlconfig.h"
1641+#include "dri_util.h"
1642+
1643+#include <glamo_bo_gem.h>
1644+
1645+typedef struct {
1646+
1647+ __DRIscreen *driScreen;
1648+ driOptionCache optionCache;
1649+
1650+ struct glamo_bo_manager *bom;
1651+
1652+} glamoScreenRec, *glamoScreenPtr;
1653+
1654+#endif /* __GLAMO_SCREEN_H */
1655+
1656+/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
1657diff --git a/src/mesa/drivers/dri/glamo/glamo_state.c b/src/mesa/drivers/dri/glamo/glamo_state.c
1658new file mode 100644
1659index 0000000..3aa2f8b
1660--- /dev/null
1661+++ b/src/mesa/drivers/dri/glamo/glamo_state.c
1662@@ -0,0 +1,305 @@
1663+/*
1664+ * Direct Rendering Support for SMedia Glamo 336x/337x
1665+ *
1666+ * (c) 2009-2010 Thomas White <taw@bitwiz.org.uk>
1667+ * Roughly based on sis_state.c (c) 2003 Eric Anholt
1668+ *
1669+ * Permission is hereby granted, free of charge, to any person obtaining a
1670+ * copy of this software and associated documentation files (the "Software"),
1671+ * to deal in the Software without restriction, including without limitation
1672+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1673+ * and/or sell copies of the Software, and to permit persons to whom the
1674+ * Software is furnished to do so, subject to the following conditions:
1675+ *
1676+ * The above copyright notice and this permission notice shall be included
1677+ * in all copies or substantial portions of the Software.
1678+ *
1679+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1680+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1681+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1682+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1683+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1684+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1685+ *
1686+ *
1687+ * Also partially based on intel_fbo.c, to which the following notice applies:
1688+ *
1689+ * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas.
1690+ * All Rights Reserved.
1691+ *
1692+ * Permission is hereby granted, free of charge, to any person obtaining a
1693+ * copy of this software and associated documentation files (the
1694+ * "Software"), to deal in the Software without restriction, including
1695+ * without limitation the rights to use, copy, modify, merge, publish,
1696+ * distribute, sub license, and/or sell copies of the Software, and to
1697+ * permit persons to whom the Software is furnished to do so, subject to
1698+ * the following conditions:
1699+ *
1700+ * The above copyright notice and this permission notice (including the
1701+ * next paragraph) shall be included in all copies or substantial portions
1702+ * of the Software.
1703+ *
1704+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1705+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1706+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
1707+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
1708+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1709+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1710+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1711+ */
1712+
1713+
1714+#include "main/context.h"
1715+#include "main/framebuffer.h"
1716+#include "main/api_arrayelt.h"
1717+#include "main/macros.h"
1718+#include "swrast/swrast.h"
1719+#include "swrast_setup/swrast_setup.h"
1720+#include "tnl/tnl.h"
1721+
1722+#include "glamo_fbo.h"
1723+#include "glamo_state.h"
1724+#include "glamo_context.h"
1725+#include "glamo_cmdq.h"
1726+#include "glamo_regs.h"
1727+
1728+
1729+static void glamoResizeBuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
1730+ GLuint width, GLuint height)
1731+{
1732+ struct glamo_framebuffer *glamo_fb = (struct glamo_framebuffer *)fb;
1733+ int i;
1734+
1735+ _mesa_resize_framebuffer(ctx, fb, width, height);
1736+
1737+ fb->Initialized = GL_TRUE; /* XXX remove someday */
1738+
1739+ if (fb->Name != 0) {
1740+ return;
1741+ }
1742+
1743+ /* Make sure all window system renderbuffers are up to date */
1744+ for (i = 0; i < 2; i++) {
1745+ struct gl_renderbuffer *rb = &glamo_fb->color_rb[i]->base;
1746+
1747+ /* only resize if size is changing */
1748+ if (rb && (rb->Width != width || rb->Height != height)) {
1749+ rb->AllocStorage(ctx, rb, rb->InternalFormat,
1750+ width, height);
1751+ }
1752+ }
1753+}
1754+
1755+
1756+static void glamoClear(struct gl_context *ctx, GLbitfield mask)
1757+{
1758+ glamoContext *gCtx;
1759+ struct gl_framebuffer *fb;
1760+ int i;
1761+
1762+ gCtx = GLAMO_CONTEXT(ctx);
1763+ fb = ctx->DrawBuffer;
1764+
1765+ printf("glamoClear (%f %f %f %f)\n", ctx->Color.ClearColor[0],
1766+ ctx->Color.ClearColor[1], ctx->Color.ClearColor[2],
1767+ ctx->Color.ClearColor[3]); fflush(stdout);
1768+
1769+ for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
1770+
1771+ struct glamo_renderbuffer *grb;
1772+
1773+ grb = glamo_renderbuffer(fb->_ColorDrawBuffers[i]);
1774+
1775+ glamoDRMStartBurst(gCtx, GLAMO_REG_2D_DST_X);
1776+ glamoDRMAddData(gCtx, fb->_Xmin, 2); /* dest X */
1777+ glamoDRMAddData(gCtx, fb->_Ymin, 2); /* dest Y */
1778+ glamoDRMAddBO(gCtx, grb->bo); /* dest L/H */
1779+ glamoDRMAddData(gCtx, grb->pitch & 0x7ff, 2); /* dest pitch */
1780+ glamoDRMAddData(gCtx, grb->height, 2); /* dest height */
1781+ glamoDRMAddData(gCtx, fb->_Xmax-fb->_Xmin, 2); /* width */
1782+ glamoDRMAddData(gCtx, fb->_Ymax-fb->_Ymin, 2); /* height */
1783+ glamoDRMAddData(gCtx, 0x0000, 2); /* patt L */
1784+ glamoDRMAddData(gCtx, 0x0000, 2); /* patt H */
1785+ glamoDRMAddData(gCtx, gCtx->col_clear, 2); /* FG colour */
1786+ glamoDRMDispatch(gCtx);
1787+
1788+ glamoDRMStartBurst(gCtx, GLAMO_REG_2D_COMMAND1);
1789+ glamoDRMAddData(gCtx, 0x0000, 2); /* Cmd param 1 */
1790+ glamoDRMAddData(gCtx, 0xf0 << 8, 2); /* Cmd param 2 */
1791+ glamoDRMAddData(gCtx, 0x0000, 2); /* Cmd param 3 */
1792+ glamoDRMDispatch(gCtx);
1793+
1794+ }
1795+}
1796+
1797+
1798+static void glamoClearColor(struct gl_context *ctx, const GLfloat color[4])
1799+{
1800+ struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
1801+ GLubyte col_byte[4];
1802+
1803+ printf("glamoClearColor (%f %f %f %f)\n", color[0], color[1], color[2],
1804+ color[3]); fflush(stdout);
1805+
1806+ CLAMPED_FLOAT_TO_UBYTE(col_byte[0], color[0]);
1807+ CLAMPED_FLOAT_TO_UBYTE(col_byte[1], color[1]);
1808+ CLAMPED_FLOAT_TO_UBYTE(col_byte[2], color[2]);
1809+ CLAMPED_FLOAT_TO_UBYTE(col_byte[3], color[3]);
1810+
1811+ gCtx->col_clear = GLAMO_PACKCOLOR565(col_byte[0], col_byte[1],
1812+ col_byte[2]);
1813+}
1814+
1815+
1816+static void glamoShadeModel(struct gl_context *ctx, GLenum mode)
1817+{
1818+ printf("glamoShadeModel\n"); fflush(stdout);
1819+}
1820+
1821+
1822+static void glamoViewport(struct gl_context *ctx, GLint x, GLint y,
1823+ GLsizei width, GLsizei height )
1824+{
1825+ struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
1826+ __DRIcontext *driContext = gCtx->driContext;
1827+ void (*old_viewport)(struct gl_context *ctx, GLint x, GLint y,
1828+ GLsizei w, GLsizei h);
1829+
1830+ if ( !driContext->driScreenPriv->dri2.enabled ) return;
1831+
1832+ /* TODO: Flush before fiddling with fake front buffer */
1833+
1834+ if ( ctx->DrawBuffer->Name == 0 ) {
1835+
1836+ glamo_update_renderbuffers(driContext,
1837+ driContext->driDrawablePriv);
1838+ if ( driContext->driDrawablePriv
1839+ != driContext->driReadablePriv ) {
1840+ glamo_update_renderbuffers(driContext,
1841+ driContext->driReadablePriv);
1842+ }
1843+
1844+ }
1845+
1846+ old_viewport = ctx->Driver.Viewport;
1847+ ctx->Driver.Viewport = NULL;
1848+ gCtx->driDrawable = driContext->driDrawablePriv;
1849+ ctx->Driver.Viewport = old_viewport;
1850+}
1851+
1852+
1853+static void glamoUploadMatrix(struct glamo_context *gCtx, uint16_t mreg,
1854+ GLfloat *matrix)
1855+{
1856+ int i;
1857+ char *type;
1858+
1859+ switch ( mreg ) {
1860+ case G3D_MATRIX_MVP :
1861+ type = "MVP"; break;
1862+ case G3D_MATRIX_MV :
1863+ type = "MV"; break;
1864+ case G3D_MATRIX_IMVP :
1865+ type = "inverse MVP"; break;
1866+ default :
1867+ type = "unknown"; break;
1868+ }
1869+ printf("Uploading %s matrix...\n", type);
1870+
1871+ glamoDRMStartBurst(gCtx, mreg);
1872+ if ( mreg != G3D_MATRIX_IMVP ) {
1873+ for ( i=0; i<16; i++ ) {
1874+ glamoDRMAddData(gCtx, float7s16(matrix[i]), 4);
1875+ }
1876+ } else {
1877+ /* Normal matrix needs special treatment */
1878+ for ( i=0; i<3; i++ ) {
1879+ glamoDRMAddData(gCtx, float7s16(matrix[4*i]), 4);
1880+ glamoDRMAddData(gCtx, float7s16(matrix[4*i+1]), 4);
1881+ glamoDRMAddData(gCtx, float7s16(matrix[4*i+2]), 4);
1882+ }
1883+ }
1884+ glamoDRMDispatch(gCtx);
1885+}
1886+
1887+
1888+GLboolean glamoValidateState(struct gl_context *ctx, GLuint new_state)
1889+{
1890+ struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
1891+
1892+ if ( new_state & (_NEW_MODELVIEW|_NEW_PROJECTION) ) {
1893+
1894+ glamoUploadMatrix(gCtx, G3D_MATRIX_MVP,
1895+ ctx->_ModelProjectMatrix.m);
1896+
1897+ /* FIXME: The following two aren't needed unless lighting
1898+ * is in use... */
1899+ glamoUploadMatrix(gCtx, G3D_MATRIX_MV,
1900+ ctx->ModelviewMatrixStack.Top->m);
1901+ _math_matrix_alloc_inv(&(ctx->_ModelProjectMatrix));
1902+ _math_matrix_analyse(&(ctx->_ModelProjectMatrix));
1903+ glamoUploadMatrix(gCtx, G3D_MATRIX_IMVP,
1904+ ctx->_ModelProjectMatrix.inv);
1905+ }
1906+
1907+ gCtx->new_state = 0;
1908+ return GL_TRUE;
1909+}
1910+
1911+
1912+static void glamoUpdateState(struct gl_context *ctx, GLbitfield new_state)
1913+{
1914+ struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
1915+
1916+ printf("glamoUpdateState\n");
1917+
1918+ _swrast_InvalidateState(ctx, new_state);
1919+ _swsetup_InvalidateState(ctx, new_state);
1920+ _vbo_InvalidateState(ctx, new_state);
1921+ _tnl_InvalidateState(ctx, new_state);
1922+ _ae_invalidate_state(ctx, new_state);
1923+
1924+ /* Make a note that some state has changed,
1925+ * so that it can be sent to the GPU later. */
1926+ gCtx->new_state |= new_state;
1927+}
1928+
1929+
1930+static void glamoFlush(struct gl_context *ctx)
1931+{
1932+ printf("glamoFlush\n");
1933+}
1934+
1935+
1936+void glamoInitStateFuncs(struct gl_context *ctx)
1937+{
1938+ ctx->Driver.UpdateState = glamoUpdateState;
1939+ ctx->Driver.Clear = glamoClear;
1940+ ctx->Driver.ClearColor = glamoClearColor;
1941+ ctx->Driver.ClearDepth = NULL;
1942+ ctx->Driver.ClearStencil = NULL;
1943+ ctx->Driver.AlphaFunc = NULL;
1944+ ctx->Driver.BlendFuncSeparate = NULL;
1945+ ctx->Driver.ColorMask = NULL;
1946+ ctx->Driver.CullFace = NULL;
1947+ ctx->Driver.DepthMask = NULL;
1948+ ctx->Driver.DepthFunc = NULL;
1949+ ctx->Driver.DepthRange = NULL;
1950+ ctx->Driver.DrawBuffer = NULL;
1951+ ctx->Driver.Enable = NULL;
1952+ ctx->Driver.FrontFace = NULL;
1953+ ctx->Driver.Fogfv = NULL;
1954+ ctx->Driver.Hint = NULL;
1955+ ctx->Driver.Lightfv = NULL;
1956+ ctx->Driver.LogicOpcode = NULL;
1957+ ctx->Driver.PolygonMode = NULL;
1958+ ctx->Driver.PolygonStipple = NULL;
1959+ ctx->Driver.ReadBuffer = NULL;
1960+ ctx->Driver.RenderMode = NULL;
1961+ ctx->Driver.Scissor = NULL;
1962+ ctx->Driver.ShadeModel = glamoShadeModel;
1963+ ctx->Driver.LightModelfv = NULL;
1964+ ctx->Driver.Viewport = glamoViewport;
1965+ ctx->Driver.ResizeBuffers = glamoResizeBuffers;
1966+ ctx->Driver.Flush = glamoFlush;
1967+}
1968diff --git a/src/mesa/drivers/dri/glamo/glamo_state.h b/src/mesa/drivers/dri/glamo/glamo_state.h
1969new file mode 100644
1970index 0000000..c3872c0
1971--- /dev/null
1972+++ b/src/mesa/drivers/dri/glamo/glamo_state.h
1973@@ -0,0 +1,34 @@
1974+/*
1975+ * Direct Rendering Support for SMedia Glamo 336x/337x
1976+ *
1977+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
1978+ * Roughly based on sis_state.h (c) 2003 Eric Anholt
1979+ *
1980+ * Permission is hereby granted, free of charge, to any person obtaining a
1981+ * copy of this software and associated documentation files (the "Software"),
1982+ * to deal in the Software without restriction, including without limitation
1983+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1984+ * and/or sell copies of the Software, and to permit persons to whom the
1985+ * Software is furnished to do so, subject to the following conditions:
1986+ *
1987+ * The above copyright notice and this permission notice shall be included
1988+ * in all copies or substantial portions of the Software.
1989+ *
1990+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1991+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1992+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1993+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1994+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1995+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1996+ */
1997+
1998+#ifndef __GLAMO_STATE_H
1999+#define __GLAMO_STATE_H
2000+
2001+#include "main/context.h"
2002+
2003+extern void glamoInitStateFuncs(struct gl_context *ctx);
2004+
2005+#endif /* __GLAMO_STATE_H */
2006+
2007+/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
2008diff --git a/src/mesa/drivers/dri/glamo/glamo_tris.c b/src/mesa/drivers/dri/glamo/glamo_tris.c
2009new file mode 100644
2010index 0000000..c45fe53
2011--- /dev/null
2012+++ b/src/mesa/drivers/dri/glamo/glamo_tris.c
2013@@ -0,0 +1,310 @@
2014+/*
2015+ * Direct Rendering Support for SMedia Glamo 336x/337x
2016+ *
2017+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
2018+ *
2019+ * Permission is hereby granted, free of charge, to any person obtaining a
2020+ * copy of this software and associated documentation files (the "Software"),
2021+ * to deal in the Software without restriction, including without limitation
2022+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
2023+ * and/or sell copies of the Software, and to permit persons to whom the
2024+ * Software is furnished to do so, subject to the following conditions:
2025+ *
2026+ * The above copyright notice and this permission notice shall be included
2027+ * in all copies or substantial portions of the Software.
2028+ *
2029+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2030+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2031+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
2032+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
2033+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2034+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2035+ *
2036+ *
2037+ * Based on intel_tris.c, to which the following notice applies:
2038+ *
2039+ * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
2040+ * All Rights Reserved.
2041+ *
2042+ * Permission is hereby granted, free of charge, to any person obtaining a
2043+ * copy of this software and associated documentation files (the
2044+ * "Software"), to deal in the Software without restriction, including
2045+ * without limitation the rights to use, copy, modify, merge, publish,
2046+ * distribute, sub license, and/or sell copies of the Software, and to
2047+ * permit persons to whom the Software is furnished to do so, subject to
2048+ * the following conditions:
2049+ *
2050+ * The above copyright notice and this permission notice (including the
2051+ * next paragraph) shall be included in all copies or substantial portions
2052+ * of the Software.
2053+ *
2054+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2055+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2056+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
2057+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
2058+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2059+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2060+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2061+ *
2062+ */
2063+
2064+
2065+#include <glamo_bo.h>
2066+#include <glamo_bo_gem.h>
2067+#include <glamo_drm.h>
2068+
2069+#include "main/mtypes.h"
2070+#include "swrast/swrast.h"
2071+#include "tnl/t_context.h"
2072+#include "tnl/t_vertex.h"
2073+#include "tnl/t_pipeline.h"
2074+
2075+#include "glamo_tris.h"
2076+#include "glamo_context.h"
2077+
2078+
2079+static void glamoRunPipeline(struct gl_context *ctx)
2080+{
2081+ printf("glamoRunPipeline\n");
2082+
2083+ /* TODO: Emit state */
2084+
2085+ _tnl_run_pipeline(ctx);
2086+}
2087+
2088+
2089+static void glamoRenderStart(struct gl_context *ctx)
2090+{
2091+ struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
2092+
2093+ /* Decide which attributes will be used */
2094+ gCtx->vertex_attrs[0].attrib = _TNL_ATTRIB_POS;
2095+ gCtx->vertex_attrs[0].format = EMIT_4F;
2096+
2097+ gCtx->vertex_size = _tnl_install_attrs(ctx, gCtx->vertex_attrs, 1,
2098+ NULL, 0);
2099+}
2100+
2101+
2102+static void glamoRenderFinish(struct gl_context *ctx)
2103+{
2104+ printf("glamoRenderFinish\n");
2105+}
2106+
2107+
2108+static void glamoPrimitiveNotify(struct gl_context *ctx, GLenum prim)
2109+{
2110+ printf("glamoPrimitiveNotify\n");
2111+}
2112+
2113+
2114+uint32_t *glamoGetPrimSpace(struct glamo_context *gCtx, unsigned int count)
2115+{
2116+ uint32_t *addr;
2117+
2118+ printf("glamoGetPrimSpace\n");
2119+
2120+ /* Check for space in the existing VB */
2121+ if (gCtx->prim.vb_bo == NULL || (gCtx->prim.current_offset +
2122+ count * gCtx->vertex_size) > GLAMO_VB_SIZE) {
2123+
2124+ /* Not enough space, or no VB existing. Start a new one... */
2125+ if (gCtx->prim.vb == NULL) {
2126+ printf("Allocated %i bytes\n", GLAMO_VB_SIZE);
2127+ gCtx->prim.vb = malloc(GLAMO_VB_SIZE);
2128+ }
2129+ gCtx->prim.vb_bo = glamo_bo_open(gCtx->glamoScreen->bom, 0,
2130+ GLAMO_VB_SIZE, 4,
2131+ GLAMO_GEM_DOMAIN_VRAM, 0);
2132+ gCtx->prim.start_offset = 0;
2133+ gCtx->prim.current_offset = 0;
2134+ }
2135+
2136+ addr = (uint32_t *)(gCtx->prim.vb + gCtx->prim.current_offset);
2137+ gCtx->prim.current_offset += gCtx->vertex_size * count;
2138+ gCtx->prim.count += count;
2139+
2140+ return addr;
2141+}
2142+
2143+
2144+#define COPY_DWORDS( j, vb, vertsize, v ) \
2145+do { \
2146+ for ( j = 0 ; j < vertsize ; j++ ) { \
2147+ vb[j] = ((GLuint *)v)[j]; \
2148+ } \
2149+ vb += vertsize; \
2150+} while (0)
2151+
2152+
2153+static void glamo_draw_triangle(struct glamo_context *gCtx,
2154+ glamoVertexPtr v0, glamoVertexPtr v1,
2155+ glamoVertexPtr v2)
2156+{
2157+ GLuint *vb = glamoGetPrimSpace(gCtx, 3);
2158+ int j;
2159+
2160+ COPY_DWORDS(j, vb, gCtx->vertex_size, v0);
2161+ COPY_DWORDS(j, vb, gCtx->vertex_size, v1);
2162+ COPY_DWORDS(j, vb, gCtx->vertex_size, v2);
2163+}
2164+
2165+
2166+static void glamo_draw_line(struct glamo_context *gCtx,
2167+ glamoVertexPtr v0, glamoVertexPtr v1)
2168+{
2169+ GLuint *vb = glamoGetPrimSpace(gCtx, 2);
2170+ int j;
2171+
2172+ COPY_DWORDS(j, vb, gCtx->vertex_size, v0);
2173+ COPY_DWORDS(j, vb, gCtx->vertex_size, v1);
2174+}
2175+
2176+
2177+static void glamo_draw_point(struct glamo_context *gCtx, glamoVertexPtr v0)
2178+{
2179+ GLuint *vb = glamoGetPrimSpace(gCtx, 2);
2180+ int j;
2181+
2182+ COPY_DWORDS(j, vb, gCtx->vertex_size, v0);
2183+}
2184+
2185+
2186+#define TRI( a, b, c ) \
2187+do { \
2188+ glamo_draw_triangle(gCtx, a, b, c ); \
2189+} while (0)
2190+
2191+
2192+#define QUAD( a, b, c, d ) \
2193+printf("Drawing a quad\n"); \
2194+do { \
2195+ glamo_draw_triangle(gCtx, a, b, d); \
2196+ glamo_draw_triangle(gCtx, b, c, d); \
2197+} while (0)
2198+
2199+
2200+#define LINE(v0, v1) \
2201+do { \
2202+ glamo_draw_line(gCtx, v0, v1); \
2203+} while (0)
2204+
2205+
2206+#define POINT(v0) \
2207+do { \
2208+ glamo_draw_point(gCtx, v0); \
2209+} while (0)
2210+
2211+
2212+#define IND (0)
2213+#define TAG(x) x
2214+#include "tnl_dd/t_dd_tritmp.h"
2215+
2216+#define IND (0)
2217+#define TAG(x) x##_offset
2218+#include "tnl_dd/t_dd_tritmp.h"
2219+
2220+#define IND (0)
2221+#define TAG(x) x##_twoside
2222+#include "tnl_dd/t_dd_tritmp.h"
2223+
2224+#define IND (0)
2225+#define TAG(x) x##_twoside_offset
2226+#include "tnl_dd/t_dd_tritmp.h"
2227+
2228+#define IND (0)
2229+#define TAG(x) x##_unfilled
2230+#include "tnl_dd/t_dd_tritmp.h"
2231+
2232+#define IND (0)
2233+#define TAG(x) x##_offset_unfilled
2234+#include "tnl_dd/t_dd_tritmp.h"
2235+
2236+#define IND (0)
2237+#define TAG(x) x##_twoside_unfilled
2238+#include "tnl_dd/t_dd_tritmp.h"
2239+
2240+#define IND (0)
2241+#define TAG(x) x##_twoside_offset_unfilled
2242+#include "tnl_dd/t_dd_tritmp.h"
2243+
2244+#define IND (0)
2245+#define TAG(x) x##_fallback
2246+#include "tnl_dd/t_dd_tritmp.h"
2247+
2248+#define IND (0)
2249+#define TAG(x) x##_offset_fallback
2250+#include "tnl_dd/t_dd_tritmp.h"
2251+
2252+#define IND (0)
2253+#define TAG(x) x##_twoside_fallback
2254+#include "tnl_dd/t_dd_tritmp.h"
2255+
2256+#define IND (0)
2257+#define TAG(x) x##_twoside_offset_fallback
2258+#include "tnl_dd/t_dd_tritmp.h"
2259+
2260+#define IND (0)
2261+#define TAG(x) x##_unfilled_fallback
2262+#include "tnl_dd/t_dd_tritmp.h"
2263+
2264+#define IND (0)
2265+#define TAG(x) x##_offset_unfilled_fallback
2266+#include "tnl_dd/t_dd_tritmp.h"
2267+
2268+#define IND (0)
2269+#define TAG(x) x##_twoside_unfilled_fallback
2270+#include "tnl_dd/t_dd_tritmp.h"
2271+
2272+#define IND (0)
2273+#define TAG(x) x##_twoside_offset_unfilled_fallback
2274+#include "tnl_dd/t_dd_tritmp.h"
2275+
2276+
2277+static void init_rast_tab()
2278+{
2279+ init();
2280+ init_offset();
2281+ init_twoside();
2282+ init_twoside_offset();
2283+ init_unfilled();
2284+ init_offset_unfilled();
2285+ init_twoside_unfilled();
2286+ init_twoside_offset_unfilled();
2287+ init_fallback();
2288+ init_offset_fallback();
2289+ init_twoside_fallback();
2290+ init_twoside_offset_fallback();
2291+ init_unfilled_fallback();
2292+ init_offset_unfilled_fallback();
2293+ init_twoside_unfilled_fallback();
2294+ init_twoside_offset_unfilled_fallback();
2295+}
2296+
2297+
2298+void glamoInitTriFuncs(struct gl_context *ctx)
2299+{
2300+ TNLcontext *tnl = TNL_CONTEXT(ctx);
2301+ struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
2302+ static int firsttime = 1;
2303+
2304+ if (firsttime) {
2305+ init_rast_tab();
2306+ firsttime = 0;
2307+ }
2308+
2309+ gCtx->prim.start_offset = 0;
2310+ gCtx->prim.current_offset = 0;
2311+ gCtx->prim.vb_bo = NULL;
2312+ gCtx->prim.vb = NULL;
2313+ gCtx->prim.count = 0;
2314+
2315+ tnl->Driver.RunPipeline = glamoRunPipeline;
2316+ tnl->Driver.Render.Start = glamoRenderStart;
2317+ tnl->Driver.Render.Finish = glamoRenderFinish;
2318+ tnl->Driver.Render.PrimitiveNotify = glamoPrimitiveNotify;
2319+ tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
2320+ tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
2321+ tnl->Driver.Render.CopyPV = _tnl_copy_pv;
2322+ tnl->Driver.Render.Interp = _tnl_interp;
2323+}
2324diff --git a/src/mesa/drivers/dri/glamo/glamo_tris.h b/src/mesa/drivers/dri/glamo/glamo_tris.h
2325new file mode 100644
2326index 0000000..ea396c1
2327--- /dev/null
2328+++ b/src/mesa/drivers/dri/glamo/glamo_tris.h
2329@@ -0,0 +1,38 @@
2330+/*
2331+ * Direct Rendering Support for SMedia Glamo 336x/337x
2332+ *
2333+ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
2334+ *
2335+ * Permission is hereby granted, free of charge, to any person obtaining a
2336+ * copy of this software and associated documentation files (the "Software"),
2337+ * to deal in the Software without restriction, including without limitation
2338+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
2339+ * and/or sell copies of the Software, and to permit persons to whom the
2340+ * Software is furnished to do so, subject to the following conditions:
2341+ *
2342+ * The above copyright notice and this permission notice shall be included
2343+ * in all copies or substantial portions of the Software.
2344+ *
2345+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2346+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2347+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
2348+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
2349+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2350+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2351+ */
2352+
2353+#ifndef __GLAMO_TRIS_H
2354+#define __GLAMO_TRIS_H
2355+
2356+#include "main/mtypes.h"
2357+
2358+#include "glamo_context.h"
2359+
2360+/* Amount of space reserved for vertex submission */
2361+#define GLAMO_VB_SIZE (32*1024)
2362+
2363+extern void glamoInitTriFuncs(struct gl_context *ctx);
2364+extern uint32_t *glamoGetPrimSpace(struct glamo_context *gCtx,
2365+ unsigned int count);
2366+
2367+#endif /* __GLAMO_TRIS_H */
2368diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
2369index 997fc0b..e3c9119 100644
2370--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
2371+++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
2372@@ -127,6 +127,8 @@ static void TAG(render_points_verts)( struct gl_context *ctx,
2373 currentsz = dmasz;
2374 }
2375
2376+ FLUSH();
2377+
2378 } else {
2379 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
2380 return;
2381@@ -162,6 +164,8 @@ static void TAG(render_lines_verts)( struct gl_context *ctx,
2382 currentsz = dmasz;
2383 }
2384
2385+ FLUSH();
2386+
2387 } else {
2388 fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
2389 return;
2390@@ -191,7 +195,7 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx,
2391 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
2392 currentsz = dmasz;
2393 }
2394-
2395+
2396 FLUSH();
2397
2398 } else {
2399@@ -294,6 +298,8 @@ static void TAG(render_triangles_verts)( struct gl_context *ctx,
2400 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
2401 currentsz = dmasz;
2402 }
2403+
2404+ FLUSH();
2405 }
2406
2407
2408@@ -567,6 +573,8 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
2409 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
2410 currentsz = dmasz;
2411 }
2412+
2413+ FLUSH();
2414 }
2415 else if (HAVE_ELTS) {
2416 /* Hardware doesn't have a quad primitive type -- try to
2417@@ -640,6 +648,8 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
2418 tmp = EMIT_VERTS(ctx, j + 1, 3, tmp);
2419 (void) tmp;
2420 }
2421+
2422+ FLUSH();
2423 }
2424 else {
2425 /* Vertices won't fit in a single buffer, should never happen.
diff --git a/meta-oe/recipes-graphics/mesa/mesa-7.10.2/uclibc.patch b/meta-oe/recipes-graphics/mesa/mesa-7.10.2/uclibc.patch
new file mode 100644
index 000000000..0508112df
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/mesa-7.10.2/uclibc.patch
@@ -0,0 +1,26 @@
1Index: Mesa-7.9.1/src/mesa/main/imports.c
2===================================================================
3--- Mesa-7.9.1.orig/src/mesa/main/imports.c 2010-12-15 13:50:00.000000000 -0800
4+++ Mesa-7.9.1/src/mesa/main/imports.c 2011-01-10 12:23:48.848656001 -0800
5@@ -757,7 +757,7 @@
6 float
7 _mesa_strtof( const char *s, char **end )
8 {
9-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
10+#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(__UCLIBC__)
11 static locale_t loc = NULL;
12 if (!loc) {
13 loc = newlocale(LC_CTYPE_MASK, "C", NULL);
14Index: Mesa-7.9.1/src/glsl/strtod.c
15===================================================================
16--- Mesa-7.9.1.orig/src/glsl/strtod.c 2011-01-10 20:08:01.568656001 -0800
17+++ Mesa-7.9.1/src/glsl/strtod.c 2011-01-10 20:08:39.898656001 -0800
18@@ -44,7 +44,7 @@
19 double
20 glsl_strtod(const char *s, char **end)
21 {
22-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
23+#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(__UCLIBC__)
24 static locale_t loc = NULL;
25 if (!loc) {
26 loc = newlocale(LC_CTYPE_MASK, "C", NULL);
diff --git a/meta-oe/recipes-graphics/mesa/mesa-common.inc b/meta-oe/recipes-graphics/mesa/mesa-common.inc
new file mode 100644
index 000000000..4073d6ffe
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/mesa-common.inc
@@ -0,0 +1,53 @@
1SECTION = "x11"
2
3DESCRIPTION = "An open source implementation of the OpenGL spec"
4HOMEPAGE = "http://mesa3d.org"
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://docs/license.html;md5=7a3373c039b6b925c427755a4f779c1d"
7
8INC_PR = "r11"
9PE = "2"
10
11PROTO_DEPS = "xf86driproto glproto"
12LIB_DEPS = "virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
13
14DEPENDS = "${PROTO_DEPS} ${LIB_DEPS}"
15
16SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2;name=archive \
17 "
18S = "${WORKDIR}/Mesa-${PV}"
19
20PROVIDES = "virtual/libgl"
21
22inherit autotools pkgconfig
23
24EXTRA_OECONF = "--enable-glu \
25 --disable-glw \
26 --disable-glut \
27 "
28
29inherit glx-use-tls
30
31# Package contents vary according to ${MACHINE_DRI_MODULES}.
32PACKAGE_ARCH = "${MACHINE_ARCH}"
33
34PACKAGES =+ "libegl libegl-dev libegl-dbg libglu libglu-dev libosmesa libosmesa-dev libgl libgl-dev"
35FILES_${PN} += "${libdir}/dri/*.so"
36FILES_libegl = "${libdir}/libEGL.so.* ${libdir}/egl/*.so"
37FILES_libgl = "${libdir}/libGL.so.*"
38FILES_libglu = "${libdir}/libGLU.so.*"
39FILES_libosmesa = "${libdir}/libOSMesa.so.*"
40
41FILES_libegl-dev = "${libdir}/libEGL.* ${includedir}/EGL"
42FILES_libgl-dev = "${libdir}/libGL.* ${includedir}/GL"
43FILES_libglu-dev = "${libdir}/libGLU.* ${includedir}/GL/glu*.h"
44FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/osmesa.h"
45
46FILES_${PN}-dbg += "${libdir}/dri/.debug/*"
47FILES_libegl-dbg += "${libdir}/egl/.debug/*"
48
49NATIVE_INSTALL_WORKS = "1"
50do_install_append () {
51 install -d ${D}/${includedir}/GL
52 cp -pPr ${S}/include/GL/internal* ${D}/${includedir}/GL
53}
diff --git a/meta-oe/recipes-graphics/mesa/mesa-dri.inc b/meta-oe/recipes-graphics/mesa/mesa-dri.inc
new file mode 100644
index 000000000..4f42b7930
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/mesa-dri.inc
@@ -0,0 +1,10 @@
1DEPENDS += "dri2proto expat libdrm makedepend-native"
2
3#not supported in oe-core base.bbclass
4#FILESPATHPKG =. "mesa-${PV}:mesa:"
5FILESPATH =. "${FILE_DIRNAME}/mesa:${FILE_DIRNAME}/mesa-${PV}:"
6
7# most of our targets do not have DRI so will use mesa-xlib
8DEFAULT_PREFERENCE = "-1"
9
10EXTRA_OECONF += " --with-driver=dri --with-dri-drivers=swrast,${MACHINE_DRI_MODULES}"
diff --git a/meta-oe/recipes-graphics/mesa/mesa-dri_7.10.2.bb b/meta-oe/recipes-graphics/mesa/mesa-dri_7.10.2.bb
new file mode 100644
index 000000000..26b56e426
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/mesa-dri_7.10.2.bb
@@ -0,0 +1,4 @@
1require mesa-common.inc
2require mesa-${PV}.inc
3require mesa-dri.inc
4PR = "${INC_PR}.0"
diff --git a/meta-oe/recipes-graphics/mesa/mesa-xlib.inc b/meta-oe/recipes-graphics/mesa/mesa-xlib.inc
new file mode 100644
index 000000000..cabe6e5ec
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/mesa-xlib.inc
@@ -0,0 +1,2 @@
1FILESPATHPKG =. "mesa-${PV}:mesa:"
2EXTRA_OECONF += " --with-driver=xlib"
diff --git a/meta-oe/recipes-graphics/mesa/mesa-xlib_7.10.2.bb b/meta-oe/recipes-graphics/mesa/mesa-xlib_7.10.2.bb
new file mode 100644
index 000000000..93bb8cd19
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/mesa-xlib_7.10.2.bb
@@ -0,0 +1,4 @@
1require mesa-common.inc
2require mesa-${PV}.inc
3require mesa-xlib.inc
4PR = "${INC_PR}.0"
diff --git a/meta-oe/recipes-graphics/mesa/mesa_7.10.2.bb b/meta-oe/recipes-graphics/mesa/mesa_7.10.2.bb
new file mode 100644
index 000000000..4cb8db7f7
--- /dev/null
+++ b/meta-oe/recipes-graphics/mesa/mesa_7.10.2.bb
@@ -0,0 +1,6 @@
1# This is a dummy package so OE can use the poky mesa files
2require mesa-dri_${PV}.bb
3
4PR = "${INC_PR}.0"
5
6EXTRA_OECONF += "--disable-egl"
diff --git a/meta-oe/recipes-graphics/tasks/task-fonts-truetype.bb b/meta-oe/recipes-graphics/tasks/task-fonts-truetype.bb
new file mode 100644
index 000000000..8ffa88b64
--- /dev/null
+++ b/meta-oe/recipes-graphics/tasks/task-fonts-truetype.bb
@@ -0,0 +1,40 @@
1DESCRIPTION = "Install one of these tasks to get support for truetype fonts."
2SECTION = "fonts"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${TOPDIR}/meta-shr/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
5PV = "1.0"
6PR = "r0"
7
8inherit task
9
10PACKAGES += "\
11 ${PN}-core \
12 ${PN}-chinese \
13 ${PN}-japanese \
14"
15
16RRECOMMENDS_task-fonts-truetype = "\
17 ${PN}-core \
18 ${PN}-chinese \
19 ${PN}-japanese \
20"
21
22RDEPENDS_task-fonts-truetype-core = "\
23 fontconfig-utils \
24 \
25 ttf-dejavu-common \
26 ttf-dejavu-sans \
27 ttf-dejavu-sans-mono \
28"
29# ttf-dejavu-serif \
30
31RDEPENDS_task-fonts-truetype-chinese = "\
32 ${PN}-core \
33 ttf-arphic-uming \
34"
35
36RDEPENDS_task-fonts-truetype-japanese = "\
37 ${PN}-core \
38 ttf-sazanami-gothic \
39 ttf-sazanami-mincho \
40"
diff --git a/meta-oe/recipes-graphics/ttf-fonts/ttf-liberation_0.2.bb b/meta-oe/recipes-graphics/ttf-fonts/ttf-liberation_0.2.bb
new file mode 100644
index 000000000..5ebb25751
--- /dev/null
+++ b/meta-oe/recipes-graphics/ttf-fonts/ttf-liberation_0.2.bb
@@ -0,0 +1,23 @@
1require ttf.inc
2
3DESCRIPTION = "Liberation fonts - TTF Version"
4HOMEPAGE = "https://www.redhat.com/promo/fonts/"
5LICENSE = "GPLv2"
6LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
7 file://License.txt;md5=5b171c5100029d884fcea21d9a2b7543 \
8"
9
10PR = "r3"
11
12SRC_URI = "http://fedorahosted.org/liberation-fonts/export/807b6dfd069b998cd9b4d3158da98817ef23c79d/F-9/liberation-fonts-ttf-3.tar.gz"
13S = "${WORKDIR}/liberation-fonts-${PV}"
14
15PACKAGES = "${PN}-dbg ttf-liberation-mono ttf-liberation-sans ttf-liberation-serif"
16RRECOMMENDS_${PN}-dbg = ""
17
18FILES_ttf-liberation-mono = "${datadir}/fonts/truetype/*Mono*"
19FILES_ttf-liberation-sans = "${datadir}/fonts/truetype/*Sans*"
20FILES_ttf-liberation-serif = "${datadir}/fonts/truetype/*Serif*"
21
22SRC_URI[md5sum] = "77728078a17e39f7c242b42c3bf6feb8"
23SRC_URI[sha256sum] = "174cf27c57612971434ec8cc4a52bfd37bad8408e9b9219539c6d5113df6ff8f"
diff --git a/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/iphone3g/pointercal.xinput b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/iphone3g/pointercal.xinput
new file mode 100644
index 000000000..d6ce56b82
--- /dev/null
+++ b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/iphone3g/pointercal.xinput
@@ -0,0 +1 @@
xinput set-int-prop "Touchscreen" "Evdev Axis Calibration" 32 -102 4739 6 7321;
diff --git a/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/nokia900/pointercal.xinput b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/nokia900/pointercal.xinput
new file mode 100644
index 000000000..66bb32cab
--- /dev/null
+++ b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/nokia900/pointercal.xinput
@@ -0,0 +1,2 @@
1xinput set-int-prop "Touchscreen" "Evdev Axis Calibration" 32 204 3897 3763 178;
2
diff --git a/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta01/pointercal.xinput b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta01/pointercal.xinput
new file mode 100644
index 000000000..be25da352
--- /dev/null
+++ b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta01/pointercal.xinput
@@ -0,0 +1,2 @@
1xinput set-int-prop "Touchscreen" "Evdev Axis Calibration" 32 107 918 911 98
2xinput set-int-prop "Touchscreen" "Evdev Axes Swap" 8 1
diff --git a/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta02/pointercal.xinput b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta02/pointercal.xinput
new file mode 100644
index 000000000..be25da352
--- /dev/null
+++ b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta02/pointercal.xinput
@@ -0,0 +1,2 @@
1xinput set-int-prop "Touchscreen" "Evdev Axis Calibration" 32 107 918 911 98
2xinput set-int-prop "Touchscreen" "Evdev Axes Swap" 8 1
diff --git a/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
new file mode 100644
index 000000000..9633fc5f3
--- /dev/null
+++ b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
@@ -0,0 +1 @@
# replace with valid machine specific pointercal.xinput
diff --git a/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
new file mode 100644
index 000000000..e611862a4
--- /dev/null
+++ b/meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
@@ -0,0 +1,21 @@
1DESCRIPTION = "Touchscreen calibration data from xinput-calibrator"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${TOPDIR}/meta-shr/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5SECTION = "base"
6
7PR = "r2"
8SRC_URI = "file://pointercal.xinput"
9S = "${WORKDIR}"
10
11do_install() {
12 # Only install file if it has a contents
13 if [ -s ${S}/pointercal.xinput ]; then
14 install -d ${D}${sysconfdir}/
15 install -m 0644 ${S}/pointercal.xinput ${D}${sysconfdir}/
16 fi
17}
18
19ALLOW_EMPTY_${PN} = "1"
20PACKAGE_ARCH = "${MACHINE_ARCH}"
21CONFFILES_${PN} = "${sysconfdir}/pointercal.xinput"
diff --git a/meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator.inc b/meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator.inc
new file mode 100644
index 000000000..357b0e5c0
--- /dev/null
+++ b/meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator.inc
@@ -0,0 +1,8 @@
1DESCRIPTION = "A generic touchscreen calibration program for X.Org"
2HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xinput_calibrator"
3LICENSE = "MIT/X11"
4DEPENDS = "virtual/libx11 libxi"
5RDEPENDS_${PN} = "xinput pointercal-xinput"
6INC_PR = "r7"
7
8inherit autotools
diff --git a/meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator_0.6.1.bb b/meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator_0.6.1.bb
new file mode 100644
index 000000000..2eb3cc942
--- /dev/null
+++ b/meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator_0.6.1.bb
@@ -0,0 +1,17 @@
1require xinput-calibrator.inc
2
3LIC_FILES_CHKSUM = "file://src/calibrator.cpp;endline=22;md5=998e238a7638a7446eaeb02398f691fc"
4SRC_URI = "git://github.com/tias/xinput_calibrator.git;protocol=git"
5
6SRCREV = "d2ce98b3f638667dd64b6d718721379b2dc750a7"
7PR = "${INC_PR}.0"
8S = "${WORKDIR}/git/"
9
10do_install_append() {
11 install -d ${D}${bindir}
12 install -m 0755 scripts/xinput_calibrator_pointercal.sh ${D}${bindir}/xinput_calibrator_once.sh
13 ln -s ${bindir}/xinput_calibrator_x11 ${D}${bindir}/xinput_calibrator
14 install -d ${D}${datadir}/applications/
15 install -m 0755 scripts/xinput_calibrator.desktop ${D}${datadir}/applications/xinput-calibrator.desktop
16 install -m 0755 scripts/xinput_calibrator_get_hal_calibration.sh ${D}${bindir}/xinput_calibrator_get_hal_calibration.sh
17}
diff --git a/meta-oe/recipes-graphics/xorg-app/rgb_1.0.4.bb b/meta-oe/recipes-graphics/xorg-app/rgb_1.0.4.bb
new file mode 100644
index 000000000..59dca2ac7
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-app/rgb_1.0.4.bb
@@ -0,0 +1,10 @@
1require xorg-app-common.inc
2DEPENDS += " xproto util-macros"
3LIC_FILES_CHKSUM = "file://COPYING;md5=ef598adbe241bd0b0b9113831f6e249a"
4PE = "1"
5PR = "${INC_PR}.0"
6
7SRC_URI[md5sum] = "35c6cccbf25a872bdd62bfcb1a73d951"
8SRC_URI[sha256sum] = "80887da011ad086fff88bfd16c6d9d5ac7da45ef1bc9d0c192a6f370423370f1"
9
10FILES_${PN} += "${datadir}/X11"
diff --git a/meta-oe/recipes-graphics/xorg-app/xinput_1.5.3.bb b/meta-oe/recipes-graphics/xorg-app/xinput_1.5.3.bb
new file mode 100644
index 000000000..c1acc983d
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-app/xinput_1.5.3.bb
@@ -0,0 +1,8 @@
1require xorg-app-common.inc
2LIC_FILES_CHKSUM = "file://COPYING;md5=22c34ea36136407a77702a8b784f9bd0"
3DESCRIPTION = "a utility to configure and test XInput devices"
4DEPENDS += " libxi"
5PR = "${INC_PR}.0"
6
7SRC_URI[md5sum] = "1e2f0ad4f3fa833b65c568907f171d28"
8SRC_URI[sha256sum] = "6aade131cecddaeefc39ddce1dd5e8473f6039c2e4efbfd9fbb5ee2a75885c76"
diff --git a/meta-oe/recipes-graphics/xorg-app/xorg-app-common.inc b/meta-oe/recipes-graphics/xorg-app/xorg-app-common.inc
new file mode 100644
index 000000000..8358af4d5
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-app/xorg-app-common.inc
@@ -0,0 +1,15 @@
1DESCRIPTION = "X application"
2HOMEPAGE = "http://www.x.org/"
3SECTION = "x11/apps"
4LICENSE = "MIT-X"
5DEPENDS = "util-macros-native virtual/libx11"
6
7INC_PR = "r5"
8
9SRC_URI = "${XORG_MIRROR}/individual/app/${BPN}-${PV}.tar.bz2"
10
11S = "${WORKDIR}/${BPN}-${PV}"
12
13inherit autotools pkgconfig
14
15FILES_${PN} += " /usr/lib/X11/${BPN} /usr/share/X11/app-defaults/"
diff --git a/meta-oe/recipes-graphics/xorg-doc/xorg-doc-common.inc b/meta-oe/recipes-graphics/xorg-doc/xorg-doc-common.inc
new file mode 100644
index 000000000..f4b8b00de
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-doc/xorg-doc-common.inc
@@ -0,0 +1,12 @@
1DESCRIPTION = "X documentation"
2HOMEPAGE = "http://www.x.org"
3SECTION = "x11/docs"
4LICENSE = "MIT-X"
5
6SRC_URI = "${XORG_MIRROR}/individual/doc/${BPN}-${PV}.tar.bz2"
7
8S = "${WORKDIR}/${BPN}-${PV}"
9
10INC_PR = "r1"
11
12inherit autotools pkgconfig
diff --git a/meta-oe/recipes-graphics/xorg-doc/xorg-sgml-doctools_1.7.bb b/meta-oe/recipes-graphics/xorg-doc/xorg-sgml-doctools_1.7.bb
new file mode 100644
index 000000000..55f4bacc2
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-doc/xorg-sgml-doctools_1.7.bb
@@ -0,0 +1,8 @@
1require xorg-doc-common.inc
2PE = "1"
3PR = "${INC_PR}.0"
4
5SRC_URI[md5sum] = "2588efb3f49f7fc6ecf41ce42e0b2e5e"
6SRC_URI[sha256sum] = "84fd94e5c50556e6f77501485f8a48724cf3c95c6d58480bc280258ba14580c8"
7
8FILES_${PN} += " /usr/share/sgml/X11"
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-input-keyboard_1.6.0.bb b/meta-oe/recipes-graphics/xorg-driver/xf86-input-keyboard_1.6.0.bb
new file mode 100644
index 000000000..cbbc7c717
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-input-keyboard_1.6.0.bb
@@ -0,0 +1,17 @@
1require xorg-driver-input.inc
2
3SUMMARY = "X.Org X server -- keyboard input driver"
4
5DESCRIPTION = "keyboard is an Xorg input driver for keyboards. The \
6driver supports the standard OS-provided keyboard interface. The driver \
7functions as a keyboard input device, and may be used as the X server's \
8core keyboard."
9
10LIC_FILES_CHKSUM = "file://COPYING;md5=ea2099d24ac9e316a6d4b9f20b3d4e10"
11
12DEPENDS += " kbproto"
13PE = "1"
14PR = "${INC_PR}.0"
15
16SRC_URI[md5sum] = "e2abe9f13e526a73cb68a7d257546eba"
17SRC_URI[sha256sum] = "c46c790fec905d696573b7a374b10ab8b4389112a8f69993fe011006c99e858e"
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-input-mouse_1.7.0.bb b/meta-oe/recipes-graphics/xorg-driver/xf86-input-mouse_1.7.0.bb
new file mode 100644
index 000000000..88b304ffa
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-input-mouse_1.7.0.bb
@@ -0,0 +1,17 @@
1require xorg-driver-input.inc
2
3SUMMARY = "X.Org X server -- mouse input driver"
4
5DESCRIPTION = "mouse is an Xorg input driver for mice. The driver \
6supports most available mouse types and interfaces. The mouse driver \
7functions as a pointer input device, and may be used as the X server's \
8core pointer. Multiple mice are supported by multiple instances of this \
9driver."
10
11LIC_FILES_CHKSUM = "file://COPYING;md5=237eb1d1a602d29ef2af62d8fba60f19"
12
13PE = "1"
14PR = "${INC_PR}.0"
15
16SRC_URI[md5sum] = "7f31472689c15b6de62eff04d0fb57d7"
17SRC_URI[sha256sum] = "4e989542b5e9e0c5f9087288b18e70de1064dd27c83a4bc6dce58f3ea9d74994"
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/10-x11-input-tslib.fdi b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/10-x11-input-tslib.fdi
new file mode 100644
index 000000000..906043947
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/10-x11-input-tslib.fdi
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<deviceinfo version="0.2">
3 <device>
4 <match key="info.capabilities" contains="input.touchpad">
5 <merge key="input.x11_driver" type="string">tslib</merge>
6 </match>
7 <match key="info.capabilities" contains="input.touchscreen">
8 <merge key="input.x11_driver" type="string">tslib</merge>
9 </match>
10 </device>
11</deviceinfo>
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/99-xf86-input-tslib.rules b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/99-xf86-input-tslib.rules
new file mode 100644
index 000000000..ec130c257
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/99-xf86-input-tslib.rules
@@ -0,0 +1,5 @@
1# create /dev/input/touchscreenX symlink, tag xf86-input-tslib as driver
2SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen%n", ENV{x11_driver}="tslib"
3SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen%n", ENV{x11_driver}="tslib"
4
5
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/double-free-crash.patch b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/double-free-crash.patch
new file mode 100644
index 000000000..07754731d
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/double-free-crash.patch
@@ -0,0 +1,20 @@
1xorg-server-1.7.3/hw/xfree86/common/xf86Helper.c contains this code
2causing a double free crash on chvt or exit:
3
4 /* This should *really* be handled in drv->UnInit(dev) call instead, but
5 * if the driver forgets about it make sure we free it or at least crash
6 * with flying colors */
7 if (pInp->private)
8 xfree(pInp->private);
9Index: xf86-input-tslib-0.0.6/src/tslib.c
10===================================================================
11--- xf86-input-tslib-0.0.6.orig/src/tslib.c
12+++ xf86-input-tslib-0.0.6/src/tslib.c
13@@ -435,6 +435,7 @@ xf86TslibUninit(InputDriverPtr drv, Inpu
14 xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
15 ts_close(priv->ts);
16 xfree(pInfo->private);
17+ pInfo->private = NULL;
18 xf86DeleteInput(pInfo, 0);
19 }
20
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/xserver-174-XGetPointerControl.patch b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/xserver-174-XGetPointerControl.patch
new file mode 100644
index 000000000..a1f6ba8f9
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/xserver-174-XGetPointerControl.patch
@@ -0,0 +1,34 @@
1From Grazvydas Ignotas
2
3At least xserver 1.7.4 crashes on XGetPointerControl request because of xf86-input-tslib:
4
5Program received signal SIGSEGV, Segmentation fault.
6#0 0x000355e0 in ProcGetPointerControl (client=0x4a2e58) at devices.c:2122
7#1 0x00062fa8 in Dispatch () at dispatch.c:439
8#2 0x00022444 in main (argc=4, argv=0xbeebedc4, envp=0xbeebedd8) at main.c:285
9
10This happens because ptrfeed field is not set in device structure from tslib.
11To fix this, call InitPtrFeedbackClassDeviceStruct() during DEVICE_INIT to get necessary setup done (as done in other input drivers).
12
13---
14diff -ur xf86-input-tslib-0.0.6/src/tslib.c xf86-input-tslib-0.0.6_/src/tslib.c
15--- xf86-input-tslib-0.0.6/src/tslib.c 2010-02-09 12:23:22.000000000 +0200
16+++ xf86-input-tslib-0.0.6_/src/tslib.c 2010-02-09 12:37:33.000000000 +0200
17@@ -103,8 +103,6 @@
18 static void
19 PointerControlProc(DeviceIntPtr dev, PtrCtrl * ctrl)
20 {
21- ErrorF("%s\n", __FUNCTION__);
22- return;
23 }
24
25 static Bool
26@@ -406,6 +404,8 @@
27 xf86MotionHistoryAllocate(pInfo);
28 #endif
29
30+ if (!InitPtrFeedbackClassDeviceStruct(device, PointerControlProc))
31+ return !Success;
32 break;
33
34 case DEVICE_ON:
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb
new file mode 100644
index 000000000..d5d11ce15
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb
@@ -0,0 +1,32 @@
1require xorg-driver-input.inc
2DESCRIPTION = "X.Org X server -- tslib input driver"
3DEPENDS += "tslib"
4RRECOMMENDS_${PN} += "tslib-calibrate"
5RSUGGESTS_${PN} += "hal"
6
7# derived from xf86-input-void, that's why I kept MIT-X, but it's not clear, see COPYING
8LIC_FILES_CHKSUM = "file://src/tslib.c;endline=28;md5=bd62eaef222dcf5cd59e490a12bd795e \
9 file://COPYING;md5=4641deddaa80fe7ca88e944e1fd94a94"
10
11PR = "${INC_PR}.1"
12
13SRC_URI = "http://www.pengutronix.de/software/xf86-input-tslib/download/xf86-input-tslib-${PV}.tar.bz2;name=archive \
14 file://double-free-crash.patch \
15 file://10-x11-input-tslib.fdi \
16 file://xserver-174-XGetPointerControl.patch \
17 file://99-xf86-input-tslib.rules \
18"
19SRC_URI[md5sum] = "b7a4d2f11637ee3fcf432e044b1d017f"
20SRC_URI[sha256sum] = "5f46fdef095a6e44a69e0f0b57c7d665224b26d990d006611236d8332e85b105"
21
22do_configure_prepend() {
23 rm -rf ${S}/m4/ || true
24}
25do_install_append() {
26 install -d ${D}/${datadir}/hal/fdi/policy/20thirdparty
27 install -m 0644 ${WORKDIR}/10-x11-input-tslib.fdi ${D}/${datadir}/hal/fdi/policy/20thirdparty
28 install -d ${D}/lib/udev/rules.d
29 install -m 0644 ${WORKDIR}/99-xf86-input-tslib.rules ${D}/lib/udev/rules.d/
30}
31
32FILES_${PN} += "${datadir}/hal /lib/udev"
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb b/meta-oe/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb
new file mode 100644
index 000000000..d555fbc4b
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb
@@ -0,0 +1,9 @@
1require xorg-driver-video.inc
2LIC_FILES_CHKSUM = "file://COPYING;md5=d8cbd99fff773f92e844948f74ef0df8"
3
4DESCRIPTION = "X.Org X server -- fbdev display driver"
5PE = "1"
6PR = "${INC_PR}.1"
7
8SRC_URI[md5sum] = "53a533d9e0c2da50962282526bace074"
9SRC_URI[sha256sum] = "93b271b4b41d7e5ca108849a583b9523e96c51813d046282285355b7001f82d5"
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo/0001-glamo-drm-define-GLAMO_CMDQ_MAX_COUNT-instead-of-mag.patch b/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo/0001-glamo-drm-define-GLAMO_CMDQ_MAX_COUNT-instead-of-mag.patch
new file mode 100644
index 000000000..0c7350fc1
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo/0001-glamo-drm-define-GLAMO_CMDQ_MAX_COUNT-instead-of-mag.patch
@@ -0,0 +1,66 @@
1From e2d0f9a3ba7f36b0b8ac8d736dd76da6e5e07f38 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Fri, 29 Oct 2010 11:19:08 +0200
4Subject: [PATCH] glamo-drm: define GLAMO_CMDQ_MAX_COUNT instead of magic constant 1024
5
6* fix check for full queue, because size != count here
7* make sure we have enough space in queue for 2 resp. 4 more commands in
8 GlamoDRMAddCommand resp. GlamoDRMAddCommandBO
9
10Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
11---
12 src/glamo-drm.c | 16 +++++++++++-----
13 1 files changed, 11 insertions(+), 5 deletions(-)
14
15diff --git a/src/glamo-drm.c b/src/glamo-drm.c
16index aac93bb..01e8510 100644
17--- a/src/glamo-drm.c
18+++ b/src/glamo-drm.c
19@@ -32,6 +32,8 @@
20
21 #include "glamo.h"
22
23+/* How many commands can be stored before forced dispatch */
24+#define GLAMO_CMDQ_MAX_COUNT 1024
25
26 /* Submit the prepared command sequence to the kernel */
27 void GlamoDRMDispatch(GlamoPtr pGlamo)
28@@ -60,7 +62,7 @@ void GlamoDRMDispatch(GlamoPtr pGlamo)
29
30 void GlamoDRMAddCommand(GlamoPtr pGlamo, uint16_t reg, uint16_t val)
31 {
32- if ( pGlamo->cmdq_drm_used == pGlamo->cmdq_drm_size ) {
33+ if ( pGlamo->cmdq_drm_used >= GLAMO_CMDQ_MAX_COUNT - 2 ) {
34 xf86DrvMsg(pGlamo->pScreen->myNum, X_INFO,
35 "Forced command cache flush.\n");
36 GlamoDRMDispatch(pGlamo);
37@@ -74,7 +76,8 @@ void GlamoDRMAddCommand(GlamoPtr pGlamo, uint16_t reg, uint16_t val)
38
39 void GlamoDRMAddCommandBO(GlamoPtr pGlamo, uint16_t reg, struct glamo_bo *bo)
40 {
41- if ( pGlamo->cmdq_drm_used == pGlamo->cmdq_drm_size ) {
42+ if ( pGlamo->cmdq_drm_used >= GLAMO_CMDQ_MAX_COUNT - 4 ||
43+ pGlamo->cmdq_obj_used >= GLAMO_CMDQ_MAX_COUNT) {
44 xf86DrvMsg(pGlamo->pScreen->myNum, X_INFO,
45 "Forced command cache flush.\n");
46 GlamoDRMDispatch(pGlamo);
47@@ -98,10 +101,13 @@ void GlamoDRMAddCommandBO(GlamoPtr pGlamo, uint16_t reg, struct glamo_bo *bo)
48
49 void GlamoDRMInit(GlamoPtr pGlamo)
50 {
51- pGlamo->cmdq_objs = malloc(1024);
52- pGlamo->cmdq_obj_pos = malloc(1024);
53+ pGlamo->cmdq_objs = malloc(GLAMO_CMDQ_MAX_COUNT);
54+ pGlamo->cmdq_obj_pos = malloc(GLAMO_CMDQ_MAX_COUNT);
55 pGlamo->cmdq_obj_used = 0;
56 pGlamo->cmdq_drm_used = 0;
57- pGlamo->cmdq_drm_size = 4 * 1024;
58+ /* we're using 2bytes per entry (uint16_t) that's why we need to allocate
59+ * GLAMO_CMDQ_MAX_COUNT * 2 bytes
60+ */
61+ pGlamo->cmdq_drm_size = 2 * GLAMO_CMDQ_MAX_COUNT;
62 pGlamo->cmdq_drm = malloc(pGlamo->cmdq_drm_size);
63 }
64--
651.7.3.2
66
diff --git a/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb b/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb
new file mode 100644
index 000000000..c9e1d5699
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb
@@ -0,0 +1,19 @@
1require xorg-driver-video.inc
2DESCRIPTION = "X.Org X server -- Glamo display driver with KMS support"
3DEPENDS += "libdrm"
4
5LIC_FILES_CHKSUM = "file://COPYING;md5=d8cbd99fff773f92e844948f74ef0df8"
6
7RDEPENDS_${PN} = "xserver-xorg-extension-dri xserver-xorg-extension-dri2 xserver-xorg-extension-glx mesa-dri"
8PE = "2"
9PV = "1.0.0+gitr${SRCPV}"
10PR = "${INC_PR}.5"
11
12SRC_URI = "git://git.openmoko.org/git/xf86-video-glamo.git;protocol=git;branch=master \
13 file://0001-glamo-drm-define-GLAMO_CMDQ_MAX_COUNT-instead-of-mag.patch \
14 "
15
16S = "${WORKDIR}/git"
17SRCREV = "16af3c00195adc68cbd508e3613be4b2349260b3"
18
19EXTRA_OECONF = " --enable-kms "
diff --git a/meta-oe/recipes-graphics/xorg-driver/xorg-driver-common.inc b/meta-oe/recipes-graphics/xorg-driver/xorg-driver-common.inc
new file mode 100644
index 000000000..970b0d176
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xorg-driver-common.inc
@@ -0,0 +1,40 @@
1DESCRIPTION = "X driver"
2HOMEPAGE = "http://www.x.org"
3SECTION = "x11/drivers"
4LICENSE = "MIT-X"
5INC_PR = "r15"
6
7DEPENDS = "randrproto xorg-server xproto"
8
9SRC_URI = "${XORG_MIRROR}/individual/driver/${BPN}-${PV}.tar.bz2"
10
11S = "${WORKDIR}/${BPN}-${PV}"
12
13FILES_${PN} += " ${libdir}/xorg/modules"
14FILES_${PN}-dbg += "${libdir}/xorg/modules/*/.debug"
15
16inherit autotools pkgconfig
17
18TARGET_CPPFLAGS += "-I${STAGING_DIR_HOST}/usr/include/xorg"
19
20# Another sucky behavor from Xorg configure scripts.
21# They use AC_CHECK_FILE to check for DRI headers. Yuck!
22# Of course this will blow up when cross compiling.
23
24do_configure_prepend() {
25 incdir=${layout_includedir}/xorg
26 for f in dri.h sarea.h dristruct.h exa.h damage.h xf86Module.h; do
27 path="$incdir/$f"
28 if [ -f "${STAGING_DIR_HOST}/$path" ]; then
29 p=`echo "$path" | sed 'y%*+%pp%;s%[^_[:alnum:]]%_%g'`
30 eval "export ac_cv_file_$p=yes"
31 fi
32 done
33}
34
35# FIXME: We don't want to include the libtool archives (*.la) from modules
36# directory, as they serve no useful purpose. Upstream should fix Makefile.am
37do_install_append() {
38 find ${D}${libdir}/xorg/modules -regex ".*\.la$" | xargs rm -f --
39}
40
diff --git a/meta-oe/recipes-graphics/xorg-driver/xorg-driver-input.inc b/meta-oe/recipes-graphics/xorg-driver/xorg-driver-input.inc
new file mode 100644
index 000000000..e44dbd58f
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xorg-driver-input.inc
@@ -0,0 +1,4 @@
1include xorg-driver-common.inc
2
3DEPENDS = "randrproto inputproto xserver-xorg xproto"
4
diff --git a/meta-oe/recipes-graphics/xorg-driver/xorg-driver-video.inc b/meta-oe/recipes-graphics/xorg-driver/xorg-driver-video.inc
new file mode 100644
index 000000000..36b5b7595
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-driver/xorg-driver-video.inc
@@ -0,0 +1,4 @@
1include xorg-driver-common.inc
2
3DEPENDS = "randrproto renderproto videoproto xextproto fontsproto xserver-xorg xproto"
4
diff --git a/meta-oe/recipes-graphics/xorg-lib/liblbxutil-1.1.0/mkg3states-1.1.patch b/meta-oe/recipes-graphics/xorg-lib/liblbxutil-1.1.0/mkg3states-1.1.patch
new file mode 100644
index 000000000..f9f4a6382
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/liblbxutil-1.1.0/mkg3states-1.1.patch
@@ -0,0 +1,55 @@
1diff -uNr liblbxutil-1.1.0.orig/configure.ac liblbxutil-1.1.0/configure.ac
2--- liblbxutil-1.1.0.orig/configure.ac 2009-12-04 23:52:04.000000000 +0100
3+++ liblbxutil-1.1.0/configure.ac 2009-12-16 10:45:00.000000000 +0100
4@@ -50,4 +50,5 @@
5
6 AC_OUTPUT([Makefile
7 src/Makefile
8+ src/image/Makefile
9 lbxutil.pc])
10diff -uNr liblbxutil-1.1.0.orig/src/image/Makefile.am liblbxutil-1.1.0/src/image/Makefile.am
11--- liblbxutil-1.1.0.orig/src/image/Makefile.am 1970-01-01 01:00:00.000000000 +0100
12+++ liblbxutil-1.1.0/src/image/Makefile.am 2009-12-16 10:45:00.000000000 +0100
13@@ -0,0 +1,15 @@
14+# evil hack
15+CFLAGS=$(CFLAGS_FOR_BUILD)
16+CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
17+LDFLAGS=$(LDFLAGS_FOR_BUILD)
18+
19+CC=$(CC_FOR_BUILD)
20+LIBTOOL = @LIBTOOL@ --tag=CC
21+
22+noinst_PROGRAMS = mkg3states
23+
24+mkg3states_SOURCES = \
25+ mkg3states.c
26+
27+mkg3states_CFLAGS=$(CFLAGS_FOR_BUILD)
28+mkg3states_LDFLAGS=$(LDFLAGS_FOR_BUILD)
29diff -uNr liblbxutil-1.1.0.orig/src/Makefile.am liblbxutil-1.1.0/src/Makefile.am
30--- liblbxutil-1.1.0.orig/src/Makefile.am 2009-12-16 10:48:11.000000000 +0100
31+++ liblbxutil-1.1.0/src/Makefile.am 2009-12-16 10:46:47.000000000 +0100
32@@ -3,10 +3,7 @@
33 AM_CFLAGS = $(CWARNFLAGS) $(LBXUTIL_CFLAGS)
34 INCLUDES = -I$(top_srcdir)/include
35
36-noinst_PROGRAMS = mkg3states
37-
38-mkg3states_SOURCES = \
39- $(srcdir)/image/mkg3states.c
40+SUBDIRS = image
41
42 liblbxutil_la_SOURCES = \
43 $(srcdir)/lbx_zlib/reqstats.h \
44@@ -38,9 +35,8 @@
45
46 $(srcdir)/image/dfaxg42d.c: g3states.h
47
48-g3states.h: mkg3states
49- -rm -f g3states.h
50- $(AM_V_GEN) ./mkg3states -c > g3states.h_ && mv g3states.h_ g3states.h
51+g3states.h: image/mkg3states
52+ $(AM_V_GEN) ./image/mkg3states -c > g3states.h_ && mv g3states.h_ g3states.h
53
54 liblbxutil_la_LDFLAGS = -version-number 1:0:0 -no-undefined
55
diff --git a/meta-oe/recipes-graphics/xorg-lib/liblbxutil_1.1.0.bb b/meta-oe/recipes-graphics/xorg-lib/liblbxutil_1.1.0.bb
new file mode 100644
index 000000000..52235866e
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/liblbxutil_1.1.0.bb
@@ -0,0 +1,14 @@
1require xorg-lib-common.inc
2
3LIC_FILES_CHKSUM = "file://COPYING;md5=b0d5bdc98f7ebab3b6c3791d9bf40907"
4
5DESCRIPTION = "XFIXES Extension"
6DEPENDS += " xextproto xproto zlib"
7PE = "1"
8PR = "${INC_PR}.0"
9
10SRC_URI += "file://mkg3states-1.1.patch"
11SRC_URI[md5sum] = "273329a78c2e9ea189ac416c7fde94a1"
12SRC_URI[sha256sum] = "c6b6ff7858ec619cafa8205debca6bf78c5610a2844a782ed643c7fd017cf8ae"
13
14export CC_FOR_BUILD = "gcc"
diff --git a/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/keysymdef_include.patch b/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/keysymdef_include.patch
new file mode 100644
index 000000000..1a30e345f
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/keysymdef_include.patch
@@ -0,0 +1,19 @@
1diff -uNr libX11-1.3.6.orig//configure.ac libX11-1.3.6/configure.ac
2--- libX11-1.3.6.orig//configure.ac 2010-09-20 08:04:16.000000000 +0200
3+++ libX11-1.3.6/configure.ac 2010-09-28 16:29:26.000000000 +0200
4@@ -355,7 +355,14 @@
5 # Find keysymdef.h
6 #
7 AC_MSG_CHECKING([keysym definitions])
8-KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
9+AC_ARG_WITH(keysymdefdir,
10+ AC_HELP_STRING([--with-keysymdefdir=DIR], [The location of keysymdef.h]),
11+ KEYSYMDEFDIR=$withval, KEYSYMDEFDIR="")
12+
13+if test x$KEYSYMDEFDIR = x; then
14+ KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
15+fi
16+
17 FILES="keysymdef.h XF86keysym.h Sunkeysym.h DECkeysym.h HPkeysym.h"
18 for i in $FILES; do
19 if test -f "$KEYSYMDEFDIR/$i"; then
diff --git a/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/x11_disable_makekeys.patch b/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/x11_disable_makekeys.patch
new file mode 100644
index 000000000..976331397
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/x11_disable_makekeys.patch
@@ -0,0 +1,29 @@
1Index: libX11-1.3.4/src/util/Makefile.am
2===================================================================
3--- libX11-1.3.4.orig/src/util/Makefile.am
4+++ libX11-1.3.4/src/util/Makefile.am
5@@ -1,24 +1 @@
6-
7-noinst_PROGRAMS=makekeys
8-
9-makekeys_CFLAGS = \
10- $(X11_CFLAGS) \
11- $(CWARNFLAGS)
12-
13-CC = @CC_FOR_BUILD@
14-CPPFLAGS = @CPPFLAGS_FOR_BUILD@
15-CFLAGS = @CFLAGS_FOR_BUILD@
16-LDFLAGS = @LDFLAGS_FOR_BUILD@
17-
18 EXTRA_DIST = mkks.sh
19-
20-if LINT
21-# Check source code with tools like lint & sparse
22-
23-ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
24- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
25-
26-lint:
27- $(LINT) $(ALL_LINT_FLAGS) makekeys.c
28-
29-endif LINT
diff --git a/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/keysymdef_include.patch b/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/keysymdef_include.patch
new file mode 100644
index 000000000..1a30e345f
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/keysymdef_include.patch
@@ -0,0 +1,19 @@
1diff -uNr libX11-1.3.6.orig//configure.ac libX11-1.3.6/configure.ac
2--- libX11-1.3.6.orig//configure.ac 2010-09-20 08:04:16.000000000 +0200
3+++ libX11-1.3.6/configure.ac 2010-09-28 16:29:26.000000000 +0200
4@@ -355,7 +355,14 @@
5 # Find keysymdef.h
6 #
7 AC_MSG_CHECKING([keysym definitions])
8-KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
9+AC_ARG_WITH(keysymdefdir,
10+ AC_HELP_STRING([--with-keysymdefdir=DIR], [The location of keysymdef.h]),
11+ KEYSYMDEFDIR=$withval, KEYSYMDEFDIR="")
12+
13+if test x$KEYSYMDEFDIR = x; then
14+ KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
15+fi
16+
17 FILES="keysymdef.h XF86keysym.h Sunkeysym.h DECkeysym.h HPkeysym.h"
18 for i in $FILES; do
19 if test -f "$KEYSYMDEFDIR/$i"; then
diff --git a/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/x11_disable_makekeys.patch b/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/x11_disable_makekeys.patch
new file mode 100644
index 000000000..976331397
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/x11_disable_makekeys.patch
@@ -0,0 +1,29 @@
1Index: libX11-1.3.4/src/util/Makefile.am
2===================================================================
3--- libX11-1.3.4.orig/src/util/Makefile.am
4+++ libX11-1.3.4/src/util/Makefile.am
5@@ -1,24 +1 @@
6-
7-noinst_PROGRAMS=makekeys
8-
9-makekeys_CFLAGS = \
10- $(X11_CFLAGS) \
11- $(CWARNFLAGS)
12-
13-CC = @CC_FOR_BUILD@
14-CPPFLAGS = @CPPFLAGS_FOR_BUILD@
15-CFLAGS = @CFLAGS_FOR_BUILD@
16-LDFLAGS = @LDFLAGS_FOR_BUILD@
17-
18 EXTRA_DIST = mkks.sh
19-
20-if LINT
21-# Check source code with tools like lint & sparse
22-
23-ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
24- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
25-
26-lint:
27- $(LINT) $(ALL_LINT_FLAGS) makekeys.c
28-
29-endif LINT
diff --git a/meta-oe/recipes-graphics/xorg-lib/libx11.inc b/meta-oe/recipes-graphics/xorg-lib/libx11.inc
new file mode 100644
index 000000000..d1e646af0
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libx11.inc
@@ -0,0 +1,52 @@
1require xorg-lib-common.inc
2
3DESCRIPTION = "Base X libs."
4COMMON_DEPENDS = "util-macros xtrans libxdmcp libxau \
5 bigreqsproto xproto xextproto xcmiscproto \
6 xf86bigfontproto kbproto inputproto xproto-native"
7
8DEPENDS = "libxcb ${COMMON_DEPENDS}"
9DEPENDS_virtclass-native = "${COMMON_DEPENDS}"
10DEPENDS_virtclass-nativesdk = "${COMMON_DEPENDS}"
11
12FILESPATHPKG .= ":libx11-${PV}:libx11"
13BBCLASSEXTEND = "native nativesdk"
14PROVIDES = "virtual/libx11"
15PE = "1"
16
17PACKAGES =+ "${PN}-xcb"
18
19FILES_${PN} += "${datadir}/X11/XKeysymDB ${datadir}/X11/XErrorDB ${libdir}/X11/Xcms.txt"
20FILES_${PN}-xcb += "${libdir}/libX11-xcb.so.*"
21FILES_${PN}-locale += "${datadir}/X11/locale ${libdir}/X11/locale"
22
23XORG_PN = "libX11"
24
25EXTRA_OECONF += " --with-xcb --with-keysymdefdir=${STAGING_INCDIR}/X11 --with-groff=no --with-ps2pdf=no --with-fop=no"
26EXTRA_OECONF_virtclass-native = " --without-xcb --with-groff=no --with-ps2pdf=no --with-fop=no"
27EXTRA_OECONF_virtclass-nativesdk = " --without-xcb --with-groff=no --with-ps2pdf=no --with-fop=no"
28
29# Below option is added to overcome the GCC bug on ARM
30# see http://gcc.gnu.org/PR42981 for further details.
31# We could potentially take it off when its fixed in gcc 4.5
32
33CFLAGS_append_arm = " -fforward-propagate "
34
35SRC_URI += " file://keysymdef_include.patch \
36 file://x11_disable_makekeys.patch \
37"
38
39do_compile_prepend() {
40 (
41 unset CC LD CXX CCLD CFLAGS CPPFLAGS LDFLAGS CXXFLAGS
42 cd src/util;
43 mv makekeys.c.orig makekeys.c || true
44 # MIN_REHASH 10 is only in 1.0.1
45 sed -i -e 's:MIN_REHASH 10:MIN_REHASH 16:g' makekeys.c
46 sed -i -e 's:MIN_REHASH 15:MIN_REHASH 16:g' makekeys.c
47 touch makekeys-makekeys.o ; ${BUILD_CC} ${BUILD_CFLAGS} -I${STAGING_INCDIR_NATIVE} makekeys.c -o makekeys
48 # mv to stop it getting rebuilt
49 mv makekeys.c makekeys.c.orig
50 cd ../../
51 ) || exit 1
52}
diff --git a/meta-oe/recipes-graphics/xorg-lib/libx11_1.4.1.bb b/meta-oe/recipes-graphics/xorg-lib/libx11_1.4.1.bb
new file mode 100644
index 000000000..a4423305e
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libx11_1.4.1.bb
@@ -0,0 +1,12 @@
1require libx11.inc
2
3LICENSE = "MIT & MIT-style & BSD"
4LIC_FILES_CHKSUM = "file://COPYING;md5=172255dee66bb0151435b2d5d709fcf7"
5
6#--without-xcb is not an option anymore
7#http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=15e5eaf62897b3179d1fbe457cb19f886f0449f8
8DEPENDS_virtclass-native = "libxcb-native ${COMMON_DEPENDS}"
9PR = "${INC_PR}.0"
10
11SRC_URI[md5sum] = "4603bdbce1bd73cbc140de402fe6ed24"
12SRC_URI[sha256sum] = "70f4e0f798645a0f269f362bfdbd4c7934dae3a2dd9ecbad28d6ede414f63ce2"
diff --git a/meta-oe/recipes-graphics/xorg-lib/libx11_1.4.3.bb b/meta-oe/recipes-graphics/xorg-lib/libx11_1.4.3.bb
new file mode 100644
index 000000000..481b90f38
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libx11_1.4.3.bb
@@ -0,0 +1,12 @@
1require libx11.inc
2
3LICENSE = "MIT & MIT-style & BSD"
4LIC_FILES_CHKSUM = "file://COPYING;md5=172255dee66bb0151435b2d5d709fcf7"
5
6#--without-xcb is not an option anymore
7#http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=15e5eaf62897b3179d1fbe457cb19f886f0449f8
8DEPENDS_virtclass-native = "libxcb-native ${COMMON_DEPENDS}"
9PR = "${INC_PR}.0"
10
11SRC_URI[md5sum] = "85e942627aaa020813e0eb8433353563"
12SRC_URI[sha256sum] = "38b5ddd93291714a46a02cb8a5dd94b995a04ed76a608551c44d1598e113635a"
diff --git a/meta-oe/recipes-graphics/xorg-lib/libxaw_1.0.9.bb b/meta-oe/recipes-graphics/xorg-lib/libxaw_1.0.9.bb
new file mode 100644
index 000000000..980de3a30
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libxaw_1.0.9.bb
@@ -0,0 +1,28 @@
1require xorg-lib-common.inc
2DESCRIPTION = "X Athena Widget Set"
3DEPENDS += "xproto virtual/libx11 libxext xextproto libxt libxmu libxpm libxp printproto libxau"
4
5LIC_FILES_CHKSUM = "file://COPYING;md5=f1beacbc336a5a256bb28dbfcf01c2be"
6
7PE = "1"
8PR = "${INC_PR}.0"
9
10SRC_URI[md5sum] = "ccc57478c41b7a75b9702241b889b1d4"
11SRC_URI[sha256sum] = "a83977546b78e24ac5dca86affc10b6404a87c16272405b05386feca1a2db037"
12
13# disable docs as groff detection doesn't work on some hosts while cross compilling
14EXTRA_OECONF += " --disable-docs "
15
16do_install_append () {
17 ln -sf libXaw6.so.6 ${D}${libdir}/libXaw.so.6
18 ln -sf libXaw7.so.7 ${D}${libdir}/libXaw.so.7
19 ln -sf libXaw7.so.7 ${D}${libdir}/libXaw.so
20}
21
22PACKAGES =+ "libxaw6 libxaw7 libxaw8"
23
24FILES_libxaw6 = "${libdir}/libXaw*.so.6*"
25FILES_libxaw7 = "${libdir}/libXaw*.so.7*"
26FILES_libxaw8 = "${libdir}/libXaw8.so.8*"
27
28XORG_PN = "libXaw"
diff --git a/meta-oe/recipes-graphics/xorg-lib/libxfixes_5.0.bb b/meta-oe/recipes-graphics/xorg-lib/libxfixes_5.0.bb
new file mode 100644
index 000000000..4ca1ea284
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libxfixes_5.0.bb
@@ -0,0 +1,22 @@
1SUMMARY = "XFixes: X Fixes extension library."
2
3DESCRIPTION = "X applications have often needed to work around various \
4shortcomings in the core X window system. This extension is designed to \
5provide the minimal server-side support necessary to eliminate problems \
6caused by these workarounds."
7
8require xorg-lib-common.inc
9
10LICENSE = "MIT-style"
11LIC_FILES_CHKSUM = "file://COPYING;md5=3c1ce42c334a6f5cccb0277556a053e0"
12
13DEPENDS += "virtual/libx11 xproto fixesproto xextproto"
14PE = "1"
15PR = "${INC_PR}.0"
16
17SRC_URI[md5sum] = "678071bd7f9f7467e2fc712d81022318"
18SRC_URI[sha256sum] = "537a2446129242737a35db40081be4bbcc126e56c03bf5f2b142b10a79cda2e3"
19
20BBCLASSEXTEND = "native"
21
22XORG_PN = "libXfixes"
diff --git a/meta-oe/recipes-graphics/xorg-lib/libxi_1.4.2.bb b/meta-oe/recipes-graphics/xorg-lib/libxi_1.4.2.bb
new file mode 100644
index 000000000..94299c091
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libxi_1.4.2.bb
@@ -0,0 +1,21 @@
1require xorg-lib-common.inc
2
3SUMMARY = "XI: X Input extension library"
4
5DESCRIPTION = "libxi is an extension to the X11 protocol to support \
6input devices other than the core X keyboard and pointer. It allows \
7client programs to select input from these devices independently from \
8each other and independently from the core devices."
9
10LICENSE = "MIT & MIT-style"
11LIC_FILES_CHKSUM = "file://COPYING;md5=17b064789fab936a1c58c4e13d965b0f \
12 file://src/XIGetDevFocus.c;endline=23;md5=cdfb0d435a33ec57ea0d1e8e395b729f"
13
14DEPENDS += "libxext inputproto"
15PE = "1"
16PR = "${INC_PR}.0"
17
18SRC_URI[md5sum] = "3d14f7bfc4a4335cf0144de9b67a5444"
19SRC_URI[sha256sum] = "272b8041efc0a0203fb0ba33481ddec989539aed862181b58c8c3e410e325691"
20
21XORG_PN = "libXi"
diff --git a/meta-oe/recipes-graphics/xorg-lib/libxkbui_1.0.2.bb b/meta-oe/recipes-graphics/xorg-lib/libxkbui_1.0.2.bb
new file mode 100644
index 000000000..499caf16c
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libxkbui_1.0.2.bb
@@ -0,0 +1,10 @@
1require xorg-lib-common.inc
2DESCRIPTION = "X11 keyboard UI presentation library"
3LICENSE = "GPL"
4LIC_FILES_CHKSUM = "file://COPYING;md5=4641deddaa80fe7ca88e944e1fd94a94"
5DEPENDS += "virtual/libx11 libxt libxkbfile"
6PE = "1"
7PR = "${INC_PR}.0"
8
9SRC_URI[md5sum] = "1143e456f7429e18e88f2eadb2f2b6b1"
10SRC_URI[sha256sum] = "20c23101d63234ee5f6d696dfa069b29c6c58e39eff433bcd7705b50b3ffa214"
diff --git a/meta-oe/recipes-graphics/xorg-lib/libxt_1.1.1.bb b/meta-oe/recipes-graphics/xorg-lib/libxt_1.1.1.bb
new file mode 100644
index 000000000..8c22f62ec
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-lib/libxt_1.1.1.bb
@@ -0,0 +1,37 @@
1require xorg-lib-common.inc
2
3SUMMARY = "Xt: X Toolkit Intrinsics library"
4
5DESCRIPTION = "The Intrinsics are a programming library tailored to the \
6special requirements of user interface construction within a network \
7window system, specifically the X Window System. The Intrinsics and a \
8widget set make up an X Toolkit. The Intrinsics provide the base \
9mechanism necessary to build a wide variety of interoperating widget \
10sets and application environments. The Intrinsics are a layer on top of \
11Xlib, the C Library X Interface. They extend the fundamental \
12abstractions provided by the X Window System while still remaining \
13independent of any particular user interface policy or style."
14
15LICENSE = "MIT & MIT-style"
16LIC_FILES_CHKSUM = "file://COPYING;md5=3239170e81427c5948287df07691f03f"
17
18DEPENDS += "libsm virtual/libx11 kbproto"
19PE = "1"
20PR = "${INC_PR}.0"
21
22SRC_URI[md5sum] = "eb22c0a1f172b06b97a3f5ae89768412"
23SRC_URI[sha256sum] = "a2a1c29c684e3c9082cdb920b5aea802b179d19107b9ab2170fda07575559da7"
24
25EXTRA_OECONF += "--disable-install-makestrs --disable-xkb"
26
27do_compile() {
28 (
29 unset CC LD CXX CCLD
30 oe_runmake -C util 'XT_CFLAGS=' 'CC=${BUILD_CC}' 'LD=${BUILD_LD}' 'CXX=${BUILD_CXX}' 'CCLD=${BUILD_CCLD}' 'CFLAGS=-D_GNU_SOURCE -I${STAGING_INCDIR_NATIVE} ${BUILD_CFLAGS}' 'LDFLAGS=${BUILD_LDFLAGS}' 'CXXFLAGS=${BUILD_CXXFLAGS}' 'CPPFLAGS=${BUILD_CPPFLAGS}' makestrs
31 ) || exit 1
32 oe_runmake
33}
34
35BBCLASSEXTEND = "native"
36
37XORG_PN = "libXt"
diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman_0.20.0.bb b/meta-oe/recipes-graphics/xorg-lib/pixman_0.20.0.bb
index b3fbd4f15..b66bc2a73 100644
--- a/meta-oe/recipes-graphics/xorg-lib/pixman_0.20.0.bb
+++ b/meta-oe/recipes-graphics/xorg-lib/pixman_0.20.0.bb
@@ -1,7 +1,7 @@
1require pixman.inc 1require pixman.inc
2 2
3SRC_URI[archive.md5sum] = "c1a31d5cedfa97c5af7148a2d1fd4356" 3SRC_URI[md5sum] = "c1a31d5cedfa97c5af7148a2d1fd4356"
4SRC_URI[archive.sha256sum] = "9c02c22c6cc3f28f3633d02ef6f0cac130518f621edb011ebbbf08cd1a81251a" 4SRC_URI[sha256sum] = "9c02c22c6cc3f28f3633d02ef6f0cac130518f621edb011ebbbf08cd1a81251a"
5 5
6PR = "${INC_PR}.0" 6PR = "${INC_PR}.0"
7 7
diff --git a/meta-oe/recipes-graphics/xorg-lib/pixman_0.21.4.bb b/meta-oe/recipes-graphics/xorg-lib/pixman_0.21.4.bb
index f0e9e388b..237e4efa6 100644
--- a/meta-oe/recipes-graphics/xorg-lib/pixman_0.21.4.bb
+++ b/meta-oe/recipes-graphics/xorg-lib/pixman_0.21.4.bb
@@ -1,7 +1,7 @@
1require pixman.inc 1require pixman.inc
2 2
3SRC_URI[archive.md5sum] = "e50975ace979cd416a505827c15191b4" 3SRC_URI[md5sum] = "e50975ace979cd416a505827c15191b4"
4SRC_URI[archive.sha256sum] = "57783330ee2f96121dc267b7f25b98356fd09fe9de185cd39e72e906b6444013" 4SRC_URI[sha256sum] = "57783330ee2f96121dc267b7f25b98356fd09fe9de185cd39e72e906b6444013"
5 5
6LICENSE = "MIT & MIT-style & Public Domain" 6LICENSE = "MIT & MIT-style & Public Domain"
7LIC_FILES_CHKSUM = "file://COPYING;md5=14096c769ae0cbb5fcb94ec468be11b3\ 7LIC_FILES_CHKSUM = "file://COPYING;md5=14096c769ae0cbb5fcb94ec468be11b3\
diff --git a/meta-oe/recipes-graphics/xorg-lib/xorg-lib-common.inc b/meta-oe/recipes-graphics/xorg-lib/xorg-lib-common.inc
index 93212c591..2f7337507 100644
--- a/meta-oe/recipes-graphics/xorg-lib/xorg-lib-common.inc
+++ b/meta-oe/recipes-graphics/xorg-lib/xorg-lib-common.inc
@@ -1,6 +1,5 @@
1HOMEPAGE = "http://www.x.org" 1HOMEPAGE = "http://www.x.org"
2BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg" 2BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
3
4SECTION = "x11/libs" 3SECTION = "x11/libs"
5LICENSE = "MIT-X" 4LICENSE = "MIT-X"
6DEPENDS = "util-macros" 5DEPENDS = "util-macros"
diff --git a/meta-oe/recipes-graphics/xorg-proto/fixesproto_5.0.bb b/meta-oe/recipes-graphics/xorg-proto/fixesproto_5.0.bb
new file mode 100644
index 000000000..004813f66
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-proto/fixesproto_5.0.bb
@@ -0,0 +1,21 @@
1require xorg-proto-common.inc
2SUMMARY = "XFixes: X Fixes extension headers"
3
4DESCRIPTION = "This package provides the wire protocol for the X Fixes \
5extension. This extension is designed to provide server-side support \
6for application work arounds to shortcomings in the core X window \
7system."
8
9
10LICENSE = "MIT & MIT-style"
11LIC_FILES_CHKSUM = "file://COPYING;md5=262a7a87da56e66dd639bf7334a110c6 \
12 file://xfixesproto.h;endline=44;md5=3deb31fbde34b96c9f19072b8d854fea"
13
14PE = "1"
15PR = "${INC_PR}.0"
16
17SRC_URI[md5sum] = "e7431ab84d37b2678af71e29355e101d"
18SRC_URI[sha256sum] = "ba2f3f31246bdd3f2a0acf8bd3b09ba99cab965c7fb2c2c92b7dc72870e424ce"
19
20
21CONFLICTS = "fixesext"
diff --git a/meta-oe/recipes-graphics/xorg-proto/xextproto_7.2.0.bb b/meta-oe/recipes-graphics/xorg-proto/xextproto_7.2.0.bb
new file mode 100644
index 000000000..9272ac1ff
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-proto/xextproto_7.2.0.bb
@@ -0,0 +1,19 @@
1require xorg-proto-common.inc
2SUMMARY = "XExt: X Extension headers"
3
4DESCRIPTION = "This package provides the wire protocol for several X \
5extensions. These protocol extensions include DOUBLE-BUFFER, DPMS, \
6Extended-Visual-Information, LBX, MIT_SHM, MIT_SUNDRY-NONSTANDARD, \
7Multi-Buffering, SECURITY, SHAPE, SYNC, TOG-CUP, XC-APPGROUP, XC-MISC, \
8XTEST. In addition a small set of utility functions are also \
9available."
10
11LICENSE = "MIT & MIT-style"
12LIC_FILES_CHKSUM = "file://COPYING;md5=86f273291759d0ba2a22585cd1c06c53"
13
14PE = "1"
15PR = "${INC_PR}.0"
16
17SRC_URI[md5sum] = "220732210ceffb01bf1caf970e3b1bfb"
18SRC_URI[sha256sum] = "d2bc4208c6b1883ebe00bc5c0048e5d825038cda56775f74bb4aa89afdc576d5"
19
diff --git a/meta-oe/recipes-graphics/xorg-proto/xorg-proto-common.inc b/meta-oe/recipes-graphics/xorg-proto/xorg-proto-common.inc
index 3e7c701c7..dc6fedf16 100644
--- a/meta-oe/recipes-graphics/xorg-proto/xorg-proto-common.inc
+++ b/meta-oe/recipes-graphics/xorg-proto/xorg-proto-common.inc
@@ -1,5 +1,6 @@
1DESCRIPTION = "X protocol headers: ${BPN}" 1DESCRIPTION = "X protocol headers: ${BPN}"
2HOMEPAGE = "http://www.x.org" 2HOMEPAGE = "http://www.x.org"
3BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
3SECTION = "x11/libs" 4SECTION = "x11/libs"
4LICENSE = "MIT-X" 5LICENSE = "MIT-X"
5 6
@@ -9,9 +10,10 @@ ALLOW_EMPTY = "1"
9 10
10INC_PR = "r2" 11INC_PR = "r2"
11 12
12SRC_URI = "${XORG_MIRROR}/individual/proto/${BPN}-${PV}.tar.bz2;name=archive" 13SRC_URI = "${XORG_MIRROR}/individual/proto/${BPN}-${PV}.tar.bz2"
13 14
14S = "${WORKDIR}/${BPN}-${PV}" 15S = "${WORKDIR}/${BPN}-${PV}"
15 16
16inherit autotools pkgconfig 17inherit autotools pkgconfig
17 18
19BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-oe/recipes-graphics/xorg-proto/xproto_7.0.21.bb b/meta-oe/recipes-graphics/xorg-proto/xproto_7.0.21.bb
new file mode 100644
index 000000000..2bc95097d
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-proto/xproto_7.0.21.bb
@@ -0,0 +1,16 @@
1require xorg-proto-common.inc
2
3SUMMARY = "Xlib: C Language X interface headers"
4
5DESCRIPTION = "This package provides the basic headers for the X Window \
6System."
7
8LICENSE = "MIT & MIT-style"
9LIC_FILES_CHKSUM = "file://COPYING;md5=b9e051107d5628966739a0b2e9b32676"
10
11PE = "1"
12PR = "${INC_PR}.0"
13
14SRC_URI[md5sum] = "c5a93a69b701cf81925fab02b35b0d0e"
15SRC_URI[sha256sum] = "38ee2f032c3a9e30504593f8b5e6c1161a6629daba93748a71c6f70c16f65548"
16
diff --git a/meta-oe/recipes-graphics/xorg-util/util-macros_1.13.0.bb b/meta-oe/recipes-graphics/xorg-util/util-macros_1.13.0.bb
new file mode 100644
index 000000000..3f4471aee
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-util/util-macros_1.13.0.bb
@@ -0,0 +1,15 @@
1require xorg-util-common.inc
2
3DESCRIPTION = "X autotools macros"
4PE = "1"
5
6LICENSE = "MIT & MIT-style"
7LIC_FILES_CHKSUM = "file://COPYING;md5=1970511fddd439b07a6ba789d28ff662"
8
9ALLOW_EMPTY = "1"
10BBCLASSEXTEND = "native nativesdk"
11
12PR = "${INC_PR}.0"
13
14SRC_URI[md5sum] = "31e9ddcbc1d8bc8c09ab180443974dd1"
15SRC_URI[sha256sum] = "7bff944fb120192e7fe1706e9c0b7e41666e7983ce3e2bdef0b7734392d9e695"
diff --git a/meta-oe/recipes-graphics/xorg-util/xorg-util-common.inc b/meta-oe/recipes-graphics/xorg-util/xorg-util-common.inc
new file mode 100644
index 000000000..e5c8ce930
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-util/xorg-util-common.inc
@@ -0,0 +1,11 @@
1HOMEPAGE = "http://www.x.org"
2SECTION = "x11/utils"
3LICENSE = "MIT-X"
4
5INC_PR = "r2"
6
7SRC_URI = "${XORG_MIRROR}/individual/util/${BPN}-${PV}.tar.gz"
8
9S = "${WORKDIR}/${BPN}-${PV}"
10
11inherit autotools pkgconfig
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xorg-xserver-common.inc b/meta-oe/recipes-graphics/xorg-xserver/xorg-xserver-common.inc
new file mode 100644
index 000000000..79f13fc13
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xorg-xserver-common.inc
@@ -0,0 +1,112 @@
1HOMEPAGE = "http://www.x.org"
2SECTION = "x11/base"
3LICENSE = "MIT-X"
4LIC_FILES_CHKSUM = "file://COPYING;md5=3dd2bbe3563837f80ed8926b06c1c353"
5
6INC_PR = "r18"
7
8PROVIDES = "virtual/xserver"
9
10# Config manager for xserver, options are: hal, udev, empty (for configuration in xorg.conf)
11DISTRO_XORG_CONFIG_MANAGER ?= "hal"
12DISTRO_XORG_CONFIG_MANAGER_shr ?= "udev"
13
14# default none, enabled by DISTRO_XORG_CONFIG_MANAGER setting
15CONFIG_MANAGER_OPTION += "${@['--disable-config-hal','--enable-config-hal',''][bb.data.getVar('DISTRO_XORG_CONFIG_MANAGER',d) in ['hal']]}"
16CONFIG_MANAGER_OPTION += "${@['--disable-config-udev','--enable-config-udev',''][bb.data.getVar('DISTRO_XORG_CONFIG_MANAGER',d) in ['udev']]}"
17
18DEPENDS = "fontconfig freetype flex-native liblbxutil kbproto \
19xf86driproto drm glproto randrproto renderproto fixesproto damageproto \
20xcmiscproto xextproto xproto xf86miscproto xf86vidmodeproto xf86bigfontproto \
21scrnsaverproto bigreqsproto resourceproto fontsproto inputproto \
22xf86dgaproto videoproto compositeproto trapproto recordproto dmxproto \
23resourceproto xineramaproto xtrans evieext libxkbfile libxfont libxau \
24libfontenc libxdmcp libxxf86vm libxaw libxmu libxt libxpm libxext libx11 \
25libxkbui libxxf86misc libxi libdmx libxtst libxres virtual/libgl libxcalibrate \
26libxv ${DISTRO_XORG_CONFIG_MANAGER}"
27
28RRECOMMENDS_${PN} = "libpciaccess"
29
30XORG_PN = "xorg-server"
31SRC_URI = "${XORG_MIRROR}/individual/xserver/${XORG_PN}-${PV}.tar.bz2"
32
33S = "${WORKDIR}/${XORG_PN}-${PV}"
34
35inherit autotools pkgconfig glx-use-tls
36
37EXTRA_OECONF += " --enable-xcalibrate \
38 --enable-kdrive \
39 --enable-xephyr \
40 --disable-xfbdev \
41 --disable-xnest \
42 --disable-kdrive-vesa \
43 --with-default-font-path="/usr/share/fonts/X11/misc" \
44 ac_cv_file__usr_share_sgml_X11_defs_ent=no"
45
46# CONFIG_MANAGER_OPTION is used only in recipes which support those options
47
48EXTRA_OECONF_append_arm = " ac_cv_header_linux_apm_bios_h=no "
49
50PACKAGES =+ "xserver-security-policy"
51FILES_xserver-security-policy += "${libdir}/xserver/SecurityPolicy"
52RRECOMMENDS_${PN} += "xserver-security-policy xkeyboard-config rgb xserver-xorg-conf"
53
54PACKAGES =+ "${PN}-sdl ${PN}-fbdev ${PN}-xprint ${PN}-xvfb ${PN}-utils ${PN}-xephyr"
55
56RDEPENDS_${PN}-xvfb += "xkeyboard-config"
57
58FILES_${PN}-fbdev = "${bindir}/Xfbdev"
59FILES_${PN}-sdl = "${bindir}/Xsdl"
60FILES_${PN}-xprint = "${libdir}/X11/xserver/*/print"
61FILES_${PN}-xvfb = "${bindir}/Xvfb"
62FILES_${PN}-utils = "${bindir}/scanpci ${bindir}/pcitweak ${bindir}/ioport ${bindir}/in[bwl] ${bindir}/out[bwl] ${bindir}/mmap[rw] ${bindir}/gtf ${bindir}/getconfig ${bindir}/getconfig.pl"
63FILES_${PN} = "${bindir} ${libdir}/X11/Options ${libdir}/X11/Cards ${libdir}/X11/getconfig ${libdir}/X11/etc ${libdir}/modules ${libdir}/xorg/modules /etc/X11 ${libdir}/xorg/protocol.txt ${datadir}/X11/xorg.conf.d"
64FILES_${PN}-doc += "${libdir}/X11/doc /usr/share/X11/xkb/compiled/README.compiled"
65FILES_${PN}-xephyr = "${bindir}/Xephyr"
66
67FILES_${PN}-dbg += "${libdir}/xorg/modules/.debug \
68 ${libdir}/xorg/modules/*/.debug \
69 ${libdir}/xorg/modules/*/*/.debug \
70 "
71
72# Split out some modules and extensions from the main package
73# These aren't needed for basic operations and only take up space:
74# 32.0k libdri.so
75# 336.0k libglx.so
76# 1360k libint10.so
77# 180.0k libwfb.so
78# 320.0k libxaa.so
79# 124.0k libxf1bpp.so
80# 84.0k libxf4bpp.so
81
82PACKAGES =+ "${PN}-extension-dri \
83 ${PN}-extension-dri2 \
84 ${PN}-extension-glx \
85 ${PN}-module-libint10 \
86 ${PN}-module-libafb \
87 ${PN}-module-libwfb \
88 ${PN}-module-libmfb \
89 ${PN}-module-libcfb \
90 ${PN}-module-xaa \
91 ${PN}-module-libxf1bpp \
92 ${PN}-module-libxf4bpp"
93
94FILES_${PN}-extension-dri = "${libdir}/xorg/modules/extensions/libdri.so"
95FILES_${PN}-extension-dri2 = "${libdir}/xorg/modules/extensions/libdri2.so"
96FILES_${PN}-extension-glx = "${libdir}/xorg/modules/extensions/libglx.so"
97FILES_${PN}-module-libint10 = "${libdir}/xorg/modules/libint10.so"
98FILES_${PN}-module-libafb = "${libdir}/xorg/modules/libafb.so"
99FILES_${PN}-module-libwfb = "${libdir}/xorg/modules/libwfb.so"
100FILES_${PN}-module-libmfb = "${libdir}/xorg/modules/libmfb.so"
101FILES_${PN}-module-libcfb = "${libdir}/xorg/modules/libcfb.so"
102FILES_${PN}-module-xaa = "${libdir}/xorg/modules/libxaa.so"
103FILES_${PN}-module-libxf1bpp = "${libdir}/xorg/modules/libxf1bpp.so"
104FILES_${PN}-module-libxf4bpp = "${libdir}/xorg/modules/libxf4bpp.so"
105
106PACKAGES =+ "${PN}-multimedia-modules"
107
108FILES_${PN}-multimedia-modules = "${libdir}/xorg/modules/multimedia/*drv*"
109
110do_install_append () {
111 ln -sf ${datadir}/fonts/X11 ${D}/${libdir}/X11/fonts
112}
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.10.0.901/hack-assume-pixman-supports-overlapped-blt.patch b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.10.0.901/hack-assume-pixman-supports-overlapped-blt.patch
new file mode 100644
index 000000000..a947582f1
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.10.0.901/hack-assume-pixman-supports-overlapped-blt.patch
@@ -0,0 +1,14 @@
1diff --git a/fb/fbcopy.c b/fb/fbcopy.c
2index 07eb663..ba394b7 100644
3--- a/fb/fbcopy.c
4+++ b/fb/fbcopy.c
5@@ -91,8 +91,7 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
6 while (nbox--)
7 {
8 #ifndef FB_ACCESS_WRAPPER /* pixman_blt() doesn't support accessors yet */
9- if (pm == FB_ALLONES && alu == GXcopy && !reverse &&
10- !upsidedown)
11+ if (pm == FB_ALLONES && alu == GXcopy)
12 {
13 if (!pixman_blt ((uint32_t *)src, (uint32_t *)dst, srcStride, dstStride, srcBpp, dstBpp,
14 (pbox->x1 + dx + srcXoff),
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.10.0.901/hack-fbdev-ignore-return-mode.patch b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.10.0.901/hack-fbdev-ignore-return-mode.patch
new file mode 100644
index 000000000..d3661cbea
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.10.0.901/hack-fbdev-ignore-return-mode.patch
@@ -0,0 +1,39 @@
1Ugly hack that prevents server termination with xf86-video-fbdev-0.4.1
2(and probably other) while returning from chvt or resume on some
3hardware (e. g. zaurus).
4
5Correct fix would require debugging of fbdev mode during LeaveVT and
6EnterVT.
7
8This patch may cause staying in incorrect or corrupted display mode
9after EnterVT, but on man affected devices it does not cause any visible
10problems.
11
12Hacked code is never called on properly written drivers.
13
14Devices affected and testers involved for future patch removal:
15Sharp Zaurus (spitz/akita): Stanislav Brabec <utx@penguin.cz>
16
17See also:
18https://bugzilla.redhat.com/show_bug.cgi?id=238451
19
20The bug (first line indicates that your device is affected):
21
22(EE) FBDEV(0): FBIOPUT_VSCREENINFO succeeded but modified mode
23
24Fatal server error:
25EnterVT failed for screen 0
26
27Index: xorg-server-1.7.3/hw/xfree86/fbdevhw/fbdevhw.c
28===================================================================
29--- xorg-server-1.7.3.orig/hw/xfree86/fbdevhw/fbdevhw.c
30+++ xorg-server-1.7.3/hw/xfree86/fbdevhw/fbdevhw.c
31@@ -571,7 +571,7 @@ fbdevHWSetMode(ScrnInfoPtr pScrn, Displa
32 #if DEBUG
33 print_fbdev_mode("returned", &set_var);
34 #endif
35- return FALSE;
36+ /* return FALSE; UGLY HACK to allow return from chvt */
37 }
38
39 if (!check)
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/dolt-fix.patch b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/dolt-fix.patch
new file mode 100644
index 000000000..e332ce0bb
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/dolt-fix.patch
@@ -0,0 +1,22 @@
1Index: xorg-server/m4/dolt.m4
2===================================================================
3--- xorg-server.orig/m4/dolt.m4 2009-04-14 21:14:56.000000000 +0400
4+++ xorg-server/m4/dolt.m4 2009-07-15 12:38:33.796848843 +0400
5@@ -147,7 +147,7 @@
6 cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
7 #!$DOLT_BASH
8 __DOLTLIBTOOL__EOF__
9- cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
10+ cat <<'__DOLTLIBTOOL__EOF__' | sed -e "s/@host_alias@/$host_alias/g" >>doltlibtool
11 top_builddir_slash="${0%%doltlibtool}"
12 : ${top_builddir_slash:=./}
13 args=()
14@@ -163,7 +163,7 @@
15 if $modeok && $tagok ; then
16 . ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
17 else
18- exec ${top_builddir_slash}libtool "$[]@"
19+ exec ${top_builddir_slash}@host_alias@-libtool "$[]@"
20 fi
21 __DOLTLIBTOOL__EOF__
22
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/hack-assume-pixman-supports-overlapped-blt.patch b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/hack-assume-pixman-supports-overlapped-blt.patch
new file mode 100644
index 000000000..a947582f1
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/hack-assume-pixman-supports-overlapped-blt.patch
@@ -0,0 +1,14 @@
1diff --git a/fb/fbcopy.c b/fb/fbcopy.c
2index 07eb663..ba394b7 100644
3--- a/fb/fbcopy.c
4+++ b/fb/fbcopy.c
5@@ -91,8 +91,7 @@ fbCopyNtoN (DrawablePtr pSrcDrawable,
6 while (nbox--)
7 {
8 #ifndef FB_ACCESS_WRAPPER /* pixman_blt() doesn't support accessors yet */
9- if (pm == FB_ALLONES && alu == GXcopy && !reverse &&
10- !upsidedown)
11+ if (pm == FB_ALLONES && alu == GXcopy)
12 {
13 if (!pixman_blt ((uint32_t *)src, (uint32_t *)dst, srcStride, dstStride, srcBpp, dstBpp,
14 (pbox->x1 + dx + srcXoff),
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/hack-fbdev-ignore-return-mode.patch b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/hack-fbdev-ignore-return-mode.patch
new file mode 100644
index 000000000..d3661cbea
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/hack-fbdev-ignore-return-mode.patch
@@ -0,0 +1,39 @@
1Ugly hack that prevents server termination with xf86-video-fbdev-0.4.1
2(and probably other) while returning from chvt or resume on some
3hardware (e. g. zaurus).
4
5Correct fix would require debugging of fbdev mode during LeaveVT and
6EnterVT.
7
8This patch may cause staying in incorrect or corrupted display mode
9after EnterVT, but on man affected devices it does not cause any visible
10problems.
11
12Hacked code is never called on properly written drivers.
13
14Devices affected and testers involved for future patch removal:
15Sharp Zaurus (spitz/akita): Stanislav Brabec <utx@penguin.cz>
16
17See also:
18https://bugzilla.redhat.com/show_bug.cgi?id=238451
19
20The bug (first line indicates that your device is affected):
21
22(EE) FBDEV(0): FBIOPUT_VSCREENINFO succeeded but modified mode
23
24Fatal server error:
25EnterVT failed for screen 0
26
27Index: xorg-server-1.7.3/hw/xfree86/fbdevhw/fbdevhw.c
28===================================================================
29--- xorg-server-1.7.3.orig/hw/xfree86/fbdevhw/fbdevhw.c
30+++ xorg-server-1.7.3/hw/xfree86/fbdevhw/fbdevhw.c
31@@ -571,7 +571,7 @@ fbdevHWSetMode(ScrnInfoPtr pScrn, Displa
32 #if DEBUG
33 print_fbdev_mode("returned", &set_var);
34 #endif
35- return FALSE;
36+ /* return FALSE; UGLY HACK to allow return from chvt */
37 }
38
39 if (!check)
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/randr-support.patch b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/randr-support.patch
new file mode 100644
index 000000000..abc7db41e
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-1.9.4/randr-support.patch
@@ -0,0 +1,102 @@
1diff -uNr xorg-server-1.9.0.orig//hw/xfree86/common/xf86Xinput.c xorg-server-1.9.0/hw/xfree86/common/xf86Xinput.c
2--- xorg-server-1.9.0.orig//hw/xfree86/common/xf86Xinput.c 2010-08-13 07:53:48.000000000 +0200
3+++ xorg-server-1.9.0/hw/xfree86/common/xf86Xinput.c 2010-08-28 21:31:10.000000000 +0200
4@@ -106,6 +106,8 @@
5
6 #include "os.h"
7
8+#define RR_Rotate_All (RR_Rotate_0|RR_Rotate_90|RR_Rotate_180|RR_Rotate_270)
9+
10 EventListPtr xf86Events = NULL;
11
12 /**
13@@ -1359,4 +1361,73 @@
14 EnableDevice(dev, TRUE);
15 }
16
17+/* Taken from evdev-properties.h. */
18+#define EVDEV_PROP_SWAP_AXES "Evdev Axes Swap"
19+#define EVDEV_PROP_INVERT_AXES "Evdev Axis Inversion"
20+
21+/* This is a hack until we get device -> CRTC association. */
22+void
23+xf86InputRotationNotify(Rotation rotation)
24+{
25+ DeviceIntPtr dev;
26+ LocalDevicePtr local;
27+ int ret;
28+ int swap_axes = 0;
29+ CARD8 invert[2] = { 0, 0 };
30+ static Atom prop_swap = 0, prop_invert = 0;
31+ static int atom_generation = -1;
32+
33+ if (atom_generation != serverGeneration) {
34+ prop_swap = 0;
35+ prop_invert = 0;
36+ }
37+
38+ switch (rotation & RR_Rotate_All) {
39+ case RR_Rotate_0:
40+ swap_axes = 1;
41+ invert[0] = 0;
42+ invert[1] = 0;
43+ break;
44+ case RR_Rotate_90:
45+ swap_axes = 0;
46+ invert[0] = 0;
47+ invert[1] = 1;
48+ break;
49+ case RR_Rotate_180:
50+ swap_axes = 1;
51+ invert[0] = 0;
52+ invert[1] = 0;
53+ break;
54+ case RR_Rotate_270:
55+ swap_axes = 0;
56+ invert[0] = 0;
57+ invert[1] = 1;
58+ break;
59+ }
60+
61+ if (!prop_swap)
62+ prop_swap = MakeAtom(EVDEV_PROP_SWAP_AXES,
63+ strlen(EVDEV_PROP_SWAP_AXES), TRUE);
64+ if (!prop_invert)
65+ prop_invert = MakeAtom(EVDEV_PROP_INVERT_AXES,
66+ strlen(EVDEV_PROP_INVERT_AXES), TRUE);
67+
68+ for (dev = inputInfo.devices; dev; dev = dev->next) {
69+ local = dev->public.devicePrivate;
70+ ret = XIChangeDeviceProperty(dev, prop_swap, XA_INTEGER, 8,
71+ PropModeReplace, 1, &swap_axes, FALSE);
72+ if (ret != Success) {
73+ xf86Msg(X_ERROR, "Changing swap_xy property failed!\n");
74+ continue;
75+ }
76+ ret = XIChangeDeviceProperty(dev, prop_invert, XA_INTEGER, 8,
77+ PropModeReplace, 2, invert, FALSE);
78+ if (ret != Success) {
79+ xf86Msg(X_ERROR, "Changing invert property failed!\n");
80+ continue;
81+ }
82+ }
83+}
84+
85+
86 /* end of xf86Xinput.c */
87diff -uNr xorg-server-1.9.0.orig//hw/xfree86/modes/xf86Crtc.c xorg-server-1.9.0/hw/xfree86/modes/xf86Crtc.c
88--- xorg-server-1.9.0.orig//hw/xfree86/modes/xf86Crtc.c 2010-07-20 05:24:12.000000000 +0200
89+++ xorg-server-1.9.0/hw/xfree86/modes/xf86Crtc.c 2010-08-28 21:28:48.000000000 +0200
90@@ -387,6 +387,12 @@
91 if (didLock)
92 crtc->funcs->unlock (crtc);
93
94+ /*
95+ * Rotate Touchscreen
96+ */
97+ xf86InputRotationNotify(crtc->rotation);
98+
99+
100 return ret;
101 }
102
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/am3517-evm/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/am3517-evm/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/am3517-evm/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/am37x-evm/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/am37x-evm/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/am37x-evm/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/archos5/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/archos5/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/archos5/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/archos5it/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/archos5it/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/archos5it/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/at91sam9263ek/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/at91sam9263ek/xorg.conf
new file mode 100644
index 000000000..7f3eb7797
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/at91sam9263ek/xorg.conf
@@ -0,0 +1,11 @@
1Section "ServerLayout"
2 Identifier "default"
3 InputDevice "atmel-ts" "CorePointer"
4EndSection
5
6Section "InputDevice"
7 Identifier "atmel-ts"
8 Driver "evdev"
9 Option "SwapAxes" "1"
10 Option "Device" "/dev/input/touchscreen0"
11EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/at91sam9g45ek/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/at91sam9g45ek/xorg.conf
new file mode 100644
index 000000000..0502f8737
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/at91sam9g45ek/xorg.conf
@@ -0,0 +1,23 @@
1Section "ServerLayout"
2 Identifier "default"
3 InputDevice "atmel-tsadcc" "CorePointer"
4EndSection
5
6Section "InputDevice"
7 Identifier "atmel-tsadcc"
8 Driver "evdev"
9 Option "Device" "/dev/input/touchscreen0"
10EndSection
11
12Section "InputDevice"
13 Driver "mouse"
14 Identifier "Mouse[1]"
15 Option "Buttons" "10"
16 Option "Device" "/dev/input/mice"
17EndSection
18
19Section "InputDevice"
20 Driver "kbd"
21 Identifier "Keyboard[0]"
22 Option "Protocol" "Standard"
23EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/babbage/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/babbage/xorg.conf
new file mode 100644
index 000000000..d4d41db42
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/babbage/xorg.conf
@@ -0,0 +1,56 @@
1#
2# X11 configuration for i.MX51 Babbage EVK
3# Based on pm9263 by Koan sas
4#
5
6Section "Monitor"
7 Identifier "Display"
8EndSection
9
10Section "Device"
11 Identifier "fbdevice"
12 Driver "fbdev"
13 Option "fbdev" "/dev/fb0"
14 Option "shadowfb" "true"
15EndSection
16
17Section "Screen"
18 Identifier "fbscreen"
19 Device "fbdevice"
20 Monitor "Display"
21EndSection
22
23Section "InputDevice"
24 Identifier "mxc_ts"
25 Driver "evdev"
26 Option "SwapAxes" "0"
27 Option "Device" "/dev/input/touchscreen0"
28EndSection
29
30Section "InputDevice"
31 Identifier "Generic Mouse"
32 Driver "mouse"
33 Option "CorePointer"
34EndSection
35
36Section "InputDevice"
37 Identifier "Keypad"
38 Driver "evdev"
39 Option "Device" "/dev/input/event0"
40# Option "XkbModel" "nokiarx51"
41# Option "XkbLayout" "us"
42EndSection
43
44Section "ServerLayout"
45 Identifier "Layout"
46 Screen "fbscreen"
47 InputDevice "mxc_ts" "CorePointer"
48 InputDevice "Keypad"
49# Enable mouse only if necessary, it may interfere with touchscreen behaviour
50# InputDevice "Generic Mouse"
51EndSection
52
53#Section "ServerFlags"
54# Option "AutoAddDevices" "false"
55#EndSection
56
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/beagleboard/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/beagleboard/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/beagleboard/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/bug/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/bug/xorg.conf
new file mode 100644
index 000000000..cf684ec17
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/bug/xorg.conf
@@ -0,0 +1,75 @@
1#
2# Initial version of X11 configuration for BugLabs BUG device.
3#
4# Up to 2 LCD modules are supported (as DISPLAY=0.0/0.1).
5# Touchscreen on both screen works properly (req tslib 0.0.6 driver).
6#
7# Mouse is not supported yet because the evdev driver need a precise
8# dev node and evdev dev nodes are somewhat random
9#
10
11Section "Monitor"
12 Identifier "Monitor 1"
13EndSection
14
15Section "Monitor"
16 Identifier "Monitor 2"
17EndSection
18
19Section "Device"
20 Identifier "fbdev Device 2"
21 Driver "fbdev"
22 Option "fbdev" "/dev/fb2"
23 Option "shadowfb" "true"
24EndSection
25
26Section "Device"
27 Identifier "fbdev Device 1"
28 Driver "fbdev"
29 Option "fbdev" "/dev/fb1"
30 Option "shadowfb" "true"
31EndSection
32
33Section "Screen"
34 Identifier "fbdev Screen 2"
35 Device "fbdev Device 2"
36 Monitor "Monitor 2"
37EndSection
38
39Section "Screen"
40 Identifier "fbdev Screen 1"
41 Device "fbdev Device 1"
42 Monitor "Monitor 1"
43EndSection
44
45Section "ServerLayout"
46 Identifier "Layout"
47 Screen "fbdev Screen 1"
48 Screen "fbdev Screen 2" Below "fbdev Screen 1"
49 InputDevice "ts4"
50 InputDevice "ts5"
51 InputDevice "Keyboard"
52EndSection
53
54Section "InputDevice"
55 Identifier "ts5"
56 Driver "tslib"
57 Option "Device" "/dev/input/bmi_lcd_ts5"
58 Option "ScreenNumber" "1"
59EndSection
60
61Section "InputDevice"
62 Identifier "ts4"
63 Driver "tslib"
64 Option "Device" "/dev/input/bmi_lcd_ts4"
65 Option "ScreenNumber" "0"
66EndSection
67
68Section "InputDevice"
69 Identifier "Keyboard"
70 Driver "kbd"
71EndSection
72
73Section "ServerFlags"
74 Option "AutoAddDevices" "false"
75EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/bug20/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/bug20/xorg.conf
new file mode 100644
index 000000000..6301d0690
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/bug20/xorg.conf
@@ -0,0 +1,37 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6# Load "type1"
7# Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29 InputDevice "bmi-lcd-ts" "CorePointer"
30EndSection
31
32Section "InputDevice"
33 Identifier "bmi-lcd-ts"
34 Driver "tslib"
35 Option "SwapAxes" "1"
36 Option "Device" "/dev/input/touchscreen0"
37EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/cm-t35/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/cm-t35/xorg.conf
new file mode 100644
index 000000000..07d849d70
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/cm-t35/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/dm37x-evm/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/dm37x-evm/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/dm37x-evm/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/eee701/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/eee701/xorg.conf
new file mode 100644
index 000000000..4ee293b79
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/eee701/xorg.conf
@@ -0,0 +1,97 @@
1Section "ServerLayout"
2 Identifier "X.org Configured"
3 Screen 0 "Screen0" 0 0
4 InputDevice "Touchpad"
5 InputDevice "Keyboard"
6 InputDevice "Mouse"
7 Option "AllowEmptyInput" "false"
8EndSection
9
10Section "Files"
11 ModulePath "/usr/lib/xorg/modules"
12 FontPath "/usr/share/fonts/X11/misc"
13EndSection
14
15Section "Module"
16 Load "dbe"
17 Load "extmod"
18EndSection
19
20Section "InputDevice"
21 Identifier "Keyboard"
22 Driver "kbd"
23 Option "CoreKeyboard"
24EndSection
25
26Section "InputDevice"
27 Identifier "Touchpad"
28 Driver "synaptics"
29 Option "TapButton1" "1"
30 Option "CorePointer"
31EndSection
32
33Section "InputDevice"
34 Identifier "Mouse"
35 Driver "mouse"
36 Option "Protocol" "Auto"
37EndSection
38
39
40Section "Monitor"
41 Identifier "Monitor0"
42 VendorName "Monitor Vendor"
43 ModelName "Monitor Model"
44EndSection
45
46Section "Device"
47 ### Available Driver options are:-
48 ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
49 ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
50 ### [arg]: arg optional
51 #Option "NoAccel" # [<bool>]
52 #Option "SWcursor" # [<bool>]
53 #Option "ColorKey" # <i>
54 #Option "CacheLines" # <i>
55 #Option "Dac6Bit" # [<bool>]
56 #Option "DRI" # [<bool>]
57 #Option "NoDDC" # [<bool>]
58 #Option "ShowCache" # [<bool>]
59 #Option "XvMCSurfaces" # <i>
60 #Option "PageFlip" # [<bool>]
61 Identifier "Card0"
62 Driver "intel"
63 VendorName "Unknown Vendor"
64 BoardName "Unknown Board"
65 BusID "PCI:0:2:0"
66EndSection
67
68Section "Screen"
69 Identifier "Screen0"
70 Device "Card0"
71 Monitor "Monitor0"
72 SubSection "Display"
73 Viewport 0 0
74 Depth 1
75 EndSubSection
76 SubSection "Display"
77 Viewport 0 0
78 Depth 4
79 EndSubSection
80 SubSection "Display"
81 Viewport 0 0
82 Depth 8
83 EndSubSection
84 SubSection "Display"
85 Viewport 0 0
86 Depth 15
87 EndSubSection
88 SubSection "Display"
89 Viewport 0 0
90 Depth 16
91 EndSubSection
92 SubSection "Display"
93 Viewport 0 0
94 Depth 24
95 EndSubSection
96EndSection
97
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/htcdream/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/htcdream/xorg.conf
new file mode 100644
index 000000000..be3c6ec54
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/htcdream/xorg.conf
@@ -0,0 +1,69 @@
1Section "Monitor"
2 Identifier "Monitor0"
3 Mode "320x480"
4 DotClock 0
5 HTimings 320 320 320 320
6 VTimings 480 480 480 480
7 Flags "-HSync" "-VSync"
8 EndMode
9EndSection
10
11Section "Device"
12 Identifier "fbdev"
13 Driver "fbdev"
14 Option "ShadowFB" "on"
15 Option "Rotate" "CW" # comment for disabling rotation
16EndSection
17
18Section "Screen"
19 Identifier "Framebuffer"
20 Device "fbdev"
21 Monitor "Monitor0"
22 DefaultFbBpp 16
23 SubSection "Display"
24 Depth 16
25 Modes "320x480"
26 EndSubSection
27EndSection
28
29
30Section "ServerLayout"
31 Identifier "Builtin Default Layout"
32 Screen "Framebuffer"
33 InputDevice "Trackball"
34 InputDevice "Touchscreen"
35 InputDevice "Keyboard"
36EndSection
37
38Section "InputDevice"
39 Identifier "Trackball"
40 Driver "evdev"
41 Option "Device" "/dev/input/event2"
42 Option "ScreenNumber" "0"
43 Option "ReportingMode" "Raw"
44 Option "SwapAxes" "True" # comment for disabling rotation
45 Option "InvertY" "True" # comment for disabling rotation
46EndSection
47
48
49Section "InputDevice"
50 Identifier "Touchscreen"
51 Driver "evdev"
52 Option "Device" "/dev/input/event1"
53 Option "SwapAxes" "True" # comment for disabling rotation
54 Option "InvertY" "True" # comment for disabling rotation
55 Option "ReportingMode" "Raw"
56EndSection
57
58Section "InputDevice"
59 Identifier "Keyboard"
60 Driver "kbd"
61 Option "XkbLayout" "us"
62 Option "XkbModel" "htcdream"
63EndSection
64
65
66Section "ServerFlags"
67 Option "AutoAddDevices" "false"
68EndSection
69
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/htcleo/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/htcleo/xorg.conf
new file mode 100644
index 000000000..4153a2628
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/htcleo/xorg.conf
@@ -0,0 +1,73 @@
1Section "Monitor"
2 Identifier "Monitor0"
3 Mode "480x800"
4 DotClock 0
5 HTimings 480 480 480 480
6 VTimings 800 800 800 800
7 Flags "-HSync" "-VSync"
8 EndMode
9EndSection
10
11
12
13Section "Device"
14 Identifier "fbdev"
15 Driver "fbdev"
16 Option "ShadowFB" "on"
17 #Option "Rotate" "CW"
18EndSection
19
20
21Section "Screen"
22 Identifier "Framebuffer"
23 Device "fbdev"
24 Monitor "Monitor"
25 DefaultFbBpp 16
26 SubSection "Display"
27 Depth 16
28 Modes "480x800"
29 EndSubSection
30EndSection
31
32Section "Screen"
33 Identifier "480x800x16"
34 Device "fbdev"
35 Monitor "Monitor"
36 DefaultFbBpp 16
37 SubSection "Display"
38 Depth 16
39 Modes "480x800"
40 EndSubSection
41EndSection
42
43
44Section "ServerLayout"
45 Identifier "Builtin Default Layout"
46 Screen "Framebuffer"
47 InputDevice "Touchscreen" "CorePointer"
48 InputDevice "Keyboard" "CoreKeyboard"
49EndSection
50
51Section "InputDevice"
52 Identifier "Mouse0"
53 Driver "mouse"
54 Option "Protocol" "auto"
55 Option "Device" "/dev/input/mice"
56 Option "Emulate3Buttons" "no"
57 Option "ZAxisMapping" "4 5"
58EndSection
59
60
61Section "InputDevice"
62 Identifier "Touchscreen"
63 Driver "tslib"
64 Option "Protocol" "auto"
65 Option "Device" "/dev/input/event0"
66 Option "CorePointer" "true"
67EndSection
68
69Section "InputDevice"
70 Identifier "Keyboard"
71 Driver "kbd"
72 Option "XkbLayout" "en_US"
73EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/igep0020/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/igep0020/xorg.conf
new file mode 100644
index 000000000..07d849d70
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/igep0020/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/ion/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/ion/xorg.conf
new file mode 100644
index 000000000..95a15235b
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/ion/xorg.conf
@@ -0,0 +1,51 @@
1# xorg.conf (X.Org X Window System server configuration file)
2#
3# This file was generated by dexconf, the Debian X Configuration tool, using
4# values from the debconf database.
5#
6# Edit this file with caution, and see the xorg.conf manual page.
7# (Type "man xorg.conf" at the shell prompt.)
8#
9# This file is automatically updated on xserver-xorg package upgrades *only*
10# if it has not been modified since the last upgrade of the xserver-xorg
11# package.
12#
13# Note that some configuration settings that could be done previously
14# in this file, now are automatically configured by the server and settings
15# here are ignored.
16#
17# If you have edited this file but would like it to be automatically updated
18# again, run the following command:
19# sudo dpkg-reconfigure -phigh xserver-xorg
20
21Section "Device"
22 Identifier "NVidia"
23 Driver "nvidia"
24# Option "NoLogo" "True"
25EndSection
26
27Section "Monitor"
28 Identifier "DELL 2007WFP"
29# Option "DPMS"
30 HorizSync 30.0-83.0
31 VertRefresh 56.0-76.0
32 ModeLine "1680x1050" 119.0 1680 1728 1760 1840 1050 1053 1059 1080 -HSync +VSync
33EndSection
34
35Section "Screen"
36 Identifier "Default Screen"
37 Device "NVidia"
38 Monitor "DELL 2007WFP"
39 DefaultDepth 24
40 SubSection "Display"
41 Depth 24
42 Modes "1680x1050"
43 ViewPort 0 0
44 EndSubSection
45EndSection
46
47Section "Module"
48 Load "glx"
49EndSection
50
51
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/iphone3g/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/iphone3g/xorg.conf
new file mode 100644
index 000000000..83ac9c148
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/iphone3g/xorg.conf
@@ -0,0 +1,29 @@
1Section "Device"
2 Identifier "Builtin Default fbdev Device 0"
3 Driver "fbdev"
4 Option "ShadowFB" "on"
5EndSection
6
7Section "Screen"
8 Identifier "Builtin Default fbdev Screen 0"
9 Device "Builtin Default fbdev Device 0"
10EndSection
11
12
13Section "InputDevice"
14 Identifier "touchscreen"
15 Driver "evdev"
16 Option "Device" "/dev/input/event2"
17 Option "ReportingMode" "Raw"
18 Option "SendCoreEvents" "On"
19 Option "GrabDevices" "True"
20 Option "InvertY" "0"
21 Option "SwapAxes" "0"
22EndSection
23
24
25Section "ServerLayout"
26 Identifier "Builtin Default Layout"
27 Screen "Builtin Default fbdev Screen 0"
28 InputDevice "touchscreen" "CorePointer" "AlwaysCore"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/mh355/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/mh355/xorg.conf
new file mode 100644
index 000000000..4c275c9dc
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/mh355/xorg.conf
@@ -0,0 +1,47 @@
1#
2# X11 configuration for Microhard MH355 device
3# (C)2010 Koan sas - www.KoanSoftware.com
4#
5
6Section "Monitor"
7 Identifier "Display"
8EndSection
9
10Section "Device"
11 Identifier "fbdevice"
12 Driver "fbdev"
13 Option "fbdev" "/dev/fb0"
14 Option "shadowfb" "true"
15EndSection
16
17Section "Screen"
18 Identifier "fbscreen"
19 Device "fbdevice"
20 Monitor "Display"
21EndSection
22
23Section "InputDevice"
24 Identifier "mh355-ts"
25 Driver "evdev"
26 Option "SwapAxes" "1"
27 Option "Device" "/dev/input/touchscreen0"
28EndSection
29
30Section "InputDevice"
31 Identifier "Generic Mouse"
32 Driver "mouse"
33 Option "CorePointer"
34EndSection
35
36Section "ServerLayout"
37 Identifier "Layout"
38 Screen "fbscreen"
39 InputDevice "mh355-ts" "CorePointer"
40# Enable mouse only if necessary, it may interfere with touchscreen behaviour
41# InputDevice "Generic Mouse"
42EndSection
43
44Section "ServerFlags"
45 Option "AutoAddDevices" "false"
46EndSection
47
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/nokia800/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/nokia800/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/nokia800/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/nokia900/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/nokia900/xorg.conf
new file mode 100644
index 000000000..d9d742ffb
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/nokia900/xorg.conf
@@ -0,0 +1,62 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Default omapfb Device"
17 Driver "omapfb"
18 Option "fb" "/dev/fb0"
19
20EndSection
21
22Section "InputDevice"
23 Identifier "gpio-keys"
24 Driver "evdev"
25 Option "Device" "/dev/input/event0"
26EndSection
27
28Section "InputDevice"
29 Identifier "twl4030_pwrbutton"
30 Driver "evdev"
31 Option "Device" "/dev/input/event3"
32EndSection
33
34
35Section "InputDevice"
36 Identifier "Keyboard"
37 Driver "evdev"
38 Option "Device" "/dev/input/event1"
39 Option "XkbModel" "nokiarx51"
40 Option "XkbLayout" "us"
41 Option "CoreKeyboard"
42EndSection
43
44Section "InputDevice"
45 Identifier "Touchscreen"
46 Driver "evdev"
47 Option "Device" "/dev/input/event2"
48EndSection
49
50Section "Screen"
51 Identifier "Default Screen"
52 Device "Default omapfb Device"
53EndSection
54
55Section "ServerLayout"
56 Identifier "Default Layout"
57 Screen "Default Screen"
58 InputDevice "Touchscreen"
59 InputDevice "Keyboard"
60 InputDevice "gpio-keys"
61 InputDevice "twl4030_pwrbutton"
62EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/om-gta01/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/om-gta01/xorg.conf
new file mode 100644
index 000000000..edb5e0ee4
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/om-gta01/xorg.conf
@@ -0,0 +1,49 @@
1Section "Monitor"
2 Identifier "LCD Panel"
3EndSection
4
5
6Section "Device"
7 Identifier "Fbdev"
8 Driver "fbdev"
9EndSection
10
11
12Section "Screen"
13 Identifier "Default Screen"
14 Device "Fbdev"
15 Monitor "LCD Panel"
16EndSection
17
18
19Section "InputDevice"
20 Identifier "Power Button"
21 Driver "evdev"
22 Option "Device" "/dev/input/event2"
23EndSection
24
25
26Section "InputDevice"
27 Identifier "AUX Button"
28 Driver "evdev"
29 Option "Device" "/dev/input/event0"
30EndSection
31
32
33Section "InputDevice"
34 Identifier "Touchscreen"
35 Driver "evdev"
36 Option "Device" "/dev/input/event1"
37EndSection
38
39Section "ServerFlags"
40 Option "AutoAddDevices" "False"
41EndSection
42
43Section "ServerLayout"
44 Identifier "Default Layout"
45 Screen "Default Screen"
46 InputDevice "Power Button"
47 InputDevice "AUX Button"
48 InputDevice "Touchscreen"
49EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/om-gta02/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/om-gta02/xorg.conf
new file mode 100644
index 000000000..de6ed1c14
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/om-gta02/xorg.conf
@@ -0,0 +1,55 @@
1Section "Module"
2 Load "glx"
3 Load "dri2"
4EndSection
5
6
7Section "Monitor"
8 Identifier "LCD Panel"
9EndSection
10
11
12Section "Device"
13 Identifier "Glamo Graphics Chip"
14 Driver "glamo"
15EndSection
16
17
18Section "Screen"
19 Identifier "Default Screen"
20 Device "Glamo Graphics Chip"
21 Monitor "LCD Panel"
22EndSection
23
24
25Section "InputDevice"
26 Identifier "Power Button"
27 Driver "evdev"
28 Option "Device" "/dev/input/event0"
29EndSection
30
31
32Section "InputDevice"
33 Identifier "AUX Button"
34 Driver "evdev"
35 Option "Device" "/dev/input/event2"
36EndSection
37
38
39Section "InputDevice"
40 Identifier "Touchscreen"
41 Driver "evdev"
42 Option "Device" "/dev/input/event1"
43EndSection
44
45Section "ServerFlags"
46 Option "AutoAddDevices" "False"
47EndSection
48
49Section "ServerLayout"
50 Identifier "Default Layout"
51 Screen "Default Screen"
52 InputDevice "Power Button"
53 InputDevice "AUX Button"
54 InputDevice "Touchscreen"
55EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3-pandora/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3-pandora/xorg.conf
new file mode 100644
index 000000000..446ac9777
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3-pandora/xorg.conf
@@ -0,0 +1,24 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4EndSection
5
6Section "Monitor"
7 Identifier "Builtin Default Monitor"
8EndSection
9
10Section "Device"
11 Identifier "Builtin Default fbdev Device 0"
12 Driver "omapfb"
13EndSection
14
15Section "Screen"
16 Identifier "Builtin Default fbdev Screen 0"
17 Device "Builtin Default fbdev Device 0"
18 Monitor "Builtin Default Monitor"
19EndSection
20
21Section "ServerLayout"
22 Identifier "Builtin Default Layout"
23 Screen "Builtin Default fbdev Screen 0"
24EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3-touchbook/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3-touchbook/xorg.conf
new file mode 100644
index 000000000..56425abf8
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3-touchbook/xorg.conf
@@ -0,0 +1,25 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4EndSection
5
6Section "Monitor"
7 Identifier "Builtin Default Monitor"
8EndSection
9
10Section "Device"
11 Identifier "Builtin Default fbdev Device 0"
12 Driver "fbdev"
13 Option "ShadowFB" "false"
14EndSection
15
16Section "Screen"
17 Identifier "Builtin Default fbdev Screen 0"
18 Device "Builtin Default fbdev Device 0"
19 Monitor "Builtin Default Monitor"
20EndSection
21
22Section "ServerLayout"
23 Identifier "Builtin Default Layout"
24 Screen "Builtin Default fbdev Screen 0"
25EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3evm/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3evm/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omap3evm/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom2/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom2/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom2/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom36x/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom36x/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/omapzoom36x/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/overo/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/overo/xorg.conf
new file mode 100644
index 000000000..983bb0823
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/overo/xorg.conf
@@ -0,0 +1,29 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "glx"
5 Load "freetype"
6 Load "type1"
7 Load "record"
8 Load "dri"
9EndSection
10
11Section "Monitor"
12 Identifier "Builtin Default Monitor"
13EndSection
14
15Section "Device"
16 Identifier "Builtin Default fbdev Device 0"
17 Driver "omapfb"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/palmpre/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/palmpre/xorg.conf
new file mode 100644
index 000000000..6915b87b9
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/palmpre/xorg.conf
@@ -0,0 +1,58 @@
1Section "Module"
2 Load "extmod"
3 Load "dbe"
4 Load "freetype"
5 Load "type1"
6 Load "record"
7 Load "dri"
8EndSection
9
10Section "Monitor"
11 Identifier "Builtin Default Monitor"
12EndSection
13
14Section "Device"
15 Identifier "Builtin Default fbdev Device 0"
16 Driver "omapfb"
17 Option "fb" "/dev/fb0"
18EndSection
19
20Section "Screen"
21 Identifier "Builtin Default fbdev Screen 0"
22 Device "Builtin Default fbdev Device 0"
23 Monitor "Builtin Default Monitor"
24EndSection
25
26Section "ServerLayout"
27 Identifier "Builtin Default Layout"
28 Screen "Builtin Default fbdev Screen 0"
29 InputDevice "Touchscreen" "CorePointer"
30EndSection
31
32Section "InputDevice"
33 Identifier "Touchscreen"
34 Driver "evdev"
35 Option "Device" "/dev/input/event6"
36 Option "SendCoreEvents" "true"
37 Option "Protocol" "Auto"
38 Option "Width" "320"
39 Option "Height" "528"
40 Option "EmulateRightButton" "1"
41 Option "CorePointer" "true"
42EndSection
43
44Section "InputDevice"
45 Identifier "Keyboard"
46 Driver "palm-pre"
47 Option "Device" "/dev/input/event2"
48 Option "SendCoreEvents" "true"
49 #Option "XkbModel" "palm-pre"
50 Option "XkbLayout" "palm-pre"
51# Option "XKbOptions" ""
52EndSection
53
54#Section "InputDevice"
55# Identifier "Keyboard"
56# Driver "evdev"
57# Option "Device" "/dev/input/event2"
58#EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/ronetix-pm9263/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/ronetix-pm9263/xorg.conf
new file mode 100644
index 000000000..d4651ad87
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/ronetix-pm9263/xorg.conf
@@ -0,0 +1,47 @@
1#
2# X11 configuration for Ronetix PM9263 device.
3# (C)2009-2010 Koan sas - www.KoanSoftware.com
4#
5
6Section "Monitor"
7 Identifier "Display"
8EndSection
9
10Section "Device"
11 Identifier "fbdevice"
12 Driver "fbdev"
13 Option "fbdev" "/dev/fb0"
14 Option "shadowfb" "true"
15EndSection
16
17Section "Screen"
18 Identifier "fbscreen"
19 Device "fbdevice"
20 Monitor "Display"
21EndSection
22
23Section "InputDevice"
24 Identifier "atmel-ts"
25 Driver "evdev"
26 Option "SwapAxes" "1"
27 Option "Device" "/dev/input/touchscreen0"
28EndSection
29
30Section "InputDevice"
31 Identifier "Generic Mouse"
32 Driver "mouse"
33 Option "CorePointer"
34EndSection
35
36Section "ServerLayout"
37 Identifier "Layout"
38 Screen "fbscreen"
39 InputDevice "atmel-ts" "CorePointer"
40# Enable mouse only if necessary, it may interfere with touchscreen behaviour
41# InputDevice "Generic Mouse"
42EndSection
43
44Section "ServerFlags"
45 Option "AutoAddDevices" "false"
46EndSection
47
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/spitz/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/spitz/xorg.conf
new file mode 100644
index 000000000..224df5c8b
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/spitz/xorg.conf
@@ -0,0 +1,49 @@
1Section "Device"
2 Identifier "Generic Video Card"
3 Driver "fbdev"
4 Option "UseFBDev" "true"
5 Option "Rotate" "CW"
6EndSection
7
8Section "Monitor"
9 Identifier "Generic Monitor"
10 Option "DPMS"
11 HorizSync 28-32
12 VertRefresh 43-60
13EndSection
14
15Section "Screen"
16 Identifier "Default Screen"
17 Device "Generic Video Card"
18 Monitor "Generic Monitor"
19 DefaultDepth 16
20 SubSection "Display"
21 Depth 1
22 Modes "640x480"
23 EndSubSection
24 SubSection "Display"
25 Depth 4
26 Modes "640x480"
27 EndSubSection
28 SubSection "Display"
29 Depth 8
30 Modes "640x480"
31 EndSubSection
32 SubSection "Display"
33 Depth 15
34 Modes "640x480"
35 EndSubSection
36 SubSection "Display"
37 Depth 16
38 Modes "640x480"
39 EndSubSection
40 SubSection "Display"
41 Depth 24
42 Modes "640x480"
43 EndSubSection
44EndSection
45
46Section "ServerLayout"
47 Identifier "Default Layout"
48 Screen "Default Screen"
49EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/vortex86sx/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/vortex86sx/xorg.conf
new file mode 100644
index 000000000..0f03faf33
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/vortex86sx/xorg.conf
@@ -0,0 +1,13 @@
1Section "Device"
2 Identifier "Card0"
3 Driver "vesa"
4EndSection
5
6# SIS driver is proper one for this device but fails with misc errors.
7#Section "Device"
8# Identifier "Card0"
9# Driver "sis"
10#
11# Disable MMX/SSE tests
12# Option "BenchmarkMemCpy" "off"
13#EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xilinx-ml507/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xilinx-ml507/xorg.conf
new file mode 100644
index 000000000..2950193ce
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xilinx-ml507/xorg.conf
@@ -0,0 +1,39 @@
1Section "Monitor"
2 Identifier "LCD Panel"
3EndSection
4
5Section "Device"
6 Identifier "Xilinx frame buffer"
7 Driver "fbdev"
8EndSection
9
10Section "Screen"
11 Identifier "Default Screen"
12 Device "Xilinx frame buffer"
13 Monitor "LCD Panel"
14 SubSection "Display"
15 Depth 24
16 Modes "640x480"
17 EndSubSection
18EndSection
19
20Section "InputDevice"
21 Identifier "Keyboard"
22 Driver "kbd"
23# Option "XkbLayout" "es"
24# Option "XkbModel" "pc105"
25EndSection
26
27Section "InputDevice"
28 Identifier "Mouse"
29 Driver "mouse"
30 Option "protocol" "auto"
31 Option "device" "/dev/input/mice"
32EndSection
33
34Section "ServerLayout"
35 Identifier "Default Layout"
36 Screen "Default Screen"
37 InputDevice "Keyboard"
38 InputDevice "Mouse"
39EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xilinx-virtex5/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xilinx-virtex5/xorg.conf
new file mode 100644
index 000000000..61f0f9fcd
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xilinx-virtex5/xorg.conf
@@ -0,0 +1,38 @@
1# Xorg conf file for Xilinx platforms
2Section "Monitor"
3 Identifier "LCD Panel"
4EndSection
5
6Section "Device"
7 Identifier "Xilinx frame buffer"
8 Driver "fbdev"
9EndSection
10
11Section "Screen"
12 Identifier "Default Screen"
13 Device "Xilinx frame buffer"
14 Monitor "LCD Panel"
15 SubSection "Display"
16 Depth 24
17 Modes "640x480"
18 EndSubSection
19EndSection
20
21Section "InputDevice"
22 Identifier "Keyboard"
23 Driver "kbd"
24EndSection
25
26Section "InputDevice"
27 Identifier "Mouse"
28 Driver "mouse"
29 Option "protocol" "auto"
30 Option "device" "/dev/input/mice"
31EndSection
32
33Section "ServerLayout"
34 Identifier "Default Layout"
35 Screen 0 "Default Screen" 0 0
36 InputDevice "Keyboard"
37 InputDevice "Mouse"
38EndSection
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xorg.conf b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xorg.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf/xorg.conf
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf_0.1.bb b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf_0.1.bb
new file mode 100644
index 000000000..ae4493d41
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg-conf_0.1.bb
@@ -0,0 +1,17 @@
1DESCRIPTION = "Machine specific xorg.conf files"
2PR = "r43"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${TOPDIR}/meta-shr/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
5
6SRC_URI = "file://xorg.conf"
7
8do_install() {
9 install -d ${D}/${sysconfdir}/X11
10 install -m 0644 ${WORKDIR}/xorg.conf ${D}/${sysconfdir}/X11/
11}
12
13# Set some dependencies to make the confs actually work
14RDEPENDS_omap3 = "xf86-video-omapfb"
15
16CONFFILES_${PN} += "${sysconfdir}/X11/xorg.conf"
17PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_1.10.0.901.bb b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_1.10.0.901.bb
new file mode 100644
index 000000000..c1d956648
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_1.10.0.901.bb
@@ -0,0 +1,29 @@
1# Assign it here, since the hal->udev transition happens post 1.7 in angstrom
2DISTRO_XORG_CONFIG_MANAGER_angstrom = "udev"
3
4require xorg-xserver-common.inc
5
6DESCRIPTION = "the X.Org X server"
7DEPENDS += "pixman libpciaccess openssl dri2proto glproto xorg-minimal-fonts font-util-native"
8PE = "2"
9PR = "${INC_PR}.0"
10
11SRC_URI += " \
12 file://hack-fbdev-ignore-return-mode.patch \
13 file://hack-assume-pixman-supports-overlapped-blt.patch \
14 "
15SRC_URI[md5sum] = "d750cf5f6342b548b7ac2be56e9d1841"
16SRC_URI[sha256sum] = "de18f52c35fc3d3f18c7e905296f9de5ac42dc71e4e01da9ae8e154a78c7771c"
17
18do_install_prepend() {
19 mkdir -p ${D}/${libdir}/X11/fonts
20}
21
22# The NVidia driver requires Xinerama support in the X server. Ion uses it.
23PACKAGE_ARCH_ion = "${MACHINE_ARCH}"
24XINERAMA = "${@['--disable-xinerama','--enable-xinerama'][bb.data.getVar('MACHINE',d) in ['ion']]}"
25
26EXTRA_OECONF += " ${CONFIG_MANAGER_OPTION} ${XINERAMA} --disable-kdrive --disable-xephyr --disable-xsdl --disable-xfake --disable-xfbdev --disable-dmx"
27EXTRA_OECONF += " --enable-dri2 --disable-unit-tests --disable-docs --disable-devel-docs"
28
29export LDFLAGS += " -ldl "
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_1.9.4.bb b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_1.9.4.bb
new file mode 100644
index 000000000..086ac176f
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_1.9.4.bb
@@ -0,0 +1,31 @@
1# Assign it here, since the hal->udev transition happens post 1.7 in angstrom
2DISTRO_XORG_CONFIG_MANAGER_angstrom = "udev"
3
4require xorg-xserver-common.inc
5
6DESCRIPTION = "the X.Org X server"
7DEPENDS += "pixman libpciaccess openssl dri2proto glproto xorg-minimal-fonts font-util-native"
8PE = "2"
9PR = "${INC_PR}.0"
10
11SRC_URI += " \
12 file://dolt-fix.patch \
13 file://randr-support.patch \
14 file://hack-fbdev-ignore-return-mode.patch \
15 file://hack-assume-pixman-supports-overlapped-blt.patch \
16 "
17SRC_URI[md5sum] = "040f091dfdfb4e335116eb0032cc690b"
18SRC_URI[sha256sum] = "ad11047ebba58f2e37b03c70c986db3ea0cc0f1a19d2d3612713ab77b8ec2458"
19
20do_install_prepend() {
21 mkdir -p ${D}/${libdir}/X11/fonts
22}
23
24# The NVidia driver requires Xinerama support in the X server. Ion uses it.
25PACKAGE_ARCH_ion = "${MACHINE_ARCH}"
26XINERAMA = "${@['--disable-xinerama','--enable-xinerama'][bb.data.getVar('MACHINE',d) in ['ion']]}"
27
28EXTRA_OECONF += " ${CONFIG_MANAGER_OPTION} ${XINERAMA} --disable-kdrive --disable-xephyr --disable-xsdl --disable-xfake --disable-xfbdev --disable-dmx"
29EXTRA_OECONF += " --enable-dri2 --disable-unit-tests --disable-docs --disable-devel-docs"
30
31export LDFLAGS += " -ldl "
diff --git a/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_git.bb b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_git.bb
new file mode 100644
index 000000000..be441a35a
--- /dev/null
+++ b/meta-oe/recipes-graphics/xorg-xserver/xserver-xorg_git.bb
@@ -0,0 +1,38 @@
1# Assign it here, since the hal->udev transition happens post 1.7 in angstrom
2DISTRO_XORG_CONFIG_MANAGER_angstrom = "udev"
3
4require xorg-xserver-common.inc
5
6LICENSE = "MIT-X"
7LIC_FILES_CHKSUM = "file://COPYING;md5=74df27b6254cc88d2799b5f4f5949c00"
8
9DESCRIPTION = "the X.Org X server"
10DEPENDS += "pixman libpciaccess openssl dri2proto glproto xorg-minimal-fonts font-util-native"
11PV = "1.10.0.901"
12PR = "${INC_PR}.0"
13PR_append = "+gitr${SRCPV}"
14PE = "2"
15
16#DEFAULT_PREFERENCE = "-1"
17
18SRCREV = "1f51fe4f748b2997e466863d8387bd6791b32931"
19SRC_URI = " \
20 git://anongit.freedesktop.org/xorg/xserver;protocol=git;branch=server-1.10-branch \
21 file://hack-fbdev-ignore-return-mode.patch \
22 file://hack-assume-pixman-supports-overlapped-blt.patch \
23"
24
25S = "${WORKDIR}/git"
26
27do_install_prepend() {
28 mkdir -p ${D}/${libdir}/X11/fonts
29}
30
31# The NVidia driver requires Xinerama support in the X server. Ion uses it.
32PACKAGE_ARCH_ion = "${MACHINE_ARCH}"
33XINERAMA = "${@['--disable-xinerama','--enable-xinerama'][bb.data.getVar('MACHINE',d) in ['ion']]}"
34
35EXTRA_OECONF += " ${CONFIG_MANAGER_OPTION} ${XINERAMA} --disable-kdrive --disable-xephyr --disable-xsdl --disable-xfake --disable-xfbdev --disable-dmx"
36EXTRA_OECONF += " --enable-dri2 --disable-unit-tests --disable-docs --disable-devel-docs"
37
38export LDFLAGS += " -ldl "
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/89xTs_Calibrate.xinput_calibrator.patch b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/89xTs_Calibrate.xinput_calibrator.patch
new file mode 100644
index 000000000..c04ad961a
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/89xTs_Calibrate.xinput_calibrator.patch
@@ -0,0 +1,12 @@
1Index: xserver-common/X11/Xsession.d/89xTs_Calibrate_xinput_calibrator
2===================================================================
3--- xserver-common/X11/Xsession.d/89xTs_Calibrate_xinput_calibrator (revision 0)
4+++ xserver-common/X11/Xsession.d/89xTs_Calibrate_xinput_calibrator (revision 0)
5@@ -0,0 +1,7 @@
6+#!/bin/sh
7+
8+if [ -e /usr/bin/xinput_calibrator_once.sh ] ; then
9+ if [ -e /etc/pointercal.xinput ] ; then
10+ /usr/bin/xinput_calibrator_once.sh
11+ fi
12+fi
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/89xdgautostart.sh b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/89xdgautostart.sh
new file mode 100644
index 000000000..9886f9fee
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/89xdgautostart.sh
@@ -0,0 +1,9 @@
1#!/bin/sh
2
3XDGAUTOSTART=/etc/xdg/autostart
4if [ -d $XDGAUTOSTART ] ; then
5 for SCRIPT in $XDGAUTOSTART/*; do
6 CMD=`grep ^Exec= $SCRIPT | cut -d '=' -f 2`
7 $CMD &
8 done
9fi
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/90xXWindowManager.patch b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/90xXWindowManager.patch
new file mode 100644
index 000000000..be5f5ce70
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/90xXWindowManager.patch
@@ -0,0 +1,11 @@
1Index: xserver-common/X11/Xsession.d/90xXWindowManager
2===================================================================
3--- xserver-common/X11/Xsession.d/90xXWindowManager (revision 0)
4+++ xserver-common/X11/Xsession.d/90xXWindowManager (revision 0)
5@@ -0,0 +1,6 @@
6+#!/bin/sh
7+if [ -x $HOME/.Xsession ]; then
8+ exec $HOME/.Xsession
9+else
10+ exec /usr/bin/x-window-manager
11+fi
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.dpi.for.gta.patch b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.dpi.for.gta.patch
new file mode 100644
index 000000000..f6e36d9e1
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.dpi.for.gta.patch
@@ -0,0 +1,29 @@
1xdpyinfo returns 96, but 285 is right value (but 280 is used as it renders 4 columns of illume icons instead of 3 and empty space)
2
3diff -uNr xserver-common-1.33.orig//X11/xserver-common xserver-common-1.33/X11/xserver-common
4--- xserver-common-1.33.orig//X11/xserver-common 2010-04-28 23:27:10.000000000 +0200
5+++ xserver-common-1.33/X11/xserver-common 2010-04-28 23:29:07.000000000 +0200
6@@ -133,19 +133,19 @@
7 ARGS="$ARGS -screen ${SCREEN_SIZE}"
8 DPI="225" ;;
9 "gta01" )
10- DPI="285"
11+ DPI="280"
12 if [ "$XSERVER" != "Xorg" ] ; then
13 ARGS="$ARGS -screen 480x640"
14 else
15- ARGS="$ARGS -nocursor"
16+ ARGS="$ARGS -dpi ${DPI} -nocursor"
17 fi
18 ;;
19 "gta02")
20- DPI="285"
21+ DPI="280"
22 if [ "$XSERVER" != "Xorg" ] ; then
23 ARGS="$ARGS -screen ${SCREEN_SIZE}"
24 else
25- ARGS="$ARGS -nocursor"
26+ ARGS="$ARGS -dpi ${DPI} -nocursor"
27 fi
28 ;;
29 "motorola_ezx_platform")
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.nocursor.for.gta.patch b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.nocursor.for.gta.patch
new file mode 100644
index 000000000..bd16efc10
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.nocursor.for.gta.patch
@@ -0,0 +1,20 @@
1diff -uNr xserver-common-1.33.orig//X11/xserver-common xserver-common-1.33/X11/xserver-common
2--- xserver-common-1.33.orig//X11/xserver-common 2010-04-28 10:44:23.000000000 +0200
3+++ xserver-common-1.33/X11/xserver-common 2010-04-28 10:46:41.000000000 +0200
4@@ -136,12 +136,16 @@
5 DPI="285"
6 if [ "$XSERVER" != "Xorg" ] ; then
7 ARGS="$ARGS -screen 480x640"
8+ else
9+ ARGS="$ARGS -nocursor"
10 fi
11 ;;
12 "gta02")
13 DPI="285"
14 if [ "$XSERVER" != "Xorg" ] ; then
15 ARGS="$ARGS -screen ${SCREEN_SIZE}"
16+ else
17+ ARGS="$ARGS -nocursor"
18 fi
19 ;;
20 "motorola_ezx_platform")
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.xserver-system.patch b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.xserver-system.patch
new file mode 100644
index 000000000..5d9d5d128
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.add.xserver-system.patch
@@ -0,0 +1,12 @@
1diff -uNr xserver-common-1.33.orig//X11/xserver-common xserver-common-1.33/X11/xserver-common
2--- xserver-common-1.33.orig//X11/xserver-common 2010-04-28 23:27:10.000000000 +0200
3+++ xserver-common-1.33/X11/xserver-common 2010-04-28 23:29:07.000000000 +0200
4@@ -192,3 +196,8 @@
5 if [ "$XSERVER" != "Xorg" ] ; then
6 ARGS="$ARGS $MOUSE"
7 fi
8+
9+# let a local script modify the variables
10+if [ -e /etc/X11/xserver-system ] ; then
11+ . /etc/X11/xserver-system
12+fi
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.n900.patch b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.n900.patch
new file mode 100644
index 000000000..4d36f5f71
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/Xserver.n900.patch
@@ -0,0 +1,17 @@
1diff -uri xserver-common-1.33.orig/X11/xserver-common xserver-common-1.33/X11/xserver-common
2--- xserver-common-1.33.orig/X11/xserver-common 2010-09-14 17:10:35.955430177 +0200
3+++ xserver-common-1.33/X11/xserver-common 2010-09-14 17:17:12.484423440 +0200
4@@ -132,6 +132,13 @@
5 "nokia_n800" | "nokia_rx-44" | "nokia_n770")
6 ARGS="$ARGS -screen ${SCREEN_SIZE}"
7 DPI="225" ;;
8+ "nokia_rx-51_board" )
9+ DPI="267"
10+ if [ "$XSERVER" != "Xorg" ] ; then
11+ ARGS="$ARGS -screen ${SCREEN_SIZE}"
12+ else
13+ ARGS="$ARGS -dpi ${DPI} -nocursor"
14+ fi ;;
15 "gta01" )
16 DPI="280"
17 if [ "$XSERVER" != "Xorg" ] ; then
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/gplv2-license.patch b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/gplv2-license.patch
new file mode 100644
index 000000000..ec9325334
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/gplv2-license.patch
@@ -0,0 +1,353 @@
1COPYING: add GPLv2 license file
2
3this is a local file recipe and the license file is missing.In order
4to pass the license checksum checking, the license file is needed. So
5this patch add the GPLv2 license file.
6
7Signed-off-by: Yu Ke <ke.yu@intel.com>
8
9diff --git a/COPYING b/COPYING
10new file mode 100644
11index 0000000..d511905
12--- /dev/null
13+++ b/COPYING
14@@ -0,0 +1,339 @@
15+ GNU GENERAL PUBLIC LICENSE
16+ Version 2, June 1991
17+
18+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
19+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+ Everyone is permitted to copy and distribute verbatim copies
21+ of this license document, but changing it is not allowed.
22+
23+ Preamble
24+
25+ The licenses for most software are designed to take away your
26+freedom to share and change it. By contrast, the GNU General Public
27+License is intended to guarantee your freedom to share and change free
28+software--to make sure the software is free for all its users. This
29+General Public License applies to most of the Free Software
30+Foundation's software and to any other program whose authors commit to
31+using it. (Some other Free Software Foundation software is covered by
32+the GNU Lesser General Public License instead.) You can apply it to
33+your programs, too.
34+
35+ When we speak of free software, we are referring to freedom, not
36+price. Our General Public Licenses are designed to make sure that you
37+have the freedom to distribute copies of free software (and charge for
38+this service if you wish), that you receive source code or can get it
39+if you want it, that you can change the software or use pieces of it
40+in new free programs; and that you know you can do these things.
41+
42+ To protect your rights, we need to make restrictions that forbid
43+anyone to deny you these rights or to ask you to surrender the rights.
44+These restrictions translate to certain responsibilities for you if you
45+distribute copies of the software, or if you modify it.
46+
47+ For example, if you distribute copies of such a program, whether
48+gratis or for a fee, you must give the recipients all the rights that
49+you have. You must make sure that they, too, receive or can get the
50+source code. And you must show them these terms so they know their
51+rights.
52+
53+ We protect your rights with two steps: (1) copyright the software, and
54+(2) offer you this license which gives you legal permission to copy,
55+distribute and/or modify the software.
56+
57+ Also, for each author's protection and ours, we want to make certain
58+that everyone understands that there is no warranty for this free
59+software. If the software is modified by someone else and passed on, we
60+want its recipients to know that what they have is not the original, so
61+that any problems introduced by others will not reflect on the original
62+authors' reputations.
63+
64+ Finally, any free program is threatened constantly by software
65+patents. We wish to avoid the danger that redistributors of a free
66+program will individually obtain patent licenses, in effect making the
67+program proprietary. To prevent this, we have made it clear that any
68+patent must be licensed for everyone's free use or not licensed at all.
69+
70+ The precise terms and conditions for copying, distribution and
71+modification follow.
72+
73+ GNU GENERAL PUBLIC LICENSE
74+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
75+
76+ 0. This License applies to any program or other work which contains
77+a notice placed by the copyright holder saying it may be distributed
78+under the terms of this General Public License. The "Program", below,
79+refers to any such program or work, and a "work based on the Program"
80+means either the Program or any derivative work under copyright law:
81+that is to say, a work containing the Program or a portion of it,
82+either verbatim or with modifications and/or translated into another
83+language. (Hereinafter, translation is included without limitation in
84+the term "modification".) Each licensee is addressed as "you".
85+
86+Activities other than copying, distribution and modification are not
87+covered by this License; they are outside its scope. The act of
88+running the Program is not restricted, and the output from the Program
89+is covered only if its contents constitute a work based on the
90+Program (independent of having been made by running the Program).
91+Whether that is true depends on what the Program does.
92+
93+ 1. You may copy and distribute verbatim copies of the Program's
94+source code as you receive it, in any medium, provided that you
95+conspicuously and appropriately publish on each copy an appropriate
96+copyright notice and disclaimer of warranty; keep intact all the
97+notices that refer to this License and to the absence of any warranty;
98+and give any other recipients of the Program a copy of this License
99+along with the Program.
100+
101+You may charge a fee for the physical act of transferring a copy, and
102+you may at your option offer warranty protection in exchange for a fee.
103+
104+ 2. You may modify your copy or copies of the Program or any portion
105+of it, thus forming a work based on the Program, and copy and
106+distribute such modifications or work under the terms of Section 1
107+above, provided that you also meet all of these conditions:
108+
109+ a) You must cause the modified files to carry prominent notices
110+ stating that you changed the files and the date of any change.
111+
112+ b) You must cause any work that you distribute or publish, that in
113+ whole or in part contains or is derived from the Program or any
114+ part thereof, to be licensed as a whole at no charge to all third
115+ parties under the terms of this License.
116+
117+ c) If the modified program normally reads commands interactively
118+ when run, you must cause it, when started running for such
119+ interactive use in the most ordinary way, to print or display an
120+ announcement including an appropriate copyright notice and a
121+ notice that there is no warranty (or else, saying that you provide
122+ a warranty) and that users may redistribute the program under
123+ these conditions, and telling the user how to view a copy of this
124+ License. (Exception: if the Program itself is interactive but
125+ does not normally print such an announcement, your work based on
126+ the Program is not required to print an announcement.)
127+
128+These requirements apply to the modified work as a whole. If
129+identifiable sections of that work are not derived from the Program,
130+and can be reasonably considered independent and separate works in
131+themselves, then this License, and its terms, do not apply to those
132+sections when you distribute them as separate works. But when you
133+distribute the same sections as part of a whole which is a work based
134+on the Program, the distribution of the whole must be on the terms of
135+this License, whose permissions for other licensees extend to the
136+entire whole, and thus to each and every part regardless of who wrote it.
137+
138+Thus, it is not the intent of this section to claim rights or contest
139+your rights to work written entirely by you; rather, the intent is to
140+exercise the right to control the distribution of derivative or
141+collective works based on the Program.
142+
143+In addition, mere aggregation of another work not based on the Program
144+with the Program (or with a work based on the Program) on a volume of
145+a storage or distribution medium does not bring the other work under
146+the scope of this License.
147+
148+ 3. You may copy and distribute the Program (or a work based on it,
149+under Section 2) in object code or executable form under the terms of
150+Sections 1 and 2 above provided that you also do one of the following:
151+
152+ a) Accompany it with the complete corresponding machine-readable
153+ source code, which must be distributed under the terms of Sections
154+ 1 and 2 above on a medium customarily used for software interchange; or,
155+
156+ b) Accompany it with a written offer, valid for at least three
157+ years, to give any third party, for a charge no more than your
158+ cost of physically performing source distribution, a complete
159+ machine-readable copy of the corresponding source code, to be
160+ distributed under the terms of Sections 1 and 2 above on a medium
161+ customarily used for software interchange; or,
162+
163+ c) Accompany it with the information you received as to the offer
164+ to distribute corresponding source code. (This alternative is
165+ allowed only for noncommercial distribution and only if you
166+ received the program in object code or executable form with such
167+ an offer, in accord with Subsection b above.)
168+
169+The source code for a work means the preferred form of the work for
170+making modifications to it. For an executable work, complete source
171+code means all the source code for all modules it contains, plus any
172+associated interface definition files, plus the scripts used to
173+control compilation and installation of the executable. However, as a
174+special exception, the source code distributed need not include
175+anything that is normally distributed (in either source or binary
176+form) with the major components (compiler, kernel, and so on) of the
177+operating system on which the executable runs, unless that component
178+itself accompanies the executable.
179+
180+If distribution of executable or object code is made by offering
181+access to copy from a designated place, then offering equivalent
182+access to copy the source code from the same place counts as
183+distribution of the source code, even though third parties are not
184+compelled to copy the source along with the object code.
185+
186+ 4. You may not copy, modify, sublicense, or distribute the Program
187+except as expressly provided under this License. Any attempt
188+otherwise to copy, modify, sublicense or distribute the Program is
189+void, and will automatically terminate your rights under this License.
190+However, parties who have received copies, or rights, from you under
191+this License will not have their licenses terminated so long as such
192+parties remain in full compliance.
193+
194+ 5. You are not required to accept this License, since you have not
195+signed it. However, nothing else grants you permission to modify or
196+distribute the Program or its derivative works. These actions are
197+prohibited by law if you do not accept this License. Therefore, by
198+modifying or distributing the Program (or any work based on the
199+Program), you indicate your acceptance of this License to do so, and
200+all its terms and conditions for copying, distributing or modifying
201+the Program or works based on it.
202+
203+ 6. Each time you redistribute the Program (or any work based on the
204+Program), the recipient automatically receives a license from the
205+original licensor to copy, distribute or modify the Program subject to
206+these terms and conditions. You may not impose any further
207+restrictions on the recipients' exercise of the rights granted herein.
208+You are not responsible for enforcing compliance by third parties to
209+this License.
210+
211+ 7. If, as a consequence of a court judgment or allegation of patent
212+infringement or for any other reason (not limited to patent issues),
213+conditions are imposed on you (whether by court order, agreement or
214+otherwise) that contradict the conditions of this License, they do not
215+excuse you from the conditions of this License. If you cannot
216+distribute so as to satisfy simultaneously your obligations under this
217+License and any other pertinent obligations, then as a consequence you
218+may not distribute the Program at all. For example, if a patent
219+license would not permit royalty-free redistribution of the Program by
220+all those who receive copies directly or indirectly through you, then
221+the only way you could satisfy both it and this License would be to
222+refrain entirely from distribution of the Program.
223+
224+If any portion of this section is held invalid or unenforceable under
225+any particular circumstance, the balance of the section is intended to
226+apply and the section as a whole is intended to apply in other
227+circumstances.
228+
229+It is not the purpose of this section to induce you to infringe any
230+patents or other property right claims or to contest validity of any
231+such claims; this section has the sole purpose of protecting the
232+integrity of the free software distribution system, which is
233+implemented by public license practices. Many people have made
234+generous contributions to the wide range of software distributed
235+through that system in reliance on consistent application of that
236+system; it is up to the author/donor to decide if he or she is willing
237+to distribute software through any other system and a licensee cannot
238+impose that choice.
239+
240+This section is intended to make thoroughly clear what is believed to
241+be a consequence of the rest of this License.
242+
243+ 8. If the distribution and/or use of the Program is restricted in
244+certain countries either by patents or by copyrighted interfaces, the
245+original copyright holder who places the Program under this License
246+may add an explicit geographical distribution limitation excluding
247+those countries, so that distribution is permitted only in or among
248+countries not thus excluded. In such case, this License incorporates
249+the limitation as if written in the body of this License.
250+
251+ 9. The Free Software Foundation may publish revised and/or new versions
252+of the General Public License from time to time. Such new versions will
253+be similar in spirit to the present version, but may differ in detail to
254+address new problems or concerns.
255+
256+Each version is given a distinguishing version number. If the Program
257+specifies a version number of this License which applies to it and "any
258+later version", you have the option of following the terms and conditions
259+either of that version or of any later version published by the Free
260+Software Foundation. If the Program does not specify a version number of
261+this License, you may choose any version ever published by the Free Software
262+Foundation.
263+
264+ 10. If you wish to incorporate parts of the Program into other free
265+programs whose distribution conditions are different, write to the author
266+to ask for permission. For software which is copyrighted by the Free
267+Software Foundation, write to the Free Software Foundation; we sometimes
268+make exceptions for this. Our decision will be guided by the two goals
269+of preserving the free status of all derivatives of our free software and
270+of promoting the sharing and reuse of software generally.
271+
272+ NO WARRANTY
273+
274+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
275+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
276+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
277+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
278+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
279+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
280+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
281+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
282+REPAIR OR CORRECTION.
283+
284+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
285+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
286+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
287+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
288+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
289+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
290+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
291+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
292+POSSIBILITY OF SUCH DAMAGES.
293+
294+ END OF TERMS AND CONDITIONS
295+
296+ How to Apply These Terms to Your New Programs
297+
298+ If you develop a new program, and you want it to be of the greatest
299+possible use to the public, the best way to achieve this is to make it
300+free software which everyone can redistribute and change under these terms.
301+
302+ To do so, attach the following notices to the program. It is safest
303+to attach them to the start of each source file to most effectively
304+convey the exclusion of warranty; and each file should have at least
305+the "copyright" line and a pointer to where the full notice is found.
306+
307+ <one line to give the program's name and a brief idea of what it does.>
308+ Copyright (C) <year> <name of author>
309+
310+ This program is free software; you can redistribute it and/or modify
311+ it under the terms of the GNU General Public License as published by
312+ the Free Software Foundation; either version 2 of the License, or
313+ (at your option) any later version.
314+
315+ This program is distributed in the hope that it will be useful,
316+ but WITHOUT ANY WARRANTY; without even the implied warranty of
317+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
318+ GNU General Public License for more details.
319+
320+ You should have received a copy of the GNU General Public License along
321+ with this program; if not, write to the Free Software Foundation, Inc.,
322+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
323+
324+Also add information on how to contact you by electronic and paper mail.
325+
326+If the program is interactive, make it output a short notice like this
327+when it starts in an interactive mode:
328+
329+ Gnomovision version 69, Copyright (C) year name of author
330+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
331+ This is free software, and you are welcome to redistribute it
332+ under certain conditions; type `show c' for details.
333+
334+The hypothetical commands `show w' and `show c' should show the appropriate
335+parts of the General Public License. Of course, the commands you use may
336+be called something other than `show w' and `show c'; they could even be
337+mouse-clicks or menu items--whatever suits your program.
338+
339+You should also get your employer (if you work as a programmer) or your
340+school, if any, to sign a "copyright disclaimer" for the program, if
341+necessary. Here is a sample; alter the names:
342+
343+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
344+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
345+
346+ <signature of Ty Coon>, 1 April 1989
347+ Ty Coon, President of Vice
348+
349+This General Public License does not permit incorporating your program into
350+proprietary programs. If your program is a subroutine library, you may
351+consider it more useful to permit linking proprietary applications with the
352+library. If this is what you want to do, use the GNU Lesser General
353+Public License instead of this License.
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/setDPI.sh b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/setDPI.sh
new file mode 100644
index 000000000..04a2edd6c
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common-1.34/setDPI.sh
@@ -0,0 +1,92 @@
1#! /bin/sh
2#
3# Copyright Matthias Hentges <devel@hentges.net> (c) 2006
4# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
5#
6# Filename: setDPI.sh
7# Date: 09-Apr-06
8
9# This script configures Xft.dpi dependent on your screens DPI. This insures that the same font-size
10# setting of 7 can be used on all machines.
11
12
13XDEFAULTS="/etc/X11/Xdefaults"
14
15
16
17set_dpi() {
18
19 CURRENT_SETTING="`cat ${XDEFAULTS} | sed -n "/Xft.dpi\:/s/.*\:\(.*\)/\1/p" | sed -n "s/\ //p"`"
20
21 if test "$CURRENT_SETTING" != "$1"
22 then
23 echo "Using Xft.dpi of $SET_SCREEN_DPI for your $SCREEN_DPI DPI screen"
24
25 if grep -q "Xft.dpi" "$XDEFAULTS"
26 then
27 cat "${XDEFAULTS}" | sed "s/^Xft.dpi\:.*/Xft.dpi\: $SET_SCREEN_DPI/" > "${XDEFAULTS}_"
28 mv "${XDEFAULTS}_" "${XDEFAULTS}"
29 else
30 echo -e "Xft.dpi: $SET_SCREEN_DPI\n" >> "$XDEFAULTS"
31 fi
32 else
33 echo "Your $SCREEN_DPI DPI screen is already configured."
34 fi
35}
36
37set_rxvt_font() {
38
39 CURRENT_SETTING="`cat ${XDEFAULTS} | sed -n "/Rxvt\*font/s/\(.*\pixelsize=\)\(.*\)/\2/p"`"
40
41 if test "$1" -gt 100
42 then
43
44 # Configure the rxvt font-size for your screen here:
45 test "$1" -gt 180 -a "$1" -lt "221" && RXVT_FONT_SIZE=16
46
47 if test -z "$RXVT_FONT_SIZE"
48 then
49 echo "WARNING: No rxvt font-size configured for a $SCREEN_DPI DPI screen!"
50 echo "Defaulting to size 9"
51 RXVT_FONT_SIZE=9
52 fi
53
54 if test "$CURRENT_SETTING" != "$RXVT_FONT_SIZE"
55 then
56 echo "Using a rxvt font-size of $RXVT_FONT_SIZE"
57 cat ${XDEFAULTS} | sed "/Rxvt\*font/s/\(.*\pixelsize\)\(=*.*\)/\1=$RXVT_FONT_SIZE/" > ${XDEFAULTS}_
58 mv ${XDEFAULTS}_ ${XDEFAULTS}
59 else
60 echo "The rxvt font-size is already configured"
61 fi
62 fi
63}
64
65if test -z "$DISPLAY"
66then
67 echo "DISPLAY is not set, aborting..."
68 exit 0
69fi
70
71SCREEN_DPI="`/usr/bin/xdpyinfo | grep "dots per inch" | awk '{print $2}'| sed -n "s/\(.*\)x\(.*\)/\2/p"`"
72
73if test -z "$SCREEN_DPI"
74then
75 echo "WARNING: Couldn't read your screens DPI, defaulting to 100"
76 SCREEN_DPI=100
77fi
78
79# Configure your screen here:
80test "$SCREEN_DPI" -gt 180 -a "$SCREEN_DPI" -lt "221" && SET_SCREEN_DPI=160
81test "$SCREEN_DPI" -gt 90 -a "$SCREEN_DPI" -lt "121" && SET_SCREEN_DPI=100
82
83
84if test -z "$SET_SCREEN_DPI"
85then
86 echo "WARNING: No default configuration found for your $SCREEN_DPI DPI screen!"
87 echo "Using 100 DPI"
88 SET_SCREEN_DPI=100
89fi
90
91set_dpi "$SET_SCREEN_DPI"
92set_rxvt_font "$SCREEN_DPI"
diff --git a/meta-oe/recipes-graphics/xserver-common/xserver-common_1.34.bb b/meta-oe/recipes-graphics/xserver-common/xserver-common_1.34.bb
new file mode 100644
index 000000000..8269205b6
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-common/xserver-common_1.34.bb
@@ -0,0 +1,38 @@
1DESCRIPTION = "Common X11 scripts and support files"
2LICENSE = "GPL"
3LICENSE = "GPLv2"
4LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
5RDEPENDS_${PN} = "xmodmap xrandr xdpyinfo"
6PR = "r0"
7
8PACKAGE_ARCH = "all"
9
10RCONFLICTS_${PN} = "xserver-kdrive-common"
11RREPLACES_${PN} = "xserver-kdrive-common"
12
13# we are using a gpe-style Makefile
14inherit gpe
15
16SRC_URI[md5sum] = "82f2f84cd96610e8f7b92c700cd31c14"
17SRC_URI[sha256sum] = "cd04c33418f776b1e13fcc7af3d6bd0c7cccd03fbabd7dbcd97f88166cc34210"
18
19SRC_URI_append = " \
20 file://gplv2-license.patch \
21 file://setDPI.sh \
22 file://89xdgautostart.sh"
23
24RDEPENDS_${PN}_append_shr = " xinput-calibrator "
25
26SRC_URI_append_shr = " file://89xTs_Calibrate.xinput_calibrator.patch \
27 file://90xXWindowManager.patch \
28 file://Xserver.add.nocursor.for.gta.patch \
29 file://Xserver.add.xserver-system.patch \
30 file://Xserver.add.dpi.for.gta.patch \
31 file://Xserver.n900.patch"
32
33do_install_append() {
34 install -m 0755 "${WORKDIR}/setDPI.sh" "${D}/etc/X11/Xinit.d/50setdpi"
35 install -m 0755 "${WORKDIR}/89xdgautostart.sh" "${D}/etc/X11/Xsession.d/89xdgautostart"
36 sed -i 's:^BINDIR=.*$:BINDIR=${bindir}:' ${D}/etc/X11/xserver-common
37}
38
diff --git a/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/gplv2-license.patch b/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/gplv2-license.patch
new file mode 100644
index 000000000..ec9325334
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/gplv2-license.patch
@@ -0,0 +1,353 @@
1COPYING: add GPLv2 license file
2
3this is a local file recipe and the license file is missing.In order
4to pass the license checksum checking, the license file is needed. So
5this patch add the GPLv2 license file.
6
7Signed-off-by: Yu Ke <ke.yu@intel.com>
8
9diff --git a/COPYING b/COPYING
10new file mode 100644
11index 0000000..d511905
12--- /dev/null
13+++ b/COPYING
14@@ -0,0 +1,339 @@
15+ GNU GENERAL PUBLIC LICENSE
16+ Version 2, June 1991
17+
18+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
19+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+ Everyone is permitted to copy and distribute verbatim copies
21+ of this license document, but changing it is not allowed.
22+
23+ Preamble
24+
25+ The licenses for most software are designed to take away your
26+freedom to share and change it. By contrast, the GNU General Public
27+License is intended to guarantee your freedom to share and change free
28+software--to make sure the software is free for all its users. This
29+General Public License applies to most of the Free Software
30+Foundation's software and to any other program whose authors commit to
31+using it. (Some other Free Software Foundation software is covered by
32+the GNU Lesser General Public License instead.) You can apply it to
33+your programs, too.
34+
35+ When we speak of free software, we are referring to freedom, not
36+price. Our General Public Licenses are designed to make sure that you
37+have the freedom to distribute copies of free software (and charge for
38+this service if you wish), that you receive source code or can get it
39+if you want it, that you can change the software or use pieces of it
40+in new free programs; and that you know you can do these things.
41+
42+ To protect your rights, we need to make restrictions that forbid
43+anyone to deny you these rights or to ask you to surrender the rights.
44+These restrictions translate to certain responsibilities for you if you
45+distribute copies of the software, or if you modify it.
46+
47+ For example, if you distribute copies of such a program, whether
48+gratis or for a fee, you must give the recipients all the rights that
49+you have. You must make sure that they, too, receive or can get the
50+source code. And you must show them these terms so they know their
51+rights.
52+
53+ We protect your rights with two steps: (1) copyright the software, and
54+(2) offer you this license which gives you legal permission to copy,
55+distribute and/or modify the software.
56+
57+ Also, for each author's protection and ours, we want to make certain
58+that everyone understands that there is no warranty for this free
59+software. If the software is modified by someone else and passed on, we
60+want its recipients to know that what they have is not the original, so
61+that any problems introduced by others will not reflect on the original
62+authors' reputations.
63+
64+ Finally, any free program is threatened constantly by software
65+patents. We wish to avoid the danger that redistributors of a free
66+program will individually obtain patent licenses, in effect making the
67+program proprietary. To prevent this, we have made it clear that any
68+patent must be licensed for everyone's free use or not licensed at all.
69+
70+ The precise terms and conditions for copying, distribution and
71+modification follow.
72+
73+ GNU GENERAL PUBLIC LICENSE
74+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
75+
76+ 0. This License applies to any program or other work which contains
77+a notice placed by the copyright holder saying it may be distributed
78+under the terms of this General Public License. The "Program", below,
79+refers to any such program or work, and a "work based on the Program"
80+means either the Program or any derivative work under copyright law:
81+that is to say, a work containing the Program or a portion of it,
82+either verbatim or with modifications and/or translated into another
83+language. (Hereinafter, translation is included without limitation in
84+the term "modification".) Each licensee is addressed as "you".
85+
86+Activities other than copying, distribution and modification are not
87+covered by this License; they are outside its scope. The act of
88+running the Program is not restricted, and the output from the Program
89+is covered only if its contents constitute a work based on the
90+Program (independent of having been made by running the Program).
91+Whether that is true depends on what the Program does.
92+
93+ 1. You may copy and distribute verbatim copies of the Program's
94+source code as you receive it, in any medium, provided that you
95+conspicuously and appropriately publish on each copy an appropriate
96+copyright notice and disclaimer of warranty; keep intact all the
97+notices that refer to this License and to the absence of any warranty;
98+and give any other recipients of the Program a copy of this License
99+along with the Program.
100+
101+You may charge a fee for the physical act of transferring a copy, and
102+you may at your option offer warranty protection in exchange for a fee.
103+
104+ 2. You may modify your copy or copies of the Program or any portion
105+of it, thus forming a work based on the Program, and copy and
106+distribute such modifications or work under the terms of Section 1
107+above, provided that you also meet all of these conditions:
108+
109+ a) You must cause the modified files to carry prominent notices
110+ stating that you changed the files and the date of any change.
111+
112+ b) You must cause any work that you distribute or publish, that in
113+ whole or in part contains or is derived from the Program or any
114+ part thereof, to be licensed as a whole at no charge to all third
115+ parties under the terms of this License.
116+
117+ c) If the modified program normally reads commands interactively
118+ when run, you must cause it, when started running for such
119+ interactive use in the most ordinary way, to print or display an
120+ announcement including an appropriate copyright notice and a
121+ notice that there is no warranty (or else, saying that you provide
122+ a warranty) and that users may redistribute the program under
123+ these conditions, and telling the user how to view a copy of this
124+ License. (Exception: if the Program itself is interactive but
125+ does not normally print such an announcement, your work based on
126+ the Program is not required to print an announcement.)
127+
128+These requirements apply to the modified work as a whole. If
129+identifiable sections of that work are not derived from the Program,
130+and can be reasonably considered independent and separate works in
131+themselves, then this License, and its terms, do not apply to those
132+sections when you distribute them as separate works. But when you
133+distribute the same sections as part of a whole which is a work based
134+on the Program, the distribution of the whole must be on the terms of
135+this License, whose permissions for other licensees extend to the
136+entire whole, and thus to each and every part regardless of who wrote it.
137+
138+Thus, it is not the intent of this section to claim rights or contest
139+your rights to work written entirely by you; rather, the intent is to
140+exercise the right to control the distribution of derivative or
141+collective works based on the Program.
142+
143+In addition, mere aggregation of another work not based on the Program
144+with the Program (or with a work based on the Program) on a volume of
145+a storage or distribution medium does not bring the other work under
146+the scope of this License.
147+
148+ 3. You may copy and distribute the Program (or a work based on it,
149+under Section 2) in object code or executable form under the terms of
150+Sections 1 and 2 above provided that you also do one of the following:
151+
152+ a) Accompany it with the complete corresponding machine-readable
153+ source code, which must be distributed under the terms of Sections
154+ 1 and 2 above on a medium customarily used for software interchange; or,
155+
156+ b) Accompany it with a written offer, valid for at least three
157+ years, to give any third party, for a charge no more than your
158+ cost of physically performing source distribution, a complete
159+ machine-readable copy of the corresponding source code, to be
160+ distributed under the terms of Sections 1 and 2 above on a medium
161+ customarily used for software interchange; or,
162+
163+ c) Accompany it with the information you received as to the offer
164+ to distribute corresponding source code. (This alternative is
165+ allowed only for noncommercial distribution and only if you
166+ received the program in object code or executable form with such
167+ an offer, in accord with Subsection b above.)
168+
169+The source code for a work means the preferred form of the work for
170+making modifications to it. For an executable work, complete source
171+code means all the source code for all modules it contains, plus any
172+associated interface definition files, plus the scripts used to
173+control compilation and installation of the executable. However, as a
174+special exception, the source code distributed need not include
175+anything that is normally distributed (in either source or binary
176+form) with the major components (compiler, kernel, and so on) of the
177+operating system on which the executable runs, unless that component
178+itself accompanies the executable.
179+
180+If distribution of executable or object code is made by offering
181+access to copy from a designated place, then offering equivalent
182+access to copy the source code from the same place counts as
183+distribution of the source code, even though third parties are not
184+compelled to copy the source along with the object code.
185+
186+ 4. You may not copy, modify, sublicense, or distribute the Program
187+except as expressly provided under this License. Any attempt
188+otherwise to copy, modify, sublicense or distribute the Program is
189+void, and will automatically terminate your rights under this License.
190+However, parties who have received copies, or rights, from you under
191+this License will not have their licenses terminated so long as such
192+parties remain in full compliance.
193+
194+ 5. You are not required to accept this License, since you have not
195+signed it. However, nothing else grants you permission to modify or
196+distribute the Program or its derivative works. These actions are
197+prohibited by law if you do not accept this License. Therefore, by
198+modifying or distributing the Program (or any work based on the
199+Program), you indicate your acceptance of this License to do so, and
200+all its terms and conditions for copying, distributing or modifying
201+the Program or works based on it.
202+
203+ 6. Each time you redistribute the Program (or any work based on the
204+Program), the recipient automatically receives a license from the
205+original licensor to copy, distribute or modify the Program subject to
206+these terms and conditions. You may not impose any further
207+restrictions on the recipients' exercise of the rights granted herein.
208+You are not responsible for enforcing compliance by third parties to
209+this License.
210+
211+ 7. If, as a consequence of a court judgment or allegation of patent
212+infringement or for any other reason (not limited to patent issues),
213+conditions are imposed on you (whether by court order, agreement or
214+otherwise) that contradict the conditions of this License, they do not
215+excuse you from the conditions of this License. If you cannot
216+distribute so as to satisfy simultaneously your obligations under this
217+License and any other pertinent obligations, then as a consequence you
218+may not distribute the Program at all. For example, if a patent
219+license would not permit royalty-free redistribution of the Program by
220+all those who receive copies directly or indirectly through you, then
221+the only way you could satisfy both it and this License would be to
222+refrain entirely from distribution of the Program.
223+
224+If any portion of this section is held invalid or unenforceable under
225+any particular circumstance, the balance of the section is intended to
226+apply and the section as a whole is intended to apply in other
227+circumstances.
228+
229+It is not the purpose of this section to induce you to infringe any
230+patents or other property right claims or to contest validity of any
231+such claims; this section has the sole purpose of protecting the
232+integrity of the free software distribution system, which is
233+implemented by public license practices. Many people have made
234+generous contributions to the wide range of software distributed
235+through that system in reliance on consistent application of that
236+system; it is up to the author/donor to decide if he or she is willing
237+to distribute software through any other system and a licensee cannot
238+impose that choice.
239+
240+This section is intended to make thoroughly clear what is believed to
241+be a consequence of the rest of this License.
242+
243+ 8. If the distribution and/or use of the Program is restricted in
244+certain countries either by patents or by copyrighted interfaces, the
245+original copyright holder who places the Program under this License
246+may add an explicit geographical distribution limitation excluding
247+those countries, so that distribution is permitted only in or among
248+countries not thus excluded. In such case, this License incorporates
249+the limitation as if written in the body of this License.
250+
251+ 9. The Free Software Foundation may publish revised and/or new versions
252+of the General Public License from time to time. Such new versions will
253+be similar in spirit to the present version, but may differ in detail to
254+address new problems or concerns.
255+
256+Each version is given a distinguishing version number. If the Program
257+specifies a version number of this License which applies to it and "any
258+later version", you have the option of following the terms and conditions
259+either of that version or of any later version published by the Free
260+Software Foundation. If the Program does not specify a version number of
261+this License, you may choose any version ever published by the Free Software
262+Foundation.
263+
264+ 10. If you wish to incorporate parts of the Program into other free
265+programs whose distribution conditions are different, write to the author
266+to ask for permission. For software which is copyrighted by the Free
267+Software Foundation, write to the Free Software Foundation; we sometimes
268+make exceptions for this. Our decision will be guided by the two goals
269+of preserving the free status of all derivatives of our free software and
270+of promoting the sharing and reuse of software generally.
271+
272+ NO WARRANTY
273+
274+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
275+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
276+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
277+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
278+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
279+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
280+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
281+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
282+REPAIR OR CORRECTION.
283+
284+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
285+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
286+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
287+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
288+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
289+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
290+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
291+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
292+POSSIBILITY OF SUCH DAMAGES.
293+
294+ END OF TERMS AND CONDITIONS
295+
296+ How to Apply These Terms to Your New Programs
297+
298+ If you develop a new program, and you want it to be of the greatest
299+possible use to the public, the best way to achieve this is to make it
300+free software which everyone can redistribute and change under these terms.
301+
302+ To do so, attach the following notices to the program. It is safest
303+to attach them to the start of each source file to most effectively
304+convey the exclusion of warranty; and each file should have at least
305+the "copyright" line and a pointer to where the full notice is found.
306+
307+ <one line to give the program's name and a brief idea of what it does.>
308+ Copyright (C) <year> <name of author>
309+
310+ This program is free software; you can redistribute it and/or modify
311+ it under the terms of the GNU General Public License as published by
312+ the Free Software Foundation; either version 2 of the License, or
313+ (at your option) any later version.
314+
315+ This program is distributed in the hope that it will be useful,
316+ but WITHOUT ANY WARRANTY; without even the implied warranty of
317+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
318+ GNU General Public License for more details.
319+
320+ You should have received a copy of the GNU General Public License along
321+ with this program; if not, write to the Free Software Foundation, Inc.,
322+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
323+
324+Also add information on how to contact you by electronic and paper mail.
325+
326+If the program is interactive, make it output a short notice like this
327+when it starts in an interactive mode:
328+
329+ Gnomovision version 69, Copyright (C) year name of author
330+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
331+ This is free software, and you are welcome to redistribute it
332+ under certain conditions; type `show c' for details.
333+
334+The hypothetical commands `show w' and `show c' should show the appropriate
335+parts of the General Public License. Of course, the commands you use may
336+be called something other than `show w' and `show c'; they could even be
337+mouse-clicks or menu items--whatever suits your program.
338+
339+You should also get your employer (if you work as a programmer) or your
340+school, if any, to sign a "copyright disclaimer" for the program, if
341+necessary. Here is a sample; alter the names:
342+
343+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
344+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
345+
346+ <signature of Ty Coon>, 1 April 1989
347+ Ty Coon, President of Vice
348+
349+This General Public License does not permit incorporating your program into
350+proprietary programs. If your program is a subroutine library, you may
351+consider it more useful to permit linking proprietary applications with the
352+library. If this is what you want to do, use the GNU Lesser General
353+Public License instead of this License.
diff --git a/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm b/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm
new file mode 100755
index 000000000..39ce890fd
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init-2.0/xserver-nodm
@@ -0,0 +1,44 @@
1#!/bin/sh
2
3. /etc/init.d/functions
4
5for x in $(cat /proc/cmdline); do
6 case $x in
7 x11=false)
8 echo "X Server disabled"
9 exit 0;
10 ;;
11 esac
12done
13
14case "$1" in
15 start)
16 # We don't want this script to block the rest of the boot process
17 if [ "$2" != "background" ]; then
18 $0 $1 background &
19 else
20 . /etc/profile
21
22 echo "Starting Xserver"
23 . /etc/X11/xserver-common
24 xinit /etc/X11/Xsession -- `which $XSERVER` $ARGS >/var/log/Xsession.log 2>&1
25 fi
26 ;;
27
28 stop)
29 echo "Stopping XServer"
30 killproc xinit
31 ;;
32
33 restart)
34 $0 stop
35 sleep 1
36 $0 start
37 ;;
38
39 *)
40 echo "usage: $0 { start | stop | restart }"
41 ;;
42esac
43
44exit 0
diff --git a/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init_2.0.bb b/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init_2.0.bb
new file mode 100644
index 000000000..8310bcd81
--- /dev/null
+++ b/meta-oe/recipes-graphics/xserver-nodm-init/xserver-nodm-init_2.0.bb
@@ -0,0 +1,27 @@
1DESCRIPTION = "Simple Xserver Init Script (no dm)"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4SECTION = "x11"
5PRIORITY = "optional"
6RDEPENDS_${PN} = "xserver-common (>= 1.30) xinit"
7DEFAULT_PREFERENCE = "-1"
8PR = "r4"
9
10SRC_URI = "file://xserver-nodm \
11 file://gplv2-license.patch \
12"
13S = ${WORKDIR}
14
15PACKAGE_ARCH = "all"
16
17do_install() {
18 install -d ${D}/etc
19 install -d ${D}/etc/init.d
20 install xserver-nodm ${D}/etc/init.d
21}
22
23inherit update-rc.d
24
25INITSCRIPT_NAME = "xserver-nodm"
26INITSCRIPT_PARAMS = "start 01 5 2 . stop 01 0 1 6 ."
27INITSCRIPT_PARAMS_shr = "start 90 5 2 . stop 90 0 1 6 ."