Skip to content

Instantly share code, notes, and snippets.

@notwa
Last active August 29, 2015 13:57
Show Gist options
  • Save notwa/9389325 to your computer and use it in GitHub Desktop.
Save notwa/9389325 to your computer and use it in GitHub Desktop.
vivante drivers for xorg
diff --git a/exa/src/vivante_fbdev/vivante_dri.c b/exa/src/vivante_fbdev/vivante_dri.c
index a7a7d5c..531e21b 100644
--- a/exa/src/vivante_fbdev/vivante_dri.c
+++ b/exa/src/vivante_fbdev/vivante_dri.c
@@ -118,7 +118,7 @@ Bool VivDRIScreenInit(ScreenPtr pScreen) {
pDRIInfo->busIdString =(char *)xalloc(64);
/* use = to copy string and it seems good, but when you free it, it will report invalid pointer, use strcpy instead */
//pDRIInfo->busIdString="platform:Vivante GCCore";
- strcpy(pDRIInfo->busIdString,"platform:Vivante GCCore");
+ strcpy(pDRIInfo->busIdString,"platform:Vivante GCCore:00");
pDRIInfo->ddxDriverMajorVersion = VIV_DRI_VERSION_MAJOR;
pDRIInfo->ddxDriverMinorVersion = VIV_DRI_VERSION_MINOR;
diff --git a/exa/src/vivante_util/vivante_debug.h b/exa/src/vivante_util/vivante_debug.h
index 3b5fd06..b41c854 100644
--- a/exa/src/vivante_util/vivante_debug.h
+++ b/exa/src/vivante_util/vivante_debug.h
@@ -39,23 +39,22 @@ extern "C" {
* DEBUG Macros (START)
*
******************************************************************************/
- //#define VIVFBDEV_DEBUG
+#define VIVFBDEV_DEBUG
#ifdef VIVFBDEV_DEBUG
-#define DEBUGP(x, args ...) fprintf(stderr, "[%s(), %s:%u]\n\n" \
-x, __FILE__, __FUNCTION__ ,__LINE__, ## args)
+#define DEBUGP(x, args ...) xf86Msg(X_INFO, "[%s:%u, %s()]\n" x, __FILE__, __LINE__, __FUNCTION__, ## args)
#else
#define DEBUGP(x, args ...)
#endif
#ifdef VIVFBDEV_DEBUG
#define TRACE_ENTER() \
- do { PrintEnter(); DEBUGP("ENTERED FUNCTION : %s\n", __FUNCTION__); } while (0)
+ do { DEBUGP("ENTERED FUNCTION : %s\n", __FUNCTION__); } while (0)
#define TRACE_EXIT(val) \
- do { PrintExit(); DEBUGP("EXITED FUNCTION : %s\n", __FUNCTION__); return val; } while (0)
+ do { DEBUGP("EXITED FUNCTION : %s\n", __FUNCTION__); return val; } while (0)
#define TRACE_INFO(x, args ...) \
- do { fprintf(stderr, "[INFO : %s(), %s:%u]\n\n" x, __FILE__, __FUNCTION__ ,__LINE__, ## args); } while (0)
+ do { DEBUGP(x, ## args); } while (0)
#define TRACE_ERROR(x, args ...) \
- do { fprintf(stderr, "[ERROR : %s(), %s:%u]\n\n" x, __FILE__, __FUNCTION__ ,__LINE__, ## args); } while (0)
+ do { xf86Msg(X_ERROR, "[%s:%u, %s()]\n" x, __FILE__, __LINE__, __FUNCTION__, ## args); } while (0)
#else
#define TRACE_ENTER() \
do { ; } while (0)
@@ -75,10 +74,6 @@ x, __FILE__, __FUNCTION__ ,__LINE__, ## args)
*
******************************************************************************/
- void PrintEnter();
- void PrintExit();
- void PrintString(const char* str);
-
#ifdef __cplusplus
}
#endif
_srcbase=xorg-drv-vivante
pkgname=${_srcbase}
pkgver=r5.75c3769
pkgrel=3
arch=(armv7h)
url="http://www.kernel.org/"
license=('MIT')
depends=('gpu-viv-bin-mx6q-x11')
provides=("$_srcbase")
conflicts=("$_srcbase")
# FIXME: don't require old headers
makedepends=('xorg-server-devel' 'linux-headers-imx6-cubox')
options=('!strip' 'buildflags')
source=("git://github.com/zOrg1331/${_srcbase}.git"
'rm-mibstore.patch'
'busid.patch'
'debug.patch')
md5sums=('SKIP'
'184e4c2d6b924d89b107c1ce40853ca8'
'df5b1149d1aafe7e4e5778308707ab9d'
'0c799d961d177a2872ed36900356edb8')
_moddir=/usr/lib/xorg/modules
pkgver() {
cd "${srcdir}/${_srcbase}"
echo -n 'r'
git rev-list --count HEAD | tr -d '\r\n'
echo -n '.'
git rev-parse --short HEAD
}
prepare() {
cd "${srcdir}/${_srcbase}"
git apply "${srcdir}/rm-mibstore.patch"
git apply "${srcdir}/busid.patch"
git apply "${srcdir}/debug.patch"
}
build() {
cd "${srcdir}/${_srcbase}/dri"
autoreconf --force --install
CFLAGS+=" -I../../exa/src/vivante_gal -I../../exa/src/vivante_util \
-I/usr/src/linux-3.0.35-11/include -I /opt/fsl/include" \
./configure --with-xorg-module-dir=${_moddir} --disable-static
make
cd "${srcdir}/${_srcbase}/exa"
autoreconf --force --install
LIBRARY_PATH='/opt/fsl/lib' \
CFLAGS+=" -I /opt/fsl/include" \
LDFLAGS+=" -L/opt/fsl/lib -lm -ldl -lX11 -lGAL" \
./configure --with-xorg-module-dir=${_moddir} --disable-static
make
}
package() {
cd "${srcdir}/${_srcbase}/dri"
make DESTDIR=${pkgdir} install
cd "${srcdir}/${_srcbase}/exa"
make DESTDIR=${pkgdir} install
mkdir -p ${pkgdir}/${_moddir}/dri/
mv ${pkgdir}/${_moddir}/extensions/libdri.so ${pkgdir}/${_moddir}/dri/vivante_dri.so
}
diff --git a/exa/src/vivante_fbdev/vivante_fbdev_driver.c b/exa/src/vivante_fbdev/vivante_fbdev_driver.c
index b5be8e2..d0288bc 100644
--- a/exa/src/vivante_fbdev/vivante_fbdev_driver.c
+++ b/exa/src/vivante_fbdev/vivante_fbdev_driver.c
@@ -746,7 +746,6 @@ VivScreenInit(SCREEN_INIT_ARGS_DECL) {
xf86SetBlackWhitePixels(pScreen);
- miInitializeBackingStore(pScreen);
xf86SetBackingStore(pScreen);
pScrn->vtSema = TRUE;
diff --git a/exa/src/vivante_util/vivante_common.h b/exa/src/vivante_util/vivante_common.h
index 98a475f..40c9b2d 100644
--- a/exa/src/vivante_util/vivante_common.h
+++ b/exa/src/vivante_util/vivante_common.h
@@ -48,7 +48,6 @@ extern "C" {
#include "mipointer.h"
-#include "mibstore.h"
#include "micmap.h"
#include "mipointrst.h"
#include "inputstr.h"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment