Commit Graph

62622 Commits

Author SHA1 Message Date
Tom Stellard 5fe1a0ebad gallium: Add PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY
Bruno Jiménez:
  v2: Updated the docs
  v3: Remove trailing comma

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 15:24:53 -07:00
Kenneth Graunke 979a015bc1 i965: Fix a few base addresses on Broadwell.
We intended to set these 64-bit addresses to 0, and set the enable bit.
But, I accidentally placed the DWord with the high bits first, when it
should have been second.

This generally worked out, by luck - presumably General State Base
Address is initially zero, and ends up remaining that way in our
contexts since we bungled the "modify enable" bit.

v2: Fix MOCS shift on GSBA.  It should be 4, and I had 2.
    (Caught by Ben Widawsky.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2014-04-29 14:01:06 -07:00
EdB 7fb05f9298 clover: Stub implementation of CL 1.2 sub-devices.
The implementation is basically a NOP but it conforms with OpenCL 1.2.

[ Francisco Jerez: Initialize property return buffer for
  CL_DEVICE_PARTITION_PROPERTIES, CL_DEVICE_PARTITION_TYPE,
  CL_DEVICE_PARTITION_AFFINITY_DOMAIN, and make the latter a scalar
  rather than a vector.  Some clean-up and code style fixes. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 16:14:50 +02:00
EdB 5827781d25 clover: Add clEnqueue{Marker, Barrier}WithWaitList.
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 13:12:38 +02:00
Jan Vesely 7b11c97d31 clover: Align kernel argument sizes to nearest power of 2
v2: use a new variable for aligned size
    add comment
    make both vars const
    only use the aligned value in argument constructors
    fix comment typo

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-04-29 13:09:21 +02:00
Francisco Jerez df985cc8f6 clover: Avoid warnings from references to deprecated CL 1.1 APIs.
Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-29 13:01:37 +02:00
Francisco Jerez beadd6b0cc clover: Update OpenCL headers to version 1.2 from Khronos.
The C++ headers are *not* updated because they rely on CL 1.2 APIs
that we do not implement yet when the core CL 1.2 headers are present.

Acked-by: Tom Stellard <thomas.stellard@amd.com>
2014-04-29 13:01:10 +02:00
Ilia Mirkin f782d6e792 nvc0/ir: offset appears to come before the Z ref
Fixes textureGatherOffset when used with a shadow sampler. Also verified
against blob compiler with textureLodOffset manually (no piglit tests
for texture[Lod]Offset + shadow samplers).

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 20:32:36 -04:00
Brian Paul 50034c0171 mesa: remove unused #pragma export on/off lines
PRAGMA_EXPORT_SUPPORTED is never defined.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77749
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 17:16:42 -06:00
Ilia Mirkin f3aa999383 nv50/ir: change texture offsets to ValueRefs, allow nonconst
This allows us to have non-constant offsets for textureGatherOffset and
textureGatherOffsets.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:09:18 -04:00
Ilia Mirkin 46364a53ef nvc0/ir: do constant folding of extbf/insbf
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:05:16 -04:00
Ilia Mirkin 1c85177419 nvc0/ir: add support for MUL_HI tgsi opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:05:16 -04:00
Ilia Mirkin b4b20d42f6 nvc0/ir: add support for new bitfield manipulation opcodes
This adds support for:

IBFE, UBFE, BFI, LSB, IMSB, UMSB, BREV, POPC

Which are all required for ARB_gs5 support.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-04-28 19:05:16 -04:00
Ilia Mirkin 1db993f2fe tgsi: add tgsi_exec support for new bit manipulation opcodes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:05:11 -04:00
Ilia Mirkin ab4927f3e0 gallium/util: add helpers for bitfield manipulation
Add bitwise reversing and signed MSB helpers for software implementation
of the new TGSI opcodes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:05:07 -04:00
Ilia Mirkin 3e73bf2724 mesa/st: implement new bit manipulation opcodes
Also pipe through [IU]MUL_HI, MAD, and lower ldexp. This provides
coverage of all new ARB_gpu_shader5 functions except uaddCarry,
usubBorrow and interpolateAt*.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:05:04 -04:00
Ilia Mirkin a52eaba787 gallium: add new opcodes for ARB_gs5 bit manipulation support
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-04-28 19:04:46 -04:00
Emil Velikov b125c92aa9 glx/drisw: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:39 +01:00
Emil Velikov a2454bdfbd glx/dri3: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:39 +01:00
Emil Velikov 55d82adec6 glx/dri2: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov 76ae25d7e8 glx/dri: explicitly assign struct components for glx_*_vtable
... to improve readability of code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov 2f519e4635 glx/indirect: explicitly assign struct components for glx_*_vtable
... to improve readability of code. Set indirect_screen_vtable as a static const.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov 31a3b58cb7 glx/apple: explicitly assign struct components for glx_*_vtable
... to improve readability of code. Set applegl_screen_vtable as a static const.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov 5f280d0c44 egl_dri: rework dri extension handling
Use designated initialisers, and store the extensions pointers as const.

The loader extensions __DRIdri2LoaderExtension and __DRIswrastLoaderExtension
are setup by the platform backends so they should not be constified.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:38 +01:00
Emil Velikov 5457caa58c gbm: cleanup __DRI*extension handling
Use designated initialisers, store all extension pointers as const and use
a const __DRIextensions array over assigning each element individually.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:38 +01:00
Emil Velikov c812557a0e dri_util: cleanup dri extension handling
Explicitly set the version that is implemented, as that may differ from
the one defined in dri_interface.h. The remaining __DRI*Extensions are
treated as constants, so got ahead and declare them as such.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:38 +01:00
Emil Velikov 51e3569573 glx/tests: explicitly set __DRI2rendererQueryExtension members
While we're here use the typcast'ed name and constify.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:38 +01:00
Emil Velikov ecfe986120 glx/dri3: rework __DRIextension handling
Use a const array with the extensions, rather than assigning each
one to a fixed size array at runtime.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-28 19:13:37 +01:00
Emil Velikov 4be3874c97 glx/dri2: rework __DRIextension handling
Make sure that the DRI*Extensions report the version of the interface
implemented over the listed in the headers. While both are currently
the same, this may change in the future.

v2: Keep loader extensions handling as is.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:13:18 +01:00
Emil Velikov 98e2a8e2f9 st/dri: cleanup dri extension handling
Explicitly set the version that is implemented, as that may differ
from the one defined in dri_interface.h. Use designated initialisers
and constify whereever possible.

Note: __DRIimageExtension should not be made const as it's modified
at runtime. This patch should have no side effects on compilers that
do not support designated initialisers, as the existing code in
dri/common already uses them.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:28 +01:00
Emil Velikov 748b35a69f dri/radeon: use a const __DRIextension array
Rather than keeping a separate and unused copy of the screen extensions
within the radeon screen, use a constant array that can be used directly
with __DRIscreen.

[Kristian Høgsberg]
The copy in the radeon screen isn't unused, that's where the array is
built and stored, the dri screen just points to that.  The pattern
here was used for cases where the extensions exported by a dri driver
could vary at runtime, for example depending on chipset.  In this
case, it's known at compile time, so it makes sense to use a static
const array instead.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:27 +01:00
Emil Velikov 38f20f79da drivers/dri: cleanup dri extension instantiation
Uniformly use the typecasted extension name, constify extension instances
and use designated initialisers. Set the implemented version of the
extension, over the one defined in dri_infertace.h. Patch covers the
following extensions:

__DRItexBufferExtension
__DRIimageExtension
__DRIrobustnessExtension
__DRI2rendererQueryExtension
__DRIdri2LoaderExtension

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:27 +01:00
Emil Velikov 9b42fd1772 dri_interface: Update __DRItexBufferExtensionRec to version 3
With commit e59fa4c46c8("dri2: release texture image.") we updated the
extension without bumping the version number. The patch itself added an
interface required to enable texture_from_pixmap on certain platforms.

The new code was effectively never build, as it depended on
__DRI_TEX_BUFFER_VERSION >= 3, which never came to be in upstream mesa.

This commit bumps the version number, drops the __DRI_TEX_BUFFER_VERSION
checks and resolves all the build conflicts. Additionally it add a version
check as egl and dri3, as require version 2 of the extension which does
not have the releaseTexBuffer hook.

Cc: Juan Zhao <juan.j.zhao@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2014-04-28 19:11:27 +01:00
Jon TURNEY ec8ebff342 Check for dladdr(), rather than assuming we have it if we have RTLD_DEFAULT
Unfortunately, Cygwin defines RTLD_DEFAULT (for glibc compatibility), but can't
provide dladdr(), so add a check for dladdr()

Since I don't think scons is ever used to build for Cygwin, just set HAVE_DLADDR
in SConscript, assuming that if we have RTLD_DEFAULT, we have dladdr().

Cc: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-28 19:11:02 +01:00
Richard Sandiford 6c8f547f66 util: Fix cross-compiles between endiannesses
The old python code used sys.is_big_endian to select between little-endian
and big-endian formats, which meant that the build and host endiannesses
needed to be the same.  This patch instead generates both big- and little-
endian layouts, using PIPE_ARCH_BIG_ENDIAN to select between them.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:27 +01:00
Richard Sandiford 6944796cbe util: Split out channel-parsing Python code
Splits out the code that parses the channel list, so that we
can have different lists for little and big endian.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:25 +01:00
Richard Sandiford 1a3746212d util: Split out channel-printing Python code
Rather than iterate over format.channels and format.swizzles directly,
use Python subfunctions that take the channel and swizzle lists as
arguments.  This allow the channel and swizzle lists to depend on
endianness.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:24 +01:00
Richard Sandiford 0ee3ac938a util: Turn inv_swizzle into a global function
With the big-endian changes, there can be two swizzle orders for each format.
This patch turns Format.inv_swizzle() into a global function that takes the
swizzle list as a parameter.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:22 +01:00
Richard Sandiford 227d7a6a3c util: Add more query methods to u_format_parse.Format
The main aim is to reduce the number of places that access channels[0],
swizzles[0] and swizzles[1] directly.

There is no change to the generated u_format_table.c.

Signed-off-by: Richard Sandiford <rsandifo@linux.vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2014-04-28 13:16:20 +01:00
Michel Dänzer 136c437cea st/mesa: Fix NULL pointer dereference for incomplete framebuffers
This can happen with glamor, which uses EGL_KHR_surfaceless_context and
only explicitly binds GL_READ_FRAMEBUFFER for glReadPixels.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-28 12:12:03 +09:00
Chris Forbes 151a20dcd4 glsl: fix spelling of derived
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2014-04-27 21:37:23 +12:00
Ilia Mirkin e88644c1f2 docs: mark off nv50/nvc0 for ARB_sample_shading, update relnotes
relnotes weren't updated this whole time, so I went through all the
GL3.txt changes and picked out the nouveau ones since 10.1.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-04-27 00:16:29 -04:00
Chia-I Wu 7b2dd89041 mesa: overhaul debug namespace support
_mesa_HashTable is not well-suited for us: it locks a mutex unnecessarily and
it does not accept 0 as the key (and have branches to handle 1 specially).
What we really need is a sparse array.  Whether it should be implemented as a
hash table, a list, or a bsearch()-able array requires investigations of the
use models.

We choose to implement it as a list for now, assuming it is common to have a
short list of IDs in each (source, type) namespace.  The code is simpler, and
the memory footprint is lower.  This also fixes several corner cases such as
making messages to have different states at different severities.

v2: use GLbitfield for State/DefaultState, and add a comment

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu 70e4337014 mesa: delay copying of debug groups
Do not copy the debug group until it is about to be written.  One likely
scenario of using glPushDebugGroup/glPopDebugGroup is to enclose a sequence of
GL commands and give them a human-readable description.  There is no message
control change in this scenario, and thus no need to copy.

This also reduces the initial size of gl_debug_state from 306KB to 7KB.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu a30c4c6ca0 mesa: clean up debug output namespace handling
Add functions to provide these operations on a struct gl_debug_namespace:

  init():    initialize the namespace
  copy():    copy all elements from one namespace to another
  clear():   clear all elements (to free the memories)
  set():     set the value of an element
  set_all(): set the value of all elements
  get():     get the value of an element

A debug namespace is like a sparse array.  The length of the array is huge,
2^sizeof(GLuint), but most of the elements assume the same value sepcified by
set_all().

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu 44a1374793 mesa: clean up debug groups
Add struct gl_debug_group to hold all namespaces of a debug group.  Replace
the 3-dimensional array, Namespaces, in struct gl_debug_state by a
1-dimensional array of type struct gl_debug_groups.

Turn the 4-dimensional array, Defaults, in struct gl_debug_state to a
1-dimensional array in struct gl_debug_namespace.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu e412305f9f mesa: clean up debug message log
Remove NextMsgLength, and move members of struct gl_debug_state that belong to
the message log to a new struct, gl_debug_log.  Rename gl_debug_msg to
gl_debug_message.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:21 +08:00
Chia-I Wu cf61ea3029 mesa: use accessors for struct gl_debug_state
When GL_DEBUG_OUTPUT_SYNCHRONOUS is GL_TRUE, drivers are allowed to log debug
messages from other threads.  That requires gl_debug_state to be protected by
a mutex, even when it is a context state.  While we do not spawn threads in
Mesa yet, this commit makes it easier to do when we want to.

Since the definition of struct gl_debug_state is no longer needed by the rest
of the driver, move it to main/errors.c.  This should make it even harder to
use the struct incorrectly.

v2: add comments for the accessors

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu 94e45c98e1 mesa: eliminate debug output message_insert
Add validate_length, and call it together with log_msg directly instead of
message_insert.  No functional change.

v2: make sure length is non-negative (i.e., known) before calling
    validate_length, noted by Timothy Arceri

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00
Chia-I Wu 188d22d9b7 mesa: eliminate debug output should_log
In both call sites, it could be easily replaced by direct
debug_is_message_enabled calls.  No functional change.

Signed-off-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-04-27 10:06:20 +08:00