diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-28 20:21:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-28 20:21:20 -0400 |
commit | 56a50adda49b2020156616c4eb15353e0f9ad7de (patch) | |
tree | a0453fde37538653628270258c3291d880a66853 /drivers/gpu/drm | |
parent | c2e2ceeae4b5587d412c05cdc31513179d37811d (diff) | |
parent | 355d7f370b51bbb6f31aaf9f98861057e1e6bbb2 (diff) |
Merge branch 'drm-intel-next' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel
* 'drm-intel-next' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel:
drm/i915: fix up error path leak in i915_cmdbuffer
drm/i915: fix unpaired i915 device mutex on entervt failure.
drm/i915: add support for G41 chipset
drm/i915: Enable ASLE if present
drm/i915: Unregister ACPI video driver when exiting
drm/i915: Register ACPI video even when not modesetting
drm/i915: fix transition to I915_TILING_NONE
drm/i915: Don't let an oops get triggered from irq_emit without dma init.
drm/i915: allow tiled front buffers on 965+
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_tiling.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_opregion.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 9 |
9 files changed, 29 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index a000cf02882..051134c56ae 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -713,18 +713,18 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data, | |||
713 | mutex_unlock(&dev->struct_mutex); | 713 | mutex_unlock(&dev->struct_mutex); |
714 | if (ret) { | 714 | if (ret) { |
715 | DRM_ERROR("i915_dispatch_cmdbuffer failed\n"); | 715 | DRM_ERROR("i915_dispatch_cmdbuffer failed\n"); |
716 | goto fail_batch_free; | 716 | goto fail_clip_free; |
717 | } | 717 | } |
718 | 718 | ||
719 | if (sarea_priv) | 719 | if (sarea_priv) |
720 | sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); | 720 | sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); |
721 | 721 | ||
722 | fail_batch_free: | ||
723 | drm_free(batch_data, cmdbuf->sz, DRM_MEM_DRIVER); | ||
724 | fail_clip_free: | 722 | fail_clip_free: |
725 | drm_free(cliprects, | 723 | drm_free(cliprects, |
726 | cmdbuf->num_cliprects * sizeof(struct drm_clip_rect), | 724 | cmdbuf->num_cliprects * sizeof(struct drm_clip_rect), |
727 | DRM_MEM_DRIVER); | 725 | DRM_MEM_DRIVER); |
726 | fail_batch_free: | ||
727 | drm_free(batch_data, cmdbuf->sz, DRM_MEM_DRIVER); | ||
728 | 728 | ||
729 | return ret; | 729 | return ret; |
730 | } | 730 | } |
@@ -1232,7 +1232,7 @@ int i915_driver_unload(struct drm_device *dev) | |||
1232 | if (dev_priv->regs != NULL) | 1232 | if (dev_priv->regs != NULL) |
1233 | iounmap(dev_priv->regs); | 1233 | iounmap(dev_priv->regs); |
1234 | 1234 | ||
1235 | intel_opregion_free(dev); | 1235 | intel_opregion_free(dev, 0); |
1236 | 1236 | ||
1237 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | 1237 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { |
1238 | intel_modeset_cleanup(dev); | 1238 | intel_modeset_cleanup(dev); |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 6503e2210f6..98560e1e899 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -77,7 +77,7 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state) | |||
77 | drm_irq_uninstall(dev); | 77 | drm_irq_uninstall(dev); |
78 | } | 78 | } |
79 | 79 | ||
80 | intel_opregion_free(dev); | 80 | intel_opregion_free(dev, 1); |
81 | 81 | ||
82 | if (state.event == PM_EVENT_SUSPEND) { | 82 | if (state.event == PM_EVENT_SUSPEND) { |
83 | /* Shut down the device */ | 83 | /* Shut down the device */ |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 473a8f7fbdb..25065923b8a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -674,12 +674,12 @@ extern int i915_restore_state(struct drm_device *dev); | |||
674 | #ifdef CONFIG_ACPI | 674 | #ifdef CONFIG_ACPI |
675 | /* i915_opregion.c */ | 675 | /* i915_opregion.c */ |
676 | extern int intel_opregion_init(struct drm_device *dev, int resume); | 676 | extern int intel_opregion_init(struct drm_device *dev, int resume); |
677 | extern void intel_opregion_free(struct drm_device *dev); | 677 | extern void intel_opregion_free(struct drm_device *dev, int suspend); |
678 | extern void opregion_asle_intr(struct drm_device *dev); | 678 | extern void opregion_asle_intr(struct drm_device *dev); |
679 | extern void opregion_enable_asle(struct drm_device *dev); | 679 | extern void opregion_enable_asle(struct drm_device *dev); |
680 | #else | 680 | #else |
681 | static inline int intel_opregion_init(struct drm_device *dev, int resume) { return 0; } | 681 | static inline int intel_opregion_init(struct drm_device *dev, int resume) { return 0; } |
682 | static inline void intel_opregion_free(struct drm_device *dev) { return; } | 682 | static inline void intel_opregion_free(struct drm_device *dev, int suspend) { return; } |
683 | static inline void opregion_asle_intr(struct drm_device *dev) { return; } | 683 | static inline void opregion_asle_intr(struct drm_device *dev) { return; } |
684 | static inline void opregion_enable_asle(struct drm_device *dev) { return; } | 684 | static inline void opregion_enable_asle(struct drm_device *dev) { return; } |
685 | #endif | 685 | #endif |
@@ -787,7 +787,8 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); | |||
787 | (dev)->pci_device == 0x2A42 || \ | 787 | (dev)->pci_device == 0x2A42 || \ |
788 | (dev)->pci_device == 0x2E02 || \ | 788 | (dev)->pci_device == 0x2E02 || \ |
789 | (dev)->pci_device == 0x2E12 || \ | 789 | (dev)->pci_device == 0x2E12 || \ |
790 | (dev)->pci_device == 0x2E22) | 790 | (dev)->pci_device == 0x2E22 || \ |
791 | (dev)->pci_device == 0x2E32) | ||
791 | 792 | ||
792 | #define IS_I965GM(dev) ((dev)->pci_device == 0x2A02) | 793 | #define IS_I965GM(dev) ((dev)->pci_device == 0x2A02) |
793 | 794 | ||
@@ -796,6 +797,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); | |||
796 | #define IS_G4X(dev) ((dev)->pci_device == 0x2E02 || \ | 797 | #define IS_G4X(dev) ((dev)->pci_device == 0x2E02 || \ |
797 | (dev)->pci_device == 0x2E12 || \ | 798 | (dev)->pci_device == 0x2E12 || \ |
798 | (dev)->pci_device == 0x2E22 || \ | 799 | (dev)->pci_device == 0x2E22 || \ |
800 | (dev)->pci_device == 0x2E32 || \ | ||
799 | IS_GM45(dev)) | 801 | IS_GM45(dev)) |
800 | 802 | ||
801 | #define IS_IGDG(dev) ((dev)->pci_device == 0xa001) | 803 | #define IS_IGDG(dev) ((dev)->pci_device == 0xa001) |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 4642115902d..ee896d91c5b 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -4087,8 +4087,10 @@ i915_gem_entervt_ioctl(struct drm_device *dev, void *data, | |||
4087 | dev_priv->mm.suspended = 0; | 4087 | dev_priv->mm.suspended = 0; |
4088 | 4088 | ||
4089 | ret = i915_gem_init_ringbuffer(dev); | 4089 | ret = i915_gem_init_ringbuffer(dev); |
4090 | if (ret != 0) | 4090 | if (ret != 0) { |
4091 | mutex_unlock(&dev->struct_mutex); | ||
4091 | return ret; | 4092 | return ret; |
4093 | } | ||
4092 | 4094 | ||
4093 | spin_lock(&dev_priv->mm.active_list_lock); | 4095 | spin_lock(&dev_priv->mm.active_list_lock); |
4094 | BUG_ON(!list_empty(&dev_priv->mm.active_list)); | 4096 | BUG_ON(!list_empty(&dev_priv->mm.active_list)); |
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index f27e523c764..52a059354e8 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c | |||
@@ -283,7 +283,6 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, | |||
283 | mutex_lock(&dev->struct_mutex); | 283 | mutex_lock(&dev->struct_mutex); |
284 | 284 | ||
285 | if (args->tiling_mode == I915_TILING_NONE) { | 285 | if (args->tiling_mode == I915_TILING_NONE) { |
286 | obj_priv->tiling_mode = I915_TILING_NONE; | ||
287 | args->swizzle_mode = I915_BIT_6_SWIZZLE_NONE; | 286 | args->swizzle_mode = I915_BIT_6_SWIZZLE_NONE; |
288 | } else { | 287 | } else { |
289 | if (args->tiling_mode == I915_TILING_X) | 288 | if (args->tiling_mode == I915_TILING_X) |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index ee7ce7b78cf..98bb4c878c4 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -406,7 +406,7 @@ int i915_irq_emit(struct drm_device *dev, void *data, | |||
406 | drm_i915_irq_emit_t *emit = data; | 406 | drm_i915_irq_emit_t *emit = data; |
407 | int result; | 407 | int result; |
408 | 408 | ||
409 | if (!dev_priv) { | 409 | if (!dev_priv || !dev_priv->ring.virtual_start) { |
410 | DRM_ERROR("called with no initialization\n"); | 410 | DRM_ERROR("called with no initialization\n"); |
411 | return -EINVAL; | 411 | return -EINVAL; |
412 | } | 412 | } |
diff --git a/drivers/gpu/drm/i915/i915_opregion.c b/drivers/gpu/drm/i915/i915_opregion.c index 8dc1fd3115c..dc425e74a26 100644 --- a/drivers/gpu/drm/i915/i915_opregion.c +++ b/drivers/gpu/drm/i915/i915_opregion.c | |||
@@ -386,6 +386,7 @@ int intel_opregion_init(struct drm_device *dev, int resume) | |||
386 | if (mboxes & MBOX_ASLE) { | 386 | if (mboxes & MBOX_ASLE) { |
387 | DRM_DEBUG("ASLE supported\n"); | 387 | DRM_DEBUG("ASLE supported\n"); |
388 | opregion->asle = base + OPREGION_ASLE_OFFSET; | 388 | opregion->asle = base + OPREGION_ASLE_OFFSET; |
389 | opregion_enable_asle(dev); | ||
389 | } | 390 | } |
390 | 391 | ||
391 | if (!resume) | 392 | if (!resume) |
@@ -409,7 +410,7 @@ err_out: | |||
409 | return err; | 410 | return err; |
410 | } | 411 | } |
411 | 412 | ||
412 | void intel_opregion_free(struct drm_device *dev) | 413 | void intel_opregion_free(struct drm_device *dev, int suspend) |
413 | { | 414 | { |
414 | struct drm_i915_private *dev_priv = dev->dev_private; | 415 | struct drm_i915_private *dev_priv = dev->dev_private; |
415 | struct intel_opregion *opregion = &dev_priv->opregion; | 416 | struct intel_opregion *opregion = &dev_priv->opregion; |
@@ -417,6 +418,9 @@ void intel_opregion_free(struct drm_device *dev) | |||
417 | if (!opregion->enabled) | 418 | if (!opregion->enabled) |
418 | return; | 419 | return; |
419 | 420 | ||
421 | if (!suspend) | ||
422 | acpi_video_exit(); | ||
423 | |||
420 | opregion->acpi->drdy = 0; | 424 | opregion->acpi->drdy = 0; |
421 | 425 | ||
422 | system_opregion = NULL; | 426 | system_opregion = NULL; |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index e805b590ae7..52119473226 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -1446,6 +1446,7 @@ | |||
1446 | #define DISPPLANE_NO_LINE_DOUBLE 0 | 1446 | #define DISPPLANE_NO_LINE_DOUBLE 0 |
1447 | #define DISPPLANE_STEREO_POLARITY_FIRST 0 | 1447 | #define DISPPLANE_STEREO_POLARITY_FIRST 0 |
1448 | #define DISPPLANE_STEREO_POLARITY_SECOND (1<<18) | 1448 | #define DISPPLANE_STEREO_POLARITY_SECOND (1<<18) |
1449 | #define DISPPLANE_TILED (1<<10) | ||
1449 | #define DSPAADDR 0x70184 | 1450 | #define DSPAADDR 0x70184 |
1450 | #define DSPASTRIDE 0x70188 | 1451 | #define DSPASTRIDE 0x70188 |
1451 | #define DSPAPOS 0x7018C /* reserved */ | 1452 | #define DSPAPOS 0x7018C /* reserved */ |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c2c8e95ff14..bdcda36953b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -657,6 +657,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
657 | int dspbase = (pipe == 0 ? DSPAADDR : DSPBADDR); | 657 | int dspbase = (pipe == 0 ? DSPAADDR : DSPBADDR); |
658 | int dspsurf = (pipe == 0 ? DSPASURF : DSPBSURF); | 658 | int dspsurf = (pipe == 0 ? DSPASURF : DSPBSURF); |
659 | int dspstride = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE; | 659 | int dspstride = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE; |
660 | int dsptileoff = (pipe == 0 ? DSPATILEOFF : DSPBTILEOFF); | ||
660 | int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR; | 661 | int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR; |
661 | u32 dspcntr, alignment; | 662 | u32 dspcntr, alignment; |
662 | int ret; | 663 | int ret; |
@@ -733,6 +734,13 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
733 | mutex_unlock(&dev->struct_mutex); | 734 | mutex_unlock(&dev->struct_mutex); |
734 | return -EINVAL; | 735 | return -EINVAL; |
735 | } | 736 | } |
737 | if (IS_I965G(dev)) { | ||
738 | if (obj_priv->tiling_mode != I915_TILING_NONE) | ||
739 | dspcntr |= DISPPLANE_TILED; | ||
740 | else | ||
741 | dspcntr &= ~DISPPLANE_TILED; | ||
742 | } | ||
743 | |||
736 | I915_WRITE(dspcntr_reg, dspcntr); | 744 | I915_WRITE(dspcntr_reg, dspcntr); |
737 | 745 | ||
738 | Start = obj_priv->gtt_offset; | 746 | Start = obj_priv->gtt_offset; |
@@ -745,6 +753,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
745 | I915_READ(dspbase); | 753 | I915_READ(dspbase); |
746 | I915_WRITE(dspsurf, Start); | 754 | I915_WRITE(dspsurf, Start); |
747 | I915_READ(dspsurf); | 755 | I915_READ(dspsurf); |
756 | I915_WRITE(dsptileoff, (y << 16) | x); | ||
748 | } else { | 757 | } else { |
749 | I915_WRITE(dspbase, Start + Offset); | 758 | I915_WRITE(dspbase, Start + Offset); |
750 | I915_READ(dspbase); | 759 | I915_READ(dspbase); |