2013-07-04 12:11:36 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright © 2013 Intel Corporation
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2021-04-05 11:47:31 -07:00
|
|
|
#ifndef INTEL_DEVICE_INFO_H
|
|
|
|
|
#define INTEL_DEVICE_INFO_H
|
2016-10-11 18:26:22 +01:00
|
|
|
|
2013-07-04 12:11:36 -07:00
|
|
|
#include <stdbool.h>
|
2017-06-15 15:22:19 +01:00
|
|
|
#include <stdint.h>
|
2013-07-04 12:11:36 -07:00
|
|
|
|
2018-03-14 13:16:01 +00:00
|
|
|
#include "util/macros.h"
|
2021-09-08 16:54:57 -07:00
|
|
|
#include "compiler/shader_enums.h"
|
2018-03-14 13:16:01 +00:00
|
|
|
|
2022-10-05 12:46:31 -07:00
|
|
|
#include "intel/common/intel_engine.h"
|
|
|
|
|
|
2017-09-27 20:57:28 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-07-13 17:56:01 -05:00
|
|
|
#define INTEL_DEVICE_MAX_NAME_SIZE 64
|
2020-07-30 15:56:14 +03:00
|
|
|
#define INTEL_DEVICE_MAX_SLICES 8
|
2021-04-05 14:29:06 -07:00
|
|
|
#define INTEL_DEVICE_MAX_SUBSLICES (8) /* Maximum on gfx11 */
|
|
|
|
|
#define INTEL_DEVICE_MAX_EUS_PER_SUBSLICE (16) /* Maximum on gfx12 */
|
2021-06-08 23:53:54 +00:00
|
|
|
#define INTEL_DEVICE_MAX_PIXEL_PIPES (16) /* Maximum on DG2 */
|
2018-03-14 13:16:01 +00:00
|
|
|
|
2021-10-26 01:03:07 -07:00
|
|
|
#define INTEL_PLATFORM_GROUP_START(group, new_enum) \
|
|
|
|
|
new_enum, INTEL_PLATFORM_ ## group ## _START = new_enum
|
|
|
|
|
#define INTEL_PLATFORM_GROUP_END(group, new_enum) \
|
|
|
|
|
new_enum, INTEL_PLATFORM_ ## group ## _END = new_enum
|
|
|
|
|
|
2021-09-22 15:06:58 +03:00
|
|
|
enum intel_platform {
|
|
|
|
|
INTEL_PLATFORM_GFX3 = 1,
|
|
|
|
|
INTEL_PLATFORM_I965,
|
|
|
|
|
INTEL_PLATFORM_ILK,
|
|
|
|
|
INTEL_PLATFORM_G4X,
|
|
|
|
|
INTEL_PLATFORM_SNB,
|
|
|
|
|
INTEL_PLATFORM_IVB,
|
|
|
|
|
INTEL_PLATFORM_BYT,
|
|
|
|
|
INTEL_PLATFORM_HSW,
|
|
|
|
|
INTEL_PLATFORM_BDW,
|
|
|
|
|
INTEL_PLATFORM_CHV,
|
|
|
|
|
INTEL_PLATFORM_SKL,
|
|
|
|
|
INTEL_PLATFORM_BXT,
|
|
|
|
|
INTEL_PLATFORM_KBL,
|
|
|
|
|
INTEL_PLATFORM_GLK,
|
|
|
|
|
INTEL_PLATFORM_CFL,
|
|
|
|
|
INTEL_PLATFORM_ICL,
|
|
|
|
|
INTEL_PLATFORM_EHL,
|
|
|
|
|
INTEL_PLATFORM_TGL,
|
|
|
|
|
INTEL_PLATFORM_RKL,
|
|
|
|
|
INTEL_PLATFORM_DG1,
|
|
|
|
|
INTEL_PLATFORM_ADL,
|
2021-08-03 13:39:12 -07:00
|
|
|
INTEL_PLATFORM_RPL,
|
2021-10-26 01:03:07 -07:00
|
|
|
INTEL_PLATFORM_GROUP_START(DG2, INTEL_PLATFORM_DG2_G10),
|
2021-11-08 14:18:49 -08:00
|
|
|
INTEL_PLATFORM_DG2_G11,
|
|
|
|
|
INTEL_PLATFORM_GROUP_END(DG2, INTEL_PLATFORM_DG2_G12),
|
2021-11-08 14:20:24 -08:00
|
|
|
INTEL_PLATFORM_GROUP_START(MTL, INTEL_PLATFORM_MTL_M),
|
|
|
|
|
INTEL_PLATFORM_GROUP_END(MTL, INTEL_PLATFORM_MTL_P),
|
2021-09-22 15:06:58 +03:00
|
|
|
};
|
|
|
|
|
|
2021-10-26 01:03:07 -07:00
|
|
|
#undef INTEL_PLATFORM_GROUP_START
|
|
|
|
|
#undef INTEL_PLATFORM_GROUP_END
|
|
|
|
|
|
|
|
|
|
#define intel_platform_in_range(platform, platform_range) \
|
|
|
|
|
(((platform) >= INTEL_PLATFORM_ ## platform_range ## _START) && \
|
|
|
|
|
((platform) <= INTEL_PLATFORM_ ## platform_range ## _END))
|
|
|
|
|
|
|
|
|
|
#define intel_device_info_is_dg2(devinfo) \
|
|
|
|
|
intel_platform_in_range((devinfo)->platform, DG2)
|
|
|
|
|
|
2021-11-08 14:20:24 -08:00
|
|
|
#define intel_device_info_is_mtl(devinfo) \
|
|
|
|
|
intel_platform_in_range((devinfo)->platform, MTL)
|
|
|
|
|
|
2015-10-29 16:11:54 -07:00
|
|
|
/**
|
|
|
|
|
* Intel hardware information and quirks
|
|
|
|
|
*/
|
2021-04-05 13:19:39 -07:00
|
|
|
struct intel_device_info
|
2013-07-04 12:11:36 -07:00
|
|
|
{
|
2021-03-29 14:41:58 -07:00
|
|
|
/* Driver internal numbers used to differentiate platforms. */
|
|
|
|
|
int ver;
|
2021-03-29 13:43:47 -07:00
|
|
|
int verx10;
|
2021-09-16 15:39:11 -07:00
|
|
|
int display_ver;
|
2022-01-05 16:48:28 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This revision is from ioctl (I915_PARAM_REVISION) unlike
|
|
|
|
|
* pci_revision_id from drm device. Its value is not always
|
|
|
|
|
* same as the pci_revision_id.
|
|
|
|
|
*/
|
2018-05-27 20:36:49 +01:00
|
|
|
int revision;
|
2013-07-04 12:11:36 -07:00
|
|
|
int gt;
|
|
|
|
|
|
2022-01-05 16:48:28 -08:00
|
|
|
/* PCI info */
|
|
|
|
|
uint16_t pci_domain;
|
|
|
|
|
uint8_t pci_bus;
|
|
|
|
|
uint8_t pci_dev;
|
|
|
|
|
uint8_t pci_func;
|
|
|
|
|
uint16_t pci_device_id;
|
|
|
|
|
uint8_t pci_revision_id;
|
|
|
|
|
|
2021-09-22 15:06:58 +03:00
|
|
|
enum intel_platform platform;
|
2013-07-04 12:11:36 -07:00
|
|
|
|
|
|
|
|
bool has_hiz_and_separate_stencil;
|
|
|
|
|
bool must_use_separate_stencil;
|
2018-02-14 14:30:27 -08:00
|
|
|
bool has_sample_with_hiz;
|
2021-11-02 15:49:27 -05:00
|
|
|
bool has_bit6_swizzle;
|
2013-07-04 12:11:36 -07:00
|
|
|
bool has_llc;
|
2013-09-25 17:01:55 -07:00
|
|
|
|
2013-09-26 11:55:36 -07:00
|
|
|
bool has_pln;
|
2020-01-13 11:17:27 -08:00
|
|
|
bool has_64bit_float;
|
2022-12-02 10:55:48 -08:00
|
|
|
bool has_64bit_float_via_math_pipe;
|
2020-01-13 11:17:27 -08:00
|
|
|
bool has_64bit_int;
|
2017-10-23 10:44:39 -07:00
|
|
|
bool has_integer_dword_mul;
|
2013-09-26 11:55:36 -07:00
|
|
|
bool has_compr4;
|
|
|
|
|
bool has_surface_tile_offset;
|
2015-04-16 17:52:03 -07:00
|
|
|
bool supports_simd16_3src;
|
2019-06-27 09:54:34 -07:00
|
|
|
bool disable_ccs_repack;
|
2021-11-28 01:06:16 -08:00
|
|
|
|
2022-11-30 14:47:47 -08:00
|
|
|
/**
|
|
|
|
|
* True if CCS needs to be initialized before use.
|
|
|
|
|
*/
|
|
|
|
|
bool has_illegal_ccs_values;
|
|
|
|
|
|
2021-11-28 01:06:16 -08:00
|
|
|
/**
|
|
|
|
|
* True if CCS uses a flat virtual address translation to a memory
|
|
|
|
|
* carve-out, rather than aux map translations, or additional surfaces.
|
|
|
|
|
*/
|
|
|
|
|
bool has_flat_ccs;
|
2019-10-21 17:16:05 +03:00
|
|
|
bool has_aux_map;
|
2022-07-18 22:55:15 -07:00
|
|
|
bool has_caching_uapi;
|
2020-06-03 17:19:50 +00:00
|
|
|
bool has_tiling_uapi;
|
2020-10-21 15:04:11 -05:00
|
|
|
bool has_ray_tracing;
|
2021-06-08 16:24:54 +03:00
|
|
|
bool has_ray_query;
|
2019-10-02 17:37:33 -07:00
|
|
|
bool has_local_mem;
|
2021-06-24 15:13:57 -05:00
|
|
|
bool has_lsc;
|
2021-07-07 12:41:57 -07:00
|
|
|
bool has_mesh_shading;
|
2022-10-06 10:04:32 -07:00
|
|
|
bool has_mmap_offset;
|
2022-10-06 10:15:54 -07:00
|
|
|
bool has_userptr_probe;
|
2022-10-06 10:33:24 -07:00
|
|
|
bool has_context_isolation;
|
2013-09-26 11:55:36 -07:00
|
|
|
|
2013-09-26 11:36:42 -07:00
|
|
|
/**
|
2015-10-29 12:12:40 -07:00
|
|
|
* \name Intel hardware quirks
|
2013-09-26 11:36:42 -07:00
|
|
|
* @{
|
|
|
|
|
*/
|
|
|
|
|
bool has_negative_rhw_bug;
|
|
|
|
|
|
2020-11-06 16:17:16 +02:00
|
|
|
/**
|
|
|
|
|
* Whether this platform supports fragment shading rate controlled by a
|
|
|
|
|
* primitive in geometry shaders and by a control buffer.
|
|
|
|
|
*/
|
|
|
|
|
bool has_coarse_pixel_primitive_and_cb;
|
|
|
|
|
|
2013-09-26 11:36:42 -07:00
|
|
|
/**
|
|
|
|
|
* Some versions of Gen hardware don't do centroid interpolation correctly
|
|
|
|
|
* on unlit pixels, causing incorrect values for derivatives near triangle
|
|
|
|
|
* edges. Enabling this flag causes the fragment shader to use
|
|
|
|
|
* non-centroid interpolation for unlit pixels, at the expense of two extra
|
|
|
|
|
* fragment shader instructions.
|
|
|
|
|
*/
|
|
|
|
|
bool needs_unlit_centroid_workaround;
|
|
|
|
|
/** @} */
|
|
|
|
|
|
2013-09-25 17:01:55 -07:00
|
|
|
/**
|
2015-10-29 12:12:40 -07:00
|
|
|
* \name GPU hardware limits
|
2015-10-29 16:11:54 -07:00
|
|
|
*
|
|
|
|
|
* In general, you can find shader thread maximums by looking at the "Maximum
|
|
|
|
|
* Number of Threads" field in the Intel PRM description of the 3DSTATE_VS,
|
|
|
|
|
* 3DSTATE_GS, 3DSTATE_HS, 3DSTATE_DS, and 3DSTATE_PS commands. URB entry
|
Remove wrongly repeated words in comments
Clean up misrepetitions ('if if', 'the the' etc) found throughout the
comments. This has been done manually, after grepping
case-insensitively for duplicate if, is, the, then, do, for, an,
plus a few other typos corrected in fly-by
v2:
* proper commit message and non-joke title;
* replace two 'as is' followed by 'is' to 'as-is'.
v3:
* 'a integer' => 'an integer' and similar (originally spotted by
Jason Ekstrand, I fixed a few other similar ones while at it)
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2016-06-23 19:20:18 +02:00
|
|
|
* limits come from the "Number of URB Entries" field in the
|
2015-10-29 16:11:54 -07:00
|
|
|
* 3DSTATE_URB_VS command and friends.
|
|
|
|
|
*
|
|
|
|
|
* These fields are used to calculate the scratch space to allocate. The
|
|
|
|
|
* amount of scratch space can be larger without being harmful on modern
|
|
|
|
|
* GPUs, however, prior to Haswell, programming the maximum number of threads
|
|
|
|
|
* to greater than the hardware maximum would cause GPU performance to tank.
|
|
|
|
|
*
|
2013-09-25 17:01:55 -07:00
|
|
|
* @{
|
|
|
|
|
*/
|
2015-11-25 15:15:20 +02:00
|
|
|
/**
|
|
|
|
|
* Total number of slices present on the device whether or not they've been
|
|
|
|
|
* fused off.
|
2016-02-08 18:00:41 -08:00
|
|
|
*
|
|
|
|
|
* XXX: CS thread counts are limited by the inability to do cross subslice
|
|
|
|
|
* communication. It is the effectively the number of logical threads which
|
|
|
|
|
* can be executed in a subslice. Fuse configurations may cause this number
|
|
|
|
|
* to change, so we program @max_cs_threads as the lower maximum.
|
2015-11-25 15:15:20 +02:00
|
|
|
*/
|
|
|
|
|
unsigned num_slices;
|
2017-06-15 23:48:49 +01:00
|
|
|
|
2021-04-03 13:28:50 +03:00
|
|
|
/**
|
|
|
|
|
* Maximum number of slices present on this device (can be more than
|
|
|
|
|
* num_slices if some slices are fused).
|
|
|
|
|
*/
|
|
|
|
|
unsigned max_slices;
|
|
|
|
|
|
2017-06-21 17:44:17 +01:00
|
|
|
/**
|
|
|
|
|
* Number of subslices for each slice (used to be uniform until CNL).
|
|
|
|
|
*/
|
2021-04-07 14:23:21 -07:00
|
|
|
unsigned num_subslices[INTEL_DEVICE_MAX_SLICES];
|
2017-06-21 17:44:17 +01:00
|
|
|
|
2021-04-03 13:28:50 +03:00
|
|
|
/**
|
|
|
|
|
* Maximum number of subslices per slice present on this device (can be
|
|
|
|
|
* more than the maximum value in the num_subslices[] array if some
|
|
|
|
|
* subslices are fused).
|
|
|
|
|
*/
|
|
|
|
|
unsigned max_subslices_per_slice;
|
|
|
|
|
|
2019-07-01 13:34:08 -07:00
|
|
|
/**
|
|
|
|
|
* Number of subslices on each pixel pipe (ICL).
|
|
|
|
|
*/
|
2021-04-05 14:29:06 -07:00
|
|
|
unsigned ppipe_subslices[INTEL_DEVICE_MAX_PIXEL_PIPES];
|
2019-07-01 13:34:08 -07:00
|
|
|
|
2018-03-14 13:15:12 +00:00
|
|
|
/**
|
2021-06-25 11:23:23 +03:00
|
|
|
* Maximum number of EUs per subslice (some EUs can be fused off).
|
2018-03-14 13:15:12 +00:00
|
|
|
*/
|
2021-06-25 11:23:23 +03:00
|
|
|
unsigned max_eus_per_subslice;
|
2021-04-03 13:28:50 +03:00
|
|
|
|
2017-06-15 23:48:49 +01:00
|
|
|
/**
|
|
|
|
|
* Number of threads per eu, varies between 4 and 8 between generations.
|
|
|
|
|
*/
|
|
|
|
|
unsigned num_thread_per_eu;
|
|
|
|
|
|
2018-03-14 13:16:01 +00:00
|
|
|
/**
|
|
|
|
|
* A bit mask of the slices available.
|
|
|
|
|
*/
|
|
|
|
|
uint8_t slice_masks;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* An array of bit mask of the subslices available, use subslice_slice_stride
|
|
|
|
|
* to access this array.
|
|
|
|
|
*/
|
2021-04-05 14:29:06 -07:00
|
|
|
uint8_t subslice_masks[INTEL_DEVICE_MAX_SLICES *
|
|
|
|
|
DIV_ROUND_UP(INTEL_DEVICE_MAX_SUBSLICES, 8)];
|
2018-03-14 13:16:01 +00:00
|
|
|
|
2021-09-08 16:20:24 -07:00
|
|
|
/**
|
|
|
|
|
* The number of enabled subslices (considering fusing). For exactly which
|
|
|
|
|
* subslices are enabled, see subslice_masks[].
|
|
|
|
|
*/
|
|
|
|
|
unsigned subslice_total;
|
|
|
|
|
|
2018-03-14 13:16:01 +00:00
|
|
|
/**
|
|
|
|
|
* An array of bit mask of EUs available, use eu_slice_stride &
|
|
|
|
|
* eu_subslice_stride to access this array.
|
|
|
|
|
*/
|
2021-04-05 14:29:06 -07:00
|
|
|
uint8_t eu_masks[INTEL_DEVICE_MAX_SLICES *
|
|
|
|
|
INTEL_DEVICE_MAX_SUBSLICES *
|
|
|
|
|
DIV_ROUND_UP(INTEL_DEVICE_MAX_EUS_PER_SUBSLICE, 8)];
|
2018-03-14 13:16:01 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Stride to access subslice_masks[].
|
|
|
|
|
*/
|
|
|
|
|
uint16_t subslice_slice_stride;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Strides to access eu_masks[].
|
|
|
|
|
*/
|
|
|
|
|
uint16_t eu_slice_stride;
|
|
|
|
|
uint16_t eu_subslice_stride;
|
|
|
|
|
|
2017-06-01 09:28:04 -07:00
|
|
|
unsigned l3_banks;
|
2015-10-29 16:11:54 -07:00
|
|
|
unsigned max_vs_threads; /**< Maximum Vertex Shader threads */
|
2016-10-03 10:39:28 +11:00
|
|
|
unsigned max_tcs_threads; /**< Maximum Hull Shader threads */
|
2016-10-03 10:39:29 +11:00
|
|
|
unsigned max_tes_threads; /**< Maximum Domain Shader threads */
|
2015-10-29 16:11:54 -07:00
|
|
|
unsigned max_gs_threads; /**< Maximum Geometry Shader threads. */
|
|
|
|
|
/**
|
|
|
|
|
* Theoretical maximum number of Pixel Shader threads.
|
|
|
|
|
*
|
|
|
|
|
* PSD means Pixel Shader Dispatcher. On modern Intel GPUs, hardware will
|
|
|
|
|
* automatically scale pixel shader thread count, based on a single value
|
|
|
|
|
* programmed into 3DSTATE_PS.
|
|
|
|
|
*
|
2021-03-29 15:46:12 -07:00
|
|
|
* To calculate the maximum number of threads for Gfx8 beyond (which have
|
2015-10-29 16:11:54 -07:00
|
|
|
* multiple Pixel Shader Dispatchers):
|
|
|
|
|
*
|
|
|
|
|
* - Look up 3DSTATE_PS and find "Maximum Number of Threads Per PSD"
|
|
|
|
|
* - Usually there's only one PSD per subslice, so use the number of
|
|
|
|
|
* subslices for number of PSDs.
|
|
|
|
|
* - For max_wm_threads, the total should be PSD threads * #PSDs.
|
|
|
|
|
*/
|
2013-09-25 17:01:55 -07:00
|
|
|
unsigned max_wm_threads;
|
2015-10-29 16:11:54 -07:00
|
|
|
|
2021-11-01 17:20:20 -07:00
|
|
|
unsigned max_threads_per_psd;
|
|
|
|
|
|
2015-10-29 16:11:54 -07:00
|
|
|
/**
|
|
|
|
|
* Maximum Compute Shader threads.
|
|
|
|
|
*
|
|
|
|
|
* Thread count * number of EUs per subslice
|
|
|
|
|
*/
|
2015-03-13 16:42:40 -07:00
|
|
|
unsigned max_cs_threads;
|
2013-09-25 17:01:55 -07:00
|
|
|
|
2021-07-13 18:21:43 -05:00
|
|
|
/**
|
|
|
|
|
* Maximum number of threads per workgroup supported by the GPGPU_WALKER or
|
|
|
|
|
* COMPUTE_WALKER command.
|
|
|
|
|
*
|
|
|
|
|
* This may be smaller than max_cs_threads as it takes into account added
|
|
|
|
|
* restrictions on the GPGPU/COMPUTE_WALKER commands. While max_cs_threads
|
|
|
|
|
* expresses the total parallelism of the GPU, this expresses the maximum
|
|
|
|
|
* number of threads we can dispatch in a single workgroup.
|
|
|
|
|
*/
|
|
|
|
|
unsigned max_cs_workgroup_threads;
|
|
|
|
|
|
2021-09-08 16:54:57 -07:00
|
|
|
/**
|
|
|
|
|
* The maximum number of potential scratch ids. Due to hardware
|
|
|
|
|
* implementation details, the range of scratch ids may be larger than the
|
|
|
|
|
* number of subslices.
|
|
|
|
|
*/
|
|
|
|
|
unsigned max_scratch_ids[MESA_SHADER_STAGES];
|
|
|
|
|
|
2013-09-25 17:01:55 -07:00
|
|
|
struct {
|
2015-11-25 14:51:16 +02:00
|
|
|
/**
|
2020-05-08 12:51:11 -07:00
|
|
|
* Fixed size of the URB.
|
2015-10-29 16:11:54 -07:00
|
|
|
*
|
2021-03-29 15:46:12 -07:00
|
|
|
* On Gfx6 and DG1, this is measured in KB. Gfx4-5 instead measure
|
2020-05-08 12:51:11 -07:00
|
|
|
* this in 512b blocks, as that's more convenient there.
|
2015-10-29 16:11:54 -07:00
|
|
|
*
|
2021-03-29 15:46:12 -07:00
|
|
|
* On most Gfx7+ platforms, the URB is a section of the L3 cache,
|
2020-05-08 12:51:11 -07:00
|
|
|
* and can be resized based on the L3 programming. For those platforms,
|
|
|
|
|
* simply leave this field blank (zero) - it isn't used.
|
2015-11-25 14:51:16 +02:00
|
|
|
*/
|
2013-09-25 17:01:55 -07:00
|
|
|
unsigned size;
|
2016-11-15 00:07:35 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The minimum number of URB entries. See the 3DSTATE_URB_<XS> docs.
|
|
|
|
|
*/
|
|
|
|
|
unsigned min_entries[4];
|
2016-11-14 23:45:16 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The maximum number of URB entries. See the 3DSTATE_URB_<XS> docs.
|
|
|
|
|
*/
|
|
|
|
|
unsigned max_entries[4];
|
2013-09-25 17:01:55 -07:00
|
|
|
} urb;
|
2016-10-27 22:08:19 +01:00
|
|
|
|
2021-09-23 22:59:40 -07:00
|
|
|
/* Maximum size in Kb that can be allocated to constants in the URB, this
|
|
|
|
|
* is usually divided among the stages for implementing push constants.
|
|
|
|
|
* See 3DSTATE_PUSH_CONSTANT_ALLOC_*.
|
|
|
|
|
*/
|
|
|
|
|
unsigned max_constant_urb_size_kb;
|
|
|
|
|
|
2021-03-18 11:03:35 +02:00
|
|
|
/**
|
|
|
|
|
* Size of the command streamer prefetch. This is important to know for
|
|
|
|
|
* self modifying batches.
|
|
|
|
|
*/
|
2022-10-05 12:46:31 -07:00
|
|
|
unsigned engine_class_prefetch[INTEL_ENGINE_CLASS_COMPUTE + 1];
|
2021-03-18 11:03:35 +02:00
|
|
|
|
2016-10-27 22:08:19 +01:00
|
|
|
/**
|
|
|
|
|
* For the longest time the timestamp frequency for Gen's timestamp counter
|
|
|
|
|
* could be assumed to be 12.5MHz, where the least significant bit neatly
|
|
|
|
|
* corresponded to 80 nanoseconds.
|
|
|
|
|
*
|
2021-03-29 15:46:12 -07:00
|
|
|
* Since Gfx9 the numbers aren't so round, with a a frequency of 12MHz for
|
2017-06-15 15:22:19 +01:00
|
|
|
* SKL (or scale factor of 83.33333333) and a frequency of 19200000Hz for
|
2016-10-27 22:08:19 +01:00
|
|
|
* BXT.
|
|
|
|
|
*
|
2022-06-22 18:31:08 +02:00
|
|
|
* For simplicity to fit with the current code scaling by a single constant
|
2016-10-27 22:08:19 +01:00
|
|
|
* to map from raw timestamps to nanoseconds we now do the conversion in
|
|
|
|
|
* floating point instead of integer arithmetic.
|
|
|
|
|
*
|
|
|
|
|
* In general it's probably worth noting that the documented constants we
|
|
|
|
|
* have for the per-platform timestamp frequencies aren't perfect and
|
|
|
|
|
* shouldn't be trusted for scaling and comparing timestamps with a large
|
|
|
|
|
* delta.
|
|
|
|
|
*
|
|
|
|
|
* E.g. with crude testing on my system using the 'correct' scale factor I'm
|
|
|
|
|
* seeing a drift of ~2 milliseconds per second.
|
|
|
|
|
*/
|
2017-06-15 15:22:19 +01:00
|
|
|
uint64_t timestamp_frequency;
|
2016-10-27 22:08:19 +01:00
|
|
|
|
2020-05-14 11:44:29 -07:00
|
|
|
uint64_t aperture_bytes;
|
2021-11-03 08:59:53 -05:00
|
|
|
uint64_t gtt_size;
|
2020-05-14 11:44:29 -07:00
|
|
|
|
2018-06-16 23:22:00 +01:00
|
|
|
/**
|
|
|
|
|
* ID to put into the .aub files.
|
|
|
|
|
*/
|
|
|
|
|
int simulator_id;
|
|
|
|
|
|
2021-07-13 17:56:01 -05:00
|
|
|
/**
|
|
|
|
|
* holds the name of the device
|
|
|
|
|
*/
|
|
|
|
|
char name[INTEL_DEVICE_MAX_NAME_SIZE];
|
|
|
|
|
|
2019-07-24 13:48:03 -07:00
|
|
|
/**
|
2022-01-10 11:59:10 -08:00
|
|
|
* no_hw is true when the pci_device_id has been overridden
|
2019-07-24 13:48:03 -07:00
|
|
|
*/
|
|
|
|
|
bool no_hw;
|
2022-01-08 00:01:55 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* apply_hwconfig is true when the platform should apply hwconfig values
|
|
|
|
|
*/
|
|
|
|
|
bool apply_hwconfig;
|
2022-05-16 02:19:48 -07:00
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
bool use_class_instance;
|
|
|
|
|
struct {
|
|
|
|
|
uint16_t mem_class;
|
|
|
|
|
uint16_t mem_instance;
|
|
|
|
|
struct {
|
|
|
|
|
uint64_t size;
|
|
|
|
|
uint64_t free;
|
2022-06-10 18:10:27 -07:00
|
|
|
} mappable, unmappable;
|
2022-05-16 02:19:48 -07:00
|
|
|
} sram, vram;
|
|
|
|
|
} mem;
|
2013-09-25 17:01:55 -07:00
|
|
|
/** @} */
|
2013-07-04 12:11:36 -07:00
|
|
|
};
|
|
|
|
|
|
2021-03-16 10:14:30 -07:00
|
|
|
#ifdef GFX_VER
|
2020-01-06 02:05:21 -08:00
|
|
|
|
2021-04-05 13:19:39 -07:00
|
|
|
#define intel_device_info_is_9lp(devinfo) \
|
2021-09-22 15:06:58 +03:00
|
|
|
(GFX_VER == 9 && ((devinfo)->platform == INTEL_PLATFORM_BXT || \
|
|
|
|
|
(devinfo)->platform == INTEL_PLATFORM_GLK))
|
2020-01-06 02:05:21 -08:00
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
2021-04-05 13:19:39 -07:00
|
|
|
#define intel_device_info_is_9lp(devinfo) \
|
2021-09-22 15:06:58 +03:00
|
|
|
((devinfo)->platform == INTEL_PLATFORM_BXT || \
|
|
|
|
|
(devinfo)->platform == INTEL_PLATFORM_GLK)
|
2017-06-20 11:06:24 +01:00
|
|
|
|
2020-01-06 02:05:21 -08:00
|
|
|
#endif
|
|
|
|
|
|
2021-06-23 18:26:28 +03:00
|
|
|
static inline bool
|
|
|
|
|
intel_device_info_slice_available(const struct intel_device_info *devinfo,
|
|
|
|
|
int slice)
|
|
|
|
|
{
|
|
|
|
|
assert(slice < INTEL_DEVICE_MAX_SLICES);
|
|
|
|
|
return (devinfo->slice_masks & (1U << slice)) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
2018-02-21 19:15:46 +00:00
|
|
|
static inline bool
|
2021-04-05 13:19:39 -07:00
|
|
|
intel_device_info_subslice_available(const struct intel_device_info *devinfo,
|
2021-04-12 20:17:16 -07:00
|
|
|
int slice, int subslice)
|
2018-02-21 19:15:46 +00:00
|
|
|
{
|
|
|
|
|
return (devinfo->subslice_masks[slice * devinfo->subslice_slice_stride +
|
|
|
|
|
subslice / 8] & (1U << (subslice % 8))) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-01 13:05:20 +03:00
|
|
|
static inline bool
|
2021-04-05 13:19:39 -07:00
|
|
|
intel_device_info_eu_available(const struct intel_device_info *devinfo,
|
2021-04-12 20:17:16 -07:00
|
|
|
int slice, int subslice, int eu)
|
2020-10-01 13:05:20 +03:00
|
|
|
{
|
|
|
|
|
unsigned subslice_offset = slice * devinfo->eu_slice_stride +
|
|
|
|
|
subslice * devinfo->eu_subslice_stride;
|
|
|
|
|
|
|
|
|
|
return (devinfo->eu_masks[subslice_offset + eu / 8] & (1U << eu % 8)) != 0;
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-03 11:41:06 +02:00
|
|
|
static inline uint32_t
|
2021-04-03 13:28:50 +03:00
|
|
|
intel_device_info_subslice_total(const struct intel_device_info *devinfo)
|
|
|
|
|
{
|
|
|
|
|
uint32_t total = 0;
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < ARRAY_SIZE(devinfo->subslice_masks); i++) {
|
|
|
|
|
total += __builtin_popcount(devinfo->subslice_masks[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return total;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline uint32_t
|
2021-04-05 13:19:39 -07:00
|
|
|
intel_device_info_eu_total(const struct intel_device_info *devinfo)
|
2021-02-03 11:41:06 +02:00
|
|
|
{
|
|
|
|
|
uint32_t total = 0;
|
|
|
|
|
|
2021-04-12 14:27:25 +03:00
|
|
|
for (size_t i = 0; i < ARRAY_SIZE(devinfo->eu_masks); i++)
|
2021-02-03 11:41:06 +02:00
|
|
|
total += __builtin_popcount(devinfo->eu_masks[i]);
|
|
|
|
|
|
|
|
|
|
return total;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-19 14:55:39 +03:00
|
|
|
/**
|
|
|
|
|
* Computes the bound of dualsubslice ID that can be used on this device.
|
|
|
|
|
*
|
|
|
|
|
* You should use this number if you're going to make calculation based on the
|
|
|
|
|
* slice/dualsubslice ID provided by the SR0.0 EU register. The maximum
|
|
|
|
|
* dualsubslice ID can be superior to the total number of dualsubslices on the
|
|
|
|
|
* device, depending on fusing.
|
|
|
|
|
*
|
|
|
|
|
* On a 16 dualsubslice GPU, the maximum dualsubslice ID is 15. This function
|
|
|
|
|
* would return the exclusive bound : 16.
|
|
|
|
|
*/
|
2020-08-06 12:53:47 -05:00
|
|
|
static inline unsigned
|
2021-08-19 14:55:39 +03:00
|
|
|
intel_device_info_dual_subslice_id_bound(const struct intel_device_info *devinfo)
|
2020-08-06 12:53:47 -05:00
|
|
|
{
|
2021-08-19 14:55:39 +03:00
|
|
|
/* Start from the last slice/subslice so we find the answer faster. */
|
|
|
|
|
for (int s = devinfo->max_slices - 1; s >= 0; s--) {
|
|
|
|
|
for (int ss = devinfo->max_subslices_per_slice - 1; ss >= 0; ss--) {
|
|
|
|
|
if (intel_device_info_subslice_available(devinfo, s, ss))
|
|
|
|
|
return s * devinfo->max_subslices_per_slice + ss + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
unreachable("Invalid topology");
|
|
|
|
|
return 0;
|
2020-08-06 12:53:47 -05:00
|
|
|
}
|
|
|
|
|
|
2021-04-05 13:19:39 -07:00
|
|
|
int intel_device_name_to_pci_device_id(const char *name);
|
2016-10-11 18:26:22 +01:00
|
|
|
|
2018-06-08 17:51:33 +01:00
|
|
|
static inline uint64_t
|
2021-04-05 13:19:39 -07:00
|
|
|
intel_device_info_timebase_scale(const struct intel_device_info *devinfo,
|
2021-04-12 20:17:16 -07:00
|
|
|
uint64_t gpu_timestamp)
|
2018-06-08 17:51:33 +01:00
|
|
|
{
|
2021-11-23 00:44:06 +02:00
|
|
|
/* Try to avoid going over the 64bits when doing the scaling */
|
|
|
|
|
uint64_t upper_ts = gpu_timestamp >> 32;
|
|
|
|
|
uint64_t lower_ts = gpu_timestamp & 0xffffffff;
|
|
|
|
|
uint64_t upper_scaled_ts = upper_ts * 1000000000ull / devinfo->timestamp_frequency;
|
|
|
|
|
uint64_t lower_scaled_ts = lower_ts * 1000000000ull / devinfo->timestamp_frequency;
|
|
|
|
|
return (upper_scaled_ts << 32) + lower_scaled_ts;
|
2018-06-08 17:51:33 +01:00
|
|
|
}
|
|
|
|
|
|
2022-05-16 03:02:01 -07:00
|
|
|
static inline bool
|
|
|
|
|
intel_vram_all_mappable(const struct intel_device_info *devinfo)
|
|
|
|
|
{
|
|
|
|
|
return devinfo->mem.vram.unmappable.size == 0;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-05 15:59:35 -07:00
|
|
|
bool intel_get_device_info_from_fd(int fh, struct intel_device_info *devinfo);
|
|
|
|
|
bool intel_get_device_info_from_pci_id(int pci_id,
|
|
|
|
|
struct intel_device_info *devinfo);
|
2019-07-24 13:48:03 -07:00
|
|
|
|
2022-06-15 10:28:07 +03:00
|
|
|
/* Only updates intel_device_info::regions::...::free fields. The
|
|
|
|
|
* class/instance/size should remain the same over time.
|
|
|
|
|
*/
|
|
|
|
|
bool intel_device_info_update_memory_info(struct intel_device_info *devinfo,
|
|
|
|
|
int fd);
|
|
|
|
|
|
2017-09-27 20:57:28 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-04-05 11:47:31 -07:00
|
|
|
#endif /* INTEL_DEVICE_INFO_H */
|