mesa.git
7 years agoi965: Add a brw_hw_type_to_reg_type() function
Matt Turner [Thu, 27 Jul 2017 00:50:22 +0000 (17:50 -0700)]
i965: Add a brw_hw_type_to_reg_type() function

Will be used in later commits.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Use a common table to translate logical to hardware types
Matt Turner [Thu, 27 Jul 2017 00:50:05 +0000 (17:50 -0700)]
i965: Use a common table to translate logical to hardware types

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Extract functions dealing with register types to separate file
Matt Turner [Wed, 26 Jul 2017 18:08:11 +0000 (11:08 -0700)]
i965: Extract functions dealing with register types to separate file

I'm going to encapsulate all of the logic dealing with register types in
this file.

Rename the parameters for the hardware encodings from type -> hw_type at
the same time.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Reverse file/type arguments to register type functions
Matt Turner [Thu, 27 Jul 2017 00:03:12 +0000 (17:03 -0700)]
i965: Reverse file/type arguments to register type functions

I think of the initial arguments as "state" and the last as the actual
subject.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Add support for disassembling 64-bit integer immediates
Matt Turner [Tue, 25 Jul 2017 21:25:27 +0000 (14:25 -0700)]
i965: Add support for disassembling 64-bit integer immediates

After the last patch converted things into enums, I helpfully got a
compiler warning about these missing from the switch statement.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Use separate enums for register vs immediate types
Matt Turner [Tue, 25 Jul 2017 21:05:44 +0000 (14:05 -0700)]
i965: Use separate enums for register vs immediate types

The hardware encodings often mean different things depending on whether
the source is an immediate.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Reorder brw_reg_type enum values
Matt Turner [Tue, 25 Jul 2017 20:16:25 +0000 (13:16 -0700)]
i965: Reorder brw_reg_type enum values

These vaguely corresponded to the hardware encodings, but that is purely
historical at this point. Reorder them so we stop making things "almost
work" when mixing enums.

The ordering has been closen so that no enum value is the same as a
compatible hardware encoding.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Validate destination restrictions with vector immediates
Matt Turner [Fri, 28 Jul 2017 01:29:50 +0000 (18:29 -0700)]
i965: Validate destination restrictions with vector immediates

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Don't let raw-move check be tricked by immediate vector types
Matt Turner [Tue, 1 Aug 2017 19:21:54 +0000 (12:21 -0700)]
i965: Don't let raw-move check be tricked by immediate vector types

UB and B type encodings are the same as UV and VF. Noticed when writing
the following patch.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Only change type of 0.0f to VF if destination stride == 1
Matt Turner [Tue, 1 Aug 2017 17:12:56 +0000 (10:12 -0700)]
i965: Only change type of 0.0f to VF if destination stride == 1

The destination stride must be equivalent to a dword if VF is used.

Also, since the only compaction table entires with "i:vf" have the
destination as "r:f" specifically check that the destination is of type
float.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Remove CONT/BREAK from instruction compaction test
Matt Turner [Tue, 1 Aug 2017 02:13:15 +0000 (19:13 -0700)]
i965: Remove CONT/BREAK from instruction compaction test

These cannot be compacted. A similar mistake was fixed in commit
90eaf01616a8

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Test instruction compaction on all supported Gens
Matt Turner [Tue, 1 Aug 2017 02:07:42 +0000 (19:07 -0700)]
i965: Test instruction compaction on all supported Gens

Note that there's no point in testing on G45, since its compaction is
the same as Gen5. Same logic applies to Gen7 variants and low-power
parts.

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Silence signed/unsigned comparison warning
Matt Turner [Wed, 2 Aug 2017 23:17:05 +0000 (16:17 -0700)]
i965: Silence signed/unsigned comparison warning

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Move compaction "prepass" into brw_eu_compact.c
Matt Turner [Fri, 28 Jul 2017 01:30:14 +0000 (18:30 -0700)]
i965: Move compaction "prepass" into brw_eu_compact.c

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agoi965: Mark src inst pointer const in compaction code
Matt Turner [Mon, 31 Jul 2017 22:35:49 +0000 (15:35 -0700)]
i965: Mark src inst pointer const in compaction code

Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
7 years agovulkan: import 1.0.59 headers and xml.
Dave Airlie [Mon, 21 Aug 2017 20:59:07 +0000 (06:59 +1000)]
vulkan: import 1.0.59 headers and xml.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoAndroid: Fix LLVM duplicated symbols linking for N and M
Rob Herring [Tue, 15 Aug 2017 21:37:41 +0000 (16:37 -0500)]
Android: Fix LLVM duplicated symbols linking for N and M

Both statically linking libLLVMCore and dynamically linking libLLVM causes
duplicated symbols in gallium_dri.so and it fails to dlopen. We don't
really need to link libLLVMCore, but just need generated headers to be
built first. Dynamically linking to libLLVM instead is enough to do
that. Thanks to Qiang Yu for finding the root cause.

With this change, we can align all versions and just have libLLVM as a
shared lib dependency.

This also requires changes in the M and N versions of LLVM to export the
include paths for libLLVM. AOSP master is okay.

Fixes: 26aee6f4d5a ("Android: rework LLVM build support")
Reported-by: Mauro Rossi <issor.oruam@gmail.com>
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Signed-off-by: Rob Herring <robh@kernel.org>
7 years agodocs: update calendar, add news item and link release notes for 17.1.7
Andres Gomez [Mon, 21 Aug 2017 15:34:42 +0000 (18:34 +0300)]
docs: update calendar, add news item and link release notes for 17.1.7

Signed-off-by: Andres Gomez <agomez@igalia.com>
7 years agodocs: add sha256 checksums for 17.1.7
Andres Gomez [Mon, 21 Aug 2017 15:22:49 +0000 (18:22 +0300)]
docs: add sha256 checksums for 17.1.7

Signed-off-by: Andres Gomez <agomez@igalia.com>
7 years agodocs: add release notes for 17.1.7
Andres Gomez [Mon, 21 Aug 2017 15:10:18 +0000 (18:10 +0300)]
docs: add release notes for 17.1.7

Signed-off-by: Andres Gomez <agomez@igalia.com>
7 years agost/va: add MJPEG for config
Leo Liu [Tue, 15 Aug 2017 15:44:08 +0000 (11:44 -0400)]
st/va: add MJPEG for config

To enable MJPEG HW decode

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: reallocate surface with YUYV stream
Leo Liu [Tue, 15 Aug 2017 16:33:21 +0000 (12:33 -0400)]
st/va: reallocate surface with YUYV stream

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: detect MJPEG format from bitstream
Leo Liu [Tue, 15 Aug 2017 18:08:02 +0000 (14:08 -0400)]
st/va: detect MJPEG format from bitstream

To find if the format is supported YUYV by sampling factor which
is embedded from bitstream. So we could use this info for buffer
reallocation on the correct format.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeon/uvd: add YUYV format support for target buffer
Leo Liu [Fri, 18 Aug 2017 16:12:05 +0000 (12:12 -0400)]
radeon/uvd: add YUYV format support for target buffer

Make chroma plane optional for YUYV support

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: reallocate surface when interlaced
Leo Liu [Tue, 15 Aug 2017 16:58:59 +0000 (12:58 -0400)]
st/va: reallocate surface when interlaced

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeon/video: MJPEG not support stacked video buffers
Leo Liu [Tue, 15 Aug 2017 16:39:35 +0000 (12:39 -0400)]
radeon/video: MJPEG not support stacked video buffers

So we have to detect it for reallocation of de-interlaced buffers

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: make surface allocate functions more usefully
Leo Liu [Tue, 15 Aug 2017 13:07:06 +0000 (09:07 -0400)]
st/va: make surface allocate functions more usefully

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeon/uvd: reconstruct MJPEG bitstream
Leo Liu [Tue, 15 Aug 2017 17:39:37 +0000 (13:39 -0400)]
radeon/uvd: reconstruct MJPEG bitstream

The current tier 1 mjpeg firmware only supports at the bitstream
level, the later tier 2 support will be at the buffers level with
newer hardware.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
7 years agost/va: add slice parameter handling for MJPEG
Leo Liu [Tue, 15 Aug 2017 15:54:22 +0000 (11:54 -0400)]
st/va: add slice parameter handling for MJPEG

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: add huffman table handling for MJPEG
Leo Liu [Tue, 15 Aug 2017 15:52:26 +0000 (11:52 -0400)]
st/va: add huffman table handling for MJPEG

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: add iq matrix handling for MJPEG
Leo Liu [Tue, 15 Aug 2017 15:01:35 +0000 (11:01 -0400)]
st/va: add iq matrix handling for MJPEG

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: add picture parameter handling for MJPEG
Leo Liu [Tue, 15 Aug 2017 14:53:22 +0000 (10:53 -0400)]
st/va: add picture parameter handling for MJPEG

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: add handles for MJPEG Buffers
Leo Liu [Tue, 15 Aug 2017 16:43:35 +0000 (12:43 -0400)]
st/va: add handles for MJPEG Buffers

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: create decoder for MJPEG format
Leo Liu [Tue, 15 Aug 2017 16:06:24 +0000 (12:06 -0400)]
st/va: create decoder for MJPEG format

Mjpeg doesn't need reference

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agost/va: add MJPEG picture to context
Leo Liu [Tue, 15 Aug 2017 14:43:38 +0000 (10:43 -0400)]
st/va: add MJPEG picture to context

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeon/video: add MJPEG support
Leo Liu [Wed, 16 Aug 2017 15:49:33 +0000 (11:49 -0400)]
radeon/video: add MJPEG support

v2: add ASIC and Kernel version check

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeon/uvd: add MJPEG support
Leo Liu [Tue, 15 Aug 2017 15:25:08 +0000 (11:25 -0400)]
radeon/uvd: add MJPEG support

There is no need of dpb buffer for mjpeg codec

v2: check dpb_size instead of format

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeon/uvd: add MJPEG stream type
Leo Liu [Tue, 15 Aug 2017 18:26:15 +0000 (14:26 -0400)]
radeon/uvd: add MJPEG stream type

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agovl: add MJPEG picture description
Leo Liu [Tue, 15 Aug 2017 14:31:30 +0000 (10:31 -0400)]
vl: add MJPEG picture description

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agovl: add MJPEG profile and format
Leo Liu [Tue, 15 Aug 2017 18:21:16 +0000 (14:21 -0400)]
vl: add MJPEG profile and format

v2: move util video change to here

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeon/uvd: get the target buffer pitch correct for different format
Leo Liu [Fri, 18 Aug 2017 16:03:19 +0000 (12:03 -0400)]
radeon/uvd: get the target buffer pitch correct for different format

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
7 years agoradeonsi: update non-resident bindless descriptors if needed
Samuel Pitoiset [Wed, 9 Aug 2017 13:47:22 +0000 (15:47 +0200)]
radeonsi: update non-resident bindless descriptors if needed

Only resident bindless descriptors are currently updated and
re-uploaded, this makes sure that the non-resident ones are
also updated.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
7 years agodri3: Move up fourcc utility function
Louis-Francis Ratté-Boulianne [Fri, 7 Jul 2017 06:53:28 +0000 (02:53 -0400)]
dri3: Move up fourcc utility function

It will be needed in next patches.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoegl: Add dma_buf_import_modifiers for glvnd
Daniel Stone [Mon, 31 Jul 2017 14:09:16 +0000 (15:09 +0100)]
egl: Add dma_buf_import_modifiers for glvnd

Make sure we advertise the new entrypoints to libglvnd's EGL dispatch.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reported-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101982
Fixes: 4c412293d0e ("egl: advertise EGL_EXT_image_dma_buf_import_modifiers")
7 years agointel/blorp: Adjust intra-tile x when faking rgb with red-only
Topi Pohjolainen [Sat, 19 Aug 2017 06:22:22 +0000 (09:22 +0300)]
intel/blorp: Adjust intra-tile x when faking rgb with red-only

v2 (Jason): Adjust directly in surf_fake_rgb_with_red()

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101910

CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
7 years agoac/nir: fixup layer/viewport export for GFX9.
Dave Airlie [Wed, 16 Aug 2017 01:39:31 +0000 (02:39 +0100)]
ac/nir: fixup layer/viewport export for GFX9.

GFX9 moved where the viewport index export goes.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoi965/bufmgr: s/BO_ALLOC_FOR_RENDER/BO_ALLOC_BUSY/
Jason Ekstrand [Sat, 19 Aug 2017 22:03:39 +0000 (15:03 -0700)]
i965/bufmgr: s/BO_ALLOC_FOR_RENDER/BO_ALLOC_BUSY/

"Alloc for render" is a terrible name for a flag because it means
basically nothing.  What the flag really does is allocate a busy BO
which someone theorized at one point in time would be more efficient if
you're planning to immediately render to it.  If the flag really means
"alloc a busy BO" we should just call it that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoi965/tex: Change the flags type on create_for_teximage
Jason Ekstrand [Sat, 19 Aug 2017 21:54:42 +0000 (14:54 -0700)]
i965/tex: Change the flags type on create_for_teximage

This matches the actual function declaration.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agomesa: only copy requested compressed teximage cubemap faces
Christoph Haag [Sat, 19 Aug 2017 23:59:43 +0000 (01:59 +0200)]
mesa: only copy requested compressed teximage cubemap faces

This is analogous to commit 2259b11 which only fixed the regular case

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102308
Signed-off-by: Christoph Haag <haagch+mesadev@frickel.club>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
7 years agoi965/tex: Don't pass samples to miptree_create_for_teximage
Jason Ekstrand [Sat, 19 Aug 2017 18:03:38 +0000 (11:03 -0700)]
i965/tex: Don't pass samples to miptree_create_for_teximage

In 76e2f390f9863a35, when Topi switched num_samples from 0 to 1 for
single-sampled, he accidentally switched the last parameter in the call
to miptree_create_for_teximage from 0 to 1 thinking it was num_samples
when it was actually layout_flags.  Switching from 0 to 1 added the
MIPTREE_LAYOUT_ACCELERATED_UPLOAD flag which causes us to allocate a
busy BO instead of an idle one.  This caused the subsequent CPU upload
to consistently stall.  The end result was a 15% performance drop in the
SynMark v7 DrvRes microbenchmark.  This restores the old behavior and
fixes the performance regression.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Fixes: 76e2f390f9863a356d1419982dec705260d67eff
Bugzilla: https://bugs.freedesktop.org/102260
Cc: mesa-stable@lists.freedesktop.org
7 years agoanv: Use ISL for emitting null surface states.
Kenneth Graunke [Thu, 17 Aug 2017 07:50:08 +0000 (00:50 -0700)]
anv: Use ISL for emitting null surface states.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965: Use ISL for emitting null surface states.
Kenneth Graunke [Thu, 17 Aug 2017 07:44:41 +0000 (00:44 -0700)]
i965: Use ISL for emitting null surface states.

We handle the Sandybridge multisampled 2D surface hack here, rather
than in ISL, because it requires allocating a BO, and is kind of messy.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoisl: Add a null surface fill function.
Kenneth Graunke [Thu, 17 Aug 2017 07:17:05 +0000 (00:17 -0700)]
isl: Add a null surface fill function.

ISL already offers functions to fill out most kinds of SURFACE_STATE,
so why not handle null surfaces too?

Null surfaces are simple, so we can just take the dimensions, rather
than an entirte fill structure.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
7 years agoi965: Remove tabs in intel_batchbuffer.c.
Kenneth Graunke [Thu, 20 Jul 2017 23:33:15 +0000 (16:33 -0700)]
i965: Remove tabs in intel_batchbuffer.c.

Our coding style is to use spaces.  Some of this was also messed up
during my bufmgr import series.

(Trivial, just whitespace changes.)

7 years agoi965/miptree: Return NONE from texture_aux_usage when fully resolved
Jason Ekstrand [Thu, 17 Aug 2017 22:27:25 +0000 (15:27 -0700)]
i965/miptree: Return NONE from texture_aux_usage when fully resolved

This little optimization improves the performance of SynMark v7
TexFilterTri by almost 10% on Sky Lake GT4 among other improvements.
We've been doing it for some time but somehow it got dropped during
the miptree refactoring.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/102258
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
7 years agoi965: Stop looking at NewDriverState when emitting 3DSTATE_URB
Jason Ekstrand [Fri, 18 Aug 2017 23:10:39 +0000 (16:10 -0700)]
i965: Stop looking at NewDriverState when emitting 3DSTATE_URB

Looking at NewDriverState is not safe in general.  The state atom system
is set up to ensure that new bits that get added to NewDriverState get
accumulated into the set of bits used when emitting atoms but it doesn't
go the other way.  If we read NewDriverState, we may not get the full
picture because the per-pipeline state (3D or compute) does not get
added to NewDriverState before state emit is done.  It's especially
dangerous to do this from BLORP (either explicitly or implicitly when
BLORP calls gen7_upload_urb) because that does not happen during one of
the normal state upload paths.

This commit solves the problem by whacking all of the per-shader-stage
URB sizes to zero whenever we change the total URB size.  We still have
to flag BRW_NEW_URB_SIZE to ensure that the gen7_urb atom triggers but
the actual decision in gen7_upload_urb can now be based entirely on URB
sizes rather than on state atoms.  This also makes BLORP correct because
it just asks for a new URB config whenever the vsize is too small and so
any change to the total URB size will trigger blorp to re-emit as well
because 0 < vs_entry_size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Bugzilla: https://bugs.freedesktop.org/102289
Cc: mesa-stable@lists.freedesktop.org
7 years agoi965: Mark all EGLimages as non-coherent.
Kenneth Graunke [Wed, 16 Aug 2017 18:15:24 +0000 (11:15 -0700)]
i965: Mark all EGLimages as non-coherent.

