summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
Commit message (Collapse)AuthorAgeFilesLines
* egl,dri: Propagate context priority hint to driver->CreateContextChris Wilson2017-10-2012-23/+38
| | | | | | | | | | | | | | | | | | | | Jump through the layers of abstraction between egl and dri in order to feed the context priority attribute through to the backend. This requires us to read the value from the base _egl_context, convert it to a DRI attribute, parse it again in the generic context creator before passing it to the driver as a function parameter. In order to not require us to pass back the actual value of the context priority after creation, we impose that drivers should report the available set of priorities during screen setup (and then they may chose to fail if given an invalid value as that should have been checked at the user boundary.) Signed-off-by: Chris Wilson <[email protected]> Acked-by: Ben Widawsky <[email protected]> # i915/i965 Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Don't disable aux buffers for non-overlapping miplevels.Kenneth Graunke2017-10-191-3/+7
| | | | | | | | | | | | | | | | | | | | Meta's GenerateMipmap implementation binds the same image for both sampling and rendering - but it samples from one miplevel while rendering the next. This is a false self-dependency, and there's no need to disable auxiliary buffers in this case. In fact, we really want to leave it enabled so the new miplevels gain color compression. Thankfully, the texture object's _MaxLevel is always one shy of the miplevel being rendered. So we can simply check if irb->mt_level is overlaps with the texture's defined levels. If not, there's no self- dependency and we can leave the auxiliary buffers enabled. Fixes a performance regression in GFXBench4 Car Chase, which apparently calls glGenerateMipmap() on every frame. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103247 Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by; Jason Ekstrand <[email protected]>
* i965: Remove the intel_miptree_prepare_fb_fetch wrapper.Kenneth Graunke2017-10-193-20/+10
| | | | | | | | Now that intel_miptree_prepare_texture takes levels and layers, there's not much use in this anymore. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by; Jason Ekstrand <[email protected]>
* i965: Only resolve texture levels/layers that are accessed.Kenneth Graunke2017-10-191-2/+16
| | | | | | | This should avoid unnecessary resolves when working with texture views. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by; Jason Ekstrand <[email protected]>
* i965: Make intel_miptree_prepare_texture() take level/layer arguments.Kenneth Graunke2017-10-193-21/+13
| | | | | | | | | | | | This effectively exports intel_miptree_prepare_texture_slices() as intel_miptree_prepare_texture(). The hope is to avoid resolves for when using texture views that access a subset of the levels/layers. For now, we pass the same arguments to separate the mechanical change from the one that actually modifies our behavior. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by; Jason Ekstrand <[email protected]>
* i965/sbe: fix active components for SSO programs with over 16 inputsIago Toral Quiroga2017-10-191-8/+2
| | | | | | | | | | | | | | | | | | | | | | When we have up to 16 FS inputs, the SF unit will reorder our inputs to be consecutive, however, when we have more than 16 we need to to read our inputs from the URB exactly as they have been output from the previous stage. This means that for SSO we have to consider if we have URB padding due to unused input locations. Specifically, this affects gen9 active components programming, since for things to work in scenarios with over 16 inputs that have padded regions we need to ensure that we program active components for the padded regions too. If we don't do this the hardware won't read the URB properly for inputs located after padded regions. Found empirically. Fixes (these also require a patch in CTS): KHR-GL45.enhanced_layouts.varying_locations KHR-GL45.enhanced_layouts.varying_array_locations Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Do not log a perf warning when mapping an idle boChris Wilson2017-10-191-2/+3
| | | | | | | | | | We only want to scare the user away from causing a GPU stall for mapping a busy bo. The time taken to instantiate the set of pages for a buffer and their mmapping is unavoidable and flagging idle bo as being busy is "crying wolf". Reported-by: Tvrtko Ursulin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use a union to bitcast a floatMatt Turner2017-10-181-1/+2
| | | | ... which does not break C's aliasing rules.
* meson: Don't try to install dri drivers unless one is builtDylan Baker2017-10-161-1/+1
| | | | | | | | This confused the with_dri flag which is meant to control Direct Rendering Infrastructure, not classic drivers Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* Revert "i965/tex_image: Reference the renderbuffer miptree in setTexBuffer2"Kenneth Graunke2017-10-161-5/+20
| | | | | | | | | | | | | | | | | | | | This reverts commit d80cbbeaff9329fdc78ae3d97097c1e65dfcdd61. It turns out that formats do matter - the framebuffer's miptree has an sRGB format, and the one we created did not. This broke rendering when using KWin compositing, GNOME Terminal Fedora (with a transparent background), and Qt menu rendering in general, to name a few. It's been a month and this hasn't been fixed, and I'm sick of reverting this patch or applying NAK'd hacks and restarting various programs at random times every day, multiple times a day, to keep my desktop environment functional. The only benefit of this patch was to prepare the way for modifiers, which AFAIK aren't finished yet anyway, so there's really no downside to reverting it. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102924
* i965: Only put external handles into the handle htChris Wilson2017-10-161-11/+25
| | | | | | | | We know that we will only ever need to lookup an external handle and so can defer adding a bo to the external ht until it is ever exported or imported, keeping that hashtable compact. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/miptree: Drop the invalidate parameter form copy_teximageJason Ekstrand2017-10-163-17/+8
| | | | | | | This was a leftover from i915. The one caller in i965 always passes in false so there's no point in having the parameter. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Rename brw->no_batch_wrap to intel_batchbuffer::no_wrapKenneth Graunke2017-10-135-12/+12
| | | | | | This really makes more sense in the intel_batchbuffer struct. Reviewed-by: Chris Wilson <[email protected]>
* i965: Delete dead brw_context fields.Kenneth Graunke2017-10-132-4/+0
| | | | | | | fast_clear_op is leftover from the meta-fast-clear days. No idea what the other thing was for, but it isn't used now. Reviewed-by: Chris Wilson <[email protected]>
* i965: Complete 'expose RGBA visuals only on Android'Mario Kleiner2017-10-131-2/+2
| | | | | | | | | | | | | | | | Commit 731ba6924a2ed6cdf47a78fd637a91a19ddcf9ed "expose RGBA visuals only on Android" replaced ARRAY_SIZE(formats) by num_formats, but there are 3 loops which add configs, and only one was updated to num_formats. Also update loops for configs with accumulation buffer and multisample configs. Fixes: 731ba6924a2 "i965: expose RGBA visuals only on Android" Signed-off-by: Mario Kleiner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* meson: Build i915Ville Syrjälä2017-10-132-0/+100
| | | | | | | | | | | Build i915 with meson. More or less copied from i965, with all the unneeded cruft removed, and the libdrm_intel dependency added. Cc: Dylan Baker <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* intel/cs: Make thread_local_id a regular builtin paramJason Ekstrand2017-10-121-6/+4
| | | | | | | | | This is a lot more natural than special casing it all over the place. We still have to do a bit of special-casing in assign_constant_locations but it's not special-cased quite as bad as it was before. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler: Allocate pull_param in assign_constant_locationsJason Ekstrand2017-10-121-2/+0
| | | | | | | | | | | Now that everything is nicely ralloc'd, we can allocate the pull_param array in assign_constant_locations instead of higher up. We can also re-allocate the param array so that it's exactly the needed size. This should save us some memory because we're not allocating the total needed param space for both push and pull. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Allocate prog_data::[pull_]param deeper inside the compilerJason Ekstrand2017-10-127-84/+51
| | | | | | | | | | | | | Now that we're always growing the param array as-needed, we can allocate the param array in common code and stop repeating the allocation everywere. In order to keep things sane, we ralloc the [pull_]param array off of the compile context and then steal it back to a NULL context later. This doesn't get us all the way to where prog_data::[pull_]param is purely an out parameter of the back-end compiler but it gets us a lot closer. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/vs: Grow the param array for clip planesJason Ekstrand2017-10-121-5/+0
| | | | | | | | Instead of requiring the caller of brw_compile_vs to figure it out, just grow the param array on-demand. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/cs: Grow prog_data::param on-demand for thread_local_id_indexJason Ekstrand2017-10-121-3/+0
| | | | | | | | | | Instead of making the caller of brw_compile_cs add something to the param array for thread_local_id_index, just add it on-demand in brw_nir_intrinsics and grow the array. This is now safe to do because everyone is now using ralloc for prog_data::param. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler: Stop adding params for texture sizesJason Ekstrand2017-10-122-6/+0
| | | | | | | | We haven't needed this ever since we started using NIR for lowering rectangle textures. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Only add the wpos state reference if we lowered somethingJason Ekstrand2017-10-121-6/+6
| | | | | | | | | | | | Otherwise, in the ARB program case _mesa_add_state_reference may grow the parameter array which will cause brw_nir_setup_arb_uniforms to write past the end of the param array because it only looks at the parameter list length but the parma array is allocated based on nir->num_uniforms. The only reason this hasn't caused us problems is because we are padding out the param array for fragment programs unnecessarily. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler: Add a flag for pull constant supportJason Ekstrand2017-10-121-0/+1
| | | | | | | | | | | The Vulkan driver does not support pull constants. It simply limits things such that we can always push everything. Previously, we were determining whether or not to push things based on whether or not the prog_data::pull_param array is non-null. This is rather hackish and about to stop working. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Store image_param in brw_context instead of prog_dataJason Ekstrand2017-10-1212-41/+15
| | | | | | | | | | This burns an extra 10k of memory or so in the case where you don't have any images. However, if you have several shaders which use images, this should be much less memory. It also gets rid of a part of prog_data that really has nothing to do with the compiler. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use prog->info.num_images for needs_dc computationJason Ekstrand2017-10-121-2/+3
| | | | | | | | This should be just as good as looking in prog_data but removes our one state setup dependency on brw_stage_prog_data::nr_image_param. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Rewrite the world of push/pull paramsJason Ekstrand2017-10-1210-82/+155
| | | | | | | | | | | | | | | | | This moves us away to the array of pointers model and onto a model where each param is represented by a generic uint32_t handle. We reserve 2^16 of these handles for builtins that get generated by somewhere inside the compiler and have well-defined meanings. Generic params have handles whose meanings are defined by the driver. The primary downside to this new approach is that it moves a little bit of the work that we would normally do at compile time to draw time. On my laptop this hurts OglBatch6 by no more than 1% and doesn't seem to have any measurable affect on OglBatch7. So, while this may come back to bite us, it doesn't look too bad. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Get rid of gen7_cs_state.cJason Ekstrand2017-10-126-177/+145
| | | | | | | | | The only thing it was handling was push constants. We pull the actual constant upload code into gen6_constant_state.c and the atoms into genX_state_upload.c. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add a helper for populating constant buffersJason Ekstrand2017-10-123-12/+33
| | | | | Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Move brw_upload_pull_constants to gen6_constant_state.cJason Ekstrand2017-10-123-64/+65
| | | | | Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Delete the PBO texsubimage path for realJason Ekstrand2017-10-121-495/+0
| | | | Acked-by: Kenneth Graunke <[email protected]>
* i965: Share the flush for brw_blorp_miptree_download into a pboChris Wilson2017-10-123-31/+24
| | | | | | | | | | | | | As all users of brw_blorp_miptree_download() must emit a full pipeline and cache flush when targetting a user PBO (as that PBO may then be subsequently bound or *be* bound anywhere and outside of the driver dirty tracking) move that flush into brw_blorp_miptree_download() itself. v2 (Ken): Rebase without userptr stuff so it can land sooner. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Delete the PBO texture upload/download pathJason Ekstrand2017-10-122-80/+0
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use blorp instead of meta for PBO pixel readsJason Ekstrand2017-10-121-9/+51
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use blorp instead of meta for PBO texture downloadsJason Ekstrand2017-10-121-4/+29
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/tex: Use blorp texture upload for all CCS_E texturesJason Ekstrand2017-10-121-1/+2
| | | | | | | | | | | This improves the FillTex benchmark in GLBench 2.7 by 30% on my Broxton. On Ken's Broxton which only has single-channel ram, it improves by 210%. v2 (Ken): Check mt->aux_usage == ISL_AUX_USAGE_CCS_E rather than using intel_miptree_is_lossless_compressed(). Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use blorp instead of meta for PBO texture uploadsJason Ekstrand2017-10-121-4/+30
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Add blorp-based texture upload and download pathsJason Ekstrand2017-10-122-0/+362
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v1 (Topi Pohjolainen): original patch. v2 (Topi Pohjolainen): - Fix return value (s/MESA_FORMAT_NONE/false/) (Anuj) - Move _mesa_tex_format_from_format_and_type() just in the end avoiding additional if-block (Anuj) - Explain better the array alignment restriction (Anuj) - Do not bail out in case of gl_pixelstore_attrib::ImageHeight, it is handled by _mesa_image_offset() automatically (Ken). - Support 1D_ARRAY by flipping depth, width and y, z (Ken). v3 (Topi Pohjolainen): - Contrary to v2, do not try to handle gl_pixelstore_attrib::ImageHeight. Currently there are no tests in piglit or cts for it. One could possibly copy or modify tests/texturing/texsubimage.c. There, however, seems to be number of corner cases to consider. Moreover, current meta path applies the packing height for both source and targets when determining the offset. This would probably require re-visiting also. v4 (Topi Pohjolainen): Rebased on top of merged drm-bacon v5 (Jason Ekstrand): - Move to brw_blorp.c - Significant refactoring - Fixed 1-D array textures - Simplified handling of PBOs vs. CPU data. - Handle gl_pixelstore_attrib::ImageHeight. It turns out there are piglit tests that cover this. The original version was failing them because of an error in the way it handled 1-D array textures. - Add support for texture download v6 (Kenneth Graunke): Rebase fixes: - Use intel_miptree_check_level_layer instead of deleted fields - Update for mesa_format_supports_render[] rename. - Pass 'false' (read-only) to intel_bufferobj_buffer v7 (Kenneth Graunke): - Fix brw_blorp_download_miptree to pass 'false' (not read only) for the destination buffer (caught by Chris Wilson). - Fix blorp_get_client_bo to pass intel_bufferobj_buffer !read_only for the 'writable' parameter instead of 'false' (caught by Jason). - Support GL_BGR, GL_BGRA, GL_BGRA_INTEGER, GL_BGR_INTEGER, allowing us to use this for ReadPixels on the window system buffer (caught by Chris Wilson). - Fix y-flipping bugs in download path (exposed by BGRA support). - Fix false vs. NULL return value in blorp_get_client_bo. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Refactor y-flipping coordinate transform.Kenneth Graunke2017-10-121-7/+11
| | | | | | I want to reuse it for the BLORP download path. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965/tex: Check if there is data to upload up-frontJason Ekstrand2017-10-121-0/+4
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/barrier: Do the correct flushes for framebuffer accessJason Ekstrand2017-10-121-1/+1
| | | | | | | | | Framebuffer access includes framebuffer reads so we need to invalidate the texture cache. We do not, however, need to flush the depth cache because you cannot do bind a depth texture as an image. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/barrier: Do the correct flushes for texture updatesJason Ekstrand2017-10-121-2/+4
| | | | | | | | | Texture uploads and downloads may go through the render pipe which may result in texturing from or rendering to the texture or the PBO. We need to flush accordingly. Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Ignore GL_SKIP_DECODE_EXT for textures accessed via texelFetch().Kenneth Graunke2017-10-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GL_EXT_texture_sRGB_decode spec says: "The conversion of sRGB color space components to linear color space is always performed if the texel lookup function is one of the texelFetch builtin functions. Otherwise, if the texel lookup function is one of the texture builtin functions or one of the texture gather functions, the conversion of sRGB color space components to linear color space is controlled by the TEXTURE_SRGB_DECODE_EXT parameter. If the TEXTURE_SRGB_DECODE_EXT parameter is DECODE_EXT, the conversion of sRGB color space components to linear color space is performed. If the TEXTURE_SRGB_DECODE_EXT parameter is SKIP_DECODE_EXT, the value is returned without decoding. However, if the texture is also accessed with a texelFetch function, then the result of texture builtin functions and/or texture gather functions may be returned with decoding or without decoding." This patch makes i965 force sRGB decoding for any textures accessed via texelFetch(). If textures are accessed via texelFetch() and a regular texture access function, this will affect the other ones too - which is fine - it's undefined according to the last paragraph quoted. We could make both work, but we'd have to emit multiple SURFACE_STATEs, and have two binding table sections, like we do for texture gather hacks on older platforms. Fixes the following Android O CTS test: dEQP-GLES31.functional.srgb_texture_decode.skip_decode.srgba8.texel_fetch Reviewed-by: Jason Ekstrand <[email protected]>
* meta: Unset the textures_used_by_txf bitfield.Kenneth Graunke2017-10-121-0/+13
| | | | | | | | | | | Drivers that use Meta are happily using blitting data using texelFetch and GL_SKIP_DECODE_EXT, but the GL_EXT_texture_sRGB spec unfortunately makes GL_SKIP_DECODE_EXT not necessarily work with texelFetch. As a hack, just unset the texture_used_by_txf bitfield so we can continue with the old desired behavior. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Drop brw_bo_alloc in ARB_indirect_parameters implementation.Kenneth Graunke2017-10-111-1/+1
| | | | | | | | | | The original implementation allocated a new BO here, but we decided to switch to intel_upload_space, which returns a reference to the current upload BO. We accidentally kept the brw_bo_alloc, even though it's no longer necessary - intel_upload_space will immediately unreference it, causing us to allocate and immediately free a buffer. Reviewed-by: Plamena Manolova <[email protected]>
* i965: Allow mapped VBOs during drawing in non-debug contexts.Kenneth Graunke2017-10-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | Section 6.3.2 of the GL 4.5 spec says: "Any GL command which attempts to read from, write to, or change the state of a buffer object may generate an INVALID_OPERATION error if all or part of the buffer object is mapped ... However, only commands which explicitly describe this error are required to do so. If an error is not generated, such commands will have undefined results and may result in GL interruption or termination." Setting this flag allows us to skip walking over the buffer bindings for every enabled vertex attribute (_mesa_all_buffers_are_unmapped). Improves performance in GFXBench4's gl_driver2_off microbenchmark by 3.05797% +/- 0.709031% (n=33) on Apollolake. This breaks KHR-*.draw_elements_base_vertex_tests.invalid_mapped_bos, but that test is invalid and has been removed from the upstream CTS. Reviewed-by: Eric Anholt <[email protected]>
* i965: Make brw_update_texture_surface static.Kenneth Graunke2017-10-112-5/+1
| | | | Trivial. It's not used in other files.
* mesa: rename various buffer bindings to one struct.Dave Airlie2017-10-112-4/+4
| | | | | | | | One binding to bind them all, these are all the same thing. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965: Disable auxiliary buffers when there are self-dependencies.Kenneth Graunke2017-10-103-25/+37
| | | | | | | | | | | | | | | | | | | Jason and I investigated several OpenGL CTS failures where the tests bind the same texture for rendering and texturing, at the same time. This has defined results as long as the reads happen before writes, or the regions are non-overlapping. Normally, this just works out. However, CCS can cause problems. If the shader is reading one set of pixels, and writing to different pixels that are adjacent, they may end up being covered by the same CCS block. So rendering may be writing a CCS block, while the sampler is trying to read it. Corruption ensues. Disabling CCS is unfortunate, but safe. Fixes several KHR-GL45.texture_barrier.* subtests. Reviewed-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: minor whitespace fixKenneth Graunke2017-10-101-1/+1
|