Rev 5362 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5362 | Rev 5366 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | #else |
30 | #else |
31 | # include |
31 | # include |
32 | #endif |
32 | #endif |
33 | #include "va_display.h" |
33 | #include "va_display.h" |
Line 34... | Line 34... | ||
34 | 34 | ||
Line 35... | Line 35... | ||
35 | static int drm_fd = -1; |
35 | static int drm_fd = 0; |
36 | 36 | ||
37 | static VADisplay |
37 | static VADisplay |
38 | va_open_display_drm(void) |
38 | va_open_display_drm(void) |
39 | { |
- | |
Line 40... | Line -... | ||
40 | VADisplay va_dpy; |
- | |
41 | int i; |
- | |
42 | - | ||
43 | static const char *drm_device_paths[] = { |
- | |
44 | "/dev/dri/renderD128", |
- | |
45 | "/dev/dri/card0", |
- | |
46 | NULL |
- | |
47 | }; |
39 | { |
48 | 40 | VADisplay va_dpy; |
|
49 | for (i = 0; drm_device_paths[i]; i++) { |
41 | |
Line 50... | Line 42... | ||
50 | drm_fd = open(drm_device_paths[i], O_RDWR); |
42 | drm_fd = get_service("DISPLAY"); |
51 | if (drm_fd < 0) |
43 | if (drm_fd == 0) |
52 | continue; |
44 | return NULL; |
Line 53... | Line -... | ||
53 | - | ||
54 | va_dpy = vaGetDisplayDRM(drm_fd); |
45 | |
55 | if (va_dpy) |
- | |
56 | return va_dpy; |
46 | va_dpy = vaGetDisplayDRM(drm_fd); |
57 | 47 | if (va_dpy) |
|
Line 58... | Line 48... | ||
58 | close(drm_fd); |
48 | return va_dpy; |
59 | drm_fd = -1; |
49 | |
60 | } |
50 | drm_fd = 0; |
61 | return NULL; |
- | |
62 | } |
- | |
63 | - | ||
64 | static void |
- | |
65 | va_close_display_drm(VADisplay va_dpy) |
51 | return NULL; |
66 | { |
52 | } |
Line 67... | Line 53... | ||
67 | if (drm_fd < 0) |
53 | |
68 | return; |
54 | static void |