Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'drm-intel-next-fixes-2023-07-06' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

- Fix BDW PSR AUX CH data register offsets [psr] (Ville Syrjälä)
- Use mock device info for creating mock device (Jani Nikula)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZKZ6VIeInBYrBuph@tursulin-desk

+25 -22
+1 -1
drivers/gpu/drm/i915/display/intel_psr_regs.h
··· 81 81 82 82 #define _SRD_AUX_DATA_A 0x60814 83 83 #define _SRD_AUX_DATA_EDP 0x6f814 84 - #define EDP_PSR_AUX_DATA(tran, i) _MMIO_TRANS2(tran, _SRD_AUX_DATA_A + (i) + 4) /* 5 registers */ 84 + #define EDP_PSR_AUX_DATA(tran, i) _MMIO_TRANS2(tran, _SRD_AUX_DATA_A + (i) * 4) /* 5 registers */ 85 85 86 86 #define _SRD_STATUS_A 0x60840 87 87 #define _SRD_STATUS_EDP 0x6f840
+24 -21
drivers/gpu/drm/i915/selftests/mock_gem_device.c
··· 118 118 i915->gt[0]->name = "Mock GT"; 119 119 } 120 120 121 + static const struct intel_device_info mock_info = { 122 + .__runtime.graphics.ip.ver = -1, 123 + .__runtime.page_sizes = (I915_GTT_PAGE_SIZE_4K | 124 + I915_GTT_PAGE_SIZE_64K | 125 + I915_GTT_PAGE_SIZE_2M), 126 + .__runtime.memory_regions = REGION_SMEM, 127 + .__runtime.platform_engine_mask = BIT(0), 128 + 129 + /* simply use legacy cache level for mock device */ 130 + .max_pat_index = 3, 131 + .cachelevel_to_pat = { 132 + [I915_CACHE_NONE] = 0, 133 + [I915_CACHE_LLC] = 1, 134 + [I915_CACHE_L3_LLC] = 2, 135 + [I915_CACHE_WT] = 3, 136 + }, 137 + }; 138 + 121 139 struct drm_i915_private *mock_gem_device(void) 122 140 { 123 141 #if IS_ENABLED(CONFIG_IOMMU_API) && defined(CONFIG_INTEL_IOMMU) 124 142 static struct dev_iommu fake_iommu = { .priv = (void *)-1 }; 125 143 #endif 126 144 struct drm_i915_private *i915; 127 - struct intel_device_info *i915_info; 128 145 struct pci_dev *pdev; 129 - unsigned int i; 130 146 int ret; 131 147 132 148 pdev = kzalloc(sizeof(*pdev), GFP_KERNEL); ··· 175 159 176 160 pci_set_drvdata(pdev, i915); 177 161 162 + /* Device parameters start as a copy of module parameters. */ 163 + i915_params_copy(&i915->params, &i915_modparams); 164 + 165 + /* Set up device info and initial runtime info. */ 166 + intel_device_info_driver_create(i915, pdev->device, &mock_info); 167 + 178 168 dev_pm_domain_set(&pdev->dev, &pm_domain); 179 169 pm_runtime_enable(&pdev->dev); 180 170 pm_runtime_dont_use_autosuspend(&pdev->dev); 181 171 if (pm_runtime_enabled(&pdev->dev)) 182 172 WARN_ON(pm_runtime_get_sync(&pdev->dev)); 183 - 184 - 185 - i915_params_copy(&i915->params, &i915_modparams); 186 173 187 174 intel_runtime_pm_init_early(&i915->runtime_pm); 188 175 /* wakeref tracking has significant overhead */ ··· 193 174 194 175 /* Using the global GTT may ask questions about KMS users, so prepare */ 195 176 drm_mode_config_init(&i915->drm); 196 - 197 - RUNTIME_INFO(i915)->graphics.ip.ver = -1; 198 - 199 - RUNTIME_INFO(i915)->page_sizes = 200 - I915_GTT_PAGE_SIZE_4K | 201 - I915_GTT_PAGE_SIZE_64K | 202 - I915_GTT_PAGE_SIZE_2M; 203 - 204 - RUNTIME_INFO(i915)->memory_regions = REGION_SMEM; 205 - 206 - /* simply use legacy cache level for mock device */ 207 - i915_info = (struct intel_device_info *)INTEL_INFO(i915); 208 - i915_info->max_pat_index = 3; 209 - for (i = 0; i < I915_MAX_CACHE_LEVEL; i++) 210 - i915_info->cachelevel_to_pat[i] = i; 211 177 212 178 intel_memory_regions_hw_probe(i915); 213 179 ··· 227 223 mock_init_ggtt(to_gt(i915)); 228 224 to_gt(i915)->vm = i915_vm_get(&to_gt(i915)->ggtt->vm); 229 225 230 - RUNTIME_INFO(i915)->platform_engine_mask = BIT(0); 231 226 to_gt(i915)->info.engine_mask = BIT(0); 232 227 233 228 to_gt(i915)->engine[RCS0] = mock_engine(i915, "mock", RCS0);