[Mesa-dev] [PATCH 3/6] egl: Add EGL_MESA_image_system_use

Jakob Bornecrantz wallbraker at gmail.com
Sat May 29 05:56:31 PDT 2010


---
 include/EGL/eglext.h                       |    7 +++
 src/egl/docs/EGL_MESA_image_system_use.txt |   80 ++++++++++++++++++++++++++++
 src/egl/main/egldisplay.h                  |    1 +
 src/egl/main/eglimage.c                    |   13 +++++
 src/egl/main/eglimage.h                    |    3 +
 src/egl/main/eglmisc.c                     |    3 +
 6 files changed, 107 insertions(+), 0 deletions(-)
 create mode 100644 src/egl/docs/EGL_MESA_image_system_use.txt

diff --git a/include/EGL/eglext.h b/include/EGL/eglext.h
index 71bdd59..a00a1e9 100644
--- a/include/EGL/eglext.h
+++ b/include/EGL/eglext.h
@@ -259,6 +259,13 @@ EGLAPI EGLBoolean EGLAPIENTRY eglGetImageAttribMESA(EGLDisplay dpy, EGLImageKHR
 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETIMAGEATTRIBMESA) (EGLDisplay dpy, EGLImageKHR img, EGLenum attrib, EGLint *out);
 #endif /* EGL_MESA_get_image_attrib */
 
+#ifndef EGL_MESA_image_system_use
+#define EGL_MESA_image_system_use 1
+#define EGL_SYSTEM_USE_MESA                  0x3201  /* eglCreateImageKHR attribute */
+#define EGL_SYSTEM_SCANOUT_BIT_MESA          0x0001  /* eglCreateImageKHR value */
+#define EGL_SYSTEM_SHARABLE_BIT_MESA         0x0002  /* eglCreateImageKHR value */
+#endif /* EGL_MESA_image_system_use */
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/egl/docs/EGL_MESA_image_system_use.txt b/src/egl/docs/EGL_MESA_image_system_use.txt
new file mode 100644
index 0000000..6aac6c5
--- /dev/null
+++ b/src/egl/docs/EGL_MESA_image_system_use.txt
@@ -0,0 +1,80 @@
+Name
+
+    MESA_image_system_use
+
+Name Strings
+
+    EGL_MESA_image_system_use
+
+Contributors
+
+    Jakob Bornecrantz
+
+Contacts
+
+    Jakob Bornecrantz, (wallbraker 'at' gmail.com)
+
+Status
+
+    Preliminary - totally subject to change.
+
+Version
+
+    Version 1, February 18, 2010
+
+Number
+
+    EGL Extension #?
+
+Dependencies
+
+    EGL_MESA_create_image is required
+
+Overview
+
+    Allows for specifing that EGLImages created with EGL_NEW_IMAGE_MESA
+    should be suitable for windowing system uses, like scanout and shared
+    between processes. As for example with DRM on Linux with KMS.
+
+New Types
+
+    None
+
+New Procedures and Functions
+
+    None
+
+New Tokens
+
+      Accepted as an attribute in the <attr_list> parameter of
+      eglCreateImageKHR:
+
+          EGL_SYSTEM_USE_MESA                           0x????
+          EGL_SYSTEM_SCANOUT_BIT_MESA                   0x0001
+          EGL_SYSTEM_SHARABLE_BIT_MESA                  0x0002
+
+
+Additions to the EGL Image (EGL_KHR_base_image) Specification:
+
+    Add the following to Table bbb (Legal attributes for eglCreateImageKHR
+    <attr_list> parameter), Section 2.5.1 (EGLImage Specification)
+
+      +------------------------+------------------------------------+---------+
+      |                        |                                    | Default |
+      |  Attribute             |  Description                       | Value   |
+      +------------------------+------------------------------------+---------+
+      |  EGL_SYSTEM_USE_MESA   |  Bitmask of supported windowing    |  0      |
+      |                        |  system uses                       |         |
+      +------------------------+------------------------------------+---------+
+
+
+Issues
+
+    1.  Why must sharable be specified to as a use?
+
+        RESOLVED:  Some drivers does internal caching of resources differently
+        depending on if the resource is shared or not.
+
+
+Revision History
+
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index ea33ac0..3413fa3 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -50,6 +50,7 @@ struct _egl_extensions
    EGLBoolean NOK_texture_from_pixmap;
    EGLBoolean MESA_create_image;
    EGLBoolean MESA_get_image_attrib;
+   EGLBoolean MESA_image_system_use;
 
    char String[_EGL_MAX_EXTENSIONS_LEN];
 };
diff --git a/src/egl/main/eglimage.c b/src/egl/main/eglimage.c
index a5e16cd..855c4c0 100644
--- a/src/egl/main/eglimage.c
+++ b/src/egl/main/eglimage.c
@@ -42,6 +42,11 @@ _eglParseImageAttribList(_EGLImage *img, const EGLint *attrib_list)
          img->Height = val;
          break;
 #endif
+#ifdef EGL_MESA_image_system_use
+      case EGL_SYSTEM_USE_MESA:
+         img->UseSystem = val;
+         break;
+#endif
       default:
          /* unknown attrs are ignored */
          break;
@@ -72,6 +77,9 @@ _eglInitImage(_EGLImage *img, _EGLDisplay *dpy, const EGLint *attrib_list)
    img->Width = 0;
    img->Height = 0;
 #endif
+#ifdef EGL_MESA_image_system_use
+   img->UseSystem = 0;
+#endif
 
    err = _eglParseImageAttribList(img, attrib_list);
    if (err != EGL_SUCCESS)
@@ -119,6 +127,11 @@ _eglGetImageAttribMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *image, EGLe
       *out = image->Height;
       break;
 #endif
+#ifdef EGL_MESA_image_system_use
+   case EGL_SYSTEM_USE_MESA:
+      *out = image->UseSystem;
+      break;
+#endif
    default:
       return EGL_FALSE;
    }
diff --git a/src/egl/main/eglimage.h b/src/egl/main/eglimage.h
index 22f55ab..f07f12b 100644
--- a/src/egl/main/eglimage.h
+++ b/src/egl/main/eglimage.h
@@ -21,6 +21,9 @@ struct _egl_image
    EGLint Width;
    EGLint Height;
 #endif
+#ifdef EGL_MESA_image_system_use
+   EGLint UseSystem;
+#endif
 };
 
 
diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c
index 1f9120f..c9329cb 100644
--- a/src/egl/main/eglmisc.c
+++ b/src/egl/main/eglmisc.c
@@ -101,6 +101,9 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
 #ifdef EGL_MESA_get_image_attrib
    _EGL_CHECK_EXTENSION(MESA_get_image_attrib);
 #endif
+#ifdef EGL_MESA_image_system_use
+   _EGL_CHECK_EXTENSION(MESA_image_system_use);
+#endif
 
    _EGL_CHECK_EXTENSION(NOK_swap_region);
    _EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
-- 
1.7.0.4



More information about the mesa-dev mailing list