From: Jani Nikula <jani.nikula@linux.intel.com>
To: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"mesa-dev@lists.freedesktop.org" <mesa-dev@lists.freedesktop.org>
Cc: "Sharp, Sarah A" <sarah.a.sharp@intel.com>,
"Kibey, Sameer" <sameer.kibey@intel.com>,
"Widawsky, Benjamin" <benjamin.widawsky@intel.com>
Subject: Re: [PATCH] list-workarounds: Extend the script to Mesa
Date: Thu, 04 Feb 2016 20:37:05 +0200 [thread overview]
Message-ID: <87h9hotj8u.fsf@intel.com> (raw)
In-Reply-To: <A3EE0A64E0D4F34AB0728B138E43077D22FA8DB3@fmsmsx111.amr.corp.intel.com>
FYI, for IGT patches, please do as instructed in CONTRIBUTING:
"""
Please use --subject-prefix="PATCH i-g-t" so that i-g-t patches are easily
identified in the massive amount mails on intel-gfx. To ensure this is always
done just run
git config format.subjectprefix "PATCH i-g-t"
from within your i-g-t git checkout.
"""
BR,
Jani.
On Thu, 04 Feb 2016, "Kibey, Sameer" <sameer.kibey@intel.com> wrote:
> Updated the list-workarounds script so that it
> can parse Mesa directory if provided. Moved the
> common code to a separate function to allow
> reuse for both kernel and mesa.
>
> The new command line is:
> Usage: list-workarounds [options] path-to-kernel
> -k path-to-kernel -m path-to-mesa
>
> The legacy usage is retained to avoid breaking
> backwards compatibility. New parameters -k and
> -m are added for the new behavior.
>
> Either kernel or mesa or both paths can be specified.
> If path-to-mesa is invalid, error is reported.
>
> Signed-off-by: Sameer Kibey <sameer.kibey@intel.com>
> ---
> scripts/list-workarounds | 75 ++++++++++++++++++++++++++++++++++--------------
> 1 file changed, 54 insertions(+), 21 deletions(-)
>
> diff --git a/scripts/list-workarounds b/scripts/list-workarounds
> index d11b6a9..0b63541 100755
> --- a/scripts/list-workarounds
> +++ b/scripts/list-workarounds
> @@ -18,7 +18,7 @@ def find_nth(haystack, needle, n):
> return start
>
> valid_platforms = ('ctg', 'elk', 'ilk', 'snb', 'ivb', 'vlv', 'hsw', 'bdw',
> - 'chv', 'skl', 'bxt')
> + 'chv', 'skl', 'bxt', 'kbl', 'byt')
> def parse_platforms(line, p):
> l = p.split(',')
> for p in l:
> @@ -65,9 +65,15 @@ def execute(cmd):
> return out, err
>
> def parse_options(args):
> - usage = "Usage: list-workarounds [options] path-to-kernel"
> + usage = "Usage: list-workarounds [options] path-to-kernel -k path-to-kernel -m path-to-mesa"
> parser = optparse.OptionParser(usage, version=1.0)
>
> + parser.add_option("-k", "--kernel-path", dest="kernel_path", default=None,
> + help="path to kernel")
> +
> + parser.add_option("-m", "--mesa-path", dest="mesa_path", default=None,
> + help="path to mesa")
> +
> parser.add_option("-v", "--verbose", action="store_true",
> dest="verbose", default=False,
> help="be more verbose")
> @@ -76,30 +82,14 @@ def parse_options(args):
> help="List workarounds for the specified platform")
>
> (options, args) = parser.parse_args()
> -
> return (options, args)
>
> -if __name__ == '__main__':
> - (options, args) = parse_options(sys.argv[1:])
> - verbose = options.verbose
> -
> - if not len(args):
> - sys.stderr.write("error: A path to a kernel tree is required\n")
> - sys.exit(1)
> -
> - kernel_path = args[0]
> - kconfig = os.path.join(kernel_path, 'Kconfig')
> - if not os.path.isfile(kconfig):
> - sys.stderr.write("error: %s does not point to a kernel tree \n"
> - % kernel_path)
> - sys.exit(1)
> -
> - i915_dir = os.path.join('drivers', 'gpu', 'drm', 'i915')
> +def print_workarounds(code_path, driver_dir):
> olddir = os.getcwd()
> - os.chdir(kernel_path)
> + os.chdir(code_path)
> work_arounds, err = execute(['git', 'grep', '-n',
> '-e', 'W[aA][A-Z0-9][a-zA-Z0-9_]\+',
> - i915_dir])
> + driver_dir])
> os.chdir(olddir)
> if err:
> print(err)
> @@ -111,3 +101,46 @@ if __name__ == '__main__':
> print("%s: %s" % (wa, ', '.join(workarounds[wa])))
> elif options.platform in workarounds[wa]:
> print(wa)
> +
> +
> +if __name__ == '__main__':
> + (options, args) = parse_options(sys.argv)
> + verbose = options.verbose
> + kernel_path = None
> +
> + if not len(args) and options.kernel_path == None and options.mesa_path == None:
> + sys.stderr.write("error: A path to either a kernel tree or Mesa is required\n")
> + sys.exit(1)
> +
> + if len(args):
> + kernel_path = args[0]
> + elif options.kernel_path != None:
> + kernel_path = options.kernel_path
> +
> + if kernel_path != None:
> + # --- list Kernel workarounds if path is provided ---
> + kconfig = os.path.join(kernel_path, 'Kconfig')
> + if not os.path.isfile(kconfig):
> + sys.stderr.write("error: %s does not point to a kernel tree \n"
> + % kernel_path)
> + sys.exit(1)
> +
> + i915_dir = os.path.join('drivers', 'gpu', 'drm', 'i915')
> + print ("List of workarounds found in kernel:")
> + print_workarounds(kernel_path, i915_dir)
> +
> + # --- list mesa workarounds if path is provided ---
> + if options.mesa_path != None:
> + # reset workarounds array
> + workarounds = {}
> +
> + mesa_path = options.mesa_path
> + i965_dir = os.path.join('src', 'mesa', 'drivers', 'dri', 'i965')
> + mesa_dir = os.path.join(mesa_path, i965_dir)
> + if not os.path.exists(mesa_dir):
> + sys.stderr.write("error: %s does not point to a valid mesa path \n"
> + % mesa_path)
> + sys.exit(1)
> +
> + print ("\nList of workarounds found in Mesa:")
> + print_workarounds(mesa_path, i965_dir)
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-02-04 18:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-04 18:14 [PATCH] list-workarounds: Extend the script to Mesa Kibey, Sameer
2016-02-04 18:37 ` Jani Nikula [this message]
2016-02-05 12:15 ` Damien Lespiau
2016-02-05 19:15 ` Kibey, Sameer
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=87h9hotj8u.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=benjamin.widawsky@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mesa-dev@lists.freedesktop.org \
--cc=sameer.kibey@intel.com \
--cc=sarah.a.sharp@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.