EGLimages are shared with external users, and we don't know what they're
going to do with them.  They might scan them out.  They might access
them in a way that doesn't work with our explicit clflushing.

It's safest to simply mark them non-coherent.

Chris Wilson caught this problem and wrote a similar (though less
aggressive) patch to solve it; the miptree code has since undergone
a lot of refactoring so I had to rewrite it.

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
7 years agobroadcom/genxml: Add V3D 3.3 packet definitions.
Eric Anholt [Fri, 3 Feb 2017 00:20:15 +0000 (16:20 -0800)]
broadcom/genxml: Add V3D 3.3 packet definitions.

This will be used by the new vc5 gallium driver, and a future Vulkan
driver.

7 years agobroadcom/genxml: Check the sub-id field when decoding instructions.
Eric Anholt [Thu, 13 Jul 2017 20:20:29 +0000 (13:20 -0700)]
broadcom/genxml: Check the sub-id field when decoding instructions.

VC5 introduces packet variants where the same opcode has behavior that is
decided by a sub-id field in the early bits of the packet.  Keep iterating
over packets until we find the one with the matching sub-id.

7 years agobroadcom/genxml: Emit code for default headers for structs as well.
Eric Anholt [Mon, 19 Dec 2016 19:11:44 +0000 (11:11 -0800)]
broadcom/genxml: Emit code for default headers for structs as well.

In the vc5 NIR backend, I want to use the XML code-generation to set up
pack/unpack of structs for the texture uniforms, and setting up the
unpacked copy needs a default header.

7 years agoanv: Move a comment that got left behind in the u_vector refactor.
Eric Anholt [Sat, 21 Jan 2017 05:22:15 +0000 (16:22 +1100)]
anv: Move a comment that got left behind in the u_vector refactor.

7 years agogallium/radeon: remove old_fence parameter from r600_gfx_write_event_eop
Marek Olšák [Tue, 15 Aug 2017 00:50:22 +0000 (02:50 +0200)]
gallium/radeon: remove old_fence parameter from r600_gfx_write_event_eop

just use the new scratch buffer.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi/gfx9: prevent a GPU hang after a timestamp event
Marek Olšák [Tue, 15 Aug 2017 00:40:30 +0000 (02:40 +0200)]
radeonsi/gfx9: prevent a GPU hang after a timestamp event

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoradeonsi: don't use CLEAR_STATE on SI
Marek Olšák [Tue, 15 Aug 2017 15:51:05 +0000 (17:51 +0200)]
radeonsi: don't use CLEAR_STATE on SI

This fixes random hangs with Unigine Valley.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102201

Fixes: 064550238ef0 ("radeonsi: use CLEAR_STATE to initialize some registers")
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoFix build when HAVE_LIBDRM isn't defined
Jon Turney [Thu, 17 Aug 2017 21:10:52 +0000 (22:10 +0100)]
Fix build when HAVE_LIBDRM isn't defined

make[4]: Entering directory '/wip/mesa/build/src/gallium/targets/dri'
  CXXLD    gallium_dri.la
../../../../src/gallium/auxiliary/pipe-loader/.libs/libpipe_loader_static.a(libpipe_loader_static_la-pipe_loader.o): In function `pipe_loader_get_driinfo_xml':
/mesa/build/src/gallium/auxiliary/pipe-loader/../../../../../src/gallium/auxiliary/pipe-loader/pipe_loader.c:117: undefined reference to `pipe_loader_drm_get_driinfo_xml'

b4ff5e90 uses pipe_loader_get_driinfo_xml() unconditionally in
pipe_loader.c, but it's definition in pipe_loader_get_driinfo_xml() is only
built if HAVE_LIBDRM.

Arrange to always use the default XML if HAVE_LIBDRM isn't defined.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
7 years agoi965: Fix missing newlines in perf_debug messages.
Kenneth Graunke [Fri, 18 Aug 2017 06:41:50 +0000 (23:41 -0700)]
i965: Fix missing newlines in perf_debug messages.

perf_debug() doesn't append a newline for you.

7 years agoglsl: add a few missing int64 constant propagation cases
Ilia Mirkin [Thu, 17 Aug 2017 02:18:39 +0000 (22:18 -0400)]
glsl: add a few missing int64 constant propagation cases

