[Intel-gfx] [PATCH 0/5] Make GEN macros more similar

Lucas De Marchi lucas.demarchi at intel.com
Thu Nov 1 08:35:12 UTC 2018


Jani, Rodrigo, Tvrtko (an whoever jumps in): continuing our conversation
here with the real patches so we can debate what's better looking to
the implementation.

I generated these patches with the following options:

- Let IS_GEN() receive 1 or 2 args (besides dev_priv)
  and use that to compare a single gen in the first case
  or a range. The idea is that IS_GEN(dev_priv, 4) can be
  seen as a shortcut to IS_GEN(dev_priv, 4, 4)
- Replace IS_GEN<n> with the new macro
- Check some cases in which we could be checking a range
  rather than manual comparisons

Last 2 patches is an attempt to convert cases in which we
can't use IS_GEN and we resort to INTEL_GEN(dev_priv) to
know if it's equal, greater than (gt), greater or equal (ge),
less than (lt) or less or equal (le).  Actually I have mixed feelings
on converting them and maybe we should just let them as is.

Let me know what you think.

thanks
Lucas De Marchi

Lucas De Marchi (5):
  drm/i915: let IS_GEN receive 1 or 2 arguments
  drm/i915: replace IS_GEN<N> with IS_GEN(..., N)
  drm/i915: merge gen checks to use range
  drm/i915: add helper IS_GEN_* macros
  RFC: drm/i915: convert a few cases to the helper IS_GEN_* macros

 drivers/gpu/drm/i915/gvt/vgpu.c            |   4 +-
 drivers/gpu/drm/i915/i915_cmd_parser.c     |   2 +-
 drivers/gpu/drm/i915/i915_debugfs.c        |  42 ++++----
 drivers/gpu/drm/i915/i915_drv.c            |  18 ++--
 drivers/gpu/drm/i915/i915_drv.h            |  23 ++--
 drivers/gpu/drm/i915/i915_gem.c            |  12 +--
 drivers/gpu/drm/i915/i915_gem_context.c    |   2 +-
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |   4 +-
 drivers/gpu/drm/i915/i915_gem_fence_reg.c  |  10 +-
 drivers/gpu/drm/i915/i915_gem_gtt.c        |   8 +-
 drivers/gpu/drm/i915/i915_gem_stolen.c     |   7 +-
 drivers/gpu/drm/i915/i915_gem_tiling.c     |   4 +-
 drivers/gpu/drm/i915/i915_gpu_error.c      |  18 ++--
 drivers/gpu/drm/i915/i915_irq.c            |  30 +++---
 drivers/gpu/drm/i915/i915_perf.c           |   4 +-
 drivers/gpu/drm/i915/i915_reg.h            |   4 +-
 drivers/gpu/drm/i915/i915_suspend.c        |  12 +--
 drivers/gpu/drm/i915/intel_atomic.c        |   2 +-
 drivers/gpu/drm/i915/intel_audio.c         |   2 +-
 drivers/gpu/drm/i915/intel_cdclk.c         |  12 +--
 drivers/gpu/drm/i915/intel_crt.c           |   6 +-
 drivers/gpu/drm/i915/intel_ddi.c           |   2 +-
 drivers/gpu/drm/i915/intel_device_info.c   |  16 +--
 drivers/gpu/drm/i915/intel_display.c       | 116 ++++++++++-----------
 drivers/gpu/drm/i915/intel_dp.c            |  32 +++---
 drivers/gpu/drm/i915/intel_engine_cs.c     |   4 +-
 drivers/gpu/drm/i915/intel_fbc.c           |  24 ++---
 drivers/gpu/drm/i915/intel_fifo_underrun.c |   6 +-
 drivers/gpu/drm/i915/intel_guc_fw.c        |   2 +-
 drivers/gpu/drm/i915/intel_hangcheck.c     |   2 +-
 drivers/gpu/drm/i915/intel_i2c.c           |   2 +-
 drivers/gpu/drm/i915/intel_lrc.c           |   6 +-
 drivers/gpu/drm/i915/intel_lvds.c          |   4 +-
 drivers/gpu/drm/i915/intel_mocs.c          |   4 +-
 drivers/gpu/drm/i915/intel_overlay.c       |  10 +-
 drivers/gpu/drm/i915/intel_panel.c         |   8 +-
 drivers/gpu/drm/i915/intel_pipe_crc.c      |   8 +-
 drivers/gpu/drm/i915/intel_pm.c            |  86 +++++++--------
 drivers/gpu/drm/i915/intel_psr.c           |  10 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c    |  28 ++---
 drivers/gpu/drm/i915/intel_ringbuffer.h    |   4 +-
 drivers/gpu/drm/i915/intel_runtime_pm.c    |   2 +-
 drivers/gpu/drm/i915/intel_sprite.c        |  14 +--
 drivers/gpu/drm/i915/intel_uc.c            |   2 +-
 drivers/gpu/drm/i915/intel_uncore.c        |  22 ++--
 drivers/gpu/drm/i915/intel_wopcm.c         |   4 +-
 46 files changed, 328 insertions(+), 316 deletions(-)

--
2.19.1.1.g56c4683e68



More information about the Intel-gfx mailing list