Merge "Default dataspace must be UNKNOWN for compatibility"
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 7c4bdf9..27a45e0 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -505,9 +505,11 @@
                 if (!found) {
                     return false;
                 }
+                // Only change the dataSpace from default if the application
+                // has explicitly set the color space with a EGL_GL_COLORSPACE_KHR attribute.
+                dataSpace = modifyBufferDataspace(dataSpace, colorSpace);
             }
         }
-        dataSpace = modifyBufferDataspace(dataSpace, colorSpace);
     }
     return true;
 }