summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* gbm/dri: Fix out-of-memory error path in dri_device_create()Ander Conselvan de Oliveira2014-04-251-0/+2
| | | | | Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium/tests: conditionally include sw/dri winsysEmil Velikov2014-04-251-1/+5
| | | | | | | | | | | In all fairness we allow the gallium tests to be build with --disable-dri which will result in the approapriate winsys to not be build, thus the build will fail. ./configure --disable-dri --with-gallium-drivers=svga --enable-gallium-tests Cc: Brian Paul <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* automake: cleanup pipe-loader handling when using sw/xlib winsysEmil Velikov2014-04-254-4/+4
| | | | | | | Rather than defining our own set of variables, use NEED_WINSYS_XLIB and based on it include the sw/xlib winsys. Signed-off-by: Emil Velikov <[email protected]>
* pipe-loader: conditionally build and use pipe_loader_sw_probe_driEmil Velikov2014-04-252-0/+6
| | | | | | | | | | | | | The function relies on the sw/dri winsys which is build only when --enable-dri is set. Fixes build issues with the following config ./configure --disable-dri --with-gallium-drivers=svga --enable-xa Issue can be reproduced with any hw gallium driver + st that uses the pipe-loader. Cc: Brian Paul <[email protected]> Reported-by: Brian Paul <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* llvmpipe: fix clearing of individual color buffers in a fbRoland Scheidegger2014-04-256-163/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GL (3.0) allows you to clear individual color buffers in a fb. In fact for fbs containing both int and float/normalized color buffers this is required (because the clearing values are otherwise undefined if applied to all buffers). The gallium interface was changed a while ago, but llvmpipe ignored it (hence doing such individual clears always resulted in clearing all buffers, plus some assorted asserts due to the mixed fbs). So change the clear command to indicate the buffer to be cleared. Also, because indicating the buffer to be cleared would have made lp_rast_arg_cmd larger which is unacceptable (we're trying to shrink it some day) allocate the clear value in the scene and just pass a pointer. There's several advantages and disadvantages here: + clearing individual buffers works (we could also actually bin such clears now if they'd come through clear_render_target() if the surface is in the current fb, though we didn't do this before for the single rb case and still don't try). + since there's one clear per rb, we do the format conversion in setup rather than per bin. Aside from the (drop in the ocean...) performance advantage this means that clearing to very small values (that is, denormal when converted to the format) should work for small float (fp16 etc.) formats, as the util code couldn't handle it correctly before (because cpu denorms are disabled when executing the bin commands, screwing up the magic conversion and flushing the values to 0, though this was not verified). - there's some overhead for traditional old-style clear-all MRT cases, since there's one rast clear command per rb instead of one for all rbs. This fixes https://bugs.freedesktop.org/show_bug.cgi?id=76976. v2: get rid of the ugly manual memcpy stuff and just use union util_color. This is 32 bytes instead of 16 but as the allocation is per scene we can live with those additional 16 bytes (and the additional 128 bytes in the setup context), which makes the code much more obvious. Suggested by Brian. Reviewed-by: Brian Paul <[email protected]>
* gallium/util: use ui[4] instead of ui in union util_colorRoland Scheidegger2014-04-2512-39/+39
| | | | | | | | util_color often merely represents a collection of bytes, however it is inconvenient if those bytes can only be accessed as floats/doubles for int formats exceeding 32bits. (Note that since rgba8 formats use one uint, not 4 bytes, hence the byte and short member were left as is.)
* llvmpipe: (trivial) use correct LP_MIN_VECTOR_ALIGN define for alignment.Roland Scheidegger2014-04-251-1/+1
| | | | | | Currently it's the same value. Reviewed-by: Brian Paul <[email protected]>
* r600g: fix hang on RV740 by using DX_RASTERIZATION_KILL instead of SX_MISCMarek Olšák2014-04-255-7/+27
| | | | | | | | Changing SX_MISC hangs RV740. When we're at it, let's use DX_RASTERIZATION_KILL on all R700 and later chipsets. Cc: 10.0 10.1 [email protected] Reviewed-by: Alex Deucher <[email protected]>