summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* etnaviv: implement resource creation with modifierLucas Stach2017-07-194-7/+100
| | | | | | | | | | This allows to create buffers with a specific tiling layout, which is primarily used by GBM to allocate the EGL back buffers with the correct tiling/modifier for use with the scanout engines. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* etnaviv: fill in modifier in etna_resource_get_handleLucas Stach2017-07-191-0/+19
| | | | | | | | | | This allows the state trackers to know the tiling layout of the resource and pass this through the various userspace protocols. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* etnaviv: fold etna_screen_bo_get_handle into etna_resource_get_handleLucas Stach2017-07-193-28/+16
| | | | | | | | | | There is no point in keeping this indirection. Makes the code easier to follow. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> (v1) Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* etnaviv: implement resource import with modifierLucas Stach2017-07-191-32/+77
| | | | | | | | | | | | | | | | This implements resource import with modifier, deriving the correct internal layout from the modifier and constructing a render compatible base resource if needed. This removes the special cases for DDX and renderonly scanout allocated buffers, as the linear modifier is enough to trigger correct handling of those buffers. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Acked-by: Daniel Stone <[email protected]>
* etnaviv: also update textures from external resourcesLucas Stach2017-07-191-8/+16
| | | | | | | | | | | | This reworks the logic in etna_update_sampler_source to select the newest resource view for updating the texture view. This should make the logic easier to follow and fixes texture updates from imported dma-bufs. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: increment correct seqno for external resourcesLucas Stach2017-07-191-1/+4
| | | | | | | | | | | | If we import a dma-buf with a sampler/pixel pipe incompatible modifier, the imported buffer will end up in an external resource view. As resource_changed signals the change of the imported resource, we need to update the external view seqno, instead of the base resource seqno. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* etnaviv: pad scanout buffer size to RS alignmentLucas Stach2017-07-191-2/+8
| | | | | | | | | | This fixes failures to import the scanout buffer with screen resolutions that don't satisfy the RS alignment restrictions, like 1680x1050. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
* etnaviv: add helper to work out RS alignmentLucas Stach2017-07-192-9/+18
| | | | | | | | The minimum RS alignment calculation is needed in various places. Extract a helper to avoid open-coding the calcuation at every site. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
* renderonly/etnaviv: stop importing resource from renderonlyLucas Stach2017-07-196-62/+62
| | | | | | | | | | | The current way of importing the resource from renderonly after allocation is opaque and is taking away control from the driver, which it needs in order to implement more advanced scenarios than the simple linear scanout with matching stride alignments. Signed-off-by: Lucas Stach <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Acked-by: Daniel Stone <[email protected]>
* dri/common: use designated initializers for OptConfElemsEmil Velikov2017-07-191-1/+4
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* gallium: auxiliary: Fix standalone Android build of u_cpu_detect (v2)Tomasz Figa2017-07-192-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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: propagate EGL_BAD_ATTRIBUTE during EGLImage attr parsingEmil Velikov2017-07-191-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 <[email protected]> Reported-by: Michel Dänzer <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Michel Dänzer <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* swr: remove unneeded fallback strcasecmp defineEmil Velikov2017-07-191-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 <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tim Rowley <[email protected]>
* st/dri: list __DRI2_FENCE extension only where neededEmil Velikov2017-07-191-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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* swrast: add dri2ConfigQueryExtension to the correct extension listEmil Velikov2017-07-192-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: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Alex Deucher <[email protected]> (v1)
* radeon: remove local vblank_mode optionEmil Velikov2017-07-191-2/+0
| | | | | | | Analogous to previous commits. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* i915: remove local vblank_mode optionEmil Velikov2017-07-191-1/+0
| | | | | | | Analogous to previous commit. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* i965: remove local vblank_mode optionEmil Velikov2017-07-191-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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* egl/dri2: remove unused buffer_count variableGwan-gyeong Mun2017-07-194-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 <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/drm: Format code in platform_drm.c according to style guide.Gwan-gyeong Mun2017-07-191-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 <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/drm: add going out of the loop when the designated buffer is foundGwan-gyeong Mun2017-07-191-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 <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gbm: fix typo in doxygen commentGwan-gyeong Mun2017-07-191-2/+2
| | | | | | | This fixes the misspelling of gbm_bo_import api param. Signed-off-by: Mun Gwan-gyeong <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: Add MKDIR_GEN definitionDaniel Stone2017-07-191-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 <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reported-by: Nick Sarnie <[email protected]> Reported-by: Mike Lothian <[email protected]> Fixes: 02cc35937277 ("egl/wayland: Use linux-dmabuf interface for buffers")
* util: Make CLAMP turn NaN into MIN.Kenneth Graunke2017-07-182-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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* nir: Use nir_src_copy instead of direct assignments.Kenneth Graunke2017-07-183-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: [email protected] Reviewed-by: Matt Turner <[email protected]>
* glsl: disable array splitting for AoATimothy Arceri2017-07-191-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 <[email protected]>
* nir: fix nir_opt_copy_prop_vars() for arrays of arraysTimothy Arceri2017-07-191-6/+6
| | | | | | | | | | Previously we only incremented the guide for a single dimension/wildcard. V2: rework logic to avoid code duplication Reviewed-by: Jason Ekstrand <[email protected]> Cc: [email protected]
* nir/vars_to_ssa: Handle missing struct members in foreach_deref_nodeJason Ekstrand2017-07-191-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 <[email protected]> Cc: [email protected]
* i965/blorp: Use the return value of brw_emit_reloc.Kenneth Graunke2017-07-181-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.)
* i965: Delete dead brw_program_reloc function.Kenneth Graunke2017-07-181-15/+0
| | | | Rafael eliminated the last use of brw_program_reloc recently.
* i965: Convert WM_STATE to genxml on gen4-5.Rafael Antognolli2017-07-186-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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Convert CLIP_STATE to genxml.Rafael Antognolli2017-07-184-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 <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* egl/wayland: Use linux-dmabuf interface for buffersDaniel Stone2017-07-185-20/+217
| | | | | | | 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 <[email protected]>
* egl/wayland: Remove duplicate wl_buffer creation codeDaniel Stone2017-07-181-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 <[email protected]>
* egl/wayland: Remove more surface specifics from create_wl_bufferDaniel Stone2017-07-181-15/+12
| | | | Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: Make create_wl_buffer more genericDaniel Stone2017-07-181-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 <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gbm: Remove is_planar_format dead codeDaniel Stone2017-07-181-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 <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gbm: Check harder for supported formatsDaniel Stone2017-07-181-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 <[email protected]>
* gbm: Pull out FourCC <-> DRIimage format tableDaniel Stone2017-07-182-85/+70
| | | | | | | Rather than duplicated (yet asymmetric) open-coded tables, pull them out to a common structure. Reviewed-by: Emil Velikov <[email protected]>
* gbm: Axe buffer import format conversion tableDaniel Stone2017-07-183-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 <[email protected]>
* i965/gen4: Set tile offsets to zero after depth rebaseTopi Pohjolainen2017-07-181-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 <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965: Refactor check for separate stencilTopi Pohjolainen2017-07-181-4/+20
| | | | | | | v2 (Jason): s/needs_stencil/needs_separate_stencil/ Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* intel/blorp/gen4: Drop cube map flag for single face copyTopi Pohjolainen2017-07-181-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 <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965/wm: Use level offsets directlyTopi Pohjolainen2017-07-181-2/+2
| | | | | | | dropping dependency to slice table. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965: Use offset helper in intel_readpixels_tiled_memcpy()Topi Pohjolainen2017-07-181-2/+5
| | | | | | | providing support for isl based. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965/miptree: Pass flags instead of explicit tiling to surface creatorTopi Pohjolainen2017-07-181-5/+8
| | | | | | | allowing one to use isl tiling filter. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965/miptree: Add pitch override for imported buffer objectsTopi Pohjolainen2017-07-181-3/+4
| | | | | Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965/miptree: Stop setting total_width/height for existing boTopi Pohjolainen2017-07-182-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 <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* i965/wm: Use isl for filling tex image parametersTopi Pohjolainen2017-07-183-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 <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* intel/isl: Take 3D surfaces into account in image paramsTopi Pohjolainen2017-07-181-2/+6
| | | | | Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>