linux/drivers/gpu/drm/i915/i915_params.c

/*
 * 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.
 */

#include <linux/string_helpers.h>

#include <drm/drm_print.h>

#include "i915_params.h"
#include "i915_drv.h"

DECLARE_DYNDBG_CLASSMAP();

#define i915_param_named(name, T, perm, desc)
#define i915_param_named_unsafe(name, T, perm, desc)

struct i915_params i915_modparams __read_mostly =;

/*
 * Note: As a rule, keep module parameter sysfs permissions read-only
 * 0400. Runtime changes are only supported through i915 debugfs.
 *
 * For any exceptions requiring write access and runtime changes through module
 * parameter sysfs, prevent debugfs file creation by setting the parameter's
 * debugfs mode to 0.
 */

i915_param_named();

i915_param_named_unsafe();

#if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
i915_param_named();
#endif

i915_param_named_unsafe();

i915_param_named_unsafe();

i915_param_named();

i915_param_named();

i915_param_named_unsafe();

i915_param_named();

i915_param_named_unsafe();

i915_param_named_unsafe();

i915_param_named_unsafe();

#if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
i915_param_named_unsafe(inject_probe_failure, uint, 0400,
	"Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)");
#endif

#if IS_ENABLED(CONFIG_DRM_I915_GVT)
i915_param_named();
#endif

#if CONFIG_DRM_I915_REQUEST_TIMEOUT
i915_param_named_unsafe();
#endif

i915_param_named_unsafe();
i915_param_named_unsafe();

#if IS_ENABLED(CONFIG_DRM_I915_REPLAY_GPU_HANGS_API)
i915_param_named();
#endif

static void _param_print_bool(struct drm_printer *p, const char *name,
			      bool val)
{}

static void _param_print_int(struct drm_printer *p, const char *name,
			     int val)
{}

static void _param_print_uint(struct drm_printer *p, const char *name,
			      unsigned int val)
{}

static void _param_print_ulong(struct drm_printer *p, const char *name,
			       unsigned long val)
{}

static void _param_print_charp(struct drm_printer *p, const char *name,
			       const char *val)
{}

#define _param_print(p, name, val)

/**
 * 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)
{}

static void _param_dup_charp(char **valp)
{}

static void _param_nop(void *valp)
{}

#define _param_dup(valp)

void i915_params_copy(struct i915_params *dest, const struct i915_params *src)
{}

static void _param_free_charp(char **valp)
{}

#define _param_free(valp)

/* free the allocated members, *not* the passed in params itself */
void i915_params_free(struct i915_params *params)
{}