vo_opengl: vaapi: document DRM fourcc upstream defines

Add the upstream symbolic names as comments. Normally, these should be
defined in libdrm's drm_fourcc.h header. But DRM_FORMAT_R8 and
DRM_FORMAT_GR88 are not defined anywhere, except in the kernel userland
headers of Linux 4.3 (!). We don't want mpv to depend on bleeding-edge
Linux kernel headers, so this will have to do.

Also, just for completeness, add fourccs for the 3 and 4 channel
formats. I didn't manage to test them, though.
This commit is contained in:
wm4 committed 2015-09-25 12:03:36 +02:00
1 parent 456366b63b
commit 0b87bf9b72
1 file changed
+4 -3
+4 -3
View File
@@ -200,9 +200,10 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image,
mp_image_setfmt(&layout, mpfmt);
// (it would be nice if we could use EGL_IMAGE_INTERNAL_FORMAT_EXT)
int drm_fmts[4] = {MP_FOURCC('R', '8', ' ', ' '),
MP_FOURCC('G', 'R', '8', '8'),
0, 0};
int drm_fmts[4] = {MP_FOURCC('R', '8', ' ', ' '), // DRM_FORMAT_R8
MP_FOURCC('G', 'R', '8', '8'), // DRM_FORMAT_GR88
MP_FOURCC('R', 'G', '2', '4'), // DRM_FORMAT_RGB888
MP_FOURCC('R', 'A', '2', '4')}; // DRM_FORMAT_RGBA8888
for (int n = 0; n < layout.num_planes; n++) {
int attribs[20] = {EGL_NONE};