Fixes KHR-GL45.shader_ballot_tests.ShaderBallotAvailability, which
causes some silly swizzles to appear, triggering this optimization to
get hit.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
7 years agoglsl: set old ldexp operand to NULL when lowering
Timothy Arceri [Thu, 17 Aug 2017 23:32:15 +0000 (09:32 +1000)]
glsl: set old ldexp operand to NULL when lowering

This fixes an assert during IR validation in LLVMpipe.

Fixes: e2e2c5abd279 (glsl: calculate number of operands in an expression once)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102274
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
7 years agointel/isl: Replace switch statements of doom with a macro
Jason Ekstrand [Thu, 17 Aug 2017 21:57:06 +0000 (14:57 -0700)]
intel/isl: Replace switch statements of doom with a macro

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agointel/isl: Reduce header file duplication
Jason Ekstrand [Thu, 17 Aug 2017 21:56:46 +0000 (14:56 -0700)]
intel/isl: Reduce header file duplication

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoradv: disable support for VEGA for now.
Dave Airlie [Thu, 17 Aug 2017 23:33:41 +0000 (09:33 +1000)]
radv: disable support for VEGA for now.

I'm working on this, but I'm not sure I'll make 17.2 at this stage,
maybe 17.2.1.

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agoglxcmds: Fix a typo in the __APPLE__ codepath
Jeremy Huddleston Sequoia [Thu, 17 Aug 2017 22:08:36 +0000 (15:08 -0700)]
glxcmds: Fix a typo in the __APPLE__ codepath

s/DummyContext/dummyContext/

Regressed-in: 5d9b50e596c9d81c37ce0844ae0f8c9da3f6bea6
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
7 years agollvmpipe: enable PIPE_CAP_QUERY_SO_OVERFLOW
Roland Scheidegger [Tue, 15 Aug 2017 15:53:49 +0000 (17:53 +0200)]
llvmpipe: enable PIPE_CAP_QUERY_SO_OVERFLOW

The driver supported this since way before the GL spec for it existed.
Just need to support both the per-stream and for all streams variants
(which are identical due to only supporting 1 stream).
Passes piglit arb_transform_feedback_overflow_query-basic.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
7 years agosoftpipe: enable PIPE_CAP_QUERY_SO_OVERFLOW
Roland Scheidegger [Tue, 15 Aug 2017 15:52:41 +0000 (17:52 +0200)]
softpipe: enable PIPE_CAP_QUERY_SO_OVERFLOW

The driver was supposed to support this since way before the GL spec for it
existed, albeit it was apparently broken, so fix and enable it.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
7 years agodri: fix typo in comment
Gwan-gyeong Mun [Thu, 10 Aug 2017 16:18:57 +0000 (01:18 +0900)]
dri: fix typo in comment

Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agoconfigure.ac: Check for expat21 if expat is not found.
Vinson Lee [Sat, 5 Aug 2017 20:31:50 +0000 (13:31 -0700)]
configure.ac: Check for expat21 if expat is not found.

Fixes build error on CentOS 6.9.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102052
Fixes: 5c007203b73d ("configure.ac: drop manual detection of expat header/library")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
7 years agoconfigure: Check llvm-config --shared-mode
Michel Dänzer [Tue, 15 Aug 2017 00:41:57 +0000 (09:41 +0900)]
configure: Check llvm-config --shared-mode

https://bugs.llvm.org/show_bug.cgi?id=6823 still affects current LLVM.
llvm-config --libs only reports the single shared library if LLVM was
built with -DLLVM_LINK_LLVM_DYLIB=ON. llvm-config --shared-mode reports
"shared" in that case, "static" otherwise (even if LLVM was built with
-DLLVM_BUILD_LLVM_DYLIB=ON).

v2: Keep the LLVM < 4.0 test. (llvm-config --shared-mode is actually
    available since LLVM 3.8, but that would make the test too
    complicated :)

