public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: "Abodunrin, Akeem G" <akeem.g.abodunrin@intel.com>
Cc: "Nikula, Jani" <jani.nikula@intel.com>,
	"Wilson, Chris P" <chris.p.wilson@intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Bloomfield, Jon" <jon.bloomfield@intel.com>,
	"Vetter, Daniel" <daniel.vetter@intel.com>,
	"Kuoppala, Mika" <mika.kuoppala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v4 1/1] tools/generate_cb_buffer: Add script to assemble CB kernel
Date: Tue, 25 Feb 2020 11:12:55 +0200	[thread overview]
Message-ID: <20200225091255.GD3839@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <CFEEE81102D91947B9CC368106979EBAC8A18F6F@ORSMSX102.amr.corp.intel.com>

On Mon, Feb 24, 2020 at 09:38:18PM +0200, Abodunrin, Akeem G wrote:
> > > +export ASSEMBLY_SOURCE=./tools/assembly_source
> > > +
> > > +function get_help {
> > > +        echo "Usage:    asm_eu_kernel.sh [options]"
> > > +        echo "Note: hsw_clear_kernel.c/ivb_clear_kernel.c automatically
> > generated by this script should never be modified - it would be imported to
> > i915, to use as it is..."
> > > +        echo " "
> > > +        echo "Please make sure your Mesa tool is compiled with "-
> > Dtools=intel" and "-Ddri-drivers=i965", and run this script from IGT source
> > root directory"
> > > +        echo " "
> > > +        echo "Options are:"
> > > +        echo " -h                       display this help message, and exit"
> > > +        echo " -g=platform              generation of device: use "hsw" for gen7.5,
> > and "ivb" for gen7 devices"
> > > +        echo " -o=name_of_file          output file to store Mesa assembled c-
> > literal for the device - If none specified, default file will be used - ivb/hsw-
> > cb_assembled"
> > > +        echo " -m=mesa                  Mesa source directory"
> > > +        echo " "
> > > +        echo " Usage example: \"scripts/asm_eu_kernel.sh -g hsw -o
> > hsw_clear_buffer.h -m /path/to/Mesa/source/directory\""
> > > +}
> > > +
> > > +function include_array # $1=array_name {
> > > +	echo "static const u32 $(basename $1)_clear_kernel[] = {"
> > > +}
> > > +function prefix_header # $1=filename $2=comment {
> > > +	array_name=$(include_array $1)
> > > +
> > > +	cat <<EOF
> > > +// SPDX-License-Identifier: MIT
> > > +/*
> > > + * Copyright (c) 2020 Intel Corporation
> > > + *
> > > + * Generated by: IGT Gpu Tools on $(date)  */
> > > +
> > > +$array_name
> > > +EOF
> > > +}
> > > +
> > > +function postfix_footer # filename
> > > +{
> > > +	cat <<EOF
> > > +};
> > > +EOF
> > > +}
> > > +
> > > +function check_output_file #check output file {
> > > +        if [ "x$output_file" != "x" ]; then
> > > +                if [ -f "$output_file" ]; then
> > > +                        echo -e "Warning: The \"$output_file\" file already exist -
> > choose another file\n"
> > > +                        get_help
> > > +                        exit 1
> > > +                fi
> > > +        else
> > > +                # It is okay to overwrite default file created
> > > +                echo -e "Output file not specified - using default file
> > \"$gen_device-cb_assembled\"\n"
> > > +                output_file="$gen_device-cb_assembled"
> > > +        fi
> > > +}
> > > +function asm_cb_kernel # as-root <args> {
> > > +        check_output_file
> > > +
> > > +        # Using i965_asm tool to assemble hex file from assembly source
> > > +        $I965_ASM -g $gen_device -t c_literal  $input_asm_source -o
> > > + $output_file
> > > +
> > > +        # Generate header file
> > > +        if [ "$gen_device" == "hsw" ]; then
> > > +                echo "Generating gen7.5 CB Kernel assembled file
> > \"hsw_clear_kernel.c\" for i915 driver..."
> > > +
> > > +                i915_filename=hsw_clear_kernel.c
> > > +                prefix_header $gen_device > $i915_filename
> > > +                cat $output_file >> $i915_filename
> > > +                postfix_footer $i915_filename >> $i915_filename
> > > +
> > > +        elif [ "$gen_device" == "ivb" ]; then
> > > +                echo "Generating gen7 CB Kernel assembled file
> > \"ivb_clear_kernel.c\" for i915 driver..."
> > > +
> > > +                i915_filename=ivb_clear_kernel.c
> > > +                prefix_header $gen_device > $i915_filename
> > > +                cat $output_file >> $i915_filename
> > > +                postfix_footer $i915_filename >> $i915_filename
> > > +        fi
> > > +}
> > > +
> > > +while getopts "hg:o:m:" opt; do
> > > +	case $opt in
> > > +		h) get_help; exit 0;;
> > > +		g) gen_device="$OPTARG" ;;
> > > +		o) output_file="$OPTARG" ;;
> > > +                m) mesa_dir="$OPTARG" ;;
> > > +		\?)
> > > +			echo -e "Unknown option: -$OPTARG\n"
> > > +			get_help
> > > +			exit 1
> > > +			;;
> > > +	esac
> > > +done
> > > +shift $(($OPTIND-1))
> > > +
> > > +if [ "x$1" != "x" ]; then
> > > +	echo -e "Unknown option: $1\n"
> > > +	get_help
> > > +	exit 1
> > > +fi
> > > +
> > > +I965_ASM="$mesa_dir/build/debug/src/intel/tools/i965_asm"
> > 
> > Should this be $mesa_dir/build/src/intel/tools/i965_asm instead?
> > 
> > 
> > After changing that I get
> > 
> > # scripts/asm_eu_kernel.sh -m ~/src/mesa -ghsw Output file not specified -
> > using default file "hsw-cb_assembled"
> > 
> > ./tools/assembly_source/hsw_clear_buf.asm: 71: syntax error at "<"
> > Generating gen7.5 CB Kernel assembled file "hsw_clear_kernel.c" for i915
> > driver...
> > 
> > 
> > And then 'hsw-cb_assembled' is an empty file, 'hsw_clear_kernel.c'
> > contains an empty array but the script exited with success...
> > 
> > Line 71 in the asm is
> > shr(1)          g3<1>D          sr0<0,1,0>D     12D             { align1 1N };
> > 
> > 
> > 
> > --
> > Petri Latvala
> Yes, that is true - I might have forgotten to mention in the cover letter that changes to Mesa might have not been merged yet, albeit I mentioned that " The changes in the IGT GPU tool require latest Mesa tool to work correctly"  So, without new changes to assembler/disassembler in the Mesa tool, you will see those error messages.


Do you have a MR link so I could test the script?

-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-02-25  9:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21  8:22 [igt-dev] [PATCH i-g-t v4 0/1] Support to assemble CB kernel for gen7 Akeem G Abodunrin
2020-02-21  8:22 ` [igt-dev] [PATCH i-g-t v4 1/1] tools/generate_cb_buffer: Add script to assemble CB kernel Akeem G Abodunrin
2020-02-24  9:48   ` Petri Latvala
2020-02-24 13:47     ` Ville Syrjälä
2020-02-24 18:47       ` Abodunrin, Akeem G
2020-02-25  9:12       ` Petri Latvala
2020-02-25 11:27         ` Ville Syrjälä
2020-02-24 19:38     ` Abodunrin, Akeem G
2020-02-25  9:12       ` Petri Latvala [this message]
2020-02-21 16:31 ` [igt-dev] ✓ Fi.CI.BAT: success for Support to assemble CB kernel for gen7 (rev3) Patchwork
2020-02-24 11:37 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

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=20200225091255.GD3839@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=akeem.g.abodunrin@intel.com \
    --cc=chris.p.wilson@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=jon.bloomfield@intel.com \
    --cc=mika.kuoppala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox