public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: David Weinehall <david.weinehall@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: --dry-run@freedesktop.org
Subject: [PATCH 00/12] Feature macro cleanup, batch 1
Date: Mon, 29 Aug 2016 13:31:40 +0300	[thread overview]
Message-ID: <20160829103152.31282-1-david.weinehall@linux.intel.com> (raw)

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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2016-08-29 10:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 10:31 David Weinehall [this message]
2016-08-29 10:31 ` [PATCH 01/12] drm/i915: Transitional, non-polymorph, macros David Weinehall
2016-08-29 10:31 ` [PATCH 02/12] drm/i915: IS_MOBILE() fixes David Weinehall
2016-08-29 10:31 ` [PATCH 03/12] drm/i915: HAS_POOLED_EU() fixes David Weinehall
2016-08-29 10:31 ` [PATCH 04/12] drm/i915: INTEL_GEN() fixes, part 1 David Weinehall
2016-08-29 10:31 ` [PATCH 05/12] drm/i915: INTEL_GEN() fixes, part 2 David Weinehall
2016-08-29 10:31 ` [PATCH 06/12] drm/i915: INTEL_GEN() fixes, part 3 David Weinehall
2016-08-29 10:31 ` [PATCH 07/12] drm/i915: INTEL_GEN() fixes, part 4 David Weinehall
2016-08-29 10:31 ` [PATCH 08/12] drm/i915: INTEL_GEN() fixes, part 5 David Weinehall
2016-08-29 10:31 ` [PATCH 09/12] drm/i915: i915_vgacntrl_reg() fixes David Weinehall
2016-08-29 10:31 ` [PATCH 10/12] drm/i915: HAS_GMCH_DISPLAY() fixes David Weinehall
2016-08-29 10:31 ` [PATCH 11/12] drm/i915: RESOURCE_STREAMER/CORE_RING_FREQ fixes David Weinehall
2016-08-29 10:31 ` [PATCH 12/12] drm/i915: INTEL_GEN() fixes, part 6 David Weinehall
2016-08-29 11:25 ` ✗ Fi.CI.BAT: warning for Feature macro cleanup, batch 1 Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160829103152.31282-1-david.weinehall@linux.intel.com \
    --to=david.weinehall@linux.intel.com \
    --cc=--dry-run@freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox