summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
Commit message (Collapse)AuthorAgeFilesLines
* st/va: use provided sizes and coords for vlVaGetImageBoyuan Zhang2018-10-111-3/+28
| | | | | | | | | | | | | | | | vlVaGetImage should respect the width, height, and coordinates x and y that passed in. Therefore, pipe_box should be created with the passed in values instead of surface width/height. v2: add input size check, return error when size out of bounds v3: fix the size check for vaimage v4: add size adjustment for x and y coordinates Signed-off-by: Boyuan Zhang <[email protected]> Cc: "18.2" <[email protected]> Reviewed-by: Leo Liu <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Acked-by: Christian König <[email protected]>
* st/dri: Handle BGRA5551 formatMichel Dänzer2018-10-091-0/+13
| | | | Reviewed-by: Marek Olšák <[email protected]>
* pipe-loader: move dup(fd) within pipe_loader_drm_probe_fdEmil Velikov2018-10-033-26/+6
| | | | | | | | | | | | | | | | | | | | | | Currently pipe_loader_drm_probe_fd takes ownership of the fd given. To match that, pipe_loader_release closes it. Yet we have many instances which do not want the change of ownership, and thus duplicate the fd before passing it to the pipe-loader. Move the dup() within pipe-loader, explicitly document that and document all the cases through the codebase. A trivial git grep -2 pipe_loader_release makes things as obvious as it gets ;-) Cc: Leo Liu <[email protected]> Cc: Thomas Hellstrom <[email protected]> Cc: Axel Davy <[email protected]> Cc: Patrick Rudolph <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: Axel Davy <[email protected]> (for nine)
* st/dri: make swrast_no_present member of dri_screenEmil Velikov2018-10-032-4/+5
| | | | | | | Just like the dri2 options, this is better suited in the dri_screen struct. Signed-off-by: Emil Velikov <[email protected]>
* st/dri: inline dri2_buffer.h within dri2.cEmil Velikov2018-10-034-26/+16
| | | | | | | | The header was used only by dri2.c, containing a two-member struct and cast wrapper. Just inline it where it's used/needed. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/xa: remove unused xa_screen::d[s]_depth_bits_lastEmil Velikov2018-10-031-2/+0
| | | | | | | Unused since the initial import. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/nine: Do not mark both ff vs and ps updatedAxel Davy2018-09-251-2/+4
| | | | | | | | | | | | | | | | Previously if only ff vs or only ff ps was used, the constants for both were marked as updated, while only the constants of the used ff shader were updated. Now that NINE_STATE_FF_VS and NINE_STATE_FF_PS do not intersect anymore, we can correctly mark the correct set of constant as updated. Fixes: https://github.com/iXit/Mesa-3D/issues/319 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Split NINE_STATE_FF_OTHERAxel Davy2018-09-255-23/+23
| | | | | | | | | | | NINE_STATE_FF_OTHER was mostly ff vs states. Rename it to NINE_STATE_FF_VS_OTHER and move common states with ps to NINE_STATE_FF_PS_CONSTS (renamed from NINE_STATE_FF_PSSTAGES). Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add dummy ff shader stateAxel Davy2018-09-252-8/+12
| | | | | | | | | | | | | | | | | | Some states only affect the ff shader, not its constants. Currently we don't check anything and always recompute the ff shader key. However we do check for NINE_STATE_FF_OTHER and if set we reupload some constants. Thus for those states which had NINE_STATE_FF_OTHER set but didn't need it, replace by a dummy ff shader state (which is easier to understand for an external reader than just setting 0 and more future proof). Signed-off-by: Axel Davy <[email protected]>
* st/nine: Mark pointsize states as ff statesAxel Davy2018-09-251-3/+3
| | | | | | | | | | The pointsize states were missing the ff NINE_STATE_FF_OTHER flag, and thus might miss state updates when using ff. Fixes some wine tests. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Minor refactor of a few NINE_STATE_* flagsAxel Davy2018-09-253-17/+14
| | | | | | | | | | | | Rename NINE_STATE_FOG_SHADER, NINE_STATE_POINTSIZE_SHADER and NINE_STATE_PS1X_SHADER into NINE_STATE_VS_PARAMS_MISC and NINE_STATE_PS_PARAMS_MISC. The behaviour is unchanged, except one minor change: D3DRS_FOGTABLEMODE doesn't need to affect VS. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Increase maximum number of temp registersAxel Davy2018-09-251-1/+1
| | | | | | | | | With some test app I hit the limit. As we allocate on demand (up to the maximum), it is free to increase the limit. Signed-off-by: Axel Davy <[email protected]> CC: <[email protected]>
* st/nine: Lock the entire buffer in some cases.Axel Davy2018-09-251-0/+8
| | | | | | | | | | | | | | | | | Previously we had already found that for MANAGED buffers the buffer started dirty (which meant all writes out of bound before the first draw call using the buffer have to be taken into account). Possibly it is the same for the other types of buffers. For now always lock the entire buffer (starting from the offset) for these (except for DYNAMIC buffers, which might hurt performance too much). Fixes: https://github.com/iXit/Mesa-3D/issues/301 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Don't call SetCursor until a cursor is setAxel Davy2018-09-251-1/+8
| | | | | | | | | | | | | | | | | | | The previous code was ignoring the input until a cursor is set inside d3d (with SetCursorProperties), as expected by wine tests. However it did still make a call to ID3DPresent_SetCursor, which would result into a SetCursor(NULL) call, thus hidding any cursor set outside d3d, which we shouldn't do. Add comment about not avoiding redundant ID3DPresent_SetCursor calls once a cursor has been set in d3d, as it has been tested to cause regressions. Fixes: https://github.com/iXit/Mesa-3D/issues/197 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Avoid redundant SetCursorPos callsAxel Davy2018-09-251-0/+4
| | | | | | | | | | | | | | | | | | | | For some applications SetCursorPosition is called when a cursor event is received. Our SetCursorPosition was always calling wine SetCursorPos which would trigger a cursor event. The infinite loop is avoided by not calling SetCursorPos when the position hasn't changed. Found thanks to wine tests. Fixes irresponsive GUI for some applications. Fixes: https://github.com/iXit/Mesa-3D/issues/173 Signed-off-by: Axel Davy <[email protected]> CC: <[email protected]>
* st/nine: Init cursor position at device creationAxel Davy2018-09-251-2/+5
| | | | | | | This is only useful for software cursor, but at least now we won't start it at (0, 0). Signed-off-by: Axel Davy <[email protected]>
* st/nine: Initialize manually cursor structureAxel Davy2018-09-251-0/+4
| | | | | | | Initialize manually the cursor structure fields for more clarity on its content. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Check if format is DS before retrieving flagsAxel Davy2018-09-251-0/+2
| | | | | | | | | | | | | | d3d9_get_pipe_depth_format_bindings assumes the input format is a depth stencil format. Previously the user could hit this function with an invalid format. Protect the last non protected call with a depth_stencil_format check. Another solution is to have d3d9_get_pipe_depth_format_bindings support non depth stencil format, but we don't want the user to create depth buffers with d3d formats that can't be one, it's better to check if the format can be depth buffer with d3d. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Remove clamping when mul_zero_winsAxel Davy2018-09-251-8/+47
| | | | | | | Tests show the clamping can be removed when mul_zero_wins is supported. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Implement predicated instructionsAxel Davy2018-09-251-7/+55
| | | | | | | | Most of the work was already there, just not implemented. Fixes: https://github.com/iXit/Mesa-3D/issues/318 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix aliased read in ffAxel Davy2018-09-251-3/+3
| | | | | | | | | Fix aliasing of colorarg_b4 with colorarg_b5. Fixes: https://github.com/iXit/Mesa-3D/issues/302 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Fix ff assignment with aliasingAxel Davy2018-09-251-9/+9
| | | | | | | "tex_stage[s][D3DTSS_COLORARG0] >> 4" could be a two bit number, thus colorarg_b4 was incorrectly set. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Clarify some ff assignmentsAxel Davy2018-09-251-6/+6
| | | | | | | | | | | | colorarg0, etc are 3 bits wide. Make the code more readable by adding an & 0x7 to further indicate we only remember the first 3 bits only. The 4th bit is always 0, and colorarg_b4, colorarg_b5, etc are used to store the 5th and 6th bits. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Print transform matrices in debugAxel Davy2018-09-251-0/+14
| | | | | | | This is useful to see the matrices content in the log to debug. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add ff key hash to help debugAxel Davy2018-09-251-0/+2
| | | | | | | This is very useful to find in the log the ff shader shource of a given call. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Avoid RefToBind calls in ffAxel Davy2018-09-253-4/+10
| | | | | | | | | | | | | | | | When using csmt, ff shader creation happens on the csmt thread. Creating the shaders, then calling RefToBind causes the device ref to be increased then decreased. However the device dtor assumes than no work pending on the csmt thread could increase the device ref, leading to hang. The issue is avoided by creating the shaders with a bind count directly. Fixes: https://github.com/iXit/Mesa-3D/issues/295 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add new helper for object creation with bindAxel Davy2018-09-251-0/+26
| | | | | | | Add a new helper to create objects starting with a bind count instead of a ref count. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Add parameter to start with bindAxel Davy2018-09-253-3/+18
| | | | | | | Add a parameter to start new object with a bind instead of a refcount. Signed-off-by: Axel Davy <[email protected]>
* st/nine: Use perspective correction for ps depth fogAxel Davy2018-09-251-7/+9
| | | | | | | | | | | | | | | | | | | | | Emulate perspective interpolation of depth for programmable ps fog ff ps fog uses position z, or 1/w depending on the ff projection matrix set. This is according to public documents found describing the algorithm and tests we made. In the case of programmable ps, we used position's z, which was sufficient to pass wine tests (which test shaders don't set w). Issue https://github.com/iXit/Mesa-3D/issues/315 showed that this calculation was wrong. Using perspective interpolation on z, that is using z * 1/w seems to satisfy both this application and wine tests. Fixes: https://github.com/iXit/Mesa-3D/issues/315 Signed-off-by: Axel Davy <[email protected]>
* st/nine: Clamp RCP when 0*inf!=0Axel Davy2018-09-251-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Tests done on several devices of all 3 vendors and of different generations showed that there are several ways of handling infs and NaN for d3d9. Tests showed Intel on windows does always clamp RCP, RSQ and LOG (thus preventing inf/nan generation), for all shader versions (some vendor behaviours vary with shader versions). Doing this in nine avoids 0*inf issues for drivers that can't generate 0*inf=0 (which is controled by TGSI's MUL_ZERO_WINS). For now clamp for all drivers. An ulterior optimization would be to avoid clamping for drivers with MUL_ZERO_WINS for the specific shader versions where NV or AMD don't clamp. LOG and RSQ being already clamped, this patch only clamps RCP. Fixes: https://github.com/iXit/Mesa-3D/issues/316 Signed-off-by: Axel Davy <[email protected]> CC: <[email protected]>
* st/dri: don't set queryDmaBufFormats/queryDmaBufModifiers if the driver does ↵Michal Srb2018-09-191-2/+4
| | | | | | | | | | | | | not implement it This is equivalent to commit a65db0ad1c3, but for dri_kms_init_screen. Without this gbm_dri_is_format_supported always returns false. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104926 Fixes: e14fe41e0bf ("st/dri: implement createImageFromRenderbuffer(2)") Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Tested-by: Adam Williamson <[email protected]>
* mesa/st: add force_compat_profile option to driconfigTimothy Arceri2018-09-181-2/+8
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/vdpau: Use output buffer as back buffer with 24-bit color onlyLeo Liu2018-09-131-1/+2
| | | | | | | | Using output buffer with 8 bits video RGB as back buffer certainly is not working for 30 bits color depth visual. Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* gallium: Correctly handle no config context creationElie Tournier2018-09-101-1/+3
| | | | | | | | | | | | This patch fixes the following Piglit test: spec@egl_mesa_configless_context@basic It also fixes few test in a virgl guest. v2: Evaluate the value of no_config (Ilia) Suggested-by: Emil Velikov <[email protected]> Signed-off-by: Elie Tournier <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* Replace uses of _mesa_bitcount with util_bitcountDylan Baker2018-09-072-8/+10
| | | | | | | | | | | | | and _mesa_bitcount_64 with util_bitcount_64. This fixes a build problem in nir for platforms that don't have popcount or popcountll, such as 32bit msvc. v2: - Fix additional uses of _mesa_bitcount added after this was originally written Acked-by: Eric Engestrom <[email protected]> (v1) Acked-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* gallium: split depth_clip into depth_clip_near & depth_clip_farMarek Olšák2018-09-062-2/+4
| | | | for AMD_depth_clamp_separate.
* st/vdpau: silence an unitialized-variable warningMarek Olšák2018-09-041-1/+1
|
* st/dri: Don't expose sRGB formats to clientsDaniel Stone2018-08-311-0/+6
| | | | | | | | | | | | | | Though the SARGB8888 format is used internally through its FourCC value, it is not a real format as defined by drm_fourcc.h; it cannot be used with KMS or other interfaces expecting drm_fourcc.h format codes. Ensure we don't advertise it through the dmabuf format/modifier query interfaces, preventing us from tripping over an assert. Signed-off-by: Daniel Stone <[email protected]> Reported-by: Michel Dänzer <[email protected]> Fixes: 8c1b9882b2e0 ("egl/dri2: Guard against invalid fourcc formats") Acked-by: Jason Ekstrand <[email protected]>
* st/mesa, gallium: add a workaround for No Mans SkyTimothy Arceri2018-08-301-0/+2
| | | | | | | | The spec seems clear this is not allowed but the Nvidia binary forces apps to add layout qualifiers so this works around the issue for No Mans Sky until the CTS can be sorted out. Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove unused dri config option disable_shader_bit_encodingTimothy Arceri2018-08-212-3/+0
| | | | | | | This was added as a workaround for Heaven 3.0 but was later removed by 5ead448719f3 to allow Heaven 4.0 to work correctly. Reviewed-by: Kenneth Graunke <[email protected]>
* bin: always define MESA_GIT_SHA1 to make it directly usable in codeEric Engestrom2018-08-162-10/+2
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* dri: Add param driCreateConfigs(mutable_render_buffer)Chad Versace2018-08-071-2/+2
| | | | | | | | | If set, then the config will have __DRI_ATTRIB_MUTABLE_RENDER_BUFFER, which translates to EGL_MUTABLE_RENDER_BUFFER_BIT_KHR. Not used yet. Reviewed-by: Tapani Pälli <[email protected]>
* gallium: add storage_sample_count parameter into is_format_supportedMarek Olšák2018-07-3117-38/+44
| | | | Tested-by: Dieter Nützel <[email protected]>
* gallium: add pipe_resource::nr_storage_samples, and set it same as nr_samplesMarek Olšák2018-07-3111-1/+16
| | | | Tested-by: Dieter Nützel <[email protected]>
* clover: Reduce wait_count in abort path.Jan Vesely2018-07-261-1/+3
| | | | | | | | | | Trigger waiter condition variable. Passes 'events' CTS on carrizo and turks. v2: reduce to 0 Cc: [email protected] Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* clover: Don't extend illegal integer types.Jan Vesely2018-07-262-2/+13
| | | | | | | | | | | | | | | | | It's OK to pass them in memory, which is what kernel invocation needs. Fixes regressions since llvm r337535 ("Reapply "AMDGPU: Fix handling of alignment padding in DAG argument lowering"): scalar-arithmetic-char scalar-arithmetic-uchar scalar-arithemtic-short scalar-arithmetic-ushort scalar-comparison-char scalar-comparison-uchar scalar-comparison-short scalar-comparison-ushort Cc: [email protected] Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* st/dri: Don't require a dri_format for image creation.Eric Anholt2018-07-202-13/+1
| | | | | | | | | | | | | Nothing in EGL_KHR_gl_image.txt seems to let us deny creation based on formats, and doing so causes many failures in dEQP-EGL.functional.image.api.* The NONE value we were protecting from only gets looked at in the __DRI_IMAGE_ATTRIB_FORMAT and __DRI_IMAGE_ATTRIB_FOURCC queries, which are used from wayland and gbm (which throw an error cleanly on unknown format) and DMABUF export. Reviewed-by: Marek Olšák <[email protected]>
* clover: Report error when pipe driver fails to create compute stateJan Vesely2018-07-171-0/+4
| | | | | | CC: <[email protected]> Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* clover: Catch errors from executing event actionJan Vesely2018-07-171-1/+3
| | | | | | | | | Abort all dependent events. v2: Abort the current event as well. CC: <[email protected]> Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* st/glx: constify some variablesKonstantin Kharlamov2018-07-171-1/+1
| | | | | | | Just a nice hint for both peoples and compilers. Signed-off-by: Konstantin Kharlamov <[email protected]> Signed-off-by: Marek Olšák <[email protected]>