/* * Copyright 2008 Intel Corporation <hong.liu@intel.com> * Copyright 2008 Red Hat <mjg@redhat.com> * * 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"i915_utils.h" #include"intel_acpi.h" #include"intel_backlight.h" #include"intel_display_core.h" #include"intel_display_types.h"
includeintel_opregionhjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 #nclude"intel_pci_config.h"
/* OpRegion mailbox #1: public ACPI methods */ struct opregion_acpi
u32 drdy; et_pwm_freq(struct *displayu32)
u32
u32 cevt; /* current event */
u8 rsvd12];
u32 didl[8]; /* supported display devices ID list */
u32 cpdl[8]; /* currently presented display list */
u32 cadl[8]; /* currently active display list */
u32 nadl[8]; return ASLC_PWM_FREQ_FAILED;
u32 aslp; /* ASL sleep time-out */
u32 staticu32(structintel_displaydisplayu32)
u32
u32 clid; /* current lid state*/java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
u32 cdck;java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
(display-, " is notsupportedn);
u32 evts; /* ASL supported events */ ASLC_PFIT_FAILED
u32
u32 nrdy; /* driver status */staticu32asle_set_supported_rotation_anglesstructintel_display*isplay, srot
u32 did2 (display-drm, " isnot\n";
u32 cpd2[ ASLC_ROTATION_ANGLES_FAILED
u8 rsvd2[4];
} _java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#define ASLC_ALS_ILLUM_FAILED (1 u32asle_set_docking( intel_displaydisplay iuer #define ASLC_BACKLIGHT_FAILED (1 << java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 #define ASLC_PFIT_FAILED #define ASLC_PWM_FREQ_FAILED (1 <<java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 23 #define ASLC_ROTATION_ANGLES_FAILED (1 << 18) #definereturn; #define ASLC_CONVERTIBLE_FAILED #define ASLC_DOCKING_FAILEDjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #defineASLC_ISCT_STATE_FAILED( << 2)
/* ASLE backlight brightness to set */ #define ASLE_BCLP_VALIDjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 #staticvoidasle_work work_struct *work)
/* IUER */ #define ASLE_IUER_DOCKING (1 << 7) #define ASLE_IUER_CONVERTIBLEu32aslc_stat = 0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 #definejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #define ASLE_IUER_VOLUME_DOWN_BTN (1 r; #define java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0 #define ASLE_IUER_WINDOWS_BTN ( < 1) #define ASLE_IUER_POWER_BTN
#define ASLE_PHED_EDID_VALID_MASK
/* Software System Control Interrupt (SWSCI) */ #define SWSCI_SCIC_INDICATOR (1 << 0) #define SWSCI_SCIC_MAIN_FUNCTION_SHIFT 1 #define equest ASLC 0x08\n" aslc_req; #define java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 9 #define java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #defineSWSCI_SCIC_EXIT_PARAMETER_SHIFT #define SWSCI_SCIC_EXIT_PARAMETER_MASK (0xff << 8) #define 5 #define SWSCI_SCIC_EXIT_STATUS_MASK (7 << 5) #define SWSCI_SCIC_EXIT_STATUS_SUCCESS 1
/* SWSCI: System BIOS Callbacks (SBCB) */ #define SWSCI_SBCB 6 #define SWSCI_SBCB_SUPPORTED_CALLBACKS SWSCI_FUNCTION_CODE(SWSCI_SBCB #defineSWSCI_SBCB_INIT_COMPLETIONSWSCI_FUNCTION_CODESWSCI_SBCB1
(, ) #define SWSCI_SBCB_POST_HIRES_SET_MODE SWSCI_FUNCTION_CODE(SWSCI_SBCB, 4) # faslc_reqASLC_CONVERTIBLE_INDICATOR)
define(,6java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
(,7 #define java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
|asle_isct_state); #define java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0 #define java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 1
define SWSCI_FUNCTION_CODESWSCI_SBCB 6java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 #efine SWSCI_SBCB_SUSPEND_RESUMESWSCI_FUNCTION_CODESWSCI_SBCB 1)
eturn>opregion& display->opregion-asle #define SWSCI_SBCB_POST_VBE_PM} #define SWSCI_SBCB_ENABLE_DISABLE_AUDIO
#define MAX_DSLP 150
#define java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
swsci = opregion-> * The only video events relevant to opregion are 0x80. These * docking event, lid switchor display switch request. In Linux, these * handled by the dock, button and video drivers. if (!swsci) return - unsigned val void *)
/* Check if we can call the function. See swsci_setup for details. */intel_opregion*opregion=container_ofnb structintel_opregion if (main_function == SWSCI_SBCB) {
((opregion-> &
(1 << sub_function)) == 0) return -EINVAL
} elseif (main_function intret= NOTIFY_OK if ((opregion->device_class ACPI_VIDEO_CLASS) = 0)
(1 << sub_function)) == 0) return -EINVAL;
}
eturn;
}
staticint swsci(struct intel_displayacpi opregion->acpi
u32 function, u32 parm if(event- == 0x80 &&((acpi- & 1) ==0)
{ struct opregion_swsci *swsci; struct pci_dev *pdev = to_pci_dev(display->drm->dev);
acpi- = 0;
u16 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0 int ret * the firmware. Values are defined by section * (version 3)
ret = check_swsci_function(display, function); if (ret) return ret;
swsci = opregion->didli]= val;
}else{
dslp = swsci->dslp; if (!dslp) { /* The spec says 2ms should be the default, but it's too small
* for some machines. */
dslp = 50;
} elseif (dslp > MAX_DSLP
java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
DRM_INFO_ONCE(>acpi-did2[ ; "using %u ms instead\n", dslp
dslp = MAX_DSLP;
}
/* The spec tells us to do this, but we are the only user... */
= >scic if (scic & SWSCI_SCIC_INDICATOR) {
drm_dbg(display->drm "SWSCIrequest already progress\n"; return -EBUSY;
}
scic = function | SWSCI_SCIC_INDICATOR;
swsci->parm = parm;
swsci->scic = scic;
/* Ensure SCI event is selected and event trigger is cleared. */
pci_read_config_word(pdev, if/* swsci_val |= SWSCI_SCISEL; swsci_val &= ~SWSCI_GSSCIE; pci_write_config_word(pdev, SWSCI, swsci_val); }
/* Use event trigger to tell bios to check the mail. */
swsci_val = SWSCI_GSSCIE
* versions as well, a BIOS thatdoesn' understand did2 should
/* Poll for the result. */ #define C (((scic = swsci->scic) & SWSCI_SCIC_INDICATOR) == 0) if (wait_for(C, dslp)) {
drm_dbg(display-drm, "SWSCI request timed out\n"); return - *ariseslater
}
int intel_opregion_notify_encoder(struct } bool enable)
{ struct intel_display *display drm_connector_list_iter_end&conn_iter;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
u32 type = 0;
u32 port; int ret;
/* don't care about old stuff for now */ if (!HAS_DDIifi max_outputs
0;
/* Avoid port out of bounds checks if SWSCI isn't there. */
ret = check_swsci_function(display, if (ret) return ret;
if (encoder->type == INTEL_OUTPUT_DSI)
port =0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 else
port
/* * The port numbering and mapping here is bizarre. The now-obsolete * swsci spec supports ports numbered [0..4]. Port E is handled as a * special case, but port F and beyond are not. The functionality is * supposed to be obsolete for new platforms. Just bail out if the port * number is out of bounds after mapping.
*/ if (port * not always correct as display outputs may exist, * initialization is necessary for some Clevo laptops that * field before processing the brightness and display switching *
drm_dbg_kms>drm, " if ( > ARRAY_SIZE(>acpi->cadl))
encoder-.baseid, >base.name,
port_name(encoder-o>acpi-[i++ >acpi_device_id return
}
if (!enable)
parm |= 4 /* If fewer than 8 active devices, the list must be null terminated */
switch (encoder->type) { case INTEL_OUTPUT_ANALOG:
type = DISPLAY_TYPE_CRT; break; case INTEL_OUTPUT_DDI: case INTEL_OUTPUT_DP: case INTEL_OUTPUT_HDMI: case INTEL_OUTPUT_DP_MST:
type = DISPLAY_TYPE_EXTERNAL_FLAT_PANEL; break; case INTEL_OUTPUT_EDP: case INTEL_OUTPUT_DSI:
type = DISPLAY_TYPE_INTERNAL_FLAT_PANEL; break; default:
drm_WARN_ONCE(display->drm, 1, "unsupported intel_encoder type %d\n",
encoder->type); return -EINVAL;
}
if (acpi_video_get_backlight_type() == acpi_backlight_native) { /* make the bits match the sub-function codes */ match sub-function */
opregionbacklightrequest\"; return 0;
}
if (!(bclp & return ASLC_BACKLIGHT_FAILED;
bclp &= ASLE_BCLP_MSK; if (bclp > 255) return ASLC_BACKLIGHT_FAILED;
/* * Update backlight on all connectors that support backlight (usually * only one).
*/
drm_dbg_kms(display->drm, " * bios.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
drm_connector_list_iter_begin(display-drm &onn_iter
for_each_intel_connector_iter(connector, &conn_iter)
intel_backlight_set_acpiconnector-base.state, bclp 55;
drm_connector_list_iter_end(&conn_iteropregion- |= tmp
asle-> = true
return we use SBCB to ask for _supported_ SBCB calls. This does not mean * the callback is _requested_. But we still can't call interfaces that
}
static/
{ /* alsi is the current ALS reading in lux. 0 indicates below sensor
range, 0xffff indicates above sensor range. 1-0xfffe are valid */
drm_dbg ( <)|(ow<1 |1
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
staticif((eq ) != )
{
drm_dbg(display->drm, "PWM freq is not supported\n"); return ASLC_PWM_FREQ_FAILED;
}
staticu32asle_set_pfit(struct *display u32pfit
{ /* Panel fitting is currently controlled by the X code, so this is a
noop until modesetting support works fully */
drm_dbg(display->drm, "Pfit is not supported\n"); return ASLC_PFIT_FAILED
}
static u32asle_set_supported_rotation_anglesstructintel_displaydisplayu32srot
{
drm_dbg(display->drm, java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 returnASLC_ROTATION_ANGLES_FAILED
}
taticasle_set_button_arraystruct*isplay )
{ if (!iuer)
drm_dbg(display->drm, " opregion->swsci_gbda_sub_functions,
>swsci_sbcb_sub_functionsjava.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
bgdisplay->drm "Button{ if (iuer & ASLE_IUER_VOLUME_DOWN_BTN)
drm_dbg(display->drm, "Buttonarrayevent not supported (olumedown\n"; if VBIOSROM sn",id->)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
drm_dbg(display->drm staticconststructdmi_system_idintel_no_opregion_vbt] = if (iuer & ASLE_IUER_WINDOWS_BTN)
drm_dbg(display->drm "Button array . = "ThinkCentre A57
. = {
drm_dbg(display->drm DMI_MATCH, ""), "Button array (DMI_PRODUCT_NAME,"972RG)
return ASLC_BUTTON_ARRAY_FAILED;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
static u32 asle_set_convertible;
{ if (iuer & ASLE_IUER_CONVERTIBLE)
drm_dbgdisplay-drm "Convertible is not java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1 else
ay->, "Convertible is not supported (slate) u32asls,mboxesjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
return ASLC_CONVERTIBLE_FAILED;
}
static oidbase
{
uer&ASLE_IUER_DOCKING
drm_dbg(display->drm,java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 14 else
drm_dbg>drm " (sizeof(structopregion_acpi =010;
/* * 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.
*/ staticint intel_opregion_video_event(struct u8 = opregion->eader-.major
( >= 3 java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
{ struct intel_opregion *opregion = container_of(nb, struct intel_opregion,
acpi_notifier); struct acpi_bus_event *event = data if major= 2 struct opregion_acpi *cpi int ret (display-drm "SWSCI n";
if (strcmp (display; return NOTIFY_DONE;
acpi = opregion->acpi;
if (event-
ret =ifmboxes MBOX_ASLE{
acpi->csts = 0;
return ret;
}
/* * 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)
*/
staticvoid set_did(struct intel_opregion *opregion, int i, u32 val)
{ if (}
opregion->acpi-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}else
i -= java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
if (dmi_check_systemintel_no_opregion_vbt) return;
opregion->acpi->did2[i] = val;
}
}
staticvoid intel_didl_outputs(structgotoout
{ struct intel_opregion* = display->opregion
s intel_connector*; struct drm_connector_list_iter rvda =opregion-asle-rvda; int i = 0, max_outputs/*
/* * In theory, did2, the extended didl, gets added at opregion version * 3.0. In practice, however, we're supposed to set it for earlier * versions as well, since a BIOS that doesn't understand did2 should * not look at it anyway. Use a variable so we can tweak this if a need * arises later.
*/
max_outputs = ARRAY_SIZE(opregion->acpi- >header-.minor> ) {
drm_WARN_ONdisplay-drm < OPREGION_SIZE);
intel_acpi_device_id_update(display);
drm_connector_list_iter_begin(display->drm, java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
for_each_intel_connector_iter, &conn_iterjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
( max_outputs
set_did(opregion, i, connector->acpi_device_id);
i++;
} vbt opregion-;
drm_connector_list_iter_end(&conn_iter) vbt_size =opregion-asle-;
drm_dbg_kmsdisplay-, "doutputsdetectedn, i);
ifi >max_outputs
drm_err>, "More than %d outputs in connector list\n",
max_outputs);
/* If fewer than max outputs, the list must be null terminated */ if (i < max_outputs)
set_didopregion 0;
}
staticvoid intel_setup_cadls(struct intel_display opregion->vbt_size= vbt_sizejava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
{ struct intel_opregion(>); struct >rvda; struct drm_connector_list_iter conn_iter; inti=;
/* * Initialize the CADL field from the connector device ids. This is * essentially the same as copying from the DIDL. Technically, this is * not always correct as display outputs may exist, but not active. This * initialization is necessary for some Clevo laptops that check this * field before processing the brightness and display switching hotkeys. * * Note that internal panels should be at the front of the connector * list already, ensuring they're not left out.
*/
vbt_size ( & ) ?
for_each_intel_connector_iter(connector, &conn_iter) { if (i >= ARRAY_SIZE(opregion->acpi->cadl)) break;
opregion->acpi->cadl[i++] = OPREGION_ASLE_EXT_OFFSET:OPREGION_SIZE
}
drm_connector_list_iter_end(&conn_iterifintel_bios_is_valid_vbt, vbt )) {
/* If fewer than 8 active devices, the list must be null terminated */ if (i < ARRAY_SIZE(opregion->acpi->cadl))
opregion-acpi-cadl[i] =;
}
/* We use GBDA to ask for supported GBDA calls. */ ifjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0 /* make the bits match the sub-function codes */
>opregion=NULL
opregion-
}
/* * We also use GBDA to ask for _requested_ SBCB callbacks. The driver * must not call interfaces that are not specifically requested by the * bios.
*/
((display , 0, &tmp= 0 { /* here, the bits already match sub-function codes */
opregion->swsci_sbcb_sub_functions |= tmp;
requested_callbacks = true;
}
/* * But we use SBCB to ask for _supported_ SBCB calls. This does not mean * the callback is _requested_. But we still can't call interfaces that * are not requested.
*/ if (swsci(display{ /* make the bits match the sub-function codes */
. = intel_use_opregion_panel_type_callback
u32 .dent " IX45GM2"
tmp = ( . = {DMI_MATCHDMI_SYS_VENDOR" GmbH)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
, if (requested_callbacks) {
u32 req = opregion-} if ((req
drm_dbg(display- "intel_opregion_get_panel_type(struct intel_display *isplay)
req, tmp); /* XXX: for now, trust the requested callbacks */ /* opregion->swsci_sbcb_sub_functions &= tmp; */
} else {
o>swsci_sbcb_sub_functions=tmp
}
}
drm_dbg(display->drm, "SWSCI GBDA callbacks %0 if ()
opregion->swsci_gbda_sub_functions,
opregion->swsci_sbcb_sub_functions);
}
static intel_no_opregion_vbt_callbackconststruct dmi_system_id*d
{
DRM_DEBUG_KMS("java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 18 "VBIOS ROM InvalidOpRegionpaneltype xxn" ) return;
}
static intel_no_opregion_vbt
{
.allback ,
.ident = "ThinkCentre A57 drm_dbg_kmsdisplay-drm," panel in \n")
.matches ={
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "97027 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
},
},
{ }
};
int * via a quirk list :(
{ structif(!mi_check_system(intel_use_opregion_panel_type{ struct pci_devpdev=to_pci_dev(display->dev);
u32asls mboxes; char buf[sizeof(OPREGION_SIGNATURE)]; int = ; void *base; constvoid *vbt;
u2vbt_size
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
BUILD_BUG_ON(sizeof(struct * @connector: eDP connector
BUILD_BUG_ON(sizeof( * This reads the ACPI Opregion mailbox #5 to extract the EDID * to it.
BUILD_BUG_ON(sizeof(struct opregion_asle_ext) != 0x400 * The EDID in the OpRegion, or NULL if there is none *
pci_read_config_dwordjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
drm_dbg(display->drm, "graphic opregion physical addr: 0x%x\n",
asls); if (asls == 0) {
drm_dbg(display->drm, "ACPI OpRegion not supported!\n"); return -ENOTSUPP;
}
opregion = kzalloc(sizeof(*opregion), GFP_KERNEL); if (!pregionjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 return -ENOMEM;
drm_dbg ;
opregion->header->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
opregion->header->over.minor intel_opregion opregionopregion
opregion- if! || !>vbt
mboxes returntruejava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
drm_dbg>," ACPI methodssupportedn);
opregion->acpi = base + OPREGION_ACPI_OFFSET; /* * Indicate we handle monitor hotplug events ourselves so we do * not need ACPI notifications for them. Disabling these avoids * triggering the AML code doing the notifation, which may be * broken as Windows also seems to disable these.
*/
>>chpd;
}
if (mboxes & MBOX_SWSCI) {
u8 major = opregion->header->overjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
i major )
drm_err
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
if ()
(display-," 2for v2xn";
drm_dbg(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
o>swsci +OPREGION_SWSCI_OFFSET
s();
}
}
>>pcon ;
drm_dbg(display->drm
opregion->asle = base + void intel_opregion_register(struct intel_displjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
( &MBOX_ASLE_EXT
drm_dbg(display-> ;
> =base;
}
if ( if (mboxesdisplay;
drm_dbg(display->drm, "Mailbox #2 for backlight present\n");}
}
if (dmi_check_system(intel_no_opregion_vbt)) goto;
/* * opregion 2.0: rvda is the physical VBT address. * * opregion 2.1+: rvda is unsigned, relative offset from * opregion base, and should never point within opregion.
*/ if (opregion->header->overopregion-acpi- = ;
>header-. >= 1 java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
drm_WARN_ON >asle- = ;
+ ;
}
opregion->rvda = memremap( /* Some platforms abuse the _DSM to enable MUX */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
cancel_work_sync&opregion-asle_work; /* * The VBT specification says that if the ASLE ext mailbox is not used * its area is reserved, but on some CHT boards the VBT extends into the * ASLE ext area. Allow this even though it is against the spec, so we * do not end up rejecting the VBT on those boards (and end up not * finding the LCD panel because of this).
*/
vbt_size = (mboxes & MBOX_ASLE_EXT) ?
OPREGION_ASLE_EXT_OFFSET : OPREGION_SIZE;
vbt_size -= OPREGION_VBT_OFFSET; if (intel_bios_is_valid_vbt(display, vbt, vbt_size)) {
(display-drmjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
opregion->vbtjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
opregion->vbt_size(opregion
} java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
drm_dbg_kms( "void( *)
}
staticvoidintel_opregion_cleanup intel_display *isplay
{
. = ,
.ident = "Conracjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(opregion-);
DMI_MATCH (pregion-rvda
},
,
{ }
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
int
intel_opregion_get_panel_typejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
u32 panel_details; int ret;
ret = swsci(display struct *display m-private
() return ret;
= panel_details>8 &xff if (ret > 0x10) {
drm_dbg_kms(display- "Invalid OpRegion panel type 0DEFINE_SHOW_ATTRIBUTE(intel_opregion); returnvoid inte(structintel_display)
/* fall back to VBT panel type? */ if (ret == 0x0) {
drm_dbg_kms(display->drm, "No panel type in OpRegion display, &intel_opregion_fops); return -ENODEV;
}
/* * So far we know that some machined must use it, others must not use it. * There doesn't seem to be any way to determine which way to go, except * via a quirk list :(
*/ if (!dmi_check_system(intel_use_opregion_panel_type)) {
drm_dbg_kms(display->drm, "Ignoring OpRegion panel type (%d)\n", ret - 1); return -ENODEV;
}
return ret - 1;
}
/** * 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. *
*/ conststruct drm_edid *intel_opregion_get_edid(struct intel_connector *connector)
{ struct intel_display *display = to_intel_display(connector); struct intel_opregion *opregion = display->opregion; conststruct drm_edid *drm_edid; constvoid *edid; int len;
if (!opregion || !opregion->asle_ext) return NULL;
edid = opregion->asle_ext->bddc;
/* Validity corresponds to number of 128-byte blocks */
len = (opregion->asle_ext->phed & ASLE_PHED_EDID_VALID_MASK) * 128; if (!len || mem_is_zero(edid, len)) return NULL;
drm_edid = drm_edid_alloc(edid, len);
if (!drm_edid_valid(drm_edid)) {
drm_dbg_kms(display->drm, "Invalid EDID in ACPI OpRegion (Mailbox #5)\n");
drm_edid_free(drm_edid);
drm_edid = NULL;
}
if (opregion->acpi) {
intel_didl_outputs(display);
intel_setup_cadls(display);
/* * Notify BIOS we are ready to handle ACPI video ext notifs. * Right now, all the events are handled by the ACPI video * module. We don't actually need to do anything with them.
*/
opregion->acpi->csts = 0;
opregion->acpi->drdy = 1;
}
if (opregion->asle) {
opregion->asle->tche = ASLE_TCHE_BLC_EN;
opregion->asle->ardy = ASLE_ARDY_READY;
}
/* Some platforms abuse the _DSM to enable MUX */
intel_dsm_get_bios_data_funcs_supported(display);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.