[Intel-gfx] [PATCH 2/2] drm/i915: Do not use INTEL_INFO(dev_priv->dev)

Chris Wilson chris at chris-wilson.co.uk
Thu Mar 31 17:12:35 UTC 2016


On Thu, Mar 31, 2016 at 07:49:39PM +0300, Joonas Lahtinen wrote:
> dev_priv is what the macro works hard to extract, pass it directly.

=0 haswell:/usr/src/linux (tasklet)$ git grep -e '[A-Z].*(dev_priv->dev)' -- drivers/gpu/drm/i915/
drivers/gpu/drm/i915/i915_debugfs.c:    if (!HAS_GUC_UCODE(dev_priv->dev))
drivers/gpu/drm/i915/i915_debugfs.c:    if (!HAS_GUC_SCHED(dev_priv->dev))
drivers/gpu/drm/i915/i915_drv.c:        if (!IS_CHERRYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/i915_drv.c:        if (!IS_CHERRYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/i915_gem_gtt.c:    if (INTEL_INFO(dev_priv->dev)->gen < 6) {
drivers/gpu/drm/i915/i915_gem_gtt.c:    if (!USES_PPGTT(dev_priv->dev))
drivers/gpu/drm/i915/i915_gpu_error.c:  if (use_ggtt && src->cache_level != I915_CACHE_NONE && !HAS_LLC(dev_priv->dev))
drivers/gpu/drm/i915/i915_gpu_error.c:  if (HAS_VEBOX(dev_priv->dev)) {
drivers/gpu/drm/i915/i915_irq.c:                if (WARN_ON_ONCE(slice >= NUM_L3_SLICES(dev_priv->dev)))
drivers/gpu/drm/i915/i915_irq.c:        if (HAS_VEBOX(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_audio.c:     if (HAS_PCH_IBX(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:   if (HAS_DDI(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:   if (INTEL_INFO(dev_priv->dev)->gen == 5)
drivers/gpu/drm/i915/intel_display.c:   if (HAS_DDI(dev_priv->dev))
drivers/gpu/drm/i915/intel_display.c:   if (HAS_PCH_CPT(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:   } else if (IS_CHERRYVIEW(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:   if (HAS_PCH_CPT(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:   } else if (IS_CHERRYVIEW(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:   if (HAS_PCH_CPT(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:   if (HAS_PCH_CPT(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:   I915_STATE_WARN(HAS_PCH_IBX(dev_priv->dev) && (val & DP_PORT_EN) == 0
drivers/gpu/drm/i915/intel_display.c:   I915_STATE_WARN(HAS_PCH_IBX(dev_priv->dev) && (val & SDVO_ENABLE) == 0
drivers/gpu/drm/i915/intel_display.c:   if (IS_MOBILE(dev_priv->dev))
drivers/gpu/drm/i915/intel_display.c:   if (HAS_PCH_IBX(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:           if (HAS_PCH_IBX(dev_priv->dev) &&
drivers/gpu/drm/i915/intel_display.c:   BUG_ON(!HAS_PCH_SPLIT(dev_priv->dev));
drivers/gpu/drm/i915/intel_display.c:   if (HAS_PCH_LPT(dev_priv->dev))
drivers/gpu/drm/i915/intel_display.c:   if (HAS_GMCH_DISPLAY(dev_priv->dev))
drivers/gpu/drm/i915/intel_display.c:   if (IS_HASWELL(dev_priv->dev))
drivers/gpu/drm/i915/intel_display.c:           if (HAS_PCH_IBX(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_display.c:   if (HAS_DDI(dev_priv->dev))
drivers/gpu/drm/i915/intel_dpll_mgr.c:  I915_STATE_WARN_ON(!(HAS_PCH_IBX(dev_priv->dev) || HAS_PCH_CPT(dev_priv->dev)));
drivers/gpu/drm/i915/intel_fifo_underrun.c:     if (HAS_PCH_IBX(dev_priv->dev))
drivers/gpu/drm/i915/intel_fifo_underrun.c:     if (HAS_GMCH_DISPLAY(dev_priv->dev) &&
drivers/gpu/drm/i915/intel_hdmi.c:      else if (HAS_PCH_SPLIT(dev_priv->dev))
drivers/gpu/drm/i915/intel_i2c.c:       if (!IS_PINEVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_i2c.c:       if (!HAS_GMBUS_IRQ(dev_priv->dev))
drivers/gpu/drm/i915/intel_i2c.c:       if (!HAS_GMBUS_IRQ(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c:        if (IS_GEN9(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_pm.c:        if (IS_GEN9(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c:        else if (IS_CHERRYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c:        else if (IS_VALLEYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c:        if (IS_GEN9(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c:        else if (IS_CHERRYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c:        else if (IS_VALLEYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_psr.c:       if (HAS_DDI(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_runtime_pm.c:        if (IS_HASWELL(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_runtime_pm.c:        } else if (IS_BROADWELL(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_runtime_pm.c:        } else if (IS_SKYLAKE(dev_priv->dev) || IS_KABYLAKE(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_runtime_pm.c:        } else if (IS_BROXTON(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_runtime_pm.c:        } else if (IS_CHERRYVIEW(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_runtime_pm.c:        } else if (IS_VALLEYVIEW(dev_priv->dev)) {
drivers/gpu/drm/i915/intel_uncore.c:    if (IS_VALLEYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_uncore.c:    if (INTEL_INFO(dev_priv->dev)->gen <= 5)

are all good candidates for contraction.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list