Skip to main content
Topic: Why is i915 reset param set to 3 (which is invalid) in recent linux kernels? (Read 885 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Why is i915 reset param set to 3 (which is invalid) in recent linux kernels?

I don't think this is the cause of the interface freezes, but it still seems weird to me. In linux-5.4.y it is set to 2 (which should be the default according to "modinfo -p i915". Here is the relevant part of drivers/gpu/drm/i915/i915_params.h in linux-5.4 (which works perfectly):
Code: [Select]
#define I915_PARAMS_FOR_EACH(param) \
param(char *, vbt_firmware, NULL) \
param(int, modeset, -1) \
param(int, lvds_channel_mode, 0) \
param(int, panel_use_ssc, -1) \
param(int, vbt_sdvo_panel_type, -1) \
param(int, enable_dc, -1) \
param(int, enable_fbc, -1) \
param(int, enable_psr, -1) \
param(int, disable_power_well, -1) \
param(int, enable_ips, 1) \
param(int, invert_brightness, 0) \
param(int, enable_guc, 0) \
param(int, guc_log_level, -1) \
param(char *, guc_firmware_path, NULL) \
param(char *, huc_firmware_path, NULL) \
param(char *, dmc_firmware_path, NULL) \
param(int, mmio_debug, -IS_ENABLED(CONFIG_DRM_I915_DEBUG_MMIO)) \
param(int, edp_vswing, 0) \
param(int, reset, 2) \ //**** set to 2 ****
param(unsigned int, inject_load_failure, 0) \
param(int, fastboot, -1) \
param(int, enable_dpcd_backlight, 0) \
param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE) \
/* leave bools at the end to not create holes */ \
param(bool, alpha_support, IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT)) \
param(bool, enable_hangcheck, true) \
param(bool, prefault_disable, false) \
param(bool, load_detect_test, false) \
param(bool, force_reset_modeset_test, false) \
param(bool, error_capture, true) \
param(bool, disable_display, false) \
param(bool, verbose_state_checks, true) \
param(bool, nuclear_pageflip, false) \
param(bool, enable_dp_mst, true) \
param(bool, enable_gvt, false)
in newer kernels it is set to 3 (and it also shows up as 3 in /sys/module/i915/parameters/reset):
Code: [Select]
#define I915_PARAMS_FOR_EACH(param) \
param(char *, vbt_firmware, NULL, 0400) \
param(int, modeset, -1, 0400) \
param(int, lvds_channel_mode, 0, 0400) \
param(int, panel_use_ssc, -1, 0600) \
param(int, vbt_sdvo_panel_type, -1, 0400) \
param(int, enable_dc, -1, 0400) \
param(int, enable_fbc, -1, 0600) \
param(int, enable_psr, -1, 0600) \
param(bool, psr_safest_params, false, 0400) \
param(bool, enable_psr2_sel_fetch, true, 0400) \
param(int, disable_power_well, -1, 0400) \
param(int, enable_ips, 1, 0600) \
param(int, invert_brightness, 0, 0600) \
param(int, enable_guc, -1, 0400) \
param(int, guc_log_level, -1, 0400) \
param(char *, guc_firmware_path, NULL, 0400) \
param(char *, huc_firmware_path, NULL, 0400) \
param(char *, dmc_firmware_path, NULL, 0400) \
param(bool, memtest, false, 0400) \
param(int, mmio_debug, -IS_ENABLED(CONFIG_DRM_I915_DEBUG_MMIO), 0600) \
param(int, edp_vswing, 0, 0400) \
param(unsigned int, reset, 3, 0600) \ //**** set to 3 ****
param(unsigned int, inject_probe_failure, 0, 0) \
param(int, fastboot, -1, 0600) \
param(int, enable_dpcd_backlight, -1, 0600) \
param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \
param(unsigned int, request_timeout_ms, CONFIG_DRM_I915_REQUEST_TIMEOUT, CONFIG_DRM_I915_REQUEST_TIMEOUT ? 0600 : 0) \
/* leave bools at the end to not create holes */ \
param(bool, enable_hangcheck, true, 0600) \
param(bool, load_detect_test, false, 0600) \
param(bool, force_reset_modeset_test, false, 0600) \
param(bool, error_capture, true, IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR) ? 0600 : 0) \
param(bool, disable_display, false, 0400) \
param(bool, verbose_state_checks, true, 0) \
param(bool, nuclear_pageflip, false, 0400) \
param(bool, enable_dp_mst, true, 0600) \
param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0)
If this is correct, "modinfo -p i915" ought to reflect the change, which seems to be undocumented. Patching the kernel, or using "i915.reset=2" boot param - the alleged default - has no effect (except setting /sys/module/i915/parameters/reset to 2; in any case the reset fails and the computer freezes). Maybe the setting is ignored - the driver is so messed-up that this doesn't seem unlikely.


 

Re: Why is i915 reset param set to 3 (which is invalid) in recent linux kernels?

Reply #2
After experimenting on some older tablet with skylake cpu:

-reset to 3 does indeed seem to be a valid option as it does still avoid hard resets, and maybe better so than 1/2;
-i915.enable_dc=0 doesn't do much but the same setting for sagv does in my device's case;
-disabling psr completely is worse somehow, but i915.psr_safest_params=1 and i915.enable_psr2_sel_fetch=0 makes a difference. Disabling fbc may or may not be needed but the display looks better.;
-intel_idle.max_cstate=1 does nothing, the crashes aren't power related and i'm even able to use the intel_undervolt utility on it.
(this is on latest kernel and firmware, i tried at first with older ones but didn't do much)

So in conclusion these parameters made firefox with hardware acceleration able to run for me, some tiny freezes still happen but no hard crashing anymore:

Code: [Select]
i915.psr_safest_params=1 i915.enable_psr2_sel_fetch=0 i915.enable_fbc=0 i915.enable_sagv=0

i'm also turning some mitigations off for even better performance (you might not want to do this in some instances):

Spoiler (click to show/hide)