mbox series

[v2,0/8] Add _PICK_EVEN_2RANGES

Message ID 20230120193457.3295977-1-lucas.demarchi@intel.com (mailing list archive)
Headers show
Series Add _PICK_EVEN_2RANGES | expand

Message

Lucas De Marchi Jan. 20, 2023, 7:34 p.m. UTC
Add a new macro, _PICK_EVEN_2RANGES, that supports using 2 address
ranges. This can be considered a v2 of
https://patchwork.freedesktop.org/series/109606/

I think I converted all the _PICK() uses that could be easily done
without making it much harder to read. We do have some cases of 3
ranges: I left those alone.

As commented in the original series and like Jani I think we may need
something else to cover all the use cases in future. Right now I don't
think we have a good alternative though. This new macro both improves
the current code and can be used for cases the ranges change in new
platforms, so I think it's good enough.  In future I think just saving
the reg during initialization and using different functions if the
bitfields change may be an alternative.

This was lightly tested on ADL-S and DG2.

Lucas De Marchi (8):
  drm/i915: Add _PICK_EVEN_2RANGES()
  drm/i915: Fix coding style on DPLL*_ENABLE defines
  drm/i915: Convert pll macros to _PICK_EVEN_2RANGES
  drm/i915: Replace _MMIO_PHY3() with _PICK_EVEN_2RANGES()
  drm/i915: Convert PIPE3/PORT3 to _PICK_EVEN_2RANGES()
  drm/i915: Convert _FIA() to _PICK_EVEN_2RANGES()
  drm/i915: Convert MBUS_ABOX_CTL() to _PICK_EVEN_2RANGES()
  drm/i915: Convert PALETTE() to _PICK_EVEN_2RANGES()

 .../drm/i915/display/intel_display_reg_defs.h |  10 +-
 .../gpu/drm/i915/display/intel_mg_phy_regs.h  |   4 +-
 drivers/gpu/drm/i915/i915_reg.h               | 106 +++++++++---------
 drivers/gpu/drm/i915/i915_reg_defs.h          |  28 +++++
 4 files changed, 89 insertions(+), 59 deletions(-)

Comments

Jani Nikula Jan. 23, 2023, 10:39 a.m. UTC | #1
On Fri, 20 Jan 2023, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> Add a new macro, _PICK_EVEN_2RANGES, that supports using 2 address
> ranges. This can be considered a v2 of
> https://patchwork.freedesktop.org/series/109606/
>
> I think I converted all the _PICK() uses that could be easily done
> without making it much harder to read. We do have some cases of 3
> ranges: I left those alone.
>
> As commented in the original series and like Jani I think we may need
> something else to cover all the use cases in future. Right now I don't
> think we have a good alternative though. This new macro both improves
> the current code and can be used for cases the ranges change in new
> platforms, so I think it's good enough.  In future I think just saving
> the reg during initialization and using different functions if the
> bitfields change may be an alternative.

Did not review, but on the approach,

Acked-by: Jani Nikula <jani.nikula@intel.com>

>
> This was lightly tested on ADL-S and DG2.
>
> Lucas De Marchi (8):
>   drm/i915: Add _PICK_EVEN_2RANGES()
>   drm/i915: Fix coding style on DPLL*_ENABLE defines
>   drm/i915: Convert pll macros to _PICK_EVEN_2RANGES
>   drm/i915: Replace _MMIO_PHY3() with _PICK_EVEN_2RANGES()
>   drm/i915: Convert PIPE3/PORT3 to _PICK_EVEN_2RANGES()
>   drm/i915: Convert _FIA() to _PICK_EVEN_2RANGES()
>   drm/i915: Convert MBUS_ABOX_CTL() to _PICK_EVEN_2RANGES()
>   drm/i915: Convert PALETTE() to _PICK_EVEN_2RANGES()
>
>  .../drm/i915/display/intel_display_reg_defs.h |  10 +-
>  .../gpu/drm/i915/display/intel_mg_phy_regs.h  |   4 +-
>  drivers/gpu/drm/i915/i915_reg.h               | 106 +++++++++---------
>  drivers/gpu/drm/i915/i915_reg_defs.h          |  28 +++++
>  4 files changed, 89 insertions(+), 59 deletions(-)