Commit Graph

25 Commits

Author SHA1 Message Date
Dylan Baker a8e2d79e02 meson: use gnu_symbol_visibility argument
This uses a meson builtin to handle -fvisibility=hidden. This is nice
because we don't need to track which languages are used, if C++ is
suddenly added meson just does the right thing.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
2020-06-01 18:59:18 +00:00
Bas Nieuwenhuizen 7e4c8949c6 gallium/dri: Remove lowered_yuv tracking for plane mapping.
Just heard that etnaviv is also compatible with it even
in the non-lowered cases, so let us enable it for everyone.

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5253>
2020-05-30 02:49:54 +00:00
Bas Nieuwenhuizen ad609bf55a frontend/dri: Implement mapping individual planes.
It is kinda surprising that

image2 = fromPlanar(image, 2, NULL)
mapImage(..., image2, ...)

does not map the third plane.

This implements that behavior in the case where the DRI frontend
lowers the multi-planar textures.

In the case it doesn't this would need driver support. AFAIU at
least etnaviv is impacted, and while it looks possible, I don't
have the etnaviv knowledge to implement it.

Instead of silently returning weird results (either always plane 0
or possibly something interleaved) this adds an error return on
mapping multi-planar textures otherwise.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5200>
2020-05-29 09:12:33 +00:00
Thong Thai 78786a219e frontends/va: Fix deinterlace bottom field first flag
Fixes an issue with mpv, where deinterlacing causes the picture to be
offset by one line every other frame in the video.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5157>
2020-05-22 18:23:53 +00:00
Pierre Moreau 8635c28a92 clover: Address unnecessary copy warnings
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4943>
2020-05-21 10:58:05 +00:00
Pierre Moreau 15a27ed73b clover/api: Address missing braces for subobj init
Signed-off-by: Pierre Moreau <dev@pmoreau.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4943>
2020-05-21 10:58:05 +00:00
Axel Davy a887ad7c84 st/nine: Handle full pSourceRect better
Some apps do set pSourceRect to the full area even if not needed.

Filtering out this case is helpful, as we currently do not handle
properly resizing (pDestRect or window size not of the size of the resource)
when pSourceRect is set. Indeed in this case pSourceRect needs to be modified
before being passed to the presentation backend.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy dbb0825570 st/nine: Ignore pDirtyRegion
We supported it, but it's not much useful.
Besides it gets more complicated to handle right when
you support resizing before display.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy 1c474dde28 st/nine: Improve pDestRect handling
pSourceRect and pDestRect allows to:
A) display a crop of the backbuffer
B) display the content in a subregion (after an offset)
C) resize the content before displaying

Before this patch, only features A and B were supported.
This patch adds C, but breaks A, which current support
relied on C not being implemented.

I think C is more important than A, and A can be added later.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy ffed34113b st/nine: Retry allocations after freeing some space
Managed resources can be released whenever we need.
When we have an allocation failure, free them and retry.
Try also to flush the csmt queue in case there were some things released.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy d771e0cc60 st/nine: Increase available GPU memory
This patch caps to 4GB the limit of GPU memory accessible
only for 32bits build.
This would deserve some tests on windows, so we might change that
behaviour in the future. For example, it's possible that
GetAvailableTextureMem is capped to 4GB on 64bits build.

We cap to a bit less than 4GB, which might help
https://github.com/iXit/Mesa-3D/issues/323

In addition, increase from 80% to 95% the allocation limit above
which we fail allocating.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy 4cf13691be st/nine: Add missing NULL checks
Ideally apps shouldn't make buggy calls.
Still if some do, let's avoid crashing.

Without this patch, if some calls are invalid,
for example if replaying a trace of a game needing
a lot of VRAM on a card with not much VRAM, it can
crash.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy 725ebc4657 st/nine: Fix a crash if the state is not initialized
I don't remember exactly the conditions of the crash,
but I had a trace which was crashing in the gallium driver
before doing any rendering (something about viewports being not initialized).

It's not the first time we hit such a problem, so rather than investigating
that crash, I chose to just initialize every states at device creation.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy 0222c550c7 st/nine: Fix uninitialized variable in BEM()
tmp was not initialized.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy 5d904d2749 st/nine: Improve return error code in CheckDeviceFormat
This seems suspicious, but is better than what we currently do.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy 54a7a69085 st/nine: Pass more adapter formats for CheckDepthStencilMatch
It seems CheckDepthStencilMatch should accept A8R8G8B8
as adapter format. Given the lack of clarity of the doc
relative to the difference between display format
and adapter format (== display format modulo alpha bits),
for now just accept display formats with and without alpha bits.

Fixes: https://github.com/iXit/Mesa-3D/issues/317

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy edff31c0d9 st/nine: Do not return invalidcall on getrenderstate
To be fair I don't remember why I wrote this patch,
but it seems reasonable.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy 2c61b4db7d st/nine: Return error when setting invalid depth buffer
Prevents a crash with the trace of
https://github.com/iXit/wine-nine-standalone/issues/40

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy c0f21cbaa1 st/nine: Add checks for pure device
Some Get* functions are forbidden for pure device.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5015>
2020-05-15 15:43:57 +00:00
Axel Davy f83f538881 st/nine: Enable ttn cache
A trace of a Hat in Time, which builds thousands of shaders
takes 339 seconds to run the second time without this patch,
and 41 seconds with it (basically there is no more loading times).

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4993>
2020-05-13 19:43:05 +00:00
Axel Davy 522bd414f3 ttn: Add new allow_disk_cache parameter
For now this parameter doesn't do anything.
It means the implementation is allowed to use
a cache on disk.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4993>
2020-05-13 19:43:05 +00:00
Marek Olšák db94a2d03d gallium: remove more "state tracker" occurences
Trivial.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
2020-05-13 13:47:27 -04:00
Marek Olšák 7480069703 gallium: rename PIPE_RESOURCE_FLAG_ST_PRIV to FRONTEND_PRIV
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
2020-05-13 13:47:27 -04:00
Marek Olšák 8c9b9aac7d gallium: change comments to remove 'state tracker'
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
2020-05-13 13:47:27 -04:00
Marek Olšák d6287a94b6 gallium: rename 'state tracker' to 'frontend'
Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
2020-05-13 13:46:53 -04:00