All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <luben.tuikov@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: "Alex Deucher" <Alexander.Deucher@amd.com>,
	"Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
	"Luben Tuikov" <luben.tuikov@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Tom StDenis" <tom.stdenis@amd.com>
Subject: [PATCH 4/6] umr: Replace and reuse asic.ipblock.reg completion
Date: Wed, 23 Mar 2022 07:48:40 -0400	[thread overview]
Message-ID: <20220323114842.78516-5-luben.tuikov@amd.com> (raw)
In-Reply-To: <20220323114842.78516-1-luben.tuikov@amd.com>

Replace and reuse asic.ipblock.reg completion.

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Cc: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Cc: Tom StDenis <tom.stdenis@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
---
 scripts/umr-completion.bash | 26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/scripts/umr-completion.bash b/scripts/umr-completion.bash
index 7029264ca5f725..ab1637a090e5d6 100644
--- a/scripts/umr-completion.bash
+++ b/scripts/umr-completion.bash
@@ -55,27 +55,6 @@ _umr_comp_blocks()
     fi
 }
 
-_umr_comp_regs()
-{
-    _umr_setup_ips
-
-    if [[ "$cur" =~ ^[^.]*'.'[^.]*'.'[^.]*$ ]]; then
-        cur_asic="${cur%%.*}"
-        substr="${cur#*.}"
-        cur_ip="${substr%.*}"
-        if [[ "${ip_names[@]}" =~ "$cur_ip" ]] && [[ $cur_asic = $asicname || $cur_asic = "*" ]]; then
-            reg_names=( $(sudo $(which umr) $select_gpu -lr $asicname.$cur_ip | grep -o "$asicname\.$cur_ip\.\w\+") )
-            COMPREPLY=( $(compgen -W "${reg_names[*]/$asicname/$cur_asic}" -- "$cur") )
-        fi
-    elif [ -n "$cur" ]; then
-        local array=( "${ips[@]}" "${ip_names[@]/#/*.}" )
-        COMPREPLY=( $(compgen -W "${array[*]/%/.}" -- "$cur") )
-        compopt -o nospace
-    else
-        COMPREPLY=( $(compgen -W "${ips[*]/%/.}" -- "$cur") )
-    fi
-}
-
 _umr_comp_option_flags()
 {
     local FLAGS=(bits bitsfull empty_log follow no_follow_ib use_pci use_colour read_smc quiet no_kernel verbose halt_waves disasm_early_term no_disasm disasm_anyways wave64 full_shader no_fold_vm_decode no_scan_waves)
@@ -396,13 +375,10 @@ _umr_completion()
         -lr|--list-regs|-s|--scan)
             _umr_comp_blocks
             ;;
-        -r|--read|-w|--write)
-            _umr_comp_regs
-            ;;
 	--lookup|-lu)
 	    _umr_comp_lookup
 	    ;;
-	--writebit|-wb)
+	-r|--read|-w|--write|--writebit|-wb)
 	    _umr_comp_asic_ipblock_registers
 	    ;;
 	--waves|-wa)
-- 
2.35.1.607.gf01e51a7cf


  parent reply	other threads:[~2022-03-23 11:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 11:48 [PATCH 0/6] Complete and add dynamic completion to umr Luben Tuikov
2022-03-23 11:48 ` [PATCH 1/6] umr: Rename "scripts/umr" --> "scripts/umr-completion.bash" Luben Tuikov
2022-03-23 11:48 ` [PATCH 2/6] umr: Rename completion function Luben Tuikov
2022-03-23 11:48 ` [PATCH 3/6] umr: Complete umr completion Luben Tuikov
2022-03-23 11:48 ` Luben Tuikov [this message]
2022-03-23 11:48 ` [PATCH 5/6] umr: Replace and reuse ipblock completion Luben Tuikov
2022-03-23 11:48 ` [PATCH 6/6] umr: Add FILES section to the man page Luben Tuikov
2022-03-23 12:01 ` [PATCH 0/6] Complete and add dynamic completion to umr StDenis, Tom

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=20220323114842.78516-5-luben.tuikov@amd.com \
    --to=luben.tuikov@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    --cc=tom.stdenis@amd.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.