Lines Matching refs:dev
186 struct drm_device *dev = intel_crtc->base.dev;
213 if (INTEL_INFO(dev)->gen >= 4) {
283 if (INTEL_INFO(dev)->gen >= 4)
299 if (INTEL_INFO(dev)->gen >= 4)
310 if (INTEL_INFO(dev)->gen < 4 && pipe_config->pipe_bpp == 18)
318 static int is_backlight_combination_mode(struct drm_device *dev)
320 struct drm_i915_private *dev_priv = dev->dev_private;
322 if (INTEL_INFO(dev)->gen >= 4)
325 if (IS_GEN2(dev))
331 static u32 i915_read_blc_pwm_ctl(struct drm_device *dev)
333 struct drm_i915_private *dev_priv = dev->dev_private;
338 if (HAS_PCH_SPLIT(dev_priv->dev)) {
350 if (INTEL_INFO(dev)->gen >= 4)
356 if (INTEL_INFO(dev)->gen >= 4)
365 static u32 intel_panel_get_max_backlight(struct drm_device *dev)
369 max = i915_read_blc_pwm_ctl(dev);
371 if (HAS_PCH_SPLIT(dev)) {
374 if (INTEL_INFO(dev)->gen < 4)
379 if (is_backlight_combination_mode(dev))
388 static u32 intel_panel_compute_brightness(struct drm_device *dev, u32 val)
390 struct drm_i915_private *dev_priv = dev->dev_private;
397 u32 max = intel_panel_get_max_backlight(dev);
405 static u32 intel_panel_get_backlight(struct drm_device *dev)
407 struct drm_i915_private *dev_priv = dev->dev_private;
413 if (HAS_PCH_SPLIT(dev)) {
417 if (INTEL_INFO(dev)->gen < 4)
420 if (is_backlight_combination_mode(dev)){
423 pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc);
428 val = intel_panel_compute_brightness(dev, val);
436 static void intel_pch_panel_set_backlight(struct drm_device *dev, u32 level)
438 struct drm_i915_private *dev_priv = dev->dev_private;
443 static void intel_panel_actually_set_backlight(struct drm_device *dev, u32 level)
445 struct drm_i915_private *dev_priv = dev->dev_private;
449 level = intel_panel_compute_brightness(dev, level);
451 if (HAS_PCH_SPLIT(dev)) {
452 intel_pch_panel_set_backlight(dev, level);
456 if (is_backlight_combination_mode(dev)){
457 u32 max = intel_panel_get_max_backlight(dev);
466 pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc);
470 if (INTEL_INFO(dev)->gen < 4)
477 void intel_panel_set_backlight(struct drm_device *dev, u32 level, u32 max)
479 struct drm_i915_private *dev_priv = dev->dev_private;
485 freq = intel_panel_get_max_backlight(dev);
502 intel_panel_actually_set_backlight(dev, level);
507 void intel_panel_disable_backlight(struct drm_device *dev)
509 struct drm_i915_private *dev_priv = dev->dev_private;
518 if (dev->switch_power_state == DRM_SWITCH_POWER_CHANGING) {
526 intel_panel_actually_set_backlight(dev, 0);
528 if (INTEL_INFO(dev)->gen >= 4) {
531 reg = HAS_PCH_SPLIT(dev) ? BLC_PWM_CPU_CTL2 : BLC_PWM_CTL2;
535 if (HAS_PCH_SPLIT(dev)) {
545 void intel_panel_enable_backlight(struct drm_device *dev,
548 struct drm_i915_private *dev_priv = dev->dev_private;
556 dev_priv->backlight.level = intel_panel_get_max_backlight(dev);
562 if (INTEL_INFO(dev)->gen >= 4) {
565 reg = HAS_PCH_SPLIT(dev) ? BLC_PWM_CPU_CTL2 : BLC_PWM_CTL2;
576 if (INTEL_INFO(dev)->num_pipes == 3)
591 if (HAS_PCH_SPLIT(dev) &&
606 intel_panel_actually_set_backlight(dev, dev_priv->backlight.level);
611 static void intel_panel_init_backlight(struct drm_device *dev)
613 struct drm_i915_private *dev_priv = dev->dev_private;
615 dev_priv->backlight.level = intel_panel_get_backlight(dev);
620 intel_panel_detect(struct drm_device *dev)
623 struct drm_i915_private *dev_priv = dev->dev_private;
648 struct drm_device *dev = bl_get_data(bd);
649 intel_panel_set_backlight(dev, bd->props.brightness,
656 struct drm_device *dev = bl_get_data(bd);
657 return intel_panel_get_backlight(dev);
667 struct drm_device *dev = connector->dev;
668 struct drm_i915_private *dev_priv = dev->dev_private;
672 intel_panel_init_backlight(dev);
682 props.max_brightness = intel_panel_get_max_backlight(dev);
690 &connector->kdev, dev,
702 void intel_panel_destroy_backlight(struct drm_device *dev)
704 struct drm_i915_private *dev_priv = dev->dev_private;
713 intel_panel_init_backlight(connector->dev);
717 void intel_panel_destroy_backlight(struct drm_device *dev)
737 drm_mode_destroy(intel_connector->base.dev, panel->fixed_mode);