diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-14 13:30:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-14 13:30:09 -0500 |
commit | 891cc2283216bf76f387546f0e220caf8ce9fbf9 (patch) | |
tree | b9ff8012a509fedf74834cee23adf9e0b3d8e5ad /drivers/gpu | |
parent | d73b388459b1ee2e80f8ff9c1916d75640d7d920 (diff) | |
parent | 22ab70d3262ddb6e69b3c246a34e2967ba5eb1e8 (diff) |
Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel
* 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel:
drm/i915/lvds: Add AOpen i915GMm-HFS to the list of false-positive LVDS
agp/intel: Fix device names of i845 and 845G
drm/i915: Disable GPU semaphores on SandyBridge mobile
drm/i915/execbuffer: Clear domains before beginning reloc processing
drm/i915/execbuffer: Reorder relocations to match new object order
drm/i915: Fix error handler to capture the first batch after the seqno
drm/i915: Add a module option to override the use of SSC
drm/i915/panel: The backlight is enabled if the current value is non-zero
drm/i915/debugfs: Correct format after changing type of err object 'size'
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 25 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_bios.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_panel.c | 2 |
9 files changed, 46 insertions, 31 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 19a3d58044dd..3601466c5502 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
@@ -703,7 +703,7 @@ static void print_error_buffers(struct seq_file *m, | |||
703 | seq_printf(m, "%s [%d]:\n", name, count); | 703 | seq_printf(m, "%s [%d]:\n", name, count); |
704 | 704 | ||
705 | while (count--) { | 705 | while (count--) { |
706 | seq_printf(m, " %08x %8zd %04x %04x %08x%s%s%s%s%s%s", | 706 | seq_printf(m, " %08x %8u %04x %04x %08x%s%s%s%s%s%s", |
707 | err->gtt_offset, | 707 | err->gtt_offset, |
708 | err->size, | 708 | err->size, |
709 | err->read_domains, | 709 | err->read_domains, |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 0de75a23f8e7..72fea2bcfc4f 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -49,6 +49,9 @@ module_param_named(powersave, i915_powersave, int, 0600); | |||
49 | unsigned int i915_lvds_downclock = 0; | 49 | unsigned int i915_lvds_downclock = 0; |
50 | module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400); | 50 | module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400); |
51 | 51 | ||
52 | unsigned int i915_panel_use_ssc = 1; | ||
53 | module_param_named(lvds_use_ssc, i915_panel_use_ssc, int, 0600); | ||
54 | |||
52 | bool i915_try_reset = true; | 55 | bool i915_try_reset = true; |
53 | module_param_named(reset, i915_try_reset, bool, 0600); | 56 | module_param_named(reset, i915_try_reset, bool, 0600); |
54 | 57 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 385fc7ec39d3..5969f46ac2d6 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -954,6 +954,7 @@ extern int i915_max_ioctl; | |||
954 | extern unsigned int i915_fbpercrtc; | 954 | extern unsigned int i915_fbpercrtc; |
955 | extern unsigned int i915_powersave; | 955 | extern unsigned int i915_powersave; |
956 | extern unsigned int i915_lvds_downclock; | 956 | extern unsigned int i915_lvds_downclock; |
957 | extern unsigned int i915_panel_use_ssc; | ||
957 | 958 | ||
958 | extern int i915_suspend(struct drm_device *dev, pm_message_t state); | 959 | extern int i915_suspend(struct drm_device *dev, pm_message_t state); |
959 | extern int i915_resume(struct drm_device *dev); | 960 | extern int i915_resume(struct drm_device *dev); |
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index e69834341ef0..dcfdf4151b6d 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
@@ -464,8 +464,6 @@ i915_gem_execbuffer_relocate(struct drm_device *dev, | |||
464 | int ret; | 464 | int ret; |
465 | 465 | ||
466 | list_for_each_entry(obj, objects, exec_list) { | 466 | list_for_each_entry(obj, objects, exec_list) { |
467 | obj->base.pending_read_domains = 0; | ||
468 | obj->base.pending_write_domain = 0; | ||
469 | ret = i915_gem_execbuffer_relocate_object(obj, eb); | 467 | ret = i915_gem_execbuffer_relocate_object(obj, eb); |
470 | if (ret) | 468 | if (ret) |
471 | return ret; | 469 | return ret; |
@@ -505,6 +503,9 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring, | |||
505 | list_move(&obj->exec_list, &ordered_objects); | 503 | list_move(&obj->exec_list, &ordered_objects); |
506 | else | 504 | else |
507 | list_move_tail(&obj->exec_list, &ordered_objects); | 505 | list_move_tail(&obj->exec_list, &ordered_objects); |
506 | |||
507 | obj->base.pending_read_domains = 0; | ||
508 | obj->base.pending_write_domain = 0; | ||
508 | } | 509 | } |
509 | list_splice(&ordered_objects, objects); | 510 | list_splice(&ordered_objects, objects); |
510 | 511 | ||
@@ -636,6 +637,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev, | |||
636 | { | 637 | { |
637 | struct drm_i915_gem_relocation_entry *reloc; | 638 | struct drm_i915_gem_relocation_entry *reloc; |
638 | struct drm_i915_gem_object *obj; | 639 | struct drm_i915_gem_object *obj; |
640 | int *reloc_offset; | ||
639 | int i, total, ret; | 641 | int i, total, ret; |
640 | 642 | ||
641 | /* We may process another execbuffer during the unlock... */ | 643 | /* We may process another execbuffer during the unlock... */ |
@@ -653,8 +655,11 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev, | |||
653 | for (i = 0; i < count; i++) | 655 | for (i = 0; i < count; i++) |
654 | total += exec[i].relocation_count; | 656 | total += exec[i].relocation_count; |
655 | 657 | ||
658 | reloc_offset = drm_malloc_ab(count, sizeof(*reloc_offset)); | ||
656 | reloc = drm_malloc_ab(total, sizeof(*reloc)); | 659 | reloc = drm_malloc_ab(total, sizeof(*reloc)); |
657 | if (reloc == NULL) { | 660 | if (reloc == NULL || reloc_offset == NULL) { |
661 | drm_free_large(reloc); | ||
662 | drm_free_large(reloc_offset); | ||
658 | mutex_lock(&dev->struct_mutex); | 663 | mutex_lock(&dev->struct_mutex); |
659 | return -ENOMEM; | 664 | return -ENOMEM; |
660 | } | 665 | } |
@@ -672,6 +677,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev, | |||
672 | goto err; | 677 | goto err; |
673 | } | 678 | } |
674 | 679 | ||
680 | reloc_offset[i] = total; | ||
675 | total += exec[i].relocation_count; | 681 | total += exec[i].relocation_count; |
676 | } | 682 | } |
677 | 683 | ||
@@ -705,17 +711,12 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev, | |||
705 | if (ret) | 711 | if (ret) |
706 | goto err; | 712 | goto err; |
707 | 713 | ||
708 | total = 0; | ||
709 | list_for_each_entry(obj, objects, exec_list) { | 714 | list_for_each_entry(obj, objects, exec_list) { |
710 | obj->base.pending_read_domains = 0; | 715 | int offset = obj->exec_entry - exec; |
711 | obj->base.pending_write_domain = 0; | ||
712 | ret = i915_gem_execbuffer_relocate_object_slow(obj, eb, | 716 | ret = i915_gem_execbuffer_relocate_object_slow(obj, eb, |
713 | reloc + total); | 717 | reloc + reloc_offset[offset]); |
714 | if (ret) | 718 | if (ret) |
715 | goto err; | 719 | goto err; |
716 | |||
717 | total += exec->relocation_count; | ||
718 | exec++; | ||
719 | } | 720 | } |
720 | 721 | ||
721 | /* Leave the user relocations as are, this is the painfully slow path, | 722 | /* Leave the user relocations as are, this is the painfully slow path, |
@@ -726,6 +727,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev, | |||
726 | 727 | ||
727 | err: | 728 | err: |
728 | drm_free_large(reloc); | 729 | drm_free_large(reloc); |
730 | drm_free_large(reloc_offset); | ||
729 | return ret; | 731 | return ret; |
730 | } | 732 | } |
731 | 733 | ||
@@ -770,7 +772,8 @@ i915_gem_execbuffer_sync_rings(struct drm_i915_gem_object *obj, | |||
770 | if (from == NULL || to == from) | 772 | if (from == NULL || to == from) |
771 | return 0; | 773 | return 0; |
772 | 774 | ||
773 | if (INTEL_INFO(obj->base.dev)->gen < 6) | 775 | /* XXX gpu semaphores are currently causing hard hangs on SNB mobile */ |
776 | if (INTEL_INFO(obj->base.dev)->gen < 6 || IS_MOBILE(obj->base.dev)) | ||
774 | return i915_gem_object_wait_rendering(obj, true); | 777 | return i915_gem_object_wait_rendering(obj, true); |
775 | 778 | ||
776 | idx = intel_ring_sync_index(from, to); | 779 | idx = intel_ring_sync_index(from, to); |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index e418e8bb61e6..b8e509ae065e 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -720,7 +720,7 @@ i915_error_first_batchbuffer(struct drm_i915_private *dev_priv, | |||
720 | if (obj->ring != ring) | 720 | if (obj->ring != ring) |
721 | continue; | 721 | continue; |
722 | 722 | ||
723 | if (!i915_seqno_passed(obj->last_rendering_seqno, seqno)) | 723 | if (i915_seqno_passed(seqno, obj->last_rendering_seqno)) |
724 | continue; | 724 | continue; |
725 | 725 | ||
726 | if ((obj->base.read_domains & I915_GEM_DOMAIN_COMMAND) == 0) | 726 | if ((obj->base.read_domains & I915_GEM_DOMAIN_COMMAND) == 0) |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index b0b1200ed650..0b44956c336b 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
@@ -264,17 +264,12 @@ parse_general_features(struct drm_i915_private *dev_priv, | |||
264 | dev_priv->int_crt_support = general->int_crt_support; | 264 | dev_priv->int_crt_support = general->int_crt_support; |
265 | dev_priv->lvds_use_ssc = general->enable_ssc; | 265 | dev_priv->lvds_use_ssc = general->enable_ssc; |
266 | 266 | ||
267 | if (dev_priv->lvds_use_ssc) { | 267 | if (IS_I85X(dev)) |
268 | if (IS_I85X(dev)) | 268 | dev_priv->lvds_ssc_freq = general->ssc_freq ? 66 : 48; |
269 | dev_priv->lvds_ssc_freq = | 269 | else if (IS_GEN5(dev) || IS_GEN6(dev)) |
270 | general->ssc_freq ? 66 : 48; | 270 | dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 120; |
271 | else if (IS_GEN5(dev) || IS_GEN6(dev)) | 271 | else |
272 | dev_priv->lvds_ssc_freq = | 272 | dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 96; |
273 | general->ssc_freq ? 100 : 120; | ||
274 | else | ||
275 | dev_priv->lvds_ssc_freq = | ||
276 | general->ssc_freq ? 100 : 96; | ||
277 | } | ||
278 | } | 273 | } |
279 | } | 274 | } |
280 | 275 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 25d96889d7d2..98967f3b7724 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -3822,6 +3822,11 @@ static void intel_update_watermarks(struct drm_device *dev) | |||
3822 | sr_hdisplay, sr_htotal, pixel_size); | 3822 | sr_hdisplay, sr_htotal, pixel_size); |
3823 | } | 3823 | } |
3824 | 3824 | ||
3825 | static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv) | ||
3826 | { | ||
3827 | return dev_priv->lvds_use_ssc && i915_panel_use_ssc; | ||
3828 | } | ||
3829 | |||
3825 | static int intel_crtc_mode_set(struct drm_crtc *crtc, | 3830 | static int intel_crtc_mode_set(struct drm_crtc *crtc, |
3826 | struct drm_display_mode *mode, | 3831 | struct drm_display_mode *mode, |
3827 | struct drm_display_mode *adjusted_mode, | 3832 | struct drm_display_mode *adjusted_mode, |
@@ -3884,7 +3889,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
3884 | num_connectors++; | 3889 | num_connectors++; |
3885 | } | 3890 | } |
3886 | 3891 | ||
3887 | if (is_lvds && dev_priv->lvds_use_ssc && num_connectors < 2) { | 3892 | if (is_lvds && intel_panel_use_ssc(dev_priv) && num_connectors < 2) { |
3888 | refclk = dev_priv->lvds_ssc_freq * 1000; | 3893 | refclk = dev_priv->lvds_ssc_freq * 1000; |
3889 | DRM_DEBUG_KMS("using SSC reference clock of %d MHz\n", | 3894 | DRM_DEBUG_KMS("using SSC reference clock of %d MHz\n", |
3890 | refclk / 1000); | 3895 | refclk / 1000); |
@@ -4059,7 +4064,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
4059 | udelay(200); | 4064 | udelay(200); |
4060 | 4065 | ||
4061 | if (has_edp_encoder) { | 4066 | if (has_edp_encoder) { |
4062 | if (dev_priv->lvds_use_ssc) { | 4067 | if (intel_panel_use_ssc(dev_priv)) { |
4063 | temp |= DREF_SSC1_ENABLE; | 4068 | temp |= DREF_SSC1_ENABLE; |
4064 | I915_WRITE(PCH_DREF_CONTROL, temp); | 4069 | I915_WRITE(PCH_DREF_CONTROL, temp); |
4065 | 4070 | ||
@@ -4070,13 +4075,13 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
4070 | 4075 | ||
4071 | /* Enable CPU source on CPU attached eDP */ | 4076 | /* Enable CPU source on CPU attached eDP */ |
4072 | if (!intel_encoder_is_pch_edp(&has_edp_encoder->base)) { | 4077 | if (!intel_encoder_is_pch_edp(&has_edp_encoder->base)) { |
4073 | if (dev_priv->lvds_use_ssc) | 4078 | if (intel_panel_use_ssc(dev_priv)) |
4074 | temp |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD; | 4079 | temp |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD; |
4075 | else | 4080 | else |
4076 | temp |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD; | 4081 | temp |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD; |
4077 | } else { | 4082 | } else { |
4078 | /* Enable SSC on PCH eDP if needed */ | 4083 | /* Enable SSC on PCH eDP if needed */ |
4079 | if (dev_priv->lvds_use_ssc) { | 4084 | if (intel_panel_use_ssc(dev_priv)) { |
4080 | DRM_ERROR("enabling SSC on PCH\n"); | 4085 | DRM_ERROR("enabling SSC on PCH\n"); |
4081 | temp |= DREF_SUPERSPREAD_SOURCE_ENABLE; | 4086 | temp |= DREF_SUPERSPREAD_SOURCE_ENABLE; |
4082 | } | 4087 | } |
@@ -4104,7 +4109,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
4104 | int factor = 21; | 4109 | int factor = 21; |
4105 | 4110 | ||
4106 | if (is_lvds) { | 4111 | if (is_lvds) { |
4107 | if ((dev_priv->lvds_use_ssc && | 4112 | if ((intel_panel_use_ssc(dev_priv) && |
4108 | dev_priv->lvds_ssc_freq == 100) || | 4113 | dev_priv->lvds_ssc_freq == 100) || |
4109 | (I915_READ(PCH_LVDS) & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP) | 4114 | (I915_READ(PCH_LVDS) & LVDS_CLKB_POWER_MASK) == LVDS_CLKB_POWER_UP) |
4110 | factor = 25; | 4115 | factor = 25; |
@@ -4183,7 +4188,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
4183 | /* XXX: just matching BIOS for now */ | 4188 | /* XXX: just matching BIOS for now */ |
4184 | /* dpll |= PLL_REF_INPUT_TVCLKINBC; */ | 4189 | /* dpll |= PLL_REF_INPUT_TVCLKINBC; */ |
4185 | dpll |= 3; | 4190 | dpll |= 3; |
4186 | else if (is_lvds && dev_priv->lvds_use_ssc && num_connectors < 2) | 4191 | else if (is_lvds && intel_panel_use_ssc(dev_priv) && num_connectors < 2) |
4187 | dpll |= PLLB_REF_INPUT_SPREADSPECTRUMIN; | 4192 | dpll |= PLLB_REF_INPUT_SPREADSPECTRUMIN; |
4188 | else | 4193 | else |
4189 | dpll |= PLL_REF_INPUT_DREFCLK; | 4194 | dpll |= PLL_REF_INPUT_DREFCLK; |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 8f4f6bd33ee9..ace8d5d30dd2 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -704,6 +704,14 @@ static const struct dmi_system_id intel_no_lvds[] = { | |||
704 | }, | 704 | }, |
705 | { | 705 | { |
706 | .callback = intel_no_lvds_dmi_callback, | 706 | .callback = intel_no_lvds_dmi_callback, |
707 | .ident = "AOpen i915GMm-HFS", | ||
708 | .matches = { | ||
709 | DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), | ||
710 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | ||
711 | }, | ||
712 | }, | ||
713 | { | ||
714 | .callback = intel_no_lvds_dmi_callback, | ||
707 | .ident = "Aopen i945GTt-VFA", | 715 | .ident = "Aopen i945GTt-VFA", |
708 | .matches = { | 716 | .matches = { |
709 | DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"), | 717 | DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"), |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index e00d200df3db..c65992df458d 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
@@ -278,6 +278,6 @@ void intel_panel_setup_backlight(struct drm_device *dev) | |||
278 | { | 278 | { |
279 | struct drm_i915_private *dev_priv = dev->dev_private; | 279 | struct drm_i915_private *dev_priv = dev->dev_private; |
280 | 280 | ||
281 | dev_priv->backlight_level = intel_panel_get_max_backlight(dev); | 281 | dev_priv->backlight_level = intel_panel_get_backlight(dev); |
282 | dev_priv->backlight_enabled = dev_priv->backlight_level != 0; | 282 | dev_priv->backlight_enabled = dev_priv->backlight_level != 0; |
283 | } | 283 | } |