// cc -I/usr/include/drm -ldrm intron.c -o intron

#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <xf86drm.h>
#include <radeon_drm.h>

main()
{
    int fd;
    drm_radeon_setparam_t vbl_activate;

    if ((fd = drmOpen("radeon", 0)) < 0) {
	printf("drmOpen: %s\n", strerror(errno)); exit(-1);
    }
    vbl_activate.param = RADEON_SETPARAM_VBLANK_CRTC;
    vbl_activate.value = DRM_RADEON_VBLANK_CRTC1;
    if (ioctl(fd, DRM_IOCTL_RADEON_SETPARAM, &vbl_activate)) {
        printf("DRM_IOCTL_RADEON_SETPARAM: %s\n", strerror(errno)); exit(-1);
    }
}
