Compare commits

..

94 Commits

Author SHA1 Message Date
Dylan Baker
c5f5ce1e37 Bump version for 19.2.2 release 2019-10-23 09:06:39 -07:00
Dylan Baker
db2797251d docs: Add release notes for 19.2.2 2019-10-23 09:06:39 -07:00
Samuel Pitoiset
56f0434232 radv: fix updating bound fast ds clear values with different aspects
On GFX9, the driver is able to do an optimized fast depth/stencil
clear with only one aspect (ie. clear the stencil part of a
depth/stencil image). When this happens, the driver should only
update the clear values of the given aspect.

Note that it's currently only supported on GFX9 but I have some
local patches that extend this optimized path for other gens.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1967
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit a13320370e)
2019-10-22 08:51:44 -07:00
Bas Nieuwenhuizen
ad56aaef4f radv: Fix single stage constant flush with merged shaders.
e.g. a VERTEX only flush with tess on Vega should look at the TCS
to see which bits are needed.

CC: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1953
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit fd21ee8b52)
Conflicts resolved by Dylan Baker

Conflicts:
	src/amd/vulkan/radv_cmd_buffer.c
2019-10-22 08:51:15 -07:00
Lepton Wu
35b900310b egl/android: Remove our own reference to buffers.
We currently doesn't maintain it correctly and the buffer gets leaked if
surface is destroyed before calling swapping buffers.

From Android frameworks/native/libs/nativewindow/include/system/window.h:

  The window holds a reference to the buffer between dequeueBuffer and
  either queueBuffer or cancelBuffer, so clients only need their own
  reference if they might use the buffer after queueing or canceling it.

v2: Remove our own reference.

Fixes: 0212db3504 ("egl/android: Cancel any outstanding ANativeBuffer in surface destructor")

Reviewed-by: Chia-I Wu <olvaffe@gmail.com> (v1)
Reviewed-By: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
(cherry picked from commit f4ba31ff50)
2019-10-21 08:59:25 -07:00
Lionel Landwerlin
cb0215a6fb anv: fix memory leak on device destroy
v2: handle vma destruction if vkCreateDevice fails (Jordan)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1959
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit b30e01aef5)
2019-10-21 08:59:18 -07:00
Lionel Landwerlin
425fbe2902 anv: fix vkUpdateDescriptorSets with inline uniform blocks
With inline uniform blocks descriptor, the meaning of descriptorCount
is a number of bytes to copy into the descriptor. Don't try to use
that size as an index into the descriptor table.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 43f40dc7cb ("anv: Implement VK_EXT_inline_uniform_block")
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1195
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 3f8f52b241)
2019-10-21 08:59:11 -07:00
Lucas Stach
62f9ba1bf2 rbug: unwrap index buffer resource
All resources passed to the drivers below rbug need to be unwrapped before
being passed down. We missed to do this for the index buffer resource when
this was made part of the draw_info structure.

Fixes: 330d0607ed (gallium: remove pipe_index_buffer and set_index_buffer)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
(cherry picked from commit a75eb888e0)
2019-10-18 09:56:11 -07:00
Lucas Stach
306e82acb6 rbug: fix transmitted texture sizes
The rbug wire format defines the texture size parameters to be uint32_t sized
and uses memcpy to move the function parameters to the message structure.
This caused totally wrong transmitted texture sizes since the height and depth
paramterds have been changed to uint16_t in the gallium API. Fix this by doing
an explicit conversion to the correct representation before packing into the
wire message.

Fixes: e6428092f5 (gallium: decrease the size of pipe_resource - 64 -> 48 bytes)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
(cherry picked from commit 6174cba748)
2019-10-18 09:56:07 -07:00
Ian Romanick
ef906b4636 intel/vec4: Don't try both sources as immediates for DPH
DPH isn't actually commutative, so this doesn't work.  If the immediate
in src0 would be a VF candidate, we could do better. *shrug*

No shader-db changes on any Intel platform.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fixes: b04beaf41d ("intel/vec4: Try both sources as candidates for being immediates")
(cherry picked from commit 92252219d3)
2019-10-18 09:56:03 -07:00
Ian Romanick
e958b35a40 nir/search: Fix possible NULL dereference in is_fsign
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fixes: 09705747d7 ("nir/algebraic: Reassociate fadd into fmul in DPH-like pattern")
(cherry picked from commit 050e4e28bf)
2019-10-18 09:55:58 -07:00
Roland Scheidegger
16af8e9772 gallivm: Fix saturated signed psub/padd intrinsics on llvm 8
LLVM 8 did remove both the signed and unsigned sse2/avx intrinsics in
the end, and provide arch-independent llvm intrinsics instead.
Fixes a crash when using snorm framebuffers (tested with piglit
arb_color_buffer_float-render GL_RGBA8_SNORM -auto).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
CC: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 045f05a2f6)
Conflicts resolved by Dylan Baker
2019-10-17 09:29:01 -07:00
Samuel Pitoiset
01e31f8cab radv: fix DCC fast clear code for intensity formats (correctly)
Previous fix was pretty bogus.

This fixes a rendering regression with Nier (minimap too large).

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1943
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1952
Fixes: ea92273cea ("radv: fix DCC fast clear code for intensity formats")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit c644644c65)
2019-10-17 09:12:02 -07:00
Eric Engestrom
4d6fcddc65 util/u_atomic: fix return type of p_atomic_{inc,dec}_return() and p_atomic_{cmp,}xchg()
We're trying to cast the return type to the type of the var, but instead
we were casting `sizeof(*v)`.

Fixes: 6df72e970c ("util: Make u_atomic.h typeless.")
Fixes: 0a7f17cf5b ("util/u_atomic: add p_atomic_xchg")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
(cherry picked from commit aaab70035a)
2019-10-17 09:11:21 -07:00
Pierre-Eric Pelloux-Prayer
5694c20188 mesa: fix invalid target error handling for teximage
This commit moves the target check before using _mesa_get_current_tex_object
to fix a "Mesa implementation error: bad target in _mesa_get_current_tex_object()"
error.

Fixes: 9dd1f7cec0 ("mesa: pass gl_texture_object as arg to not depend on state")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 16233797f4)
2019-10-17 09:11:13 -07:00
James Xiong
9a929cfef2 iris: finish aux import on get_param
A buffer and its aux are imported separately, if the aux import is
not completed yet when resource_get_param is called, merge the
separate aux a.k.a the 2nd image into the main image.

Fixes: 246eebba4a ("iris: Export and import surfaces with modifiers that have aux data")

Signed-off-by: James Xiong <james.xiong@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit fd235484fe)
2019-10-17 09:11:06 -07:00
Lionel Landwerlin
ae4f569232 etnaviv: remove variable from global namespace
Found out by accident this was clashing with another driver.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Cc: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 701e0ac077)
2019-10-17 09:11:00 -07:00
Alan Coopersmith
9d13289ad4 intel/common: include unistd.h for ioctl() prototype on Solaris
Fixes build errors of:
In file included from ../src/intel/vulkan/anv_private.h:48,
                 from ../src/intel/vulkan/genX_blorp_exec.c:26:
../src/intel/common/gen_gem.h: In function ‘gen_ioctl’:
../src/intel/common/gen_gem.h:68:15: error: implicit declaration of function ‘ioctl’ [-Werror=implicit-function-declaration]
   68 |         ret = ioctl(fd, request, arg);
      |               ^~~~~
In file included from ../include/c11/threads_posix.h:35,
                 from ../include/c11/threads.h:66,
                 from ../src/mesa/main/mtypes.h:39,
                 from ../src/intel/compiler/brw_compiler.h:30,
                 from ../src/intel/vulkan/anv_private.h:51,
                 from ../src/intel/vulkan/genX_blorp_exec.c:26:
/usr/include/unistd.h: At top level:
/usr/include/unistd.h:471:12: error: conflicting types for ‘ioctl’
  471 | extern int ioctl(int, int, ...);
      |            ^~~~~
/usr/include/unistd.h:471:1: note: a parameter list with an ellipsis can’t match an empty parameter name list declaration
  471 | extern int ioctl(int, int, ...);
      | ^~~~~~
In file included from ../src/intel/vulkan/anv_private.h:48,
                 from ../src/intel/vulkan/genX_blorp_exec.c:26:
../src/intel/common/gen_gem.h:68:15: note: previous implicit declaration of ‘ioctl’ was here
   68 |         ret = ioctl(fd, request, arg);
      |               ^~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 6804b8e1ff)
2019-10-17 09:09:03 -07:00
Alan Coopersmith
9b49a4ea12 meson: recognize "sunos" as the system name for Solaris
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit d8a9420f6f)
Minor conflicts resolved by Dylan Baker
2019-10-17 09:08:50 -07:00
Alan Coopersmith
55a04df479 util: Solaris has linux-style pthread_setname_np
Fixes: dcf9d91a ("util: Handle differences in pthread_setname_np")

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 7040795a69)
2019-10-17 09:08:10 -07:00
Alan Coopersmith
45aa00da9f util: Workaround lack of flock on Solaris
v2: Replace autoconf check for flock() with meson check

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit b3028a9fb8)
Minor conflicts resolved by Dylan Baker
2019-10-17 09:07:40 -07:00
Alan Coopersmith
a1e6d1fb30 util: Make Solaris implemention of p_atomic_add work with gcc
gcc is very particular about where you place the (void) cast
The previous placement made it error out with:

In file included from disk_cache.c:40:0:
../../src/util/u_atomic.h:203:29: error: void value not ignored as it ought to be
 #define p_atomic_add(v, i) ((void)         \
                              ^
disk_cache.c:658:4: note: in expansion of macro ‘p_atomic_add’
    p_atomic_add(cache->size, size);
    ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit a56c3e3a47)
2019-10-17 09:07:01 -07:00
Alan Coopersmith
2380173433 c99_compat.h: Don't try to use 'restrict' in C++ code
Fixes build failures on Solaris in C++ files using gcc:

../src/util/u_math.h:628:41: error: expected ‘,’ or ‘...’ before ‘dest’
  628 | util_memcpy_cpu_to_le32(void * restrict dest, const void * restrict src, size_t n)
      |                                         ^~~~
../src/util/u_math.h: In function ‘void* util_memcpy_cpu_to_le32(void*)’:
../src/util/u_math.h:641:18: error: ‘dest’ was not declared in this scope
  641 |    return memcpy(dest, src, n);
      |                  ^~~~
../src/util/u_math.h:641:24: error: ‘src’ was not declared in this scope
  641 |    return memcpy(dest, src, n);
      |                        ^~~
../src/util/u_math.h:641:29: error: ‘n’ was not declared in this scope; did you mean ‘yn’?
  641 |    return memcpy(dest, src, n);
      |                             ^
      |                             yn

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit ddde652e70)
2019-10-17 09:07:00 -07:00
Samuel Pitoiset
45ebe99a88 Revert "radv: do not emit PKT3_CONTEXT_CONTROL with AMDGPU 3.6.0+"
This reverts commit 2ca8629fa9.

This was initially ported from RadeonSI, but in the meantime it has
been reverted because it might hang. Be conservative and re-introduce
this packet emission.

Unfortunately this doesn't fix anything known.

Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 4a3bdc6d22)
2019-10-15 10:05:50 -07:00
Lucas Stach
c1ca1602dd etnaviv: fix vertex buffer state emission for single stream GPUs
GPUs with a single supported vertex stream must use the single state
address to program the stream.

Fixes: 3d09bb390a (etnaviv: GC7000: State changes for HALTI3..5)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
(cherry picked from commit ce23bc9283)
2019-10-15 10:05:26 -07:00
Kenneth Graunke
91960ae890 iris: Implement the Gen < 9 tessellation quads workaround
Fixes several CTS tests:
- KHR-GL46.tessellation_shader.vertex.vertex_spacing
- KHR-GL46.tessellation_shader.tessellation_shader_point_mode.points_verification

Fixes: 823609b1a3 ("iris/WIP: add broadwell support")
(cherry picked from commit ac7af7c500)
2019-10-14 11:16:04 -07:00
Samuel Pitoiset
59e56bf05d radv: fix DCC fast clear code for intensity formats
This fixes a rendering issue with DiRT 4 on GFX10. Only GFX10 was
affected because intensity formats are different.

Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1923
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit ea92273cea)
2019-10-14 11:16:00 -07:00
Timothy Arceri
6f30614d73 glsl: fix crash compiling bindless samplers inside unnamed UBOs
The check to see if we were dealing with a buffer block was
too late and only worked for named UBOs.

Fixes: f32b01ca43 "glsl/linker: remove ubo explicit binding handling"

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1900
(cherry picked from commit 1294f01e06)
2019-10-14 11:15:56 -07:00
Bas Nieuwenhuizen
b87edab8a2 nir/dead_cf: Remove dead control flow after infinite loops.
And after discard-only loops. Otherwise we end up with dead code
which confuses nir_repair_ssa into adding a whole bunch of uses
of undefined. However, for derefs, we sometimes always expect to
get a variable instead of undefined.

Fixes dEQP-VK.graphicsfuzz.write-red-in-loop-nest on radv.

Fixes: c832820ce9 "nir/dead_cf: Repair SSA if the pass makes progress"
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1928
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
(cherry picked from commit 6da3bf2600)
2019-10-11 11:09:52 -07:00
Eric Engestrom
8355658fa8 meson: skip installation of GLVND-provided headers
Fixes: 93df862b6a ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1846
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 34ba363ab0)
2019-10-11 11:09:47 -07:00
Eric Engestrom
089aa74d57 meson: split Mesa headers as a separate installation
Fixes: 93df862b6a ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 1a7e9652c4)
2019-10-11 11:09:41 -07:00
Eric Engestrom
7f0d0ab83d meson: split headers one per line
Fixes: 93df862b6a ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit daae003f47)
2019-10-11 11:09:37 -07:00
Eric Engestrom
7b70f2ec47 meson: move a couple of include installs around
Preparation for a later commit.

Fixes: 93df862b6a ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit b9a5fb1f05)
2019-10-11 11:09:32 -07:00
Eric Engestrom
f446e56d30 meson: rename glvnd_missing_pc_files to not glvnd_has_headers_and_pc_files
This reflects better what is provided by glvnd or not.

Fixes: 93df862b6a ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit b57fa7ca49)
2019-10-11 11:09:26 -07:00
Eric Engestrom
767965b6fa GL: drop symbols mangling support
SCons and Meson have never supported that feature, and Autotools was
deleted over 6 months ago and no-one complained yet, so it's pretty
obvious nobody cares about it.

Fixes: 95aefc94a9 ("Delete autotools")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit a0829cf23b)
2019-10-11 11:09:22 -07:00
Bas Nieuwenhuizen
3deb4fa226 radv: Disallow sparse shared images.
Since we really cannot share them ever.

Also remove an unused switch.

Fixes: b70829708a "radv: Implement VK_KHR_external_memory"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 53b1372571)
2019-10-11 11:09:16 -07:00
Connor Abbott
0056943e69 nir/sink: Don't sink load_ubo to outside of its defining loop
Previously, this could have made the resource divergent in code like
that which is genereated by nir_lower_non_uniform_access.

Fixes: da8ed68a ('nir: replace nir_move_load_const() with nir_opt_sink()')
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
(cherry picked from commit 5ac32b2954)
2019-10-10 09:09:35 -07:00
Connor Abbott
d14d70de2f nir/sink: Rewrite loop handling logic
Previously, for code like:
loop {
    loop {
        a = load_ubo()
    }
    use(a)
}
adjust_block_for_loops() would return the block before the first loop.
Now we compute the range of allowed blocks and then walk the dominance
tree directly, guaranteeing directly that we always choose a block that
dominates all the uses and is dominated by the definition.

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
(cherry picked from commit af9296b8c0)
2019-10-10 09:09:27 -07:00
Alejandro Piñeiro
0beee2f723 v3d: take into account prim_counts_offset
Specifically when reading the primitive counters.

This fixed ~700 CTS tests using this pattern:
dEQP-GLES3.functional.transform_feedback.*

when run after tests like
dEQP-GLES3.functional.prerequisite.read_pixels on the same
caselist. When run individually those tests were passing because
prim_counts_offset was zero.

Fixes: 0f2d1dfe65 ("v3d: use the GPU to
       record primitives written to transform feedback")

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
(cherry picked from commit fa41a51891)
2019-10-10 09:05:34 -07:00
Samuel Pitoiset
c48dc6ad5f radv: bump minTexelBufferOffsetAlignment to 4
The spec has probably been misinterpreted during RADV bringup.

This fixes GPU hangs with dEQP-VK.binding_model.*offset_nonzero*.

Fixes: f4e499ec79 ("radv: add initial non-conformant radv vulkan driver")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 030e67fac3)
2019-10-10 09:04:55 -07:00
Samuel Pitoiset
03df69d6a1 drirc: enable vk_x11_override_min_image_count for DOOM
DOOM fails to handle more images than expected when the adaptative
sync mode is enabled.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1902
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit ad96c4987c)
2019-10-10 09:04:55 -07:00
Clément Guérin
47bc45ba1a radeonsi: enable zerovram for Rocket League
Fixes corruption on game startup.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1888

Cc: 19.1 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
(cherry picked from commit 5afbe87d21)
2019-10-10 09:04:55 -07:00
Kenneth Graunke
aa89c0a2bd iris: Properly unreference extra VBOs for draw parameters
bound_vertex_buffers doesn't include extra draw parameters buffers.
Tracking this correctly is kind of complicated, and iris_destroy_state
isn't exactly in a hot path, so just loop over all VBO bindings.

Fixes: 4122665dd9 (iris: Enable ARB_shader_draw_parameters support)
Reported-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
(cherry picked from commit face221283)
2019-10-10 09:04:55 -07:00
Dylan Baker
3e15620451 docs: Add SHA256 sum for 19.2.1 2019-10-09 10:19:16 -07:00
Dylan Baker
877417918f Bump version for 19.2.1 2019-10-09 09:47:07 -07:00
Dylan Baker
e19dc53aae docs: Add relnotes for 19.2.1 2019-10-09 09:47:07 -07:00
Dylan Baker
a06f8341d8 bin: delete unused releasing scripts
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Juan A. Suarez <jasuarez@igalia.com>
(cherry picked from commit 974e3ad004)
2019-10-09 09:46:04 -07:00
Dylan Baker
4f38287970 release: Add an update_release_calendar.py script
This script is for updating post version bump.

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Juan A. Suarez <jasuarez@igalia.com>
(cherry picked from commit 3226b12a09)
2019-10-09 09:46:04 -07:00
Dylan Baker
a4348e9594 scripts: Mesa 19.2.x only implements GL 4.5 2019-10-09 09:46:04 -07:00
Dylan Baker
61b3371acc scripts: Add a gen_release_notes.py script
This script is responsible for generating an entire page in the
docs/relnotes/ directory. It includes a template for the page, and uses
mako to fill in the necessary bits. It is designed to be purely fire and
forget, calculating previous versions, shortlogs, bug fixes, and dates.

Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Juan A. Suarez <jasuarez@igalia.com>
(cherry picked from commit 86079447da)
2019-10-09 09:15:28 -07:00
Eric Engestrom
5a0361ce09 meson: add missing idep_nir_headers in iris_gen_libs
Fixes: 4929f020c3 ("iris: better SBE")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 731097c747)
2019-10-08 09:18:31 -07:00
Tapani Pälli
06b8b29a0a anv/android: fix images created with external format support
This fixes a case where user first creates image and then later binds it
with memory created from AHW buffer.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
(cherry picked from commit e4a826b2c8)
2019-10-08 09:18:22 -07:00
Prodea Alexandru-Liviu
9052318565 scons/MSYS2-MinGW-W64: Fix build options defaults
Signed-off-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Cc: <mesa-stable@lists.freedesktop.org>

When building in a MSYS2 Mingw-w64 environment Mesa3D sets wrong default build options which inevitably lead to build failure.

(cherry picked from commit 6309c31fd8)
2019-10-07 10:49:04 -07:00
Lionel Landwerlin
85193e808a intel/isl: Set null surface format to R32_UINT
It appears we never had a test in piglit or deqp sampling from a null
surface...

It turns out this triggers a hang on IVB only. Updating the null
surface format to R32_UINT fixes the hang on ivb and doesn't affect
other platforms, so set it by default for all platforms.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1872
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c445d6f66e)
2019-10-07 10:48:14 -07:00
Lionel Landwerlin
34d738ff2e intel: fix subslice computation from topology data
We're missing the offset of the slice in the subslice mask...

This worked for most platforms that don't have first slice fused off
because we would reread the same mask from slice0 again and again...

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c1900f5b0f ("intel: devinfo: add helper functions to fill fusing masks values")
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1869
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
(cherry picked from commit d36763b2a4)
2019-10-07 10:48:14 -07:00
Andres Gomez
c289ac9a22 egl: Remove the 565 pbuffer-only EGL config under X11.
The CTS finally has agreed to drop the requirement for a
565-no-depth-no-stencil config for ES 3.0. Hence we can now remove the
code to satisfy this requirement using a pbuffer-only visual with
whatever other buffers the driver happens to have given us.

