Skip to content

Feature macro cleanup, batch 1

David Weinehall intel-gfx 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12drm/i915: Transitional, non-polymorph, macrosdrivers/gpu/drm/i915/i915_drv.h+3 -00 replies
2/12drm/i915: IS_MOBILE() fixesdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem_fence.c drivers/gpu/drm/i915/intel_display.c +3 more+16 -110 replies
3/12drm/i915: HAS_POOLED_EU() fixesdrivers/gpu/drm/i915/i915_drv.c drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem_render_state.c+5 -40 replies
4/12drm/i915: INTEL_GEN() fixes, part 1drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem_render_state.c drivers/gpu/drm/i915/intel_display.c +1 more+5 -50 replies
5/12drm/i915: INTEL_GEN() fixes, part 2drivers/gpu/drm/i915/i915_drv.c drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/i915_gem_execbuffer.c +20 more+80 -800 replies
6/12drm/i915: INTEL_GEN() fixes, part 3drivers/gpu/drm/i915/intel_display.c+89 -870 replies
7/12drm/i915: INTEL_GEN() fixes, part 4drivers/gpu/drm/i915/intel_pm.c+40 -270 replies
8/12drm/i915: INTEL_GEN() fixes, part 5drivers/gpu/drm/i915/i915_drv.c drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/i915_gem_execbuffer.c +20 more+124 -1310 replies
9/12drm/i915: i915_vgacntrl_reg() fixesdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/intel_display.c+5 -50 replies
10/12drm/i915: HAS_GMCH_DISPLAY() fixesdrivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/intel_color.c drivers/gpu/drm/i915/intel_display.c +4 more+25 -230 replies
11/12drm/i915: RESOURCE_STREAMER/CORE_RING_FREQ fixesdrivers/gpu/drm/i915/i915_drv.c drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gem_execbuffer.c+8 -70 replies
12/12drm/i915: INTEL_GEN() fixes, part 6drivers/gpu/drm/i915/i915_drv.c drivers/gpu/drm/i915/i915_drv.h drivers/gpu/drm/i915/i915_gpu_error.c +2 more+19 -180 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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(-)
Signature · 6 lines
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx