[Intel-gfx] [PATCH 0/3] drm/i915: use INTEL_GEN(dev_priv) wherever possible

Dave Gordon david.s.gordon at intel.com
Mon Sep 12 19:20:00 UTC 2016


Wherever we find "INTEL_INFO(dev)->gen", and have a suitable
"dev_priv" in scope, replace it with "INTEL_GEN(dev_priv)",
which is the preferred wasy to access this device property.

This is mostly achieved automatically by the following Coccinelle
script, with a little manual postprocessing of a few files.

@dev_priv_param@
function FUNC;
idexpression struct drm_device *DEV;
identifier DEV_PRIV;
@@
FUNC(..., struct drm_i915_private *DEV_PRIV, ...)
{
    <...
-   INTEL_INFO(DEV)->gen
+   INTEL_GEN(DEV_PRIV)
    ...>
}

@dev_priv_local@
idexpression struct drm_device *DEV;
identifier DEV_PRIV;
expression E;
@@
{
    ...
(
    struct drm_i915_private *DEV_PRIV;
|
    struct drm_i915_private *DEV_PRIV = E;
)
    <...
-   INTEL_INFO(DEV)->gen
+   INTEL_GEN(DEV_PRIV)
    ...>
}

Patch 1 covers those that were purely autoconverted, patch 2
deals with those that needed a little manual tweaking, and
patch 3 is just intel_display.c separated out 'cos it's huge.

Dave Gordon (3):
  drm/i915: prefer INTEL_GEN(dev_priv) to INTEL_INFO(dev)->gen
  drm/i915: prefer INTEL_GEN(dev_priv) to INTEL_INFO(dev)->gen (part 2)
  drm/i915: prefer INTEL_GEN(dev_priv) to INTEL_INFO(dev)->gen (part 3)

 drivers/gpu/drm/i915/i915_gem.c            |   4 +-
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |   6 +-
 drivers/gpu/drm/i915/i915_gem_fence.c      |   9 ++-
 drivers/gpu/drm/i915/i915_gem_gtt.c        |   4 +-
 drivers/gpu/drm/i915/i915_gem_stolen.c     |   6 +-
 drivers/gpu/drm/i915/i915_gpu_error.c      |  14 ++--
 drivers/gpu/drm/i915/i915_irq.c            |  12 ++--
 drivers/gpu/drm/i915/i915_suspend.c        |  12 ++--
 drivers/gpu/drm/i915/intel_color.c         |   2 +-
 drivers/gpu/drm/i915/intel_crt.c           |   6 +-
 drivers/gpu/drm/i915/intel_ddi.c           |   4 +-
 drivers/gpu/drm/i915/intel_display.c       | 107 ++++++++++++++---------------
 drivers/gpu/drm/i915/intel_dp.c            |  14 ++--
 drivers/gpu/drm/i915/intel_dpll_mgr.c      |   2 +-
 drivers/gpu/drm/i915/intel_lvds.c          |   4 +-
 drivers/gpu/drm/i915/intel_pm.c            |  18 ++---
 drivers/gpu/drm/i915/intel_psr.c           |   4 +-
 drivers/gpu/drm/i915/intel_sdvo.c          |   8 +--
 drivers/gpu/drm/i915/intel_tv.c            |   2 +-
 19 files changed, 118 insertions(+), 120 deletions(-)

-- 
1.9.1



More information about the Intel-gfx mailing list