Skip to content

Instantly share code, notes, and snippets.

@varadgautam
varadgautam / pygl-ms-rbo-blit.py
Created August 12, 2016 13:10
test ms->ms and ms->non-ms blits
from ctypes import *
import sys
gl = cdll.LoadLibrary('libGL.so')
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
glCreateShader = gl.glCreateShader
@varadgautam
varadgautam / pygl-ms-fbo.py
Last active August 10, 2016 17:39
render to an ms fbo and blit
# render to an ms fbo and blit
from ctypes import *
import sys
gl = cdll.LoadLibrary('libGL.so')
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
x11perf results (reps/sec) on rpi2
without queue with queue % delta test
--- --- --- ---
1840000 2360000 28.26% 10x10 tiled rectangle (17x15 tile)
1920000 2440000 27.08% 10x10 tiled rectangle (4x4 tile)
1340000 1620000 20.90% 10x10 tiled rectangle (216x208 tile)
9900000 11900000 20.20% 10-pixel line
1310000 1570000 19.85% 10x10 tiled rectangle (161x145 tile)
2800000 3270000 16.79% 10x10 rectangle
@varadgautam
varadgautam / kitkat-x86-ifc6410-hacks.patch
Created August 25, 2015 05:23
`repo diff` to build kitkat-x86 for ifc6410
project device/generic/armv7-a-neon/
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 80a34cc..a064850 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -25,3 +25,5 @@ WPA_SUPPLICANT_VERSION := VER_0_8_X
USE_OPENGL_RENDERER := true
BOARD_USE_LEGACY_UI := true
diff --git a/init/util.c b/init/util.c
index 8dd56a1..80a9854 100644
--- a/init/util.c
+++ b/init/util.c
@@ -438,7 +438,7 @@ void get_hardware_name(char *hardware, unsigned int *revision)
if (x) {
x += 2;
n = 0;
- while (*x && *x != '\n') {
+ while (*x && *x != '\n' && *x != '(') {
@varadgautam
varadgautam / android-x86-ifc6410-jdk7.patch
Created May 1, 2015 17:24
build Android-x86 for IFC6410 with JDK7
project frameworks/base/
diff --git a/api/current.txt b/api/current.txt
index 8e69592..bd21366 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -133,6 +133,7 @@ package android {
field public static final java.lang.String TRANSMIT_IR = "android.permission.TRANSMIT_IR";
field public static final java.lang.String UNINSTALL_SHORTCUT = "com.android.launcher.permission.UNINSTALL_SHORTCUT";
field public static final java.lang.String UPDATE_DEVICE_STATS = "android.permission.UPDATE_DEVICE_STATS";
@varadgautam
varadgautam / uart_interrupt.c
Created June 7, 2014 13:03
simple uart interrupt handler
/* simple uart interrupt : echo when something received on serial */
/* does not work -- u-boot remaps the interrupt table :
* http://stackoverflow.com/questions/23964400/am335x-freertos-port-unable-to-handle-irqs-and-swi */
#define INTC_BASE 0x48200000
#define INTC_SIR_IRQ 0x40
#define IRQ_HANDLER 0x4030CE38 /* RAM exception vector : TRM 26.1.3.2 */
#define CM_PER_TIMER7_CLKCTRL 0x44E0007C
@varadgautam
varadgautam / uboot_hello_world.c
Created June 4, 2014 08:22
a simple independent U-Boot loadable application
/* a simple independent U-Boot loadable application */
/* use U-Boot's example makefile to compile */
#define UART0_BASE 0x44E09000
#define REG(x) (*((volatile unsigned int *) x))
void main(){
int c = 'x';
while(1){
REG(UART0_BASE + 0) = c;
@varadgautam
varadgautam / add-to-gtk-notebook.c
Created December 9, 2013 12:23
Adding an item to GtkNotebook's Default Popup
static GtkMenu*
notebook_create_tab_popup (notebook)
{
GtkWidget *menu;
gint n, i;
GtkWidget *menuitem;
n = gtk_notebook_get_n_pages (notebook);
menu = gtk_menu_new ();