[Intel-gfx] drm/i915: Inline feature detection into sanitize_enable_ppgtt
Dan Carpenter
dan.carpenter at oracle.com
Tue Oct 28 11:52:51 CET 2014
Hello Chris Wilson,
The patch 1893a71b1eba: "drm/i915: Inline feature detection into
sanitize_enable_ppgtt" from Sep 19, 2014, leads to the following
static checker warning:
drivers/gpu/drm/i915/i915_gem_gtt.c:70 sanitize_enable_ppgtt()
warn: we tested 'has_aliasing_ppgtt' before and it was 'true'
drivers/gpu/drm/i915/i915_gem_gtt.c
36 static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
37 {
38 bool has_aliasing_ppgtt;
39 bool has_full_ppgtt;
40
41 has_aliasing_ppgtt = INTEL_INFO(dev)->gen >= 6;
42 has_full_ppgtt = INTEL_INFO(dev)->gen >= 7;
43 if (IS_GEN8(dev))
44 has_full_ppgtt = false; /* XXX why? */
45
46 if (enable_ppgtt == 0 || !has_aliasing_ppgtt)
^^^^^^^^^^^^^^^^^^^
The patch introduces this condition.
47 return 0;
48
49 if (enable_ppgtt == 1)
50 return 1;
51
52 if (enable_ppgtt == 2 && has_full_ppgtt)
53 return 2;
54
55 #ifdef CONFIG_INTEL_IOMMU
56 /* Disable ppgtt on SNB if VT-d is on. */
57 if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) {
58 DRM_INFO("Disabling PPGTT because VT-d is on\n");
59 return 0;
60 }
61 #endif
62
63 /* Early VLV doesn't have this */
64 if (IS_VALLEYVIEW(dev) && !IS_CHERRYVIEW(dev) &&
65 dev->pdev->revision < 0xb) {
66 DRM_DEBUG_DRIVER("disabling PPGTT on pre-B3 step VLV\n");
67 return 0;
68 }
69
70 return has_aliasing_ppgtt ? 1 : 0;
^^^^^^^^^^^^^^^^^^
The patch introduces this already known condition.
71 }
regards,
dan carpenter
More information about the Intel-gfx
mailing list