[Mesa-dev] [PATCH] egl: EXT_pixel_format_float plumbing

Eric Engestrom eric.engestrom at imgtec.com
Thu Nov 9 17:03:58 UTC 2017


On Thursday, 2017-11-09 09:40:43 +0200, Tapani Pälli wrote:
> Patch adds support and capability to match with new surface attribute,
> component type. Currently no configs with floating point type are exposed.

Have you tested android O with this patch? I think it might fail to
start, as it requires floating point configs to be present if the
extension is advertised.

Other than that, it looks all good to me:
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

> 
> With this change, following dEQP test starts to pass:
> 
>    dEQP-EGL.functional.choose_config.color_component_type_ext.dont_care
>    dEQP-EGL.functional.choose_config.color_component_type_ext.fixed
>    dEQP-EGL.functional.choose_config.color_component_type_ext.float
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 2 ++
>  src/egl/main/eglapi.c           | 1 +
>  src/egl/main/eglconfig.c        | 9 +++++++++
>  src/egl/main/eglconfig.h        | 2 ++
>  src/egl/main/egldisplay.h       | 1 +
>  5 files changed, 15 insertions(+)
> 
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index b486be7487..a511081df8 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -695,6 +695,8 @@ dri2_setup_screen(_EGLDisplay *disp)
>        dri2_renderer_query_integer(dri2_dpy,
>                                    __DRI2_RENDERER_HAS_CONTEXT_PRIORITY);
>  
> +   disp->Extensions.EXT_pixel_format_float = EGL_TRUE;
> +
>     if (dri2_renderer_query_integer(dri2_dpy,
>                                     __DRI2_RENDERER_HAS_FRAMEBUFFER_SRGB))
>        disp->Extensions.KHR_gl_colorspace = EGL_TRUE;
> diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
> index 76dabba2eb..c1bf5bbfe1 100644
> --- a/src/egl/main/eglapi.c
> +++ b/src/egl/main/eglapi.c
> @@ -514,6 +514,7 @@ _eglCreateExtensionsString(_EGLDisplay *dpy)
>     _EGL_CHECK_EXTENSION(KHR_surfaceless_context);
>     if (dpy->Extensions.EXT_swap_buffers_with_damage)
>        _eglAppendExtension(&exts, "EGL_KHR_swap_buffers_with_damage");
> +   _EGL_CHECK_EXTENSION(EXT_pixel_format_float);
>     _EGL_CHECK_EXTENSION(KHR_wait_sync);
>  
>     if (dpy->Extensions.KHR_no_config_context)
> diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c
> index f057b0bfe8..2d3b3ddd90 100644
> --- a/src/egl/main/eglconfig.c
> +++ b/src/egl/main/eglconfig.c
> @@ -68,6 +68,7 @@ _eglInitConfig(_EGLConfig *conf, _EGLDisplay *dpy, EGLint id)
>     conf->TransparentType = EGL_NONE;
>     conf->NativeVisualType = EGL_NONE;
>     conf->ColorBufferType = EGL_RGB_BUFFER;
> +   conf->ComponentType = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
>  }
>  
>  
> @@ -254,6 +255,9 @@ static const struct {
>     { EGL_RECORDABLE_ANDROID,        ATTRIB_TYPE_BOOLEAN,
>                                      ATTRIB_CRITERION_EXACT,
>                                      EGL_DONT_CARE },
> +   { EGL_COLOR_COMPONENT_TYPE_EXT,  ATTRIB_TYPE_ENUM,
> +                                    ATTRIB_CRITERION_EXACT,
> +                                    EGL_COLOR_COMPONENT_TYPE_FIXED_EXT },
>  };
>  
>  
> @@ -316,6 +320,11 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
>              if (val != EGL_RGB_BUFFER && val != EGL_LUMINANCE_BUFFER)
>                 valid = EGL_FALSE;
>              break;
> +         case EGL_COLOR_COMPONENT_TYPE_EXT:
> +            if (val != EGL_COLOR_COMPONENT_TYPE_FIXED_EXT &&
> +                val != EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT)
> +               valid = EGL_FALSE;
> +            break;
>           default:
>              assert(0);
>              break;
> diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h
> index 22da697e83..21f0a28412 100644
> --- a/src/egl/main/eglconfig.h
> +++ b/src/egl/main/eglconfig.h
> @@ -88,6 +88,7 @@ struct _egl_config
>     EGLint YInvertedNOK;
>     EGLint FramebufferTargetAndroid;
>     EGLint RecordableAndroid;
> +   EGLint ComponentType;
>  };
>  
>  
> @@ -137,6 +138,7 @@ _eglOffsetOfConfig(EGLint attr)
>     ATTRIB_MAP(EGL_Y_INVERTED_NOK,            YInvertedNOK);
>     ATTRIB_MAP(EGL_FRAMEBUFFER_TARGET_ANDROID, FramebufferTargetAndroid);
>     ATTRIB_MAP(EGL_RECORDABLE_ANDROID,        RecordableAndroid);
> +   ATTRIB_MAP(EGL_COLOR_COMPONENT_TYPE_EXT,  ComponentType);
>  #undef ATTRIB_MAP
>     default:
>        return -1;
> diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
> index 981cbf4ca0..0f57680b21 100644
> --- a/src/egl/main/egldisplay.h
> +++ b/src/egl/main/egldisplay.h
> @@ -103,6 +103,7 @@ struct _egl_extensions
>     EGLBoolean EXT_create_context_robustness;
>     EGLBoolean EXT_image_dma_buf_import;
>     EGLBoolean EXT_image_dma_buf_import_modifiers;
> +   EGLBoolean EXT_pixel_format_float;
>     EGLBoolean EXT_swap_buffers_with_damage;
>  
>     unsigned int IMG_context_priority;
> -- 
> 2.13.6
> 


More information about the mesa-dev mailing list