[Mesa-dev] [PATCH v3] egl: Support IMG_context_priority
Emil Velikov
emil.l.velikov at gmail.com
Wed Apr 12 13:31:16 UTC 2017
HI Chris,
The approach looks very good.
On 12 April 2017 at 11:11, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> @@ -312,6 +312,60 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
> ctx->Flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
> break;
>
> + case EGL_CONTEXT_PRIORITY_LEVEL_IMG:
> + if (dpy->Extensions.IMG_context_priority & (1 << bit))
> + ctx->ContextPriority = val;
> +
> + break;
> + }
> +
> default:
> err = EGL_BAD_ATTRIBUTE;
> break;
> @@ -505,6 +559,7 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy, _EGLConfig *conf,
> ctx->Flags = 0;
> ctx->Profile = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
> ctx->ResetNotificationStrategy = EGL_NO_RESET_NOTIFICATION_KHR;
> + ctx->ContextPriority = EGL_CONTEXT_PRIORITY_MEDIUM_IMG;
>
Nicely spotted.
> err = _eglParseContextAttribList(ctx, dpy, attrib_list);
> if (err == EGL_SUCCESS && ctx->Config) {
> @@ -570,6 +625,9 @@ _eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *c,
> case EGL_RENDER_BUFFER:
> *value = _eglQueryContextRenderBuffer(c);
> break;
> + case EGL_CONTEXT_PRIORITY_LEVEL_IMG:
> + *value = c->ContextPriority;
> + break;
> default:
> return _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
> + unsigned int IMG_context_priority;
> +#define __EGL_CONTEXT_PRIORITY_LOW_BIT 0
> +#define __EGL_CONTEXT_PRIORITY_MEDIUM_BIT 1
> +#define __EGL_CONTEXT_PRIORITY_HIGH_BIT 2
> +
Can we drop these these defines - we don't seem to do anything.
With that
Reviewed-by: Emil Velikov <emli.velikov at collabora.com>
-Emil
More information about the mesa-dev
mailing list