i965: expose SRGB visuals and turn on EGL_KHR_gl_colorspace
authorTapani Pälli <tapani.palli@intel.com>
Tue, 31 Oct 2017 08:56:28 +0000 (10:56 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 9 Nov 2017 05:43:25 +0000 (07:43 +0200)
commitc591b1e59454db2e8854e36852e0d413ce38b2f2
treedf55979ce2f2402bd979baaf1807d14b6441cd55
parent4dc8458cd13154daa48bd97c3f8393daf02aa351
i965: expose SRGB visuals and turn on EGL_KHR_gl_colorspace

Patch exposes sRGB visuals and adds DRI integer query support for
__DRI2_RENDERER_HAS_FRAMEBUFFER_SRGB. Further changes make sure that
we mark if the app explicitly wanted sRGB and for these framebuffers
we don't turn sRGB off in intel_gles3_srgb_workaround. This way we
keep compatibility for existing applications relying on default sRGB
and ony add more visual support.

With this change, following dEQP tests start to pass:

   dEQP-EGL.functional.wide_color.window_8888_colorspace_srgb
   dEQP-EGL.functional.wide_color.pbuffer_8888_colorspace_srgb

v2: some code cleanup (Emil Velikov)
    update num_formats correctly (reported by deveee@gmail.com)

v3: cleanup, remove redundant is_srgb
    rename explicit_srgb as 'need_srgb' to follow style better

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (v2)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102264
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102354
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102503
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/intel_fbo.h
src/mesa/drivers/dri/i965/intel_screen.c