[Intel-gfx] [PATCH 3/3] drm/i915/bios: Introduce panel_bits() and panel_bool()
Ville Syrjälä
ville.syrjala at linux.intel.com
Thu Jun 16 14:28:32 UTC 2022
On Thu, Jun 16, 2022 at 01:48:16PM +0300, Jani Nikula wrote:
> On Wed, 15 Jun 2022, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> >
> > Abstract the bit extraction from the VBT per-panel bitfields
> > slightly.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_bios.c | 31 +++++++++++++------
> > drivers/gpu/drm/i915/display/intel_vbt_defs.h | 3 --
> > 2 files changed, 21 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> > index 807184fd5618..76e86358adb9 100644
> > --- a/drivers/gpu/drm/i915/display/intel_bios.c
> > +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> > @@ -743,6 +743,16 @@ static int get_panel_type(struct drm_i915_private *i915,
> > return panel_types[i].panel_type;
> > }
> >
> > +static unsigned int panel_bits(unsigned int value, int panel_type, int num_bits)
> > +{
> > + return (value >> (panel_type * num_bits)) & (BIT(num_bits) - 1);
>
> Nitpick, this might be easier to parse with GENMASK and friends, but
> *shrug*.
Pondered about it a bit myself, but decided to keep the current
form for the time being at least.
> Reviewed-by: Jani Nikula <jani.nikula at intel.com>
Ta. Series pushed.
--
Ville Syrjälä
Intel
More information about the Intel-gfx
mailing list