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.
|
|
|
|
*/
|
|
|
|
|
2017-12-19 19:43:46 +08:00
|
|
|
#include <drm/drm_print.h>
|
|
|
|
|
2015-12-18 19:08:15 +08:00
|
|
|
#include "i915_params.h"
|
2014-01-21 17:24:25 +08:00
|
|
|
#include "i915_drv.h"
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
#define i915_param_named(name, T, perm, desc) \
|
2017-09-20 03:38:44 +08:00
|
|
|
module_param_named(name, i915_modparams.name, T, perm); \
|
2017-09-14 23:08:03 +08:00
|
|
|
MODULE_PARM_DESC(name, desc)
|
|
|
|
#define i915_param_named_unsafe(name, T, perm, desc) \
|
2017-09-20 03:38:44 +08:00
|
|
|
module_param_named_unsafe(name, i915_modparams.name, T, perm); \
|
2017-09-14 23:08:03 +08:00
|
|
|
MODULE_PARM_DESC(name, desc)
|
2017-09-14 23:08:02 +08:00
|
|
|
|
2017-09-20 03:38:44 +08:00
|
|
|
struct i915_params i915_modparams __read_mostly = {
|
2017-09-25 18:50:07 +08:00
|
|
|
#define MEMBER(T, member, value) .member = (value),
|
|
|
|
I915_PARAMS_FOR_EACH(MEMBER)
|
|
|
|
#undef MEMBER
|
2014-01-21 17:24:25 +08:00
|
|
|
};
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named(modeset, int, 0400,
|
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])");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(enable_dc, int, 0400,
|
2015-11-16 22:01:06 +08:00
|
|
|
"Enable power-saving display C-states. "
|
|
|
|
"(-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6)");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(enable_fbc, int, 0600,
|
2014-01-21 17:24:25 +08:00
|
|
|
"Enable frame buffer compression for power savings "
|
|
|
|
"(default: -1 (use per-chip default))");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(lvds_channel_mode, int, 0400,
|
2014-01-21 17:24:25 +08:00
|
|
|
"Specify LVDS channel mode "
|
|
|
|
"(0=probe BIOS [default], 1=single-channel, 2=dual-channel)");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(panel_use_ssc, int, 0600,
|
2014-01-21 17:24:25 +08:00
|
|
|
"Use Spread Spectrum Clock with panels [LVDS/eDP] "
|
|
|
|
"(default: auto from VBT)");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(vbt_sdvo_panel_type, int, 0400,
|
2014-01-21 17:24:25 +08:00
|
|
|
"Override/Ignore selection of SDVO panel mode in the VBT "
|
|
|
|
"(-2=ignore, -1=auto [default], index in VBT BIOS table)");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(reset, int, 0600,
|
|
|
|
"Attempt GPU resets (0=disabled, 1=full gpu reset, 2=engine reset [default])");
|
2014-01-21 17:24:25 +08:00
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(vbt_firmware, charp, 0400,
|
|
|
|
"Load VBT from specified file under /lib/firmware");
|
2017-08-17 19:52:09 +08:00
|
|
|
|
2016-10-12 17:05:18 +08:00
|
|
|
#if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named(error_capture, bool, 0600,
|
2016-10-12 17:05:18 +08: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 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(enable_hangcheck, bool, 0644,
|
2014-01-21 17:24:25 +08:00
|
|
|
"Periodically check GPU activity for detecting hangs. "
|
|
|
|
"WARNING: Disabling this can cause system wide hangs. "
|
|
|
|
"(default: true)");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(enable_psr, int, 0600,
|
|
|
|
"Enable PSR "
|
2018-07-12 13:27:15 +08:00
|
|
|
"(0=disabled, 1=enabled) "
|
2017-09-14 23:08:03 +08:00
|
|
|
"Default: -1 (use per-chip default)");
|
2014-01-21 17:24:25 +08:00
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(alpha_support, bool, 0400,
|
2016-10-31 18:18:28 +08:00
|
|
|
"Enable alpha quality driver support for latest hardware. "
|
|
|
|
"See also CONFIG_DRM_I915_ALPHA_SUPPORT.");
|
2014-01-21 17:24:25 +08:00
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(disable_power_well, int, 0400,
|
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
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(enable_ips, int, 0600, "Enable IPS (default: true)");
|
2014-01-21 17:24:25 +08:00
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named(fastboot, bool, 0600,
|
2015-11-19 16:26:30 +08:00
|
|
|
"Try to skip unnecessary mode sets at boot time (default: false)");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(prefault_disable, bool, 0600,
|
2014-01-21 17:24:25 +08:00
|
|
|
"Disable page prefaulting for pread/pwrite/reloc (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(load_detect_test, bool, 0600,
|
2015-03-04 01:03:47 +08:00
|
|
|
"Force-enable the VGA load detect code for testing (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(force_reset_modeset_test, bool, 0600,
|
2016-08-06 04:28:28 +08:00
|
|
|
"Force a modeset during gpu reset for testing (default:false). "
|
|
|
|
"For developers only.");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(invert_brightness, int, 0600,
|
2014-01-21 17:24:25 +08: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 01:20:55 +08:00
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named(disable_display, bool, 0400,
|
|
|
|
"Disable display (default: false)");
|
2014-02-19 02:15:46 +08:00
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named(mmio_debug, int, 0600,
|
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
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named(verbose_state_checks, bool, 0600,
|
2014-12-16 02:56:32 +08:00
|
|
|
"Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions.");
|
2015-01-23 08:53:12 +08:00
|
|
|
|
2017-09-14 23:08:03 +08: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 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 */
|
2017-09-14 23:08:03 +08: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 21:53:15 +08: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 23:08:03 +08:00
|
|
|
|
|
|
|
i915_param_named(guc_log_level, int, 0400,
|
2018-01-11 23:24:40 +08: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 23:14:05 +08:00
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(guc_firmware_path, charp, 0400,
|
2017-03-14 22:28:14 +08:00
|
|
|
"GuC firmware path to use instead of the default one");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(huc_firmware_path, charp, 0400,
|
2017-03-14 22:28:14 +08:00
|
|
|
"HuC firmware path to use instead of the default one");
|
|
|
|
|
2018-04-24 20:20:16 +08:00
|
|
|
i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
|
|
|
|
"DMC firmware path to use instead of the default one");
|
|
|
|
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(enable_dp_mst, bool, 0600,
|
2016-03-15 23:14:05 +08:00
|
|
|
"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
|
2017-09-14 23:08:03 +08:00
|
|
|
|
2018-02-02 01:32:48 +08:00
|
|
|
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
|
2017-09-14 23:08:03 +08:00
|
|
|
i915_param_named_unsafe(inject_load_failure, uint, 0400,
|
2016-03-16 19:39:08 +08: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 01:32:48 +08:00
|
|
|
#endif
|
2017-09-14 23:08:03 +08:00
|
|
|
|
|
|
|
i915_param_named(enable_dpcd_backlight, bool, 0600,
|
2017-07-20 17:25:17 +08: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 20:07:00 +08:00
|
|
|
|
2018-11-16 22:44:47 +08:00
|
|
|
#if IS_ENABLED(CONFIG_DRM_I915_GVT)
|
2017-09-14 23:08:03 +08: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 20:07:00 +08:00
|
|
|
"Enable support for Intel GVT-g graphics virtualization host support(default:false)");
|
2018-11-16 22:44:47 +08:00
|
|
|
#endif
|
2017-12-19 19:43:46 +08: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
|
2018-10-16 20:29:37 +08:00
|
|
|
WARN_ONCE(1, "no printer defined for param type %s (i915.%s)\n",
|
|
|
|
type, name);
|
2017-12-19 19:43:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
}
|
2018-12-27 22:33:37 +08:00
|
|
|
|
|
|
|
static __always_inline void dup_param(const char *type, void *x)
|
|
|
|
{
|
|
|
|
if (!__builtin_strcmp(type, "char *"))
|
|
|
|
*(void **)x = kstrdup(*(void **)x, GFP_ATOMIC);
|
|
|
|
}
|
|
|
|
|
|
|
|
void i915_params_copy(struct i915_params *dest, const struct i915_params *src)
|
|
|
|
{
|
|
|
|
*dest = *src;
|
|
|
|
#define DUP(T, x, ...) dup_param(#T, &dest->x);
|
|
|
|
I915_PARAMS_FOR_EACH(DUP);
|
|
|
|
#undef DUP
|
|
|
|
}
|
2018-12-27 22:33:38 +08:00
|
|
|
|
|
|
|
static __always_inline void free_param(const char *type, void *x)
|
|
|
|
{
|
|
|
|
if (!__builtin_strcmp(type, "char *")) {
|
|
|
|
kfree(*(void **)x);
|
|
|
|
*(void **)x = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* free the allocated members, *not* the passed in params itself */
|
|
|
|
void i915_params_free(struct i915_params *params)
|
|
|
|
{
|
|
|
|
#define FREE(T, x, ...) free_param(#T, ¶ms->x);
|
|
|
|
I915_PARAMS_FOR_EACH(FREE);
|
|
|
|
#undef FREE
|
|
|
|
}
|