Mesa (master): st/egl: Remove unnecessary egl_g3d_find_pixmap_config.

Chia-I Wu olv at kemper.freedesktop.org
Wed Dec 22 05:22:57 UTC 2010


Module: Mesa
Branch: master
Commit: 0364c08d7f219ef3a250a4fd8396aacfdddf0368
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0364c08d7f219ef3a250a4fd8396aacfdddf0368

Author: Chia-I Wu <olv at lunarg.com>
Date:   Wed Dec 22 12:19:12 2010 +0800

st/egl: Remove unnecessary egl_g3d_find_pixmap_config.

It was used to find a compatible config for a given pixmap.  Now that a
config is optional for pixmap surface creation, the function is not
needed.

---

 .../state_trackers/egl/common/egl_g3d_api.c        |   27 +-------------------
 .../state_trackers/egl/common/egl_g3d_api.h        |    3 --
 .../state_trackers/egl/common/egl_g3d_image.c      |    8 +-----
 3 files changed, 2 insertions(+), 36 deletions(-)

diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.c b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
index 8e53e1d..a15c988 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_api.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.c
@@ -643,19 +643,13 @@ egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
    struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
    struct egl_g3d_surface *gsurf = egl_g3d_surface(surf);
    _EGLContext *ctx = _eglGetCurrentContext();
-   struct egl_g3d_config *gconf;
    struct native_surface *nsurf;
    struct pipe_resource *ptex;
 
    if (!gsurf->render_texture)
       return EGL_TRUE;
 
-   gconf = egl_g3d_config(egl_g3d_find_pixmap_config(dpy, target));
-   if (!gconf)
-      return _eglError(EGL_BAD_NATIVE_PIXMAP, "eglCopyBuffers");
-
-   nsurf = gdpy->native->create_pixmap_surface(gdpy->native,
-         target, gconf->native);
+   nsurf = gdpy->native->create_pixmap_surface(gdpy->native, target, NULL);
    if (!nsurf)
       return _eglError(EGL_BAD_NATIVE_PIXMAP, "eglCopyBuffers");
 
@@ -888,25 +882,6 @@ egl_g3d_show_screen_surface(_EGLDriver *drv, _EGLDisplay *dpy,
 
 #endif /* EGL_MESA_screen_surface */
 
-/**
- * Find a config that supports the pixmap.
- */
-_EGLConfig *
-egl_g3d_find_pixmap_config(_EGLDisplay *dpy, EGLNativePixmapType pix)
-{
-   struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
-   struct egl_g3d_config *gconf;
-   EGLint i;
-
-   for (i = 0; i < dpy->Configs->Size; i++) {
-      gconf = egl_g3d_config((_EGLConfig *) dpy->Configs->Elements[i]);
-      if (gdpy->native->is_pixmap_supported(gdpy->native, pix, gconf->native))
-         break;
-   }
-
-   return (i < dpy->Configs->Size) ? &gconf->base : NULL;
-}
-
 void
 egl_g3d_init_driver_api(_EGLDriver *drv)
 {
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_api.h b/src/gallium/state_trackers/egl/common/egl_g3d_api.h
index d5196c1..17fd795 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_api.h
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_api.h
@@ -31,7 +31,4 @@
 void
 egl_g3d_init_driver_api(_EGLDriver *drv);
 
-_EGLConfig *
-egl_g3d_find_pixmap_config(_EGLDisplay *dpy, EGLNativePixmapType pix);
-
 #endif /* _EGL_G3D_API_H_ */
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_image.c b/src/gallium/state_trackers/egl/common/egl_g3d_image.c
index b2d6b43..e6ff100 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_image.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_image.c
@@ -48,17 +48,11 @@ static struct pipe_resource *
 egl_g3d_reference_native_pixmap(_EGLDisplay *dpy, EGLNativePixmapType pix)
 {
    struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
-   struct egl_g3d_config *gconf;
    struct native_surface *nsurf;
    struct pipe_resource *textures[NUM_NATIVE_ATTACHMENTS];
    enum native_attachment natt;
 
-   gconf = egl_g3d_config(egl_g3d_find_pixmap_config(dpy, pix));
-   if (!gconf)
-      return NULL;
-
-   nsurf = gdpy->native->create_pixmap_surface(gdpy->native,
-         pix, gconf->native);
+   nsurf = gdpy->native->create_pixmap_surface(gdpy->native, pix, NULL);
    if (!nsurf)
       return NULL;
 




More information about the mesa-commit mailing list