2014-01-21 17:24:25 +08: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 19:08:15 +08:00
|
|
|
#include "i915_params.h"
|
2014-01-21 17:24:25 +08: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 22:01:06 +08:00
|
|
|
.enable_dc = -1,
|
2014-01-21 17:24:25 +08:00
|
|
|
.enable_fbc = -1,
|
2014-12-11 20:48:35 +08:00
|
|
|
.enable_execlists = -1,
|
2014-01-21 17:24:25 +08:00
|
|
|
.enable_hangcheck = true,
|
|
|
|
.enable_ppgtt = -1,
|
2016-02-12 20:08:11 +08:00
|
|
|
.enable_psr = -1,
|
2016-10-31 18:18:28 +08:00
|
|
|
.alpha_support = IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT),
|
2015-11-06 05:04:11 +08:00
|
|
|
.disable_power_well = -1,
|
2014-01-21 17:24:25 +08:00
|
|
|
.enable_ips = 1,
|
2015-11-19 16:26:30 +08:00
|
|
|
.fastboot = 0,
|
2014-01-21 17:24:25 +08:00
|
|
|
.prefault_disable = 0,
|
2015-03-04 01:03:47 +08:00
|
|
|
.load_detect_test = 0,
|
2016-08-06 04:28:28 +08:00
|
|
|
.force_reset_modeset_test = 0,
|
2014-01-21 17:24:25 +08:00
|
|
|
.reset = true,
|
2016-10-12 17:05:18 +08:00
|
|
|
.error_capture = true,
|
2014-01-21 17:24:25 +08:00
|
|
|
.invert_brightness = 0,
|
2014-02-11 01:20:55 +08:00
|
|
|
.disable_display = 0,
|
2016-11-24 20:58:51 +08:00
|
|
|
.enable_cmd_parser = true,
|
2016-05-24 23:13:53 +08: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 04:49:29 +08:00
|
|
|
.mmio_debug = 0,
|
2014-12-16 02:56:32 +08:00
|
|
|
.verbose_state_checks = 1,
|
2015-08-26 15:29:56 +08:00
|
|
|
.nuclear_pageflip = 0,
|
2015-05-06 20:05:48 +08:00
|
|
|
.edp_vswing = 0,
|
2016-07-19 07:27:57 +08:00
|
|
|
.enable_guc_loading = 0,
|
|
|
|
.enable_guc_submission = 0,
|
2015-07-10 02:29:03 +08:00
|
|
|
.guc_log_level = -1,
|
2017-03-14 22:28:14 +08:00
|
|
|
.guc_firmware_path = NULL,
|
|
|
|
.huc_firmware_path = NULL,
|
2016-03-15 23:14:05 +08:00
|
|
|
.enable_dp_mst = true,
|
2016-03-16 19:39:08 +08:00
|
|
|
.inject_load_failure = 0,
|
2016-04-05 22:10:52 +08:00
|
|
|
.enable_dpcd_backlight = false,
|
drm/i915: gvt: Introduce the basic architecture of GVT-g
This patch introduces the very basic framework of GVT-g device model,
includes basic prototypes, definitions, initialization.
v12:
- Call intel_gvt_init() in driver early initialization stage. (Chris)
v8:
- Remove the GVT idr and mutex in intel_gvt_host. (Joonas)
v7:
- Refine the URL link in Kconfig. (Joonas)
- Refine the introduction of GVT-g host support in Kconfig. (Joonas)
- Remove the macro GVT_ALIGN(), use round_down() instead. (Joonas)
- Make "struct intel_gvt" a data member in struct drm_i915_private.(Joonas)
- Remove {alloc, free}_gvt_device()
- Rename intel_gvt_{create, destroy}_gvt_device()
- Expost intel_gvt_init_host()
- Remove the dummy "struct intel_gvt" declaration in intel_gvt.h (Joonas)
v6:
- Refine introduction in Kconfig. (Chris)
- The exposed API functions will take struct intel_gvt * instead of
void *. (Chris/Tvrtko)
- Remove most memebers of strct intel_gvt_device_info. Will add them
in the device model patches.(Chris)
- Remove gvt_info() and gvt_err() in debug.h. (Chris)
- Move GVT kernel parameter into i915_params. (Chris)
- Remove include/drm/i915_gvt.h, as GVT-g will be built within i915.
- Remove the redundant struct i915_gvt *, as the functions in i915
will directly take struct intel_gvt *.
- Add more comments for reviewer.
v5:
Take Tvrtko's comments:
- Fix the misspelled words in Kconfig
- Let functions take drm_i915_private * instead of struct drm_device *
- Remove redundant prints/local varible initialization
v3:
Take Joonas' comments:
- Change file name i915_gvt.* to intel_gvt.*
- Move GVT kernel parameter into intel_gvt.c
- Remove redundant debug macros
- Change error handling style
- Add introductions for some stub functions
- Introduce drm/i915_gvt.h.
Take Kevin's comments:
- Move GVT-g host/guest check into intel_vgt_balloon in i915_gem_gtt.c
v2:
- Introduce i915_gvt.c.
It's necessary to introduce the stubs between i915 driver and GVT-g host,
as GVT-g components is configurable in kernel config. When disabled, the
stubs here do nothing.
Take Joonas' comments:
- Replace boolean return value with int.
- Replace customized info/warn/debug macros with DRM macros.
- Document all non-static functions like i915.
- Remove empty and unused functions.
- Replace magic number with marcos.
- Set GVT-g in kernel config to "n" by default.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466078825-6662-5-git-send-email-zhi.a.wang@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-16 20:07:00 +08:00
|
|
|
.enable_gvt = false,
|
2014-01-21 17:24:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
module_param_named(modeset, i915.modeset, int, 0400);
|
|
|
|
MODULE_PARM_DESC(modeset,
|
2015-06-23 19:57:47 +08:00
|
|
|
"Use kernel modesetting [KMS] (0=disable, "
|
2014-01-21 17:24:25 +08:00
|
|
|
"1=on, -1=force vga console preference [default])");
|
|
|
|
|
2015-09-08 19:56:23 +08:00
|
|
|
module_param_named_unsafe(panel_ignore_lid, i915.panel_ignore_lid, int, 0600);
|
2014-01-21 17:24:25 +08: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 04:54:23 +08:00
|
|
|
module_param_named_unsafe(semaphores, i915.semaphores, int, 0400);
|
2014-01-21 17:24:25 +08:00
|
|
|
MODULE_PARM_DESC(semaphores,
|
|
|
|
"Use semaphores for inter-ring sync "
|
|
|
|
"(default: -1 (use per-chip defaults))");
|
|
|
|
|
2014-08-27 04:54:23 +08:00
|
|
|
module_param_named_unsafe(enable_rc6, i915.enable_rc6, int, 0400);
|
2014-01-27 21:26:38 +08:00
|
|
|
MODULE_PARM_DESC(enable_rc6,
|
2014-01-21 17:24:25 +08: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 22:01:06 +08: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 04:54:23 +08:00
|
|
|
module_param_named_unsafe(enable_fbc, i915.enable_fbc, int, 0600);
|
2014-01-27 21:26:38 +08:00
|
|
|
MODULE_PARM_DESC(enable_fbc,
|
2014-01-21 17:24:25 +08:00
|
|
|
"Enable frame buffer compression for power savings "
|
|
|
|
"(default: -1 (use per-chip default))");
|
|
|
|
|
2016-02-16 19:18:12 +08:00
|
|
|
module_param_named_unsafe(lvds_channel_mode, i915.lvds_channel_mode, int, 0400);
|
2014-01-21 17:24:25 +08:00
|
|
|
MODULE_PARM_DESC(lvds_channel_mode,
|
|
|
|
"Specify LVDS channel mode "
|
|
|
|
"(0=probe BIOS [default], 1=single-channel, 2=dual-channel)");
|
|
|
|
|
2015-09-08 19:56:23 +08:00
|
|
|
module_param_named_unsafe(lvds_use_ssc, i915.panel_use_ssc, int, 0600);
|
2014-01-21 17:24:25 +08:00
|
|
|
MODULE_PARM_DESC(lvds_use_ssc,
|
|
|
|
"Use Spread Spectrum Clock with panels [LVDS/eDP] "
|
|
|
|
"(default: auto from VBT)");
|
|
|
|
|
2016-02-16 19:18:12 +08:00
|
|
|
module_param_named_unsafe(vbt_sdvo_panel_type, i915.vbt_sdvo_panel_type, int, 0400);
|
2014-01-21 17:24:25 +08: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 18:42:08 +08:00
|
|
|
module_param_named_unsafe(reset, i915.reset, bool, 0600);
|
2014-01-21 17:24:25 +08:00
|
|
|
MODULE_PARM_DESC(reset, "Attempt GPU resets (default: true)");
|
|
|
|
|
2016-10-12 17:05:18 +08:00
|
|
|
#if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
|
|
|
|
module_param_named(error_capture, i915.error_capture, bool, 0600);
|
|
|
|
MODULE_PARM_DESC(error_capture,
|
|
|
|
"Record the GPU state following a hang. "
|
|
|
|
"This information in /sys/class/drm/card<N>/error is vital for "
|
|
|
|
"triaging and debugging hangs.");
|
|
|
|
#endif
|
|
|
|
|
2015-09-08 19:56:23 +08:00
|
|
|
module_param_named_unsafe(enable_hangcheck, i915.enable_hangcheck, bool, 0644);
|
2014-01-21 17:24:25 +08: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 04:54:23 +08:00
|
|
|
module_param_named_unsafe(enable_ppgtt, i915.enable_ppgtt, int, 0400);
|
2014-01-27 21:26:38 +08:00
|
|
|
MODULE_PARM_DESC(enable_ppgtt,
|
2014-01-21 17:24:25 +08:00
|
|
|
"Override PPGTT usage. "
|
2015-09-30 22:36:19 +08:00
|
|
|
"(-1=auto [default], 0=disabled, 1=aliasing, 2=full, 3=full with extended address space)");
|
2014-01-21 17:24:25 +08:00
|
|
|
|
2015-09-08 19:56:23 +08:00
|
|
|
module_param_named_unsafe(enable_execlists, i915.enable_execlists, int, 0400);
|
2014-07-25 00:04:11 +08:00
|
|
|
MODULE_PARM_DESC(enable_execlists,
|
|
|
|
"Override execlists usage. "
|
2014-12-11 20:48:35 +08:00
|
|
|
"(-1=auto [default], 0=disabled, 1=enabled)");
|
2014-07-25 00:04:11 +08:00
|
|
|
|
2015-09-08 19:56:23 +08:00
|
|
|
module_param_named_unsafe(enable_psr, i915.enable_psr, int, 0600);
|
2016-02-02 04:02:08 +08:00
|
|
|
MODULE_PARM_DESC(enable_psr, "Enable PSR "
|
2016-02-12 20:08:11 +08:00
|
|
|
"(0=disabled, 1=enabled - link mode chosen per-platform, 2=force link-standby mode, 3=force link-off mode) "
|
|
|
|
"Default: -1 (use per-chip default)");
|
2014-01-21 17:24:25 +08:00
|
|
|
|
2017-02-07 05:36:06 +08:00
|
|
|
module_param_named_unsafe(alpha_support, i915.alpha_support, bool, 0400);
|
2016-10-31 18:18:28 +08:00
|
|
|
MODULE_PARM_DESC(alpha_support,
|
|
|
|
"Enable alpha quality driver support for latest hardware. "
|
|
|
|
"See also CONFIG_DRM_I915_ALPHA_SUPPORT.");
|
2014-01-21 17:24:25 +08:00
|
|
|
|
2015-11-17 23:44:23 +08:00
|
|
|
module_param_named_unsafe(disable_power_well, i915.disable_power_well, int, 0400);
|
2014-01-21 17:24:25 +08:00
|
|
|
MODULE_PARM_DESC(disable_power_well,
|
2015-11-06 05:04:11 +08:00
|
|
|
"Disable display power wells when possible "
|
|
|
|
"(-1=auto [default], 0=power wells always on, 1=power wells disabled when possible)");
|
2014-01-21 17:24:25 +08:00
|
|
|
|
2015-09-08 19:56:23 +08:00
|
|
|
module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600);
|
2014-01-21 17:24:25 +08:00
|
|
|
MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)");
|
|
|
|
|
2015-11-19 16:26:30 +08: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 01:03:47 +08:00
|
|
|
module_param_named_unsafe(prefault_disable, i915.prefault_disable, bool, 0600);
|
2014-01-21 17:24:25 +08:00
|
|
|
MODULE_PARM_DESC(prefault_disable,
|
|
|
|
"Disable page prefaulting for pread/pwrite/reloc (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2015-03-04 01:03:47 +08: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.");
|
|
|
|
|
2016-08-06 04:28:28 +08:00
|
|
|
module_param_named_unsafe(force_reset_modeset_test, i915.force_reset_modeset_test, bool, 0600);
|
|
|
|
MODULE_PARM_DESC(force_reset_modeset_test,
|
|
|
|
"Force a modeset during gpu reset for testing (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2015-09-08 19:56:23 +08:00
|
|
|
module_param_named_unsafe(invert_brightness, i915.invert_brightness, int, 0600);
|
2014-01-21 17:24:25 +08: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 01:20:55 +08:00
|
|
|
|
2016-02-16 19:18:12 +08:00
|
|
|
module_param_named(disable_display, i915.disable_display, bool, 0400);
|
2014-02-11 01:20:55 +08:00
|
|
|
MODULE_PARM_DESC(disable_display, "Disable display (default: false)");
|
2014-02-19 02:15:46 +08:00
|
|
|
|
2016-11-24 20:58:51 +08:00
|
|
|
module_param_named_unsafe(enable_cmd_parser, i915.enable_cmd_parser, bool, 0400);
|
2014-02-19 02:15:46 +08:00
|
|
|
MODULE_PARM_DESC(enable_cmd_parser,
|
2016-11-24 20:58:51 +08:00
|
|
|
"Enable command parsing (true=enabled [default], false=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 19:17:17 +08:00
|
|
|
|
2016-05-24 23:13:53 +08:00
|
|
|
module_param_named_unsafe(use_mmio_flip, i915.use_mmio_flip, int, 0600);
|
|
|
|
MODULE_PARM_DESC(use_mmio_flip,
|
|
|
|
"use MMIO flips (-1=never, 0=driver discretion [default], 1=always)");
|
|
|
|
|
2014-12-18 18:55:50 +08: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 04:49:29 +08:00
|
|
|
MODULE_PARM_DESC(mmio_debug,
|
2014-12-18 18:55:50 +08:00
|
|
|
"Enable the MMIO debug code for the first N failures (default: off). "
|
|
|
|
"This may negatively affect performance.");
|
2014-12-16 02:56:32 +08: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 08:53:12 +08:00
|
|
|
|
2017-02-02 15:41:42 +08:00
|
|
|
module_param_named_unsafe(nuclear_pageflip, i915.nuclear_pageflip, bool, 0400);
|
2015-08-26 15:29:56 +08:00
|
|
|
MODULE_PARM_DESC(nuclear_pageflip,
|
2017-02-02 15:41:42 +08:00
|
|
|
"Force enable atomic functionality on platforms that don't have full support yet.");
|
2015-08-26 15:29:56 +08:00
|
|
|
|
2015-05-06 20:05:48 +08: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 02:29:03 +08:00
|
|
|
|
2016-05-20 18:42:42 +08:00
|
|
|
module_param_named_unsafe(enable_guc_loading, i915.enable_guc_loading, int, 0400);
|
|
|
|
MODULE_PARM_DESC(enable_guc_loading,
|
|
|
|
"Enable GuC firmware loading "
|
2016-07-19 07:27:57 +08:00
|
|
|
"(-1=auto, 0=never [default], 1=if available, 2=required)");
|
2016-05-20 18:42:42 +08:00
|
|
|
|
|
|
|
module_param_named_unsafe(enable_guc_submission, i915.enable_guc_submission, int, 0400);
|
|
|
|
MODULE_PARM_DESC(enable_guc_submission,
|
|
|
|
"Enable GuC submission "
|
2016-07-19 07:27:57 +08:00
|
|
|
"(-1=auto, 0=never [default], 1=if available, 2=required)");
|
2015-07-10 02:29:03 +08:00
|
|
|
|
|
|
|
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)");
|
2016-03-15 23:14:05 +08:00
|
|
|
|
2017-03-14 22:28:14 +08:00
|
|
|
module_param_named_unsafe(guc_firmware_path, i915.guc_firmware_path, charp, 0400);
|
|
|
|
MODULE_PARM_DESC(guc_firmware_path,
|
|
|
|
"GuC firmware path to use instead of the default one");
|
|
|
|
|
|
|
|
module_param_named_unsafe(huc_firmware_path, i915.huc_firmware_path, charp, 0400);
|
|
|
|
MODULE_PARM_DESC(huc_firmware_path,
|
|
|
|
"HuC firmware path to use instead of the default one");
|
|
|
|
|
2016-03-15 23:14:05 +08:00
|
|
|
module_param_named_unsafe(enable_dp_mst, i915.enable_dp_mst, bool, 0600);
|
|
|
|
MODULE_PARM_DESC(enable_dp_mst,
|
|
|
|
"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
|
2016-03-16 19:39:08 +08:00
|
|
|
module_param_named_unsafe(inject_load_failure, i915.inject_load_failure, uint, 0400);
|
|
|
|
MODULE_PARM_DESC(inject_load_failure,
|
|
|
|
"Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)");
|
2016-04-05 22:10:52 +08:00
|
|
|
module_param_named(enable_dpcd_backlight, i915.enable_dpcd_backlight, bool, 0600);
|
|
|
|
MODULE_PARM_DESC(enable_dpcd_backlight,
|
|
|
|
"Enable support for DPCD backlight control (default:false)");
|
drm/i915: gvt: Introduce the basic architecture of GVT-g
This patch introduces the very basic framework of GVT-g device model,
includes basic prototypes, definitions, initialization.
v12:
- Call intel_gvt_init() in driver early initialization stage. (Chris)
v8:
- Remove the GVT idr and mutex in intel_gvt_host. (Joonas)
v7:
- Refine the URL link in Kconfig. (Joonas)
- Refine the introduction of GVT-g host support in Kconfig. (Joonas)
- Remove the macro GVT_ALIGN(), use round_down() instead. (Joonas)
- Make "struct intel_gvt" a data member in struct drm_i915_private.(Joonas)
- Remove {alloc, free}_gvt_device()
- Rename intel_gvt_{create, destroy}_gvt_device()
- Expost intel_gvt_init_host()
- Remove the dummy "struct intel_gvt" declaration in intel_gvt.h (Joonas)
v6:
- Refine introduction in Kconfig. (Chris)
- The exposed API functions will take struct intel_gvt * instead of
void *. (Chris/Tvrtko)
- Remove most memebers of strct intel_gvt_device_info. Will add them
in the device model patches.(Chris)
- Remove gvt_info() and gvt_err() in debug.h. (Chris)
- Move GVT kernel parameter into i915_params. (Chris)
- Remove include/drm/i915_gvt.h, as GVT-g will be built within i915.
- Remove the redundant struct i915_gvt *, as the functions in i915
will directly take struct intel_gvt *.
- Add more comments for reviewer.
v5:
Take Tvrtko's comments:
- Fix the misspelled words in Kconfig
- Let functions take drm_i915_private * instead of struct drm_device *
- Remove redundant prints/local varible initialization
v3:
Take Joonas' comments:
- Change file name i915_gvt.* to intel_gvt.*
- Move GVT kernel parameter into intel_gvt.c
- Remove redundant debug macros
- Change error handling style
- Add introductions for some stub functions
- Introduce drm/i915_gvt.h.
Take Kevin's comments:
- Move GVT-g host/guest check into intel_vgt_balloon in i915_gem_gtt.c
v2:
- Introduce i915_gvt.c.
It's necessary to introduce the stubs between i915 driver and GVT-g host,
as GVT-g components is configurable in kernel config. When disabled, the
stubs here do nothing.
Take Joonas' comments:
- Replace boolean return value with int.
- Replace customized info/warn/debug macros with DRM macros.
- Document all non-static functions like i915.
- Remove empty and unused functions.
- Replace magic number with marcos.
- Set GVT-g in kernel config to "n" by default.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466078825-6662-5-git-send-email-zhi.a.wang@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-16 20:07:00 +08:00
|
|
|
|
2016-06-20 20:17:02 +08:00
|
|
|
module_param_named(enable_gvt, i915.enable_gvt, bool, 0400);
|
drm/i915: gvt: Introduce the basic architecture of GVT-g
This patch introduces the very basic framework of GVT-g device model,
includes basic prototypes, definitions, initialization.
v12:
- Call intel_gvt_init() in driver early initialization stage. (Chris)
v8:
- Remove the GVT idr and mutex in intel_gvt_host. (Joonas)
v7:
- Refine the URL link in Kconfig. (Joonas)
- Refine the introduction of GVT-g host support in Kconfig. (Joonas)
- Remove the macro GVT_ALIGN(), use round_down() instead. (Joonas)
- Make "struct intel_gvt" a data member in struct drm_i915_private.(Joonas)
- Remove {alloc, free}_gvt_device()
- Rename intel_gvt_{create, destroy}_gvt_device()
- Expost intel_gvt_init_host()
- Remove the dummy "struct intel_gvt" declaration in intel_gvt.h (Joonas)
v6:
- Refine introduction in Kconfig. (Chris)
- The exposed API functions will take struct intel_gvt * instead of
void *. (Chris/Tvrtko)
- Remove most memebers of strct intel_gvt_device_info. Will add them
in the device model patches.(Chris)
- Remove gvt_info() and gvt_err() in debug.h. (Chris)
- Move GVT kernel parameter into i915_params. (Chris)
- Remove include/drm/i915_gvt.h, as GVT-g will be built within i915.
- Remove the redundant struct i915_gvt *, as the functions in i915
will directly take struct intel_gvt *.
- Add more comments for reviewer.
v5:
Take Tvrtko's comments:
- Fix the misspelled words in Kconfig
- Let functions take drm_i915_private * instead of struct drm_device *
- Remove redundant prints/local varible initialization
v3:
Take Joonas' comments:
- Change file name i915_gvt.* to intel_gvt.*
- Move GVT kernel parameter into intel_gvt.c
- Remove redundant debug macros
- Change error handling style
- Add introductions for some stub functions
- Introduce drm/i915_gvt.h.
Take Kevin's comments:
- Move GVT-g host/guest check into intel_vgt_balloon in i915_gem_gtt.c
v2:
- Introduce i915_gvt.c.
It's necessary to introduce the stubs between i915 driver and GVT-g host,
as GVT-g components is configurable in kernel config. When disabled, the
stubs here do nothing.
Take Joonas' comments:
- Replace boolean return value with int.
- Replace customized info/warn/debug macros with DRM macros.
- Document all non-static functions like i915.
- Remove empty and unused functions.
- Replace magic number with marcos.
- Set GVT-g in kernel config to "n" by default.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466078825-6662-5-git-send-email-zhi.a.wang@intel.com
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-16 20:07:00 +08:00
|
|
|
MODULE_PARM_DESC(enable_gvt,
|
|
|
|
"Enable support for Intel GVT-g graphics virtualization host support(default:false)");
|