Skip to content

Instantly share code, notes, and snippets.

@ssvb
Created April 17, 2013 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssvb/5404771 to your computer and use it in GitHub Desktop.
Save ssvb/5404771 to your computer and use it in GitHub Desktop.
A hack to forcefully release the leaked sunxi disp layers.
#include <stdint.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#define DISP_CMD_LAYER_RELEASE 0x41
int fd;
int layer_release(int layer_id)
{
uint32_t tmp4[4];
tmp4[0] = 0;
tmp4[1] = layer_id;
return ioctl(fd, DISP_CMD_LAYER_RELEASE, &tmp4);
}
int main()
{
int id;
fd = open("/dev/disp", O_RDWR);
for (id = 101; id < 104; id++)
layer_release(id);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment