[FFmpeg-devel] [PATCH] avutil/ppc/cpu: Fix power8 linux detection

Lauri Kasanen cand at gmx.com
Thu Jan 10 11:45:21 EET 2019


On Wed, 9 Jan 2019 21:55:30 +0100
Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:

> 2019-01-08 10:08 GMT+01:00, Lauri Kasanen <cand at gmx.com>:
> > The existing code was in no released kernel that I can see. The corrected
> > code
> > was added in 3.9.
> >
> > Signed-off-by: Lauri Kasanen <cand at gmx.com>
> > ---
> >  libavutil/ppc/cpu.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
> > index 7bb7cd8..b022149 100644
> > --- a/libavutil/ppc/cpu.c
> > +++ b/libavutil/ppc/cpu.c
> > @@ -93,13 +93,13 @@ int ff_get_cpu_flags_ppc(void)
> >                  if (buf[i + 1] & PPC_FEATURE_HAS_VSX)
> >                      ret |= AV_CPU_FLAG_VSX;
> >  #endif
> > -#ifdef PPC_FEATURE_ARCH_2_07
> > -                if (buf[i + 1] & PPC_FEATURE_HAS_POWER8)
> > -                    ret |= AV_CPU_FLAG_POWER8;
> > -#endif
> >                  if (ret & AV_CPU_FLAG_VSX)
> >                      av_assert0(ret & AV_CPU_FLAG_ALTIVEC);
> 
> > -                goto out;
> 
> This seems like an unrelated change.

It's necessary. HWCAP appears before HWCAP2 in the array, so if the
code jumps out in HWCAP, it never gets to checking the CAP2 bits like
power8.

- Lauri


More information about the ffmpeg-devel mailing list