linux/drivers/gpu/drm/nouveau/nouveau_acpi.c

// SPDX-License-Identifier: MIT
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/slab.h>
#include <linux/mxm-wmi.h>
#include <linux/vga_switcheroo.h>
#include <drm/drm_edid.h>
#include <acpi/video.h>

#include "nouveau_drv.h"
#include "nouveau_acpi.h"

#define NOUVEAU_DSM_LED
#define NOUVEAU_DSM_LED_STATE
#define NOUVEAU_DSM_LED_OFF
#define NOUVEAU_DSM_LED_STAMINA
#define NOUVEAU_DSM_LED_SPEED

#define NOUVEAU_DSM_POWER
#define NOUVEAU_DSM_POWER_STATE
#define NOUVEAU_DSM_POWER_SPEED
#define NOUVEAU_DSM_POWER_STAMINA

#define NOUVEAU_DSM_OPTIMUS_CAPS
#define NOUVEAU_DSM_OPTIMUS_FLAGS

#define NOUVEAU_DSM_OPTIMUS_POWERDOWN_PS3
#define NOUVEAU_DSM_OPTIMUS_NO_POWERDOWN_PS3
#define NOUVEAU_DSM_OPTIMUS_FLAGS_CHANGED

#define NOUVEAU_DSM_OPTIMUS_SET_POWERDOWN

/* result of the optimus caps function */
#define OPTIMUS_ENABLED
#define OPTIMUS_STATUS_MASK
#define OPTIMUS_STATUS_OFF
#define OPTIMUS_STATUS_ON_ENABLED
#define OPTIMUS_STATUS_PWR_STABLE
#define OPTIMUS_DISPLAY_HOTPLUG
#define OPTIMUS_CAPS_MASK
#define OPTIMUS_DYNAMIC_PWR_CAP

#define OPTIMUS_AUDIO_CAPS_MASK
#define OPTIMUS_HDA_CODEC_MASK

static struct nouveau_dsm_priv {} nouveau_dsm_priv;

bool nouveau_is_optimus(void) {}

bool nouveau_is_v1_dsm(void) {}

#ifdef CONFIG_VGA_SWITCHEROO
static const guid_t nouveau_dsm_muid =;

static const guid_t nouveau_op_dsm_muid =;

static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
{}

/*
 * On some platforms, _DSM(nouveau_op_dsm_muid, func0) has special
 * requirements on the fourth parameter, so a private implementation
 * instead of using acpi_check_dsm().
 */
static int nouveau_dsm_get_optimus_functions(acpi_handle handle)
{}

static int nouveau_dsm(acpi_handle handle, int func, int arg)
{}

static int nouveau_dsm_switch_mux(acpi_handle handle, int mux_id)
{}

static int nouveau_dsm_set_discrete_state(acpi_handle handle, enum vga_switcheroo_state state)
{}

static int nouveau_dsm_switchto(enum vga_switcheroo_client_id id)
{}

static int nouveau_dsm_power_state(enum vga_switcheroo_client_id id,
				   enum vga_switcheroo_state state)
{}

static enum vga_switcheroo_client_id nouveau_dsm_get_client_id(struct pci_dev *pdev)
{}

static const struct vga_switcheroo_handler nouveau_dsm_handler =;

static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out,
				  bool *has_mux, bool *has_opt,
				  bool *has_opt_flags, bool *has_pr3)
{}

static bool nouveau_dsm_detect(void)
{}

void nouveau_register_dsm_handler(void)
{}

/* Must be called for Optimus models before the card can be turned off */
void nouveau_switcheroo_optimus_dsm(void)
{}

void nouveau_unregister_dsm_handler(void)
{}
#else
void nouveau_register_dsm_handler(void) {}
void nouveau_unregister_dsm_handler(void) {}
void nouveau_switcheroo_optimus_dsm(void) {}
#endif

void *
nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector)
{}

bool nouveau_acpi_video_backlight_use_native(void)
{}

void nouveau_acpi_video_register_backlight(void)
{}