drm/i915/guc: Unify naming of private GuC action functions
Subsystems (2)
PATCH v2 1/3 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.
v2: rebase + naming compromise
--- drivers/gpu/drm/i915/intel_guc_log.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/intel_guc_log.c +9 -9
@@ -38,7 +38,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
@@ -47,7 +47,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 ,
@@ -57,8 +57,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, -bool default_logging,u32 verbosity) +static int guc_action_control_log (struct intel_guc *guc,bool enable, +bool default_logging,u32 verbosity) {union guc_log_control control_val = { {
@@ -449,7 +449,7 @@ static void guc_log_capture_logs(struct intel_guc_log *log)* 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); }
@@ -527,9 +527,9 @@ int intel_guc_log_level_set(struct intel_guc_log *log, u64 val) }intel_runtime_pm_get (dev_priv); - ret =guc_log_control (guc,GUC_LOG_LEVEL_TO_VERBOSE (val), -GUC_LOG_LEVEL_TO_ENABLED (val), -GUC_LOG_LEVEL_TO_VERBOSITY (val)); + ret =guc_action_control_log (guc,GUC_LOG_LEVEL_TO_VERBOSE (val), +GUC_LOG_LEVEL_TO_ENABLED (val), +GUC_LOG_LEVEL_TO_VERBOSITY (val));intel_runtime_pm_put (dev_priv);if (ret) {DRM_DEBUG_DRIVER ("guc_log_control action failed %d\n" , ret);
@@ -611,7 +611,7 @@ void intel_guc_log_relay_flush(struct intel_guc_log *log)flush_work (&log->relay.flush_work);intel_runtime_pm_get (i915); -guc_log_flush (guc); +guc_action_flush_log (guc);intel_runtime_pm_put (i915);/* GuC would have updated log buffer by now, so capture it */
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/3 drm/i915/guc: Drop union guc_log_control
Usually we use shift/mask macros for bit field definitions. Union guc_log_control was not following that pattern.
Additional bonus:
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-25 (-25)
Function old new delta intel_guc_log_level_set 388 363 -25
--- drivers/gpu/drm/i915/intel_guc_fwif.h | 16 +++++----------- drivers/gpu/drm/i915/intel_guc_log.c | 11 +++-------- 2 files changed, 8 insertions(+), 19 deletions(-)
drivers/gpu/drm/i915/intel_guc_fwif.h +5 -11
@@ -534,17 +534,6 @@ struct guc_log_buffer_state {u32 version; } __packed; -union guc_log_control { -struct { -u32 logging_enabled:1 ; -u32 reserved1:3 ; -u32 verbosity:4 ; -u32 default_logging:1 ; -u32 reserved2:23 ; - }; -u32 value; -} __packed; -struct guc_ctx_report {u32 report_return_status;u32 reserved1[64 ];
@@ -603,6 +592,11 @@ enum intel_guc_report_status { INTEL_GUC_REPORT_STATUS_COMPLETE = 0x4, }; +#define GUC_LOG_CONTROL_LOGGING_ENABLED (1 << 0) +#define GUC_LOG_CONTROL_VERBOSITY_SHIFT 4 +#define GUC_LOG_CONTROL_VERBOSITY_MASK (0xF << GUC_LOG_CONTROL_VERBOSITY_SHIFT) +#define GUC_LOG_CONTROL_DEFAULT_LOGGING (1 << 8) +/* * The GuC sends its response to a command by overwriting the * command in SS0. The response is distinguishable from a command
drivers/gpu/drm/i915/intel_guc_log.c +3 -8
@@ -60,16 +60,11 @@ static int guc_action_flush_log(struct intel_guc *guc)static int guc_action_control_log (struct intel_guc *guc,bool enable,bool default_logging,u32 verbosity) { -union guc_log_control control_val = { - { - .logging_enabled = enable, - .verbosity = verbosity, - .default_logging = default_logging, - }, - };u32 action[] = {INTEL_GUC_ACTION_UK_LOG_ENABLE_LOGGING , - control_val.value + (enable ?GUC_LOG_CONTROL_LOGGING_ENABLED :0 ) | + (verbosity <<GUC_LOG_CONTROL_VERBOSITY_SHIFT ) | + (default_logging ?GUC_LOG_CONTROL_DEFAULT_LOGGING :0 ) };return intel_guc_send (guc, action,ARRAY_SIZE (action));
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 2/3] drm/i915/guc: Drop union guc_log_control
Quoted 40 lines · Michal Wajdeczko
Usually we use shift/mask macros for bit field definitions. Union
guc_log_controlwas not following that pattern.Additional bonus:
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-25 (-25)
Function old new delta intel_guc_log_level_set 388 363 -25Signed-off-by Michal Wajdeczko <[email protected]>Cc Michal Winiarski <[email protected]>Cc Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_guc_fwif.h | 16 +++++----------- drivers/gpu/drm/i915/intel_guc_log.c | 11 +++-------- 2 files changed, 8 insertions(+), 19 deletions(-)drivers/gpu/drm/i915/intel_guc_fwif.h +0
-11@@ -534,17 +534,6 @@ struct guc_log_buffer_state {u32 version; } __packed; -union guc_log_control { -struct { -u32 logging_enabled:1 ; -u32 reserved1:3 ; -u32 verbosity:4 ; -u32 default_logging:1 ; -u32 reserved2:23 ; - }; -u32 value; -} __packed; -struct guc_ctx_report {u32 report_return_status;u32 reserved1[64 ];
drivers/gpu/drm/i915/intel_guc_fwif.h enum intel_guc_report_status { · line 597
Quoted 6 lines
drivers/gpu/drm/i915/intel_guc_fwif.h +3
-0@@ -603,6 +592,11 @@ enum intel_guc_report_status { INTEL_GUC_REPORT_STATUS_COMPLETE = 0x4, }; +#define GUC_LOG_CONTROL_LOGGING_ENABLED (1 << 0) +#define GUC_LOG_CONTROL_VERBOSITY_SHIFT 4 +#define GUC_LOG_CONTROL_VERBOSITY_MASK (0xF << GUC_LOG_CONTROL_VERBOSITY_SHIFT)
You're not using the mask anywhere. Is it just to describe the iface? Or was it supposed to be used in guc_action_control_log? (there's a slight change in behavior here, which may lead to confusion when passing out-of-range verbosity)
-Michał
Quoted 32 lines
drivers/gpu/drm/i915/intel_guc_fwif.h +2
-0+#define GUC_LOG_CONTROL_DEFAULT_LOGGING (1 << 8) +/* * The GuC sends its response to a command by overwriting the * command in SS0. The response is distinguishable from a command drivers/gpu/drm/i915/intel_guc_log.c +3
-8@@ -60,16 +60,11 @@ static int guc_action_flush_log(struct intel_guc *guc)static int guc_action_control_log (struct intel_guc *guc,bool enable,bool default_logging,u32 verbosity) { -union guc_log_control control_val = { - { - .logging_enabled = enable, - .verbosity = verbosity, - .default_logging = default_logging, - }, - };u32 action[] = {INTEL_GUC_ACTION_UK_LOG_ENABLE_LOGGING , - control_val.value + (enable ?GUC_LOG_CONTROL_LOGGING_ENABLED :0 ) | + (verbosity <<GUC_LOG_CONTROL_VERBOSITY_SHIFT ) | + (default_logging ?GUC_LOG_CONTROL_DEFAULT_LOGGING :0 ) };return intel_guc_send (guc, action,ARRAY_SIZE (action));Signature · 1 line
1.9.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 2/3] drm/i915/guc: Drop union guc_log_control
Quoted 44 lines · Michał Winiarski
Quoted 43 lines · Michal Wajdeczko
Usually we use shift/mask macros for bit field definitions. Union
guc_log_controlwas not following that pattern.Additional bonus:
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-25 (-25)
Function old new delta intel_guc_log_level_set 388 363 -25Signed-off-by Michal Wajdeczko <[email protected]>Cc Michal Winiarski <[email protected]>Cc Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_guc_fwif.h | 16 +++++----------- drivers/gpu/drm/i915/intel_guc_log.c | 11 +++-------- 2 files changed, 8 insertions(+), 19 deletions(-)drivers/gpu/drm/i915/intel_guc_fwif.h +0
-11@@ -534,17 +534,6 @@ struct guc_log_buffer_state {u32 version; } __packed; -union guc_log_control { -struct { -u32 logging_enabled:1 ; -u32 reserved1:3 ; -u32 verbosity:4 ; -u32 default_logging:1 ; -u32 reserved2:23 ; - }; -u32 value; -} __packed; -struct guc_ctx_report {u32 report_return_status;u32 reserved1[64 ];@@ -603,6 +592,11 @@ enum intel_guc_report_status { INTEL_GUC_REPORT_STATUS_COMPLETE = 0x4, };
Quoted 6 lines
drivers/gpu/drm/i915/intel_guc_fwif.h enum intel_guc_report_status {
Quoted 4 lines
drivers/gpu/drm/i915/intel_guc_fwif.h +3
-0+#define GUC_LOG_CONTROL_LOGGING_ENABLED (1 << 0) +#define GUC_LOG_CONTROL_VERBOSITY_SHIFT 4 +#define GUC_LOG_CONTROL_VERBOSITY_MASK (0xF << GUC_LOG_CONTROL_VERBOSITY_SHIFT)You're not using the mask anywhere. Is it just to describe the iface?
yep, only bit-field interface
Quoted 3 lines
Or was it supposed to be used in
guc_action_control_log? (there's a slight change in behavior here, which may lead to confusion when passing out-of-range verbosity)
As you already check for out-of-range verbosity level passed by user:
if (val < GUC_LOG_LEVEL_DISABLED || val > GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX)) return -EINVAL;
I can make my check in guc_action() more assertive:
GEM_BUG_ON(verbosity > GUC_LOG_VERBOSITY_MAX)
Thanks,
/m
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 3/3 drm/i915/guc: Move enable/disable msg functions to GuC header
In reply to Michal WajdeczkoWhile today we are modifying GuC enabled msg mask only in GuC log, this code should be defined as generic GuC to allow future code reuse.
--- drivers/gpu/drm/i915/intel_guc.h | 14 ++++++++++++++ drivers/gpu/drm/i915/intel_guc_log.c | 26 ++++++++++++-------------- 2 files changed, 26 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/intel_guc.h +14 -0
@@ -155,4 +155,18 @@ static inline int intel_guc_sanitize(struct intel_guc *guc) return 0; } +static inline void intel_guc_enable_msg (struct intel_guc *guc,u32 mask) +{ +spin_lock_irq (&guc->irq_lock); + guc->msg_enabled_mask |= mask; +spin_unlock_irq (&guc->irq_lock); +} + +static inline void intel_guc_disable_msg (struct intel_guc *guc,u32 mask) +{ +spin_lock_irq (&guc->irq_lock); + guc->msg_enabled_mask &= ~mask; +spin_unlock_irq (&guc->irq_lock); +} +#endif
drivers/gpu/drm/i915/intel_guc_log.c +12 -14
@@ -70,25 +70,23 @@ static int guc_action_control_log(struct intel_guc *guc, bool enable,return intel_guc_send (guc, action,ARRAY_SIZE (action)); } -static void guc_flush_log_msg_enable (struct intel_guc *guc) +static inline struct intel_guc *log_to_guc (struct intel_guc_log *log) { -spin_lock_irq (&guc->irq_lock); - guc->msg_enabled_mask |=INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER | -INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED ; -spin_unlock_irq (&guc->irq_lock); + return container_of(log, struct intel_guc, log); } -static void guc_flush_log_msg_disable (struct intel_guc *guc) +static void guc_log_enable_flush_events (struct intel_guc_log *log) { -spin_lock_irq (&guc->irq_lock); - guc->msg_enabled_mask &= ~(INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER | -INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED ); -spin_unlock_irq (&guc->irq_lock); +intel_guc_enable_msg (log_to_guc (log), +INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER | +INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED ); } -static inline struct intel_guc *log_to_guc (struct intel_guc_log *log) +static void guc_log_disable_flush_events (struct intel_guc_log *log) { - return container_of(log, struct intel_guc, log); +intel_guc_disable_msg (log_to_guc (log), +INTEL_GUC_RECV_MSG_FLUSH_LOG_BUFFER | +INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED ); }/*
@@ -575,7 +573,7 @@ int intel_guc_log_relay_open(struct intel_guc_log *log)mutex_unlock (&log->relay.lock); -guc_flush_log_msg_enable (log_to_guc (log)); +guc_log_enable_flush_events (log);/* * When GuC is logging without us relaying to userspace, we're ignoring
@@ -615,7 +613,7 @@ void intel_guc_log_relay_flush(struct intel_guc_log *log)void intel_guc_log_relay_close (struct intel_guc_log *log) { -guc_flush_log_msg_disable (log_to_guc (log)); +guc_log_disable_flush_events (log);flush_work (&log->relay.flush_work);mutex_lock (&log->relay.lock);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 3/3] drm/i915/guc: Move enable/disable msg functions to GuC header
Quoted 8 lines · Michal Wajdeczko
While today we are modifying GuC enabled msg mask only in GuC log, this code should be defined as generic GuC to allow future code reuse.
Signed-off-by Michal Wajdeczko <[email protected]>Cc Michal Winiarski <[email protected]>Cc Sagar Arun Kamble <[email protected]>Cc Chris Wilson <[email protected]>
-Michał
Quoted 4 lines
--- drivers/gpu/drm/i915/intel_guc.h | 14 ++++++++++++++ drivers/gpu/drm/i915/intel_guc_log.c | 26 ++++++++++++-------------- 2 files changed, 26 insertions(+), 14 deletions(-)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 9 lines · Michal Wajdeczko
We should avoid using
guc_logprefix for functions that don't operate on GuC log, but rather request action from the GuC. Better to useguc_actionprefix.v2: rebase + naming compromise
Signed-off-by Michal Wajdeczko <[email protected]>Cc Michal Winiarski <[email protected]>Cc Sagar Arun Kamble <[email protected]>
-Michał
Quoted 3 lines
--- drivers/gpu/drm/i915/intel_guc_log.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [v2,1/3] drm/i915/guc: Unify naming of private GuC action functions
In reply to Michal Wajdeczko== Series Details ==
== Series Details ==
Series: series starting with [v2,1/3] drm/i915/guc: Unify naming of private GuC action functions
URL : https://patchwork.freedesktop.org/series/40190/
State : success
== Summary ==
Series 40190v1 series starting with [v2,1/3] drm/i915/guc: Unify naming of private GuC action functions
https://patchwork.freedesktop.org/api/1.0/series/40190/revisions/1/mbox/
---- Known issues:
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
fail -> PASS (fi-gdg-551) fdo#102575
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
pass -> FAIL (fi-cfl-s2) fdo#100368
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
pass -> INCOMPLETE (fi-snb-2520m) fdo#103713fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
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:429s fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:445s fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:385s fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:534s 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:514s fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:512s 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:504s fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:410s fi-cfl-s2 total:285 pass:258 dwarn:0 dfail:0 fail:1 skip:26 time:573s fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:510s fi-cnl-drrs total:285 pass:254 dwarn:3 dfail:0 fail:0 skip:28 time:526s fi-elk-e7500 total:285 pass:225 dwarn:1 dfail:0 fail:0 skip:59 time:426s fi-gdg-551 total:285 pass:177 dwarn:0 dfail:0 fail:0 skip:108 time:317s fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:536s fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:406s fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:427s fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:473s fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:428s fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:481s fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:465s 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:654s fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:446s 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:508s fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:498s fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:430s fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:445s 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
9b79492f331e36cf2e08d65ab3221abb66f67844 drm-tip: 2018y-03m-19d-14h-18m-12s UTC integration manifest 2d92dd0eb2bc drm/i915/guc: Move enable/disable msg functions to GuC header 811b8a5cc50f drm/i915/guc: Drop union guc_log_control47e7b038230a 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_8394/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [v2,1/3] drm/i915/guc: Unify naming of private GuC action functions
In reply to Michal Wajdeczko== Series Details ==
== Series Details ==
Series: series starting with [v2,1/3] drm/i915/guc: Unify naming of private GuC action functions
URL : https://patchwork.freedesktop.org/series/40190/
State : success
== Summary ==
---- Possible new issues:
Test pm_rc6_residency:
Subgroup rc6-accuracy:
skip -> PASS (shard-snb)---- Known issues:
Test kms_flip:
Subgroup dpms-vs-vblank-race:
fail -> PASS (shard-hsw) fdo#103060
Test kms_sysfs_edid_timing:
warn -> PASS (shard-apl) fdo#100047fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
shard-apl total:3442 pass:1815 dwarn:1 dfail:0 fail:7 skip:1619 time:12953s shard-hsw total:3442 pass:1768 dwarn:1 dfail:0 fail:1 skip:1671 time:11956s shard-snb total:3442 pass:1359 dwarn:1 dfail:0 fail:2 skip:2080 time:7220s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8394/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx