linux/drivers/gpu/drm/i915/display/intel_opregion.c

/*
 * Copyright 2008 Intel Corporation <[email protected]>
 * Copyright 2008 Red Hat <[email protected]>
 *
 * 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
 * NON-INFRINGEMENT.  IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS 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/acpi.h>
#include <linux/dmi.h>
#include <acpi/video.h>

#include <drm/drm_edid.h>

#include "i915_drv.h"
#include "intel_acpi.h"
#include "intel_backlight.h"
#include "intel_display_types.h"
#include "intel_opregion.h"
#include "intel_pci_config.h"

#define OPREGION_HEADER_OFFSET
#define OPREGION_ACPI_OFFSET
#define ACPI_CLID
#define ACPI_CDCK
#define OPREGION_SWSCI_OFFSET
#define OPREGION_ASLE_OFFSET
#define OPREGION_VBT_OFFSET
#define OPREGION_ASLE_EXT_OFFSET

#define OPREGION_SIGNATURE
#define MBOX_ACPI
#define MBOX_SWSCI
#define MBOX_ASLE
#define MBOX_ASLE_EXT
#define MBOX_BACKLIGHT

#define PCON_HEADLESS_SKU

struct opregion_header {} __packed;

/* OpRegion mailbox #1: public ACPI methods */
struct opregion_acpi {} __packed;

/* OpRegion mailbox #2: SWSCI */
struct opregion_swsci {} __packed;

/* OpRegion mailbox #3: ASLE */
struct opregion_asle {} __packed;

/* OpRegion mailbox #5: ASLE ext */
struct opregion_asle_ext {} __packed;

/* Driver readiness indicator */
#define ASLE_ARDY_READY
#define ASLE_ARDY_NOT_READY

/* ASLE Interrupt Command (ASLC) bits */
#define ASLC_SET_ALS_ILLUM
#define ASLC_SET_BACKLIGHT
#define ASLC_SET_PFIT
#define ASLC_SET_PWM_FREQ
#define ASLC_SUPPORTED_ROTATION_ANGLES
#define ASLC_BUTTON_ARRAY
#define ASLC_CONVERTIBLE_INDICATOR
#define ASLC_DOCKING_INDICATOR
#define ASLC_ISCT_STATE_CHANGE
#define ASLC_REQ_MSK
/* response bits */
#define ASLC_ALS_ILLUM_FAILED
#define ASLC_BACKLIGHT_FAILED
#define ASLC_PFIT_FAILED
#define ASLC_PWM_FREQ_FAILED
#define ASLC_ROTATION_ANGLES_FAILED
#define ASLC_BUTTON_ARRAY_FAILED
#define ASLC_CONVERTIBLE_FAILED
#define ASLC_DOCKING_FAILED
#define ASLC_ISCT_STATE_FAILED

/* Technology enabled indicator */
#define ASLE_TCHE_ALS_EN
#define ASLE_TCHE_BLC_EN
#define ASLE_TCHE_PFIT_EN
#define ASLE_TCHE_PFMB_EN

/* ASLE backlight brightness to set */
#define ASLE_BCLP_VALID
#define ASLE_BCLP_MSK

/* ASLE panel fitting request */
#define ASLE_PFIT_VALID
#define ASLE_PFIT_CENTER
#define ASLE_PFIT_STRETCH_TEXT
#define ASLE_PFIT_STRETCH_GFX

/* PWM frequency and minimum brightness */
#define ASLE_PFMB_BRIGHTNESS_MASK
#define ASLE_PFMB_BRIGHTNESS_VALID
#define ASLE_PFMB_PWM_MASK
#define ASLE_PFMB_PWM_VALID

#define ASLE_CBLV_VALID

/* IUER */
#define ASLE_IUER_DOCKING
#define ASLE_IUER_CONVERTIBLE
#define ASLE_IUER_ROTATION_LOCK_BTN
#define ASLE_IUER_VOLUME_DOWN_BTN
#define ASLE_IUER_VOLUME_UP_BTN
#define ASLE_IUER_WINDOWS_BTN
#define ASLE_IUER_POWER_BTN

#define ASLE_PHED_EDID_VALID_MASK

/* Software System Control Interrupt (SWSCI) */
#define SWSCI_SCIC_INDICATOR
#define SWSCI_SCIC_MAIN_FUNCTION_SHIFT
#define SWSCI_SCIC_MAIN_FUNCTION_MASK
#define SWSCI_SCIC_SUB_FUNCTION_SHIFT
#define SWSCI_SCIC_SUB_FUNCTION_MASK
#define SWSCI_SCIC_EXIT_PARAMETER_SHIFT
#define SWSCI_SCIC_EXIT_PARAMETER_MASK
#define SWSCI_SCIC_EXIT_STATUS_SHIFT
#define SWSCI_SCIC_EXIT_STATUS_MASK
#define SWSCI_SCIC_EXIT_STATUS_SUCCESS

#define SWSCI_FUNCTION_CODE(main, sub)

/* SWSCI: Get BIOS Data (GBDA) */
#define SWSCI_GBDA
#define SWSCI_GBDA_SUPPORTED_CALLS
#define SWSCI_GBDA_REQUESTED_CALLBACKS
#define SWSCI_GBDA_BOOT_DISPLAY_PREF
#define SWSCI_GBDA_PANEL_DETAILS
#define SWSCI_GBDA_TV_STANDARD
#define SWSCI_GBDA_INTERNAL_GRAPHICS
#define SWSCI_GBDA_SPREAD_SPECTRUM

/* SWSCI: System BIOS Callbacks (SBCB) */
#define SWSCI_SBCB
#define SWSCI_SBCB_SUPPORTED_CALLBACKS
#define SWSCI_SBCB_INIT_COMPLETION
#define SWSCI_SBCB_PRE_HIRES_SET_MODE
#define SWSCI_SBCB_POST_HIRES_SET_MODE
#define SWSCI_SBCB_DISPLAY_SWITCH
#define SWSCI_SBCB_SET_TV_FORMAT
#define SWSCI_SBCB_ADAPTER_POWER_STATE
#define SWSCI_SBCB_DISPLAY_POWER_STATE
#define SWSCI_SBCB_SET_BOOT_DISPLAY
#define SWSCI_SBCB_SET_PANEL_DETAILS
#define SWSCI_SBCB_SET_INTERNAL_GFX
#define SWSCI_SBCB_POST_HIRES_TO_DOS_FS
#define SWSCI_SBCB_SUSPEND_RESUME
#define SWSCI_SBCB_SET_SPREAD_SPECTRUM
#define SWSCI_SBCB_POST_VBE_PM
#define SWSCI_SBCB_ENABLE_DISABLE_AUDIO

#define MAX_DSLP

#define OPREGION_SIZE

struct intel_opregion {};

static int check_swsci_function(struct intel_display *display, u32 function)
{}

static int swsci(struct intel_display *display,
		 u32 function, u32 parm, u32 *parm_out)
{}

#define DISPLAY_TYPE_CRT
#define DISPLAY_TYPE_TV
#define DISPLAY_TYPE_EXTERNAL_FLAT_PANEL
#define DISPLAY_TYPE_INTERNAL_FLAT_PANEL

int intel_opregion_notify_encoder(struct intel_encoder *encoder,
				  bool enable)
{}

static const struct {} power_state_map[] =;

int intel_opregion_notify_adapter(struct intel_display *display,
				  pci_power_t state)
{}

static u32 asle_set_backlight(struct intel_display *display, u32 bclp)
{}

static u32 asle_set_als_illum(struct intel_display *display, u32 alsi)
{}

static u32 asle_set_pwm_freq(struct intel_display *display, u32 pfmb)
{}

static u32 asle_set_pfit(struct intel_display *display, u32 pfit)
{}

static u32 asle_set_supported_rotation_angles(struct intel_display *display, u32 srot)
{}

static u32 asle_set_button_array(struct intel_display *display, u32 iuer)
{}

static u32 asle_set_convertible(struct intel_display *display, u32 iuer)
{}

static u32 asle_set_docking(struct intel_display *display, u32 iuer)
{}

static u32 asle_isct_state(struct intel_display *display)
{}

static void asle_work(struct work_struct *work)
{}

bool intel_opregion_asle_present(struct intel_display *display)
{}

void intel_opregion_asle_intr(struct intel_display *display)
{}

#define ACPI_EV_DISPLAY_SWITCH
#define ACPI_EV_LID
#define ACPI_EV_DOCK

/*
 * The only video events relevant to opregion are 0x80. These indicate either a
 * docking event, lid switch or display switch request. In Linux, these are
 * handled by the dock, button and video drivers.
 */
static int intel_opregion_video_event(struct notifier_block *nb,
				      unsigned long val, void *data)
{}

/*
 * Initialise the DIDL field in opregion. This passes a list of devices to
 * the firmware. Values are defined by section B.4.2 of the ACPI specification
 * (version 3)
 */

static void set_did(struct intel_opregion *opregion, int i, u32 val)
{}

static void intel_didl_outputs(struct intel_display *display)
{}

static void intel_setup_cadls(struct intel_display *display)
{}

static void swsci_setup(struct intel_display *display)
{}

static int intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
{}

static const struct dmi_system_id intel_no_opregion_vbt[] =;

int intel_opregion_setup(struct intel_display *display)
{}

static int intel_use_opregion_panel_type_callback(const struct dmi_system_id *id)
{}

static const struct dmi_system_id intel_use_opregion_panel_type[] =;

int
intel_opregion_get_panel_type(struct intel_display *display)
{}

/**
 * intel_opregion_get_edid - Fetch EDID from ACPI OpRegion mailbox #5
 * @connector: eDP connector
 *
 * This reads the ACPI Opregion mailbox #5 to extract the EDID that is passed
 * to it.
 *
 * Returns:
 * The EDID in the OpRegion, or NULL if there is none or it's invalid.
 *
 */
const struct drm_edid *intel_opregion_get_edid(struct intel_connector *connector)
{}

bool intel_opregion_vbt_present(struct intel_display *display)
{}

const void *intel_opregion_get_vbt(struct intel_display *display, size_t *size)
{}

bool intel_opregion_headless_sku(struct intel_display *display)
{}

void intel_opregion_register(struct intel_display *display)
{}

static void intel_opregion_resume_display(struct intel_display *display)
{}

void intel_opregion_resume(struct intel_display *display)
{}

static void intel_opregion_suspend_display(struct intel_display *display)
{}

void intel_opregion_suspend(struct intel_display *display, pci_power_t state)
{}

void intel_opregion_unregister(struct intel_display *display)
{}

void intel_opregion_cleanup(struct intel_display *display)
{}

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

DEFINE_SHOW_ATTRIBUTE();

void intel_opregion_debugfs_register(struct intel_display *display)
{}