Skip to content

Commit

Permalink
drm/gma500: Remove lid code
Browse files Browse the repository at this point in the history
[ Upstream commit 6aff4c2 ]

Due to a change in the order of initialization, the lid timer got
started before proper setup was made. This resulted in a crash during
boot.

The lid switch is handled by gma500 through a timer that periodically
polls the opregion for changes. These types of ACPI events shouldn't be
handled by the graphics driver so let's get rid of the lid code.  This
fixes the crash during boot.

Reported-by: Enrico Bartky <enrico.bartky@gmail.com>
Fixes: 8f1aacc ("drm/gma500: Implement client-based fbdev emulation")
Tested-by: Enrico Bartky <enrico.bartky@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240415112731.31841-1-patrik.r.jakobsson@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
patjak authored and gregkh committed May 2, 2024
1 parent bd7e8e5 commit 1960e9e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 94 deletions.
1 change: 0 additions & 1 deletion drivers/gpu/drm/gma500/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ gma500_gfx-y += \
psb_intel_lvds.o \
psb_intel_modes.o \
psb_intel_sdvo.o \
psb_lid.o \
psb_irq.o

gma500_gfx-$(CONFIG_ACPI) += opregion.o
Expand Down
5 changes: 1 addition & 4 deletions drivers/gpu/drm/gma500/psb_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ static int psb_backlight_setup(struct drm_device *dev)
}

psb_intel_lvds_set_brightness(dev, PSB_MAX_BRIGHTNESS);
/* This must occur after the backlight is properly initialised */
psb_lid_timer_init(dev_priv);

return 0;
}

Expand Down Expand Up @@ -259,8 +258,6 @@ static int psb_chip_setup(struct drm_device *dev)

static void psb_chip_teardown(struct drm_device *dev)
{
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
psb_lid_timer_takedown(dev_priv);
gma_intel_teardown_gmbus(dev);
}

Expand Down
9 changes: 0 additions & 9 deletions drivers/gpu/drm/gma500/psb_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@

#define PSB_NUM_VBLANKS 2
#define PSB_WATCHDOG_DELAY (HZ * 2)
#define PSB_LID_DELAY (HZ / 10)

#define PSB_MAX_BRIGHTNESS 100

Expand Down Expand Up @@ -499,11 +498,7 @@ struct drm_psb_private {
/* Hotplug handling */
struct work_struct hotplug_work;

/* LID-Switch */
spinlock_t lid_lock;
struct timer_list lid_timer;
struct psb_intel_opregion opregion;
u32 lid_last_state;

/* Watchdog */
uint32_t apm_reg;
Expand Down Expand Up @@ -599,10 +594,6 @@ struct psb_ops {
int i2c_bus; /* I2C bus identifier for Moorestown */
};

/* psb_lid.c */
extern void psb_lid_timer_init(struct drm_psb_private *dev_priv);
extern void psb_lid_timer_takedown(struct drm_psb_private *dev_priv);

/* modesetting */
extern void psb_modeset_init(struct drm_device *dev);
extern void psb_modeset_cleanup(struct drm_device *dev);
Expand Down
80 changes: 0 additions & 80 deletions drivers/gpu/drm/gma500/psb_lid.c

This file was deleted.

0 comments on commit 1960e9e

Please sign in to comment.