summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-07-19mesa: Add GL_MESA_simulate_graphics_resetsimulate-graphics-resetFredrik Höglund9-0/+50
This extension adds a glSimulateGraphicsResetMESA entry point, which when called makes the context behave as if a graphics reset has occurred. The status parameter is the status that will be returned by glGetGraphicsResetStatus.
2017-07-19dri/common: use designated initializers for OptConfElemsEmil Velikov1-1/+4
Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-07-19gallium: auxiliary: Fix standalone Android build of u_cpu_detect (v2)Tomasz Figa2-2/+10
Commit 463b7d0332c5("gallium: Enable ARM NEON CPU detection.") introduced CPU feature detection based Android cpufeatures library. Unfortunately it also added an assumption that if PIPE_OS_ANDROID is defined, the library is also available, which is not true for the standalone build without using Android build system. Fix it by defining HAS_ANDROID_CPUFEATURES in Android.mk and replacing respective #ifdefs to use it instead. v2: - Add a comment explaining why the separate flag is needed (Emil). Signed-off-by: Tomasz Figa <tfiga@chromium.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-19egl: propagate EGL_BAD_ATTRIBUTE during EGLImage attr parsingEmil Velikov1-0/+7
Earlier commit refactored/split the parsing into separate hunks. While no functional change was intended, it did not attribute that different error is set when the attrib. value is incorrect. Fixes: 3ee2be4113d ("egl: split _eglParseImageAttribList into per extension functions") Cc: Michel Dänzer <michel@daenzer.net> Reported-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-07-19swr: remove unneeded fallback strcasecmp defineEmil Velikov1-5/+0
The last user of the function was removed with earlier commit. Fixes: 50842e8a931 ("swr: replace gallium->swr format enum conversion") Cc: Tim Rowley <timothy.o.rowley@intel.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
2017-07-19st/dri: list __DRI2_FENCE extension only where neededEmil Velikov1-1/+0
The extension should be present (if applicable) in the list returned by getExtensions(). AFAICT no loader has ever looked for it in __driDriverExtensions/__driDriverGetExtensions. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-19swrast: add dri2ConfigQueryExtension to the correct extension listEmil Velikov2-2/+1
The extension should be in the list as returned by getExtensions(). Seems to have gone unnoticed since close to nobody wants to change the vblank mode for the software driver. v2: Rebase Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
2017-07-19radeon: remove local vblank_mode optionEmil Velikov1-2/+0
Analogous to previous commits. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-19i915: remove local vblank_mode optionEmil Velikov1-1/+0
Analogous to previous commit. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-19i965: remove local vblank_mode optionEmil Velikov1-1/+0
The option is only queried from the loader, which has access to the dri common code in src/mesa/drivers/dri/common/. One could grant the loader access to brw_config_options but even then, having the same option in both places is not a good idea. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2017-07-19egl/dri2: remove unused buffer_count variableGwan-gyeong Mun4-8/+2
It removes unused buffer_count variable from dri2_egl_surface. And it polishes the assert of dri2_drm_get_buffers_with_format(). Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-19egl/drm: Format code in platform_drm.c according to style guide.Gwan-gyeong Mun1-1/+2
This is a tiny housekeeping patch which does the following: * Limit lines to 78 or fewer characters. According to the mesa coding style guidelines. Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-19egl/drm: add going out of the loop when the designated buffer is foundGwan-gyeong Mun1-0/+1
Because the color_buffers have a each unique bo, if the designated buffer is found, release_buffer() can go out the loop which seaches the buffer. Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-19gbm: fix typo in doxygen commentGwan-gyeong Mun1-2/+2
This fixes the misspelling of gbm_bo_import api param. Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-19egl: Add MKDIR_GEN definitionDaniel Stone1-0/+2
Adding linux-dmabuf Wayland protocol files as generated did the right thing, by prepending $(MKDIR_GEN) so autotools didn't try to write into a build directory which didn't yet exist. Unfortunately MKDIR_GEN needs to be defined in every Makefile it's used in (which we do now), or alternately defined and substituted in configure.ac (which we don't do), and src/egl/ didn't actually have it from either method. As unset variables expand to nothing, it was silently being skipped. Copy & paste the defintion to make sure drivers/dri2/ exists before we try to generate files into it. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reported-by: Nick Sarnie <commendsarnex@gmail.com> Reported-by: Mike Lothian <mike@fireburn.co.uk> Fixes: 02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers")
2017-07-18util: Make CLAMP turn NaN into MIN.Kenneth Graunke2-3/+4
The previous implementation of CLAMP() allowed NaN to pass through unscathed, by failing both comparisons. NaN isn't exactly a value between MIN and MAX, which can break the assumptions of many callers. This patch changes CLAMP to convert NaN to MIN, arbitrarily. Callers that need NaN to be handled in a specific manner should probably open code something, or use a macro specifically designed to do that. Section 2.3.4.1 of the OpenGL 4.5 spec says: "Any representable floating-point value is legal as input to a GL command that requires floating-point data. The result of providing a value that is not a floating-point number to such a command is unspecified, but must not lead to GL interruption or termination. In IEEE arithmetic, for example, providing a negative zero or a denormalized number to a GL command yields predictable results, while providing a NaN or an infinity yields unspecified results." While CLAMP may apply to more than just GL inputs, it seems reasonable to follow those rules, and allow MIN as an "unspecified result". This prevents assertion failures in i965 when running the games "XCOM: Enemy Unknown" and "XCOM: Enemy Within", which call glTexEnv(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, -nan(0x7ffff3)); presumably unintentionally. i965 clamps the LOD bias to be in range, and asserts that it's in the proper range when converting to fixed point. NaN is not, so it crashed. We'd like to at least avoid that. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2017-07-18nir: Use nir_src_copy instead of direct assignments.Kenneth Graunke3-9/+9
If the source is an indirect register, there is ralloc'd data. Copying with a direct assignment will copy the pointer, but the data will still belong to the old instruction's memory context. Since we're lowering and throwing away instructions, that could free the data by mistake. Instead, use nir_src_copy, which properly handles this. This is admittedly not a common case, so I think the bug is real, but unlikely to be hit. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-07-19glsl: disable array splitting for AoATimothy Arceri1-0/+23
While it produces functioning code the pass creates worse code for arrays of arrays. See the comment added in this patch for more detail. V2: skip splitting of AoA of matrices too. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-07-19nir: fix nir_opt_copy_prop_vars() for arrays of arraysTimothy Arceri1-6/+6
Previously we only incremented the guide for a single dimension/wildcard. V2: rework logic to avoid code duplication Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Cc: mesa-stable@lists.freedesktop.org
2017-07-19nir/vars_to_ssa: Handle missing struct members in foreach_deref_nodeJason Ekstrand1-2/+6
This can happen if, for instance, you have an array of structs and there are both direct and wildcard references to the same struct and some members only have direct or only have indirect. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Cc: mesa-stable@lists.freedesktop.org
2017-07-18i965/blorp: Use the return value of brw_emit_reloc.Kenneth Graunke1-3/+3
This guarantees that the value written in the batch matches the value recorded in the relocation entry. (Chris Wilson wrote an identical patch as well.)
2017-07-18i965: Delete dead brw_program_reloc function.Kenneth Graunke1-15/+0
Rafael eliminated the last use of brw_program_reloc recently.
2017-07-18i965: Convert WM_STATE to genxml on gen4-5.Rafael Antognolli6-437/+153
The code doesn't get exactly a lot simpler but at least it is in a single place, and we delete more than we add. Another good point is that you get rid of struct brw_wm_unit_state which was a third mechanism for encoding GEN state. We used to have GENXML, manual packing and these bitfield structs. Now we're down to just GENXML and some manual packing. (Khristian) Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-07-18i965: Convert CLIP_STATE to genxml.Rafael Antognolli4-215/+100
Add the code into its own function and atom, since almost nothing is shared with GEN >= 6. v2: Split GEN <=5 and GEN >= 6 into separate functions (Ken). v3: Minor tidying by Ken. Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-07-18egl/wayland: Use linux-dmabuf interface for buffersDaniel Stone6-21/+221
When available, use the zwp_linux_dambuf_v1 interface to create buffers, which allows multiple planes and buffer modifiers to be used. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18egl/wayland: Remove duplicate wl_buffer creation codeDaniel Stone1-42/+12
Now create_wl_buffer is generic enough, we can use it for the EGL_WL_create_wayland_buffer_from_image extension. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18egl/wayland: Remove more surface specifics from create_wl_bufferDaniel Stone1-15/+12
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18egl/wayland: Make create_wl_buffer more genericDaniel Stone1-32/+34
Remove surface-specific code from create_wl_buffer, so it's now just a generic translation from DRIimage to wl_buffer. Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18gbm: Remove is_planar_format dead codeDaniel Stone1-30/+0
This was only used in create_dumb() to blacklist planar formats. However, the start of the function already whitelists ARGB8888 (cursor) and XRGB8888 (scanout), and nothing else. So this entire function can be removed. Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18gbm: Check harder for supported formatsDaniel Stone1-15/+26
Luckily no-one really used the is_format_supported() call, because it only supported three formats. Also, since buffers with alpha can be displayed on planes, stop banning them from use. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18gbm: Pull out FourCC <-> DRIimage format tableDaniel Stone2-85/+70
Rather than duplicated (yet asymmetric) open-coded tables, pull them out to a common structure. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18gbm: Axe buffer import format conversion tableDaniel Stone3-41/+30
Wayland buffers coming from wl_drm use the WL_DRM_FORMAT_* enums, which are identical to GBM_FORMAT_*. Similarly, FD imports do not need to convert between GBM and DRI FourCC, since they are (almost) completely compatible. This widens the formats accepted by gbm_bo_import() when importing wl_buffers; previously, only XRGB8888, ARGB8888, RGB565 and YUYV were supported. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18i965/gen4: Set tile offsets to zero after depth rebaseTopi Pohjolainen1-4/+6
Current logic calls intel_renderbuffer_set_draw_offset() which in turn tries to calculate x and y offset against layer/level settings that are against the original miptree actually having sufficient levels/layers. This returns correctly x=0 y=0 regardless of the given layer/level only because one calls intel_miptree_get_image_offset() which goes and consults miptree offset table which in turn luckily contains entries for max-mipmap levels, all initialised to zero even in case of non-mipmapped. This patch stops consulting the table and simply sets the draw offsets to zero that are compatible with the single slice miptree backing the renderbuffer. This prepares for ISL based miptrees that calculate offsets on-demand and do not tolerate levels beyond what the miptree has. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965: Refactor check for separate stencilTopi Pohjolainen1-4/+20
v2 (Jason): s/needs_stencil/needs_separate_stencil/ Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18intel/blorp/gen4: Drop cube map flag for single face copyTopi Pohjolainen1-1/+7
This will falsely trigger an assert on number of layers once isl is used for 3D layouts of Gen4 cube maps. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/wm: Use level offsets directlyTopi Pohjolainen1-2/+2
dropping dependency to slice table. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965: Use offset helper in intel_readpixels_tiled_memcpy()Topi Pohjolainen1-2/+5
providing support for isl based. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/miptree: Pass flags instead of explicit tiling to surface creatorTopi Pohjolainen1-5/+8
allowing one to use isl tiling filter. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/miptree: Add pitch override for imported buffer objectsTopi Pohjolainen1-3/+4
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/miptree: Stop setting total_width/height for existing boTopi Pohjolainen2-6/+0
Now that image surface vertical slice calculator doesn't depend on total_height, total dimensions are only needed when new buffer objects are created. Therefore one can safely ignore them when miptrees are created for already exisiting buffer objects. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/wm: Use isl for filling tex image parametersTopi Pohjolainen3-92/+19
This helps to drop dependency to miptree::total_height which is used in brw_miptree_get_vertical_slice_pitch(). Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18intel/isl: Take 3D surfaces into account in image paramsTopi Pohjolainen1-2/+6
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/miptree: Check for miptree_create() failuresTopi Pohjolainen1-0/+2
Rest of the function assumes it always succeeds. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/miptree: Do not rely on msaa type to decide if aux is neededTopi Pohjolainen2-4/+47
Once the driver moves to ISL both compressed and uncompressed have the same type. One needs to tell them apart by other means. This can be done by checking the existence of mcs_buf. There is a short period of time within intel_miptree_create() where mcs_buf doesn't exist yet (between calls to intel_miptree_create_layout() and intel_miptree_alloc_mcs()). First compute_msaa_layout() makes the decision if compression is to be used and sets the msaa_layout type. Then based on the type one sets aux_usage and finally decides if mcs_buf is needed. This patch duplicates the logic in compute_msaa_layout() and uses that to make the decision on aux_usage and mcs_buf allocation. Most of the original logic in compute_msaa_layout() will be gone in later patch leaving only one version. Elsewhere only brw_populate_sampler_prog_key_data() needs to know if compression is used based on the msaa_type. This is now replaced with consideration for number of samples and existence of mcs_buf. All other occurrences consider CMS || UMS which can be represented using single the type of ISL_MSAA_LAYOUT_ARRAY without any tweaks. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965: Make irb::mt_layer logical instead of physicalTopi Pohjolainen4-59/+12
same as irb::layer_count. In case of copies and blits msaa surfacas already fall to blorp which natively works with logical slices. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/tex: Use offset helper instead of accessing table directlyTopi Pohjolainen2-4/+8
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965: Mark read-only args as const in intel_miptree_supports_hiz()Topi Pohjolainen1-2/+2
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/miptree: Use > 1 instead of > 0 to check for multisamplingTopi Pohjolainen1-2/+2
Checking against zero currently works as single sampling is represented with zero. Once one moves to isl single sampling really has sample number of one. This keeps later patches simpler. Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18i965/miptree: Set refcount before failing via _release()Topi Pohjolainen1-1/+2
Otherwise one wraps uint to UINT_MAX via -1. Fixes: 3cf470f2b6c ("i965: Add isl based miptree creator") Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-18build: Add $(top_srcdir)/src/compiler/spirv to AM_CPPFLAGSKenneth Graunke1-0/+1
Generated C files try to include spirv_info.h. For in-tree builds, the header is in the same directory, so it just works. For out-of-tree builds, we need to look for it in srcdir rather than builddir. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101831 Acked-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>