Skip to contentSkip to conversation

drm/i915/guc: Unify naming of private GuC action functions

PATCH Superseded Michal Wajdeczko 3 participants 5 messages Mar 14, 2018 – Mar 15, 2018

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/guc: Unify naming of private GuC action functions

We should avoid using guc_log prefix for functions that don't operate on GuC log, but rather request action from the GuC. Better to use guc_action prefix.

Cc Michal Winiarski <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
 drivers/gpu/drm/i915/intel_guc_log.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_guc_log.c +9 -7
index b9c7bd7..457168a 100644
@@ -39,7 +39,7 @@
  * registers value.
  */
 
-static int guc_log_flush_complete(struct intel_guc *guc)
+static int guc_action_flush_log_complete(struct intel_guc *guc)
 {
 	u32 action[] = {
 		INTEL_GUC_ACTION_LOG_BUFFER_FILE_FLUSH_COMPLETE
@@ -48,7 +48,7 @@ static int guc_log_flush_complete(struct intel_guc *guc)
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
-static int guc_log_flush(struct intel_guc *guc)
+static int guc_action_flush_log(struct intel_guc *guc)
 {
 	u32 action[] = {
 		INTEL_GUC_ACTION_FORCE_LOG_BUFFER_FLUSH,
@@ -58,7 +58,8 @@ static int guc_log_flush(struct intel_guc *guc)
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
-static int guc_log_control(struct intel_guc *guc, bool enable, u32 verbosity)
+static int guc_action_enable_log(struct intel_guc *guc, bool enable,
+				 u32 verbosity)
 {
 	union guc_log_control control_val = {
 		{
@@ -525,7 +526,7 @@ static void guc_log_capture_logs(struct intel_guc *guc)
 	 * time, so get/put should be really quick.
 	 */
 	intel_runtime_pm_get(dev_priv);
-	guc_log_flush_complete(guc);
+	guc_action_flush_log_complete(guc);
 	intel_runtime_pm_put(dev_priv);
 }
 
@@ -541,7 +542,7 @@ static void guc_flush_logs(struct intel_guc *guc)
 
 	/* Ask GuC to update the log buffer state */
 	intel_runtime_pm_get(dev_priv);
-	guc_log_flush(guc);
+	guc_action_flush_log(guc);
 	intel_runtime_pm_put(dev_priv);
 
 	/* GuC would have updated log buffer by now, so capture it */
@@ -639,10 +640,11 @@ int intel_guc_log_control_set(struct intel_guc *guc, u64 val)
 	}
 
 	intel_runtime_pm_get(dev_priv);
-	ret = guc_log_control(guc, enabled, LOG_LEVEL_TO_VERBOSITY(val));
+	ret = guc_action_enable_log(guc, enabled, LOG_LEVEL_TO_VERBOSITY(val));
 	intel_runtime_pm_put(dev_priv);
 	if (ret) {
-		DRM_DEBUG_DRIVER("guc_log_control action failed %d\n", ret);
+		DRM_DEBUG_DRIVER("GuC action to %s log failed (%d)\n",
+				 enabled ? "enable" : "disable", ret);
 		goto out_unlock;
 	}
 
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.BAT: warning for drm/i915/guc: Unify naming of private GuC action functions

== Series Details ==

== Series Details ==

Series: drm/i915/guc: Unify naming of private GuC action functions
URL : https://patchwork.freedesktop.org/series/39982/
State : warning

== Summary ==

Series 39982v1 drm/i915/guc: Unify naming of private GuC action functions
https://patchwork.freedesktop.org/api/1.0/series/39982/revisions/1/mbox/

---- Possible new issues:

Test kms_flip:

        Subgroup basic-flip-vs-wf_vblank:
                fail       -> PASS       (fi-skl-6770hq)
Test kms_force_connector_basic:
        Subgroup force-connector-state:
                pass       -> SKIP       (fi-ivb-3520m)
        Subgroup force-edid:
                pass       -> SKIP       (fi-ivb-3520m)
        Subgroup force-load-detect:
                pass       -> SKIP       (fi-ivb-3520m)
        Subgroup prune-stale-modes:
                pass       -> SKIP       (fi-ivb-3520m)

---- Known issues:

Test kms_pipe_crc_basic:

        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:285  pass:264  dwarn:0   dfail:0   fail:0   skip:21  time:436s
fi-bdw-gvtdvm    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:441s
fi-blb-e6850     total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:378s
fi-bsw-n3050     total:285  pass:239  dwarn:0   dfail:0   fail:0   skip:46  time:535s
fi-bwr-2160      total:285  pass:180  dwarn:0   dfail:0   fail:0   skip:105 time:297s
fi-bxt-dsi       total:285  pass:255  dwarn:0   dfail:0   fail:0   skip:30  time:511s
fi-byt-j1900     total:285  pass:250  dwarn:0   dfail:0   fail:0   skip:35  time:517s
fi-byt-n2820     total:285  pass:246  dwarn:0   dfail:0   fail:0   skip:39  time:503s
fi-cfl-8700k     total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:409s
fi-cfl-s2        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:580s
fi-cfl-u         total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:509s
fi-cnl-y3        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:588s
fi-elk-e7500     total:285  pass:226  dwarn:0   dfail:0   fail:0   skip:59  time:425s
fi-gdg-551       total:285  pass:176  dwarn:0   dfail:0   fail:1   skip:108 time:315s
fi-glk-1         total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:532s
fi-hsw-4770      total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:402s
fi-ilk-650       total:285  pass:225  dwarn:0   dfail:0   fail:0   skip:60  time:421s
fi-ivb-3520m     total:285  pass:252  dwarn:0   dfail:0   fail:0   skip:33  time:471s
fi-ivb-3770      total:285  pass:252  dwarn:0   dfail:0   fail:0   skip:33  time:430s
fi-kbl-7500u     total:285  pass:260  dwarn:1   dfail:0   fail:0   skip:24  time:478s
fi-kbl-7567u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:462s
fi-kbl-r         total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:514s
fi-pnv-d510      total:285  pass:219  dwarn:1   dfail:0   fail:0   skip:65  time:662s
fi-skl-6260u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:436s
fi-skl-6600u     total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:531s
fi-skl-6700hq    total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:540s
fi-skl-6700k2    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:506s
fi-skl-6770hq    total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:491s
fi-skl-guc       total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:425s
fi-skl-gvtdvm    total:285  pass:262  dwarn:0   dfail:0   fail:0   skip:23  time:446s
fi-snb-2520m     total:242  pass:208  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:399s

Blacklisted hosts:
fi-cnl-drrs total:285 pass:254 dwarn:3 dfail:0 fail:0 skip:28 time:546s

86e964296fe8bc85fdb624fa75b4cd83fcfb58cd drm-tip: 2018y-03m-14d-17h-40m-20s UTC integration manifest 4a9184965adc drm/i915/guc: Unify naming of private GuC action functions

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8350/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Michal Wajdeczko
Quoted 34 lines · Michal Wajdeczko

We should avoid using guc_log prefix for functions that don't operate on GuC log, but rather request action from the GuC. Better to use guc_action prefix.

Cc Michal Winiarski <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
 drivers/gpu/drm/i915/intel_guc_log.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_guc_log.c +2 -2
index b9c7bd7..457168a 100644
@@ -39,7 +39,7 @@
  * registers value.
  */
 
-static int guc_log_flush_complete(struct intel_guc *guc)
+static int guc_action_flush_log_complete(struct intel_guc *guc)
 {
 	u32 action[] = {
 		INTEL_GUC_ACTION_LOG_BUFFER_FILE_FLUSH_COMPLETE
@@ -48,7 +48,7 @@ static int guc_log_flush_complete(struct intel_guc *guc)
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
-static int guc_log_flush(struct intel_guc *guc)
+static int guc_action_flush_log(struct intel_guc *guc)
 {
 	u32 action[] = {
 		INTEL_GUC_ACTION_FORCE_LOG_BUFFER_FLUSH,

drivers/gpu/drm/i915/intel_guc_log.c static int guc_log_flush(struct intel_guc *guc) · line 62

Quoted 6 lines
drivers/gpu/drm/i915/intel_guc_log.c +2 -1
@@ -58,7 +58,8 @@ static int guc_log_flush(struct intel_guc *guc)
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
-static int guc_log_control(struct intel_guc *guc, bool enable, u32 verbosity)
+static int guc_action_enable_log(struct intel_guc *guc, bool enable,
+				 u32 verbosity)

Let's hide the fact that the actual action is called "ENABLE_LOGGING", and stick with guc_action_log_control, especially since we're using guc_log_control union, and the action itself is also used for verbosity (and default log... more than just enable/disable switch).

With that:

-Michał

Quoted 38 lines
drivers/gpu/drm/i915/intel_guc_log.c +5 -4
 {
 	union guc_log_control control_val = {
 		{
@@ -525,7 +526,7 @@ static void guc_log_capture_logs(struct intel_guc *guc)
 	 * time, so get/put should be really quick.
 	 */
 	intel_runtime_pm_get(dev_priv);
-	guc_log_flush_complete(guc);
+	guc_action_flush_log_complete(guc);
 	intel_runtime_pm_put(dev_priv);
 }
 
@@ -541,7 +542,7 @@ static void guc_flush_logs(struct intel_guc *guc)
 
 	/* Ask GuC to update the log buffer state */
 	intel_runtime_pm_get(dev_priv);
-	guc_log_flush(guc);
+	guc_action_flush_log(guc);
 	intel_runtime_pm_put(dev_priv);
 
 	/* GuC would have updated log buffer by now, so capture it */
@@ -639,10 +640,11 @@ int intel_guc_log_control_set(struct intel_guc *guc, u64 val)
 	}
 
 	intel_runtime_pm_get(dev_priv);
-	ret = guc_log_control(guc, enabled, LOG_LEVEL_TO_VERBOSITY(val));
+	ret = guc_action_enable_log(guc, enabled, LOG_LEVEL_TO_VERBOSITY(val));
 	intel_runtime_pm_put(dev_priv);
 	if (ret) {
-		DRM_DEBUG_DRIVER("guc_log_control action failed %d\n", ret);
+		DRM_DEBUG_DRIVER("GuC action to %s log failed (%d)\n",
+				 enabled ? "enable" : "disable", ret);
 		goto out_unlock;
 	}
 
Signature · 1 line
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 39 lines · Michał Winiarski
Quoted 38 lines · Michal Wajdeczko

We should avoid using guc_log prefix for functions that don't operate on GuC log, but rather request action from the GuC. Better to use guc_action prefix.

Cc Michal Winiarski <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
 drivers/gpu/drm/i915/intel_guc_log.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_guc_log.c +2 -2
index b9c7bd7..457168a 100644
@@ -39,7 +39,7 @@
  * registers value.
  */
 
-static int guc_log_flush_complete(struct intel_guc *guc)
+static int guc_action_flush_log_complete(struct intel_guc *guc)
 {
 	u32 action[] = {
 		INTEL_GUC_ACTION_LOG_BUFFER_FILE_FLUSH_COMPLETE
@@ -48,7 +48,7 @@ static int guc_log_flush_complete(struct intel_guc  
 *guc)
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
-static int guc_log_flush(struct intel_guc *guc)
+static int guc_action_flush_log(struct intel_guc *guc)
 {
 	u32 action[] = {
drivers/gpu/drm/i915/intel_guc_log.c +0 -0
 		INTEL_GUC_ACTION_FORCE_LOG_BUFFER_FLUSH,
@@ -58,7 +58,8 @@ static int guc_log_flush(struct intel_guc *guc)
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
Quoted 9 lines

drivers/gpu/drm/i915/intel_guc_log.c static int guc_log_flush(struct intel_guc *guc) · line 62

Quoted 4 lines
drivers/gpu/drm/i915/intel_guc_log.c +2 -1
-static int guc_log_control(struct intel_guc *guc, bool enable, u32  
 verbosity)
+static int guc_action_enable_log(struct intel_guc *guc, bool enable,
+				 u32 verbosity)

Let's hide the fact that the actual action is called "ENABLE_LOGGING", and stick with guc_action_log_control, especially since we're using guc_log_control union, and the action itself is also used for verbosity (and default log... more than just enable/disable switch).

Hmm, I think that using action name as base for function is right thing. If in your opinion action name is not correct, we should start with action rename first.

And I would rather prefer to drop definition of union guc_log_control and replace it with set of SHIFT/MASK macros as we do for other bitfields.

Also using actual action name as base for new function name, we could avoid having yet another [log|control|log] function name permutation.

But I'm flexible ;)

Quoted 45 lines

With that:

-Michał

Quoted 38 lines
drivers/gpu/drm/i915/intel_guc_log.c +0 -0
 {
 	union guc_log_control control_val = {
drivers/gpu/drm/i915/intel_guc_log.c +5 -4
 		{
@@ -525,7 +526,7 @@ static void guc_log_capture_logs(struct intel_guc  
 *guc)
 	 * time, so get/put should be really quick.
 	 */
 	intel_runtime_pm_get(dev_priv);
-	guc_log_flush_complete(guc);
+	guc_action_flush_log_complete(guc);
 	intel_runtime_pm_put(dev_priv);
 }
@@ -541,7 +542,7 @@ static void guc_flush_logs(struct intel_guc *guc)
 
 	/* Ask GuC to update the log buffer state */
 	intel_runtime_pm_get(dev_priv);
-	guc_log_flush(guc);
+	guc_action_flush_log(guc);
 	intel_runtime_pm_put(dev_priv);
 
 	/* GuC would have updated log buffer by now, so capture it */
@@ -639,10 +640,11 @@ int intel_guc_log_control_set(struct intel_guc  
 *guc, u64 val)
 	}
 
 	intel_runtime_pm_get(dev_priv);
-	ret = guc_log_control(guc, enabled, LOG_LEVEL_TO_VERBOSITY(val));
+	ret = guc_action_enable_log(guc, enabled,  
 LOG_LEVEL_TO_VERBOSITY(val));
 	intel_runtime_pm_put(dev_priv);
 	if (ret) {
-		DRM_DEBUG_DRIVER("guc_log_control action failed %d\n", ret);
+		DRM_DEBUG_DRIVER("GuC action to %s log failed (%d)\n",
+				 enabled ? "enable" : "disable", ret);
 		goto out_unlock;

}

Quoted 2 lines
Quoted 2 lines

--
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 56 lines · Michal Wajdeczko
Quoted 40 lines · Michał Winiarski
Quoted 39 lines · Michal Wajdeczko

We should avoid using guc_log prefix for functions that don't operate on GuC log, but rather request action from the GuC. Better to use guc_action prefix.

Cc Michal Winiarski <[email protected]>
Cc Sagar Arun Kamble <[email protected]>
---
 drivers/gpu/drm/i915/intel_guc_log.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_guc_log.c +2 -2
index b9c7bd7..457168a 100644
@@ -39,7 +39,7 @@
  * registers value.
  */
 
-static int guc_log_flush_complete(struct intel_guc *guc)
+static int guc_action_flush_log_complete(struct intel_guc *guc)
 {
 	u32 action[] = {
 		INTEL_GUC_ACTION_LOG_BUFFER_FILE_FLUSH_COMPLETE
@@ -48,7 +48,7 @@ static int guc_log_flush_complete(struct intel_guc
 *guc)
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
-static int guc_log_flush(struct intel_guc *guc)
+static int guc_action_flush_log(struct intel_guc *guc)
 {
 	u32 action[] = {
drivers/gpu/drm/i915/intel_guc_log.c +0 -0
 		INTEL_GUC_ACTION_FORCE_LOG_BUFFER_FLUSH,
@@ -58,7 +58,8 @@ static int guc_log_flush(struct intel_guc *guc)
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
Quoted 12 lines

drivers/gpu/drm/i915/intel_guc_log.c static int guc_log_flush(struct intel_guc *guc) · line 62

Quoted 4 lines
drivers/gpu/drm/i915/intel_guc_log.c +2 -1
-static int guc_log_control(struct intel_guc *guc, bool enable, u32
 verbosity)
+static int guc_action_enable_log(struct intel_guc *guc, bool enable,
+				 u32 verbosity)

Let's hide the fact that the actual action is called "ENABLE_LOGGING", and stick
with guc_action_log_control, especially since we're using guc_log_control union,
and the action itself is also used for verbosity (and default log... more than
just enable/disable switch).

Quoted 3 lines

Hmm, I think that using action name as base for function is right thing. If in your opinion action name is not correct, we should start with action rename first.

Nooo, then we're going to have i915/GuC mismatch :/

Quoted 2 lines

And I would rather prefer to drop definition of union guc_log_control and replace it with set of SHIFT/MASK macros as we do for other bitfields.

Sure - why not.

Quoted 2 lines

Also using actual action name as base for new function name, we could avoid having yet another [log|control|log] function name permutation.

We're not consistent with maching action/function name, and I think 4 arguments "enable" function is going to be really confusing. But I don't have a strong opinion here, it's going to be used in a single place, and it has "guc_action_*" warning sign now ;)

-Michał

Quoted 27 lines

But I'm flexible ;)

Quoted 25 lines

With that:

-Michał

Quoted 18 lines
drivers/gpu/drm/i915/intel_guc_log.c +3 -2
 	/* GuC would have updated log buffer by now, so capture it */
@@ -639,10 +640,11 @@ int intel_guc_log_control_set(struct intel_guc
 *guc, u64 val)
 	}
 
 	intel_runtime_pm_get(dev_priv);
-	ret = guc_log_control(guc, enabled, LOG_LEVEL_TO_VERBOSITY(val));
+	ret = guc_action_enable_log(guc, enabled,
 LOG_LEVEL_TO_VERBOSITY(val));
 	intel_runtime_pm_put(dev_priv);
 	if (ret) {
-		DRM_DEBUG_DRIVER("guc_log_control action failed %d\n", ret);
+		DRM_DEBUG_DRIVER("GuC action to %s log failed (%d)\n",
+				 enabled ? "enable" : "disable", ret);
 		goto out_unlock;

}

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

--
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx