linux/drivers/gpu/drm/i915/display/intel_dmc.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, sublicense,
 * 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/debugfs.h>
#include <linux/firmware.h>

#include "i915_drv.h"
#include "i915_reg.h"
#include "intel_de.h"
#include "intel_dmc.h"
#include "intel_dmc_regs.h"
#include "intel_step.h"

/**
 * DOC: DMC Firmware Support
 *
 * From gen9 onwards we have newly added DMC (Display microcontroller) in display
 * engine to save and restore the state of display engine when it enter into
 * low-power state and comes back to normal.
 */

#define INTEL_DMC_FIRMWARE_URL

enum intel_dmc_id {};

struct intel_dmc {};

/* Note: This may be NULL. */
static struct intel_dmc *i915_to_dmc(struct drm_i915_private *i915)
{}

static const char *dmc_firmware_param(struct drm_i915_private *i915)
{}

static bool dmc_firmware_param_disabled(struct drm_i915_private *i915)
{}

#define DMC_VERSION(major, minor)
#define DMC_VERSION_MAJOR(version)
#define DMC_VERSION_MINOR(version)

#define DMC_PATH(platform)

/*
 * New DMC additions should not use this. This is used solely to remain
 * compatible with systems that have not yet updated DMC blobs to use
 * unversioned file names.
 */
#define DMC_LEGACY_PATH(platform, major, minor)

#define XE2LPD_DMC_MAX_FW_SIZE
#define XELPDP_DMC_MAX_FW_SIZE
#define DISPLAY_VER13_DMC_MAX_FW_SIZE
#define DISPLAY_VER12_DMC_MAX_FW_SIZE

#define XE2LPD_DMC_PATH
MODULE_FIRMWARE();

#define BMG_DMC_PATH
MODULE_FIRMWARE();

#define MTL_DMC_PATH
MODULE_FIRMWARE();

#define DG2_DMC_PATH
MODULE_FIRMWARE();

#define ADLP_DMC_PATH
#define ADLP_DMC_FALLBACK_PATH
MODULE_FIRMWARE();
MODULE_FIRMWARE();

#define ADLS_DMC_PATH
MODULE_FIRMWARE();

#define DG1_DMC_PATH
MODULE_FIRMWARE();

#define RKL_DMC_PATH
MODULE_FIRMWARE();

#define TGL_DMC_PATH
MODULE_FIRMWARE();

#define ICL_DMC_PATH
#define ICL_DMC_MAX_FW_SIZE
MODULE_FIRMWARE();

#define GLK_DMC_PATH
#define GLK_DMC_MAX_FW_SIZE
MODULE_FIRMWARE();

#define KBL_DMC_PATH
#define KBL_DMC_MAX_FW_SIZE
MODULE_FIRMWARE();

#define SKL_DMC_PATH
#define SKL_DMC_MAX_FW_SIZE
MODULE_FIRMWARE();

#define BXT_DMC_PATH
#define BXT_DMC_MAX_FW_SIZE
MODULE_FIRMWARE();

static const char *dmc_firmware_default(struct drm_i915_private *i915, u32 *size)
{}

#define DMC_DEFAULT_FW_OFFSET
#define PACKAGE_MAX_FW_INFO_ENTRIES
#define PACKAGE_V2_MAX_FW_INFO_ENTRIES
#define DMC_V1_MAX_MMIO_COUNT
#define DMC_V3_MAX_MMIO_COUNT
#define DMC_V1_MMIO_START_RANGE

#define PIPE_TO_DMC_ID(pipe)

struct intel_css_header {} __packed;

struct intel_fw_info {} __packed;

struct intel_package_header {} __packed;

struct intel_dmc_header_base {} __packed;

struct intel_dmc_header_v1 {} __packed;

struct intel_dmc_header_v3 {} __packed;

struct stepping_info {};

#define for_each_dmc_id(__dmc_id)

static bool is_valid_dmc_id(enum intel_dmc_id dmc_id)
{}

static bool has_dmc_id_fw(struct drm_i915_private *i915, enum intel_dmc_id dmc_id)
{}

bool intel_dmc_has_payload(struct drm_i915_private *i915)
{}

static const struct stepping_info *
intel_get_stepping_info(struct drm_i915_private *i915,
			struct stepping_info *si)
{}

static void gen9_set_dc_state_debugmask(struct drm_i915_private *i915)
{}

static void disable_event_handler(struct drm_i915_private *i915,
				  i915_reg_t ctl_reg, i915_reg_t htp_reg)
{}

static void disable_all_event_handlers(struct drm_i915_private *i915)
{}

static void adlp_pipedmc_clock_gating_wa(struct drm_i915_private *i915, bool enable)
{}

static void mtl_pipedmc_clock_gating_wa(struct drm_i915_private *i915)
{}

