summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* glx/dri2: rework __DRIextension handlingEmil Velikov2014-04-281-1/+1
| | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> (v1) Reviewed-by: Kristian Høgsberg <[email protected]>
* st/dri: cleanup dri extension handlingEmil Velikov2014-04-282-25/+30
| | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* dri/radeon: use a const __DRIextension arrayEmil Velikov2014-04-282-17/+14
| | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* drivers/dri: cleanup dri extension instantiationEmil Velikov2014-04-286-28/+37
| | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* dri_interface: Update __DRItexBufferExtensionRec to version 3Emil Velikov2014-04-286-19/+29
| | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Cc: Kristian Høgsberg <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* Check for dladdr(), rather than assuming we have it if we have RTLD_DEFAULTJon TURNEY2014-04-282-4/+4
| | | | | | | | | | | | 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 <[email protected]> Signed-off-by: Jon TURNEY <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util: Fix cross-compiles between endiannessesRichard Sandiford2014-04-282-32/+46
| | | | | | | | | | 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 <[email protected]> Signed-off-by: José Fonseca <[email protected]>
* util: Split out channel-parsing Python codeRichard Sandiford2014-04-281-46/+50
| | | | | | | | | | 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 <[email protected]> Signed-off-by: José Fonseca <[email protected]>
* util: Split out channel-printing Python codeRichard Sandiford2014-04-282-41/+69
| | | | | | | | | | | | 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 <[email protected]> Signed-off-by: José Fonseca <[email protected]>
* util: Turn inv_swizzle into a global functionRichard Sandiford2014-04-282-11/+11
| | | | | | | | | | | 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 <[email protected]> Signed-off-by: José Fonseca <[email protected]>
* util: Add more query methods to u_format_parse.FormatRichard Sandiford2014-04-283-36/+51
| | | | | | | | | | 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 <[email protected]> Signed-off-by: José Fonseca <[email protected]>
* st/mesa: Fix NULL pointer dereference for incomplete framebuffersMichel Dänzer2014-04-281-1/+6
| | | | | | | | This can happen with glamor, which uses EGL_KHR_surfaceless_context and only explicitly binds GL_READ_FRAMEBUFFER for glReadPixels. Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* glsl: fix spelling of derivedChris Forbes2014-04-271-1/+1
| | | | Signed-off-by: Chris Forbes <[email protected]>
* mesa: overhaul debug namespace supportChia-I Wu2014-04-271-178/+88
| | | | | | | | | | | | | | | | | | _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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: delay copying of debug groupsChia-I Wu2014-04-271-41/+89
| | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: clean up debug output namespace handlingChia-I Wu2014-04-271-139/+211
| | | | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: clean up debug groupsChia-I Wu2014-04-271-42/+48
| | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: clean up debug message logChia-I Wu2014-04-271-36/+42
| | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: use accessors for struct gl_debug_stateChia-I Wu2014-04-278-108/+156
| | | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: eliminate debug output message_insertChia-I Wu2014-04-271-26/+19
| | | | | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: eliminate debug output should_logChia-I Wu2014-04-271-29/+11
| | | | | | | | 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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: eliminate debug output control_app_messagesChia-I Wu2014-04-271-66/+17
| | | | | | | | Merge control_app_messages with the only caller. Eliminate set_message_state and control_messages too as they are unused. No functional change. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: eliminate debug output get_msgChia-I Wu2014-04-271-73/+26
| | | | | | | Merge get_msg with the only caller. No functional change. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: refactor _mesa_PopDebugGroup and _mesa_free_errors_dataChia-I Wu2014-04-271-62/+63
| | | | | | | | | Replace free_errors_data by debug_clear_group. Add debug_pop_group and debug_destroy for use in _mesa_PopDebugGroup and _mesa_free_errors_data respectively. No funcitonal change. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: refactor _mesa_PushDebugGroupChia-I Wu2014-04-271-42/+60
| | | | | | | | | Move group copying to debug_push_group. Save the group message before pushing instead of after, since we will need it after popping. No functional change otherwise. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: refactor debug output control_messagesChia-I Wu2014-04-271-51/+62
| | | | | | | Move most of the code to debug_set_message_enable_all. No functional change. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: refactor debug output get_msgChia-I Wu2014-04-271-11/+47
| | | | | | | | Move message fetching to debug_fetch_message and message deletion to debug_delete_messages. No functional change. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: refactor debug out log_msgChia-I Wu2014-04-271-59/+75
| | | | | | | | Move message logging to debug_log_message. Replace store_message_details by debug_message_store. No functional change. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: refactor debug output set_message_stateChia-I Wu2014-04-271-31/+39
| | | | | | | Move message state update to debug_set_message_enable. No functional change. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: refactor debug output should_logChia-I Wu2014-04-271-50/+61
| | | | | | | | Move the message filtering logic to debug_is_message_enabled. No functional change. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: refactor _mesa_get_debug_stateChia-I Wu2014-04-271-25/+37
| | | | | | | | Move gl_debug_state allocation to a new function, debug_create. No functional change. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* nvc0/ir: fetch shadow value from proper place for TG4 cube arrayIlia Mirkin2014-04-261-1/+4
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nvc0/ir: set gatherComp for non-shadow targetsIlia Mirkin2014-04-261-0/+2
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nvc0/ir: set instance count based on the GS_INVOCATIONS propertyIlia Mirkin2014-04-261-3/+1
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nvc0/ir: add support for INVOCATIONID system valueIlia Mirkin2014-04-263-2/+1
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nvc0/ir: add support for SAMPLEMASK sysvalIlia Mirkin2014-04-265-0/+8
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* mesa/st: translate gl_InvocationID to INVOCATIONID semanticIlia Mirkin2014-04-261-0/+1
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: translate gl_SampleMaskIn to SAMPLEMASK semanticIlia Mirkin2014-04-261-0/+1
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add GS_INVOCATIONS propertyIlia Mirkin2014-04-263-1/+19
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add INVOCATIONID semanticIlia Mirkin2014-04-263-2/+10
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* nvc0: add support for PIPE_CAP_SAMPLE_SHADINGIlia Mirkin2014-04-2615-14/+131
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv50: add support for PIPE_CAP_SAMPLE_SHADINGIlia Mirkin2014-04-2614-8/+107
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* mesa/st: add support for ARB_sample_shadingIlia Mirkin2014-04-2612-11/+89
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add basic support for ARB_sample_shadingIlia Mirkin2014-04-2619-2/+48
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mapi: OpenVG symbol exports.Enrico Horn2014-04-251-0/+1
| | | | | | | Fixes another mistake in 144bbb7b78e. Reviewed-by: Matt Turner <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77502
* glsl: Use properly typed arguments for bitfieldInsert.Matt Turner2014-04-251-2/+2
| | | | | | | | bitfieldInsert takes scalar integers for its last two arguments. Since bitfieldInsert is lowered on i965 to two instructions that have more flexible arguments, I didn't notice when I wrote this. Reviewed-by: Ilia Mirkin <[email protected]>
* i965: Don't bother flushing the batch if it doesn't ref our mt to map.Eric Anholt2014-04-251-1/+2
| | | | | | -1.1372% +/- 0.858033% effect on cairo runtime on glamor (n=175). Reviewed-by: Kenneth Graunke <[email protected]>
* egl: Protect use of gbm_dri with ifdef HAVE_DRM_PLATFORMAnder Conselvan de Oliveira2014-04-251-0/+2
| | | | | | | Otherwise it fails to compile if the drm egl platform is disabled. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* wayland: Fix the logic in disabling the prime capabilityNeil Roberts2014-04-251-1/+1
| | | | | | | | | | It looks like this bit of code is trying to disable the prime capability if the driver doesn't support createImageFromFds. However the logic looks a bit broken and what it would actually do is disable all other capabilities apart from prime. This patch fixes it to actually disable prime. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gbm: Set errno on errorsAnder Conselvan de Oliveira2014-04-252-15/+41
| | | | | | | | | This should give the caller some information of what called the error. For the gbm_bo_import() case, for instance, it is possible to know if the import is not supported or the error was caused by an invalid parameter. Reviewed-by: Emil Velikov <[email protected]>