2017-12-22 04:57:32 +07: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 03:12:22 +07:00
|
|
|
#include <uapi/drm/i915_drm.h>
|
|
|
|
|
2019-06-13 15:44:16 +07:00
|
|
|
#include "display/intel_display.h"
|
|
|
|
|
2019-04-25 00:48:39 +07:00
|
|
|
#include "gt/intel_engine_types.h"
|
|
|
|
#include "gt/intel_context_types.h"
|
|
|
|
#include "gt/intel_sseu.h"
|
|
|
|
|
2017-12-22 04:57:32 +07: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,
|
|
|
|
/* gen10 */
|
|
|
|
INTEL_CANNONLAKE,
|
2018-01-12 01:00:04 +07:00
|
|
|
/* gen11 */
|
|
|
|
INTEL_ICELAKE,
|
2019-03-23 00:58:43 +07:00
|
|
|
INTEL_ELKHARTLAKE,
|
2019-07-12 00:30:56 +07:00
|
|
|
/* gen12 */
|
|
|
|
INTEL_TIGERLAKE,
|
2017-12-22 04:57:32 +07:00
|
|
|
INTEL_MAX_PLATFORMS
|
|
|
|
};
|
|
|
|
|
2019-03-27 21:23:28 +07: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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define INTEL_SUBPLATFORM_BITS (3)
|
|
|
|
|
|
|
|
/* 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 05:38:36 +07:00
|
|
|
enum intel_ppgtt_type {
|
2018-09-27 03:12:22 +07: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 04:57:32 +07:00
|
|
|
#define DEV_INFO_FOR_EACH_FLAG(func) \
|
|
|
|
func(is_mobile); \
|
|
|
|
func(is_lp); \
|
2019-05-06 20:48:01 +07:00
|
|
|
func(require_force_probe); \
|
2019-10-25 02:51:19 +07:00
|
|
|
func(is_dgfx); \
|
2017-12-22 04:57:32 +07:00
|
|
|
/* Keep has_* in alphabetical order */ \
|
|
|
|
func(has_64bit_reloc); \
|
2019-01-03 18:21:04 +07:00
|
|
|
func(gpu_reset_clobbers_display); \
|
2017-12-22 04:57:32 +07:00
|
|
|
func(has_reset_engine); \
|
|
|
|
func(has_fpga_dbg); \
|
2019-07-31 01:04:06 +07:00
|
|
|
func(has_global_mocs); \
|
2019-07-25 07:18:06 +07:00
|
|
|
func(has_gt_uc); \
|
2017-12-22 04:57:32 +07:00
|
|
|
func(has_l3_dpf); \
|
|
|
|
func(has_llc); \
|
|
|
|
func(has_logical_ring_contexts); \
|
2018-03-02 23:14:59 +07:00
|
|
|
func(has_logical_ring_elsq); \
|
2017-12-22 04:57:32 +07:00
|
|
|
func(has_logical_ring_preemption); \
|
|
|
|
func(has_pooled_eu); \
|
|
|
|
func(has_rc6); \
|
|
|
|
func(has_rc6p); \
|
2019-04-19 20:48:36 +07:00
|
|
|
func(has_rps); \
|
2017-12-22 04:57:32 +07:00
|
|
|
func(has_runtime_pm); \
|
|
|
|
func(has_snoop); \
|
2018-07-20 17:19:10 +07:00
|
|
|
func(has_coherent_ggtt); \
|
2017-12-22 04:57:32 +07:00
|
|
|
func(unfenced_needs_alignment); \
|
2018-12-01 06:20:48 +07:00
|
|
|
func(hws_needs_physical);
|
|
|
|
|
|
|
|
#define DEV_INFO_DISPLAY_FOR_EACH_FLAG(func) \
|
|
|
|
/* Keep in alphabetical order */ \
|
2017-12-22 04:57:32 +07:00
|
|
|
func(cursor_needs_physical); \
|
2018-12-01 06:20:48 +07:00
|
|
|
func(has_csr); \
|
|
|
|
func(has_ddi); \
|
|
|
|
func(has_dp_mst); \
|
2019-09-20 18:59:21 +07:00
|
|
|
func(has_dsb); \
|
2019-10-26 07:13:23 +07:00
|
|
|
func(has_dsc); \
|
2018-12-01 06:20:48 +07:00
|
|
|
func(has_fbc); \
|
2019-02-05 05:25:38 +07:00
|
|
|
func(has_gmch); \
|
2019-10-26 07:13:20 +07:00
|
|
|
func(has_hdcp); \
|
2018-12-01 06:20:48 +07:00
|
|
|
func(has_hotplug); \
|
|
|
|
func(has_ipc); \
|
2019-07-12 12:57:05 +07:00
|
|
|
func(has_modular_fia); \
|
2018-12-01 06:20:48 +07:00
|
|
|
func(has_overlay); \
|
|
|
|
func(has_psr); \
|
2017-12-22 04:57:32 +07:00
|
|
|
func(overlay_needs_physical); \
|
2018-12-01 06:20:48 +07:00
|
|
|
func(supports_tv);
|
2017-12-22 04:57:32 +07:00
|
|
|
|
|
|
|
struct intel_device_info {
|
|
|
|
u16 gen_mask;
|
|
|
|
|
|
|
|
u8 gen;
|
|
|
|
u8 gt; /* GT number, 0 if undefined */
|
2019-03-06 01:03:30 +07:00
|
|
|
intel_engine_mask_t engine_mask; /* Engines supported by the HW */
|
2017-12-22 04:57:32 +07:00
|
|
|
|
|
|
|
enum intel_platform platform;
|
|
|
|
|
2020-04-18 02:51:07 +07:00
|
|
|
unsigned int dma_mask_size; /* available DMA address bits */
|
|
|
|
|
2019-03-15 05:38:36 +07:00
|
|
|
enum intel_ppgtt_type ppgtt_type;
|
|
|
|
unsigned int ppgtt_size; /* log2, e.g. 31/32/48 bits */
|
|
|
|
|
2018-02-22 18:16:58 +07:00
|
|
|
unsigned int page_sizes; /* page sizes supported by the HW */
|
2019-10-18 16:07:49 +07:00
|
|
|
|
|
|
|
u32 memory_regions; /* regions supported by the HW */
|
2018-02-22 18:16:58 +07:00
|
|
|
|
2017-12-22 04:57:32 +07:00
|
|
|
u32 display_mmio_offset;
|
|
|
|
|
2019-09-12 03:29:08 +07:00
|
|
|
u8 pipe_mask;
|
2020-03-19 00:02:35 +07:00
|
|
|
u8 cpu_transcoder_mask;
|
2017-12-22 04:57:32 +07:00
|
|
|
|
|
|
|
#define DEFINE_FLAG(name) u8 name:1
|
|
|
|
DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
|
|
|
|
#undef DEFINE_FLAG
|
2018-12-01 06:20:48 +07:00
|
|
|
|
|
|
|
struct {
|
|
|
|
#define DEFINE_FLAG(name) u8 name:1
|
|
|
|
DEV_INFO_DISPLAY_FOR_EACH_FLAG(DEFINE_FLAG);
|
|
|
|
#undef DEFINE_FLAG
|
|
|
|
} display;
|
|
|
|
|
2017-12-22 04:57:32 +07:00
|
|
|
u16 ddb_size; /* in blocks */
|
drm/i915: Manipulate DBuf slices properly
Start manipulating DBuf slices as a mask,
but not as a total number, as current approach
doesn't give us full control on all combinations
of slices, which we might need(like enabling S2
only can't enabled by setting enabled_slices=1).
Removed wrong code from intel_get_ddb_size as
it doesn't match to BSpec. For now still just
use DBuf slice until proper algorithm is implemented.
Other minor code refactoring to get prepared
for major DBuf assignment changes landed:
- As now enabled slices contain a mask
we still need some value which should
reflect how much DBuf slices are supported
by the platform, now device info contains
num_supported_dbuf_slices.
- Removed unneeded assertion as we are now
manipulating slices in a more proper way.
v2: Start using enabled_slices in dev_priv
v3: "enabled_slices" is now "enabled_dbuf_slices_mask",
as this now sits in dev_priv independently.
v4: - Fixed debug print formatting to hex(Matt Roper)
- Optimized dbuf slice updates to be used only
if slice union is different from current conf(Matt Roper)
- Fixed some functions to be static(Matt Roper)
- Created a parameterized version for DBUF_CTL to
simplify DBuf programming cycle(Matt Roper)
- Removed unrequred field from GEN10_FEATURES(Matt Roper)
v5: - Removed redundant programming dbuf slices helper(Ville Syrjälä)
- Started to use parameterized loop for hw readout to get slices
(Ville Syrjälä)
- Added back assertion checking amount of DBUF slices enabled
after DC states 5/6 transition, also added new assertion
as starting from ICL DMC seems to restore the last DBuf
power state set, rather than power up all dbuf slices
as assertion was previously expecting(Ville Syrjälä)
v6: - Now using enum for DBuf slices in this patch (Ville Syrjälä)
- Removed gen11_assert_dbuf_enabled and put gen9_assert_dbuf_enabled
back, as we really need to have a single unified assert here
however currently enabling always slice 1 is enforced by BSpec,
so we will have to OR enabled slices mask with 1 in order
to be consistent with BSpec, that way we can unify that
assertion and against the actual state from the driver, but
not some hardcoded value.(concluded with Ville)
- Remove parameterized DBUF_CTL version, to extract it to another
patch.(Ville Syrjälä)
v7:
- Removed unneeded hardcoded return value for older gens from
intel_enabled_dbuf_slices_mask - this now is handled in a
unified manner since device info anyway returns max dbuf slices
as 1 for older platforms(Matthew Roper)
- Now using INTEL_INFO(dev_priv)->num_supported_dbuf_slices instead
of intel_dbuf_max_slices function as it is trivial(Matthew Roper)
v8: - Fixed icl_dbuf_disable to disable all dbufs still(Ville Syrjälä)
v9: - Renamed _DBUF_CTL_S to DBUF_CTL_S(Ville Syrjälä)
- Now using power_domain mutex to protect from race condition, which
can occur because intel_dbuf_slices_update might be running in
parallel to gen9_dc_off_power_well_enable being called from
intel_dp_detect for instance, which causes assertion triggered by
race condition, as gen9_assert_dbuf_enabled might preempt this
when registers were already updated, while dev_priv was not.
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200202230630.8975-6-stanislav.lisovskiy@intel.com
2020-02-03 06:06:29 +07:00
|
|
|
u8 num_supported_dbuf_slices; /* number of DBuf slices */
|
2017-12-22 04:57:32 +07: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 21:56:41 +07:00
|
|
|
struct color_luts {
|
2019-06-12 13:44:57 +07:00
|
|
|
u32 degamma_lut_size;
|
|
|
|
u32 gamma_lut_size;
|
2019-01-31 01:10:22 +07:00
|
|
|
u32 degamma_lut_tests;
|
|
|
|
u32 gamma_lut_tests;
|
2018-12-31 21:56:41 +07:00
|
|
|
} color;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct intel_runtime_info {
|
2019-03-27 21:23:28 +07: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 21:56:41 +07:00
|
|
|
u16 device_id;
|
|
|
|
|
|
|
|
u8 num_sprites[I915_MAX_PIPES];
|
|
|
|
u8 num_scalers[I915_MAX_PIPES];
|
|
|
|
|
2019-03-06 01:03:30 +07:00
|
|
|
u8 num_engines;
|
2018-12-31 21:56:41 +07:00
|
|
|
|
2017-12-22 04:57:32 +07:00
|
|
|
/* Slice/subslice/EU info */
|
|
|
|
struct sseu_dev_info sseu;
|
|
|
|
|
2020-02-16 23:34:45 +07:00
|
|
|
u32 rawclk_freq;
|
|
|
|
|
2020-03-02 21:39:39 +07:00
|
|
|
u32 cs_timestamp_frequency_hz;
|
2020-02-16 20:36:20 +07:00
|
|
|
u32 cs_timestamp_period_ns;
|
2017-12-22 04:57:32 +07:00
|
|
|
|
2018-12-13 16:15:21 +07:00
|
|
|
/* Media engine access to SFC per instance */
|
|
|
|
u8 vdbox_sfc_access;
|
2017-12-22 04:57:32 +07:00
|
|
|
};
|
|
|
|
|
2018-02-08 04:05:43 +07:00
|
|
|
struct intel_driver_caps {
|
|
|
|
unsigned int scheduler;
|
2018-07-06 17:14:41 +07:00
|
|
|
bool has_logical_contexts:1;
|
2018-02-08 04:05:43 +07:00
|
|
|
};
|
|
|
|
|
2017-12-22 04:57:32 +07:00
|
|
|
const char *intel_platform_name(enum intel_platform platform);
|
|
|
|
|
2019-03-27 21:23:28 +07:00
|
|
|
void intel_device_info_subplatform_init(struct drm_i915_private *dev_priv);
|
2018-12-31 21:56:43 +07:00
|
|
|
void intel_device_info_runtime_init(struct drm_i915_private *dev_priv);
|
2019-12-08 01:29:37 +07:00
|
|
|
|
|
|
|
void intel_device_info_print_static(const struct intel_device_info *info,
|
2017-12-22 04:57:34 +07:00
|
|
|
struct drm_printer *p);
|
2019-12-08 01:29:37 +07:00
|
|
|
void intel_device_info_print_runtime(const struct intel_runtime_info *info,
|
2018-03-06 19:28:54 +07:00
|
|
|
struct drm_printer *p);
|
2019-12-08 01:29:37 +07:00
|
|
|
void intel_device_info_print_topology(const struct sseu_dev_info *sseu,
|
|
|
|
struct drm_printer *p);
|
2017-12-22 04:57:32 +07:00
|
|
|
|
drm/i915/icl: Check for fused-off VDBOX and VEBOX instances
In Gen11, the Video Decode engines (aka VDBOX, aka VCS, aka BSD) and the
Video Enhancement engines (aka VEBOX, aka VECS) could be fused off. Also,
each VDBOX and VEBOX has its own power well, which only exist if the
related engine exists in the HW.
Unfortunately, we have a Catch-22 situation going on: we need the blitter
forcewake to read the register with the fuse info, but we cannot initialize
the forcewake domains without knowin about the engines present in the HW.
We workaround this problem by allowing the initialization of all forcewake
domains and then pruning the fused off ones, as per the fuse information.
Bspec: 20680
v2: We were shifting incorrectly for vebox disable (Vinay)
v3: Assert mmio is ready and warn if we have attempted to initialize
forcewake for fused-off engines (Paulo)
v4:
- Use INTEL_GEN in new code (Tvrtko)
- Shorter local variable (Tvrtko, Michal)
- Keep "if (!...) continue" style (Tvrtko)
- No unnecessary BUG_ON (Tvrtko)
- WARN_ON and cleanup if wrong mask (Tvrtko, Michal)
- Use I915_READ_FW (Michal)
- Use I915_MAX_VCS/VECS macros (Michal)
v5: Rebased by Rodrigo fixing conflicts on top of:
"drm/i915: Simplify intel_engines_init"
v6: Fix v5. Remove info->num_rings. (by Oscar)
v7: Rebase (Rodrigo).
v8:
- s/intel_device_info_fused_off_engines/
intel_device_info_init_mmio (Chris)
- Make vdbox_disable & vebox_disable local variables (Chris)
v9:
- Move function declaration to intel_device_info.h (Michal)
- Missing indent in bit fields definitions (Michal)
- When RC6 is enabled by BIOS, the fuse register cannot be read until
the blitter powerwell is awake. Shuffle where the fuse is read, prune
the forcewake domains after the fact and change the commit message
accordingly (Vinay, Sagar, Chris).
v10:
- Improved commit message (Sagar)
- New line in header file (Sagar)
- Specify the message in fw_domain_reset applies to ICL+ (Sagar)
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180316121456.11577-1-mika.kuoppala@linux.intel.com
[Mika: soothe checkpatch on commit msg]
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2018-03-16 19:14:49 +07:00
|
|
|
void intel_device_info_init_mmio(struct drm_i915_private *dev_priv);
|
|
|
|
|
2018-02-08 04:05:43 +07:00
|
|
|
void intel_driver_caps_print(const struct intel_driver_caps *caps,
|
|
|
|
struct drm_printer *p);
|
|
|
|
|
2017-12-22 04:57:32 +07:00
|
|
|
#endif
|