static void pipedmc_clock_gating_wa(struct drm_i915_private *i915, bool enable)
{}

void intel_dmc_enable_pipe(struct drm_i915_private *i915, enum pipe pipe)
{}

void intel_dmc_disable_pipe(struct drm_i915_private *i915, enum pipe pipe)
{}

static bool is_dmc_evt_ctl_reg(struct drm_i915_private *i915,
			       enum intel_dmc_id dmc_id, i915_reg_t reg)
{}

static bool is_dmc_evt_htp_reg(struct drm_i915_private *i915,
			       enum intel_dmc_id dmc_id, i915_reg_t reg)
{}

static bool disable_dmc_evt(struct drm_i915_private *i915,
			    enum intel_dmc_id dmc_id,
			    i915_reg_t reg, u32 data)
{}

static u32 dmc_mmiodata(struct drm_i915_private *i915,
			struct intel_dmc *dmc,
			enum intel_dmc_id dmc_id, int i)
{}

/**
 * intel_dmc_load_program() - write the firmware from memory to register.
 * @i915: i915 drm device.
 *
 * DMC firmware is read from a .bin file and kept in internal memory one time.
 * Everytime display comes back from low power state this function is called to
 * copy the firmware from internal memory to registers.
 */
void intel_dmc_load_program(struct drm_i915_private *i915)
{}

/**
 * intel_dmc_disable_program() - disable the firmware
 * @i915: i915 drm device
 *
 * Disable all event handlers in the firmware, making sure the firmware is
 * inactive after the display is uninitialized.
 */
void intel_dmc_disable_program(struct drm_i915_private *i915)
{}

void assert_dmc_loaded(struct drm_i915_private *i915)
{}

static bool fw_info_matches_stepping(const struct intel_fw_info *fw_info,
				     const struct stepping_info *si)
{}

/*
 * Search fw_info table for dmc_offset to find firmware binary: num_entries is
 * already sanitized.
 */
static void dmc_set_fw_offset(struct intel_dmc *dmc,
			      const struct intel_fw_info *fw_info,
			      unsigned int num_entries,
			      const struct stepping_info *si,
			      u8 package_ver)
{}

static bool dmc_mmio_addr_sanity_check(struct intel_dmc *dmc,
				       const u32 *mmioaddr, u32 mmio_count,
				       int header_ver, enum intel_dmc_id dmc_id)
{}

static u32 parse_dmc_fw_header(struct intel_dmc *dmc,
			       const struct intel_dmc_header_base *dmc_header,
			       size_t rem_size, enum intel_dmc_id dmc_id)
{}

static u32
parse_dmc_fw_package(struct intel_dmc *dmc,
		     const struct intel_package_header *package_header,
		     const struct stepping_info *si,
		     size_t rem_size)
{}

/* Return number of bytes parsed or 0 on error */
static u32 parse_dmc_fw_css(struct intel_dmc *dmc,
			    struct intel_css_header *css_header,
			    size_t rem_size)
{}

static int parse_dmc_fw(struct intel_dmc *dmc, const struct firmware *fw)
{}

static void intel_dmc_runtime_pm_get(struct drm_i915_private *i915)
{}

static void intel_dmc_runtime_pm_put(struct drm_i915_private *i915)
{}

static const char *dmc_fallback_path(struct drm_i915_private *i915)
{}

static void dmc_load_work_fn(struct work_struct *work)
{}

/**
 * intel_dmc_init() - initialize the firmware loading.
 * @i915: i915 drm device.
 *
 * This function is called at the time of loading the display driver to read
 * firmware from a .bin file and copied into a internal memory.
 */
void intel_dmc_init(struct drm_i915_private *i915)
{}

/**
 * intel_dmc_suspend() - prepare DMC firmware before system suspend
 * @i915: i915 drm device
 *
 * Prepare the DMC firmware before entering system suspend. This includes
 * flushing pending work items and releasing any resources acquired during
 * init.
 */
void intel_dmc_suspend(struct drm_i915_private *i915)
{}

/**
 * intel_dmc_resume() - init DMC firmware during system resume
 * @i915: i915 drm device
 *
 * Reinitialize the DMC firmware during system resume, reacquiring any
 * resources released in intel_dmc_suspend().
 */
void intel_dmc_resume(struct drm_i915_private *i915)
{}

/**
 * intel_dmc_fini() - unload the DMC firmware.
 * @i915: i915 drm device.
 *
 * Firmmware unloading includes freeing the internal memory and reset the
 * firmware loading status.
 */
void intel_dmc_fini(struct drm_i915_private *i915)
{}

void intel_dmc_print_error_state(struct drm_printer *p,
				 struct drm_i915_private *i915)
{}

static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
{}

DEFINE_SHOW_ATTRIBUTE();

void intel_dmc_debugfs_register(struct drm_i915_private *i915)
{}