blob: 83fa56120809818bc2c44f2b9987ec7175c576be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include <stdio.h>
#include <assert.h>
#include "gbm.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(void)
{
int fd;
struct gbm_device *gbm;
struct gbm_bo *bo;
int ret;
fd = open("/dev/dri/card0", O_RDWR);
if (fd == -1)
return 1;
gbm = gbm_device_create(fd);
if (gbm == NULL)
return 1;
else
printf("gbm created\n");
bo = gbm_bo_create(gbm, 250, 250, GBM_BO_FORMAT_XRGB8888,
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
gbm_device_destroy(gbm);
close(fd);
return 0;
}
|