linux/drivers/gpu/drm/drm_panel_orientation_quirks.c

/* SPDX-License-Identifier: MIT */
/*
 * drm_panel_orientation_quirks.c -- Quirks for non-normal panel orientation
 *
 * Copyright (C) 2017 Hans de Goede <[email protected]>
 *
 * Note the quirks in this file are shared with fbdev/efifb and as such
 * must not depend on other drm code.
 */

#include <linux/dmi.h>
#include <linux/module.h>
#include <drm/drm_connector.h>
#include <drm/drm_utils.h>

#ifdef CONFIG_DMI

/*
 * Some x86 clamshell design devices use portrait tablet screens and a display
 * engine which cannot rotate in hardware, so we need to rotate the fbcon to
 * compensate. Unfortunately these (cheap) devices also typically have quite
 * generic DMI data, so we match on a combination of DMI data, screen resolution
 * and a list of known BIOS dates to avoid false positives.
 */

struct drm_dmi_panel_orientation_data {};

static const struct drm_dmi_panel_orientation_data gpd_micropc =;

static const struct drm_dmi_panel_orientation_data gpd_onemix2s =;

static const struct drm_dmi_panel_orientation_data gpd_pocket =;

static const struct drm_dmi_panel_orientation_data gpd_pocket2 =;

static const struct drm_dmi_panel_orientation_data gpd_win =;

static const struct drm_dmi_panel_orientation_data gpd_win2 =;

static const struct drm_dmi_panel_orientation_data itworks_tw891 =;

static const struct drm_dmi_panel_orientation_data onegx1_pro =;

static const struct drm_dmi_panel_orientation_data lcd720x1280_rightside_up =;

static const struct drm_dmi_panel_orientation_data lcd800x1280_leftside_up =;

static const struct drm_dmi_panel_orientation_data lcd800x1280_rightside_up =;

static const struct drm_dmi_panel_orientation_data lcd1080x1920_leftside_up =;

static const struct drm_dmi_panel_orientation_data lcd1080x1920_rightside_up =;

static const struct drm_dmi_panel_orientation_data lcd1200x1920_rightside_up =;

static const struct drm_dmi_panel_orientation_data lcd1280x1920_rightside_up =;

static const struct drm_dmi_panel_orientation_data lcd1600x2560_leftside_up =;

static const struct drm_dmi_panel_orientation_data lcd1600x2560_rightside_up =;

static const struct dmi_system_id orientation_data[] =;

/**
 * drm_get_panel_orientation_quirk - Check for panel orientation quirks
 * @width: width in pixels of the panel
 * @height: height in pixels of the panel
 *
 * This function checks for platform specific (e.g. DMI based) quirks
 * providing info on panel_orientation for systems where this cannot be
 * probed from the hard-/firm-ware. To avoid false-positive this function
 * takes the panel resolution as argument and checks that against the
 * resolution expected by the quirk-table entry.
 *
 * Note this function is also used outside of the drm-subsys, by for example
 * the efifb code. Because of this this function gets compiled into its own
 * kernel-module when built as a module.
 *
 * Returns:
 * A DRM_MODE_PANEL_ORIENTATION_* value if there is a quirk for this system,
 * or DRM_MODE_PANEL_ORIENTATION_UNKNOWN if there is no quirk.
 */
int drm_get_panel_orientation_quirk(int width, int height)
{}
EXPORT_SYMBOL();

#else

/* There are no quirks for non x86 devices yet */
int drm_get_panel_orientation_quirk(int width, int height)
{
	return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
}
EXPORT_SYMBOL(drm_get_panel_orientation_quirk);

#endif

MODULE_DESCRIPTION();
MODULE_LICENSE();