162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright © 2015 Intel Corporation
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
562306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
662306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation
762306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
862306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
962306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci * The above copyright notice and this permission notice (including the next
1262306a36Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
1362306a36Sopenharmony_ci * Software.
1462306a36Sopenharmony_ci *
1562306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1662306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1762306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1862306a36Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1962306a36Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2062306a36Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2162306a36Sopenharmony_ci * IN THE SOFTWARE.
2262306a36Sopenharmony_ci *
2362306a36Sopenharmony_ci */
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci#ifndef _I915_PARAMS_H_
2662306a36Sopenharmony_ci#define _I915_PARAMS_H_
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#include <linux/bitops.h>
2962306a36Sopenharmony_ci#include <linux/cache.h> /* for __read_mostly */
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_cistruct drm_printer;
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#define ENABLE_GUC_SUBMISSION		BIT(0)
3462306a36Sopenharmony_ci#define ENABLE_GUC_LOAD_HUC		BIT(1)
3562306a36Sopenharmony_ci#define ENABLE_GUC_MASK			GENMASK(1, 0)
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci/*
3862306a36Sopenharmony_ci * Invoke param, a function-like macro, for each i915 param, with arguments:
3962306a36Sopenharmony_ci *
4062306a36Sopenharmony_ci * param(type, name, value, mode)
4162306a36Sopenharmony_ci *
4262306a36Sopenharmony_ci * type: parameter type, one of {bool, int, unsigned int, unsigned long, char *}
4362306a36Sopenharmony_ci * name: name of the parameter
4462306a36Sopenharmony_ci * value: initial/default value of the parameter
4562306a36Sopenharmony_ci * mode: debugfs file permissions, one of {0400, 0600, 0}, use 0 to not create
4662306a36Sopenharmony_ci *       debugfs file
4762306a36Sopenharmony_ci */
4862306a36Sopenharmony_ci#define I915_PARAMS_FOR_EACH(param) \
4962306a36Sopenharmony_ci	param(char *, vbt_firmware, NULL, 0400) \
5062306a36Sopenharmony_ci	param(int, modeset, -1, 0400) \
5162306a36Sopenharmony_ci	param(int, lvds_channel_mode, 0, 0400) \
5262306a36Sopenharmony_ci	param(int, panel_use_ssc, -1, 0600) \
5362306a36Sopenharmony_ci	param(int, vbt_sdvo_panel_type, -1, 0400) \
5462306a36Sopenharmony_ci	param(int, enable_dc, -1, 0400) \
5562306a36Sopenharmony_ci	param(int, enable_fbc, -1, 0600) \
5662306a36Sopenharmony_ci	param(int, enable_psr, -1, 0600) \
5762306a36Sopenharmony_ci	param(bool, enable_dpt, true, 0400) \
5862306a36Sopenharmony_ci	param(bool, psr_safest_params, false, 0400) \
5962306a36Sopenharmony_ci	param(bool, enable_psr2_sel_fetch, true, 0400) \
6062306a36Sopenharmony_ci	param(bool, enable_sagv, true, 0600) \
6162306a36Sopenharmony_ci	param(int, disable_power_well, -1, 0400) \
6262306a36Sopenharmony_ci	param(int, enable_ips, 1, 0600) \
6362306a36Sopenharmony_ci	param(int, invert_brightness, 0, 0600) \
6462306a36Sopenharmony_ci	param(int, enable_guc, -1, 0400) \
6562306a36Sopenharmony_ci	param(int, guc_log_level, -1, 0400) \
6662306a36Sopenharmony_ci	param(char *, guc_firmware_path, NULL, 0400) \
6762306a36Sopenharmony_ci	param(char *, huc_firmware_path, NULL, 0400) \
6862306a36Sopenharmony_ci	param(char *, dmc_firmware_path, NULL, 0400) \
6962306a36Sopenharmony_ci	param(char *, gsc_firmware_path, NULL, 0400) \
7062306a36Sopenharmony_ci	param(bool, memtest, false, 0400) \
7162306a36Sopenharmony_ci	param(int, mmio_debug, -IS_ENABLED(CONFIG_DRM_I915_DEBUG_MMIO), 0600) \
7262306a36Sopenharmony_ci	param(int, edp_vswing, 0, 0400) \
7362306a36Sopenharmony_ci	param(unsigned int, reset, 3, 0600) \
7462306a36Sopenharmony_ci	param(unsigned int, inject_probe_failure, 0, 0) \
7562306a36Sopenharmony_ci	param(int, fastboot, -1, 0600) \
7662306a36Sopenharmony_ci	param(int, enable_dpcd_backlight, -1, 0600) \
7762306a36Sopenharmony_ci	param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \
7862306a36Sopenharmony_ci	param(unsigned int, request_timeout_ms, CONFIG_DRM_I915_REQUEST_TIMEOUT, CONFIG_DRM_I915_REQUEST_TIMEOUT ? 0600 : 0) \
7962306a36Sopenharmony_ci	param(unsigned int, lmem_size, 0, 0400) \
8062306a36Sopenharmony_ci	param(unsigned int, lmem_bar_size, 0, 0400) \
8162306a36Sopenharmony_ci	/* leave bools at the end to not create holes */ \
8262306a36Sopenharmony_ci	param(bool, enable_hangcheck, true, 0600) \
8362306a36Sopenharmony_ci	param(bool, load_detect_test, false, 0600) \
8462306a36Sopenharmony_ci	param(bool, force_reset_modeset_test, false, 0600) \
8562306a36Sopenharmony_ci	param(bool, error_capture, true, IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR) ? 0600 : 0) \
8662306a36Sopenharmony_ci	param(bool, disable_display, false, 0400) \
8762306a36Sopenharmony_ci	param(bool, verbose_state_checks, true, 0) \
8862306a36Sopenharmony_ci	param(bool, nuclear_pageflip, false, 0400) \
8962306a36Sopenharmony_ci	param(bool, enable_dp_mst, true, 0600) \
9062306a36Sopenharmony_ci	param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0)
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci#define MEMBER(T, member, ...) T member;
9362306a36Sopenharmony_cistruct i915_params {
9462306a36Sopenharmony_ci	I915_PARAMS_FOR_EACH(MEMBER);
9562306a36Sopenharmony_ci};
9662306a36Sopenharmony_ci#undef MEMBER
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ciextern struct i915_params i915_modparams __read_mostly;
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_civoid i915_params_dump(const struct i915_params *params, struct drm_printer *p);
10162306a36Sopenharmony_civoid i915_params_copy(struct i915_params *dest, const struct i915_params *src);
10262306a36Sopenharmony_civoid i915_params_free(struct i915_params *params);
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci#endif
105