drivers/gpu/drm/gma500/cdv_intel_lvds.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/gma500/cdv_intel_lvds.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/gma500/cdv_intel_lvds.c- Extension
.c- Size
- 18129 bytes
- Lines
- 667
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dmi.hlinux/i2c.hlinux/pm_runtime.hdrm/drm_crtc_helper.hdrm/drm_modeset_helper_vtables.hdrm/drm_print.hdrm/drm_simple_kms_helper.hcdv_device.hintel_bios.hpower.hpsb_drv.hpsb_intel_drv.hpsb_intel_reg.h
Detected Declarations
struct cdv_intel_lvds_privfunction cdv_intel_lvds_get_max_backlightfunction cdv_intel_lvds_set_backlightfunction cdv_intel_lvds_set_powerfunction cdv_intel_lvds_encoder_dpmsfunction cdv_intel_lvds_savefunction cdv_intel_lvds_mode_fixupfunction cdv_intel_lvds_preparefunction cdv_intel_lvds_commitfunction cdv_intel_lvds_mode_setfunction cdv_intel_lvds_get_modesfunction cdv_intel_lvds_destroyfunction cdv_intel_lvds_set_propertyfunction lvds_is_present_in_vbtfunction panelfunction list_for_each_entry
Annotated Snippet
struct cdv_intel_lvds_priv {
/**
* Saved LVDO output states
*/
uint32_t savePP_ON;
uint32_t savePP_OFF;
uint32_t saveLVDS;
uint32_t savePP_CONTROL;
uint32_t savePP_CYCLE;
uint32_t savePFIT_CONTROL;
uint32_t savePFIT_PGM_RATIOS;
uint32_t saveBLC_PWM_CTL;
};
/*
* Returns the maximum level of the backlight duty cycle field.
*/
static u32 cdv_intel_lvds_get_max_backlight(struct drm_device *dev)
{
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 retval;
if (gma_power_begin(dev, false)) {
retval = ((REG_READ(BLC_PWM_CTL) &
BACKLIGHT_MODULATION_FREQ_MASK) >>
BACKLIGHT_MODULATION_FREQ_SHIFT) * 2;
gma_power_end(dev);
} else
retval = ((dev_priv->regs.saveBLC_PWM_CTL &
BACKLIGHT_MODULATION_FREQ_MASK) >>
BACKLIGHT_MODULATION_FREQ_SHIFT) * 2;
return retval;
}
/*
* Sets the backlight level.
*
* level backlight level, from 0 to cdv_intel_lvds_get_max_backlight().
*/
static void cdv_intel_lvds_set_backlight(struct drm_device *dev, int level)
{
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 blc_pwm_ctl;
if (gma_power_begin(dev, false)) {
blc_pwm_ctl =
REG_READ(BLC_PWM_CTL) & ~BACKLIGHT_DUTY_CYCLE_MASK;
REG_WRITE(BLC_PWM_CTL,
(blc_pwm_ctl |
(level << BACKLIGHT_DUTY_CYCLE_SHIFT)));
gma_power_end(dev);
} else {
blc_pwm_ctl = dev_priv->regs.saveBLC_PWM_CTL &
~BACKLIGHT_DUTY_CYCLE_MASK;
dev_priv->regs.saveBLC_PWM_CTL = (blc_pwm_ctl |
(level << BACKLIGHT_DUTY_CYCLE_SHIFT));
}
}
/*
* Sets the power state for the panel.
*/
static void cdv_intel_lvds_set_power(struct drm_device *dev,
struct drm_encoder *encoder, bool on)
{
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 pp_status;
if (!gma_power_begin(dev, true))
return;
if (on) {
REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) |
POWER_TARGET_ON);
do {
pp_status = REG_READ(PP_STATUS);
} while ((pp_status & PP_ON) == 0);
cdv_intel_lvds_set_backlight(dev,
dev_priv->mode_dev.backlight_duty_cycle);
} else {
cdv_intel_lvds_set_backlight(dev, 0);
REG_WRITE(PP_CONTROL, REG_READ(PP_CONTROL) &
~POWER_TARGET_ON);
do {
pp_status = REG_READ(PP_STATUS);
} while (pp_status & PP_ON);
Annotation
- Immediate include surface: `linux/dmi.h`, `linux/i2c.h`, `linux/pm_runtime.h`, `drm/drm_crtc_helper.h`, `drm/drm_modeset_helper_vtables.h`, `drm/drm_print.h`, `drm/drm_simple_kms_helper.h`, `cdv_device.h`.
- Detected declarations: `struct cdv_intel_lvds_priv`, `function cdv_intel_lvds_get_max_backlight`, `function cdv_intel_lvds_set_backlight`, `function cdv_intel_lvds_set_power`, `function cdv_intel_lvds_encoder_dpms`, `function cdv_intel_lvds_save`, `function cdv_intel_lvds_mode_fixup`, `function cdv_intel_lvds_prepare`, `function cdv_intel_lvds_commit`, `function cdv_intel_lvds_mode_set`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.