Skip to content

Commit 0948a9e

Browse files
committed
Merge branches 'acpi-resource' and 'acpi-video'
Merge ACPI resource handling quirks and ACPI backlight handling fixes for 6.2-rc2: - Add ACPI IRQ override quirks for Asus ExpertBook B2502, Lenovo 14ALC7, and XMG Core 15 (Hans de Goede, Adrian Freund, Erik Schumacher). - Adjust ACPI video detection fallback path to prevent non-operational ACPI backlight devices from being created on systems where the native driver does not detect a suitable panel (Mario Limonciello). - Fix Apple GMUX backlight detection (Hans de Goede). * acpi-resource: ACPI: resource: Add Asus ExpertBook B2502 to Asus quirks ACPI: resource: do IRQ override on Lenovo 14ALC7 ACPI: resource: do IRQ override on XMG Core 15 * acpi-video: ACPI: video: Fix Apple GMUX backlight detection ACPI: video: Don't enable fallback path for creating ACPI backlight by default drm/amd/display: Report to ACPI video if no panels were found ACPI: video: Allow GPU drivers to report no panels
3 parents e555c85 + 7203481 + 3cf3b7f commit 0948a9e

File tree

5 files changed

+69
-9
lines changed

5 files changed

+69
-9
lines changed

drivers/acpi/acpi_video.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ module_param(device_id_scheme, bool, 0444);
7070
static int only_lcd = -1;
7171
module_param(only_lcd, int, 0444);
7272

73-
/*
74-
* Display probing is known to take up to 5 seconds, so delay the fallback
75-
* backlight registration by 5 seconds + 3 seconds for some extra margin.
76-
*/
77-
static int register_backlight_delay = 8;
73+
static int register_backlight_delay;
7874
module_param(register_backlight_delay, int, 0444);
7975
MODULE_PARM_DESC(register_backlight_delay,
8076
"Delay in seconds before doing fallback (non GPU driver triggered) "
@@ -2176,6 +2172,17 @@ static bool should_check_lcd_flag(void)
21762172
return false;
21772173
}
21782174

2175+
/*
2176+
* At least one graphics driver has reported that no LCD is connected
2177+
* via the native interface. cancel the registration for fallback acpi_video0.
2178+
* If another driver still deems this necessary, it can explicitly register it.
2179+
*/
2180+
void acpi_video_report_nolcd(void)
2181+
{
2182+
cancel_delayed_work(&video_bus_register_backlight_work);
2183+
}
2184+
EXPORT_SYMBOL(acpi_video_report_nolcd);
2185+
21792186
int acpi_video_register(void)
21802187
{
21812188
int ret = 0;

drivers/acpi/resource.c

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,24 @@ static const struct dmi_system_id asus_laptop[] = {
432432
DMI_MATCH(DMI_BOARD_NAME, "S5602ZA"),
433433
},
434434
},
435+
{
436+
.ident = "Asus ExpertBook B2502",
437+
.matches = {
438+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
439+
DMI_MATCH(DMI_BOARD_NAME, "B2502CBA"),
440+
},
441+
},
435442
{ }
436443
};
437444

438-
static const struct dmi_system_id lenovo_82ra[] = {
445+
static const struct dmi_system_id lenovo_laptop[] = {
446+
{
447+
.ident = "LENOVO IdeaPad Flex 5 14ALC7",
448+
.matches = {
449+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
450+
DMI_MATCH(DMI_PRODUCT_NAME, "82R9"),
451+
},
452+
},
439453
{
440454
.ident = "LENOVO IdeaPad Flex 5 16ALC7",
441455
.matches = {
@@ -446,6 +460,17 @@ static const struct dmi_system_id lenovo_82ra[] = {
446460
{ }
447461
};
448462

463+
static const struct dmi_system_id schenker_gm_rg[] = {
464+
{
465+
.ident = "XMG CORE 15 (M22)",
466+
.matches = {
467+
DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"),
468+
DMI_MATCH(DMI_BOARD_NAME, "GMxRGxx"),
469+
},
470+
},
471+
{ }
472+
};
473+
449474
struct irq_override_cmp {
450475
const struct dmi_system_id *system;
451476
unsigned char irq;
@@ -458,8 +483,9 @@ struct irq_override_cmp {
458483
static const struct irq_override_cmp override_table[] = {
459484
{ medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
460485
{ asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
461-
{ lenovo_82ra, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
462-
{ lenovo_82ra, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
486+
{ lenovo_laptop, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
487+
{ lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
488+
{ schenker_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
463489
};
464490

465491
static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,

drivers/acpi/video_detect.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/module.h>
3535
#include <linux/pci.h>
3636
#include <linux/platform_data/x86/nvidia-wmi-ec-backlight.h>
37+
#include <linux/pnp.h>
3738
#include <linux/types.h>
3839
#include <linux/workqueue.h>
3940
#include <acpi/video.h>
@@ -105,6 +106,26 @@ static bool nvidia_wmi_ec_supported(void)
105106
}
106107
#endif
107108

109+
static bool apple_gmux_backlight_present(void)
110+
{
111+
struct acpi_device *adev;
112+
struct device *dev;
113+
114+
adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1);
115+
if (!adev)
116+
return false;
117+
118+
dev = acpi_get_first_physical_node(adev);
119+
if (!dev)
120+
return false;
121+
122+
/*
123+
* drivers/platform/x86/apple-gmux.c only supports old style
124+
* Apple GMUX with an IO-resource.
125+
*/
126+
return pnp_get_resource(to_pnp_dev(dev), IORESOURCE_IO, 0) != NULL;
127+
}
128+
108129
/* Force to use vendor driver when the ACPI device is known to be
109130
* buggy */
110131
static int video_detect_force_vendor(const struct dmi_system_id *d)
@@ -767,7 +788,7 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
767788
if (nvidia_wmi_ec_present)
768789
return acpi_backlight_nvidia_wmi_ec;
769790

770-
if (apple_gmux_present())
791+
if (apple_gmux_backlight_present())
771792
return acpi_backlight_apple_gmux;
772793

773794
/* Use ACPI video if available, except when native should be preferred. */

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4360,6 +4360,10 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
43604360
amdgpu_set_panel_orientation(&aconnector->base);
43614361
}
43624362

4363+
/* If we didn't find a panel, notify the acpi video detection */
4364+
if (dm->adev->flags & AMD_IS_APU && dm->num_of_edps == 0)
4365+
acpi_video_report_nolcd();
4366+
43634367
/* Software is initialized. Now we can register interrupt handlers. */
43644368
switch (adev->asic_type) {
43654369
#if defined(CONFIG_DRM_AMD_DC_SI)

include/acpi/video.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ enum acpi_backlight_type {
5353
};
5454

5555
#if IS_ENABLED(CONFIG_ACPI_VIDEO)
56+
extern void acpi_video_report_nolcd(void);
5657
extern int acpi_video_register(void);
5758
extern void acpi_video_unregister(void);
5859
extern void acpi_video_register_backlight(void);
@@ -69,6 +70,7 @@ extern int acpi_video_get_levels(struct acpi_device *device,
6970
struct acpi_video_device_brightness **dev_br,
7071
int *pmax_level);
7172
#else
73+
static inline void acpi_video_report_nolcd(void) { return; };
7274
static inline int acpi_video_register(void) { return -ENODEV; }
7375
static inline void acpi_video_unregister(void) { return; }
7476
static inline void acpi_video_register_backlight(void) { return; }

0 commit comments

Comments
 (0)