Re: [igt-dev] [PATCH i-g-t 1/1] tools/generate_cb_buffer: Add script to assemble CB kernel

Abodunrin, Akeem G
2020-02-20T01:06:11Z

> > +export ASSEMBLY_SOURCE=./tools/assembly_source
> > +
> > +function get_help {
> > + echo "Usage: asm_eu_kernel.sh [options]"
> > + echo "Remember to run this as root"
>
> I can't spot why this would need root.
Since we are generating new file, and writing to it - the script definitely needs root access... otherwise commands like this " prefix_header $i915_filename "Media CB Kernel for gen7.5 devices"" fails
>
>
> > + echo " "
> > + echo "Please make sure your MESA tool is compiled, and run this script
> from igt home directory"
>
> Mesa written as "Mesa" and IGT written as "IGT". And it's "source root
> directory", not "home directory".
>
> Does the assembler require specific build options for Mesa? Note them here.

Yes, it does - but the options are hardcoded in this script - so, mentioning them in the help function is irrelevant...
> > +
> > +if [ "x$gen_device" != "x" ]; then
> > + if [ "$gen_device" == "hsw" ]; then
> > + input_asm_source="${ASSEMBLY_SOURCE}/hsw_clear_buf.asm"
> > + elif [ "$gen_device" == "ivb" ]; then
> > + input_asm_source="${ASSEMBLY_SOURCE}/ivb_clear_buf.asm"
> > + else
> > + echo "Unknown platform specified"
> > + get_help
> > + exit 1
> > + fi
> > + asm_cb_kernel
> > +fi
>
> If -g is not given at all, the script exits silently.
Good catch!

Thanks,
~Akeem