ilo: decode INTERFACE_DESCRIPTOR_DATA

This is at least much better than decoding as blobs.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo: tidy up message descriptor decoding

Move opcode to string mappings to functions of their own.  Have for consistent
outputs for similar opcodes.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
egl_dri2: fix double free on drm platforms

Earlier commit failed to attribure that for drm platforms one does not
call dri2_create_screen, thus it does not create the screen and
driver_configs but inherits them from the "display" - gbm.

As such wrap cleanup in Platform != _EGL_PLATFORM_DRM to prevent
the issue and still cleanup correctly for non-drm platforms.

v2:
 - Drop the ifdef HAVE_DRM_PLATFORM, reindent the code and fix the
comment block. Suggested by Ken.

Reported-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Mark Janes <mark.a.janes@intel.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
egl_dri2: add a note about dri2_create_screen

The function is not called by platform_drm. As such one needs to
pay special attention at teardown.

v2: Fix the comment block. Spotted by Ken.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
gbm/dri: cleanup memory leak on teardown

During teardown we free the driver_configs list pointer, but we forget
to deallocate each config in that list.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
i965: drop the custom gen8_instruction CFLAG

No longer needed as the file was removed with
commit 8c229d306b3f312adbdfbaf79967ee43fbfc839e
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Mon Aug 11 10:07:07 2014 -0700

    i965: Delete the Gen8 code generators.

    We now use the brw_eu_emit.c code instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
docs: Update minimum required LLVM version.
llvmpipe: Avoid deadlock when unloading opengl32.dll

On Windows, DllMain calls and thread creation/destruction are
serialized, so when llvmpipe is destroyed from DllMain waiting for the
rasterizer threads to finish will deadlock.

So, instead of waiting for rasterizer threads to have finished, simply wait for the
rasterizer threads to notify they are just about to finish.

Verified with this very simple program:

   #include <windows.h>
   int main() {
      HMODULE hModule = LoadLibraryA("opengl32.dll");
      FreeLibrary(hModule);
   }

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=76252

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
glsl/list: Add an exec_list_validate function

This can be very useful for trying to debug list corruptions.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
glsl/list: Move declaration before code.

Fixes MSVC build error.

shaderapi.c
src\glsl\list.h(535) : error C2143: syntax error : missing ';' before 'type'
src\glsl\list.h(535) : error C2143: syntax error : missing ')' before 'type'
src\glsl\list.h(536) : error C2065: 'node' : undeclared identifier

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86025
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
glsl/list: Revert unintentional file mode change in previous commit.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
util/format: Generate floating point constants for clamping.

This commit causes the generated C code to change as

            union util_format_r32g32b32a32_sscaled pixel;
  -         pixel.chan.r = (int32_t)CLAMP(src[0], -2147483648, 2147483647);
  -         pixel.chan.g = (int32_t)CLAMP(src[1], -2147483648, 2147483647);
  -         pixel.chan.b = (int32_t)CLAMP(src[2], -2147483648, 2147483647);
  -         pixel.chan.a = (int32_t)CLAMP(src[3], -2147483648, 2147483647);
  +         pixel.chan.r = (int32_t)CLAMP(src[0], -2147483648.0f, 2147483647.0f);
  +         pixel.chan.g = (int32_t)CLAMP(src[1], -2147483648.0f, 2147483647.0f);
  +         pixel.chan.b = (int32_t)CLAMP(src[2], -2147483648.0f, 2147483647.0f);
  +         pixel.chan.a = (int32_t)CLAMP(src[3], -2147483648.0f, 2147483647.0f);
            memcpy(dst, &pixel, sizeof pixel);

which surprisingly makes a difference for MSVC.

Thanks to Juraj Svec for diagnosing this and drafting a fix.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29661
util/format: Fix clamping to 32bit integers.

Use clamping constants that guarantee no integer overflows.

As spotted by Chris Forbes.

This causes the code to change as:

-         value |= (uint32_t)CLAMP(src[0], 0.0f, 4294967295.0f);
+         value |= (uint32_t)CLAMP(src[0], 0.0f, 4294967040.0f);

-         value |= (uint32_t)((int32_t)CLAMP(src[0], -2147483648.0f, 2147483647.0f));
+         value |= (uint32_t)((int32_t)CLAMP(src[0], -2147483648.0f, 2147483520.0f));

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Add release notes for the 10.3.3 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1a9cc5f50db5d27530a3449743b43aac389d781f)
docs: Add sha256 sums for the 10.3.3 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 9cc26056ee13f25c5785fef81b31487f1429baa4)
docs: add news item and link release notes for mesa 10.3.3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
i965: Set Line Width correctly on Cherryview and Skylake.

Line Width moved to DW1 bits 29:12.  It's actually now a U11.7.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
i965: Use ctx->Const.MaxLineWidth when clamping ctx->Line.Width.

Rather than hardcoding platform values in every code path, just use the
maximum value we set.

Currently, ctx->Const.LineWidth == 5, which is smaller than the hardware
limit.  But applications shouldn't be using a value larger than we
support anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
i965: Advertise larger line widths.

We've artificially been limiting this to 5 for no particular reason.

On Gen4-5, the limit is [0, 7.5] with a granularity of 0.5 (U3.1).
On Gen6+, the limit is [0, 7.9921875].  Since it's a U3.7, the
granularity should be 0.125 (1/8).

This patch conservatively advertises one granularity smaller than the
hardware's maximum value, just in case there's a problem using the
largest possible value.  On Gen4-5, this is 7.5 - 0.5 = 7.0.  On Gen6+,
this is 8.0 - 0.125 = 7.875.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
i965: Advertise a line width of 40.0 on Cherryview and Skylake.

According to the documentation, line widths higher than 40.0 may have
quality problems.  That's already 20 times larger than we've been
exposing, so it seems totally sufficient.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>