2017-12-22 05:57:32 +08:00
|
|
|
/*
|
|
|
|
* Copyright © 2014-2017 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INTEL_DEVICE_INFO_H_
|
|
|
|
#define _INTEL_DEVICE_INFO_H_
|
|
|
|
|
2018-09-27 04:12:22 +08:00
|
|
|
#include <uapi/drm/i915_drm.h>
|
|
|
|
|
2021-03-26 21:21:33 +08:00
|
|
|
#include "intel_step.h"
|
|
|
|
|
2019-06-13 16:44:16 +08:00
|
|
|
#include "display/intel_display.h"
|
|
|
|
|
2019-04-25 01:48:39 +08:00
|
|
|
#include "gt/intel_engine_types.h"
|
|
|
|
#include "gt/intel_context_types.h"
|
|
|
|
#include "gt/intel_sseu.h"
|
|
|
|
|
2017-12-22 05:57:32 +08:00
|
|
|
struct drm_printer;
|
|
|
|
struct drm_i915_private;
|
|
|
|
|
|
|
|
/* Keep in gen based order, and chronological order within a gen */
|
|
|
|
enum intel_platform {
|
|
|
|
INTEL_PLATFORM_UNINITIALIZED = 0,
|
|
|
|
/* gen2 */
|
|
|
|
INTEL_I830,
|
|
|
|
INTEL_I845G,
|
|
|
|
INTEL_I85X,
|
|
|
|
INTEL_I865G,
|
|
|
|
/* gen3 */
|
|
|
|
INTEL_I915G,
|
|
|
|
INTEL_I915GM,
|
|
|
|
INTEL_I945G,
|
|
|
|
INTEL_I945GM,
|
|
|
|
INTEL_G33,
|
|
|
|
INTEL_PINEVIEW,
|
|
|
|
/* gen4 */
|
|
|
|
INTEL_I965G,
|
|
|
|
INTEL_I965GM,
|
|
|
|
INTEL_G45,
|
|
|
|
INTEL_GM45,
|
|
|
|
/* gen5 */
|
|
|
|
INTEL_IRONLAKE,
|
|
|
|
/* gen6 */
|
|
|
|
INTEL_SANDYBRIDGE,
|
|
|
|
/* gen7 */
|
|
|
|
INTEL_IVYBRIDGE,
|
|
|
|
INTEL_VALLEYVIEW,
|
|
|
|
INTEL_HASWELL,
|
|
|
|
/* gen8 */
|
|
|
|
INTEL_BROADWELL,
|
|
|
|
INTEL_CHERRYVIEW,
|
|
|
|
/* gen9 */
|
|
|
|
INTEL_SKYLAKE,
|
|
|
|
INTEL_BROXTON,
|
|
|
|
INTEL_KABYLAKE,
|
|
|
|
INTEL_GEMINILAKE,
|
|
|
|
INTEL_COFFEELAKE,
|
2020-06-02 22:05:40 +08:00
|
|
|
INTEL_COMETLAKE,
|
2017-12-22 05:57:32 +08:00
|
|
|
/* gen10 */
|
|
|
|
INTEL_CANNONLAKE,
|
2018-01-12 02:00:04 +08:00
|
|
|
/* gen11 */
|
|
|
|
INTEL_ICELAKE,
|
2019-03-23 01:58:43 +08:00
|
|
|
INTEL_ELKHARTLAKE,
|
2020-10-14 03:29:48 +08:00
|
|
|
INTEL_JASPERLAKE,
|
2019-07-12 01:30:56 +08:00
|
|
|
/* gen12 */
|
|
|
|
INTEL_TIGERLAKE,
|
2020-05-05 06:52:06 +08:00
|
|
|
INTEL_ROCKETLAKE,
|
2020-07-14 02:23:17 +08:00
|
|
|
INTEL_DG1,
|
2021-01-20 03:29:31 +08:00
|
|
|
INTEL_ALDERLAKE_S,
|
2021-05-07 00:19:23 +08:00
|
|
|
INTEL_ALDERLAKE_P,
|
2017-12-22 05:57:32 +08:00
|
|
|
INTEL_MAX_PLATFORMS
|
|
|
|
};
|
|
|
|
|
2019-03-27 22:23:28 +08:00
|
|
|
/*
|
|
|
|
* Subplatform bits share the same namespace per parent platform. In other words
|
|
|
|
* it is fine for the same bit to be used on multiple parent platforms.
|
|
|
|
*/
|
|
|
|
|
2021-01-22 00:19:36 +08:00
|
|
|
#define INTEL_SUBPLATFORM_BITS (2)
|
|
|
|
#define INTEL_SUBPLATFORM_MASK (BIT(INTEL_SUBPLATFORM_BITS) - 1)
|
2019-03-27 22:23:28 +08:00
|
|
|
|
|
|
|
/* HSW/BDW/SKL/KBL/CFL */
|
|
|
|
#define INTEL_SUBPLATFORM_ULT (0)
|
|
|
|
#define INTEL_SUBPLATFORM_ULX (1)
|
|
|
|
|
|
|
|
/* CNL/ICL */
|
|
|
|
#define INTEL_SUBPLATFORM_PORTF (0)
|
|
|
|
|
2019-03-15 06:38:36 +08:00
|
|
|
enum intel_ppgtt_type {
|
2018-09-27 04:12:22 +08:00
|
|
|
INTEL_PPGTT_NONE = I915_GEM_PPGTT_NONE,
|
|
|
|
INTEL_PPGTT_ALIASING = I915_GEM_PPGTT_ALIASING,
|
|
|
|
INTEL_PPGTT_FULL = I915_GEM_PPGTT_FULL,
|
|
|
|
};
|
|
|
|
|
2017-12-22 05:57:32 +08:00
|
|
|
#define DEV_INFO_FOR_EACH_FLAG(func) \
|
|
|
|
func(is_mobile); \
|
|
|
|
func(is_lp); \
|
2019-05-06 21:48:01 +08:00
|
|
|
func(require_force_probe); \
|
2019-10-25 03:51:19 +08:00
|
|
|
func(is_dgfx); \
|
2017-12-22 05:57:32 +08:00
|
|
|
/* Keep has_* in alphabetical order */ \
|
|
|
|
func(has_64bit_reloc); \
|
2019-01-03 19:21:04 +08:00
|
|
|
func(gpu_reset_clobbers_display); \
|
2017-12-22 05:57:32 +08:00
|
|
|
func(has_reset_engine); \
|
2019-07-31 02:04:06 +08:00
|
|
|
func(has_global_mocs); \
|
2019-07-25 08:18:06 +08:00
|
|
|
func(has_gt_uc); \
|
2017-12-22 05:57:32 +08:00
|
|
|
func(has_l3_dpf); \
|
|
|
|
func(has_llc); \
|
|
|
|
func(has_logical_ring_contexts); \
|
2018-03-03 00:14:59 +08:00
|
|
|
func(has_logical_ring_elsq); \
|
2020-07-14 02:23:16 +08:00
|
|
|
func(has_master_unit_irq); \
|
2017-12-22 05:57:32 +08:00
|
|
|
func(has_pooled_eu); \
|
|
|
|
func(has_rc6); \
|
|
|
|
func(has_rc6p); \
|
2019-04-19 21:48:36 +08:00
|
|
|
func(has_rps); \
|
2017-12-22 05:57:32 +08:00
|
|
|
func(has_runtime_pm); \
|
|
|
|
func(has_snoop); \
|
2018-07-20 18:19:10 +08:00
|
|
|
func(has_coherent_ggtt); \
|
2017-12-22 05:57:32 +08:00
|
|
|
func(unfenced_needs_alignment); \
|
2018-12-01 07:20:48 +08:00
|
|
|
func(hws_needs_physical);
|
|
|
|
|
|
|
|
#define DEV_INFO_DISPLAY_FOR_EACH_FLAG(func) \
|
|
|
|
/* Keep in alphabetical order */ \
|
2017-12-22 05:57:32 +08:00
|
|
|
func(cursor_needs_physical); \
|
2018-12-01 07:20:48 +08:00
|
|
|
func(has_csr); \
|
|
|
|
func(has_ddi); \
|
|
|
|
func(has_dp_mst); \
|
2019-09-20 19:59:21 +08:00
|
|
|
func(has_dsb); \
|
2019-10-26 08:13:23 +08:00
|
|
|
func(has_dsc); \
|
2018-12-01 07:20:48 +08:00
|
|
|
func(has_fbc); \
|
2021-02-13 06:20:49 +08:00
|
|
|
func(has_fpga_dbg); \
|
2019-02-05 06:25:38 +08:00
|
|
|
func(has_gmch); \
|
2019-10-26 08:13:20 +08:00
|
|
|
func(has_hdcp); \
|
2018-12-01 07:20:48 +08:00
|
|
|
func(has_hotplug); \
|
2020-07-17 06:05:50 +08:00
|
|
|
func(has_hti); \
|
2018-12-01 07:20:48 +08:00
|
|
|
func(has_ipc); \
|
2019-07-12 13:57:05 +08:00
|
|
|
func(has_modular_fia); \
|
2018-12-01 07:20:48 +08:00
|
|
|
func(has_overlay); \
|
|
|
|
func(has_psr); \
|
2020-06-04 05:15:28 +08:00
|
|
|
func(has_psr_hw_tracking); \
|
2017-12-22 05:57:32 +08:00
|
|
|
func(overlay_needs_physical); \
|
2018-12-01 07:20:48 +08:00
|
|
|
func(supports_tv);
|
2017-12-22 05:57:32 +08:00
|
|
|
|
|
|
|
struct intel_device_info {
|
2021-04-13 13:09:54 +08:00
|
|
|
u8 graphics_ver;
|
|
|
|
u8 media_ver;
|
|
|
|
|
2017-12-22 05:57:32 +08:00
|
|
|
u8 gt; /* GT number, 0 if undefined */
|
2020-07-08 08:39:47 +08:00
|
|
|
intel_engine_mask_t platform_engine_mask; /* Engines supported by the HW */
|
2017-12-22 05:57:32 +08:00
|
|
|
|
|
|
|
enum intel_platform platform;
|
|
|
|
|
2020-04-18 03:51:07 +08:00
|
|
|
unsigned int dma_mask_size; /* available DMA address bits */
|
|
|
|
|
2019-03-15 06:38:36 +08:00
|
|
|
enum intel_ppgtt_type ppgtt_type;
|
|
|
|
unsigned int ppgtt_size; /* log2, e.g. 31/32/48 bits */
|
|
|
|
|
2018-02-22 19:16:58 +08:00
|
|
|
unsigned int page_sizes; /* page sizes supported by the HW */
|
2019-10-18 17:07:49 +08:00
|
|
|
|
|
|
|
u32 memory_regions; /* regions supported by the HW */
|
2018-02-22 19:16:58 +08:00
|
|
|
|
2017-12-22 05:57:32 +08:00
|
|
|
u32 display_mmio_offset;
|
|
|
|
|
2019-09-12 04:29:08 +08:00
|
|
|
u8 pipe_mask;
|
2020-03-19 01:02:35 +08:00
|
|
|
u8 cpu_transcoder_mask;
|
2017-12-22 05:57:32 +08:00
|
|
|
|
2020-06-06 10:57:34 +08:00
|
|
|
u8 abox_mask;
|
|
|
|
|
2017-12-22 05:57:32 +08:00
|
|
|
#define DEFINE_FLAG(name) u8 name:1
|
|
|
|
DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
|
|
|
|
#undef DEFINE_FLAG
|
2018-12-01 07:20:48 +08:00
|
|
|
|
|
|
|
struct {
|
2021-04-13 13:09:52 +08:00
|
|
|
u8 ver;
|
drm/i915: Add DISPLAY_VER() and related macros
Although we've long referred to platforms by a single "GEN" number, the
hardware teams have recommended that we stop doing this since the
various component IP blocks are going to start using independent number
schemes with varying cadence. To support this, hardware platforms a bit
down the road are going to start providing MMIO registers that the
driver can read to obtain the "graphics version," "media version," and
"display version" without needing to do a PCI ID -> platform -> version
translation.
Although our current platforms don't yet expose these registers (and the
next couple we release probably won't have them yet either), the
hardware teams would still like to see us move to this independent
numbering scheme now in preparation. For i915 that means we should try
to eliminate all usage of INTEL_GEN() throughout our code and instead
replace it with separate GRAPHICS_VER(), MEDIA_VER(), and DISPLAY_VER()
constructs in the code. For old platforms, these will all usually give
the same value for each IP block (aside from a few special cases like
GLK which we can no more accurately represent as graphics=9 +
display=10), but future platforms will have more flexibility to bump IP
version numbers independently.
The upcoming ADL-P platform will have a display version of 13 and a
graphics version of 12, so let's just the first step of breaking out
DISPLAY_VER(), but leaving the rest of INTEL_GEN() untouched for now.
For now we'll automatically derive the display version from the
platform's INTEL_GEN() value except in cases where an alternative
display version is explicitly provided in the device info structure.
We also add some helper macros IS_DISPLAY_VER(i915, ver) and
IS_DISPLAY_RANGE(i915, from, until) that match the behavior of the
existing gen-based macros. However unlike IS_GEN(), we will implement
those macros with direct comparisons rather than trying to maintain a
mask to help compiler optimization. In practice the optimization winds
up not being used in very many places (since the vast majority of our
platform checks are of the form "gen >= x") so there is pretty minimal
size reduction in the final driver binary[1]. We're also likely going
to need to extend these version numbers to non-integer major.minor
values at some point in the future, so the mask approach won't work at
all once we get to platforms like that.
[1] The results before/after the next patch in this series, which
switches our code over to the new display macros:
$ size i915.ko.{orig,new}
text data bss dec hex filename
2940291 102944 5384 3048619 2e84ab i915.ko.orig
2940723 102956 5384 3049063 2e8667 i915.ko.new
v2:
- Move version into device info's display sub-struct. (Jani)
- Add extra parentheses to macros. (Jani)
- Note the lack of genmask optimization in the display-based macros and
give size data. (Lucas)
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210320044245.3920043-3-matthew.d.roper@intel.com
2021-03-20 12:42:41 +08:00
|
|
|
|
2018-12-01 07:20:48 +08:00
|
|
|
#define DEFINE_FLAG(name) u8 name:1
|
|
|
|
DEV_INFO_DISPLAY_FOR_EACH_FLAG(DEFINE_FLAG);
|
|
|
|
#undef DEFINE_FLAG
|
|
|
|
} display;
|
|
|
|
|
2021-04-17 01:10:04 +08:00
|
|
|
struct {
|
|
|
|
u16 size; /* in blocks */
|
2021-04-17 01:10:06 +08:00
|
|
|
u8 slice_mask;
|
2021-04-17 01:10:04 +08:00
|
|
|
} dbuf;
|
2017-12-22 05:57:32 +08:00
|
|
|
|
|
|
|
/* Register offsets for the various display pipes and transcoders */
|
|
|
|
int pipe_offsets[I915_MAX_TRANSCODERS];
|
|
|
|
int trans_offsets[I915_MAX_TRANSCODERS];
|
|
|
|
int cursor_offsets[I915_MAX_PIPES];
|
|
|
|
|
2018-12-31 22:56:41 +08:00
|
|
|
struct color_luts {
|
2019-06-12 14:44:57 +08:00
|
|
|
u32 degamma_lut_size;
|
|
|
|
u32 gamma_lut_size;
|
2019-01-31 02:10:22 +08:00
|
|
|
u32 degamma_lut_tests;
|
|
|
|
u32 gamma_lut_tests;
|
2018-12-31 22:56:41 +08:00
|
|
|
} color;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct intel_runtime_info {
|
2019-03-27 22:23:28 +08:00
|
|
|
/*
|
|
|
|
* Platform mask is used for optimizing or-ed IS_PLATFORM calls into
|
|
|
|
* into single runtime conditionals, and also to provide groundwork
|
|
|
|
* for future per platform, or per SKU build optimizations.
|
|
|
|
*
|
|
|
|
* Array can be extended when necessary if the corresponding
|
|
|
|
* BUILD_BUG_ON is hit.
|
|
|
|
*/
|
|
|
|
u32 platform_mask[2];
|
|
|
|
|
2018-12-31 22:56:41 +08:00
|
|
|
u16 device_id;
|
|
|
|
|
|
|
|
u8 num_sprites[I915_MAX_PIPES];
|
|
|
|
u8 num_scalers[I915_MAX_PIPES];
|
|
|
|
|
2020-02-17 00:34:45 +08:00
|
|
|
u32 rawclk_freq;
|
2021-03-26 21:21:33 +08:00
|
|
|
|
2021-03-26 21:21:38 +08:00
|
|
|
struct intel_step_info step;
|
2017-12-22 05:57:32 +08:00
|
|
|
};
|
|
|
|
|
2018-02-08 05:05:43 +08:00
|
|
|
struct intel_driver_caps {
|
|
|
|
unsigned int scheduler;
|
2018-07-06 18:14:41 +08:00
|
|
|
bool has_logical_contexts:1;
|
2018-02-08 05:05:43 +08:00
|
|
|
};
|
|
|
|
|
2017-12-22 05:57:32 +08:00
|
|
|
const char *intel_platform_name(enum intel_platform platform);
|
|
|
|
|
2019-03-27 22:23:28 +08:00
|
|
|
void intel_device_info_subplatform_init(struct drm_i915_private *dev_priv);
|
2018-12-31 22:56:43 +08:00
|
|
|
void intel_device_info_runtime_init(struct drm_i915_private *dev_priv);
|
2019-12-08 02:29:37 +08:00
|
|
|
|
|
|
|
void intel_device_info_print_static(const struct intel_device_info *info,
|
2017-12-22 05:57:34 +08:00
|
|
|
struct drm_printer *p);
|
2019-12-08 02:29:37 +08:00
|
|
|
void intel_device_info_print_runtime(const struct intel_runtime_info *info,
|
2018-03-06 20:28:54 +08:00
|
|
|
struct drm_printer *p);
|
2017-12-22 05:57:32 +08:00
|
|
|
|
2018-02-08 05:05:43 +08:00
|
|
|
void intel_driver_caps_print(const struct intel_driver_caps *caps,
|
|
|
|
struct drm_printer *p);
|
|
|
|
|
2017-12-22 05:57:32 +08:00
|
|
|
#endif
|