[PATCH 00/12] Feature macro cleanup, batch 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Most of our feature macros are made to take
drm_i915_private as a parameter, since the wanted
information is part of that struct.

A lot of code still passes drm_device instead, meaning
extra pointer churn.  As a stop-gap solution our macros
currently implements a poor man's polymorphism by use of
the magic __I915__ macro.

This batch of patches starts a transition to a shinier
world with non-polymorphic macros.  I've got more
patches in the pipeline, but to prevent the merge
from stalling due to lack of review or due to merge
conflicts, I've decided to split them into several
batches.

The first patch in this series is only needed during
the merge period; the final patch in the final batch
of patches will undo those changes (but until then
these transitional macros serve to prevent new code
being added that uses the old behaviour).

This batch will, due to the introduction of some
transitional code, introduce more lines that it deletes,
but the following batches will more than compensate for this.
In terms of module size, this patch should save us a bit less
than 1kB. The total series will save something on the order
of 35-40kB (without doing most of the further cleanup that
this enables).

The philosophy when doing this transition has been:

* Whenever struct drm_i915_private * has been introduced
  it has been named dev_priv[1].

* In most of those cases I've tried to make the newly introduced
  pointers be independent from struct drm_device *, to ease finding
  unused variables once the transition is complete

* Whenever a transitioned macro has another macro on the same line,
  or the ones immediately preceeding or succeeding, I've transitioned
  those too, to minimise the amount of patches that changes the
  same lines.

* If leaf functions with struct drm_device * as an in-parameter
  has ended up not using that parameter at all (except for turning
  it into struct drm_i915_private *), I have in a few cases modified
  the function to take the latter pointer as a parameter instead.

* In a few cases I've rebroken lines to make them follow the kernel
  coding style.

[1] Let the bikeshedding ensue; i915 is an alternative
    that would make the code slightly more compact,
    be slightly more descriptive, and allow for fewer
    lines that violates that the kernel coding style
    in terms of length, but it does have a solid majority
    against it in terms of established use.

David Weinehall (12):
  drm/i915: Transitional, non-polymorph, macros
  drm/i915: IS_MOBILE() fixes
  drm/i915: HAS_POOLED_EU() fixes
  drm/i915: INTEL_GEN() fixes, part 1
  drm/i915: INTEL_GEN() fixes, part 2
  drm/i915: INTEL_GEN() fixes, part 3
  drm/i915: INTEL_GEN() fixes, part 4
  drm/i915: INTEL_GEN() fixes, part 5
  drm/i915: i915_vgacntrl_reg() fixes
  drm/i915: HAS_GMCH_DISPLAY() fixes
  drm/i915: RESOURCE_STREAMER/CORE_RING_FREQ fixes
  drm/i915: INTEL_GEN() fixes, part 6

 drivers/gpu/drm/i915/i915_drv.c              |  29 ++--
 drivers/gpu/drm/i915/i915_drv.h              |  52 +++---
 drivers/gpu/drm/i915/i915_gem.c              |  14 +-
 drivers/gpu/drm/i915/i915_gem_execbuffer.c   |  11 +-
 drivers/gpu/drm/i915/i915_gem_fence.c        |   9 +-
 drivers/gpu/drm/i915/i915_gem_gtt.c          |  22 +--
 drivers/gpu/drm/i915/i915_gem_render_state.c |   6 +-
 drivers/gpu/drm/i915/i915_gem_stolen.c       |   9 +-
 drivers/gpu/drm/i915/i915_gem_tiling.c       |   7 +-
 drivers/gpu/drm/i915/i915_gpu_error.c        |  18 +--
 drivers/gpu/drm/i915/i915_irq.c              |  50 +++---
 drivers/gpu/drm/i915/i915_suspend.c          |  18 +--
 drivers/gpu/drm/i915/intel_audio.c           |   2 +-
 drivers/gpu/drm/i915/intel_bios.c            |   2 +-
 drivers/gpu/drm/i915/intel_color.c           |  16 +-
 drivers/gpu/drm/i915/intel_crt.c             |   9 +-
 drivers/gpu/drm/i915/intel_ddi.c             |  24 ++-
 drivers/gpu/drm/i915/intel_device_info.c     |   2 +-
 drivers/gpu/drm/i915/intel_display.c         | 231 ++++++++++++++-------------
 drivers/gpu/drm/i915/intel_dp.c              |  56 ++++---
 drivers/gpu/drm/i915/intel_dpll_mgr.c        |   5 +-
 drivers/gpu/drm/i915/intel_drv.h             |   2 +-
 drivers/gpu/drm/i915/intel_dsi.c             |   5 +-
 drivers/gpu/drm/i915/intel_fbc.c             |  28 ++--
 drivers/gpu/drm/i915/intel_fifo_underrun.c   |   2 +-
 drivers/gpu/drm/i915/intel_guc_loader.c      |   2 +-
 drivers/gpu/drm/i915/intel_hdmi.c            |  15 +-
 drivers/gpu/drm/i915/intel_lvds.c            |  17 +-
 drivers/gpu/drm/i915/intel_mocs.c            |   2 +-
 drivers/gpu/drm/i915/intel_panel.c           |  12 +-
 drivers/gpu/drm/i915/intel_pm.c              |  83 ++++++----
 drivers/gpu/drm/i915/intel_psr.c             |   8 +-
 drivers/gpu/drm/i915/intel_ringbuffer.c      |   2 +-
 drivers/gpu/drm/i915/intel_sdvo.c            |  12 +-
 drivers/gpu/drm/i915/intel_sprite.c          |  17 +-
 drivers/gpu/drm/i915/intel_tv.c              |   2 +-
 drivers/gpu/drm/i915/intel_uncore.c          |  14 +-
 37 files changed, 418 insertions(+), 397 deletions(-)

-- 
2.9.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux