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.
|
|
|
|
*/
|
|
|
|
|
2017-12-19 18:43:46 +07:00
|
|
|
#include <drm/drm_print.h>
|
|
|
|
|
2015-12-18 18:08:15 +07:00
|
|
|
#include "i915_params.h"
|
2014-01-21 16:24:25 +07:00
|
|
|
#include "i915_drv.h"
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
#define i915_param_named(name, T, perm, desc) \
|
2017-09-20 02:38:44 +07:00
|
|
|
module_param_named(name, i915_modparams.name, T, perm); \
|
2017-09-14 22:08:03 +07:00
|
|
|
MODULE_PARM_DESC(name, desc)
|
|
|
|
#define i915_param_named_unsafe(name, T, perm, desc) \
|
2017-09-20 02:38:44 +07:00
|
|
|
module_param_named_unsafe(name, i915_modparams.name, T, perm); \
|
2017-09-14 22:08:03 +07:00
|
|
|
MODULE_PARM_DESC(name, desc)
|
2017-09-14 22:08:02 +07:00
|
|
|
|
2017-09-20 02:38:44 +07:00
|
|
|
struct i915_params i915_modparams __read_mostly = {
|
2017-09-25 17:50:07 +07:00
|
|
|
#define MEMBER(T, member, value) .member = (value),
|
|
|
|
I915_PARAMS_FOR_EACH(MEMBER)
|
|
|
|
#undef MEMBER
|
2014-01-21 16:24:25 +07:00
|
|
|
};
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named(modeset, int, 0400,
|
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])");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(enable_dc, int, 0400,
|
2015-11-16 21:01:06 +07:00
|
|
|
"Enable power-saving display C-states. "
|
|
|
|
"(-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6)");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(enable_fbc, int, 0600,
|
2014-01-21 16:24:25 +07:00
|
|
|
"Enable frame buffer compression for power savings "
|
|
|
|
"(default: -1 (use per-chip default))");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(lvds_channel_mode, int, 0400,
|
2014-01-21 16:24:25 +07:00
|
|
|
"Specify LVDS channel mode "
|
|
|
|
"(0=probe BIOS [default], 1=single-channel, 2=dual-channel)");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(panel_use_ssc, int, 0600,
|
2014-01-21 16:24:25 +07:00
|
|
|
"Use Spread Spectrum Clock with panels [LVDS/eDP] "
|
|
|
|
"(default: auto from VBT)");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(vbt_sdvo_panel_type, int, 0400,
|
2014-01-21 16:24:25 +07:00
|
|
|
"Override/Ignore selection of SDVO panel mode in the VBT "
|
|
|
|
"(-2=ignore, -1=auto [default], index in VBT BIOS table)");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(reset, int, 0600,
|
|
|
|
"Attempt GPU resets (0=disabled, 1=full gpu reset, 2=engine reset [default])");
|
2014-01-21 16:24:25 +07:00
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(vbt_firmware, charp, 0400,
|
|
|
|
"Load VBT from specified file under /lib/firmware");
|
2017-08-17 18:52:09 +07:00
|
|
|
|
2016-10-12 16:05:18 +07:00
|
|
|
#if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named(error_capture, bool, 0600,
|
2016-10-12 16:05:18 +07:00
|
|
|
"Record the GPU state following a hang. "
|
|
|
|
"This information in /sys/class/drm/card<N>/error is vital for "
|
|
|
|
"triaging and debugging hangs.");
|
|
|
|
#endif
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(enable_hangcheck, bool, 0644,
|
2014-01-21 16:24:25 +07:00
|
|
|
"Periodically check GPU activity for detecting hangs. "
|
|
|
|
"WARNING: Disabling this can cause system wide hangs. "
|
|
|
|
"(default: true)");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(enable_psr, int, 0600,
|
|
|
|
"Enable PSR "
|
2018-07-12 12:27:15 +07:00
|
|
|
"(0=disabled, 1=enabled) "
|
2017-09-14 22:08:03 +07:00
|
|
|
"Default: -1 (use per-chip default)");
|
2014-01-21 16:24:25 +07:00
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(alpha_support, bool, 0400,
|
2016-10-31 17:18:28 +07:00
|
|
|
"Enable alpha quality driver support for latest hardware. "
|
|
|
|
"See also CONFIG_DRM_I915_ALPHA_SUPPORT.");
|
2014-01-21 16:24:25 +07:00
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(disable_power_well, int, 0400,
|
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
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(enable_ips, int, 0600, "Enable IPS (default: true)");
|
2014-01-21 16:24:25 +07:00
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named(fastboot, bool, 0600,
|
2015-11-19 15:26:30 +07:00
|
|
|
"Try to skip unnecessary mode sets at boot time (default: false)");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(prefault_disable, bool, 0600,
|
2014-01-21 16:24:25 +07:00
|
|
|
"Disable page prefaulting for pread/pwrite/reloc (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(load_detect_test, bool, 0600,
|
2015-03-04 00:03:47 +07:00
|
|
|
"Force-enable the VGA load detect code for testing (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(force_reset_modeset_test, bool, 0600,
|
2016-08-06 03:28:28 +07:00
|
|
|
"Force a modeset during gpu reset for testing (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(invert_brightness, int, 0600,
|
2014-01-21 16:24:25 +07:00
|
|
|
"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
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named(disable_display, bool, 0400,
|
|
|
|
"Disable display (default: false)");
|
2014-02-19 01:15:46 +07:00
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named(mmio_debug, int, 0600,
|
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
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named(verbose_state_checks, bool, 0600,
|
2014-12-16 01:56:32 +07:00
|
|
|
"Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions.");
|
2015-01-23 07:53:12 +07:00
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(nuclear_pageflip, bool, 0400,
|
|
|
|
"Force enable atomic functionality on platforms that don't have full support yet.");
|
2015-08-26 14:29:56 +07:00
|
|
|
|
2015-05-06 19:05:48 +07:00
|
|
|
/* WA to get away with the default setting in VBT for early platforms.Will be removed */
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(edp_vswing, int, 0400,
|
|
|
|
"Ignore/Override vswing pre-emph table selection from VBT "
|
|
|
|
"(0=use value from vbt [default], 1=low power swing(200mV),"
|
|
|
|
"2=default swing(400mV))");
|
|
|
|
|
2017-12-06 20:53:15 +07:00
|
|
|
i915_param_named_unsafe(enable_guc, int, 0400,
|
|
|
|
"Enable GuC load for GuC submission and/or HuC load. "
|
|
|
|
"Required functionality can be selected using bitmask values. "
|
|
|
|
"(-1=auto, 0=disable [default], 1=GuC submission, 2=HuC load)");
|
2017-09-14 22:08:03 +07:00
|
|
|
|
|
|
|
i915_param_named(guc_log_level, int, 0400,
|
2018-01-11 22:24:40 +07:00
|
|
|
"GuC firmware logging level. Requires GuC to be loaded. "
|
|
|
|
"(-1=auto [default], 0=disable, 1..4=enable with verbosity min..max)");
|
2016-03-15 22:14:05 +07:00
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(guc_firmware_path, charp, 0400,
|
2017-03-14 21:28:14 +07:00
|
|
|
"GuC firmware path to use instead of the default one");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(huc_firmware_path, charp, 0400,
|
2017-03-14 21:28:14 +07:00
|
|
|
"HuC firmware path to use instead of the default one");
|
|
|
|
|
2018-04-24 19:20:16 +07:00
|
|
|
i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
|
|
|
|
"DMC firmware path to use instead of the default one");
|
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(enable_dp_mst, bool, 0600,
|
2016-03-15 22:14:05 +07:00
|
|
|
"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
|
2017-09-14 22:08:03 +07:00
|
|
|
|
2018-02-02 00:32:48 +07:00
|
|
|
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named_unsafe(inject_load_failure, uint, 0400,
|
2016-03-16 18:39:08 +07:00
|
|
|
"Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)");
|
2018-02-02 00:32:48 +07:00
|
|
|
#endif
|
2017-09-14 22:08:03 +07:00
|
|
|
|
|
|
|
i915_param_named(enable_dpcd_backlight, bool, 0600,
|
2017-07-20 16:25:17 +07:00
|
|
|
"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 19:07:00 +07:00
|
|
|
|
2017-09-14 22:08:03 +07:00
|
|
|
i915_param_named(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 19:07:00 +07:00
|
|
|
"Enable support for Intel GVT-g graphics virtualization host support(default:false)");
|
2017-12-19 18:43:46 +07:00
|
|
|
|
|
|
|
static __always_inline void _print_param(struct drm_printer *p,
|
|
|
|
const char *name,
|
|
|
|
const char *type,
|
|
|
|
const void *x)
|
|
|
|
{
|
|
|
|
if (!__builtin_strcmp(type, "bool"))
|
|
|
|
drm_printf(p, "i915.%s=%s\n", name, yesno(*(const bool *)x));
|
|
|
|
else if (!__builtin_strcmp(type, "int"))
|
|
|
|
drm_printf(p, "i915.%s=%d\n", name, *(const int *)x);
|
|
|
|
else if (!__builtin_strcmp(type, "unsigned int"))
|
|
|
|
drm_printf(p, "i915.%s=%u\n", name, *(const unsigned int *)x);
|
|
|
|
else if (!__builtin_strcmp(type, "char *"))
|
|
|
|
drm_printf(p, "i915.%s=%s\n", name, *(const char **)x);
|
|
|
|
else
|
|
|
|
BUILD_BUG();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* i915_params_dump - dump i915 modparams
|
|
|
|
* @params: i915 modparams
|
|
|
|
* @p: the &drm_printer
|
|
|
|
*
|
|
|
|
* Pretty printer for i915 modparams.
|
|
|
|
*/
|
|
|
|
void i915_params_dump(const struct i915_params *params, struct drm_printer *p)
|
|
|
|
{
|
|
|
|
#define PRINT(T, x, ...) _print_param(p, #x, #T, ¶ms->x);
|
|
|
|
I915_PARAMS_FOR_EACH(PRINT);
|
|
|
|
#undef PRINT
|
|
|
|
}
|