This reverts commit 82607f8a90,
commit 6ad31c4ff3 and
commit dacb11a585.

v2:
  - Reference the VK-GL-CTS issue (Eric E.).

v3:
  - Don't revert
    fc21394bc4 ("egl: Quiet warning about front buffer rendering for pixmaps/pbuffers")
    (Kenneth).

References: VK-GL-CTS issue 1601.
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Andres Gomez <agomez@igalia.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 02c265be9d)
Conflicts resolved by Dylan Baker
2019-10-07 10:48:14 -07:00
Dylan Baker
bad5e64da8 meson: Only error building gallium video without libdrm when the platform is drm
Fixes: 3b265f61f5
       ("meson: gallium media state trackers require libdrm with x11")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1878
Tested-by: Vinson Lee <vlee@freedesktop.org>
(cherry picked from commit 1481d05409)
2019-10-07 10:48:14 -07:00
Dylan Baker
52cf623955 .cherry-ignore: Update for 19.2.1 cycle 2019-10-07 10:48:14 -07:00
Bas Nieuwenhuizen
78a05b8cbb radv: Fix condition for skipping the continue CS.
We need the continue CS for referencing the tess/GDS/sample position BOs.

Fixes: 46e52df34d "radv: add tessellation ring allocation support. (v2)"
Fixes: e1dc3ab753 "radv/gfx10: allocate GDS/OA buffer objects for NGG streamout"
Fixes: 1171b304f3 "radv: overhaul fragment shader sample positions."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit 8ad3d8b178)
2019-10-04 15:54:22 +02:00
Lionel Landwerlin
676471a092 intel: fix topology query
i915 will report ENODEV on generations prior to Haswell because there
is no point in reporting values on those. This is prior any fusing
could happen on parts with identical PCI ids.

This query call was previously only triggered on generations that
support performance queries, which happens to match generation for
which i915 reports topology, but the commit pointed below started
using it on all generations.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/1860
Cc: <mesa-stable@lists.freedesktop.org>
Fixes: 96e1c945f2 ("i965: Move device info initialization to common code")
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
(cherry picked from commit 1c6fdbc83c)
2019-10-03 09:56:36 -07:00
Marek Olšák
0b97377f58 radeonsi/gfx10: fix corruption for chips with harvested TCCs
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 235ebe9163)
2019-10-01 15:29:22 -07:00
Marek Olšák
33eecbcc9b ac: add radeon_info::tcc_harvested
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 8cbe83445b)
Conflicts resolved by Dylan Baker

Conflicts:
	src/amd/common/ac_gpu_info.h
2019-10-01 15:28:53 -07:00
Lionel Landwerlin
2bbe4c69c8 mesa: don't forget to clear _Layer field on texture unit
On the Android Antutu benchmark we ran into an assert in ISL where the
(base layer + num layers) > total layers. It turns out the core of
mesa forgot to clear the _Layer variable, potentially leaving an
inconsistent value.

v2: Pull setting u->_Layer out of the conditional blocks (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 2208d79dde)
2019-10-01 12:30:07 -07:00
Ken Mays
db56bc2c52 haiku: fix Mesa build
1. The hgl.c file is a read-only file versus read-write.
Ref: src/gallium/state_trackers/hgl/hgl.c

2.  I've included the Haiku-specific patches I used to get a successful
build of Mesa 19.1.7 on Haiku using the meson/ninja build procedure.
Shows "[764/764] linking target ... libswpipe.so" at build completion.

v2:
Remove autotools files (Eric)

v3:
Update the patch

Reported-by: Ken Mays <kmays2000@gmail.com>
Tested-by: Ken Mays <kmays2000@gmail.com>
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Alexander von Gluck IV <kallisti5@unixzen.com>
(cherry picked from commit 4943c89d6d)
2019-10-01 12:30:02 -07:00
Kenneth Graunke
4169d86913 iris: Fix iris_rebind_buffer() for VBOs with non-zero offsets.
We can't just check for the BO base address, we need to check for the
full address including any offset we may have applied.  When updating
the address, we need to include the offset again.

Fixes: 5ad0c88dbe ("iris: Replace buffer backing storage and rebind to update addresses.")
(cherry picked from commit 309924c3c9)
2019-10-01 12:29:58 -07:00
Dylan Baker
680e18c159 meson: gallium media state trackers require libdrm with x11
v2: - update copyright year in all changed files
    - rebase on master

Cc: 19.1 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 3b265f61f5)
2019-10-01 12:29:54 -07:00
Kenneth Graunke
d4dab05a09 iris: Disable CCS_E for 32-bit floating point textures.
A while back, Michael Larabel noticed that Paraview's Wavelet Volume
case runs significantly slower on iris than i965.  It turns out this
is because we enable CCS_E for 32-bit floating point formats, while
i965 disables it, with an oblique comment saying that we benchmarked
it (on what exactly?) and determined that it was a loss.

Paraview uses both R32_FLOAT and R32G32B32A32_FLOAT, and I observed
large framerate drops when enabling CCS_E for either format.  However,
several other benchmarks (Aztec Ruins, many Synmark cases) use 16-bit
floating point formats, with no apparent ill effects.

So, disable compression for 32-bit float formats for now, but leave it
enabled for 16-bit float formats as they seem to be working fine.

Improves performance in Paraview's Wavelet Volume test by 62% on a
Skylake GT4e.

Fixes: 3cfc6a207b ("iris: Fill out res->aux.possible_usages")
(cherry picked from commit a0a93763fb)
2019-10-01 12:29:51 -07:00
Marek Olšák
f5cccfe0e6 ac: fix num_good_cu_per_sh for harvested chips
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit b7c2f7c5a6)
2019-10-01 12:29:45 -07:00
Marek Olšák
0a2285b1d4 ac: fix incorrect vram_size reported by the kernel
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 7d97013294)
2019-10-01 12:29:15 -07:00
Marek Olšák
8f95245068 radeonsi/gfx10: fix L2 cache rinse programming
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 3c0938bece)
2019-10-01 12:29:11 -07:00
pal1000
a413b55157 scons/windows: Support build with LLVM 9.
As X86AsmPrinter component is gone, LLVMX86AsmPrinter got replaced
with LLVMRemarks, LLVMBitstreamReader and LLVMDebugInfoDWARF.

Tests done with llvm-config on both LLVM 8 and 9 indicate that
mcjit, bitwriter and x86asmprinter fully fit inside engine component.

On other platforms and with meson build mcdisassembler was used to replace
X86AsmPrinter but mcdisassembler also fully fits inside engine component
for LLVM>=8 according to same tests.

v2: Avoid duplicating code related to Mingw pthreads.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>

Cc: 19.1 19.2 <mesa-stable@lists.freedesktop.org>

On 19.1 this patch does not apply cleanly without 88eb2a1f

(cherry picked from commit bcb4dfb14b)
2019-09-30 09:10:21 -07:00
Michel Zou
5a027b6201 scons: add py3 support
SCons 3.1 has moved to python 3, requiring this fix
to continue supporting scons builds.

Closes: #944
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Eric Engestrom <eric@engestrom.ch>
Tested-by: Eric Engestrom <eric@engestrom.ch>
(cherry picked from commit 3f92d17894)
2019-09-30 09:10:16 -07:00
Mauro Rossi
769a18d1f3 android: compiler/nir: build nir_divergence_analysis.c
Prerequisite to avoid following radv linking error happening with aco

FAILED: out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/vulkan.radv_intermediates/LINKED/vulkan.radv.so
...
external/mesa/src/amd/compiler/aco_instruction_selection_setup.cpp:178:
error: undefined reference to 'nir_divergence_analysis'
clang.real: error: linker command failed with exit code 1 (use -v to see invocation)

Fixes: df86c5f ("nir: add divergence analysis pass.")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
(cherry picked from commit 268fb10e9c)
2019-09-30 09:10:11 -07:00
Andrii Simiklit
cb2649768f glsl: disallow incompatible matrices multiplication
glsl 4.4 spec section '5.9 expressions':
"The operator is multiply (*), where both operands are matrices or one operand is a vector and the
 other a matrix. A right vector operand is treated as a column vector and a left vector operand as a
 row vector. In all these cases, it is required that the number of columns of the left operand is equal
 to the number of rows of the right operand. Then, the multiply (*) operation does a linear
 algebraic multiply, yielding an object that has the same number of rows as the left operand and the
 same number of columns as the right operand. Section 5.10 “Vector and Matrix Operations”
 explains in more detail how vectors and matrices are operated on."

This fix disallows a multiplication of incompatible matrices like:
mat4x3(..) * mat4x3(..)
mat4x2(..) * mat4x2(..)
mat3x2(..) * mat3x2(..)
....

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111664
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
(cherry picked from commit b32bb888c7)
2019-09-30 09:10:07 -07:00
Jason Ekstrand
e6edeebd15 intel/fs: Fix fs_inst::flags_read for ANY/ALL predicates
Without this, we were DCEing flag writes because we didn't think their
results were used because we didn't understand that an ANY32 predicate
actually read all the flags.

Fixes: df1aec763e "i965/fs: Define methods to calculate the flag..."
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 6c858b9a91)
2019-09-30 09:10:02 -07:00
Dylan Baker
2dbf10ba3d meson: Link xvmc with libxv
Prior to xvmc 1.0.12 libxvmc incorrectly required libxv, but that was
fixed. This results in compilation failures for the gallium xvmc tracker
and tools. This patch fixes that by explicitly linking to libxv.

Fixes: 22a817af8a
       ("meson: build gallium xvmc state tracker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1844
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit e456a053c3)
2019-09-30 09:09:57 -07:00
Dylan Baker
daeb959c91 meson: Try finding libxvmcw via pkg-config before using find_library
This fixes cross compiling issues, because pkg-config is less likely to
get the wrong libs.

v2: - Fix typo in comment

Fixes: 22a817af8a
       ("meson: build gallium xvmc state tracker")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/939
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 8c5c21d7e3)
2019-09-30 09:09:52 -07:00
Andreas Gottschling
db1ed17ac4 drisw: Fix shared memory leak on drawable resize
XDestroyImage will mark the segment as to-be-destroyed, but it will
persist until we detach it, and we weren't doing so.

Cc: mesa-stable@lists.freedesktop.org
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/issues/121
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit c5a2ccec5e)
2019-09-30 09:09:47 -07:00
pal1000
dc0995669d scons: Fix MSYS2 Mingw-w64 build.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>

This patch is based on 28e3f85e09/mingw-w64-mesa/link-ole32.patch but with tweaks to avoid MSVC build break when applied.

v2: Create Mingw platform alias pointing to windows host platform define to avoid spurious crosscompilation;

v3: Fix obviously wrong compiler flags for swr driver;

v4: Update original patch URL because it has been relocated;

v5: Don't bother patching autools stuff as it's not used by MSYS2 Mingw-w64 build and it's days are numbered anyway;

v6: After Mingw posix flag fix in 295851eb things are far simpler as we don't need more linking of uuid, ole32, version and shell32 than what is already in place.
(cherry picked from commit ffb0d3a25c)
2019-09-30 09:09:00 -07:00
Michel Dänzer
434ab094c0 radeonsi: fix VAAPI segfault due to various bugs
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111236
(cherry picked from commit 67d930d64b)
2019-09-26 14:40:54 -07:00
Tapani Pälli
e35a7a0238 iris: disable aux on first get_param if not created with aux
This moves the fix from commit 361f3d19f1 to happen in get_param
(used now instead of get_handle by st/dri). This fixes artifacts
seen with Xorg and CCS_E.

Fixes: fc12fd05f5 "iris: Implement pipe_screen::resource_get_param"
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit f4d9169204)
2019-09-26 08:47:50 -07:00
Marek Olšák
95d87a897b gallium: extend resource_get_param to be as capable as resource_get_handle
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d307aa56f9)
2019-09-26 08:47:50 -07:00
Lionel Landwerlin
c4b70fef71 intel: use proper label for Comet Lake skus
Fixes: 82f6a746e8 ("intel: Add support for Comet Lake")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 813f3460e7)
2019-09-26 08:47:50 -07:00
Ian Romanick
bc6cc94d5a nir/range-analysis: Bail if the types don't match
Some shaders are hurt by this change because now a
load_const(0x00000000) is not recognized as eq_zero when loaded as a
float.  This behavior is restored in a later patch (nir/range-analysis:
Use types to provide better ranges from bcsel and mov).

v2: Add a comment about reinterpretation of int/uint/bool.  Suggested by
Caio.  Rewrite condition the check for types being float versus checking
for types not being all the things that aren't float.

Fixes: 405de7ccb6 ("nir/range-analysis: Rudimentary value range analysis pass")
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>

All Gen7+ platforms had similar results. (Ice Lake shown)
total instructions in shared programs: 16327543 -> 16328255 (<.01%)
instructions in affected programs: 55928 -> 56640 (1.27%)
helped: 0
HURT: 208
HURT stats (abs)   min: 1 max: 16 x̄: 3.42 x̃: 3
HURT stats (rel)   min: 0.33% max: 6.74% x̄: 1.31% x̃: 1.12%
95% mean confidence interval for instructions value: 3.06 3.79
95% mean confidence interval for instructions %-change: 1.17% 1.46%
Instructions are HURT.

total cycles in shared programs: 363682759 -> 363683977 (<.01%)
cycles in affected programs: 325758 -> 326976 (0.37%)
helped: 44
HURT: 133
helped stats (abs) min: 1 max: 179 x̄: 33.61 x̃: 5
helped stats (rel) min: 0.06% max: 14.21% x̄: 2.47% x̃: 0.29%
HURT stats (abs)   min: 1 max: 157 x̄: 20.28 x̃: 14
HURT stats (rel)   min: 0.07% max: 14.44% x̄: 1.42% x̃: 0.73%
95% mean confidence interval for cycles value: 0.38 13.39
95% mean confidence interval for cycles %-change: -0.06% 0.96%
Inconclusive result (%-change mean confidence interval includes 0).

Sandy Bridge
total instructions in shared programs: 10787433 -> 10787443 (<.01%)
instructions in affected programs: 1842 -> 1852 (0.54%)
helped: 0
HURT: 10
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.33% max: 1.85% x̄: 0.73% x̃: 0.49%
95% mean confidence interval for instructions value: 1.00 1.00
95% mean confidence interval for instructions %-change: 0.36% 1.10%
Instructions are HURT.

total cycles in shared programs: 153724543 -> 153724563 (<.01%)
cycles in affected programs: 8407 -> 8427 (0.24%)
helped: 1
HURT: 3
helped stats (abs) min: 18 max: 18 x̄: 18.00 x̃: 18
helped stats (rel) min: 0.98% max: 0.98% x̄: 0.98% x̃: 0.98%
HURT stats (abs)   min: 4 max: 18 x̄: 12.67 x̃: 16
HURT stats (rel)   min: 0.21% max: 0.75% x̄: 0.56% x̃: 0.72%
95% mean confidence interval for cycles value: -21.31 31.31
95% mean confidence interval for cycles %-change: -1.11% 1.46%
Inconclusive result (value mean confidence interval includes 0).

No shader-db changes on Iron Lake or GM45.

(cherry picked from commit 018d2b524a)
2019-09-26 08:47:50 -07:00
Lionel Landwerlin
6273d4d4ed anv: gem-stubs: return a valid fd got anv_gem_userptr()
Fixes invalid close(-1) in the unit tests.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit da2d67fc3b)
2019-09-26 08:47:50 -07:00
Danylo Piliaiev
960ab3e465 st/nine: Ignore D3DSIO_RET if it is the last instruction in a shader
RET as a last instruction could be safely ignored.
Remove it to prevent crashes/warnings in case underlying driver
doesn't implement arbitrary returns.

A better way would be to remove the RET after the whole shader
is parsed which will handle a possible case when the last RET is
followed by a comment.

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
(cherry picked from commit 2d8f77db83)
2019-09-26 08:47:50 -07:00
Dylan Baker
41b57b8b73 meson: fix logic for generating .pc files with old glvnd
We want to generate PC files for non-glvnd builds and for builds with
old glvnd, but the current logic doesn't do that, it builds them
unconditionally, and for GLES it builds the shared libraries, which is
also not what we want. This does not generate .pc files for gles1 or
gles2. Which it we weren't doing before either, making this not a
regression but a return to status-quo.o

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1838
Fixes: 93df862b6a
       ("meson: re-add incorrect pkg-config files with GLVND for backward compatibility")
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit fafd20f67d)
2019-09-26 08:47:50 -07:00
Erik Faye-Lund
109137ee7b glsl: correct bitcast-helpers
Without this, we'll incorrectly round off huge values to the nearest
representable double instead of keeping it at the exact value  as
we're supposed to.

Found by inspecting compiler-warnings.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 85faf5082f ("glsl: Add 64-bit integer support for constant expressions")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
(cherry picked from commit 88f909eb37)
2019-09-26 08:47:50 -07:00
Rhys Perry
f4faf5cbd7 nir/opt_remove_phis: handle phis with no sources
This can happen with loops with unreachable exits which are later
optimized away.

Fixes assertion in dEQP-VK.graphicsfuzz.unreachable-loops with RADV.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 12372d60ff)
2019-09-26 08:47:50 -07:00
Marek Olšák
b29682c290 gallium/vl: don't set PIPE_HANDLE_USAGE_EXPLICIT_FLUSH
because vl doesn't call flush_resource and I wasn't able to find
all places where flush_resource needs to be called.

This fixes corrupted / unflushed surfaces with fullscreen videos on Raven.

Cc: 19.1 19.2 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit f52afdf672)
2019-09-26 08:47:50 -07:00
Connor Abbott
1b67e47c0c nir/opt_large_constants: Handle store writemasks
This fixes some piglit tests on radeonsi NIR where a varying is
initialized to a constant array in the vertex shader. Varying packing
after nir_lower_io_to_temporaries creates writemasked stores which
persist after pulling the constant initialization down into the fragment
shader.

While we're here, rewrite handle_constant_store() to do the loop over
components outside the switch, so that we don't have to duplicate the
writemask checking for every bitsize.

Fixes: 1235850522 ("nir: Add a large constants optimization pass")
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
(cherry picked from commit 270fe55256)
2019-09-26 08:47:50 -07:00
Eric Engestrom
0c56cb50c7 meson: drop -Wno-foo bug workaround for Meson < 0.46
This was a workaround for a bug in Meson that was fixed in 0.46 [1].

[1] https://github.com/mesonbuild/meson/pull/2284

Fixes: f7b6a8d12f ("meson: bump required version to 0.46")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
(cherry picked from commit 3fd0afd5e3)
2019-09-26 08:47:50 -07:00
Eric Engestrom
40d592473e radv: fix s/load/store/ copy-paste typo
Fixes: cdc6efddf9 ("radv: implement all depth/stencil resolve modes using graphics")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
(cherry picked from commit 30f639c181)
2019-09-26 08:47:50 -07:00
Stephen Barber
2947b89369 nouveau: add idep_nir_headers as dep for libnouveau
Fixes a compilation error when building libnouveau:

In file included from ../src/gallium/drivers/nouveau/nv50/nv50_program.c:25:
../src/compiler/nir/nir.h:1115:10: fatal error: nir_intrinsics.h: No such file or directory
 #include "nir_intrinsics.h"
           ^~~~~~~~~~~~~~~~~~
           compilation terminated.

Fixes: f014ae3c7c ("nouveau: add support for nir")
Signed-off-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
(cherry picked from commit 8c3ace6991)
2019-09-26 08:47:50 -07:00
109 changed files with 1528 additions and 3520 deletions

View File

@@ -1 +1 @@
19.2.0
19.2.2

View File

@@ -16,3 +16,9 @@ dcc0e23438f3e5929c2ef74d57e8207be25ecb41
# This doesn't apply cleanly, and no one really cares about this file on stable
# branches anyway.
bcd9224728dcb8d8fe4bcddc4bd9b2c36fcfe9dd
# De-nominated by its author due to alternate fix not being backported
43041627445540afda1a05d11861935963660344
# This is immediately reverted, so just don't apply
19546108d3dd5541a189e36df4ea83b3f519e48f

0
bin/__init__.py Normal file
View File

View File

@@ -1,35 +0,0 @@
#!/bin/sh
# This script is used to generate the list of fixed bugs that
# appears in the release notes files, with HTML formatting.
#
# Note: This script could take a while until all details have
# been fetched from bugzilla.
#
# Usage examples:
#
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 > bugfixes
# $ bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 | tee bugfixes
# regex pattern: trim before bug number
trim_before='s/.*show_bug.cgi?id=\([0-9]*\).*/\1/'
# regex pattern: reconstruct the url
use_after='s,^,https://bugs.freedesktop.org/show_bug.cgi?id=,'
echo "<ul>"
echo ""
# extract fdo urls from commit log
git log --pretty=medium $* | grep 'bugs.freedesktop.org/show_bug' | sed -e $trim_before | sort -n -u | sed -e $use_after |\
while read url
do
id=$(echo $url | cut -d'=' -f2)
summary=$(wget --quiet -O - $url | grep -e '<title>.*</title>' | sed -e 's/ *<title>[0-9]\+ &ndash; \(.*\)<\/title>/\1/')
echo "<li><a href=\"$url\">Bug $id</a> - $summary</li>"
echo ""
done
echo "</ul>"

264
bin/gen_release_notes.py Executable file
View File

@@ -0,0 +1,264 @@
#!/usr/bin/env python3
# Copyright © 2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Generates release notes for a given version of mesa."""
import asyncio
import datetime
import os
import pathlib
import textwrap
import typing
import urllib.parse
import aiohttp
from mako.template import Template
from mako import exceptions
CURRENT_GL_VERSION = '4.5'
CURRENT_VK_VERSION = '1.1'
TEMPLATE = Template(textwrap.dedent("""\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa ${next_version} Release Notes / ${today}</h1>
<p>
%if bugfix:
Mesa ${next_version} is a new development release. People who are concerned
with stability and reliability should stick with a previous release or
wait for Mesa ${version[:-1]}1.
%else:
Mesa ${next_version} is a bug fix release which fixes bugs found since the ${version} release.
%endif
</p>
<p>
Mesa ${next_version} implements the OpenGL ${gl_version} API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL ${gl_version}. OpenGL
${gl_version} is <strong>only</strong> available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
</p>
<p>
Mesa ${next_version} implements the Vulkan ${vk_version} API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
</p>
<h2>SHA256 checksum</h2>
<pre>
TBD.
</pre>
<h2>New features</h2>
<ul>
%for f in features:
<li>${f}</li>
%endfor
</ul>
<h2>Bug fixes</h2>
<ul>
%for b in bugs:
<li>${b}</li>
%endfor
</ul>
<h2>Changes</h2>
<ul>
%for c, author in changes:
%if author:
<p>${c}</p>
%else:
<li>${c}</li>
%endif
%endfor
</ul>
</div>
</body>
</html>
"""))
async def gather_commits(version: str) -> str:
p = await asyncio.create_subprocess_exec(
'git', 'log', f'mesa-{version}..', '--grep', r'Closes: \(https\|#\).*',
stdout=asyncio.subprocess.PIPE)
out, _ = await p.communicate()
assert p.returncode == 0, f"git log didn't work: {version}"
return out.decode().strip()
async def gather_bugs(version: str) -> typing.List[str]:
commits = await gather_commits(version)
issues: typing.List[str] = []
for commit in commits.split('\n'):
sha, message = commit.split(maxsplit=1)
p = await asyncio.create_subprocess_exec(
'git', 'log', '--max-count', '1', r'--format=%b', sha,
stdout=asyncio.subprocess.PIPE)
_out, _ = await p.communicate()
out = _out.decode().split('\n')
for line in reversed(out):
if line.startswith('Closes:'):
bug = line.lstrip('Closes:').strip()
break
else:
raise Exception('No closes found?')
if bug.startswith('h'):
# This means we have a bug in the form "Closes: https://..."
issues.append(os.path.basename(urllib.parse.urlparse(bug).path))
else:
issues.append(bug)
loop = asyncio.get_event_loop()
async with aiohttp.ClientSession(loop=loop) as session:
results = await asyncio.gather(*[get_bug(session, i) for i in issues])
typing.cast(typing.Tuple[str, ...], results)
return list(results)
async def get_bug(session: aiohttp.ClientSession, bug_id: str) -> str:
"""Query gitlab to get the name of the issue that was closed."""
# Mesa's gitlab id is 176,
url = 'https://gitlab.freedesktop.org/api/v4/projects/176/issues'
params = {'iids[]': bug_id}
async with session.get(url, params=params) as response:
content = await response.json()
return content[0]['title']
async def get_shortlog(version: str) -> str:
"""Call git shortlog."""
p = await asyncio.create_subprocess_exec('git', 'shortlog', f'mesa-{version}..',
stdout=asyncio.subprocess.PIPE)
out, _ = await p.communicate()
assert p.returncode == 0, 'error getting shortlog'
assert out is not None, 'just for mypy'
return out.decode()
def walk_shortlog(log: str) -> typing.Generator[typing.Tuple[str, bool], None, None]:
for l in log.split('\n'):
if l.startswith(' '): # this means we have a patch description
yield l, False
else:
yield l, True
def calculate_next_version(version: str, is_point: bool) -> str:
"""Calculate the version about to be released."""
if '-' in version:
version = version.split('-')[0]
if is_point:
base = version.split('.')
base[2] = str(int(base[2]) + 1)
return '.'.join(base)
return version
def calculate_previous_version(version: str, is_point: bool) -> str:
"""Calculate the previous version to compare to.
In the case of -rc to final that verison is the previous .0 release,
(19.3.0 in the case of 20.0.0, for example). for point releases that is
the last point release. This value will be the same as the input value
for a point release, but different for a major release.
"""
if '-' in version:
version = version.split('-')[0]
if is_point:
return version
base = version.split('.')
if base[1] == '0':
base[0] = str(int(base[0]) - 1)
base[1] = '3'
else:
base[1] = str(int(base[1]) - 1)
return '.'.join(base)
def get_features() -> typing.Generator[str, None, None]:
p = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes' / 'new_features.txt'
if p.exists():
with p.open('rt') as f:
for line in f:
yield line
async def main() -> None:
v = pathlib.Path(__file__).parent.parent / 'VERSION'
with v.open('rt') as f:
raw_version = f.read().strip()
is_point_release = '-rc' not in raw_version
assert '-devel' not in raw_version, 'Do not run this script on -devel'
version = raw_version.split('-')[0]
previous_version = calculate_previous_version(version, is_point_release)
next_version = calculate_next_version(version, is_point_release)
shortlog, bugs = await asyncio.gather(
get_shortlog(previous_version),
gather_bugs(previous_version),
)
final = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes' / f'{next_version}.html'
with final.open('wt') as f:
try:
f.write(TEMPLATE.render(
bugfix=is_point_release,
bugs=bugs,
changes=walk_shortlog(shortlog),
features=get_features(),
gl_version=CURRENT_GL_VERSION,
next_version=next_version,
today=datetime.date.today(),
version=previous_version,
vk_version=CURRENT_VK_VERSION,
))
except:
print(exceptions.text_error_template().render())
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())

View File

@@ -0,0 +1,62 @@
# Copyright © 2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from unittest import mock
import pytest
from .gen_release_notes import *
@pytest.mark.parametrize(
'current, is_point, expected',
[
('19.2.0', True, '19.2.1'),
('19.3.6', True, '19.3.7'),
('20.0.0-rc4', False, '20.0.0'),
])
def test_next_version(current: str, is_point: bool, expected: str) -> None:
assert calculate_next_version(current, is_point) == expected
@pytest.mark.parametrize(
'current, is_point, expected',
[
('19.3.6', True, '19.3.6'),
('20.0.0-rc4', False, '19.3.0'),
])
def test_previous_version(current: str, is_point: bool, expected: str) -> None:
assert calculate_previous_version(current, is_point) == expected
@pytest.mark.asyncio
async def test_get_shortlog():
# Certainly not perfect, but it's something
version = '19.2.0'
out = await get_shortlog(version)
assert out
@pytest.mark.asyncio
async def test_gather_commits():
# Certainly not perfect, but it's something
version = '19.2.0'
out = await gather_commits(version)
assert out

122
bin/post_version.py Executable file
View File

@@ -0,0 +1,122 @@
#!/usr/bin/env python3
# Copyright © 2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Update the main page, release notes, and calendar."""
import calendar
import datetime
import pathlib
from lxml import (
etree,
html,
)
def calculate_previous_version(version: str, is_point: bool) -> str:
"""Calculate the previous version to compare to.
In the case of -rc to final that verison is the previous .0 release,
(19.3.0 in the case of 20.0.0, for example). for point releases that is
the last point release. This value will be the same as the input value
for a poiont release, but different for a major release.
"""
if '-' in version:
version = version.split('-')[0]
if is_point:
return version
base = version.split('.')
if base[1] == '0':
base[0] = str(int(base[0]) - 1)
base[1] = '3'
else:
base[1] = str(int(base[1]) - 1)
return '.'.join(base)
def get_version() -> str:
v = pathlib.Path(__file__).parent.parent / 'VERSION'
with v.open('rt') as f:
raw_version = f.read().strip()
return raw_version.split('-')[0]
def is_point_release() -> bool:
v = pathlib.Path(__file__).parent.parent / 'VERSION'
with v.open('rt') as f:
raw_version = f.read().strip()
return '-rc' not in raw_version
def update_index(is_point: bool, version: str, previous_version: str) -> None:
p = pathlib.Path(__file__).parent.parent / 'docs' / 'index.html'
with p.open('rt') as f:
tree = html.parse(f)
news = tree.xpath('.//h1')[0]
date = datetime.date.today()
month = calendar.month_name[date.month]
header = etree.Element('h2')
header.text=f"{month} {date.day}, {date.year}"
body = etree.Element('p')
a = etree.SubElement(body, 'a', attrib={'href': f'relnotes/{previous_version}'})
a.text = f"Mesa {previous_version}"
if is_point:
a.tail = " is released. This is a bug fix release."
else:
a.tail = (" is released. This is a new development release. "
"See the release notes for mor information about this release.")
root = news.getparent()
index = root.index(news) + 1
root.insert(index, body)
root.insert(index, header)
tree.write(p.as_posix(), method='html')
def update_release_notes(previous_version: str) -> None:
p = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes.html'
with p.open('rt') as f:
tree = html.parse(f)
li = etree.Element('li')
a = etree.SubElement(li, 'a', href=f'relnotes/{previous_version}')
a.text = f'{previous_version} release notes'
ul = tree.xpath('.//ul')[0]
ul.insert(0, li)
tree.write(p.as_posix(), method='html')
def main() -> None:
is_point = is_point_release()
version = get_version()
previous_version = calculate_previous_version(version, is_point)
update_index(is_point, version, previous_version)
update_release_notes(previous_version)
if __name__ == "__main__":
main()

View File

@@ -1,29 +0,0 @@
#!/bin/sh
# This script is used to generate the list of changes that
# appears in the release notes files, with HTML formatting.
#
# Usage examples:
#
# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3
# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3 > changes
# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3 | tee changes
in_log=0
git shortlog $* | while read l
do
if [ $in_log -eq 0 ]; then
echo '<p>'$l'</p>'
echo '<ul>'
in_log=1
elif echo "$l" | egrep -q '^$' ; then
echo '</ul>'
echo
in_log=0
else
mesg=$(echo $l | sed 's/ (cherry picked from commit [0-9a-f]\+)//;s/\&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g')
echo ' <li>'${mesg}'</li>'
fi
done

View File

@@ -17,6 +17,9 @@ import SCons.Script.SConscript
host_platform = _platform.system().lower()
if host_platform.startswith('cygwin'):
host_platform = 'cygwin'
# MSYS2 default platform selection.
if host_platform.startswith('mingw'):
host_platform = 'windows'
# Search sys.argv[] for a "platform=foo" argument since we don't have
# an 'env' variable at this point.
@@ -49,9 +52,18 @@ if 'PROCESSOR_ARCHITECTURE' in os.environ:
else:
host_machine = _platform.machine()
host_machine = _machine_map.get(host_machine, 'generic')
# MSYS2 default machine selection.
if _platform.system().lower().startswith('mingw') and 'MSYSTEM' in os.environ:
if os.environ['MSYSTEM'] == 'MINGW32':
host_machine = 'x86'
if os.environ['MSYSTEM'] == 'MINGW64':
host_machine = 'x86_64'
default_machine = host_machine
default_toolchain = 'default'
# MSYS2 default toolchain selection.
if _platform.system().lower().startswith('mingw'):
default_toolchain = 'mingw'
if target_platform == 'windows' and host_platform != 'windows':
default_machine = 'x86'

159
docs/relnotes/19.2.1.html Normal file
View File

@@ -0,0 +1,159 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 19.2.1 Release Notes / 2019-10-09</h1>
<p>
Mesa 19.2.1 is a bug fix release which fixes bugs found since the 19.2.0 release.
</p>
<p>
Mesa 19.2.1 implements the OpenGL 4.5 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
4.5 is <strong>only</strong> available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
</p>
<p>
Mesa 19.2.1 implements the Vulkan 1.1 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
</p>
<h2>SHA256 checksum</h2>
<pre>
4cc53ca1a8d12c6ff0e5ea44a5213c05c88447ab50d7e28bb350cd29199f01e9 mesa-19.2.1.tar.xz
</pre>
<h2>New features</h2>
<ul>
<li>None</li>
</ul>
<h2>Bug fixes</h2>
<ul>
<li>meson.build:1447:6: ERROR: Problem encountered: libdrm required for gallium video statetrackers when using x11</li>
<li>Mesa doesn't build with current Scons version (3.1.0)</li>
<li>libXvMC-1.0.12 breaks mesa build</li>
<li>Meson can't find 32-bit libXvMCW in non-standard path</li>
<li>Mesa installs gl.pc and egl.pc even with libglvnd >= 1.2.0</li>
</ul>
<h2>Changes</h2>
<ul>
<p>Andreas Gottschling (1):</p>
<li> drisw: Fix shared memory leak on drawable resize</li>
<p></p>
<p>Andres Gomez (1):</p>
<li> egl: Remove the 565 pbuffer-only EGL config under X11.</li>
<p></p>
<p>Andrii Simiklit (1):</p>
<li> glsl: disallow incompatible matrices multiplication</li>
<p></p>
<p>Bas Nieuwenhuizen (1):</p>
<li> radv: Fix condition for skipping the continue CS.</li>
<p></p>
<p>Connor Abbott (1):</p>
<li> nir/opt_large_constants: Handle store writemasks</li>
<p></p>
<p>Danylo Piliaiev (1):</p>
<li> st/nine: Ignore D3DSIO_RET if it is the last instruction in a shader</li>
<p></p>
<p>Dylan Baker (9):</p>
<li> meson: fix logic for generating .pc files with old glvnd</li>
<li> meson: Try finding libxvmcw via pkg-config before using find_library</li>
<li> meson: Link xvmc with libxv</li>
<li> meson: gallium media state trackers require libdrm with x11</li>
<li> .cherry-ignore: Update for 19.2.1 cycle</li>
<li> meson: Only error building gallium video without libdrm when the platform is drm</li>
<li> scripts: Add a gen_release_notes.py script</li>
<li> release: Add an update_release_calendar.py script</li>
<li> bin: delete unused releasing scripts</li>
<p></p>
<p>Eric Engestrom (3):</p>
<li> radv: fix s/load/store/ copy-paste typo</li>
<li> meson: drop -Wno-foo bug workaround for Meson < 0.46</li>
<li> meson: add missing idep_nir_headers in iris_gen_libs</li>
<p></p>
<p>Erik Faye-Lund (1):</p>
<li> glsl: correct bitcast-helpers</li>
<p></p>
<p>Ian Romanick (1):</p>
<li> nir/range-analysis: Bail if the types don't match</li>
<p></p>
<p>Jason Ekstrand (1):</p>
<li> intel/fs: Fix fs_inst::flags_read for ANY/ALL predicates</li>
<p></p>
<p>Ken Mays (1):</p>
<li> haiku: fix Mesa build</li>
<p></p>
<p>Kenneth Graunke (2):</p>
<li> iris: Disable CCS_E for 32-bit floating point textures.</li>
<li> iris: Fix iris_rebind_buffer() for VBOs with non-zero offsets.</li>
<p></p>
<p>Lionel Landwerlin (6):</p>
<li> anv: gem-stubs: return a valid fd got anv_gem_userptr()</li>
<li> intel: use proper label for Comet Lake skus</li>
<li> mesa: don't forget to clear _Layer field on texture unit</li>
<li> intel: fix topology query</li>
<li> intel: fix subslice computation from topology data</li>
<li> intel/isl: Set null surface format to R32_UINT</li>
<p></p>
<p>Marek Olšák (7):</p>
<li> gallium/vl: don't set PIPE_HANDLE_USAGE_EXPLICIT_FLUSH</li>
<li> gallium: extend resource_get_param to be as capable as resource_get_handle</li>
<li> radeonsi/gfx10: fix L2 cache rinse programming</li>
<li> ac: fix incorrect vram_size reported by the kernel</li>
<li> ac: fix num_good_cu_per_sh for harvested chips</li>
<li> ac: add radeon_info::tcc_harvested</li>
<li> radeonsi/gfx10: fix corruption for chips with harvested TCCs</li>
<p></p>
<p>Mauro Rossi (1):</p>
<li> android: compiler/nir: build nir_divergence_analysis.c</li>
<p></p>
<p>Michel Dänzer (1):</p>
<li> radeonsi: fix VAAPI segfault due to various bugs</li>
<p></p>
<p>Michel Zou (1):</p>
<li> scons: add py3 support</li>
<p></p>
<p>Prodea Alexandru-Liviu (1):</p>
<li> scons/MSYS2-MinGW-W64: Fix build options defaults</li>
<p></p>
<p>Rhys Perry (1):</p>
<li> nir/opt_remove_phis: handle phis with no sources</li>
<p></p>
<p>Stephen Barber (1):</p>
<li> nouveau: add idep_nir_headers as dep for libnouveau</li>
<p></p>
<p>Tapani Pälli (2):</p>
<li> iris: disable aux on first get_param if not created with aux</li>
<li> anv/android: fix images created with external format support</li>
<p></p>
<p>pal1000 (2):</p>
<li> scons: Fix MSYS2 Mingw-w64 build.</li>
<li> scons/windows: Support build with LLVM 9.</li>
<p></p>
<p></p>
</ul>
</div>
</body>
</html>

147
docs/relnotes/19.2.2.html Normal file
View File

@@ -0,0 +1,147 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Mesa Release Notes</title>
<link rel="stylesheet" type="text/css" href="../mesa.css">
</head>
<body>
<div class="header">
<h1>The Mesa 3D Graphics Library</h1>
</div>
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 19.2.2 Release Notes / 2019-10-23</h1>
<p>
Mesa 19.2.2 is a bug fix release which fixes bugs found since the 19.2.1 release.
</p>
<p>
Mesa 19.2.2 implements the OpenGL 4.5 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
4.5 is <strong>only</strong> available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.
</p>
<p>
Mesa 19.2.2 implements the Vulkan 1.1 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
</p>
<h2>SHA256 checksum</h2>
<pre>
TBD.
</pre>
<h2>New features</h2>
<ul>
<li>None</li>
</ul>
<h2>Bug fixes</h2>
<ul>
<li>Vulkan version of &quot;Middle-earth: Shadow of Mordor&quot; has graphics glitches on RADV driver (part 2)</li>
<li>Vulkan version of &quot;Middle-earth: Shadow of Mordor&quot; has graphics glitches on RADV driver</li>
<li>[amdgpu][Navi][llvm] Minimap problem in Nier Automata</li>
<li>Black ground in Dirt 4</li>
<li>Superbibles examples crashing Mesa drivers (radeonsi) and causing gpu reset</li>
<li>[CTS] dEQP-VK.graphicsfuzz.write-red-in-loop-nest crashes</li>
<li>mesa and libglvnd install the same headers</li>
<li>Regression: Doom (2016) crashes on Mesa 19.2 and above and Radeon 380 with Vulkan (worked on Mesa 19.1)</li>
<li>Rocket League displays corruption when the game starts</li>
</ul>
<h2>Changes</h2>
<ul>
<p>Alan Coopersmith (6):</p>
<li> c99_compat.h: Don&#x27;t try to use &#x27;restrict&#x27; in C++ code</li>
<li> util: Make Solaris implemention of p_atomic_add work with gcc</li>
<li> util: Workaround lack of flock on Solaris</li>
<li> util: Solaris has linux-style pthread_setname_np</li>
<li> meson: recognize &quot;sunos&quot; as the system name for Solaris</li>
<li> intel/common: include unistd.h for ioctl() prototype on Solaris</li>
<p></p>
<p>Alejandro Piñeiro (1):</p>
<li> v3d: take into account prim_counts_offset</li>
<p></p>
<p>Bas Nieuwenhuizen (3):</p>
<li> radv: Disallow sparse shared images.</li>
<li> nir/dead_cf: Remove dead control flow after infinite loops.</li>
<li> radv: Fix single stage constant flush with merged shaders.</li>
<p></p>
<p>Clément Guérin (1):</p>
<li> radeonsi: enable zerovram for Rocket League</li>
<p></p>
<p>Connor Abbott (2):</p>
<li> nir/sink: Rewrite loop handling logic</li>
<li> nir/sink: Don&#x27;t sink load_ubo to outside of its defining loop</li>
<p></p>
<p>Dylan Baker (1):</p>
<li> docs: Add SHA256 sum for 19.2.1</li>
<p></p>
<p>Eric Engestrom (7):</p>
<li> GL: drop symbols mangling support</li>
<li> meson: rename `glvnd_missing_pc_files` to `not glvnd_has_headers_and_pc_files`</li>
<li> meson: move a couple of include installs around</li>
<li> meson: split headers one per line</li>
<li> meson: split Mesa headers as a separate installation</li>
<li> meson: skip installation of GLVND-provided headers</li>
<li> util/u_atomic: fix return type of p_atomic_{inc,dec}_return() and p_atomic_{cmp,}xchg()</li>
<p></p>
<p>Ian Romanick (2):</p>
<li> nir/search: Fix possible NULL dereference in is_fsign</li>
<li> intel/vec4: Don&#x27;t try both sources as immediates for DPH</li>
<p></p>
<p>James Xiong (1):</p>
<li> iris: finish aux import on get_param</li>
<p></p>
<p>Kenneth Graunke (2):</p>
<li> iris: Properly unreference extra VBOs for draw parameters</li>
<li> iris: Implement the Gen &lt; 9 tessellation quads workaround</li>
<p></p>
<p>Lepton Wu (1):</p>
<li> egl/android: Remove our own reference to buffers.</li>
<p></p>
<p>Lionel Landwerlin (3):</p>
<li> etnaviv: remove variable from global namespace</li>
<li> anv: fix vkUpdateDescriptorSets with inline uniform blocks</li>
<li> anv: fix memory leak on device destroy</li>
<p></p>
<p>Lucas Stach (3):</p>
<li> etnaviv: fix vertex buffer state emission for single stream GPUs</li>
<li> rbug: fix transmitted texture sizes</li>
<li> rbug: unwrap index buffer resource</li>
<p></p>
<p>Pierre-Eric Pelloux-Prayer (1):</p>
<li> mesa: fix invalid target error handling for teximage</li>
<p></p>
<p>Roland Scheidegger (1):</p>
<li> gallivm: Fix saturated signed psub/padd intrinsics on llvm 8</li>
<p></p>
<p>Samuel Pitoiset (6):</p>
<li> drirc: enable vk_x11_override_min_image_count for DOOM</li>
<li> radv: bump minTexelBufferOffsetAlignment to 4</li>
<li> radv: fix DCC fast clear code for intensity formats</li>
<li> Revert &quot;radv: do not emit PKT3_CONTEXT_CONTROL with AMDGPU 3.6.0+&quot;</li>
<li> radv: fix DCC fast clear code for intensity formats (correctly)</li>
<li> radv: fix updating bound fast ds clear values with different aspects</li>
<p></p>
<p>Timothy Arceri (1):</p>
<li> glsl: fix crash compiling bindless samplers inside unnamed UBOs</li>
<p></p>
<p></p>
</ul>
</div>
</body>
</html>

