2014-01-21 16:24:25 +07:00
|
|
|
/*
|
|
|
|
* Copyright © 2014 Intel Corporation
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sub license, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the
|
|
|
|
* next paragraph) shall be included in all copies or substantial portions
|
|
|
|
* of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
|
* IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2015-12-18 18:08:15 +07:00
|
|
|
#include "i915_params.h"
|
2014-01-21 16:24:25 +07:00
|
|
|
#include "i915_drv.h"
|
|
|
|
|
|
|
|
struct i915_params i915 __read_mostly = {
|
|
|
|
.modeset = -1,
|
|
|
|
.panel_ignore_lid = 1,
|
|
|
|
.semaphores = -1,
|
|
|
|
.lvds_channel_mode = 0,
|
|
|
|
.panel_use_ssc = -1,
|
|
|
|
.vbt_sdvo_panel_type = -1,
|
|
|
|
.enable_rc6 = -1,
|
2015-11-16 21:01:06 +07:00
|
|
|
.enable_dc = -1,
|
2014-01-21 16:24:25 +07:00
|
|
|
.enable_fbc = -1,
|
2014-12-11 19:48:35 +07:00
|
|
|
.enable_execlists = -1,
|
2014-01-21 16:24:25 +07:00
|
|
|
.enable_hangcheck = true,
|
|
|
|
.enable_ppgtt = -1,
|
2014-08-09 04:48:26 +07:00
|
|
|
.enable_psr = 0,
|
2014-01-21 16:24:25 +07:00
|
|
|
.preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT),
|
2015-11-06 04:04:11 +07:00
|
|
|
.disable_power_well = -1,
|
2014-01-21 16:24:25 +07:00
|
|
|
.enable_ips = 1,
|
2015-11-19 15:26:30 +07:00
|
|
|
.fastboot = 0,
|
2014-01-21 16:24:25 +07:00
|
|
|
.prefault_disable = 0,
|
2015-03-04 00:03:47 +07:00
|
|
|
.load_detect_test = 0,
|
2014-01-21 16:24:25 +07:00
|
|
|
.reset = true,
|
|
|
|
.invert_brightness = 0,
|
2014-02-11 00:20:55 +07:00
|
|
|
.disable_display = 0,
|
2014-02-19 01:15:57 +07:00
|
|
|
.enable_cmd_parser = 1,
|
2014-04-01 14:33:47 +07:00
|
|
|
.disable_vtd_wa = 0,
|
drm/i915: Replaced Blitter ring based flips with MMIO flips
This patch enables the framework for using MMIO based flip calls,
in contrast with the CS based flip calls which are being used currently.
MMIO based flip calls can be enabled on architectures where
Render and Blitter engines reside in different power wells. The
decision to use MMIO flips can be made based on workloads to give
100% residency for Media power well.
v2: The MMIO flips now use the interrupt driven mechanism for issuing the
flips when target seqno is reached. (Incorporating Ville's idea)
v3: Rebasing on latest code. Code restructuring after incorporating
Damien's comments
v4: Addressing Ville's review comments
-general cleanup
-updating only base addr instead of calling update_primary_plane
-extending patch for gen5+ platforms
v5: Addressed Ville's review comments
-Making mmio flip vs cs flip selection based on module parameter
-Adding check for DRIVER_MODESET feature in notify_ring before calling
notify mmio flip.
-Other changes mostly in function arguments
v6: -Having a seperate function to check condition for using mmio flips (Ville)
-propogating error code from i915_gem_check_olr (Ville)
v7: -Adding __must_check with i915_gem_check_olr (Chris)
-Renaming mmio_flip_data to mmio_flip (Chris)
-Rebasing on latest nightly
v8: -Rebasing on latest code
-squash 3rd patch in series(mmio setbase vs page flip race) with this patch
-Added new tiling mode update in intel_do_mmio_flip (Chris)
v9: -check for obj->last_write_seqno being 0 instead of obj->ring being NULL in
intel_postpone_flip, as this is a more restrictive condition (Chris)
v10: -Applied Chris's suggestions for squashing patches 2,3 into this patch.
These patches make the selection of CS vs MMIO flip at the page flip time, and
make the module parameter for using mmio flips as tristate, the states being
'force CS flips', 'force mmio flips', 'driver discretion'.
Changed the logic for driver discretion (Chris)
v11: Minor code cleanup(better readability, fixing whitespace errors, using
lockdep to check mutex locked status in postpone_flip, removal of __must_check
in function definition) (Chris)
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Akash Goel <akash.goel@intel.com>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk> # snb, ivb
[danvet: Fix up parameter alignement checkpatch spotted.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-02 18:17:17 +07:00
|
|
|
.use_mmio_flip = 0,
|
drm/i915: reorganize the unclaimed register detection code
The current code only runs when we do an I915_WRITE operation. It
checks if the unclaimed register flag is set before we do the
operation, and then it checks it again after we do the operation. This
double check allows us to find out if the I915_WRITE operation in
question is the bad one, or if some previous code is the bad one. When
it finds a problem, our code uses DRM_ERROR to signal it.
The good thing about the current code is that it detects the problem,
so at least we can know we did something wrong. The problem is that
even though we find the problem, we don't really have much information
to actually debug it. So whenever I see one of these DRM_ERROR
messages on my systems, the first thing I do is apply a patch to
change the DRM_ERROR to a WARN and also check for unclaimed registers
on I915_READ operations. This local patch makes things even slower,
but it usually helps a lot in finding the bad code.
The first point here is that since the current code is only useful to
detect whether we have a problem or not, but it is not really good to
find the cause of the problem, I don't think we should be checking
both before and after every I915_WRITE operation: just doing the check
once should be enough for us to quickly detect problems. With this
change, the code that runs by default for every single user will only
do 1 read operation for every single I915_WRITE, instead of 2. This
patch does this change.
The second point is that the local patch I have should be upstream,
but since it makes things slower it should be disabled by default. So
I added the i915.mmio_debug option to enable it.
So after this patch, this is what will happen:
- By default, we will try to detect unclaimed registers once after
every I915_WRITE operation. Previously we tried twice for every
I915_WRITE.
- When we find an unclaimed register we will still print a DRM_ERROR
message, but we will now tell the user to try again with
i915.mmio_debug=1.
- When we use i915.mmio_debug=1 we will try to find unclaimed
registers both before and after every I915_READ and I915_WRITE
operation, and we will print stack traces in case we find them.
This should really help locating the exact point of the bad code
(or at least finding out that i915.ko is not the problem).
This commit also opens space for really-slow register debugging
operations on other platforms. In theory we can now add lots and lots
of debug code behind i915.mmio_debug, enable this option on our tests,
and catch more problems.
v2: - Remove not-so-useful comments (Daniel)
- Fix the param definition macros (Rodrigo)
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-17 03:49:29 +07:00
|
|
|
.mmio_debug = 0,
|
2014-12-16 01:56:32 +07:00
|
|
|
.verbose_state_checks = 1,
|
2015-08-26 14:29:56 +07:00
|
|
|
.nuclear_pageflip = 0,
|
2015-05-06 19:05:48 +07:00
|
|
|
.edp_vswing = 0,
|
2015-07-10 01:29:03 +07:00
|
|
|
.enable_guc_submission = false,
|
|
|
|
.guc_log_level = -1,
|
2014-01-21 16:24:25 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
module_param_named(modeset, i915.modeset, int, 0400);
|
|
|
|
MODULE_PARM_DESC(modeset,
|
2015-06-23 18:57:47 +07:00
|
|
|
"Use kernel modesetting [KMS] (0=disable, "
|
2014-01-21 16:24:25 +07:00
|
|
|
"1=on, -1=force vga console preference [default])");
|
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(panel_ignore_lid, i915.panel_ignore_lid, int, 0600);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(panel_ignore_lid,
|
|
|
|
"Override lid status (0=autodetect, 1=autodetect disabled [default], "
|
|
|
|
"-1=force lid closed, -2=force lid open)");
|
|
|
|
|
2014-08-27 03:54:23 +07:00
|
|
|
module_param_named_unsafe(semaphores, i915.semaphores, int, 0400);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(semaphores,
|
|
|
|
"Use semaphores for inter-ring sync "
|
|
|
|
"(default: -1 (use per-chip defaults))");
|
|
|
|
|
2014-08-27 03:54:23 +07:00
|
|
|
module_param_named_unsafe(enable_rc6, i915.enable_rc6, int, 0400);
|
2014-01-27 20:26:38 +07:00
|
|
|
MODULE_PARM_DESC(enable_rc6,
|
2014-01-21 16:24:25 +07:00
|
|
|
"Enable power-saving render C-state 6. "
|
|
|
|
"Different stages can be selected via bitmask values "
|
|
|
|
"(0 = disable; 1 = enable rc6; 2 = enable deep rc6; 4 = enable deepest rc6). "
|
|
|
|
"For example, 3 would enable rc6 and deep rc6, and 7 would enable everything. "
|
|
|
|
"default: -1 (use per-chip default)");
|
|
|
|
|
2015-11-16 21:01:06 +07:00
|
|
|
module_param_named_unsafe(enable_dc, i915.enable_dc, int, 0400);
|
|
|
|
MODULE_PARM_DESC(enable_dc,
|
|
|
|
"Enable power-saving display C-states. "
|
|
|
|
"(-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6)");
|
|
|
|
|
2014-08-27 03:54:23 +07:00
|
|
|
module_param_named_unsafe(enable_fbc, i915.enable_fbc, int, 0600);
|
2014-01-27 20:26:38 +07:00
|
|
|
MODULE_PARM_DESC(enable_fbc,
|
2014-01-21 16:24:25 +07:00
|
|
|
"Enable frame buffer compression for power savings "
|
|
|
|
"(default: -1 (use per-chip default))");
|
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(lvds_channel_mode, i915.lvds_channel_mode, int, 0600);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(lvds_channel_mode,
|
|
|
|
"Specify LVDS channel mode "
|
|
|
|
"(0=probe BIOS [default], 1=single-channel, 2=dual-channel)");
|
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(lvds_use_ssc, i915.panel_use_ssc, int, 0600);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(lvds_use_ssc,
|
|
|
|
"Use Spread Spectrum Clock with panels [LVDS/eDP] "
|
|
|
|
"(default: auto from VBT)");
|
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(vbt_sdvo_panel_type, i915.vbt_sdvo_panel_type, int, 0600);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(vbt_sdvo_panel_type,
|
|
|
|
"Override/Ignore selection of SDVO panel mode in the VBT "
|
|
|
|
"(-2=ignore, -1=auto [default], index in VBT BIOS table)");
|
|
|
|
|
2015-06-18 17:42:08 +07:00
|
|
|
module_param_named_unsafe(reset, i915.reset, bool, 0600);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(reset, "Attempt GPU resets (default: true)");
|
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(enable_hangcheck, i915.enable_hangcheck, bool, 0644);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(enable_hangcheck,
|
|
|
|
"Periodically check GPU activity for detecting hangs. "
|
|
|
|
"WARNING: Disabling this can cause system wide hangs. "
|
|
|
|
"(default: true)");
|
|
|
|
|
2014-08-27 03:54:23 +07:00
|
|
|
module_param_named_unsafe(enable_ppgtt, i915.enable_ppgtt, int, 0400);
|
2014-01-27 20:26:38 +07:00
|
|
|
MODULE_PARM_DESC(enable_ppgtt,
|
2014-01-21 16:24:25 +07:00
|
|
|
"Override PPGTT usage. "
|
2015-09-30 21:36:19 +07:00
|
|
|
"(-1=auto [default], 0=disabled, 1=aliasing, 2=full, 3=full with extended address space)");
|
2014-01-21 16:24:25 +07:00
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(enable_execlists, i915.enable_execlists, int, 0400);
|
2014-07-24 23:04:11 +07:00
|
|
|
MODULE_PARM_DESC(enable_execlists,
|
|
|
|
"Override execlists usage. "
|
2014-12-11 19:48:35 +07:00
|
|
|
"(-1=auto [default], 0=disabled, 1=enabled)");
|
2014-07-24 23:04:11 +07:00
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(enable_psr, i915.enable_psr, int, 0600);
|
2016-02-02 03:02:08 +07:00
|
|
|
MODULE_PARM_DESC(enable_psr, "Enable PSR "
|
|
|
|
"(0=disabled [default], 1=enabled - link mode chosen per-platform, 2=force link-standby mode, 3=force link-off mode)");
|
2014-01-21 16:24:25 +07:00
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(preliminary_hw_support, i915.preliminary_hw_support, int, 0600);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(preliminary_hw_support,
|
|
|
|
"Enable preliminary hardware support.");
|
|
|
|
|
2015-11-17 22:44:23 +07:00
|
|
|
module_param_named_unsafe(disable_power_well, i915.disable_power_well, int, 0400);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(disable_power_well,
|
2015-11-06 04:04:11 +07:00
|
|
|
"Disable display power wells when possible "
|
|
|
|
"(-1=auto [default], 0=power wells always on, 1=power wells disabled when possible)");
|
2014-01-21 16:24:25 +07:00
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)");
|
|
|
|
|
2015-11-19 15:26:30 +07:00
|
|
|
module_param_named(fastboot, i915.fastboot, bool, 0600);
|
|
|
|
MODULE_PARM_DESC(fastboot,
|
|
|
|
"Try to skip unnecessary mode sets at boot time (default: false)");
|
|
|
|
|
2015-03-04 00:03:47 +07:00
|
|
|
module_param_named_unsafe(prefault_disable, i915.prefault_disable, bool, 0600);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(prefault_disable,
|
|
|
|
"Disable page prefaulting for pread/pwrite/reloc (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2015-03-04 00:03:47 +07:00
|
|
|
module_param_named_unsafe(load_detect_test, i915.load_detect_test, bool, 0600);
|
|
|
|
MODULE_PARM_DESC(load_detect_test,
|
|
|
|
"Force-enable the VGA load detect code for testing (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(invert_brightness, i915.invert_brightness, int, 0600);
|
2014-01-21 16:24:25 +07:00
|
|
|
MODULE_PARM_DESC(invert_brightness,
|
|
|
|
"Invert backlight brightness "
|
|
|
|
"(-1 force normal, 0 machine defaults, 1 force inversion), please "
|
|
|
|
"report PCI device ID, subsystem vendor and subsystem device ID "
|
|
|
|
"to dri-devel@lists.freedesktop.org, if your machine needs it. "
|
|
|
|
"It will then be included in an upcoming module version.");
|
2014-02-11 00:20:55 +07:00
|
|
|
|
|
|
|
module_param_named(disable_display, i915.disable_display, bool, 0600);
|
|
|
|
MODULE_PARM_DESC(disable_display, "Disable display (default: false)");
|
2014-02-19 01:15:46 +07:00
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(disable_vtd_wa, i915.disable_vtd_wa, bool, 0600);
|
2014-04-01 14:33:47 +07:00
|
|
|
MODULE_PARM_DESC(disable_vtd_wa, "Disable all VT-d workarounds (default: false)");
|
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(enable_cmd_parser, i915.enable_cmd_parser, int, 0600);
|
2014-02-19 01:15:46 +07:00
|
|
|
MODULE_PARM_DESC(enable_cmd_parser,
|
2014-02-19 01:15:57 +07:00
|
|
|
"Enable command parsing (1=enabled [default], 0=disabled)");
|
drm/i915: Replaced Blitter ring based flips with MMIO flips
This patch enables the framework for using MMIO based flip calls,
in contrast with the CS based flip calls which are being used currently.
MMIO based flip calls can be enabled on architectures where
Render and Blitter engines reside in different power wells. The
decision to use MMIO flips can be made based on workloads to give
100% residency for Media power well.
v2: The MMIO flips now use the interrupt driven mechanism for issuing the
flips when target seqno is reached. (Incorporating Ville's idea)
v3: Rebasing on latest code. Code restructuring after incorporating
Damien's comments
v4: Addressing Ville's review comments
-general cleanup
-updating only base addr instead of calling update_primary_plane
-extending patch for gen5+ platforms
v5: Addressed Ville's review comments
-Making mmio flip vs cs flip selection based on module parameter
-Adding check for DRIVER_MODESET feature in notify_ring before calling
notify mmio flip.
-Other changes mostly in function arguments
v6: -Having a seperate function to check condition for using mmio flips (Ville)
-propogating error code from i915_gem_check_olr (Ville)
v7: -Adding __must_check with i915_gem_check_olr (Chris)
-Renaming mmio_flip_data to mmio_flip (Chris)
-Rebasing on latest nightly
v8: -Rebasing on latest code
-squash 3rd patch in series(mmio setbase vs page flip race) with this patch
-Added new tiling mode update in intel_do_mmio_flip (Chris)
v9: -check for obj->last_write_seqno being 0 instead of obj->ring being NULL in
intel_postpone_flip, as this is a more restrictive condition (Chris)
v10: -Applied Chris's suggestions for squashing patches 2,3 into this patch.
These patches make the selection of CS vs MMIO flip at the page flip time, and
make the module parameter for using mmio flips as tristate, the states being
'force CS flips', 'force mmio flips', 'driver discretion'.
Changed the logic for driver discretion (Chris)
v11: Minor code cleanup(better readability, fixing whitespace errors, using
lockdep to check mutex locked status in postpone_flip, removal of __must_check
in function definition) (Chris)
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Akash Goel <akash.goel@intel.com>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk> # snb, ivb
[danvet: Fix up parameter alignement checkpatch spotted.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-02 18:17:17 +07:00
|
|
|
|
2015-09-08 18:56:23 +07:00
|
|
|
module_param_named_unsafe(use_mmio_flip, i915.use_mmio_flip, int, 0600);
|
drm/i915: Replaced Blitter ring based flips with MMIO flips
This patch enables the framework for using MMIO based flip calls,
in contrast with the CS based flip calls which are being used currently.
MMIO based flip calls can be enabled on architectures where
Render and Blitter engines reside in different power wells. The
decision to use MMIO flips can be made based on workloads to give
100% residency for Media power well.
v2: The MMIO flips now use the interrupt driven mechanism for issuing the
flips when target seqno is reached. (Incorporating Ville's idea)
v3: Rebasing on latest code. Code restructuring after incorporating
Damien's comments
v4: Addressing Ville's review comments
-general cleanup
-updating only base addr instead of calling update_primary_plane
-extending patch for gen5+ platforms
v5: Addressed Ville's review comments
-Making mmio flip vs cs flip selection based on module parameter
-Adding check for DRIVER_MODESET feature in notify_ring before calling
notify mmio flip.
-Other changes mostly in function arguments
v6: -Having a seperate function to check condition for using mmio flips (Ville)
-propogating error code from i915_gem_check_olr (Ville)
v7: -Adding __must_check with i915_gem_check_olr (Chris)
-Renaming mmio_flip_data to mmio_flip (Chris)
-Rebasing on latest nightly
v8: -Rebasing on latest code
-squash 3rd patch in series(mmio setbase vs page flip race) with this patch
-Added new tiling mode update in intel_do_mmio_flip (Chris)
v9: -check for obj->last_write_seqno being 0 instead of obj->ring being NULL in
intel_postpone_flip, as this is a more restrictive condition (Chris)
v10: -Applied Chris's suggestions for squashing patches 2,3 into this patch.
These patches make the selection of CS vs MMIO flip at the page flip time, and
make the module parameter for using mmio flips as tristate, the states being
'force CS flips', 'force mmio flips', 'driver discretion'.
Changed the logic for driver discretion (Chris)
v11: Minor code cleanup(better readability, fixing whitespace errors, using
lockdep to check mutex locked status in postpone_flip, removal of __must_check
in function definition) (Chris)
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Akash Goel <akash.goel@intel.com>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk> # snb, ivb
[danvet: Fix up parameter alignement checkpatch spotted.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-02 18:17:17 +07:00
|
|
|
MODULE_PARM_DESC(use_mmio_flip,
|
|
|
|
"use MMIO flips (-1=never, 0=driver discretion [default], 1=always)");
|
drm/i915: reorganize the unclaimed register detection code
The current code only runs when we do an I915_WRITE operation. It
checks if the unclaimed register flag is set before we do the
operation, and then it checks it again after we do the operation. This
double check allows us to find out if the I915_WRITE operation in
question is the bad one, or if some previous code is the bad one. When
it finds a problem, our code uses DRM_ERROR to signal it.
The good thing about the current code is that it detects the problem,
so at least we can know we did something wrong. The problem is that
even though we find the problem, we don't really have much information
to actually debug it. So whenever I see one of these DRM_ERROR
messages on my systems, the first thing I do is apply a patch to
change the DRM_ERROR to a WARN and also check for unclaimed registers
on I915_READ operations. This local patch makes things even slower,
but it usually helps a lot in finding the bad code.
The first point here is that since the current code is only useful to
detect whether we have a problem or not, but it is not really good to
find the cause of the problem, I don't think we should be checking
both before and after every I915_WRITE operation: just doing the check
once should be enough for us to quickly detect problems. With this
change, the code that runs by default for every single user will only
do 1 read operation for every single I915_WRITE, instead of 2. This
patch does this change.
The second point is that the local patch I have should be upstream,
but since it makes things slower it should be disabled by default. So
I added the i915.mmio_debug option to enable it.
So after this patch, this is what will happen:
- By default, we will try to detect unclaimed registers once after
every I915_WRITE operation. Previously we tried twice for every
I915_WRITE.
- When we find an unclaimed register we will still print a DRM_ERROR
message, but we will now tell the user to try again with
i915.mmio_debug=1.
- When we use i915.mmio_debug=1 we will try to find unclaimed
registers both before and after every I915_READ and I915_WRITE
operation, and we will print stack traces in case we find them.
This should really help locating the exact point of the bad code
(or at least finding out that i915.ko is not the problem).
This commit also opens space for really-slow register debugging
operations on other platforms. In theory we can now add lots and lots
of debug code behind i915.mmio_debug, enable this option on our tests,
and catch more problems.
v2: - Remove not-so-useful comments (Daniel)
- Fix the param definition macros (Rodrigo)
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-17 03:49:29 +07:00
|
|
|
|
2014-12-18 17:55:50 +07:00
|
|
|
module_param_named(mmio_debug, i915.mmio_debug, int, 0600);
|
drm/i915: reorganize the unclaimed register detection code
The current code only runs when we do an I915_WRITE operation. It
checks if the unclaimed register flag is set before we do the
operation, and then it checks it again after we do the operation. This
double check allows us to find out if the I915_WRITE operation in
question is the bad one, or if some previous code is the bad one. When
it finds a problem, our code uses DRM_ERROR to signal it.
The good thing about the current code is that it detects the problem,
so at least we can know we did something wrong. The problem is that
even though we find the problem, we don't really have much information
to actually debug it. So whenever I see one of these DRM_ERROR
messages on my systems, the first thing I do is apply a patch to
change the DRM_ERROR to a WARN and also check for unclaimed registers
on I915_READ operations. This local patch makes things even slower,
but it usually helps a lot in finding the bad code.
The first point here is that since the current code is only useful to
detect whether we have a problem or not, but it is not really good to
find the cause of the problem, I don't think we should be checking
both before and after every I915_WRITE operation: just doing the check
once should be enough for us to quickly detect problems. With this
change, the code that runs by default for every single user will only
do 1 read operation for every single I915_WRITE, instead of 2. This
patch does this change.
The second point is that the local patch I have should be upstream,
but since it makes things slower it should be disabled by default. So
I added the i915.mmio_debug option to enable it.
So after this patch, this is what will happen:
- By default, we will try to detect unclaimed registers once after
every I915_WRITE operation. Previously we tried twice for every
I915_WRITE.
- When we find an unclaimed register we will still print a DRM_ERROR
message, but we will now tell the user to try again with
i915.mmio_debug=1.
- When we use i915.mmio_debug=1 we will try to find unclaimed
registers both before and after every I915_READ and I915_WRITE
operation, and we will print stack traces in case we find them.
This should really help locating the exact point of the bad code
(or at least finding out that i915.ko is not the problem).
This commit also opens space for really-slow register debugging
operations on other platforms. In theory we can now add lots and lots
of debug code behind i915.mmio_debug, enable this option on our tests,
and catch more problems.
v2: - Remove not-so-useful comments (Daniel)
- Fix the param definition macros (Rodrigo)
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-17 03:49:29 +07:00
|
|
|
MODULE_PARM_DESC(mmio_debug,
|
2014-12-18 17:55:50 +07:00
|
|
|
"Enable the MMIO debug code for the first N failures (default: off). "
|
|
|
|
"This may negatively affect performance.");
|
2014-12-16 01:56:32 +07:00
|
|
|
|
|
|
|
module_param_named(verbose_state_checks, i915.verbose_state_checks, bool, 0600);
|
|
|
|
MODULE_PARM_DESC(verbose_state_checks,
|
|
|
|
"Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions.");
|
2015-01-23 07:53:12 +07:00
|
|
|
|
2015-08-26 14:29:56 +07:00
|
|
|
module_param_named_unsafe(nuclear_pageflip, i915.nuclear_pageflip, bool, 0600);
|
|
|
|
MODULE_PARM_DESC(nuclear_pageflip,
|
|
|
|
"Force atomic modeset functionality; asynchronous mode is not yet supported. (default: false).");
|
|
|
|
|
2015-05-06 19:05:48 +07:00
|
|
|
/* WA to get away with the default setting in VBT for early platforms.Will be removed */
|
|
|
|
module_param_named_unsafe(edp_vswing, i915.edp_vswing, int, 0400);
|
|
|
|
MODULE_PARM_DESC(edp_vswing,
|
|
|
|
"Ignore/Override vswing pre-emph table selection from VBT "
|
|
|
|
"(0=use value from vbt [default], 1=low power swing(200mV),"
|
|
|
|
"2=default swing(400mV))");
|
2015-07-10 01:29:03 +07:00
|
|
|
|
|
|
|
module_param_named_unsafe(enable_guc_submission, i915.enable_guc_submission, bool, 0400);
|
|
|
|
MODULE_PARM_DESC(enable_guc_submission, "Enable GuC submission (default:false)");
|
|
|
|
|
|
|
|
module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
|
|
|
|
MODULE_PARM_DESC(guc_log_level,
|
|
|
|
"GuC firmware logging level (-1:disabled (default), 0-3:enabled)");
|