diff options
author | Alejandro Piñeiro <apinheiro@igalia.com> | 2020-07-30 14:32:26 +0200 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-10-13 21:21:32 +0000 |
commit | 947fa7033dc3224b04c421cb759ae101ee9d30a4 (patch) | |
tree | 23cbcf5b6ec94d1cf082aff3cb90ef810222ec35 | |
parent | 81b713e341a5e90720d4084dc202860399d19f44 (diff) |
v3dv: add v3dv_limits file
There are several definitions for hw limits on v3dv_image that we want
to share, but v3dv_private was already growing bigger and messier.
So let's move them to a specific header. Note that there is already a
broadcom/common/v3d_limits.h. We are not putting them there because
right now they are only used by the Vulkan driver, but are candidates
to be moved.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
-rw-r--r-- | src/broadcom/vulkan/meson.build | 1 | ||||
-rw-r--r-- | src/broadcom/vulkan/v3dv_image.c | 16 | ||||
-rw-r--r-- | src/broadcom/vulkan/v3dv_limits.h | 65 | ||||
-rw-r--r-- | src/broadcom/vulkan/v3dv_private.h | 23 |
4 files changed, 68 insertions, 37 deletions
diff --git a/src/broadcom/vulkan/meson.build b/src/broadcom/vulkan/meson.build index 8d974ad997e..29fc4cc665c 100644 --- a/src/broadcom/vulkan/meson.build +++ b/src/broadcom/vulkan/meson.build @@ -61,6 +61,7 @@ libv3dv_files = files( 'v3dv_device.c', 'v3dv_formats.c', 'v3dv_image.c', + 'v3dv_limits.h', 'v3dv_meta_clear.c', 'v3dv_meta_copy.c', 'v3dv_pass.c', diff --git a/src/broadcom/vulkan/v3dv_image.c b/src/broadcom/vulkan/v3dv_image.c index 68d444c607f..787c6b20c00 100644 --- a/src/broadcom/vulkan/v3dv_image.c +++ b/src/broadcom/vulkan/v3dv_image.c @@ -31,22 +31,6 @@ #include "vk_util.h" #include "vulkan/wsi/wsi_common.h" -/* These are tunable parameters in the HW design, but all the V3D - * implementations agree. - */ -#define VC5_UIFCFG_BANKS 8 -#define VC5_UIFCFG_PAGE_SIZE 4096 -#define VC5_UIFCFG_XOR_VALUE (1 << 4) -#define VC5_PAGE_CACHE_SIZE (VC5_UIFCFG_PAGE_SIZE * VC5_UIFCFG_BANKS) -#define VC5_UBLOCK_SIZE 64 -#define VC5_UIFBLOCK_SIZE (4 * VC5_UBLOCK_SIZE) -#define VC5_UIFBLOCK_ROW_SIZE (4 * VC5_UIFBLOCK_SIZE) - -#define PAGE_UB_ROWS (VC5_UIFCFG_PAGE_SIZE / VC5_UIFBLOCK_ROW_SIZE) -#define PAGE_UB_ROWS_TIMES_1_5 ((PAGE_UB_ROWS * 3) >> 1) -#define PAGE_CACHE_UB_ROWS (VC5_PAGE_CACHE_SIZE / VC5_UIFBLOCK_ROW_SIZE) -#define PAGE_CACHE_MINUS_1_5_UB_ROWS (PAGE_CACHE_UB_ROWS - PAGE_UB_ROWS_TIMES_1_5) - /** * Computes the HW's UIFblock padding for a given height/cpp. * diff --git a/src/broadcom/vulkan/v3dv_limits.h b/src/broadcom/vulkan/v3dv_limits.h new file mode 100644 index 00000000000..f5e9b44436e --- /dev/null +++ b/src/broadcom/vulkan/v3dv_limits.h @@ -0,0 +1,65 @@ +/* + * Copyright © 2020 Raspberry Pi + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ +#ifndef V3DV_LIMITS_H +#define V3DV_LIMITS_H + +#define NSEC_PER_SEC 1000000000ull + +/* From vulkan spec "If the multiple viewports feature is not enabled, + * scissorCount must be 1", ditto for viewportCount. For now we don't support + * that feature. + */ +#define MAX_VIEWPORTS 1 +#define MAX_SCISSORS 1 + +#define MAX_VBS 16 +#define MAX_VERTEX_ATTRIBS 16 + +#define MAX_SETS 16 + +#define MAX_PUSH_CONSTANTS_SIZE 128 + +#define MAX_DYNAMIC_UNIFORM_BUFFERS 16 +#define MAX_DYNAMIC_STORAGE_BUFFERS 8 +#define MAX_DYNAMIC_BUFFERS \ + (MAX_DYNAMIC_UNIFORM_BUFFERS + MAX_DYNAMIC_STORAGE_BUFFERS) + + +/* These are tunable parameters in the HW design, but all the V3D + * implementations agree. + */ +#define VC5_UIFCFG_BANKS 8 +#define VC5_UIFCFG_PAGE_SIZE 4096 +#define VC5_UIFCFG_XOR_VALUE (1 << 4) +#define VC5_PAGE_CACHE_SIZE (VC5_UIFCFG_PAGE_SIZE * VC5_UIFCFG_BANKS) +#define VC5_UBLOCK_SIZE 64 +#define VC5_UIFBLOCK_SIZE (4 * VC5_UBLOCK_SIZE) +#define VC5_UIFBLOCK_ROW_SIZE (4 * VC5_UIFBLOCK_SIZE) + +#define PAGE_UB_ROWS (VC5_UIFCFG_PAGE_SIZE / VC5_UIFBLOCK_ROW_SIZE) +#define PAGE_UB_ROWS_TIMES_1_5 ((PAGE_UB_ROWS * 3) >> 1) +#define PAGE_CACHE_UB_ROWS (VC5_PAGE_CACHE_SIZE / VC5_UIFBLOCK_ROW_SIZE) +#define PAGE_CACHE_MINUS_1_5_UB_ROWS (PAGE_CACHE_UB_ROWS - PAGE_UB_ROWS_TIMES_1_5) + + +#endif /* V3DV_LIMITS_H */ diff --git a/src/broadcom/vulkan/v3dv_private.h b/src/broadcom/vulkan/v3dv_private.h index a737e0d1b2b..9ec38df0d76 100644 --- a/src/broadcom/vulkan/v3dv_private.h +++ b/src/broadcom/vulkan/v3dv_private.h @@ -46,6 +46,8 @@ #define VG(x) ((void)0) #endif +#include "v3dv_limits.h" + #include "common/v3d_device_info.h" #include "common/v3d_limits.h" @@ -115,27 +117,6 @@ pack_emit_reloc(void *cl, const void *reloc) {} memcpy((dest), (src), (count) * sizeof(*(src))); \ }) -#define NSEC_PER_SEC 1000000000ull - -/* From vulkan spec "If the multiple viewports feature is not enabled, - * scissorCount must be 1", ditto for viewportCount. For now we don't support - * that feature. - */ -#define MAX_VIEWPORTS 1 -#define MAX_SCISSORS 1 - -#define MAX_VBS 16 -#define MAX_VERTEX_ATTRIBS 16 - -#define MAX_SETS 16 - -#define MAX_PUSH_CONSTANTS_SIZE 128 - -#define MAX_DYNAMIC_UNIFORM_BUFFERS 16 -#define MAX_DYNAMIC_STORAGE_BUFFERS 8 -#define MAX_DYNAMIC_BUFFERS \ - (MAX_DYNAMIC_UNIFORM_BUFFERS + MAX_DYNAMIC_STORAGE_BUFFERS) - struct v3dv_instance; #ifdef USE_V3D_SIMULATOR |