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

drm/i915: Introduce HAS_64BIT_RELOC

Move has_64bit_reloc into dev_priv->info. This will make it visible
in the feature listing debug output.

v2:
- Keep the struct member to keep GCC fragile but happy (Chris)
v3:
- More detailed commit message (Chris)
- Include forgotten CHV and BXT (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1478162386-5018-1-git-send-email-joonas.lahtinen@linux.intel.com

+10 -4
+3
drivers/gpu/drm/i915/i915_drv.h
··· 670 670 func(is_kabylake); \ 671 671 func(is_preliminary); \ 672 672 /* Keep has_* in alphabetical order */ \ 673 + func(has_64bit_reloc); \ 673 674 func(has_csr); \ 674 675 func(has_ddi); \ 675 676 func(has_dp_mst); \ ··· 2918 2917 #define HAS_CSR(dev) (INTEL_INFO(dev)->has_csr) 2919 2918 2920 2919 #define HAS_RUNTIME_PM(dev_priv) ((dev_priv)->info.has_runtime_pm) 2920 + #define HAS_64BIT_RELOC(dev_priv) ((dev_priv)->info.has_64bit_reloc) 2921 + 2921 2922 /* 2922 2923 * For now, anything with a GuC requires uCode loading, and then supports 2923 2924 * command submission once loaded. But these are logically independent
+2 -1
drivers/gpu/drm/i915/i915_gem_execbuffer.c
··· 331 331 cache->page = -1; 332 332 cache->vaddr = 0; 333 333 cache->i915 = i915; 334 - cache->use_64bit_reloc = INTEL_GEN(cache->i915) >= 8; 334 + /* Must be a variable in the struct to allow GCC to unroll. */ 335 + cache->use_64bit_reloc = HAS_64BIT_RELOC(i915); 335 336 cache->node.allocated = false; 336 337 } 337 338
+1 -2
drivers/gpu/drm/i915/i915_gem_render_state.c
··· 74 74 struct drm_i915_private *i915) 75 75 { 76 76 const struct intel_renderstate_rodata *rodata = so->rodata; 77 - const bool has_64bit_reloc = INTEL_GEN(i915) >= 8; 78 77 struct drm_i915_gem_object *obj = so->vma->obj; 79 78 unsigned int i = 0, reloc_index = 0; 80 79 unsigned int needs_clflush; ··· 92 93 if (i * 4 == rodata->reloc[reloc_index]) { 93 94 u64 r = s + so->vma->node.start; 94 95 s = lower_32_bits(r); 95 - if (has_64bit_reloc) { 96 + if (HAS_64BIT_RELOC(i915)) { 96 97 if (i + 1 >= rodata->batch_items || 97 98 rodata->batch[i + 1] != 0) 98 99 goto err;
+4 -1
drivers/gpu/drm/i915/i915_pci.c
··· 288 288 #define BDW_FEATURES \ 289 289 HSW_FEATURES, \ 290 290 BDW_COLORS, \ 291 - .has_logical_ring_contexts = 1 291 + .has_logical_ring_contexts = 1, \ 292 + .has_64bit_reloc = 1 292 293 293 294 static const struct intel_device_info intel_broadwell_info = { 294 295 BDW_FEATURES, ··· 309 308 .has_hotplug = 1, 310 309 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, 311 310 .is_cherryview = 1, 311 + .has_64bit_reloc = 1, 312 312 .has_psr = 1, 313 313 .has_runtime_pm = 1, 314 314 .has_resource_streamer = 1, ··· 349 347 .has_hotplug = 1, 350 348 .ring_mask = RENDER_RING | BSD_RING | BLT_RING | VEBOX_RING, 351 349 .num_pipes = 3, 350 + .has_64bit_reloc = 1, 352 351 .has_ddi = 1, 353 352 .has_fpga_dbg = 1, 354 353 .has_fbc = 1,