Fixes: 3d8da1f678e1 ("configure: Trust LLVM >= 4.0 llvm-config --libs
                      for shared libraries")
Bugzilla: https://bugs.freedesktop.org/102247
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
7 years agoloader_dri3: Make sure we have an updated back v3
Thomas Hellstrom [Fri, 11 Aug 2017 07:49:54 +0000 (09:49 +0200)]
loader_dri3: Make sure we have an updated back v3

With GLX_SWAP_COPY_OML and GLX_SWAP_EXCHANGE_OML it may happen in situations
when glXSwapBuffers() is immediately followed by for example another
glXSwapBuffers() or glXCopyBuffers() or back buffer age querying, that we
haven't yet allocated and initialized a new back buffer because there was
no GL rendering in between.

Make sure that we have a back buffer in those situations.

v2: Eliminate the drawable have_back_format member.
v3: Make sure we re-initialize the back even if it exists.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoloader_dri3: Support GLX_SWAP_EXCHANGE_OML
Thomas Hellstrom [Thu, 10 Aug 2017 15:34:05 +0000 (17:34 +0200)]
loader_dri3: Support GLX_SWAP_EXCHANGE_OML

Add support for the exchange swap method. Since we're now forcing a fake front
buffer and we exchange the back and fake front on swaps, we don't need to add
much code.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoloader_dri3: Eliminate the back-to-fake-front copy
Thomas Hellstrom [Thu, 10 Aug 2017 15:20:49 +0000 (17:20 +0200)]
loader_dri3: Eliminate the back-to-fake-front copy

Eliminate the back-to-fake-front copy by exchanging the previous back buffer
and the fake front buffer. This is a gain except when we need to preserve
the back buffer content but in that case we still typically gain by replacing
a server-side blit by a client side non-flushing blit.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoloader_dri3: Remove buffer_type from buffer metadata
Thomas Hellstrom [Wed, 28 Jun 2017 06:31:56 +0000 (08:31 +0200)]
loader_dri3: Remove buffer_type from buffer metadata

It's not used anywhere and now that we're about to exchange back- and
fake fronts it doesn't serve a purpose.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoloader_dri3: Support GLX_SWAP_COPY_OML
Thomas Hellstrom [Thu, 10 Aug 2017 15:10:47 +0000 (17:10 +0200)]
loader_dri3: Support GLX_SWAP_COPY_OML

Support the GLX_SWAP_COPY_OML method. When this method is requested, we use
the same swapbuffer code path as EGL_BUFFER_PRESERVED.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoloader_dri3: Honor the request to preserve back buffer content
Thomas Hellstrom [Thu, 10 Aug 2017 14:14:23 +0000 (16:14 +0200)]
loader_dri3: Honor the request to preserve back buffer content

EGL uses the force_copy parameter to loader_dri3_swap_buffers_msc() to indicate
that it wants to preserve back buffer contents across a buffer swap.

While the loader then turns off server-side page-flipping there's nothing to
guarantee that a new backbuffer isn't chosen when EGL starts to render again,
and that buffer's content is of course undefined.

So rework the functionality:
If the client supports local blits, allow server-side page flipping and when
a new back is grabbed, if needed, blit the old back's content to the new back.
If the client doesn't support local blits, disallow server-side page-flipping
to avoid a client deadlock and then, when grabbing a new back buffer, sleep
until the old back is idle, which may take a substantial time depending on
swap interval.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoloader_dri3: Increase the likelyhood of reusing the current swap buffer
Thomas Hellstrom [Thu, 10 Aug 2017 13:59:58 +0000 (15:59 +0200)]
loader_dri3: Increase the likelyhood of reusing the current swap buffer

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoloader_dri3/glx/egl: Optionally use a blit context for blitting operations
Thomas Hellstrom [Thu, 10 Aug 2017 13:35:39 +0000 (15:35 +0200)]
loader_dri3/glx/egl: Optionally use a blit context for blitting operations

The code was relying on us always having a current context for client local
image blit operations. Otherwise the blit would be skipped. However,
glxSwapBuffers, for example, doesn't require a current context and that was a
common problem in the dri1 era. It seems the problem has resurfaced with dri3.

If we don't have a current context when we want to blit, try creating a private
dri context and maintain a context cache of a single context.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agoloader_dri3/glx/egl: Remove the loader_dri3_vtable get_dri_screen callback
Thomas Hellstrom [Fri, 11 Aug 2017 07:57:51 +0000 (09:57 +0200)]
loader_dri3/glx/egl: Remove the loader_dri3_vtable get_dri_screen callback

It's not very usable since in the rare, but definitely existing case that
we don't have a current context, it will return NULL.

Presumably it will always be safe to use the dri screen the drawable was
created with for operations on that drawable.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
7 years agonv50/ir: fix TXQ srcMask
Ilia Mirkin [Wed, 16 Aug 2017 04:33:34 +0000 (00:33 -0400)]
nv50/ir: fix TXQ srcMask

src0.x is always read for the LOD, irrespective of which outputs are
read.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
7 years agonv50/ir: fix srcMask computation for TG4 and TXF
Ilia Mirkin [Wed, 16 Aug 2017 04:25:40 +0000 (00:25 -0400)]
nv50/ir: fix srcMask computation for TG4 and TXF

This affects which inputs are marked as used. In a situation where only
the texture instruction uses an input, it might have been ignored as
unused due to input masks.

Affects subtests of KHR-GL45.texture_cube_map_array.sampling

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
7 years agoanv/gem: Add a stub for sync_file_merge
Jason Ekstrand [Thu, 17 Aug 2017 01:43:11 +0000 (18:43 -0700)]
anv/gem: Add a stub for sync_file_merge

This fixes make check

Fixes: 5c4e4932e02164e18cba9ae2cf3ec56afa2f2a6b
7 years agoradv: disable texture gather workaround on gfx9.
Dave Airlie [Wed, 16 Aug 2017 23:17:20 +0000 (00:17 +0100)]
radv: disable texture gather workaround on gfx9.

Not required anymore.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
7 years agost/mesa: remove Windows hack for glFinish
Brian Paul [Wed, 16 Aug 2017 15:50:34 +0000 (09:50 -0600)]
st/mesa: remove Windows hack for glFinish

I see no evidence that opengl32.dll's wglSwapBuffers calls glFinish.
It looks like Jose removed that dependency years ago, but this hack
remained.

Removing this code also fixes the Piglit sync_api test since commit
eceb6710024716.

No piglit regressions.  No glretrace regressions, per Charmaine.
Fixes VMware bug 1937990.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
7 years agogallium/os: fix os_time_get_nano() to roll over less
Frank Richter [Tue, 15 Aug 2017 13:46:35 +0000 (15:46 +0200)]
gallium/os: fix os_time_get_nano() to roll over less

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102241
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
7 years agost/wgl: check for negative delta in wait_swap_interval()
Frank Richter [Mon, 14 Aug 2017 14:05:22 +0000 (16:05 +0200)]
st/wgl: check for negative delta in wait_swap_interval()

This can happen because of rollover.  See bug report for details.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102241
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
7 years agost/mesa: fix a null pointer access
Frank Richter [Wed, 7 Jun 2017 12:40:23 +0000 (14:40 +0200)]
st/mesa: fix a null pointer access

Fixes crash with llvmpipe on Windows.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102148
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
7 years agoi965: Alphabetize TCS image dirty bits
Kenneth Graunke [Wed, 16 Aug 2017 23:09:29 +0000 (16:09 -0700)]
i965: Alphabetize TCS image dirty bits

Trivial.

7 years agoi965: Always allow CPU readback of the scanout on LLC platforms
Chris Wilson [Sat, 5 Aug 2017 09:39:59 +0000 (10:39 +0100)]
i965: Always allow CPU readback of the scanout on LLC platforms

LLC platforms are magic in that reads from the CPU are always cache
coherent, or rather GPU writes that bypass LLC do still invalidate the
appropriate cache line.

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
7 years agoswr/rast: Fix invalid casting for calls to Interlocked* functions
Tim Rowley [Tue, 8 Aug 2017 01:33:24 +0000 (20:33 -0500)]
swr/rast: Fix invalid casting for calls to Interlocked* functions

CID: 141624314162441416255
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
7 years agoradeon/vce: support all firmwares with major ver 53
Boyuan Zhang [Wed, 16 Aug 2017 18:24:29 +0000 (14:24 -0400)]
radeon/vce: support all firmwares with major ver 53

The vce firmware interface should now be stable, all firmwares with
major version equals to 53 are supported.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
7 years agoi965: make sure check_and_emit_atom gets inlined
Tapani Pälli [Tue, 15 Aug 2017 06:26:09 +0000 (09:26 +0300)]
i965: make sure check_and_emit_atom gets inlined

Improves performance of 3DMark "Ice Storm Unlimited" benchmark
by 1-2% on Apollolake (on Android-IA using clang 3.8.256229).

Change is based on the performance profiling work and results
by Aravindan Muthukumar and Yogesh Marathe.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Aravindan Muthukumar <aravindan.muthukumar@intel.com>
Signed-off-by: Yogesh Marathe <yogesh.marathe@intel.com>
Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
7 years agoa2xx: only update rasterizer settings when they're there
Ilia Mirkin [Tue, 15 Aug 2017 05:38:17 +0000 (01:38 -0400)]
a2xx: only update rasterizer settings when they're there

The rasterizer being empty can happen e.g. during clears

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>