/* * Copyright © 2016 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. * */ #include <linux/string_helpers.h> #include <drm/drm_print.h> #include <drm/intel/i915_pciids.h> #include "gt/intel_gt_regs.h" #include "i915_drv.h" #include "i915_reg.h" #include "i915_utils.h" #include "intel_device_info.h" #define PLATFORM_NAME … static const char * const platform_names[] = …; #undef PLATFORM_NAME const char *intel_platform_name(enum intel_platform platform) { … } void intel_device_info_print(const struct intel_device_info *info, const struct intel_runtime_info *runtime, struct drm_printer *p) { … } #define ID(id) … static const u16 subplatform_ult_ids[] = …; static const u16 subplatform_ulx_ids[] = …; static const u16 subplatform_portf_ids[] = …; static const u16 subplatform_uy_ids[] = …; static const u16 subplatform_n_ids[] = …; static const u16 subplatform_rpl_ids[] = …; static const u16 subplatform_rplu_ids[] = …; static const u16 subplatform_g10_ids[] = …; static const u16 subplatform_g11_ids[] = …; static const u16 subplatform_g12_ids[] = …; static const u16 subplatform_arl_ids[] = …; static bool find_devid(u16 id, const u16 *p, unsigned int num) { … } static void intel_device_info_subplatform_init(struct drm_i915_private *i915) { … } static void ip_ver_read(struct drm_i915_private *i915, u32 offset, struct intel_ip_version *ip) { … } /* * Setup the graphics version for the current device. This must be done before * any code that performs checks on GRAPHICS_VER or DISPLAY_VER, so this * function should be called very early in the driver initialization sequence. * * Regular MMIO access is not yet setup at the point this function is called so * we peek at the appropriate MMIO offset directly. The GMD_ID register is * part of an 'always on' power well by design, so we don't need to worry about * forcewake while reading it. */ static void intel_ipver_early_init(struct drm_i915_private *i915) { … } /** * intel_device_info_runtime_init_early - initialize early runtime info * @i915: the i915 device * * Determine early intel_device_info fields at runtime. This function needs * to be called before the MMIO has been setup. */ void intel_device_info_runtime_init_early(struct drm_i915_private *i915) { … } /** * intel_device_info_runtime_init - initialize runtime info * @dev_priv: the i915 device * * Determine various intel_device_info fields at runtime. * * Use it when either: * - it's judged too laborious to fill n static structures with the limit * when a simple if statement does the job, * - run-time checks (eg read fuse/strap registers) are needed. * * This function needs to be called: * - after the MMIO has been setup as we are reading registers, * - after the PCH has been detected, * - before the first usage of the fields it can tweak. */ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv) { … } /* * Set up device info and initial runtime info at driver create. * * Note: i915 is only an allocated blob of memory at this point. */ void intel_device_info_driver_create(struct drm_i915_private *i915, u16 device_id, const struct intel_device_info *match_info) { … } void intel_driver_caps_print(const struct intel_driver_caps *caps, struct drm_printer *p) { … }