File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed
Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (C) 2018-2019 Intel Corporation
2+ * Copyright (C) 2018-2020 Intel Corporation
33 *
44 * SPDX-License-Identifier: MIT
55 *
@@ -297,7 +297,13 @@ size_t CmdParse<T>::getCommandLength(void *cmd) {
297297 if (pCmd)
298298 return pCmd->TheStructure .Common .DwordLength + 2 ;
299299 }
300- return getCommandLengthHwSpecific (cmd);
300+
301+ auto commandLengthHwSpecific = getCommandLengthHwSpecific (cmd);
302+
303+ if (commandLengthHwSpecific != 0 ) {
304+ return commandLengthHwSpecific;
305+ }
306+ return getAdditionalCommandLength (cmd);
301307}
302308
303309template <class T >
@@ -327,5 +333,20 @@ const char *CmdParse<T>::getCommandName(void *cmd) {
327333
328334#undef RETURN_NAME_IF
329335
330- return getCommandNameHwSpecific (cmd);
336+ auto commandNameHwSpecific = getCommandNameHwSpecific (cmd);
337+ if (strcmp (commandNameHwSpecific, " UNKNOWN" ) != 0 ) {
338+ return commandNameHwSpecific;
339+ }
340+
341+ return getAdditionalCommandName (cmd);
342+ }
343+
344+ template <class T >
345+ size_t CmdParse<T>::getAdditionalCommandLength(void *cmd) {
346+ return 0 ;
347+ }
348+
349+ template <class T >
350+ const char *CmdParse<T>::getAdditionalCommandName(void *cmd) {
351+ return " UNKNOWN" ;
331352}
Original file line number Diff line number Diff line change 11/*
2- * Copyright (C) 2017-2019 Intel Corporation
2+ * Copyright (C) 2017-2020 Intel Corporation
33 *
44 * SPDX-License-Identifier: MIT
55 *
@@ -90,6 +90,7 @@ template <class T>
9090struct CmdParse : public T {
9191 static size_t getCommandLength (void *cmd);
9292 static size_t getCommandLengthHwSpecific (void *cmd);
93+ static size_t getAdditionalCommandLength (void *cmd);
9394
9495 static bool parseCommandBuffer (GenCmdList &_cmds, void *_buffer, size_t _length);
9596
@@ -98,4 +99,5 @@ struct CmdParse : public T {
9899
99100 static const char *getCommandName (void *cmd);
100101 static const char *getCommandNameHwSpecific (void *cmd);
102+ static const char *getAdditionalCommandName (void *cmd);
101103};
You can’t perform that action at this time.
0 commit comments