diff options
| -rw-r--r-- | drivers/gpu/drm/drm_pci.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_drv.c | 10 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem_stolen.c | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 71 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_ddi.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 12 |
6 files changed, 67 insertions, 36 deletions
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 5736aaa7e86c..f7af69bcf3f4 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c | |||
| @@ -468,8 +468,8 @@ void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) | |||
| 468 | } else { | 468 | } else { |
| 469 | list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list, | 469 | list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list, |
| 470 | legacy_dev_list) { | 470 | legacy_dev_list) { |
| 471 | drm_put_dev(dev); | ||
| 472 | list_del(&dev->legacy_dev_list); | 471 | list_del(&dev->legacy_dev_list); |
| 472 | drm_put_dev(dev); | ||
| 473 | } | 473 | } |
| 474 | } | 474 | } |
| 475 | DRM_INFO("Module unloaded\n"); | 475 | DRM_INFO("Module unloaded\n"); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 215131ab1dd2..c204b4e3356e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c | |||
| @@ -172,20 +172,24 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) | |||
| 172 | 172 | ||
| 173 | ret = exynos_drm_subdrv_open(dev, file); | 173 | ret = exynos_drm_subdrv_open(dev, file); |
| 174 | if (ret) | 174 | if (ret) |
| 175 | goto out; | 175 | goto err_file_priv_free; |
| 176 | 176 | ||
| 177 | anon_filp = anon_inode_getfile("exynos_gem", &exynos_drm_gem_fops, | 177 | anon_filp = anon_inode_getfile("exynos_gem", &exynos_drm_gem_fops, |
| 178 | NULL, 0); | 178 | NULL, 0); |
| 179 | if (IS_ERR(anon_filp)) { | 179 | if (IS_ERR(anon_filp)) { |
| 180 | ret = PTR_ERR(anon_filp); | 180 | ret = PTR_ERR(anon_filp); |
| 181 | goto out; | 181 | goto err_subdrv_close; |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | anon_filp->f_mode = FMODE_READ | FMODE_WRITE; | 184 | anon_filp->f_mode = FMODE_READ | FMODE_WRITE; |
| 185 | file_priv->anon_filp = anon_filp; | 185 | file_priv->anon_filp = anon_filp; |
| 186 | 186 | ||
| 187 | return ret; | 187 | return ret; |
| 188 | out: | 188 | |
| 189 | err_subdrv_close: | ||
| 190 | exynos_drm_subdrv_close(dev, file); | ||
| 191 | |||
| 192 | err_file_priv_free: | ||
| 189 | kfree(file_priv); | 193 | kfree(file_priv); |
| 190 | file->driver_priv = NULL; | 194 | file->driver_priv = NULL; |
| 191 | return ret; | 195 | return ret; |
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index d58b4e287e32..28d24caa49f3 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c | |||
| @@ -214,6 +214,13 @@ int i915_gem_init_stolen(struct drm_device *dev) | |||
| 214 | struct drm_i915_private *dev_priv = dev->dev_private; | 214 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 215 | int bios_reserved = 0; | 215 | int bios_reserved = 0; |
| 216 | 216 | ||
| 217 | #ifdef CONFIG_INTEL_IOMMU | ||
| 218 | if (intel_iommu_gfx_mapped) { | ||
| 219 | DRM_INFO("DMAR active, disabling use of stolen memory\n"); | ||
| 220 | return 0; | ||
| 221 | } | ||
| 222 | #endif | ||
| 223 | |||
| 217 | if (dev_priv->gtt.stolen_size == 0) | 224 | if (dev_priv->gtt.stolen_size == 0) |
| 218 | return 0; | 225 | return 0; |
| 219 | 226 | ||
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 9fec71175571..d554169ac592 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
| @@ -618,33 +618,25 @@ static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) | |||
| 618 | 618 | ||
| 619 | /* raw reads, only for fast reads of display block, no need for forcewake etc. */ | 619 | /* raw reads, only for fast reads of display block, no need for forcewake etc. */ |
| 620 | #define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__)) | 620 | #define __raw_i915_read32(dev_priv__, reg__) readl((dev_priv__)->regs + (reg__)) |
| 621 | #define __raw_i915_read16(dev_priv__, reg__) readw((dev_priv__)->regs + (reg__)) | ||
| 622 | 621 | ||
| 623 | static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe) | 622 | static bool ilk_pipe_in_vblank_locked(struct drm_device *dev, enum pipe pipe) |
| 624 | { | 623 | { |
| 625 | struct drm_i915_private *dev_priv = dev->dev_private; | 624 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 626 | uint32_t status; | 625 | uint32_t status; |
| 627 | 626 | int reg; | |
| 628 | if (INTEL_INFO(dev)->gen < 7) { | 627 | |
| 629 | status = pipe == PIPE_A ? | 628 | if (INTEL_INFO(dev)->gen >= 8) { |
| 630 | DE_PIPEA_VBLANK : | 629 | status = GEN8_PIPE_VBLANK; |
| 631 | DE_PIPEB_VBLANK; | 630 | reg = GEN8_DE_PIPE_ISR(pipe); |
| 631 | } else if (INTEL_INFO(dev)->gen >= 7) { | ||
| 632 | status = DE_PIPE_VBLANK_IVB(pipe); | ||
| 633 | reg = DEISR; | ||
| 632 | } else { | 634 | } else { |
| 633 | switch (pipe) { | 635 | status = DE_PIPE_VBLANK(pipe); |
| 634 | default: | 636 | reg = DEISR; |
| 635 | case PIPE_A: | ||
| 636 | status = DE_PIPEA_VBLANK_IVB; | ||
| 637 | break; | ||
| 638 | case PIPE_B: | ||
| 639 | status = DE_PIPEB_VBLANK_IVB; | ||
| 640 | break; | ||
| 641 | case PIPE_C: | ||
| 642 | status = DE_PIPEC_VBLANK_IVB; | ||
| 643 | break; | ||
| 644 | } | ||
| 645 | } | 637 | } |
| 646 | 638 | ||
| 647 | return __raw_i915_read32(dev_priv, DEISR) & status; | 639 | return __raw_i915_read32(dev_priv, reg) & status; |
| 648 | } | 640 | } |
| 649 | 641 | ||
| 650 | static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | 642 | static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, |
| @@ -702,7 +694,28 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe, | |||
| 702 | else | 694 | else |
| 703 | position = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) & DSL_LINEMASK_GEN3; | 695 | position = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) & DSL_LINEMASK_GEN3; |
| 704 | 696 | ||
| 705 | if (HAS_PCH_SPLIT(dev)) { | 697 | if (HAS_DDI(dev)) { |
| 698 | /* | ||
| 699 | * On HSW HDMI outputs there seems to be a 2 line | ||
| 700 | * difference, whereas eDP has the normal 1 line | ||
| 701 | * difference that earlier platforms have. External | ||
| 702 | * DP is unknown. For now just check for the 2 line | ||
| 703 | * difference case on all output types on HSW+. | ||
| 704 | * | ||
| 705 | * This might misinterpret the scanline counter being | ||
| 706 | * one line too far along on eDP, but that's less | ||
| 707 | * dangerous than the alternative since that would lead | ||
| 708 | * the vblank timestamp code astray when it sees a | ||
| 709 | * scanline count before vblank_start during a vblank | ||
| 710 | * interrupt. | ||
| 711 | */ | ||
| 712 | in_vbl = ilk_pipe_in_vblank_locked(dev, pipe); | ||
| 713 | if ((in_vbl && (position == vbl_start - 2 || | ||
| 714 | position == vbl_start - 1)) || | ||
| 715 | (!in_vbl && (position == vbl_end - 2 || | ||
| 716 | position == vbl_end - 1))) | ||
| 717 | position = (position + 2) % vtotal; | ||
| 718 | } else if (HAS_PCH_SPLIT(dev)) { | ||
| 706 | /* | 719 | /* |
| 707 | * The scanline counter increments at the leading edge | 720 | * The scanline counter increments at the leading edge |
| 708 | * of hsync, ie. it completely misses the active portion | 721 | * of hsync, ie. it completely misses the active portion |
| @@ -2769,10 +2782,9 @@ static void ibx_irq_postinstall(struct drm_device *dev) | |||
| 2769 | return; | 2782 | return; |
| 2770 | 2783 | ||
| 2771 | if (HAS_PCH_IBX(dev)) { | 2784 | if (HAS_PCH_IBX(dev)) { |
| 2772 | mask = SDE_GMBUS | SDE_AUX_MASK | SDE_TRANSB_FIFO_UNDER | | 2785 | mask = SDE_GMBUS | SDE_AUX_MASK | SDE_POISON; |
| 2773 | SDE_TRANSA_FIFO_UNDER | SDE_POISON; | ||
| 2774 | } else { | 2786 | } else { |
| 2775 | mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT; | 2787 | mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT; |
| 2776 | 2788 | ||
| 2777 | I915_WRITE(SERR_INT, I915_READ(SERR_INT)); | 2789 | I915_WRITE(SERR_INT, I915_READ(SERR_INT)); |
| 2778 | } | 2790 | } |
| @@ -2832,20 +2844,19 @@ static int ironlake_irq_postinstall(struct drm_device *dev) | |||
| 2832 | display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE_IVB | | 2844 | display_mask = (DE_MASTER_IRQ_CONTROL | DE_GSE_IVB | |
| 2833 | DE_PCH_EVENT_IVB | DE_PLANEC_FLIP_DONE_IVB | | 2845 | DE_PCH_EVENT_IVB | DE_PLANEC_FLIP_DONE_IVB | |
| 2834 | DE_PLANEB_FLIP_DONE_IVB | | 2846 | DE_PLANEB_FLIP_DONE_IVB | |
| 2835 | DE_PLANEA_FLIP_DONE_IVB | DE_AUX_CHANNEL_A_IVB | | 2847 | DE_PLANEA_FLIP_DONE_IVB | DE_AUX_CHANNEL_A_IVB); |
| 2836 | DE_ERR_INT_IVB); | ||
| 2837 | extra_mask = (DE_PIPEC_VBLANK_IVB | DE_PIPEB_VBLANK_IVB | | 2848 | extra_mask = (DE_PIPEC_VBLANK_IVB | DE_PIPEB_VBLANK_IVB | |
| 2838 | DE_PIPEA_VBLANK_IVB); | 2849 | DE_PIPEA_VBLANK_IVB | DE_ERR_INT_IVB); |
