18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright © 2015 Intel Corporation
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
58c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
68c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation
78c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
88c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
98c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice (including the next
128c2ecf20Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
138c2ecf20Sopenharmony_ci * Software.
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
168c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
178c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
188c2ecf20Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
198c2ecf20Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
208c2ecf20Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
218c2ecf20Sopenharmony_ci * IN THE SOFTWARE.
228c2ecf20Sopenharmony_ci *
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#ifndef _I915_PARAMS_H_
268c2ecf20Sopenharmony_ci#define _I915_PARAMS_H_
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#include <linux/bitops.h>
298c2ecf20Sopenharmony_ci#include <linux/cache.h> /* for __read_mostly */
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_cistruct drm_printer;
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#define ENABLE_GUC_SUBMISSION		BIT(0)
348c2ecf20Sopenharmony_ci#define ENABLE_GUC_LOAD_HUC		BIT(1)
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/*
378c2ecf20Sopenharmony_ci * Invoke param, a function-like macro, for each i915 param, with arguments:
388c2ecf20Sopenharmony_ci *
398c2ecf20Sopenharmony_ci * param(type, name, value, mode)
408c2ecf20Sopenharmony_ci *
418c2ecf20Sopenharmony_ci * type: parameter type, one of {bool, int, unsigned int, unsigned long, char *}
428c2ecf20Sopenharmony_ci * name: name of the parameter
438c2ecf20Sopenharmony_ci * value: initial/default value of the parameter
448c2ecf20Sopenharmony_ci * mode: debugfs file permissions, one of {0400, 0600, 0}, use 0 to not create
458c2ecf20Sopenharmony_ci *       debugfs file
468c2ecf20Sopenharmony_ci */
478c2ecf20Sopenharmony_ci#define I915_PARAMS_FOR_EACH(param) \
488c2ecf20Sopenharmony_ci	param(char *, vbt_firmware, NULL, 0400) \
498c2ecf20Sopenharmony_ci	param(int, modeset, -1, 0400) \
508c2ecf20Sopenharmony_ci	param(int, lvds_channel_mode, 0, 0400) \
518c2ecf20Sopenharmony_ci	param(int, panel_use_ssc, -1, 0600) \
528c2ecf20Sopenharmony_ci	param(int, vbt_sdvo_panel_type, -1, 0400) \
538c2ecf20Sopenharmony_ci	param(int, enable_dc, -1, 0400) \
548c2ecf20Sopenharmony_ci	param(int, enable_fbc, -1, 0600) \
558c2ecf20Sopenharmony_ci	param(int, enable_psr, -1, 0600) \
568c2ecf20Sopenharmony_ci	param(bool, psr_safest_params, false, 0600) \
578c2ecf20Sopenharmony_ci	param(bool, enable_psr2_sel_fetch, false, 0600) \
588c2ecf20Sopenharmony_ci	param(int, disable_power_well, -1, 0400) \
598c2ecf20Sopenharmony_ci	param(int, enable_ips, 1, 0600) \
608c2ecf20Sopenharmony_ci	param(int, invert_brightness, 0, 0600) \
618c2ecf20Sopenharmony_ci	param(int, enable_guc, 0, 0400) \
628c2ecf20Sopenharmony_ci	param(int, guc_log_level, -1, 0400) \
638c2ecf20Sopenharmony_ci	param(char *, guc_firmware_path, NULL, 0400) \
648c2ecf20Sopenharmony_ci	param(char *, huc_firmware_path, NULL, 0400) \
658c2ecf20Sopenharmony_ci	param(char *, dmc_firmware_path, NULL, 0400) \
668c2ecf20Sopenharmony_ci	param(int, mmio_debug, -IS_ENABLED(CONFIG_DRM_I915_DEBUG_MMIO), 0600) \
678c2ecf20Sopenharmony_ci	param(int, edp_vswing, 0, 0400) \
688c2ecf20Sopenharmony_ci	param(unsigned int, reset, 3, 0600) \
698c2ecf20Sopenharmony_ci	param(unsigned int, inject_probe_failure, 0, 0) \
708c2ecf20Sopenharmony_ci	param(int, fastboot, -1, 0600) \
718c2ecf20Sopenharmony_ci	param(int, enable_dpcd_backlight, -1, 0600) \
728c2ecf20Sopenharmony_ci	param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \
738c2ecf20Sopenharmony_ci	param(unsigned long, fake_lmem_start, 0, 0400) \
748c2ecf20Sopenharmony_ci	/* leave bools at the end to not create holes */ \
758c2ecf20Sopenharmony_ci	param(bool, enable_hangcheck, true, 0600) \
768c2ecf20Sopenharmony_ci	param(bool, load_detect_test, false, 0600) \
778c2ecf20Sopenharmony_ci	param(bool, force_reset_modeset_test, false, 0600) \
788c2ecf20Sopenharmony_ci	param(bool, error_capture, true, 0600) \
798c2ecf20Sopenharmony_ci	param(bool, disable_display, false, 0400) \
808c2ecf20Sopenharmony_ci	param(bool, verbose_state_checks, true, 0) \
818c2ecf20Sopenharmony_ci	param(bool, nuclear_pageflip, false, 0400) \
828c2ecf20Sopenharmony_ci	param(bool, enable_dp_mst, true, 0600) \
838c2ecf20Sopenharmony_ci	param(bool, enable_gvt, false, 0400)
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci#define MEMBER(T, member, ...) T member;
868c2ecf20Sopenharmony_cistruct i915_params {
878c2ecf20Sopenharmony_ci	I915_PARAMS_FOR_EACH(MEMBER);
888c2ecf20Sopenharmony_ci};
898c2ecf20Sopenharmony_ci#undef MEMBER
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ciextern struct i915_params i915_modparams __read_mostly;
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_civoid i915_params_dump(const struct i915_params *params, struct drm_printer *p);
948c2ecf20Sopenharmony_civoid i915_params_copy(struct i915_params *dest, const struct i915_params *src);
958c2ecf20Sopenharmony_civoid i915_params_free(struct i915_params *params);
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#endif
988c2ecf20Sopenharmony_ci
99