mesa.git
6 years agoanv: add new formats KHR_sampler_ycbcr_conversion
Lionel Landwerlin [Tue, 14 Mar 2017 17:22:36 +0000 (17:22 +0000)]
anv: add new formats KHR_sampler_ycbcr_conversion

Adding new downsampling factors for each planes.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv: modify the internal concept of format to express multiple planes
Lionel Landwerlin [Tue, 14 Mar 2017 17:20:07 +0000 (17:20 +0000)]
anv: modify the internal concept of format to express multiple planes

A given Vulkan format can now be decomposed into a set of planes. We
now use 'struct anv_format_plane' to represent the format of those
planes.

v2: by Jason
    Rename anv_get_plane_format() to anv_get_format_plane()
    Don't rename anv_get_isl_format()
    Replace ds_fmt() by fmt2()
    Introduce fmt_unsupported()

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoanv: prepare formats to handle disjoints sets
Lionel Landwerlin [Mon, 25 Sep 2017 17:10:20 +0000 (18:10 +0100)]
anv: prepare formats to handle disjoints sets

Newer format enums start at offset 1000000000, making it impossible to
have them all in one table. This change splits the formats into sets
that we then access through indirection.

v2: rename format_extract to vk_to_anv_format (Chad/Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoisl: fill out layout descriptions for yuv formats
Lionel Landwerlin [Thu, 20 Jul 2017 19:40:41 +0000 (20:40 +0100)]
isl: fill out layout descriptions for yuv formats

Some description was missing.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoisl: check whether a format is rgb if colorspace is yuv
Lionel Landwerlin [Tue, 3 Oct 2017 18:10:41 +0000 (19:10 +0100)]
isl: check whether a format is rgb if colorspace is yuv

Suggested by Chad.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoisl: make format layout channels accessible by index
Lionel Landwerlin [Tue, 6 Jun 2017 19:00:46 +0000 (20:00 +0100)]
isl: make format layout channels accessible by index

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agovulkan: util: add macros to extract extension/offset number from enums
Lionel Landwerlin [Tue, 14 Mar 2017 17:17:12 +0000 (17:17 +0000)]
vulkan: util: add macros to extract extension/offset number from enums

v2: Simplify offset enum computation (Jason)

v3: capitalize macros (Chad)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoradv: convert all COMPUTE operations to the RADV_META_SAVE_XXX flags
Samuel Pitoiset [Tue, 3 Oct 2017 13:11:21 +0000 (15:11 +0200)]
radv: convert all COMPUTE operations to the RADV_META_SAVE_XXX flags

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: add RADV_META_SAVE_COMPUTE_PIPELINE flag
Samuel Pitoiset [Tue, 3 Oct 2017 12:47:32 +0000 (14:47 +0200)]
radv: add RADV_META_SAVE_COMPUTE_PIPELINE flag

This will allow use to merge the compute save/restore helpers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: add radv_meta_save() helper
Samuel Pitoiset [Tue, 3 Oct 2017 12:37:56 +0000 (14:37 +0200)]
radv: add radv_meta_save() helper

And merge radv_meta_save_novertex() with
radv_meta_save_graphics_reset_vport_scissor_novertex().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: merge radv_meta_{save,restore}_pass() with RADV_META_SAVE_PASS
Samuel Pitoiset [Tue, 3 Oct 2017 12:26:38 +0000 (14:26 +0200)]
radv: merge radv_meta_{save,restore}_pass() with RADV_META_SAVE_PASS

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: convert all GFX operations to the RADV_META_SAVE_XXX flags
Samuel Pitoiset [Tue, 3 Oct 2017 12:23:48 +0000 (14:23 +0200)]
radv: convert all GFX operations to the RADV_META_SAVE_XXX flags

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: introduce the concept of meta save flags
Samuel Pitoiset [Tue, 3 Oct 2017 12:12:05 +0000 (14:12 +0200)]
radv: introduce the concept of meta save flags

This will allow us to save/restore the different states on-demand
based on the meta operation. For now, this saves/restores all
states. Compute will follow once the graphics part is done.

The main idea is to merge all save/restore helpers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: remove unused RADV_META_VERTEX_BINDING_COUNT
Samuel Pitoiset [Tue, 3 Oct 2017 09:31:57 +0000 (11:31 +0200)]
radv: remove unused RADV_META_VERTEX_BINDING_COUNT

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: select the pipeline outside of the loop when decompressing htile
Samuel Pitoiset [Tue, 3 Oct 2017 09:08:03 +0000 (11:08 +0200)]
radv: select the pipeline outside of the loop when decompressing htile

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: add radv_htile_enabled() helper
Samuel Pitoiset [Tue, 3 Oct 2017 08:48:42 +0000 (10:48 +0200)]
radv: add radv_htile_enabled() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoi965: pass wanted format to intel_miptree_create_for_dri_image
Tapani Pälli [Wed, 4 Oct 2017 13:32:05 +0000 (16:32 +0300)]
i965: pass wanted format to intel_miptree_create_for_dri_image

Change b3a44ae7a4 caused regressions on Android where DRI and renderbuffer
can disagree on the format being used. This patch removes the colorspace
parameter and instead we pass renderbuffer format. For non-winsys images we
still do srgb/linear modification in same manner as change b3a44ae7a4 wanted
but take format from renderbuffer instead of DRI image.

This patch fixes regressions seen with following test sets:

   dEQP-EGL.functional.color_clears*
   dEQP-EGL.functional.render*

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102999
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoradeonsi: add a drirc workaround for HTILE corruption in ARK: Survival Evolved
Marek Olšák [Tue, 3 Oct 2017 17:28:48 +0000 (19:28 +0200)]
radeonsi: add a drirc workaround for HTILE corruption in ARK: Survival Evolved

v2: use DB_META | PS_PARTIAL_FLUSH

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102955
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (v1)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
6 years agoradeonsi: inline struct si_sampler_views
Marek Olšák [Mon, 2 Oct 2017 15:07:52 +0000 (17:07 +0200)]
radeonsi: inline struct si_sampler_views

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: rename si_textures_info -> si_samplers, si_images_info -> si_images
Marek Olšák [Mon, 2 Oct 2017 15:03:01 +0000 (17:03 +0200)]
radeonsi: rename si_textures_info -> si_samplers, si_images_info -> si_images

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: fold needs_*_decompress_mask update into si_set_sampler_view
Marek Olšák [Mon, 2 Oct 2017 14:58:10 +0000 (16:58 +0200)]
radeonsi: fold needs_*_decompress_mask update into si_set_sampler_view

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: simplify a loop in si_update_fb_dirtiness_after_rendering
Marek Olšák [Mon, 2 Oct 2017 14:49:37 +0000 (16:49 +0200)]
radeonsi: simplify a loop in si_update_fb_dirtiness_after_rendering

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoac: properly document a buffer.store LLVM workaround
Marek Olšák [Sat, 30 Sep 2017 13:36:18 +0000 (15:36 +0200)]
ac: properly document a buffer.store LLVM workaround

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: use f32_0 and f32_1
Marek Olšák [Fri, 29 Sep 2017 14:49:14 +0000 (16:49 +0200)]
radeonsi: use f32_0 and f32_1

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: fold *gallivm
Marek Olšák [Fri, 29 Sep 2017 14:35:26 +0000 (16:35 +0200)]
radeonsi: fold *gallivm

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: lp_type::length is always 1
Marek Olšák [Fri, 29 Sep 2017 14:28:23 +0000 (16:28 +0200)]
radeonsi: lp_type::length is always 1

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: don't use bld.elem_type
Marek Olšák [Fri, 29 Sep 2017 14:27:26 +0000 (16:27 +0200)]
radeonsi: don't use bld.elem_type

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: don't use lp_build_const_*
Marek Olšák [Fri, 29 Sep 2017 14:23:45 +0000 (16:23 +0200)]
radeonsi: don't use lp_build_const_*

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: use ctx->ac.context and ctx->types
Marek Olšák [Fri, 29 Sep 2017 13:11:14 +0000 (15:11 +0200)]
radeonsi: use ctx->ac.context and ctx->types

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: use ctx->ac.builder
Marek Olšák [Fri, 29 Sep 2017 13:02:06 +0000 (15:02 +0200)]
radeonsi: use ctx->ac.builder

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: use ctx->i/f32 types more
Marek Olšák [Wed, 27 Sep 2017 10:58:43 +0000 (12:58 +0200)]
radeonsi: use ctx->i/f32 types more

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: use i32_0 and i32_1 more
Marek Olšák [Wed, 27 Sep 2017 10:53:41 +0000 (12:53 +0200)]
radeonsi: use i32_0 and i32_1 more

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: use bitcast in a few places
Marek Olšák [Wed, 27 Sep 2017 10:48:31 +0000 (12:48 +0200)]
radeonsi: use bitcast in a few places

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: use ac helpers for bitcasts
Marek Olšák [Wed, 27 Sep 2017 10:46:17 +0000 (12:46 +0200)]
radeonsi: use ac helpers for bitcasts

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
6 years agoglsl_to_tgsi: skip UARL for 1D registers if the driver doesn't need it
Marek Olšák [Tue, 26 Sep 2017 13:32:49 +0000 (15:32 +0200)]
glsl_to_tgsi: skip UARL for 1D registers if the driver doesn't need it

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoglsl_to_tgsi: handle reladdr as TEMP in rename_temp_registers and dead_code
Marek Olšák [Tue, 26 Sep 2017 13:34:34 +0000 (15:34 +0200)]
glsl_to_tgsi: handle reladdr as TEMP in rename_temp_registers and dead_code

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoglsl_to_tgsi: each reladdr object should have only one parent
Marek Olšák [Fri, 29 Sep 2017 00:38:53 +0000 (02:38 +0200)]
glsl_to_tgsi: each reladdr object should have only one parent

required by rename_temp_registers.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoglsl_to_tgsi: fix instruction order for bindless textures
Marek Olšák [Fri, 29 Sep 2017 02:52:10 +0000 (04:52 +0200)]
glsl_to_tgsi: fix instruction order for bindless textures

We emitted instructions loading the bindless handle after the memory
instruction.

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoglsl_to_tgsi: enable copy propagation for tessellation shaders
Marek Olšák [Tue, 26 Sep 2017 01:32:15 +0000 (03:32 +0200)]
glsl_to_tgsi: enable copy propagation for tessellation shaders

just don't propagate output reads

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: implement PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS
Marek Olšák [Tue, 26 Sep 2017 13:58:13 +0000 (15:58 +0200)]
radeonsi: implement PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: use si_get_indirect_index for TEMP indexing
Marek Olšák [Thu, 28 Sep 2017 20:21:03 +0000 (22:21 +0200)]
radeonsi: use si_get_indirect_index for TEMP indexing

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradeonsi: use si_get_indirect_index for CONST indexing
Marek Olšák [Tue, 26 Sep 2017 13:30:34 +0000 (15:30 +0200)]
radeonsi: use si_get_indirect_index for CONST indexing

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agotgsi/ureg: allow any register file in address operands
Marek Olšák [Thu, 28 Sep 2017 19:45:51 +0000 (21:45 +0200)]
tgsi/ureg: allow any register file in address operands

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agogallium: add PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS
Marek Olšák [Tue, 26 Sep 2017 13:56:15 +0000 (15:56 +0200)]
gallium: add PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agotgsi/scan: scan address operands (v2)
Marek Olšák [Tue, 26 Sep 2017 14:17:47 +0000 (16:17 +0200)]
tgsi/scan: scan address operands (v2)

v2: set swizzled usage mask

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agotgsi/scan: set correct usage mask for tex offsets in scan_src_operand
Marek Olšák [Mon, 2 Oct 2017 18:35:15 +0000 (20:35 +0200)]
tgsi/scan: set correct usage mask for tex offsets in scan_src_operand

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agotgsi/scan: take advantage of already swizzled usage mask in scan_src_operand
Marek Olšák [Mon, 2 Oct 2017 17:59:22 +0000 (19:59 +0200)]
tgsi/scan: take advantage of already swizzled usage mask in scan_src_operand

It has always been a usage mask *after* swizzling.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agotgsi/scan: set non-valid src_index for tex offsets in scan_src_operand
Marek Olšák [Mon, 2 Oct 2017 17:51:16 +0000 (19:51 +0200)]
tgsi/scan: set non-valid src_index for tex offsets in scan_src_operand

tex offsets are not "Src" operands.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agotgsi: implement tgsi_util_get_inst_usage_mask properly
Marek Olšák [Mon, 2 Oct 2017 20:30:55 +0000 (22:30 +0200)]
tgsi: implement tgsi_util_get_inst_usage_mask properly

All opcodes are handled.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agotgsi: add docs for some existing pack opcodes
Marek Olšák [Mon, 2 Oct 2017 20:28:46 +0000 (22:28 +0200)]
tgsi: add docs for some existing pack opcodes

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
6 years agoradv: Enable VK_KHR_maintenance2 extension.
Bas Nieuwenhuizen [Thu, 5 Oct 2017 23:12:48 +0000 (01:12 +0200)]
radv: Enable VK_KHR_maintenance2 extension.

Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: Make tess winding order a bit more intuitive.
Bas Nieuwenhuizen [Thu, 5 Oct 2017 23:10:44 +0000 (01:10 +0200)]
radv: Make tess winding order a bit more intuitive.

Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: Allow setting the domain origin in tess.
Bas Nieuwenhuizen [Thu, 5 Oct 2017 23:10:11 +0000 (01:10 +0200)]
radv: Allow setting the domain origin in tess.

Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: Disable usage checks in metadata for images with extended usage data.
Bas Nieuwenhuizen [Thu, 5 Oct 2017 22:55:57 +0000 (00:55 +0200)]
radv: Disable usage checks in metadata for images with extended usage data.

The app can extend the usage, so knowing that the usage is limitied
does not help us here.

Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: Implement querying the point clipping behavior.
Bas Nieuwenhuizen [Thu, 5 Oct 2017 22:50:15 +0000 (00:50 +0200)]
radv: Implement querying the point clipping behavior.

Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agobroadcom: Fix out-of-tree build include path
Daniel Stone [Wed, 27 Sep 2017 17:42:22 +0000 (18:42 +0100)]
broadcom: Fix out-of-tree build include path

Reviewed-by: Eric Anholt <eric@anholt.net>
Fixes: 5b102160ae ("broadcom/genxml: Introduce a V3D packet/struct decoder.")
6 years agomeson: generate builddir/src/amd/vulkan/dev_icd.json
Bas Nieuwenhuizen [Thu, 5 Oct 2017 19:31:29 +0000 (21:31 +0200)]
meson: generate builddir/src/amd/vulkan/dev_icd.json

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agomesa: Use a 565 format for GL_RGB and GL_UNSIGNED_SHORT_5_6_5 textures.
Kenneth Graunke [Wed, 4 Oct 2017 08:08:37 +0000 (01:08 -0700)]
mesa: Use a 565 format for GL_RGB and GL_UNSIGNED_SHORT_5_6_5 textures.

Found while trying to optimize an application.

Not observed to help performance on i965, but should at least reduce
the memory usage of such textures a bit.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eero Tamminen <eero.t.tamminen@intel.com>
6 years agointel/compiler: Don't propagate cmod into integer multiplies
Jason Ekstrand [Wed, 4 Oct 2017 20:20:52 +0000 (13:20 -0700)]
intel/compiler: Don't propagate cmod into integer multiplies

No shader-db change on Sky Lake.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
6 years agointel/compiler: Don't cmod propagate into a saturated operation
Jason Ekstrand [Wed, 4 Oct 2017 20:49:29 +0000 (13:49 -0700)]
intel/compiler: Don't cmod propagate into a saturated operation

Shader-db results on Sky Lake:

    total instructions in shared programs: 12954445 -> 12955125 (0.01%)
    instructions in affected programs: 141862 -> 142542 (0.48%)
    helped: 0
    HURT: 626

Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
6 years agobroadcom/vc4: Don't advertise tiled dmabuf modifiers if we can't use them
Derek Foreman [Thu, 5 Oct 2017 17:41:08 +0000 (12:41 -0500)]
broadcom/vc4: Don't advertise tiled dmabuf modifiers if we can't use them

If the DRM_VC4_GET_TILING ioctl isn't present then we can't tell
if a dmabuf bo is tiled or linear, so will always assume it's
linear.

By not advertising tiled formats in this situation we ensure the
assumption is correct.

This fixes a bug where most attempts to render a gl wayland client
under weston will result in a client side abort.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Daniel Stone <daniels@collabora.com> (on irc)
6 years agoegl: Simplify the "driver" interface
Adam Jackson [Mon, 28 Aug 2017 15:23:58 +0000 (11:23 -0400)]
egl: Simplify the "driver" interface

"Driver" isn't a great word for what this layer is, it's effectively a
build-time choice about what OS you're targeting. Despite that both of
the extant backends totally ignore the display argument, the old code
would only set up the backend relative to a display.

That causes problems! One problem is it means eglGetProcAddress can
generate X or Wayland protocol when it tries to connect to a default
display so it can call into the backend, which is, you know, completely
bonkers. Any other EGL API that doesn't reference a display, like
EGL_EXT_device_query, would have the same issue.

Fortunately this is a problem that can be solved with the delete key.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
6 years agoloader/dri3: Don't accidently free buffer holding new back content
Thomas Hellstrom [Thu, 14 Sep 2017 11:09:05 +0000 (13:09 +0200)]
loader/dri3: Don't accidently free buffer holding new back content

Avoid freeing buffers holding new back content
(with GLX_SWAP_COPY_OML and GLX_SWAP_EXCHANGE_OML)
Prevously that would have resulted in back buffer content becoming
incorrect after a swap, although I haven't managed to trigger such a
situation yet.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
6 years agoloader/dri3: Avoid resizing existing buffers in dri3_find_back_alloc
Thomas Hellstrom [Thu, 14 Sep 2017 10:39:18 +0000 (12:39 +0200)]
loader/dri3: Avoid resizing existing buffers in dri3_find_back_alloc

Resize only in loader_dri3_get_buffers(),
where the dri driver has a chance to immediately update the viewport.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
6 years agoloader/dri3: Use local blits and local buffers when resizing
Thomas Hellstrom [Thu, 14 Sep 2017 10:15:43 +0000 (12:15 +0200)]
loader/dri3: Use local blits and local buffers when resizing

When a drawable is resized, and we fill the resized buffers, with data
from the old buffers, use a local blit if there is a local buffer (back or
fake front), and we have local blitting capability.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
6 years agogallivm/ppc64le: allow environmental control of Altivec code generation
Ben Crocker [Thu, 28 Sep 2017 18:09:13 +0000 (14:09 -0400)]
gallivm/ppc64le: allow environmental control of Altivec code generation

In check_os_altivec_support(), allow control of Altivec (first PPC vector
instruction set) code generation via a new environmental control,
GALLIVM_ALTIVEC, which is expected to take on a value of 1 or 0.
The default is to enable Altivec code generation.

This environmental control of Altivec code generation is initially
available only #ifdef DEBUG.

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
6 years agogallivm/ppc64le: adjust VSX code generation control.
Ben Crocker [Thu, 28 Sep 2017 18:09:12 +0000 (14:09 -0400)]
gallivm/ppc64le: adjust VSX code generation control.

In lp_build_create_jit_compiler_for_module(), advance the minimum
version of LLVM for VSX code generation to 4.0; this is the minimum
revision at which several known VSX code generation bugs are fixed:

  https://llvm.org/bugs/show_bug.cgi?id=25503 (fixed in 3.8.1)
  https://llvm.org/bugs/show_bug.cgi?id=26775 (fixed in 3.8.1)
  https://llvm.org/bugs/show_bug.cgi?id=33531 (fixed in 4.0)

An llc performance bug introduced in LLVM 4.0,

  https://llvm.org/bugs/show_bug.cgi?id=34647

is still pending as of LLVM 5.0, but only has a pronounced effect on
one of the Piglit tests: ext_transform_feedback-max-varyings.

All changes tested via Piglit.

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
Acked-by: Roland Scheidegger <sroland@vmware.com>
6 years agogallivm: allow additional llc options
Ben Crocker [Thu, 28 Sep 2017 18:09:11 +0000 (14:09 -0400)]
gallivm: allow additional llc options

In init_native_targets, allow the passing of additional options to
the LLC compiler via new GALLIVM_LLC_OPTIONS environmental control.
This option is available only #ifdef DEBUG, initially.
At top, add #include <llvm-c/Support.h> for LLVMParseCommandLineOptions()
declaration.

v2: Fix compile error with old llvm versions (sroland)

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
6 years agogallivm: fix typo in debug_printf message
Ben Crocker [Thu, 28 Sep 2017 18:09:10 +0000 (14:09 -0400)]
gallivm: fix typo in debug_printf message

In gallivm_compile_module, fix a typo in the
debug_printf("Invoke as \"llc ..." message.

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ben Crocker <bcrocker@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
6 years agoradv: remove useless checks around radv_CmdBindPipeline()
Samuel Pitoiset [Wed, 4 Oct 2017 20:27:39 +0000 (22:27 +0200)]
radv: remove useless checks around radv_CmdBindPipeline()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: check that pipeline is different before binding it
Samuel Pitoiset [Wed, 4 Oct 2017 20:27:38 +0000 (22:27 +0200)]
radv: check that pipeline is different before binding it

We only need to dirty the descriptors when the pipeline is
a new one, because user SGPRs can be potentially different.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoi965: Validate "Special Requirements for Handling Double Precision Data Types"
Matt Turner [Wed, 30 Aug 2017 01:29:29 +0000 (18:29 -0700)]
i965: Validate "Special Requirements for Handling Double Precision Data Types"

I did not implement:

   CNL's restriction on 64-bit int + align16, because I don't think
   we'll ever use this combination regardless of hardware generation.

   The restriction on immediate DF -> F conversions, because there's no
   reason to ever generate that, and I don't even know how DF -> F
   conversions are supposed to work in Align16 since (1) the dst stride
   must be 1, but (2) the dst stride would have to be 2 for src and dst
   strides to be aligned.

6 years agoi965: Fix and enable forgotten validation test
Matt Turner [Fri, 1 Sep 2017 22:22:40 +0000 (15:22 -0700)]
i965: Fix and enable forgotten validation test

I seem to have forgotten I still had work to do.

6 years agoi965: Only insert error message if not already present
Matt Turner [Mon, 18 Sep 2017 21:07:20 +0000 (14:07 -0700)]
i965: Only insert error message if not already present

Some restrictions require something like strides to match between src
and dest. For multi-source instructions, I'd rather encapsulate the
logic for not inserting already present errors in ERROR_IF than
open-coding it multiple places.

6 years agoi965: Avoid validation error when src1 is not present
Matt Turner [Fri, 1 Sep 2017 22:21:48 +0000 (15:21 -0700)]
i965: Avoid validation error when src1 is not present

There can be no violation of the restriction that source offsets are
aligned if there is only one source offset.

6 years agoi965: Remove validate_reg()
Matt Turner [Mon, 11 Sep 2017 17:08:59 +0000 (10:08 -0700)]
i965: Remove validate_reg()

Replaced by the assembly validator, and in fact gets in the way of
writing tests for the assembly validator.

6 years agoi965: Add and use STRIDE and WIDTH macros
Matt Turner [Wed, 30 Aug 2017 01:25:54 +0000 (18:25 -0700)]
i965: Add and use STRIDE and WIDTH macros

You'll notice there were bugs in some of the code being replaced.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
6 years agoi965: Add parentheses around usage of macro arguments
Matt Turner [Fri, 1 Sep 2017 22:34:54 +0000 (15:34 -0700)]
i965: Add parentheses around usage of macro arguments

Otherwise I cannot use this macro in test_eu_validate.cpp

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
6 years agoi965: Add GLK, CFL, CNL to test_eu_validate.c
Matt Turner [Wed, 30 Aug 2017 22:45:22 +0000 (15:45 -0700)]
i965: Add GLK, CFL, CNL to test_eu_validate.c

6 years agoi965: Add Atom graphics names to parse_devid_override()
Matt Turner [Tue, 29 Aug 2017 22:32:11 +0000 (15:32 -0700)]
i965: Add Atom graphics names to parse_devid_override()

6 years agoi965: Fix support for disassembling 64-bit integer immediates
Matt Turner [Thu, 21 Sep 2017 20:52:28 +0000 (13:52 -0700)]
i965: Fix support for disassembling 64-bit integer immediates

The type suffixes were wrong, and the 16 was missing the 0 prefix.

Fixes: 92f787ff86ab ("i965: Add support for disassembling 64-bit integer immediates")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
6 years agoi965/fs: Rewrite fsign64 to skip the float -> double conversion
Matt Turner [Fri, 29 Sep 2017 03:59:49 +0000 (20:59 -0700)]
i965/fs: Rewrite fsign64 to skip the float -> double conversion

... without the float -> double conversion. Low power parts have
additional restrictions when it comes to operating on 64-bit types, and
the instruction used to do the conversion violates one of them:
specifically, the restriction that "Source and Destination horizontal
stride must be aligned to the same qword".

Previously we generated a float and then converted, but we can avoid the
conversion by using the same extract-the-sign-bit + or-in-1.0 algorithm
by directly operating on the high four bytes of each double-precision
component in the result.

In SIMD8 and SIMD16 this cuts one instruction from the implementation,
and more importantly that instruction is the one which violated the
regioning restriction.

Along the way I removed some comments that I did not think helped, and
some code about double comparisons which does not seem to be necessary
today.

This prevents validation failures caught by the new EU validation code
added in later patches.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
6 years agoi965/fs: Unpack count argument to 64-bit shift ops on Atom
Matt Turner [Thu, 21 Sep 2017 23:42:02 +0000 (16:42 -0700)]
i965/fs: Unpack count argument to 64-bit shift ops on Atom

64-bit operations on Atom parts have additional restrictions over their
big-core counterparts (validated by later patches).

Specifically, the restriction that "Source and Destination horizontal
stride must be aligned to the same qword" is violated by most shift
operations since NIR uses a 32-bit value as the shift count argument,
and this causes instructions like

   shl(8)          g19<1>Q         g5<4,4,1>Q      g23<4,4,1>UD

where src1 has a 32-bit stride, but the dest and src0 have a 64-bit
stride.

This caused ~4 pixels in the ARB_shader_ballot piglit test
fs-readInvocation-uint.shader_test to be incorrect. Unfortunately no
ARB_gpu_shader_int64 test hit this case because they operate on
uniforms, and their scalar regions are an exception to the restriction.

We work around this by effectively unpacking the shift count, so that we
can read it with a 64-bit stride in the shift instruction. Unfortunately
the unpack (a MOV with a dst stride of 2) is a partial write, and cannot
be copy-propagated or CSE'd.

Bugzilla: https://bugs.freedesktop.org/101984

6 years agoi965/fs: Don't apply POW/FDIV workaround on Gen10+
Matt Turner [Fri, 25 Aug 2017 22:52:27 +0000 (15:52 -0700)]
i965/fs: Don't apply POW/FDIV workaround on Gen10+

The documentation says it applies only to Gens 8 and 9.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
6 years agoi965: Fix src0 vs src1 typo
Matt Turner [Tue, 3 Oct 2017 05:15:07 +0000 (22:15 -0700)]
i965: Fix src0 vs src1 typo

A typo caused us to copy src0's reg file to src1 rather than reading
src1's as intended. This caused us to fail to compact instructions like

   mov(8)   g4<1>D    0D              { align1 1Q };

because src1 was set to immediate rather than architecture file. Fixing
this reenables compaction (after the precompact() pass changes the data
types):

   mov(8)   g4<1>UD   0x00000000UD    { align1 1Q compacted };

Fixes: 1cb0a7941b27 ("i965: Switch to using the logical register types")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoradv: enable tc compatible htile for d32s8 also.
Dave Airlie [Tue, 13 Jun 2017 03:31:14 +0000 (13:31 +1000)]
radv: enable tc compatible htile for d32s8 also.

This enables tc compatible htile for stencil surfaces as well.

This gives a 3-5fps boost on Mad Max on high@4k.

It also depends on Bas's tc-compat htile patch.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: dump SPIRV when a GPU hang is detected
Samuel Pitoiset [Fri, 22 Sep 2017 14:56:40 +0000 (16:56 +0200)]
radv: dump SPIRV when a GPU hang is detected

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: dump NIR when a GPU hang is detected
Samuel Pitoiset [Fri, 22 Sep 2017 14:44:08 +0000 (16:44 +0200)]
radv: dump NIR when a GPU hang is detected

This looks a bit ugly to me, but the existing codepath
is not terribly elegant as well.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoac: silence a warning
Marek Olšák [Wed, 4 Oct 2017 14:59:40 +0000 (16:59 +0200)]
ac: silence a warning

6 years agoegl/wayland: Don't use dmabuf with no modifiers
Daniel Stone [Mon, 2 Oct 2017 15:40:53 +0000 (16:40 +0100)]
egl/wayland: Don't use dmabuf with no modifiers

The dmabuf interface requires a valid modifier to be sent. If we don't
explicitly get a modifier from the driver, we can't know what to send;
it must be inferred from legacy side-channels (or assumed to linear, if
none exists).

If we have no modifier, then we can only have a single-plane format
anyway, so fall back to the old wl_drm buffer import path.

Fixes: a65db0ad1c ("st/dri: don't expose modifiers in EGL if the driver doesn't implement them")
Fixes: 02cc359372 ("egl/wayland: Use linux-dmabuf interface for buffers")
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reported-by: Andy Furniss <adf.lists@gmail.com>
Cc: Marek Olšák <marek.olsak@amd.com>
6 years agoegl/wayland: Check queryImage return for wl_buffer
Daniel Stone [Mon, 2 Oct 2017 15:40:53 +0000 (16:40 +0100)]
egl/wayland: Check queryImage return for wl_buffer

When creating a wl_buffer from a DRIImage, we extract all the DRIImage
information via queryImage. Check whether or not it actually succeeds,
either bailing out if the query was critical, or providing sensible
fallbacks for information which was not available in older DRIImage
versions.

Fixes: a65db0ad1c ("st/dri: don't expose modifiers in EGL if the driver doesn't implement them")
Fixes: 02cc359372 ("egl/wayland: Use linux-dmabuf interface for buffers")
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reported-by: Andy Furniss <adf.lists@gmail.com>
Cc: Marek Olšák <marek.olsak@amd.com>
6 years agotravis: move include path from $CC to $CFLAGS
Eric Engestrom [Wed, 4 Oct 2017 12:54:14 +0000 (13:54 +0100)]
travis: move include path from $CC to $CFLAGS

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agowayland-egl: adds CFLAGS for wayland.egl.h include
Tobias Klausmann [Tue, 3 Oct 2017 13:45:22 +0000 (15:45 +0200)]
wayland-egl: adds CFLAGS for wayland.egl.h include

Starting with commit ab0589c6ed ("wayland-egl: remove no longer needed
wayland-client dependency") the wayland-egl.h include was missing leading to a
build failure:

  CC       wayland-egl.lo
wayland-egl.c:33:10: fatal error: wayland-egl.h: No such file or directory
 #include "wayland-egl.h"
          ^~~~~~~~~~~~~~~

Strictly speaking we should be checking for wayland-egl in configure and
propagating its CFLAGS here.

Yet again, the current wayland-egl split is bonkers as the Wayland repo
provides single header, no pkg-config file or library.

That will be resolved at a later stage, but in the meanwhile fix the
build.

Fixes: ab0589c6ed ("wayland-egl: remove no longer needed wayland-client
dependency")
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[Emil Velikov: add some text about CFLAGS and current wayland-egl situation]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoautomake: add texcompress_s3tc_tmp.h to the sources list
Emil Velikov [Wed, 4 Oct 2017 13:21:40 +0000 (14:21 +0100)]
automake: add texcompress_s3tc_tmp.h to the sources list

Otherwise it will be missing from the tarball.

Fixes: f7daa737d17 ("mesa: Combine libtxc_dxtn sources into
texcompress_s3tc_tmp.h")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agost/va: add RGB support to vlVaPutSurface
Leo Liu [Mon, 2 Oct 2017 01:27:21 +0000 (21:27 -0400)]
st/va: add RGB support to vlVaPutSurface

Tested-by: Andy Furniss <adf.lists@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
6 years agost/va: don't re-allocate interlaced buffer with pakced format
Leo Liu [Mon, 2 Oct 2017 01:27:20 +0000 (21:27 -0400)]
st/va: don't re-allocate interlaced buffer with pakced format

It caused corruption, when vlVaPutImage putting raw data to the fields

v2: add RGB formats since it got uploaded here as well

Cc: mesa-stable@lists.freedesktop.org
Cc: Andy Furniss <adf.lists@gmail.com>
Tested-by: Andy Furniss <adf.lists@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
6 years agost/vdpau: don't re-allocate interlaced buffer with packed YUV format
Leo Liu [Sun, 1 Oct 2017 02:19:49 +0000 (22:19 -0400)]
st/vdpau: don't re-allocate interlaced buffer with packed YUV format

It caused corruption, when vlVdpVideoSurfacePutBitsYCbCr putting YUV to the fields

Cc: mesa-stable@lists.freedesktop.org
Cc: Andy Furniss <adf.lists@gmail.com>
Tested-by: Andy Furniss <adf.lists@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
6 years agoradv: Implement TC compatible HTILE.
Bas Nieuwenhuizen [Tue, 9 May 2017 06:26:07 +0000 (08:26 +0200)]
radv: Implement TC compatible HTILE.

The situations where we enable it are quite limitied, but it works,
even for madmax, so lets just enable it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: emit fmuladd instead of fma to llvm.
Dave Airlie [Wed, 4 Oct 2017 02:06:04 +0000 (03:06 +0100)]
radv: emit fmuladd instead of fma to llvm.

For Vulkan SPIR-V the spec states
fma() Inherited from OpFMul followed by OpFAdd.

Matt says the backend will do the right thing depending on the
hardware being compiled for, if you use the fmuladd intrinsic.

Using the Mad Max pts test, on high settings at 4K:
CHP: 55->60
HGDD: 46->50
LM: 55->60
No change on Stronghold.

Thanks to Feral for spending the time to track this down.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoandroid: fix build issues with brw_nir_trig_workarounds.c
Tapani Pälli [Tue, 3 Oct 2017 08:06:12 +0000 (11:06 +0300)]
android: fix build issues with brw_nir_trig_workarounds.c

Fixes: 848da66222 ("intel: use a flag instead of setting PYTHONPATH")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>