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

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 dd145a1195ef87b258a90286eaf8c65495d9c8cf..6c395bdf311c046ca63e8dc168e60b056c4f4be5 100644 (file)
@@ -381,6 +381,7 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
    char *exts = dpy->ExtensionsString;
 
    /* Please keep these sorted alphabetically. */
+   _EGL_CHECK_EXTENSION(ANDROID_framebuffer_target);
    _EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
 
    _EGL_CHECK_EXTENSION(CHROMIUM_sync_control);
index d79c0e15422e044852c860a9409316be7c4d68ab..7d2791ca34044dc582fa19509a3fe06c59c7ceac 100644 (file)
@@ -245,7 +245,10 @@ static const struct {
    /* extensions */
    { EGL_Y_INVERTED_NOK,            ATTRIB_TYPE_BOOLEAN,
                                     ATTRIB_CRITERION_EXACT,
-                                    EGL_DONT_CARE }
+                                    EGL_DONT_CARE },
+   { EGL_FRAMEBUFFER_TARGET_ANDROID, ATTRIB_TYPE_BOOLEAN,
+                                    ATTRIB_CRITERION_EXACT,
+                                    EGL_DONT_CARE },
 };
 
 
@@ -488,6 +491,8 @@ _eglIsConfigAttribValid(_EGLConfig *conf, EGLint attr)
    switch (attr) {
    case EGL_Y_INVERTED_NOK:
       return conf->Display->Extensions.NOK_texture_from_pixmap;
+   case EGL_FRAMEBUFFER_TARGET_ANDROID:
+      return conf->Display->Extensions.ANDROID_framebuffer_target;
    default:
       break;
    }
index 84cb2276b707e60bc14c5914301bf7fda54b153a..7bdb090c46cc3018638af45ad1121e5127f49075 100644 (file)
@@ -86,6 +86,7 @@ struct _egl_config
 
    /* extensions */
    EGLint YInvertedNOK;
+   EGLint FramebufferTargetAndroid;
 };
 
 
@@ -133,6 +134,7 @@ _eglOffsetOfConfig(EGLint attr)
    ATTRIB_MAP(EGL_CONFORMANT,                Conformant);
    /* extensions */
    ATTRIB_MAP(EGL_Y_INVERTED_NOK,            YInvertedNOK);
+   ATTRIB_MAP(EGL_FRAMEBUFFER_TARGET_ANDROID, FramebufferTargetAndroid);
 #undef ATTRIB_MAP
    default:
       return -1;
index cec6d59e6a4ec01821f88778059ec03c385fdc36..a468a31278434634e03220ce7d03beb3568becf7 100644 (file)
@@ -90,6 +90,7 @@ struct _egl_resource
 struct _egl_extensions
 {
    /* Please keep these sorted alphabetically. */
+   EGLBoolean ANDROID_framebuffer_target;
    EGLBoolean ANDROID_image_native_buffer;
 
    EGLBoolean CHROMIUM_sync_control;