View File

@@ -27,11 +27,6 @@
#ifndef __gl_h_
#define __gl_h_
#if defined(USE_MGL_NAMESPACE)
#include "gl_mangle.h"
#endif
/**********************************************************************
* Begin system-specific stuff.
*/
@@ -2101,13 +2096,6 @@ typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum t
#endif
/**
** NOTE!!!!! If you add new functions to this file, or update
** glext.h be sure to regenerate the gl_mangle.h file. See comments
** in that file for details.
**/
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -32,11 +32,6 @@
#include <GL/gl.h>
#if defined(USE_MGL_NAMESPACE)
#include "glx_mangle.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -1,82 +0,0 @@
/*
* Mesa 3-D graphics library
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef GLX_MANGLE_H
#define GLX_MANGLE_H
#define glXChooseVisual mglXChooseVisual
#define glXCreateContext mglXCreateContext
#define glXDestroyContext mglXDestroyContext
#define glXMakeCurrent mglXMakeCurrent
#define glXCopyContext mglXCopyContext
#define glXSwapBuffers mglXSwapBuffers
#define glXCreateGLXPixmap mglXCreateGLXPixmap
#define glXDestroyGLXPixmap mglXDestroyGLXPixmap
#define glXQueryExtension mglXQueryExtension
#define glXQueryVersion mglXQueryVersion
#define glXIsDirect mglXIsDirect
#define glXGetConfig mglXGetConfig
#define glXGetCurrentContext mglXGetCurrentContext
#define glXGetCurrentDrawable mglXGetCurrentDrawable
#define glXWaitGL mglXWaitGL
#define glXWaitX mglXWaitX
#define glXUseXFont mglXUseXFont
#define glXQueryExtensionsString mglXQueryExtensionsString
#define glXQueryServerString mglXQueryServerString
#define glXGetClientString mglXGetClientString
#define glXCreateGLXPixmapMESA mglXCreateGLXPixmapMESA
#define glXReleaseBuffersMESA mglXReleaseBuffersMESA
#define glXCopySubBufferMESA mglXCopySubBufferMESA
#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
/* GLX 1.2 */
#define glXGetCurrentDisplay mglXGetCurrentDisplay
/* GLX 1.3 */
#define glXChooseFBConfig mglXChooseFBConfig
#define glXGetFBConfigAttrib mglXGetFBConfigAttrib
#define glXGetFBConfigs mglXGetFBConfigs
#define glXGetVisualFromFBConfig mglXGetVisualFromFBConfig
#define glXCreateWindow mglXCreateWindow
#define glXDestroyWindow mglXDestroyWindow
#define glXCreatePixmap mglXCreatePixmap
#define glXDestroyPixmap mglXDestroyPixmap
#define glXCreatePbuffer mglXCreatePbuffer
#define glXDestroyPbuffer mglXDestroyPbuffer
#define glXQueryDrawable mglXQueryDrawable
#define glXCreateNewContext mglXCreateNewContext
#define glXMakeContextCurrent mglXMakeContextCurrent
#define glXGetCurrentReadDrawable mglXGetCurrentReadDrawable
#define glXQueryContext mglXQueryContext
#define glXSelectEvent mglXSelectEvent
#define glXGetSelectedEvent mglXGetSelectedEvent
/* GLX 1.4 */
#define glXGetProcAddress mglXGetProcAddress
#define glXGetProcAddressARB mglXGetProcAddressARB
#endif

View File

@@ -12,7 +12,6 @@ Normal Haiku Op*enGL layout:
* headers/os/opengl/GLView.h
* headers/os/opengl/GLRenderer.h
* headers/os/opengl/GL/gl.h
* headers/os/opengl/GL/gl_mangle.h
* headers/os/opengl/GL/glext.h
* headers/os/opengl/GL/osmesa.h (needed?)

View File

@@ -96,7 +96,7 @@
* - http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html
*/
#ifndef restrict
# if (__STDC_VERSION__ >= 199901L)
# if (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus)
/* C99 */
# elif defined(__GNUC__)
# define restrict __restrict__

View File

@@ -22,52 +22,77 @@ inc_include = include_directories('.')
inc_d3d9 = include_directories('D3D9')
inc_haikugl = include_directories('HaikuGL')
if with_gles1
install_headers(
'GLES/egl.h', 'GLES/gl.h', 'GLES/glext.h', 'GLES/glplatform.h',
subdir : 'GLES',
)
if not glvnd_has_headers_and_pc_files
if with_gles1 or with_gles2 or with_opengl or with_egl
install_headers('KHR/khrplatform.h', subdir : 'KHR')
endif
if with_gles1
install_headers(
'GLES/egl.h',
'GLES/gl.h',
'GLES/glext.h',
'GLES/glplatform.h',
subdir : 'GLES',
)
endif
if with_gles2
install_headers(
'GLES2/gl2.h',
'GLES2/gl2ext.h',
'GLES2/gl2platform.h',
subdir : 'GLES2',
)
install_headers(
'GLES3/gl3.h',
'GLES3/gl31.h',
'GLES3/gl32.h',
'GLES3/gl3ext.h',
'GLES3/gl3platform.h',
subdir : 'GLES3',
)
endif
if with_opengl
install_headers(
'GL/gl.h',
'GL/glcorearb.h',
'GL/glext.h',
subdir : 'GL',
)
endif
if with_glx != 'disabled'
install_headers(
'GL/glx.h',
'GL/glxext.h',
subdir : 'GL')
endif
if with_egl
install_headers(
'EGL/egl.h',
'EGL/eglext.h',
'EGL/eglplatform.h',
subdir : 'EGL',
)
endif
endif
if with_gles2
# Non-upstream headers
if with_egl
install_headers(
'GLES2/gl2.h', 'GLES2/gl2ext.h', 'GLES2/gl2platform.h',
subdir : 'GLES2',
'EGL/eglmesaext.h',
'EGL/eglextchromium.h',
subdir : 'EGL',
)
install_headers(
'GLES3/gl3.h', 'GLES3/gl31.h', 'GLES3/gl32.h', 'GLES3/gl3ext.h',
'GLES3/gl3platform.h',
subdir : 'GLES3',
)
endif
if with_gles1 or with_gles2 or with_opengl or with_egl
install_headers('KHR/khrplatform.h', subdir : 'KHR')
endif
if with_opengl
install_headers(
'GL/gl.h', 'GL/glext.h', 'GL/glcorearb.h', 'GL/gl_mangle.h',
subdir : 'GL',
)
endif
if with_glx != 'disabled'
install_headers('GL/glx.h', 'GL/glxext.h', 'GL/glx_mangle.h', subdir : 'GL')
endif
if with_osmesa != 'none'
install_headers('GL/osmesa.h', subdir : 'GL')
endif
if with_egl
install_headers(
'EGL/eglext.h', 'EGL/egl.h', 'EGL/eglextchromium.h', 'EGL/eglmesaext.h',
'EGL/eglplatform.h',
subdir : 'EGL',
)
endif
if with_dri
install_headers('GL/internal/dri_interface.h', subdir : 'GL/internal')
endif

View File

@@ -186,29 +186,29 @@ CHIPSET(0x3EA5, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)")
CHIPSET(0x3EA6, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)")
CHIPSET(0x3EA7, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)")
CHIPSET(0x3EA8, cfl_gt3, "Intel(R) HD Graphics (Coffeelake 3x8 GT3)")
CHIPSET(0x3EA1, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 2x6 GT1)")
CHIPSET(0x3EA4, cfl_gt1, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT1)")
CHIPSET(0x3EA0, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)")
CHIPSET(0x3EA3, cfl_gt2, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT2)")
CHIPSET(0x3EA2, cfl_gt3, "Intel(R) HD Graphics (Whiskey Lake 3x8 GT3)")
CHIPSET(0x9B21, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA0, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA2, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA4, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA5, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA8, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BAA, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BAB, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BAC, cfl_gt1, "Intel(R) HD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9B41, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC0, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC2, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC4, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC5, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC8, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BCA, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BCB, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BCC, cfl_gt2, "Intel(R) HD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x3EA1, cfl_gt1, "Intel(R) UHD Graphics (Whiskey Lake 2x6 GT1)")
CHIPSET(0x3EA4, cfl_gt1, "Intel(R) UHD Graphics (Whiskey Lake 3x8 GT1)")
CHIPSET(0x3EA0, cfl_gt2, "Intel(R) UHD Graphics (Whiskey Lake 3x8 GT2)")
CHIPSET(0x3EA3, cfl_gt2, "Intel(R) UHD Graphics (Whiskey Lake 3x8 GT2)")
CHIPSET(0x3EA2, cfl_gt3, "Intel(R) UHD Graphics (Whiskey Lake 3x8 GT3)")
CHIPSET(0x9B21, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA0, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA2, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA4, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA5, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BA8, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BAA, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BAB, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9BAC, cfl_gt1, "Intel(R) UHD Graphics (Comet Lake 2x6 GT1)")
CHIPSET(0x9B41, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC0, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC2, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC4, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC5, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BC8, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BCA, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BCB, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x9BCC, cfl_gt2, "Intel(R) UHD Graphics (Comet Lake 3x8 GT2)")
CHIPSET(0x5A49, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)")
CHIPSET(0x5A4A, cnl_2x8, "Intel(R) HD Graphics (Cannonlake 2x8 GT0.5)")
CHIPSET(0x5A41, cnl_3x8, "Intel(R) HD Graphics (Cannonlake 3x8 GT1)")

View File

@@ -93,7 +93,7 @@ with_shared_glapi = get_option('shared-glapi')
# shared-glapi is required if at least two OpenGL APIs are being built
if not with_shared_glapi
if ((with_gles1 == 'true' and with_gles2 == 'true') or
if ((with_gles1 == 'true' and with_gles2 == 'true') or
(with_gles1 == 'true' and with_opengl) or
(with_gles2 == 'true' and with_opengl))
error('shared-glapi required for building two or more of OpenGL, OpenGL ES 1.x, OpenGL ES 2.x')
@@ -117,7 +117,7 @@ with_any_opengl = with_opengl or with_gles1 or with_gles2
# Only build shared_glapi if at least one OpenGL API is enabled
with_shared_glapi = get_option('shared-glapi') and with_any_opengl
system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux'].contains(host_machine.system())
system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos'].contains(host_machine.system())
dri_drivers = get_option('dri-drivers')
if dri_drivers.contains('auto')
@@ -385,7 +385,7 @@ endif
if with_glx != 'disabled'
if not (with_platform_x11 and with_any_opengl)
error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
elif with_glx == 'gallium-xlib'
elif with_glx == 'gallium-xlib'
if not with_gallium
error('Gallium-xlib based GLX requires at least one gallium driver')
elif not with_gallium_softpipe
@@ -393,7 +393,7 @@ if with_glx != 'disabled'
elif with_dri
error('gallium-xlib conflicts with any dri driver')
endif
elif with_glx == 'xlib'
elif with_glx == 'xlib'
if with_dri
error('xlib conflicts with any dri driver')
endif
@@ -502,10 +502,12 @@ elif not (with_gallium_r600 or with_gallium_nouveau)
endif
endif
dep_xvmc = null_dep
dep_xv = null_dep
with_gallium_xvmc = false
if _xvmc != 'false'
dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : _xvmc == 'true')
with_gallium_xvmc = dep_xvmc.found()
dep_xv = dependency('xv', required : _xvmc == 'true')
with_gallium_xvmc = dep_xvmc.found() and dep_xv.found()
endif
xvmc_drivers_path = get_option('xvmc-libs-path')
@@ -856,6 +858,8 @@ endif
# TODO: this is very incomplete
if ['linux', 'cygwin', 'gnu', 'gnu/kfreebsd'].contains(host_machine.system())
pre_args += '-D_GNU_SOURCE'
elif host_machine.system() == 'sunos'
pre_args += '-D__EXTENSIONS__'
endif
# Check for generic C arguments
@@ -865,6 +869,8 @@ foreach a : ['-Werror=implicit-function-declaration',
'-Werror=incompatible-pointer-types',
'-Werror=format',
'-Wformat-security',
'-Wno-missing-field-initializers',
'-Wno-format-truncation',
'-fno-math-errno',
'-fno-trapping-math', '-Qunused-arguments']
if cc.has_argument(a)
@@ -872,12 +878,6 @@ foreach a : ['-Werror=implicit-function-declaration',
endif
endforeach
foreach a : ['missing-field-initializers', 'format-truncation']
if cc.has_argument('-W' + a)
c_args += '-Wno-' + a
endif
endforeach
c_vis_args = []
if cc.has_argument('-fvisibility=hidden')
c_vis_args += '-fvisibility=hidden'
@@ -888,6 +888,9 @@ cpp_args = []
foreach a : ['-Werror=return-type',
'-Werror=format',
'-Wformat-security',
'-Wno-non-virtual-dtor',
'-Wno-missing-field-initializers',
'-Wno-format-truncation',
'-fno-math-errno', '-fno-trapping-math',
'-Qunused-arguments']
if cpp.has_argument(a)
@@ -895,19 +898,11 @@ foreach a : ['-Werror=return-type',
endif
endforeach
# For some reason, the test for -Wno-foo always succeeds with gcc, even if the
# option is not supported. Hence, check for -Wfoo instead.
foreach a : ['non-virtual-dtor', 'missing-field-initializers', 'format-truncation']
if cpp.has_argument('-W' + a)
cpp_args += '-Wno-' + a
endif
endforeach
no_override_init_args = []
foreach a : ['override-init', 'initializer-overrides']
if cc.has_argument('-W' + a)
no_override_init_args += '-Wno-' + a
foreach a : ['-Wno-override-init',
'-Wno-initializer-overrides']
if cc.has_argument(a)
no_override_init_args += a
endif
endforeach
@@ -1041,7 +1036,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h'
endif
endforeach
foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'random_r']
foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'random_r', 'flock']
if cc.has_function(f)
pre_args += '-DHAVE_@0@'.format(f.to_upper())
endif
@@ -1307,12 +1302,12 @@ else
endif
dep_glvnd = null_dep
glvnd_has_headers_and_pc_files = false
if with_glvnd
dep_glvnd = dependency('libglvnd', version : '>= 0.2.0')
# GLVND until commit 0dfaea2bcb7cdcc785f9 ("Add pkg-config files for EGL, GL,
# GLES, and GLX.") was missing its pkg-config files, forcing every vendor to
# provide them and the distro maintainers to resolve the conflict.
glvnd_missing_pc_files = dep_glvnd.version().version_compare('< 1.2.0')
# GLVND before 1.2 was missing its pkg-config and header files, forcing every
# vendor to provide them and the distro maintainers to resolve the conflict.
glvnd_has_headers_and_pc_files = dep_glvnd.version().version_compare('>= 1.2.0')
pre_args += '-DUSE_LIBGLVND=1'
endif
@@ -1423,6 +1418,9 @@ if with_platform_x11
with_gallium_omx != 'disabled'))
dep_xcb = dependency('xcb')
dep_x11_xcb = dependency('x11-xcb')
if with_dri_platform == 'drm' and not dep_libdrm.found()
error('libdrm required for gallium video statetrackers when using x11')
endif
endif
if with_any_vk or with_egl or (with_glx == 'dri' and with_dri_platform == 'drm')
dep_xcb_dri2 = dependency('xcb-dri2', version : '>= 1.8')
@@ -1443,7 +1441,7 @@ if with_platform_x11
if with_glx == 'dri' or with_glx == 'gallium-xlib'
dep_glproto = dependency('glproto', version : '>= 1.4.14')
endif
if with_glx == 'dri'
if with_glx == 'dri'
if with_dri_platform == 'drm'
dep_dri2proto = dependency('dri2proto', version : '>= 2.8')
dep_xxf86vm = dependency('xxf86vm')

View File

@@ -128,9 +128,9 @@ def generate(env):
if not path:
path = []
if SCons.Util.is_String(path):
path = string.split(path, os.pathsep)
path = str.split(path, os.pathsep)
env['ENV']['PATH'] = string.join([dir] + path, os.pathsep)
env['ENV']['PATH'] = str.join(os.pathsep, [dir] + path)
# Most of mingw is the same as gcc and friends...
gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas']

View File

@@ -262,8 +262,12 @@ def parse_source_list(env, filename, names=None):
sym_table = parser.parse(src.abspath)
if names:
if isinstance(names, basestring):
names = [names]
if sys.version_info[0] >= 3:
if isinstance(names, str):
names = [names]
else:
if isinstance(names, basestring):
names = [names]
symbols = names
else:

View File

@@ -132,7 +132,7 @@ def check_cc(env, cc, expr, cpp_opt = '-E'):
sys.stdout.write('Checking for %s ... ' % cc)
source = tempfile.NamedTemporaryFile(suffix='.c', delete=False)
source.write('#if !(%s)\n#error\n#endif\n' % expr)
source.write(('#if !(%s)\n#error\n#endif\n' % expr).encode())
source.close()
# sys.stderr.write('%r %s %s\n' % (env['CC'], cpp_opt, source.name));
@@ -237,6 +237,9 @@ def generate(env):
hosthost_platform = host_platform.system().lower()
if hosthost_platform.startswith('cygwin'):
hosthost_platform = 'cygwin'
# Avoid spurious crosscompilation in MSYS2 environment.
if hosthost_platform.startswith('mingw'):
hosthost_platform = 'windows'
host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', host_platform.machine()))
host_machine = {
'x86': 'x86',

View File

@@ -30,6 +30,7 @@ Tool-specific initialization for LLVM
import os
import os.path
import re
import platform as host_platform
import sys
import distutils.version
@@ -100,8 +101,36 @@ def generate(env):
env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')])
env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')])
# LIBS should match the output of `llvm-config --libs engine mcjit bitwriter x86asmprinter irreader`
if llvm_version >= distutils.version.LooseVersion('5.0'):
# LLVM 5.0 and newer requires MinGW w/ pthreads due to use of std::thread and friends.
if llvm_version >= distutils.version.LooseVersion('5.0') and env['crosscompile']:
assert env['gcc']
env.AppendUnique(CXXFLAGS = ['-posix'])
# LIBS should match the output of `llvm-config --libs engine mcjit bitwriter x86asmprinter irreader` for LLVM<=7.0
# and `llvm-config --libs engine irreader` for LLVM>=8.0
# LLVMAggressiveInstCombine library part of engine component can be safely omitted as it's not used.
if llvm_version >= distutils.version.LooseVersion('9.0'):
env.Prepend(LIBS = [
'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
'LLVMDebugInfoCodeView', 'LLVMCodeGen',
'LLVMScalarOpts', 'LLVMInstCombine',
'LLVMTransformUtils',
'LLVMBitWriter', 'LLVMX86Desc',
'LLVMMCDisassembler', 'LLVMX86Info',
'LLVMX86Utils',
'LLVMMCJIT', 'LLVMExecutionEngine', 'LLVMTarget',
'LLVMAnalysis', 'LLVMProfileData',
'LLVMRuntimeDyld', 'LLVMObject', 'LLVMMCParser',
'LLVMBitReader', 'LLVMMC', 'LLVMCore',
'LLVMSupport',
'LLVMIRReader', 'LLVMAsmParser',
'LLVMDemangle', 'LLVMGlobalISel', 'LLVMDebugInfoMSF',
'LLVMBinaryFormat',
'LLVMRemarks', 'LLVMBitstreamReader', 'LLVMDebugInfoDWARF',
])
elif llvm_version >= distutils.version.LooseVersion('5.0'):
env.Prepend(LIBS = [
'LLVMX86Disassembler', 'LLVMX86AsmParser',
'LLVMX86CodeGen', 'LLVMSelectionDAG', 'LLVMAsmPrinter',
@@ -120,10 +149,6 @@ def generate(env):
'LLVMDemangle', 'LLVMGlobalISel', 'LLVMDebugInfoMSF',
'LLVMBinaryFormat',
])
if env['platform'] == 'windows' and env['crosscompile']:
# LLVM 5.0 requires MinGW w/ pthreads due to use of std::thread and friends.
assert env['gcc']
env.AppendUnique(CXXFLAGS = ['-posix'])
elif llvm_version >= distutils.version.LooseVersion('4.0'):
env.Prepend(LIBS = [
'LLVMX86Disassembler', 'LLVMX86AsmParser',
@@ -217,6 +242,12 @@ def generate(env):
'uuid',
])
# Mingw-w64 zlib is required when building with LLVM support in MSYS2 environment
if host_platform.system().lower().startswith('mingw'):
env.Append(LIBS = [
'z',
])
if env['msvc']:
# Some of the LLVM C headers use the inline keyword without
# defining it.

View File

@@ -92,6 +92,14 @@ static bool has_syncobj(int fd)
return value ? true : false;
}
static uint64_t fix_vram_size(uint64_t size)
{
/* The VRAM size is underreported, so we need to fix it, because
* it's used to compute the number of memory modules for harvesting.
*/
return align64(size, 256*1024*1024);
}
bool ac_query_gpu_info(int fd, void *dev_p,
struct radeon_info *info,
struct amdgpu_gpu_info *amdinfo)
@@ -265,7 +273,7 @@ bool ac_query_gpu_info(int fd, void *dev_p,
/* Note: usable_heap_size values can be random and can't be relied on. */
info->gart_size = meminfo.gtt.total_heap_size;
info->vram_size = meminfo.vram.total_heap_size;
info->vram_size = fix_vram_size(meminfo.vram.total_heap_size);
info->vram_vis_size = meminfo.cpu_accessible_vram.total_heap_size;
} else {
/* This is a deprecated interface, which reports usable sizes
@@ -296,7 +304,7 @@ bool ac_query_gpu_info(int fd, void *dev_p,
}
info->gart_size = gtt.heap_size;
info->vram_size = vram.heap_size;
info->vram_size = fix_vram_size(vram.heap_size);
info->vram_vis_size = vram_vis.heap_size;
}
@@ -419,6 +427,9 @@ bool ac_query_gpu_info(int fd, void *dev_p,
}
if (info->chip_class >= GFX10) {
info->tcc_cache_line_size = 128;
/* This is a hack, but it's all we can do without a kernel upgrade. */
info->tcc_harvested =
(info->vram_size / info->num_tcc_blocks) != 512*1024*1024;
} else {
info->tcc_cache_line_size = 64;
}
@@ -450,6 +461,12 @@ bool ac_query_gpu_info(int fd, void *dev_p,
info->num_good_cu_per_sh = info->num_good_compute_units /
(info->max_se * info->max_sh_per_se);
/* Round down to the nearest multiple of 2, because the hw can't
* disable CUs. It can only disable whole WGPs (dual-CUs).
*/
if (info->chip_class >= GFX10)
info->num_good_cu_per_sh -= info->num_good_cu_per_sh % 2;
memcpy(info->si_tile_mode_array, amdinfo->gb_tile_mode,
sizeof(amdinfo->gb_tile_mode));
info->enabled_rb_mask = amdinfo->enabled_rb_pipes_mask;
@@ -534,6 +551,7 @@ void ac_print_gpu_info(struct radeon_info *info)
printf(" num_sdma_rings = %i\n", info->num_sdma_rings);
printf(" clock_crystal_freq = %i\n", info->clock_crystal_freq);
printf(" tcc_cache_line_size = %u\n", info->tcc_cache_line_size);
printf(" tcc_harvested = %u\n", info->tcc_harvested);
printf(" use_display_dcc_unaligned = %u\n", info->use_display_dcc_unaligned);
printf(" use_display_dcc_with_retile_blit = %u\n", info->use_display_dcc_with_retile_blit);

View File

@@ -58,6 +58,7 @@ struct radeon_info {
uint32_t num_sdma_rings;
uint32_t clock_crystal_freq;
uint32_t tcc_cache_line_size;
bool tcc_harvested;
/* There are 2 display DCC codepaths, because display expects unaligned DCC. */
/* Disable RB and pipe alignment to skip the retile blit. (1 RB chips only) */

View File

@@ -1546,9 +1546,19 @@ radv_update_bound_fast_clear_ds(struct radv_cmd_buffer *cmd_buffer,
if (cmd_buffer->state.attachments[att_idx].iview->image != image)
return;
radeon_set_context_reg_seq(cs, R_028028_DB_STENCIL_CLEAR, 2);
radeon_emit(cs, ds_clear_value.stencil);
radeon_emit(cs, fui(ds_clear_value.depth));
if (aspects == (VK_IMAGE_ASPECT_DEPTH_BIT |
VK_IMAGE_ASPECT_STENCIL_BIT)) {
radeon_set_context_reg_seq(cs, R_028028_DB_STENCIL_CLEAR, 2);
radeon_emit(cs, ds_clear_value.stencil);
radeon_emit(cs, fui(ds_clear_value.depth));
} else if (aspects == VK_IMAGE_ASPECT_DEPTH_BIT) {
radeon_set_context_reg_seq(cs, R_02802C_DB_DEPTH_CLEAR, 1);
radeon_emit(cs, fui(ds_clear_value.depth));
} else {
assert(aspects == VK_IMAGE_ASPECT_STENCIL_BIT);
radeon_set_context_reg_seq(cs, R_028028_DB_STENCIL_CLEAR, 1);
radeon_emit(cs, ds_clear_value.stencil);
}
/* Update the ZRANGE_PRECISION value for the TC-compat bug. This is
* only needed when clearing Z to 0.0.
@@ -2268,14 +2278,15 @@ radv_flush_constants(struct radv_cmd_buffer *cmd_buffer,
return;
radv_foreach_stage(stage, stages) {
if (!pipeline->shaders[stage])
shader = radv_get_shader(pipeline, stage);
if (!shader)
continue;
need_push_constants |= pipeline->shaders[stage]->info.info.loads_push_constants;
need_push_constants |= pipeline->shaders[stage]->info.info.loads_dynamic_offsets;
need_push_constants |= shader->info.info.loads_push_constants;
need_push_constants |= shader->info.info.loads_dynamic_offsets;
uint8_t base = pipeline->shaders[stage]->info.info.base_inline_push_consts;
uint8_t count = pipeline->shaders[stage]->info.info.num_inline_push_consts;
uint8_t base = shader->info.info.base_inline_push_consts;
uint8_t count = shader->info.info.num_inline_push_consts;
radv_emit_inline_push_consts(cmd_buffer, pipeline, stage,
AC_UD_INLINE_PUSH_CONSTANTS,

View File

@@ -1170,7 +1170,7 @@ void radv_GetPhysicalDeviceProperties(
.viewportBoundsRange = { INT16_MIN, INT16_MAX },
.viewportSubPixelBits = 8,
.minMemoryMapAlignment = 4096, /* A page */
.minTexelBufferOffsetAlignment = 1,
.minTexelBufferOffsetAlignment = 4,
.minUniformBufferOffsetAlignment = 4,
.minStorageBufferOffsetAlignment = 4,
.minTexelOffset = -32,
@@ -2057,12 +2057,9 @@ VkResult radv_CreateDevice(
device->empty_cs[family] = device->ws->cs_create(device->ws, family);
switch (family) {
case RADV_QUEUE_GENERAL:
/* Since amdgpu version 3.6.0, CONTEXT_CONTROL is emitted by the kernel */
if (device->physical_device->rad_info.drm_minor < 6) {
radeon_emit(device->empty_cs[family], PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_LOAD_ENABLE(1));
radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_SHADOW_ENABLE(1));
}
radeon_emit(device->empty_cs[family], PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_LOAD_ENABLE(1));
radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_SHADOW_ENABLE(1));
break;
case RADV_QUEUE_COMPUTE:
radeon_emit(device->empty_cs[family], PKT3(PKT3_NOP, 0, 0));
@@ -2673,7 +2670,8 @@ radv_get_preamble_cs(struct radv_queue *queue,
*initial_full_flush_preamble_cs = queue->initial_full_flush_preamble_cs;
*initial_preamble_cs = queue->initial_preamble_cs;
*continue_preamble_cs = queue->continue_preamble_cs;
if (!scratch_size && !compute_scratch_size && !esgs_ring_size && !gsvs_ring_size)
if (!scratch_size && !compute_scratch_size && !esgs_ring_size && !gsvs_ring_size &&
!needs_tess_rings && !needs_sample_positions)
*continue_preamble_cs = NULL;
return VK_SUCCESS;
}

View File

@@ -1305,6 +1305,10 @@ get_external_image_format_properties(const VkPhysicalDeviceImageFormatInfo2 *pIm
VkExternalMemoryFeatureFlagBits flags = 0;
VkExternalMemoryHandleTypeFlags export_flags = 0;
VkExternalMemoryHandleTypeFlags compat_flags = 0;
if (pImageFormatInfo->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT)
return;
switch (handleType) {
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
@@ -1381,14 +1385,9 @@ VkResult radv_GetPhysicalDeviceImageFormatProperties2(
* present and VkExternalImageFormatProperties will be ignored.
*/
if (external_info && external_info->handleType != 0) {
switch (external_info->handleType) {
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT:
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT:
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT:
get_external_image_format_properties(base_info, external_info->handleType,
&external_props->externalMemoryProperties);
break;
default:
get_external_image_format_properties(base_info, external_info->handleType,
&external_props->externalMemoryProperties);
if (!external_props->externalMemoryProperties.externalMemoryFeatures) {
/* From the Vulkan 1.0.97 spec:
*
* If handleType is not compatible with the [parameters] specified

View File

@@ -620,7 +620,7 @@ static unsigned gfx9_border_color_swizzle(const enum vk_swizzle swizzle[4])
return bc_swizzle;
}
static bool vi_alpha_is_on_msb(struct radv_device *device, VkFormat format)
bool vi_alpha_is_on_msb(struct radv_device *device, VkFormat format)
{
const struct vk_format_description *desc = vk_format_description(format);

View File

@@ -1444,7 +1444,9 @@ enum {
RADV_DCC_CLEAR_SECONDARY_1 = 0x40404040U
};
static void vi_get_fast_clear_parameters(VkFormat format,
static void vi_get_fast_clear_parameters(struct radv_device *device,
VkFormat image_format,
VkFormat view_format,
const VkClearColorValue *clear_value,
uint32_t* reset_value,
bool *can_avoid_fast_clear_elim)
@@ -1453,18 +1455,20 @@ static void vi_get_fast_clear_parameters(VkFormat format,
int extra_channel;
bool main_value = false;
bool extra_value = false;
bool has_color = false;
bool has_alpha = false;
int i;
*can_avoid_fast_clear_elim = false;
*reset_value = RADV_DCC_CLEAR_REG;
const struct vk_format_description *desc = vk_format_description(format);
if (format == VK_FORMAT_B10G11R11_UFLOAT_PACK32 ||
format == VK_FORMAT_R5G6B5_UNORM_PACK16 ||
format == VK_FORMAT_B5G6R5_UNORM_PACK16)
const struct vk_format_description *desc = vk_format_description(view_format);
if (view_format == VK_FORMAT_B10G11R11_UFLOAT_PACK32 ||
view_format == VK_FORMAT_R5G6B5_UNORM_PACK16 ||
view_format == VK_FORMAT_B5G6R5_UNORM_PACK16)
extra_channel = -1;
else if (desc->layout == VK_FORMAT_LAYOUT_PLAIN) {
if (radv_translate_colorswap(format, false) <= 1)
if (vi_alpha_is_on_msb(device, view_format))
extra_channel = desc->nr_channels - 1;
else
extra_channel = 0;
@@ -1499,12 +1503,21 @@ static void vi_get_fast_clear_parameters(VkFormat format,
return;
}
if (index == extra_channel)
if (index == extra_channel) {
extra_value = values[i];
else
has_alpha = true;
} else {
main_value = values[i];
has_color = true;
}
}
/* If alpha isn't present, make it the same as color, and vice versa. */
if (!has_alpha)
extra_value = main_value;
else if (!has_color)
main_value = extra_value;
for (int i = 0; i < 4; ++i)
if (values[i] != main_value &&
desc->swizzle[i] - VK_SWIZZLE_X != extra_channel &&
@@ -1564,7 +1577,9 @@ radv_can_fast_clear_color(struct radv_cmd_buffer *cmd_buffer,
bool can_avoid_fast_clear_elim;
uint32_t reset_value;
vi_get_fast_clear_parameters(iview->vk_format,
vi_get_fast_clear_parameters(cmd_buffer->device,
iview->image->vk_format,
iview->vk_format,
&clear_value, &reset_value,
&can_avoid_fast_clear_elim);
@@ -1636,7 +1651,9 @@ radv_fast_clear_color(struct radv_cmd_buffer *cmd_buffer,
bool can_avoid_fast_clear_elim;
bool need_decompress_pass = false;
vi_get_fast_clear_parameters(iview->vk_format,
vi_get_fast_clear_parameters(cmd_buffer->device,
iview->image->vk_format,
iview->vk_format,
&clear_value, &reset_value,
&can_avoid_fast_clear_elim);

View File

@@ -535,7 +535,7 @@ create_depth_stencil_resolve_pipeline(struct radv_device *device,
.pAttachments = &(VkAttachmentDescription) {
.format = src_format,
.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,
.storeOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,
.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE,
.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD,
.stencilStoreOp = VK_ATTACHMENT_STORE_OP_STORE,
.initialLayout = VK_IMAGE_LAYOUT_GENERAL,

View File

@@ -1882,6 +1882,8 @@ VkResult radv_image_create(VkDevice _device,
const VkAllocationCallbacks* alloc,
VkImage *pImage);
bool vi_alpha_is_on_msb(struct radv_device *device, VkFormat format);
VkResult
radv_image_from_gralloc(VkDevice device_h,
const VkImageCreateInfo *base_info,

View File

@@ -161,12 +161,9 @@ si_emit_graphics(struct radv_physical_device *physical_device,
{
int i;
/* Since amdgpu version 3.6.0, CONTEXT_CONTROL is emitted by the kernel */
if (physical_device->rad_info.drm_minor < 6) {
radeon_emit(cs, PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
radeon_emit(cs, CONTEXT_CONTROL_LOAD_ENABLE(1));
radeon_emit(cs, CONTEXT_CONTROL_SHADOW_ENABLE(1));
}
radeon_emit(cs, PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
radeon_emit(cs, CONTEXT_CONTROL_LOAD_ENABLE(1));
radeon_emit(cs, CONTEXT_CONTROL_SHADOW_ENABLE(1));
if (physical_device->has_clear_state) {
radeon_emit(cs, PKT3(PKT3_CLEAR_STATE, 0, 0));

View File

@@ -217,6 +217,7 @@ NIR_FILES = \
nir/nir_control_flow_private.h \
nir/nir_deref.c \
nir/nir_deref.h \
nir/nir_divergence_analysis.c \
nir/nir_dominance.c \
nir/nir_format_convert.h \
nir/nir_from_ssa.c \

View File

@@ -106,7 +106,7 @@ bitcast_i642d(int64_t i)
return d;
}
static double
static uint64_t
bitcast_d2u64(double d)
{
assert(sizeof(double) == sizeof(uint64_t));
@@ -115,7 +115,7 @@ bitcast_d2u64(double d)
return u;
}
static double
static int64_t
bitcast_d2i64(double d)
{
assert(sizeof(double) == sizeof(int64_t));

View File

@@ -283,15 +283,15 @@ link_set_uniform_initializers(struct gl_shader_program *prog,
if (var->data.explicit_binding) {
const glsl_type *const type = var->type;
if (type->without_array()->is_sampler() ||
if (var->is_in_buffer_block()) {
/* This case is handled by link_uniform_blocks (at
* process_block_array_leaf)
*/
} else if (type->without_array()->is_sampler() ||
type->without_array()->is_image()) {
int binding = var->data.binding;
linker::set_opaque_binding(mem_ctx, prog, var, var->type,
var->name, &binding);
} else if (var->is_in_buffer_block()) {
/* This case is handled by link_uniform_blocks (at
* process_block_array_leaf)
*/
} else if (type->contains_atomic()) {
/* we don't actually need to do anything. */
} else {

View File

@@ -1349,9 +1349,7 @@ glsl_type::get_function_instance(const glsl_type *return_type,
const glsl_type *
glsl_type::get_mul_type(const glsl_type *type_a, const glsl_type *type_b)
{
if (type_a == type_b) {
return type_a;
} else if (type_a->is_matrix() && type_b->is_matrix()) {
if (type_a->is_matrix() && type_b->is_matrix()) {
/* Matrix multiply. The columns of A must match the rows of B. Given
* the other previously tested constraints, this means the vector type
* of a row from A must be the same as the vector type of a column from
@@ -1371,6 +1369,8 @@ glsl_type::get_mul_type(const glsl_type *type_a, const glsl_type *type_b)
return type;
}
} else if (type_a == type_b) {
return type_a;
} else if (type_a->is_matrix()) {
/* A is a matrix and B is a column vector. Columns of A must match
* rows of B. Given the other previously tested constraints, this

View File

@@ -334,6 +334,13 @@ dead_cf_list(struct exec_list *list, bool *list_ends_in_jump)
bool dummy;
progress |= dead_cf_list(&loop->body, &dummy);
nir_block *next = nir_cf_node_as_block(nir_cf_node_next(cur));
if (next->predecessors->entries == 0 &&
(!exec_list_is_empty(&next->instr_list) ||
!exec_node_is_tail_sentinel(next->cf_node.node.next))) {
remove_after_cf_node(cur);
return true;
}
break;
}

View File

@@ -107,6 +107,7 @@ build_constant_load(nir_builder *b, nir_deref_instr *deref,
static void
handle_constant_store(void *mem_ctx, struct var_info *info,
nir_deref_instr *deref, nir_const_value *val,
unsigned writemask,
glsl_type_size_align_func size_align)
{
assert(!nir_deref_instr_has_indirect(deref));
@@ -123,35 +124,35 @@ handle_constant_store(void *mem_ctx, struct var_info *info,
char *dst = (char *)info->constant_data +
nir_deref_instr_get_const_offset(deref, size_align);
switch (bit_size) {
case 1:
/* Booleans are special-cased to be 32-bit */
for (unsigned i = 0; i < num_components; i++)
for (unsigned i = 0; i < num_components; i++) {
if (!(writemask & (1 << i)))
continue;
switch (bit_size) {
case 1:
/* Booleans are special-cased to be 32-bit */
((int32_t *)dst)[i] = -(int)val[i].b;
break;
break;
case 8:
for (unsigned i = 0; i < num_components; i++)
case 8:
((uint8_t *)dst)[i] = val[i].u8;
break;
break;
case 16:
for (unsigned i = 0; i < num_components; i++)
case 16:
((uint16_t *)dst)[i] = val[i].u16;
break;
break;
case 32:
for (unsigned i = 0; i < num_components; i++)
case 32:
((uint32_t *)dst)[i] = val[i].u32;
break;
break;
case 64:
for (unsigned i = 0; i < num_components; i++)
case 64:
((uint64_t *)dst)[i] = val[i].u64;
break;
break;
default:
unreachable("Invalid bit size");
default:
unreachable("Invalid bit size");
}
}
}
@@ -211,10 +212,12 @@ nir_opt_large_constants(nir_shader *shader,
bool src_is_const = false;
nir_deref_instr *src_deref = NULL, *dst_deref = NULL;
unsigned writemask = 0;
switch (intrin->intrinsic) {
case nir_intrinsic_store_deref:
dst_deref = nir_src_as_deref(intrin->src[0]);
src_is_const = nir_src_is_const(intrin->src[1]);
writemask = nir_intrinsic_write_mask(intrin);
break;
case nir_intrinsic_load_deref:
@@ -255,7 +258,8 @@ nir_opt_large_constants(nir_shader *shader,
info->is_constant = false;
} else {
nir_const_value *val = nir_src_as_const_value(intrin->src[1]);
handle_constant_store(var_infos, info, dst_deref, val, size_align);
handle_constant_store(var_infos, info, dst_deref, val, writemask,
size_align);
}
}

View File

@@ -109,12 +109,13 @@ remove_phis_block(nir_block *block, nir_builder *b)
if (!srcs_same)
continue;
/* We must have found at least one definition, since there must be at
* least one forward edge.
*/
assert(def != NULL);
if (!def) {
/* In this case, the phi had no sources. So turn it into an undef. */
if (mov) {
b->cursor = nir_after_phis(block);
def = nir_ssa_undef(b, phi->dest.ssa.num_components,
phi->dest.ssa.bit_size);
} else if (mov) {
/* If the sources were all movs from the same source with the same
* swizzle, then we can't just pick a random move because it may not
* dominate the phi node. Instead, we need to emit our own move after

View File

@@ -76,23 +76,48 @@ get_innermost_loop(nir_cf_node *node)
return NULL;
}
/* return last block not after use_block with def_loop as it's innermost loop */
static nir_block *
adjust_block_for_loops(nir_block *use_block, nir_loop *def_loop)
static bool
loop_contains_block(nir_loop *loop, nir_block *block)
{
nir_loop *use_loop = NULL;
nir_block *before = nir_cf_node_as_block(nir_cf_node_prev(&loop->cf_node));
nir_block *after = nir_cf_node_as_block(nir_cf_node_next(&loop->cf_node));
for (nir_cf_node *node = &use_block->cf_node; node != NULL; node = node->parent) {
if (def_loop && node == &def_loop->cf_node)
break;
if (node->type == nir_cf_node_loop)
use_loop = nir_cf_node_as_loop(node);
}
if (use_loop) {
return nir_block_cf_tree_prev(nir_loop_first_block(use_loop));
} else {
return use_block;
return block->index > before->index && block->index < after->index;
}
/* Given the LCA of all uses and the definition, find a block on the path
* between them in the dominance tree that is outside of as many loops as
* possible. If "sink_out_of_loops" is false, then we disallow sinking the
* definition outside of the loop it's defined in (if any).
*/
static nir_block *
adjust_block_for_loops(nir_block *use_block, nir_block *def_block,
bool sink_out_of_loops)
{
nir_loop *def_loop = NULL;
if (!sink_out_of_loops)
def_loop = get_innermost_loop(&def_block->cf_node);
for (nir_block *cur_block = use_block; cur_block != def_block->imm_dom;
cur_block = cur_block->imm_dom) {
if (!sink_out_of_loops && def_loop &&
!loop_contains_block(def_loop, use_block)) {
use_block = cur_block;
continue;
}
nir_cf_node *next = nir_cf_node_next(&cur_block->cf_node);
if (next && next->type == nir_cf_node_loop) {
nir_loop *following_loop = nir_cf_node_as_loop(next);
if (loop_contains_block(following_loop, use_block)) {
use_block = cur_block;
continue;
}
}
}
return use_block;
}
/* iterate a ssa def's use's and try to find a more optimal block to
@@ -102,14 +127,10 @@ adjust_block_for_loops(nir_block *use_block, nir_loop *def_loop)
* the uses
*/
static nir_block *
get_preferred_block(nir_ssa_def *def, bool sink_into_loops)
get_preferred_block(nir_ssa_def *def, bool sink_into_loops, bool sink_out_of_loops)
{
nir_block *lca = NULL;
nir_loop *def_loop = NULL;
if (!sink_into_loops)
def_loop = get_innermost_loop(&def->parent_instr->block->cf_node);
nir_foreach_use(use, def) {
nir_instr *instr = use->parent_instr;
nir_block *use_block = instr->block;
@@ -131,18 +152,6 @@ get_preferred_block(nir_ssa_def *def, bool sink_into_loops)
use_block = phi_lca;
}
/* If we're moving a load_ubo or load_interpolated_input, we don't want to
* sink it down into loops, which may result in accessing memory or shared
* functions multiple times. Sink it just above the start of the loop
* where it's used. For load_consts, undefs, and comparisons, we expect
* the driver to be able to emit them as simple ALU ops, so sinking as far
* in as we can go is probably worth it for register pressure.
*/
if (!sink_into_loops) {
use_block = adjust_block_for_loops(use_block, def_loop);
assert(nir_block_dominates(def->parent_instr->block, use_block));
}
lca = nir_dominance_lca(lca, use_block);
}
@@ -150,14 +159,28 @@ get_preferred_block(nir_ssa_def *def, bool sink_into_loops)
nir_block *use_block =
nir_cf_node_as_block(nir_cf_node_prev(&use->parent_if->cf_node));
if (!sink_into_loops) {
use_block = adjust_block_for_loops(use_block, def_loop);
assert(nir_block_dominates(def->parent_instr->block, use_block));
}
lca = nir_dominance_lca(lca, use_block);
}
/* If we're moving a load_ubo or load_interpolated_input, we don't want to
* sink it down into loops, which may result in accessing memory or shared
* functions multiple times. Sink it just above the start of the loop
* where it's used. For load_consts, undefs, and comparisons, we expect
* the driver to be able to emit them as simple ALU ops, so sinking as far
* in as we can go is probably worth it for register pressure.
*/
if (!sink_into_loops) {
lca = adjust_block_for_loops(lca, def->parent_instr->block,
sink_out_of_loops);
assert(nir_block_dominates(def->parent_instr->block, lca));
} else {
/* sink_into_loops = true and sink_out_of_loops = false isn't
* implemented yet because it's not used.
*/
assert(sink_out_of_loops);
}
return lca;
}
@@ -199,8 +222,17 @@ nir_opt_sink(nir_shader *shader, nir_move_options options)
continue;
nir_ssa_def *def = nir_instr_ssa_def(instr);
bool sink_into_loops = instr->type != nir_instr_type_intrinsic;
/* Don't sink load_ubo out of loops because that can make its
* resource divergent and break code like that which is generated
* by nir_lower_non_uniform_access.
*/
bool sink_out_of_loops =
instr->type != nir_instr_type_intrinsic ||
nir_instr_as_intrinsic(instr)->intrinsic != nir_intrinsic_load_ubo;
nir_block *use_block =
get_preferred_block(def, instr->type != nir_instr_type_intrinsic);
get_preferred_block(def, sink_into_loops, sink_out_of_loops);
if (!use_block || use_block == instr->block)
continue;

View File

@@ -229,6 +229,26 @@ analyze_expression(const nir_alu_instr *instr, unsigned src,
const struct nir_alu_instr *const alu =
nir_instr_as_alu(instr->src[src].src.ssa->parent_instr);
const nir_alu_type use_type = nir_op_infos[instr->op].input_types[src];
/* Bail if the type of the instruction generating the value does not match
* the type the value will be interpreted as. int/uint/bool can be
* reinterpreted trivially. The most important cases are between float and
* non-float.
*/
if (alu->op != nir_op_mov && alu->op != nir_op_bcsel) {
const nir_alu_type use_base_type =
nir_alu_type_get_base_type(use_type);
const nir_alu_type src_base_type =
nir_alu_type_get_base_type(nir_op_infos[alu->op].output_type);
if (use_base_type != src_base_type &&
(use_base_type == nir_type_float ||
src_base_type == nir_type_float)) {
return (struct ssa_result_range){unknown, false};
}
}
struct hash_entry *he = _mesa_hash_table_search(ht, alu);
if (he != NULL)
return unpack_data(he->data);

View File

@@ -203,7 +203,7 @@ is_fsign(nir_alu_instr *instr, unsigned src,
if (src_alu->op == nir_op_fneg)
src_alu = nir_src_as_alu_instr(src_alu->src[0].src);
return src_alu->op == nir_op_fsign;
return src_alu != NULL && src_alu->op == nir_op_fsign;
}
static inline bool

View File

@@ -231,8 +231,6 @@ droid_window_dequeue_buffer(struct dri2_egl_surface *dri2_surf)
close(fence_fd);
}
dri2_surf->buffer->common.incRef(&dri2_surf->buffer->common);
/* Record all the buffers created by ANativeWindow and update back buffer
* for updating buffer's age in swap_buffers.
*/
@@ -289,7 +287,6 @@ droid_window_enqueue_buffer(_EGLDisplay *disp, struct dri2_egl_surface *dri2_sur
dri2_surf->window->queueBuffer(dri2_surf->window, dri2_surf->buffer,
fence_fd);
dri2_surf->buffer->common.decRef(&dri2_surf->buffer->common);
dri2_surf->buffer = NULL;
dri2_surf->back = NULL;
@@ -312,6 +309,7 @@ droid_window_cancel_buffer(struct dri2_egl_surface *dri2_surf)
dri2_surf->out_fence_fd = -1;
ret = dri2_surf->window->cancelBuffer(dri2_surf->window,
dri2_surf->buffer, fence_fd);
dri2_surf->buffer = NULL;
if (ret < 0) {
_eglLog(_EGL_WARNING, "ANativeWindow::cancelBuffer failed");
dri2_surf->base.Lost = EGL_TRUE;

View File

@@ -754,61 +754,9 @@ dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
return dri2_x11_do_authenticate(dri2_dpy, id);
}
static bool
dri2_x11_config_match_attrib(struct dri2_egl_display *dri2_dpy,
const __DRIconfig *config,
unsigned int attrib,
unsigned int value)
{
uint32_t config_val;
if (!dri2_dpy->core->getConfigAttrib(config, attrib, &config_val))
return false;
return config_val == value;
}
/**
* See if the X server can export a pixmap with the given color depth.
*
* Glamor in xorg-server 1.20 can't export pixmaps which have a different
* color depth than the root window as a DRI image. This makes it impossible
* to expose pbuffer-only visuals with, say, 16bpp on a 24bpp X display.
*/
static bool
x11_can_export_pixmap_with_bpp(struct dri2_egl_display *dri2_dpy, int bpp)
{
bool supported = false;
#ifdef HAVE_DRI3
xcb_dri3_buffer_from_pixmap_cookie_t cookie;
xcb_dri3_buffer_from_pixmap_reply_t *reply;
xcb_pixmap_t pixmap = xcb_generate_id(dri2_dpy->conn);
xcb_create_pixmap(dri2_dpy->conn, bpp, pixmap, dri2_dpy->screen->root, 1, 1);
cookie = xcb_dri3_buffer_from_pixmap(dri2_dpy->conn, pixmap);
reply = xcb_dri3_buffer_from_pixmap_reply(dri2_dpy->conn, cookie, NULL);
if (reply) {
int *fds = xcb_dri3_buffer_from_pixmap_reply_fds(dri2_dpy->conn, reply);
for (int i = 0; i < reply->nfd; i++) {
close(fds[i]);
}
supported = true;
free(reply);
}
xcb_free_pixmap(dri2_dpy->conn, pixmap);
#endif
return supported;
}
static EGLBoolean
dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
_EGLDisplay *disp, bool supports_preserved,
bool add_pbuffer_configs)
_EGLDisplay *disp, bool supports_preserved)
{
xcb_depth_iterator_t d;
xcb_visualtype_t *visuals;
@@ -884,47 +832,6 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
xcb_depth_next(&d);
}
/* Add a 565-no-depth-no-stencil pbuffer-only config. If X11 is depth 24,
* we wouldn't have 565 available, which the CTS demands.
*/
if (add_pbuffer_configs && x11_can_export_pixmap_with_bpp(dri2_dpy, 16)) {
for (int j = 0; dri2_dpy->driver_configs[j]; j++) {
const __DRIconfig *config = dri2_dpy->driver_configs[j];
const EGLint config_attrs[] = {
EGL_NATIVE_VISUAL_ID, 0,
EGL_NATIVE_VISUAL_TYPE, EGL_NONE,
EGL_NONE
};
EGLint surface_type = EGL_PBUFFER_BIT;
unsigned int rgba_masks[4] = {
0x1f << 11,
0x3f << 5,
0x1f << 0,
0,
};
/* Check that we've found single-sample, no depth, no stencil,
* and single-buffered.
*/
if (!dri2_x11_config_match_attrib(dri2_dpy, config,
__DRI_ATTRIB_DEPTH_SIZE, 0) ||
!dri2_x11_config_match_attrib(dri2_dpy, config,
__DRI_ATTRIB_STENCIL_SIZE, 0) ||
!dri2_x11_config_match_attrib(dri2_dpy, config,
__DRI_ATTRIB_SAMPLES, 0) ||
!dri2_x11_config_match_attrib(dri2_dpy, config,
__DRI_ATTRIB_DOUBLE_BUFFER, 0)) {
continue;
}
if (dri2_add_config(disp, config, config_count + 1, surface_type,
config_attrs, rgba_masks)) {
config_count++;
break;
}
}
}
if (!config_count) {
_eglLog(_EGL_WARNING, "DRI2: failed to create any config");
return EGL_FALSE;
@@ -1400,7 +1307,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
dri2_setup_screen(disp);
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, true, false))
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, true))
goto cleanup;
/* Fill vtbl last to prevent accidentally calling virtual function during
@@ -1498,7 +1405,7 @@ dri2_initialize_x11_dri3(_EGLDriver *drv, _EGLDisplay *disp)
dri2_set_WL_bind_wayland_display(drv, disp);
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, false, true))
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, false))
goto cleanup;
dri2_dpy->loader_dri3_ext.core = dri2_dpy->core;
@@ -1608,7 +1515,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
dri2_set_WL_bind_wayland_display(drv, disp);
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, true, false))
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, true))
goto cleanup;
/* Fill vtbl last to prevent accidentally calling virtual function during

View File

@@ -176,21 +176,23 @@ libegl = shared_library(
# If using glvnd the pkg-config header should not point to EGL_mesa, it should
# point to EGL. glvnd is only available on unix like platforms so adding -l
# should be safe here
if with_glvnd and glvnd_missing_pc_files
_egl = '-L${libdir} -lEGL'
else
_egl = libegl
endif
if not with_glvnd or not glvnd_has_headers_and_pc_files
if not glvnd_has_headers_and_pc_files
_egl = '-L${libdir} -lEGL'
else
_egl = libegl
endif
pkg.generate(
name : 'egl',
description : 'Mesa EGL Library',
version : meson.project_version(),
libraries : _egl,
libraries_private: gl_priv_libs,
requires_private : gl_priv_reqs,
extra_cflags : gl_pkgconfig_c_flags,
)
pkg.generate(
name : 'egl',
description : 'Mesa EGL Library',
version : meson.project_version(),
libraries : _egl,
libraries_private: gl_priv_libs,
requires_private : gl_priv_reqs,
extra_cflags : gl_pkgconfig_c_flags,
)
endif
if with_tests and prog_nm.found()
if with_glvnd

View File

@@ -313,14 +313,19 @@ dd_screen_resource_get_handle(struct pipe_screen *_screen,
static bool
dd_screen_resource_get_param(struct pipe_screen *_screen,
struct pipe_context *_pipe,
struct pipe_resource *resource,
unsigned int plane,
unsigned plane,
unsigned layer,
enum pipe_resource_param param,
unsigned handle_usage,
uint64_t *value)
{
struct pipe_screen *screen = dd_screen(_screen)->screen;
struct pipe_context *pipe = _pipe ? dd_context(_pipe)->pipe : NULL;
return screen->resource_get_param(screen, resource, plane, param, value);
return screen->resource_get_param(screen, pipe, resource, plane, layer,
param, handle_usage, value);
}
static void

View File

@@ -157,9 +157,12 @@ static bool noop_resource_get_handle(struct pipe_screen *pscreen,
}
static bool noop_resource_get_param(struct pipe_screen *pscreen,
struct pipe_context *ctx,
struct pipe_resource *resource,
unsigned int plane,
unsigned plane,
unsigned layer,
enum pipe_resource_param param,
unsigned handle_usage,
uint64_t *value)
{
struct noop_pipe_screen *noop_screen = (struct noop_pipe_screen*)pscreen;
@@ -172,7 +175,8 @@ static bool noop_resource_get_param(struct pipe_screen *pscreen,
if (!tex)
return false;
result = screen->resource_get_param(screen, tex, 0, param, value);
result = screen->resource_get_param(screen, NULL, tex, 0, 0, param,
handle_usage, value);
pipe_resource_reference(&tex, NULL);
return result;
}

View File

@@ -114,10 +114,15 @@ rbug_draw_block_locked(struct rbug_context *rb_pipe, int flag)
}
static void
rbug_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info)
rbug_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *_info)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
struct pipe_draw_info info;
info = *_info;
if(_info->index_size && !_info->has_user_indices)
info.index.resource = rbug_resource_unwrap(_info->index.resource);
mtx_lock(&rb_pipe->draw_mutex);
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_BEFORE);
@@ -127,7 +132,7 @@ rbug_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info)
if (!(rb_pipe->curr.shader[PIPE_SHADER_FRAGMENT] && rb_pipe->curr.shader[PIPE_SHADER_FRAGMENT]->disabled) &&
!(rb_pipe->curr.shader[PIPE_SHADER_GEOMETRY] && rb_pipe->curr.shader[PIPE_SHADER_GEOMETRY]->disabled) &&
!(rb_pipe->curr.shader[PIPE_SHADER_VERTEX] && rb_pipe->curr.shader[PIPE_SHADER_VERTEX]->disabled))
pipe->draw_vbo(pipe, info);
pipe->draw_vbo(pipe, &info);
mtx_unlock(&rb_pipe->call_mutex);
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_AFTER);

View File

@@ -217,17 +217,23 @@ rbug_screen_resource_get_handle(struct pipe_screen *_screen,
static bool
rbug_screen_resource_get_param(struct pipe_screen *_screen,
struct pipe_context *_pipe,
struct pipe_resource *_resource,
unsigned int plane,
unsigned plane,
unsigned layer,
enum pipe_resource_param param,
unsigned handle_usage,
uint64_t *value)
{
struct rbug_screen *rb_screen = rbug_screen(_screen);
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct rbug_resource *rb_resource = rbug_resource(_resource);
struct pipe_screen *screen = rb_screen->screen;
struct pipe_resource *resource = rb_resource->resource;
return screen->resource_get_param(screen, resource, plane, param, value);
return screen->resource_get_param(screen, rb_pipe ? rb_pipe->pipe : NULL,
resource, plane, layer, param,
handle_usage, value);
}

View File

@@ -409,17 +409,23 @@ trace_screen_resource_get_handle(struct pipe_screen *_screen,
static bool
trace_screen_resource_get_param(struct pipe_screen *_screen,
struct pipe_context *_pipe,
struct pipe_resource *resource,
unsigned int plane,
unsigned plane,
unsigned layer,
enum pipe_resource_param param,
unsigned handle_usage,
uint64_t *value)
{
struct trace_screen *tr_screen = trace_screen(_screen);
struct trace_context *tr_pipe = _pipe ? trace_context(_pipe) : NULL;
struct pipe_screen *screen = tr_screen->screen;
/* TODO trace call */
return screen->resource_get_param(screen, resource, plane, param, value);
return screen->resource_get_param(screen, tr_pipe ? tr_pipe->pipe : NULL,
resource, plane, layer, param,
handle_usage, value);
}
static void

View File

@@ -555,7 +555,7 @@ lp_build_add(struct lp_build_context *bld,
return bld->one;
if (!type.floating && !type.fixed) {
if (HAVE_LLVM >= 0x0900) {
if (HAVE_LLVM >= 0x0800) {
char intrin[32];
intrinsic = type.sign ? "llvm.sadd.sat" : "llvm.uadd.sat";
lp_format_intrinsic(intrin, sizeof intrin, intrinsic, bld->vec_type);
@@ -564,11 +564,9 @@ lp_build_add(struct lp_build_context *bld,
if (type.width * type.length == 128) {
if (util_cpu_caps.has_sse2) {
if (type.width == 8)
intrinsic = type.sign ? "llvm.x86.sse2.padds.b" :
HAVE_LLVM < 0x0800 ? "llvm.x86.sse2.paddus.b" : NULL;
intrinsic = type.sign ? "llvm.x86.sse2.padds.b" : "llvm.x86.sse2.paddus.b";
if (type.width == 16)
intrinsic = type.sign ? "llvm.x86.sse2.padds.w" :
HAVE_LLVM < 0x0800 ? "llvm.x86.sse2.paddus.w" : NULL;
intrinsic = type.sign ? "llvm.x86.sse2.padds.w" : "llvm.x86.sse2.paddus.w";
} else if (util_cpu_caps.has_altivec) {
if (type.width == 8)
intrinsic = type.sign ? "llvm.ppc.altivec.vaddsbs" : "llvm.ppc.altivec.vaddubs";
@@ -579,11 +577,9 @@ lp_build_add(struct lp_build_context *bld,
if (type.width * type.length == 256) {
if (util_cpu_caps.has_avx2) {
if (type.width == 8)
intrinsic = type.sign ? "llvm.x86.avx2.padds.b" :
HAVE_LLVM < 0x0800 ? "llvm.x86.avx2.paddus.b" : NULL;
intrinsic = type.sign ? "llvm.x86.avx2.padds.b" : "llvm.x86.avx2.paddus.b";
if (type.width == 16)
intrinsic = type.sign ? "llvm.x86.avx2.padds.w" :
HAVE_LLVM < 0x0800 ? "llvm.x86.avx2.paddus.w" : NULL;
intrinsic = type.sign ? "llvm.x86.avx2.padds.w" : "llvm.x86.avx2.paddus.w";
}
}
}
@@ -883,7 +879,7 @@ lp_build_sub(struct lp_build_context *bld,
return bld->zero;
if (!type.floating && !type.fixed) {
if (HAVE_LLVM >= 0x0900) {
if (HAVE_LLVM >= 0x0800) {
char intrin[32];
intrinsic = type.sign ? "llvm.ssub.sat" : "llvm.usub.sat";
lp_format_intrinsic(intrin, sizeof intrin, intrinsic, bld->vec_type);
@@ -892,11 +888,9 @@ lp_build_sub(struct lp_build_context *bld,
if (type.width * type.length == 128) {
if (util_cpu_caps.has_sse2) {
if (type.width == 8)
intrinsic = type.sign ? "llvm.x86.sse2.psubs.b" :
HAVE_LLVM < 0x0800 ? "llvm.x86.sse2.psubus.b" : NULL;
intrinsic = type.sign ? "llvm.x86.sse2.psubs.b" : "llvm.x86.sse2.psubus.b";
if (type.width == 16)
intrinsic = type.sign ? "llvm.x86.sse2.psubs.w" :
HAVE_LLVM < 0x0800 ? "llvm.x86.sse2.psubus.w" : NULL;
intrinsic = type.sign ? "llvm.x86.sse2.psubs.w" : "llvm.x86.sse2.psubus.w";
} else if (util_cpu_caps.has_altivec) {
if (type.width == 8)
intrinsic = type.sign ? "llvm.ppc.altivec.vsubsbs" : "llvm.ppc.altivec.vsububs";
@@ -907,11 +901,9 @@ lp_build_sub(struct lp_build_context *bld,
if (type.width * type.length == 256) {
if (util_cpu_caps.has_avx2) {
if (type.width == 8)
intrinsic = type.sign ? "llvm.x86.avx2.psubs.b" :
HAVE_LLVM < 0x0800 ? "llvm.x86.avx2.psubus.b" : NULL;
intrinsic = type.sign ? "llvm.x86.avx2.psubs.b" : "llvm.x86.avx2.psubus.b";
if (type.width == 16)
intrinsic = type.sign ? "llvm.x86.avx2.psubs.w" :
HAVE_LLVM < 0x0800 ? "llvm.x86.avx2.psubus.w" : NULL;
intrinsic = type.sign ? "llvm.x86.avx2.psubs.w" : "llvm.x86.avx2.psubus.w";
}
}
}

View File

@@ -283,9 +283,9 @@ int rbug_send_texture_info_reply(struct rbug_connection *__con,
uint32_t format,
uint32_t *width,
uint32_t width_len,
uint16_t *height,
uint16_t *h16,
uint32_t height_len,
uint16_t *depth,
uint16_t *d16,
uint32_t depth_len,
uint32_t blockw,
uint32_t blockh,
@@ -299,6 +299,8 @@ int rbug_send_texture_info_reply(struct rbug_connection *__con,
uint32_t __pos = 0;
uint8_t *__data = NULL;
int __ret = 0;
uint32_t *height = alloca(sizeof(uint32_t) * height_len);
uint32_t *depth = alloca(sizeof(uint32_t) * height_len);
LEN(8); /* header */
LEN(4); /* serial */
@@ -321,6 +323,11 @@ int rbug_send_texture_info_reply(struct rbug_connection *__con,
if (!__data)
return -ENOMEM;
for (int i = 0; i < height_len; i++)
height[i] = h16[i];
for (int i = 0; i < depth_len; i++)
depth[i] = d16[i];
WRITE(4, int32_t, ((int32_t)RBUG_OP_TEXTURE_INFO_REPLY));
WRITE(4, uint32_t, ((uint32_t)(__len / 4)));
WRITE(4, uint32_t, serial); /* serial */

View File

@@ -221,7 +221,6 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
int buffer_fd, fence_fd;
struct pipe_resource templ, *pixmap_buffer_texture;
struct winsys_handle whandle;
unsigned usage;
buffer = CALLOC_STRUCT(vl_dri3_buffer);
if (!buffer)
@@ -271,10 +270,8 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
}
memset(&whandle, 0, sizeof(whandle));
whandle.type= WINSYS_HANDLE_TYPE_FD;
usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
scrn->base.pscreen->resource_get_handle(scrn->base.pscreen, NULL,
pixmap_buffer_texture, &whandle,
usage);
pixmap_buffer_texture, &whandle, 0);
buffer_fd = whandle.handle;
buffer->pitch = whandle.stride;
buffer->width = templ.width0;

View File

@@ -330,7 +330,7 @@ etna_emit_state(struct etna_context *ctx)
/*14680*/ EMIT_STATE(NFE_VERTEX_STREAMS_VERTEX_DIVISOR(x), ctx->vertex_buffer.cvb[x].FE_VERTEX_STREAM_UNK14680);
}
}
} else if(ctx->specs.stream_count >= 1) { /* hw w/ multiple vertex streams */
} else if(ctx->specs.stream_count > 1) { /* hw w/ multiple vertex streams */
for (int x = 0; x < ctx->vertex_buffer.count; ++x) {
/*00680*/ EMIT_STATE_RELOC(FE_VERTEX_STREAMS_BASE_ADDR(x), &ctx->vertex_buffer.cvb[x].FE_VERTEX_STREAM_BASE_ADDR);
}

View File

@@ -402,7 +402,7 @@ enum modifier_priority {
MODIFIER_PRIORITY_SUPER_TILED,
};
const uint64_t priority_to_modifier[] = {
static const uint64_t priority_to_modifier[] = {
[MODIFIER_PRIORITY_INVALID] = DRM_FORMAT_MOD_INVALID,
[MODIFIER_PRIORITY_LINEAR] = DRM_FORMAT_MOD_LINEAR,
[MODIFIER_PRIORITY_SPLIT_TILED] = DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED,

View File

@@ -1227,6 +1227,9 @@ iris_update_compiled_tcs(struct iris_context *ice)
.tes_primitive_mode = tes_info->tess.primitive_mode,
.input_vertices =
!tcs || compiler->use_tcs_8_patch ? ice->state.vertices_per_patch : 0,
.quads_workaround = devinfo->gen < 9 &&
tes_info->tess.primitive_mode == GL_QUADS &&
tes_info->tess.spacing == TESS_SPACING_EQUAL,
};
get_unified_tess_slots(ice, &key.outputs_written,
&key.patch_outputs_written);

View File

@@ -628,6 +628,28 @@ supports_ccs(const struct gen_device_info *devinfo,
return true;
}
static bool
want_ccs_e_for_format(const struct gen_device_info *devinfo,
enum isl_format format)
{
if (!isl_format_supports_ccs_e(devinfo, format))
return false;
const struct isl_format_layout *fmtl = isl_format_get_layout(format);
/* CCS_E seems to significantly hurt performance with 32-bit floating
* point formats. For example, Paraview's "Wavelet Volume" case uses
* both R32_FLOAT and R32G32B32A32_FLOAT, and enabling CCS_E for those
* formats causes a 62% FPS drop.
*
* However, many benchmarks seem to use 16-bit float with no issues.
*/
if (fmtl->channels.r.bits == 32 && fmtl->channels.r.type == ISL_SFLOAT)
return false;
return true;
}
static struct pipe_resource *
iris_resource_create_for_buffer(struct pipe_screen *pscreen,
const struct pipe_resource *templ)
@@ -765,7 +787,7 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen,
res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ;
} else if (likely(!(INTEL_DEBUG & DEBUG_NO_RBC)) &&
supports_ccs(devinfo, &res->surf)) {
if (isl_format_supports_ccs_e(devinfo, res->surf.format))
if (want_ccs_e_for_format(devinfo, res->surf.format))
res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_E;
if (isl_format_supports_ccs_d(devinfo, res->surf.format))
@@ -1023,21 +1045,49 @@ iris_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
mod ? mod->supports_clear_color : false);
}
static void
iris_resource_disable_aux_on_first_query(struct pipe_resource *resource,
unsigned usage)
{
struct iris_resource *res = (struct iris_resource *)resource;
bool mod_with_aux =
res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE;
/* Disable aux usage if explicit flush not set and this is the first time
* we are dealing with this resource and the resource was not created with
* a modifier with aux.
*/
if (!mod_with_aux &&
(!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) && res->aux.usage != 0) &&
p_atomic_read(&resource->reference.count) == 1) {
iris_resource_disable_aux(res);
}
}
static bool
iris_resource_get_param(struct pipe_screen *screen,
struct pipe_context *context,
struct pipe_resource *resource,
unsigned int plane,
unsigned plane,
unsigned layer,
enum pipe_resource_param param,
unsigned handle_usage,
uint64_t *value)
{
struct iris_resource *res = (struct iris_resource *)resource;
bool mod_with_aux =
res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE;
bool wants_aux = mod_with_aux && plane > 0;
struct iris_bo *bo = wants_aux ? res->aux.bo : res->bo;
bool result;
unsigned handle;
if (iris_resource_unfinished_aux_import(res))
iris_resource_finish_aux_import(screen, res);
struct iris_bo *bo = wants_aux ? res->aux.bo : res->bo;
iris_resource_disable_aux_on_first_query(resource, handle_usage);
switch (param) {
case PIPE_RESOURCE_PARAM_NPLANES:
if (mod_with_aux) {
@@ -1088,15 +1138,7 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
bool mod_with_aux =
res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE;
/* Disable aux usage if explicit flush not set and this is the first time
* we are dealing with this resource and the resource was not created with
* a modifier with aux.
*/
if (!mod_with_aux &&
(!(usage & PIPE_HANDLE_USAGE_EXPLICIT_FLUSH) && res->aux.usage != 0) &&
p_atomic_read(&resource->reference.count) == 1) {
iris_resource_disable_aux(res);
}
iris_resource_disable_aux_on_first_query(resource, usage);
struct iris_bo *bo;
if (mod_with_aux && whandle->plane > 0) {

View File

@@ -845,6 +845,8 @@ struct iris_vertex_buffer_state {
/** The resource to source vertex data from. */
struct pipe_resource *resource;
int offset;
};
struct iris_depth_buffer_state {
@@ -2866,6 +2868,8 @@ iris_set_vertex_buffers(struct pipe_context *ctx,
pipe_resource_reference(&state->resource, buffer->buffer.resource);
struct iris_resource *res = (void *) state->resource;
state->offset = (int) buffer->buffer_offset;
if (res) {
ice->state.bound_vertex_buffers |= 1ull << (start_slot + i);
res->bind_history |= PIPE_BIND_VERTEX_BUFFER;
@@ -5841,11 +5845,11 @@ iris_destroy_state(struct iris_context *ice)
pipe_resource_reference(&ice->draw.draw_params_res, NULL);
pipe_resource_reference(&ice->draw.derived_draw_params_res, NULL);
uint64_t bound_vbs = ice->state.bound_vertex_buffers;
while (bound_vbs) {
const int i = u_bit_scan64(&bound_vbs);
/* Loop over all VBOs, including ones for draw parameters */
for (unsigned i = 0; i < ARRAY_SIZE(genx->vertex_buffers); i++) {
pipe_resource_reference(&genx->vertex_buffers[i].resource, NULL);
}
free(ice->state.genx);
for (int i = 0; i < 4; i++) {
@@ -5929,8 +5933,8 @@ iris_rebind_buffer(struct iris_context *ice,
STATIC_ASSERT(GENX(VERTEX_BUFFER_STATE_BufferStartingAddress_bits) == 64);
uint64_t *addr = (uint64_t *) &state->state[1];
if (*addr == old_address) {
*addr = res->bo->gtt_offset;
if (*addr == old_address + state->offset) {
*addr = res->bo->gtt_offset + state->offset;
ice->state.dirty |= IRIS_DIRTY_VERTEX_BUFFERS;
}
}

View File

@@ -66,12 +66,12 @@ foreach v : ['80', '90', '100', '110']
iris_gen_libs += static_library(
'libiris_gen@0@'.format(v),
['iris_blorp.c', 'iris_query.c', 'iris_state.c', gen_xml_pack],
include_directories : [inc_common, inc_intel, inc_nir],
include_directories : [inc_common, inc_intel],
c_args : [
c_vis_args, no_override_init_args, c_sse2_args,
'-DGEN_VERSIONx10=@0@'.format(v),
],
dependencies : [dep_libdrm, dep_valgrind],
dependencies : [dep_libdrm, dep_valgrind, idep_nir_headers],
)
endforeach

View File

@@ -210,13 +210,13 @@ files_libnouveau = files(
libnouveau = static_library(
'nouveau',
[files_libnouveau, nir_opcodes_h],
files_libnouveau,
include_directories : [
inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_common,
],
c_args : [c_vis_args],
cpp_args : [cpp_vis_args],
dependencies : [dep_libdrm, dep_libdrm_nouveau],
dependencies : [dep_libdrm, dep_libdrm_nouveau, idep_nir_headers],
)
nouveau_compiler = executable(

View File

@@ -178,6 +178,7 @@ void si_vid_join_surfaces(struct si_context *sctx,
surfaces[i]->u.gfx9.offset[j] += off;
}
surfaces[i]->flags |= RADEON_SURF_IMPORTED;
off += surfaces[i]->surf_size;
}

View File

@@ -1700,7 +1700,9 @@ si_make_CB_shader_coherent(struct si_context *sctx, unsigned num_samples,
SI_CONTEXT_INV_VCACHE;
if (sctx->chip_class >= GFX10) {
if (shaders_read_metadata)
if (sctx->screen->info.tcc_harvested)
sctx->flags |= SI_CONTEXT_INV_L2;
else if (shaders_read_metadata)
sctx->flags |= SI_CONTEXT_INV_L2_METADATA;
} else if (sctx->chip_class == GFX9) {
/* Single-sample color is coherent with shaders on GFX9, but
@@ -1726,7 +1728,9 @@ si_make_DB_shader_coherent(struct si_context *sctx, unsigned num_samples,
SI_CONTEXT_INV_VCACHE;
if (sctx->chip_class >= GFX10) {
if (shaders_read_metadata)
if (sctx->screen->info.tcc_harvested)
sctx->flags |= SI_CONTEXT_INV_L2;
else if (shaders_read_metadata)
sctx->flags |= SI_CONTEXT_INV_L2_METADATA;
} else if (sctx->chip_class == GFX9) {
/* Single-sample depth (not stencil) is coherent with shaders

View File

@@ -1130,16 +1130,28 @@ void gfx10_emit_cache_flush(struct si_context *ctx)
}
if (flags & SI_CONTEXT_INV_VCACHE)
gcr_cntl |= S_586_GL1_INV(1) | S_586_GLV_INV(1);
/* The L2 cache ops are:
* - INV: - invalidate lines that reflect memory (were loaded from memory)
* - don't touch lines that were overwritten (were stored by gfx clients)
* - WB: - don't touch lines that reflect memory
* - write back lines that were overwritten
* - WB | INV: - invalidate lines that reflect memory
* - write back lines that were overwritten
*
* GLM doesn't support WB alone. If WB is set, INV must be set too.
*/
if (flags & SI_CONTEXT_INV_L2) {
/* Writeback and invalidate everything in L2. */
gcr_cntl |= S_586_GL2_INV(1) | S_586_GLM_INV(1);
gcr_cntl |= S_586_GL2_INV(1) | S_586_GL2_WB(1) |
S_586_GLM_INV(1) | S_586_GLM_WB(1);
ctx->num_L2_invalidates++;
} else if (flags & SI_CONTEXT_WB_L2) {
/* Writeback but do not invalidate. */
gcr_cntl |= S_586_GL2_WB(1);
gcr_cntl |= S_586_GL2_WB(1) |
S_586_GLM_WB(1) | S_586_GLM_INV(1);
} else if (flags & SI_CONTEXT_INV_L2_METADATA) {
gcr_cntl |= S_586_GLM_INV(1) | S_586_GLM_WB(1);
}
if (flags & SI_CONTEXT_INV_L2_METADATA)
gcr_cntl |= S_586_GLM_INV(1);
if (flags & (SI_CONTEXT_FLUSH_AND_INV_CB | SI_CONTEXT_FLUSH_AND_INV_DB)) {
if (flags & SI_CONTEXT_FLUSH_AND_INV_CB) {

View File

@@ -1913,6 +1913,7 @@ static bool si_can_invalidate_texture(struct si_screen *sscreen,
const struct pipe_box *box)
{
return !tex->buffer.b.is_shared &&
!(tex->surface.flags & RADEON_SURF_IMPORTED) &&
!(transfer_usage & PIPE_TRANSFER_READ) &&
tex->buffer.b.b.last_level == 0 &&
util_texrange_covers_whole_level(&tex->buffer.b.b, 0,

View File

@@ -96,6 +96,7 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
/* reset the address */
resources[i]->buffer.gpu_address = ctx->ws->buffer_get_virtual_address(
resources[i]->buffer.buf);
resources[i]->buffer.bo_size = resources[i]->buffer.buf->size;
}
vidtemplate.height *= array_size;

View File

@@ -214,7 +214,7 @@ env.Prepend(CPPPATH = [
envavx = env.Clone()
envavx.Append(CPPDEFINES = ['KNOB_ARCH=KNOB_ARCH_AVX'])
if env['platform'] == 'windows':
if env['msvc']:
envavx.Append(CCFLAGS = ['/arch:AVX'])
else:
envavx.Append(CCFLAGS = ['-mavx'])
@@ -230,7 +230,7 @@ env.Alias('swrAVX', swrAVX)
envavx2 = env.Clone()
envavx2.Append(CPPDEFINES = ['KNOB_ARCH=KNOB_ARCH_AVX2'])
if env['platform'] == 'windows':
if env['msvc']:
envavx2.Append(CCFLAGS = ['/arch:AVX2'])
else:
envavx2.Append(CCFLAGS = ['-mavx2', '-mfma', '-mbmi2', '-mf16c'])

View File

@@ -457,7 +457,7 @@ v3d_read_and_accumulate_primitive_counters(struct v3d_context *v3d)
perf_debug("stalling on TF counts readback");
struct v3d_resource *rsc = v3d_resource(v3d->prim_counts);
if (v3d_bo_wait(rsc->bo, PIPE_TIMEOUT_INFINITE, "prim-counts")) {
uint32_t *map = v3d_bo_map(rsc->bo);
uint32_t *map = v3d_bo_map(rsc->bo) + v3d->prim_counts_offset;
v3d->tf_prims_generated += map[V3D_PRIM_COUNTS_TF_WRITTEN];
}
}

View File

@@ -265,11 +265,20 @@ struct pipe_screen {
/**
* Get info for the given pipe resource without the need to get a
* winsys_handle.
*
* The context parameter can optionally be used to flush the resource and
* the context to make sure the resource is coherent with whatever user
* will use it. Some drivers may also use the context to convert
* the resource into a format compatible for sharing. The context parameter
* is allowed to be NULL.
*/
bool (*resource_get_param)(struct pipe_screen *screen,
struct pipe_context *context,
struct pipe_resource *resource,
unsigned int plane,
unsigned plane,
unsigned layer,
enum pipe_resource_param param,
unsigned handle_usage,
uint64_t *value);
/**

View File

@@ -1128,14 +1128,15 @@ dri2_query_image_by_resource_handle(__DRIimage *image, int attrib, int *value)
static bool
dri2_resource_get_param(__DRIimage *image, enum pipe_resource_param param,
uint64_t *value)
unsigned handle_usage, uint64_t *value)
{
struct pipe_screen *pscreen = image->texture->screen;
if (!pscreen->resource_get_param)
return false;
return pscreen->resource_get_param(pscreen, image->texture, image->plane,
param, value);
return pscreen->resource_get_param(pscreen, NULL, image->texture,
image->plane, 0, param, handle_usage,
value);
}
static bool
@@ -1143,6 +1144,7 @@ dri2_query_image_by_resource_param(__DRIimage *image, int attrib, int *value)
{
enum pipe_resource_param param;
uint64_t res_param;
unsigned handle_usage;
if (!image->texture->screen->resource_get_param)
return false;
@@ -1174,7 +1176,12 @@ dri2_query_image_by_resource_param(__DRIimage *image, int attrib, int *value)
return false;
}
if (!dri2_resource_get_param(image, param, &res_param))
if (image->use & __DRI_IMAGE_USE_BACKBUFFER)
handle_usage = PIPE_HANDLE_USAGE_EXPLICIT_FLUSH;
else
handle_usage = PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE;
if (!dri2_resource_get_param(image, param, handle_usage, &res_param))
return false;
switch (attrib) {
@@ -1312,7 +1319,7 @@ dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
return NULL;
} else if (plane > 0) {
uint64_t planes;
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_NPLANES,
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_NPLANES, 0,
&planes) ||
plane >= planes) {
return NULL;
@@ -1321,7 +1328,7 @@ dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
if (image->dri_components == 0) {
uint64_t modifier;
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_MODIFIER,
if (!dri2_resource_get_param(image, PIPE_RESOURCE_PARAM_MODIFIER, 0,
&modifier) ||
modifier == DRM_FORMAT_MOD_INVALID) {
return NULL;

View File

@@ -44,7 +44,8 @@ hgl_st_context(struct st_context_iface *stctxi)
// Perform a safe void to hgl_buffer cast
static inline struct hgl_buffer*
//static inline struct hgl_buffer*
struct hgl_buffer*
hgl_st_framebuffer(struct st_framebuffer_iface *stfbi)
{
struct hgl_buffer* buffer;
@@ -62,7 +63,9 @@ hgl_st_framebuffer_flush_front(struct st_context_iface *stctxi,
CALLED();
//struct hgl_context* context = hgl_st_context(stctxi);
//struct hgl_buffer* buffer = hgl_st_context(stfbi);
// struct hgl_buffer* buffer = hgl_st_context(stfbi);
struct hgl_buffer* buffer = hgl_st_framebuffer(stfbi);
//buffer->surface
#if 0
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
@@ -281,7 +284,8 @@ hgl_create_st_manager(struct hgl_context* context)
//manager->display = dpy;
manager->screen = context->screen;
manager->get_param = hgl_st_manager_get_param;
manager->st_manager_private = (void *)context;
return manager;
}

View File

@@ -39,6 +39,8 @@ struct hgl_buffer
unsigned mask;
struct pipe_screen* screen;
struct pipe_surface* surface;
enum pipe_texture_target target;
struct pipe_resource* textures[ST_ATTACHMENT_COUNT];
@@ -80,6 +82,8 @@ struct hgl_context
struct hgl_buffer* read;
};
// hgl_buffer from statetracker interface
struct hgl_buffer* hgl_st_framebuffer(struct st_framebuffer_iface *stfbi);
// hgl state_tracker api
struct st_api* hgl_create_st_api(void);

View File

@@ -1803,7 +1803,13 @@ DECL_SPECIAL(LOOP)
DECL_SPECIAL(RET)
{
ureg_RET(tx->ureg);
/* RET as a last instruction could be safely ignored.
* Remove it to prevent crashes/warnings in case underlying
* driver doesn't implement arbitrary returns.
*/
if (*(tx->parse_next) != NINED3DSP_END) {
ureg_RET(tx->ureg);
}
return D3D_OK;
}

View File

@@ -1,4 +1,4 @@
# Copyright © 2017 Intel Corporation
# Copyright © 2017, 2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -19,7 +19,9 @@
# SOFTWARE.
inc_st_omx = [inc_common]
dep_st_omx = [dep_omx, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3]
dep_st_omx = [
dep_omx, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_libdrm,
]
files_omx = files(
'vid_dec_common.c',
@@ -57,7 +59,7 @@ elif with_gallium_omx == 'tizonia'
inc_egl,
inc_egl_dri2,
]
dep_st_omx = [dep_st_omx, dep_omx_other, dep_libdrm]
dep_st_omx = [dep_st_omx, dep_omx_other]
endif
libomx_st = static_library(

View File

@@ -1,4 +1,4 @@
# Copyright © 2017-2018 Intel Corporation
# Copyright © 2017-2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -35,5 +35,8 @@ libva_st = static_library(
),
],
include_directories : [inc_common],
dependencies : [dep_va_headers, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3],
dependencies : [
dep_va_headers, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3,
dep_libdrm,
],
)

View File

@@ -1,4 +1,4 @@
# Copyright © 2017 Intel Corproration
# Copyright © 2017, 2019 Intel Corproration
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -35,5 +35,5 @@ libvdpau_st = static_library(
include_directories : [
inc_include, inc_src, inc_util, inc_gallium, inc_gallium_aux,
],
dependencies : [dep_vdpau, dep_xcb, dep_x11_xcb, dep_xcb_dri2],
dependencies : [dep_vdpau, dep_xcb, dep_x11_xcb, dep_xcb_dri2, dep_libdrm],
)

View File

@@ -1,4 +1,4 @@
# Copyright © 2017 Intel Corporation
# Copyright © 2017, 2019 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -23,20 +23,29 @@ libxvmc_st = static_library(
files('attributes.c', 'block.c', 'context.c', 'surface.c', 'subpicture.c'),
c_args : [c_vis_args],
include_directories : [inc_common],
dependencies : [dep_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3],
dependencies : [
dep_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_xv,
dep_libdrm,
],
)
# These tests will not work without a working xvmc configuration.
# These tests will not work without a working xvmc configuration.
if with_tools.contains('xvmc')
dep_xvmcw = cc.find_library('XvMCW')
# pkg-config was added in 1.0.12, so allow fallback
dep_xvmcw = dependency('xvmc-wrapper', required : false)
if not dep_xvmcw.found()
dep_xvmcw = cc.find_library('XvMCW')
endif
dep_real_xvmc = dependency('xvmc')
foreach x : ['context', 'surface', 'subpicture', 'blocks', 'rendering']
_name = 'xvmc_@0@'.format(x)
executable(
_name,
files('tests/test_@0@.c'.format(x), 'tests/testlib.c'),
dependencies : [
dep_real_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_xvmcw,
dep_real_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3,
dep_xvmcw, dep_xv,
],
install: true,
)
@@ -46,7 +55,8 @@ if with_tools.contains('xvmc')
'xvmc_bench',
files('tests/xvmc_bench.c', 'tests/testlib.c'),
dependencies : [
dep_real_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_xvmcw,
dep_real_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3,
dep_xvmcw, dep_xv,
],
install: true,
)

View File

@@ -26,6 +26,7 @@
#include "sw/hgl/hgl_sw_winsys.h"
#include "util/u_atomic.h"
#include "util/u_memory.h"
#include "util/u_framebuffer.h"
#include "target-helpers/inline_sw_helper.h"
#include "target-helpers/inline_debug_helper.h"
@@ -332,36 +333,17 @@ GalliumContext::SwapBuffers(context_id contextID)
ERROR("%s: context not found\n", __func__);
return B_ERROR;
}
// TODO: Where did st_notify_swapbuffers go?
//st_notify_swapbuffers(context->draw->stfbi);
context->st->flush(context->st, ST_FLUSH_FRONT, NULL);
struct st_context *stContext = (struct st_context*)context->st;
unsigned nColorBuffers = stContext->state.framebuffer.nr_cbufs;
for (unsigned i = 0; i < nColorBuffers; i++) {
pipe_surface* surface = stContext->state.framebuffer.cbufs[i];
if (!surface) {
ERROR("%s: Color buffer %d invalid!\n", __func__, i);
continue;
}
TRACE("%s: Flushing color buffer #%d\n", __func__, i);
// We pass our destination bitmap to flush_fronbuffer which passes it
// to the private winsys display call.
fScreen->flush_frontbuffer(fScreen, surface->texture, 0, 0,
context->bitmap, NULL);
struct hgl_buffer* buffer = hgl_st_framebuffer(context->draw->stfbi);
pipe_surface* surface = buffer->surface;
if (!surface) {
ERROR("%s: Invalid drawable surface!\n", __func__);
return B_ERROR;
}
#if 0
// TODO... should we flush the z stencil buffer?
pipe_surface* zSurface = stContext->state.framebuffer.zsbuf;
fScreen->flush_frontbuffer(fScreen, zSurface->texture, 0, 0,
fScreen->flush_frontbuffer(fScreen, surface->texture, 0, 0,
context->bitmap, NULL);
#endif
return B_OK;
}

View File

@@ -118,11 +118,7 @@ extern void (*linker_foo(const unsigned char *procName))()
#include "glapi/glapi.h"
#include "glapi/glapitable.h"
#if defined(USE_MGL_NAMESPACE)
#define NAME(func) mgl##func
#else
#define NAME(func) gl##func
#endif
#define DISPATCH(FUNC, ARGS, MESSAGE) \
GET_DISPATCH()->FUNC ARGS

View File

@@ -86,6 +86,8 @@ XCreateDrawable(struct drisw_drawable * pdp, int shmid, Display * dpy)
if (pdp->ximage) {
XDestroyImage(pdp->ximage);
pdp->ximage = NULL;
if ((pdp->shminfo.shmid > 0) && (shmid != pdp->shminfo.shmid))
XShmDetach(dpy, &pdp->shminfo);
}
if (!xshm_error && shmid >= 0) {

View File

@@ -51,6 +51,7 @@ BGLView::BGLView(BRect rect, const char* name, ulong resizingMode, ulong mode,
fDitherMap(NULL)
{
fRoster = new GLRendererRoster(this, options);
fRenderer = fRoster->GetRenderer();
}
@@ -68,7 +69,7 @@ BGLView::LockGL()
// TODO: acquire the OpenGL API lock it on this glview
fDisplayLock.Lock();
if (fRenderer)
if (fRenderer != NULL && fDisplayLock.CountLocks() == 1)
fRenderer->LockGL();
}
@@ -76,7 +77,7 @@ BGLView::LockGL()
void
BGLView::UnlockGL()
{
if (fRenderer)
if (fRenderer != NULL && fDisplayLock.CountLocks() == 1)
fRenderer->UnlockGL();
fDisplayLock.Unlock();
@@ -189,7 +190,6 @@ BGLView::AttachedToWindow()
for (BView* view = this; view != NULL; view = view->Parent())
view->ConvertToParent(&fBounds);
fRenderer = fRoster->GetRenderer();
if (fRenderer != NULL) {
// Jackburton: The following code was commented because it doesn't look
// good in "direct" mode:

View File

@@ -26,6 +26,7 @@
#include <errno.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/ioctl.h>
static inline uint64_t

View File

@@ -1011,15 +1011,37 @@ fs_inst::size_read(int arg) const
}
namespace {
unsigned
predicate_width(brw_predicate predicate)
{
switch (predicate) {
case BRW_PREDICATE_NONE: return 1;
case BRW_PREDICATE_NORMAL: return 1;
case BRW_PREDICATE_ALIGN1_ANY2H: return 2;
case BRW_PREDICATE_ALIGN1_ALL2H: return 2;
case BRW_PREDICATE_ALIGN1_ANY4H: return 4;
case BRW_PREDICATE_ALIGN1_ALL4H: return 4;
case BRW_PREDICATE_ALIGN1_ANY8H: return 8;
case BRW_PREDICATE_ALIGN1_ALL8H: return 8;
case BRW_PREDICATE_ALIGN1_ANY16H: return 16;
case BRW_PREDICATE_ALIGN1_ALL16H: return 16;
case BRW_PREDICATE_ALIGN1_ANY32H: return 32;
case BRW_PREDICATE_ALIGN1_ALL32H: return 32;
default: unreachable("Unsupported predicate");
}
}
/* Return the subset of flag registers that an instruction could
* potentially read or write based on the execution controls and flag
* subregister number of the instruction.
*/
unsigned
flag_mask(const fs_inst *inst)
flag_mask(const fs_inst *inst, unsigned width)
{
const unsigned start = inst->flag_subreg * 16 + inst->group;
const unsigned end = start + inst->exec_size;
assert(util_is_power_of_two_nonzero(width));
const unsigned start = (inst->flag_subreg * 16 + inst->group) &
~(width - 1);
const unsigned end = start + ALIGN(inst->exec_size, width);
return ((1 << DIV_ROUND_UP(end, 8)) - 1) & ~((1 << (start / 8)) - 1);
}
@@ -1051,9 +1073,9 @@ fs_inst::flags_read(const gen_device_info *devinfo) const
* f0.0 and f1.0 on Gen7+, and f0.0 and f0.1 on older hardware.
*/
const unsigned shift = devinfo->gen >= 7 ? 4 : 2;
return flag_mask(this) << shift | flag_mask(this);
return flag_mask(this, 1) << shift | flag_mask(this, 1);
} else if (predicate) {
return flag_mask(this);
return flag_mask(this, predicate_width(predicate));
} else {
unsigned mask = 0;
for (int i = 0; i < sources; i++) {
@@ -1072,7 +1094,7 @@ fs_inst::flags_written() const
opcode != BRW_OPCODE_WHILE)) ||
opcode == SHADER_OPCODE_FIND_LIVE_CHANNEL ||
opcode == FS_OPCODE_FB_WRITE) {
return flag_mask(this);
return flag_mask(this, 1);
} else {
return flag_mask(dst, size_written);
}

View File

@@ -1978,7 +1978,7 @@ vec4_visitor::nir_emit_alu(nir_alu_instr *instr)
break;
case nir_op_fdph_replicated:
try_immediate_source(instr, op, true, devinfo);
try_immediate_source(instr, op, false, devinfo);
inst = emit(BRW_OPCODE_DPH, dst, op[0], op[1]);
inst->saturate = instr->dest.saturate;
break;

View File

@@ -1104,7 +1104,7 @@ update_from_topology(struct gen_device_info *devinfo,
for (int b = 0; b < devinfo->subslice_slice_stride; b++) {
devinfo->num_subslices[s] +=
__builtin_popcount(devinfo->subslice_masks[b]);
__builtin_popcount(devinfo->subslice_masks[s * devinfo->subslice_slice_stride + b]);
}
n_subslices += devinfo->num_subslices[s];
}
@@ -1320,6 +1320,9 @@ query_topology(struct gen_device_info *devinfo, int fd)
if (gen_ioctl(fd, DRM_IOCTL_I915_QUERY, &query))
return false;
if (item.length < 0)
return false;
struct drm_i915_query_topology_info *topo_info =
(struct drm_i915_query_topology_info *) calloc(1, item.length);
item.data_ptr = (uintptr_t) topo_info;

View File

@@ -789,7 +789,12 @@ isl_genX(null_fill_state)(void *state, struct isl_extent3d size)
{
struct GENX(RENDER_SURFACE_STATE) s = {
.SurfaceType = SURFTYPE_NULL,
.SurfaceFormat = ISL_FORMAT_B8G8R8A8_UNORM,
/* We previously had this format set to B8G8R8A8_UNORM but ran into
* hangs on IVB. R32_UINT seems to work for everybody.
*
* https://gitlab.freedesktop.org/mesa/mesa/issues/1872
*/
.SurfaceFormat = ISL_FORMAT_R32_UINT,
#if GEN_GEN >= 7
.SurfaceArray = size.depth > 0,
#endif

View File

@@ -1470,9 +1470,6 @@ void anv_UpdateDescriptorSets(
&dst->descriptors[dst_layout->descriptor_index];
dst_desc += copy->dstArrayElement;
for (uint32_t j = 0; j < copy->descriptorCount; j++)
dst_desc[j] = src_desc[j];
if (src_layout->data & ANV_DESCRIPTOR_INLINE_UNIFORM) {
assert(src_layout->data == ANV_DESCRIPTOR_INLINE_UNIFORM);
memcpy(dst->desc_mem.map + dst_layout->descriptor_offset +
@@ -1481,6 +1478,9 @@ void anv_UpdateDescriptorSets(
copy->srcArrayElement,
copy->descriptorCount);
} else {
for (uint32_t j = 0; j < copy->descriptorCount; j++)
dst_desc[j] = src_desc[j];
unsigned desc_size = anv_descriptor_size(src_layout);
if (desc_size > 0) {
assert(desc_size == anv_descriptor_size(dst_layout));

View File

@@ -2421,7 +2421,7 @@ VkResult anv_CreateDevice(
vk_priority_to_gen(priority));
if (err != 0 && priority > VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT) {
result = vk_error(VK_ERROR_NOT_PERMITTED_EXT);
goto fail_fd;
goto fail_vmas;
}
}
@@ -2587,6 +2587,11 @@ VkResult anv_CreateDevice(
pthread_mutex_destroy(&device->mutex);
fail_context_id:
anv_gem_destroy_context(device, device->context_id);
fail_vmas:
if (physical_device->use_softpin) {
util_vma_heap_finish(&device->vma_hi);
util_vma_heap_finish(&device->vma_lo);
}
fail_fd:
close(device->fd);
fail_device:
@@ -2642,6 +2647,11 @@ void anv_DestroyDevice(
anv_bo_pool_finish(&device->batch_bo_pool);
if (physical_device->use_softpin) {
util_vma_heap_finish(&device->vma_hi);
util_vma_heap_finish(&device->vma_lo);
}
pthread_cond_destroy(&device->queue_submit);
pthread_mutex_destroy(&device->mutex);

View File

@@ -68,7 +68,13 @@ anv_gem_munmap(void *p, uint64_t size)
uint32_t
anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
{
return -1;
int fd = os_create_anonymous_file(size, "fake bo");
if (fd == -1)
return 0;
assert(fd != 0);
return fd;
}
int

View File

@@ -735,6 +735,17 @@ anv_CreateImage(VkDevice device,
return anv_image_from_external(device, pCreateInfo, create_info,
pAllocator, pImage);
bool use_external_format = false;
const struct VkExternalFormatANDROID *ext_format =
vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_FORMAT_ANDROID);
/* "If externalFormat is zero, the effect is as if the
* VkExternalFormatANDROID structure was not present. Otherwise, the image
* will have the specified external format."
*/
if (ext_format && ext_format->externalFormat != 0)
use_external_format = true;
const VkNativeBufferANDROID *gralloc_info =
vk_find_struct_const(pCreateInfo->pNext, NATIVE_BUFFER_ANDROID);
if (gralloc_info)
@@ -750,6 +761,7 @@ anv_CreateImage(VkDevice device,
return anv_image_create(device,
&(struct anv_image_create_info) {
.vk_info = pCreateInfo,
.external_format = use_external_format,
},
pAllocator,
pImage);

View File

@@ -113,15 +113,6 @@ typedef struct {
print(' ;')
print('')
print('')
print("#ifdef USE_MGL_NAMESPACE")
for func in api.functionIterateByOffset():
for n in func.entry_points:
if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)):
print('#define gl_dispatch_stub_%u mgl_dispatch_stub_%u' % (func.offset, func.offset))
break
print("#endif /* USE_MGL_NAMESPACE */")
print('')
print('')
print('#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)')
for func in api.functionIterateByOffset():
for n in func.entry_points:

View File

@@ -134,12 +134,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print('# define HIDDEN(x)')
print('#endif')
print('')
print('# if defined(USE_MGL_NAMESPACE)')
print('# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))')
print('# define _glapi_Dispatch _mglapi_Dispatch')
print('# else')
print('# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))')
print('# endif')
print('')
print('\t.text')
print('')

View File

@@ -58,18 +58,9 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print('#include "x86/assyntax.h"')
print('')
print('#if defined(STDCALL_API)')
print('# if defined(USE_MGL_NAMESPACE)')
print('# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))')
print('# else')
print('# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))')
print('# endif')
print('#else')
print('# if defined(USE_MGL_NAMESPACE)')
print('# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))')
print('# define _glapi_Dispatch _mglapi_Dispatch')
print('# else')
print('# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))')
print('# endif')
print('#endif')
print('')
print('#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))')

View File

@@ -69,16 +69,6 @@ extern "C" {
#endif /* _GLAPI_NO_EXPORTS */
/* Is this needed? It is incomplete anyway. */
#ifdef USE_MGL_NAMESPACE
#define _glapi_set_dispatch _mglapi_set_dispatch
#define _glapi_get_dispatch _mglapi_get_dispatch
#define _glapi_set_context _mglapi_set_context
#define _glapi_get_context _mglapi_get_context
#define _glapi_Dispatch _mglapi_Dispatch
#define _glapi_Context _mglapi_Context
#endif
typedef void (*_glapi_proc)(void);
typedef void (*_glapi_nop_handler_proc)(const char *name);

View File

@@ -51,11 +51,7 @@
#define KEYWORD2 GLAPIENTRY
#if defined(USE_MGL_NAMESPACE)
#define NAME(func) mgl##func
#else
#define NAME(func) gl##func
#endif
#if 0 /* Use this to log GL calls to stdout (for DEBUG only!) */

View File

@@ -511,11 +511,6 @@ _glapi_get_proc_address(const char *funcName)
init_glapi_relocs_once();
#ifdef USE_MGL_NAMESPACE
if (funcName && funcName[0] == 'm')
funcName++;
#endif
if (!funcName || funcName[0] != 'g' || funcName[1] != 'l')
return NULL;

View File

@@ -603,13 +603,8 @@ class GLAPIPrinter(ABIPrinter):
def _get_c_header(self):
header = """#ifndef _GLAPI_TMP_H_
#define _GLAPI_TMP_H_
#ifdef USE_MGL_NAMESPACE
#define GLAPI_PREFIX(func) mgl##func
#define GLAPI_PREFIX_STR(func) "mgl"#func
#else
#define GLAPI_PREFIX(func) gl##func
#define GLAPI_PREFIX_STR(func) "gl"#func
#endif /* USE_MGL_NAMESPACE */
typedef int GLclampx;
#endif /* _GLAPI_TMP_H_ */"""

View File

@@ -174,11 +174,6 @@ _glapi_get_stub(const char *name, int generate)
{
const struct mapi_stub *stub;
#ifdef USE_MGL_NAMESPACE
if (name && name[0] == 'm')
name++;
#endif
if (!name || name[0] != 'g' || name[1] != 'l')
return NULL;
name += 2;

View File

@@ -35,7 +35,7 @@ if with_shared_glapi
else
libglapi = []
endif
if not with_glvnd or glvnd_missing_pc_files
if not with_glvnd
if with_gles1
subdir('es1api')
endif

Some files were not shown because too many files have changed in this diff Show More