Re: [RFC 2/3] drm/i915: Prefer IS_GEN<n> check with bitmask.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 26 Oct 2018, Rodrigo Vivi wrote:

> On Thu, Oct 25, 2018 at 12:11:57PM +0100, Julia Lawall wrote:
> >
> >
> > On Thu, 25 Oct 2018, Ville Syrjälä wrote:
> >
> > > On Wed, Oct 24, 2018 at 04:41:06PM -0700, Rodrigo Vivi wrote:
> > > > On Wed, Oct 24, 2018 at 01:22:57PM +0300, Ville Syrjälä wrote:
> > > > > On Tue, Oct 23, 2018 at 04:36:19PM -0700, Rodrigo Vivi wrote:
> > > > > > Whenever possible we should stick with IS_GEN<n> checks.
> > > > > >
> > > > > > Bitmaks has been introduced on commit ae7617f0ef18 ("drm/i915:
> > > > > > Allow optimized platform checks") for efficiency.
> > > > > >
> > > > > > Let's stick with it whenever possible.
> > > > > >
> > > > > > This patch was generated with coccinelle:
> > > > > >
> > > > > > spatch -sp_file is_gen.cocci *{c,h} --in-place
> > > > > >
> > > > > > is_gen.cocci:
> > > > > > @gen2@ expression e; @@
> > > > > > -INTEL_GEN(e) == 2
> > > > > > +IS_GEN2(e)
> > > > > > @gen3@ expression e; @@
> > > > > > -INTEL_GEN(e) == 3
> > > > > > +IS_GEN3(e)
> > > > > > @gen4@ expression e; @@
> > > > > > -INTEL_GEN(e) == 4
> > > > > > +IS_GEN4(e)
> > > > > > @gen5@ expression e; @@
> > > > > > -INTEL_GEN(e) == 5
> > > > > > +IS_GEN5(e)
> > > > > > @gen6@ expression e; @@
> > > > > > -INTEL_GEN(e) == 6
> > > > > > +IS_GEN6(e)
> > > > > > @gen7@ expression e; @@
> > > > > > -INTEL_GEN(e) == 7
> > > > > > +IS_GEN7(e)
> > > > > > @gen8@ expression e; @@
> > > > > > -INTEL_GEN(e) == 8
> > > > > > +IS_GEN8(e)
> > > > > > @gen9@ expression e; @@
> > > > > > -INTEL_GEN(e) == 9
> > > > > > +IS_GEN9(e)
> > > > > > @gen10@ expression e; @@
> > > > > > -INTEL_GEN(e) == 10
> > > > > > +IS_GEN10(e)
> > > > > > @gen11@ expression e; @@
> > > > > > -INTEL_GEN(e) == 11
> > > > > > +IS_GEN11(e)
> > > > >
> > > > > Slightly less repetitive version.
> > > >
> > > > Thanks. I'm supper newbie on coccinelle and it was
> > > > easier to duplicate then trying to learn all this new lang.
> > > >
> > > > But I really appreciate you sharing this. I'd like
> > > > to go with this so the better rule keeps on commit message.
> > > >
> > > > > Sadly not super neat on
> > > > > account of having to use the python stuff.
> > > >
> > > > however it seems python version didn't work so well here:
> > > >
> > > > init_defs_builtins: /usr/lib64/coccinelle/standard.h
> > > > Python error: No module named coccilib.elems
> > > >
> > > > do you have any idea about it?
> > >
> > > Never seen it. On gentoo it just works when I have the python
> > > use flag enabled.
> > >
> > > Maybe your distro doesn't include the python support in the
> > > build, or maybe some kind of python version issue?
> >
> > Thanks for the report.  I will have someone look into it.  It's an
> > internal Coccinelle thing.  Perhaps python is not enabled.  Do you have
> > the version of Coccinelle from github?
>
> I just tried with coccinelle from github but got same result.
>
> But with this commit before the bump to automake1.16:
>
> commit 4db95998768557c66d6e337be2253032b5d810bc (HEAD -> master)
> Author: Thierry Martinez <thierry.martinez@xxxxxxxx>
> Date:   Wed Sep 12 14:43:41 2018 +0200
>
>     Compute depend by calling make recursilevy
>
>     The set of files in $(source_files) may change when the tarball is
>     unpacked.
>
> ----
>
> $ python --version
> Python 2.7.15
> $ python3 --version
> Python 3.6.6
>
> ----
>
> I believe I'm moving this patch with the repetitive bad
> rule for now that I'm sure it works in most of the distros.

Sorry, I'm not sure to understand the last sentence. Are things ok now, or
not?

thanks,
julia
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux