Ian Romanick
d76c204d05
util: Move util_is_power_of_two to bitscan.h and rename to util_is_power_of_two_or_zero
...
The new name make the zero-input behavior more obvious. The next
patch adds a new function with different zero-input behavior.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2018-03-29 14:09:23 -07:00
Marek Olšák
025105453a
radeonsi: simplify DCC format categories
...
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2018-03-28 18:45:52 -04:00
Marek Olšák
769603564e
radeonsi: don't reallocate on DMABUF export if local BOs are disabled
2018-03-26 19:22:12 -04:00
Marek Olšák
f7ffa504a0
ac/surface: compute tile swizzle for GFX9
...
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2018-03-21 13:40:06 -04:00
Marek Olšák
b494ed168c
radeonsi: don't flush when si_eliminate_fast_color_clear is no-op
2018-02-21 20:03:11 +01:00
Marek Olšák
5f55f4c59f
radeonsi: make texture_discard_cmask/eliminate functions non-static
2018-02-21 20:03:11 +01:00
Marek Olšák
022c5b22fe
radeonsi: don't ignore pitch for imported textures
...
Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2018-01-24 21:08:45 +01:00
Marek Olšák
986e467e4c
gallium/util: add util_num_layers helper
2017-12-25 14:23:02 +01:00
Brian Paul
63b03dc924
gallium/util: don't pass a pipe_resource to util_resource_is_array_texture()
...
No need to pass a pipe_resource when we can just pass the target.
This makes the function potentially more usable. Rename it too.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-12-12 09:44:59 -07:00
Marek Olšák
010214b403
radeonsi: allow DMABUF exports for local buffers
...
Cc: 17.3 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-06 15:19:02 +01:00
Marek Olšák
5e805cc74b
radeonsi: flush the context after resource_copy_region for buffer exports
...
Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-12-05 13:28:00 +01:00
Marek Olšák
ed4780383c
radeonsi/gfx9: fix importing shared textures with DCC
...
VI has 11 dwords at least. GFX9 has 10 dwords.
Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-30 18:46:11 +01:00
Marek Olšák
2c5f2936af
r300,r600,radeonsi: replace RADEON_FLUSH_* with PIPE_FLUSH_*
...
and handle PIPE_FLUSH_HINT_FINISH in r300.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-29 18:21:30 +01:00
Marek Olšák
950221f923
radeonsi: remove r600_common_screen
...
Most files in gallium/radeon now include si_pipe.h.
chip_class and family are now here:
sscreen->info.family
sscreen->info.chip_class
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-29 18:21:30 +01:00
Marek Olšák
c0d44fe0e9
radeonsi: remove query/apply_opaque_metadata callbacks
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-29 18:21:30 +01:00
Marek Olšák
7aa2366b70
radeonsi: move all clear() code into si_clear.c
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-29 18:21:30 +01:00
Marek Olšák
3c4d871ca2
radeonsi: enable DCC with MSAA for VI
...
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-29 18:21:30 +01:00
Marek Olšák
373f4a48ae
radeonsi: implement fast color clear for DCC with MSAA for VI
...
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-29 18:21:30 +01:00
Marek Olšák
e3c0a5b6e8
ac/surface: enable DCC computation for MSAA
...
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-29 18:21:30 +01:00
Marek Olšák
6863651bbd
radeonsi: fix layered DCC fast clear
...
Cc: 17.2 17.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-29 18:21:30 +01:00
Nicolai Hähnle
08f6b4dd7b
radeonsi: avoid attempting to create CMASK if the tiling mode doesn't have it
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-11-28 09:34:43 +01:00
Marek Olšák
ec15ff78c3
ac: change legacy_surf_level::slice_size to dword units
...
The next commit will reduce the size even more.
v2: typecast to uint64_t manually
v3: add more typecasts, add asserts
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-27 14:44:04 +01:00
Marek Olšák
474b4a9191
ac: pack ac_surface better
...
r600_texture: 1736 -> 1488 bytes
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-27 14:12:38 +01:00
Marek Olšák
95cd74abd4
radeonsi: remove an old hack for evergreen
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-27 14:12:38 +01:00
Marek Olšák
f8a4b606a2
radeonsi: clean up r600_surface
...
216 -> 160 bytes
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-09 17:32:14 +01:00
Marek Olšák
6916ee7e17
radeonsi: remove r600_texture::non_disp_tiling
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-09 17:32:14 +01:00
Nicolai Hähnle
222a2fb998
util: move os_time.[ch] to src/util
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-11-09 11:57:21 +01:00
Marek Olšák
529cdce799
radeonsi: remove 'Authors:' comments
...
It's inaccurate. Instead, see the copyright and use "git log" and
"git blame" to know the authorship.
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-11-02 18:19:03 +01:00
Marek Olšák
07fdc0a09c
gallium: add pipe_screen::check_resource_capability
...
This is optional (and no CAP).
Implemented by radeonsi, ddebug, rbug, trace.
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-12 19:03:33 +02:00
Marek Olšák
76997e9133
radeonsi: shrink r600d_common.h and stop using it
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-09 16:27:05 +02:00
Marek Olšák
3784ce9782
radeonsi: enumerize DBG flags
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-09 16:20:16 +02:00
Marek Olšák
f1eb9a9c27
gallium/radeon: remove old r600g code checking chip_class and family
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-07 18:26:35 +02:00
Nicolai Hähnle
4c56e07029
radeonsi: clamp depth comparison value only for fixed point formats
...
The hardware usually does this automatically. However, we upgrade
depth to Z32_FLOAT to enable TC-compatible HTILE, which means the
hardware no longer clamps the comparison value for us.
The only way to tell in the shader whether a clamp is required
seems to be to communicate an additional bit in the descriptor
table. While VI has some unused bits in the resource descriptor,
those bits have unfortunately all been used in gfx9. So we use
an unused bit in the sampler state instead.
Fixes dEQP-GLES3.functional.texture.shadow.2d.linear.equal_depth_component32f
and many other tests in dEQP-GLES3.functional.texture.shadow.*
Fixes: d4d9ec55c5
("radeonsi: implement TC-compatible HTILE")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2017-09-29 11:44:50 +02:00
Marek Olšák
f70f6baaa3
gallium/radeon: consolidate PIPE_BIND_SHARED/SCANOUT handling
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-09-27 10:38:46 +02:00
Samuel Pitoiset
eba2abf54b
gallium/radeon: more use of vi_dcc_formats_are_incompatible()
...
Found by inspection.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-09-27 09:31:24 +02:00
Marek Olšák
06bfb2d28f
r600: fork and import gallium/radeon
...
This marks the end of code sharing between r600 and radeonsi.
It's getting difficult to work on radeonsi without breaking r600.
A lot of functions had to be renamed to prevent linker conflicts.
There are also minor cleanups.
Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-09-26 04:21:14 +02:00
Marek Olšák
a5b764cfea
radeonsi: reallocate if a non-sharable textures is being shared
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-09-18 17:47:49 +02:00
Marek Olšák
4bd2bdbb3c
ac/surface: add radeon_surf::has_stencil for convenience
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-09-07 17:59:37 +02:00
Marek Olšák
fdef2f0fd1
radeonsi/gfx9: properly handle imported textures with unexpected swizzle mode
...
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-22 13:29:47 +02:00
Nicolai Hähnle
bc93339799
radeonsi: start using u_log_context for debugging
...
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-22 09:51:00 +02:00
Dave Airlie
e0edfadec8
radeonsi: initialise imported surface to 0.
...
For memobj imports we weren't setting the surface to 0, which
meant sometimes we'd end up with tile_swizzle garbage, which
would corrupt rendering.
This seems to fix the image corruption on the imported memory
objects in vrdashboard for me.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-08-15 01:35:58 +01:00
Dave Airlie
2bdb0da030
radeonsi: add basic memory object support
...
v2: also consider gfx9 metadata
v3: ref/unref memobj->buf
v4: add refcount comment
Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-06 12:42:06 +10:00
Andres Rodriguez
ddf2c830a6
radeonsi: factor out metadata import
...
Plumbing for importing memobj backed textures.
Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-08-06 12:42:06 +10:00
Marek Olšák
da942a4b81
radeonsi: program tile swizzle for color and FMASK surfaces for GFX & SDMA
...
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-04 02:10:04 +02:00
Marek Olšák
7726092795
gallium/radeon: reallocate textures with non-zero tile_swizzle on export
...
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-04 02:10:04 +02:00
Marek Olšák
4e757d591d
ac/surface: add RADEON_SURF_SHAREABLE
...
Shareable textures won't use tile swizzle.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-08-04 02:10:04 +02:00
Marek Olšák
d308460586
gallium/radeon: reallocate suballocated buffers when exported
...
This should fix exports of suballocated buffers.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-17 10:50:39 -04:00
Marek Olšák
5b555854cc
gallium/radeon: flush the context after in-place texture realloc before export
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-17 10:50:39 -04:00
Marek Olšák
c784015643
gallium/radeon: allow suballocating textures
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-04 15:40:37 +02:00
Marek Olšák
23446eedd1
gallium/radeon: generalize the function for in-place texture reallocation
...
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-04 15:40:37 +02:00