egl: Add EGL_RECORDABLE_ANDROID attribute
authorRob Herring <robh@kernel.org>
Tue, 2 Feb 2016 20:23:08 +0000 (14:23 -0600)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 1 Apr 2016 12:45:08 +0000 (13:45 +0100)
This is used by Android to select an eglconfig compatible with screen
recording.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Rob Herring <robh@kernel.org>
[Emil Velikov: add the _eglIsConfigAttribValid check]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/main/eglapi.c
src/egl/main/eglconfig.c
src/egl/main/eglconfig.h
src/egl/main/egldisplay.h

index 6c395bdf311c046ca63e8dc168e60b056c4f4be5..8886759011a1ad123fb6d111a2032b40e1fd0ac4 100644 (file)
@@ -383,6 +383,7 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
    /* Please keep these sorted alphabetically. */
    _EGL_CHECK_EXTENSION(ANDROID_framebuffer_target);
    _EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
+   _EGL_CHECK_EXTENSION(ANDROID_recordable);
 
    _EGL_CHECK_EXTENSION(CHROMIUM_sync_control);
 
index 7d2791ca34044dc582fa19509a3fe06c59c7ceac..435d9245384408868a1b81b17a5becb049880529 100644 (file)
@@ -249,6 +249,9 @@ static const struct {
    { EGL_FRAMEBUFFER_TARGET_ANDROID, ATTRIB_TYPE_BOOLEAN,
                                     ATTRIB_CRITERION_EXACT,
                                     EGL_DONT_CARE },
+   { EGL_RECORDABLE_ANDROID,        ATTRIB_TYPE_BOOLEAN,
+                                    ATTRIB_CRITERION_EXACT,
+                                    EGL_DONT_CARE },
 };
 
 
@@ -493,6 +496,8 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
       return conf->Display->Extensions.NOK_texture_from_pixmap;
    case EGL_FRAMEBUFFER_TARGET_ANDROID:
       return conf->Display->Extensions.ANDROID_framebuffer_target;
+   case EGL_RECORDABLE_ANDROID:
+      return conf->Display->Extensions.ANDROID_recordable;
    default:
       break;
    }
index 7bdb090c46cc3018638af45ad1121e5127f49075..22da697e83c32599b866e455719d4366354402fe 100644 (file)
@@ -87,6 +87,7 @@ struct _egl_config
    /* extensions */
    EGLint YInvertedNOK;
    EGLint FramebufferTargetAndroid;
+   EGLint RecordableAndroid;
 };
 
 
@@ -135,6 +136,7 @@ _eglOffsetOfConfig(EGLint attr)
    /* extensions */
    ATTRIB_MAP(EGL_Y_INVERTED_NOK,            YInvertedNOK);
    ATTRIB_MAP(EGL_FRAMEBUFFER_TARGET_ANDROID, FramebufferTargetAndroid);
+   ATTRIB_MAP(EGL_RECORDABLE_ANDROID,        RecordableAndroid);
 #undef ATTRIB_MAP
    default:
       return -1;
index a468a31278434634e03220ce7d03beb3568becf7..6bfc8589a42786958cfdc5d5010852445f0384d4 100644 (file)
@@ -92,6 +92,7 @@ struct _egl_extensions
    /* Please keep these sorted alphabetically. */
    EGLBoolean ANDROID_framebuffer_target;
    EGLBoolean ANDROID_image_native_buffer;
+   EGLBoolean ANDROID_recordable;
 
    EGLBoolean CHROMIUM_sync_control;