Commit 154374c3 authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Chris Wilson

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

v2: prevent out-of-range verbosity (MichalWi)
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Michal Winiarski <michal.winiarski@intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Reviewed-by: default avatarMichaĹ Winiarski <michal.winiarski@intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180320181419.35576-2-michal.wajdeczko@intel.com
parent 7beae44d
...@@ -534,17 +534,6 @@ struct guc_log_buffer_state { ...@@ -534,17 +534,6 @@ struct guc_log_buffer_state {
u32 version; u32 version;
} __packed; } __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 { struct guc_ctx_report {
u32 report_return_status; u32 report_return_status;
u32 reserved1[64]; u32 reserved1[64];
...@@ -603,6 +592,11 @@ enum intel_guc_report_status { ...@@ -603,6 +592,11 @@ enum intel_guc_report_status {
INTEL_GUC_REPORT_STATUS_COMPLETE = 0x4, 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 * The GuC sends its response to a command by overwriting the
* command in SS0. The response is distinguishable from a command * command in SS0. The response is distinguishable from a command
......
...@@ -60,18 +60,15 @@ static int guc_action_flush_log(struct intel_guc *guc) ...@@ -60,18 +60,15 @@ static int guc_action_flush_log(struct intel_guc *guc)
static int guc_action_control_log(struct intel_guc *guc, bool enable, static int guc_action_control_log(struct intel_guc *guc, bool enable,
bool default_logging, u32 verbosity) bool default_logging, u32 verbosity)
{ {
union guc_log_control control_val = {
{
.logging_enabled = enable,
.verbosity = verbosity,
.default_logging = default_logging,
},
};
u32 action[] = { u32 action[] = {
INTEL_GUC_ACTION_UK_LOG_ENABLE_LOGGING, 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)
}; };
GEM_BUG_ON(verbosity > GUC_LOG_VERBOSITY_MAX);
return intel_guc_send(guc, action, ARRAY_SIZE(action)); return intel_guc_send(guc, action, ARRAY_SIZE(action));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment