diff options
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_bufs.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_fops.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_usb.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/mdfld_dsi_output.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i810/i810_dma.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_fb.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_panel.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_pm.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_sor.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_irq_kms.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv770.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/si.c | 5 |
20 files changed, 64 insertions, 42 deletions
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 30372f7b2d45..348b367debeb 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c | |||
@@ -1510,8 +1510,8 @@ int drm_freebufs(struct drm_device *dev, void *data, | |||
1510 | * \param arg pointer to a drm_buf_map structure. | 1510 | * \param arg pointer to a drm_buf_map structure. |
1511 | * \return zero on success or a negative number on failure. | 1511 | * \return zero on success or a negative number on failure. |
1512 | * | 1512 | * |
1513 | * Maps the AGP, SG or PCI buffer region with do_mmap(), and copies information | 1513 | * Maps the AGP, SG or PCI buffer region with vm_mmap(), and copies information |
1514 | * about each buffer into user space. For PCI buffers, it calls do_mmap() with | 1514 | * about each buffer into user space. For PCI buffers, it calls vm_mmap() with |
1515 | * offset equal to 0, which drm_mmap() interpretes as PCI buffers and calls | 1515 | * offset equal to 0, which drm_mmap() interpretes as PCI buffers and calls |
1516 | * drm_mmap_dma(). | 1516 | * drm_mmap_dma(). |
1517 | */ | 1517 | */ |
@@ -1553,18 +1553,14 @@ int drm_mapbufs(struct drm_device *dev, void *data, | |||
1553 | retcode = -EINVAL; | 1553 | retcode = -EINVAL; |
1554 | goto done; | 1554 | goto done; |
1555 | } | 1555 | } |
1556 | down_write(¤t->mm->mmap_sem); | 1556 | virtual = vm_mmap(file_priv->filp, 0, map->size, |
1557 | virtual = do_mmap(file_priv->filp, 0, map->size, | ||
1558 | PROT_READ | PROT_WRITE, | 1557 | PROT_READ | PROT_WRITE, |
1559 | MAP_SHARED, | 1558 | MAP_SHARED, |
1560 | token); | 1559 | token); |
1561 | up_write(¤t->mm->mmap_sem); | ||
1562 | } else { | 1560 | } else { |
1563 | down_write(¤t->mm->mmap_sem); | 1561 | virtual = vm_mmap(file_priv->filp, 0, dma->byte_count, |
1564 | virtual = do_mmap(file_priv->filp, 0, dma->byte_count, | ||
1565 | PROT_READ | PROT_WRITE, | 1562 | PROT_READ | PROT_WRITE, |
1566 | MAP_SHARED, 0); | 1563 | MAP_SHARED, 0); |
1567 | up_write(¤t->mm->mmap_sem); | ||
1568 | } | 1564 | } |
1569 | if (virtual > -1024UL) { | 1565 | if (virtual > -1024UL) { |
1570 | /* Real error */ | 1566 | /* Real error */ |
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index d3aaeb6ae236..c79870a75c2f 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -3335,10 +3335,12 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, | |||
3335 | 3335 | ||
3336 | ret = crtc->funcs->page_flip(crtc, fb, e); | 3336 | ret = crtc->funcs->page_flip(crtc, fb, e); |
3337 | if (ret) { | 3337 | if (ret) { |
3338 | spin_lock_irqsave(&dev->event_lock, flags); | 3338 | if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { |
3339 | file_priv->event_space += sizeof e->event; | 3339 | spin_lock_irqsave(&dev->event_lock, flags); |
3340 | spin_unlock_irqrestore(&dev->event_lock, flags); | 3340 | file_priv->event_space += sizeof e->event; |
3341 | kfree(e); | 3341 | spin_unlock_irqrestore(&dev->event_lock, flags); |
3342 | kfree(e); | ||
3343 | } | ||
3342 | } | 3344 | } |
3343 | 3345 | ||
3344 | out: | 3346 | out: |
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index cdfbf27b2b3c..123de28f94ef 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
@@ -507,12 +507,12 @@ int drm_release(struct inode *inode, struct file *filp) | |||
507 | 507 | ||
508 | drm_events_release(file_priv); | 508 | drm_events_release(file_priv); |
509 | 509 | ||
510 | if (dev->driver->driver_features & DRIVER_GEM) | ||
511 | drm_gem_release(dev, file_priv); | ||
512 | |||
513 | if (dev->driver->driver_features & DRIVER_MODESET) | 510 | if (dev->driver->driver_features & DRIVER_MODESET) |
514 | drm_fb_release(file_priv); | 511 | drm_fb_release(file_priv); |
515 | 512 | ||
513 | if (dev->driver->driver_features & DRIVER_GEM) | ||
514 | drm_gem_release(dev, file_priv); | ||
515 | |||
516 | mutex_lock(&dev->ctxlist_mutex); | 516 | mutex_lock(&dev->ctxlist_mutex); |
517 | if (!list_empty(&dev->ctxlist)) { | 517 | if (!list_empty(&dev->ctxlist)) { |
518 | struct drm_ctx_list *pos, *n; | 518 | struct drm_ctx_list *pos, *n; |
diff --git a/drivers/gpu/drm/drm_usb.c b/drivers/gpu/drm/drm_usb.c index c8c83dad2ce1..37c9a523dd1c 100644 --- a/drivers/gpu/drm/drm_usb.c +++ b/drivers/gpu/drm/drm_usb.c | |||
@@ -1,6 +1,6 @@ | |||
1 | #include "drmP.h" | 1 | #include "drmP.h" |
2 | #include <linux/usb.h> | 2 | #include <linux/usb.h> |
3 | #include <linux/export.h> | 3 | #include <linux/module.h> |
4 | 4 | ||
5 | int drm_get_usb_dev(struct usb_interface *interface, | 5 | int drm_get_usb_dev(struct usb_interface *interface, |
6 | const struct usb_device_id *id, | 6 | const struct usb_device_id *id, |
@@ -114,3 +114,7 @@ void drm_usb_exit(struct drm_driver *driver, | |||
114 | usb_deregister(udriver); | 114 | usb_deregister(udriver); |
115 | } | 115 | } |
116 | EXPORT_SYMBOL(drm_usb_exit); | 116 | EXPORT_SYMBOL(drm_usb_exit); |
117 | |||
118 | MODULE_AUTHOR("David Airlie"); | ||
119 | MODULE_DESCRIPTION("USB DRM support"); | ||
120 | MODULE_LICENSE("GPL and additional rights"); | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 26d51979116b..392ce71ed6a1 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c | |||
@@ -581,10 +581,8 @@ int exynos_drm_gem_mmap_ioctl(struct drm_device *dev, void *data, | |||
581 | obj->filp->f_op = &exynos_drm_gem_fops; | 581 | obj->filp->f_op = &exynos_drm_gem_fops; |
582 | obj->filp->private_data = obj; | 582 | obj->filp->private_data = obj; |
583 | 583 | ||
584 | down_write(¤t->mm->mmap_sem); | 584 | addr = vm_mmap(obj->filp, 0, args->size, |
585 | addr = do_mmap(obj->filp, 0, args->size, | ||
586 | PROT_READ | PROT_WRITE, MAP_SHARED, 0); | 585 | PROT_READ | PROT_WRITE, MAP_SHARED, 0); |
587 | up_write(¤t->mm->mmap_sem); | ||
588 | 586 | ||
589 | drm_gem_object_unreference_unlocked(obj); | 587 | drm_gem_object_unreference_unlocked(obj); |
590 | 588 | ||
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.h b/drivers/gpu/drm/gma500/mdfld_dsi_output.h index 21071cef92a4..36eb0744841c 100644 --- a/drivers/gpu/drm/gma500/mdfld_dsi_output.h +++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.h | |||
@@ -29,7 +29,6 @@ | |||
29 | #define __MDFLD_DSI_OUTPUT_H__ | 29 | #define __MDFLD_DSI_OUTPUT_H__ |
30 | 30 | ||
31 | #include <linux/backlight.h> | 31 | #include <linux/backlight.h> |
32 | #include <linux/version.h> | ||
33 | #include <drm/drmP.h> | 32 | #include <drm/drmP.h> |
34 | #include <drm/drm.h> | 33 | #include <drm/drm.h> |
35 | #include <drm/drm_crtc.h> | 34 | #include <drm/drm_crtc.h> |
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c index 2c8a60c3b98e..f920fb5e42b6 100644 --- a/drivers/gpu/drm/i810/i810_dma.c +++ b/drivers/gpu/drm/i810/i810_dma.c | |||
@@ -129,6 +129,7 @@ static int i810_map_buffer(struct drm_buf *buf, struct drm_file *file_priv) | |||
129 | if (buf_priv->currently_mapped == I810_BUF_MAPPED) | 129 | if (buf_priv->currently_mapped == I810_BUF_MAPPED) |
130 | return -EINVAL; | 130 | return -EINVAL; |
131 | 131 | ||
132 | /* This is all entirely broken */ | ||
132 | down_write(¤t->mm->mmap_sem); | 133 | down_write(¤t->mm->mmap_sem); |
133 | old_fops = file_priv->filp->f_op; | 134 | old_fops = file_priv->filp->f_op; |
134 | file_priv->filp->f_op = &i810_buffer_fops; | 135 | file_priv->filp->f_op = &i810_buffer_fops; |
@@ -157,11 +158,8 @@ static int i810_unmap_buffer(struct drm_buf *buf) | |||
157 | if (buf_priv->currently_mapped != I810_BUF_MAPPED) | 158 | if (buf_priv->currently_mapped != I810_BUF_MAPPED) |
158 | return -EINVAL; | 159 | return -EINVAL; |
159 | 160 | ||
160 | down_write(¤t->mm->mmap_sem); | 161 | retcode = vm_munmap((unsigned long)buf_priv->virtual, |
161 | retcode = do_munmap(current->mm, | ||
162 | (unsigned long)buf_priv->virtual, | ||
163 | (size_t) buf->total); | 162 | (size_t) buf->total); |
164 | up_write(¤t->mm->mmap_sem); | ||
165 | 163 | ||
166 | buf_priv->currently_mapped = I810_BUF_UNMAPPED; | 164 | buf_priv->currently_mapped = I810_BUF_UNMAPPED; |
167 | buf_priv->virtual = NULL; | 165 | buf_priv->virtual = NULL; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 0e3c6acde955..0d1e4b7b4b99 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1087,11 +1087,9 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, | |||
1087 | if (obj == NULL) | 1087 | if (obj == NULL) |
1088 | return -ENOENT; | 1088 | return -ENOENT; |
1089 | 1089 | ||
1090 | down_write(¤t->mm->mmap_sem); | 1090 | addr = vm_mmap(obj->filp, 0, args->size, |
1091 | addr = do_mmap(obj->filp, 0, args->size, | ||
1092 | PROT_READ | PROT_WRITE, MAP_SHARED, | 1091 | PROT_READ | PROT_WRITE, MAP_SHARED, |
1093 | args->offset); | 1092 | args->offset); |
1094 | up_write(¤t->mm->mmap_sem); | ||
1095 | drm_gem_object_unreference_unlocked(obj); | 1093 | drm_gem_object_unreference_unlocked(obj); |
1096 | if (IS_ERR((void *)addr)) | 1094 | if (IS_ERR((void *)addr)) |
1097 | return addr; | 1095 | return addr; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index bae38acf44dc..5908cd563400 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -3478,8 +3478,11 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc, | |||
3478 | return false; | 3478 | return false; |
3479 | } | 3479 | } |
3480 | 3480 | ||
3481 | /* All interlaced capable intel hw wants timings in frames. */ | 3481 | /* All interlaced capable intel hw wants timings in frames. Note though |
3482 | drm_mode_set_crtcinfo(adjusted_mode, 0); | 3482 | * that intel_lvds_mode_fixup does some funny tricks with the crtc |
3483 | * timings, so we need to be careful not to clobber these.*/ | ||
3484 | if (!(adjusted_mode->private_flags & INTEL_MODE_CRTC_TIMINGS_SET)) | ||
3485 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
3483 | 3486 | ||
3484 | return true; | 3487 | return true; |
3485 | } | 3488 | } |
@@ -7465,7 +7468,13 @@ static int intel_gen6_queue_flip(struct drm_device *dev, | |||
7465 | OUT_RING(fb->pitches[0] | obj->tiling_mode); | 7468 | OUT_RING(fb->pitches[0] | obj->tiling_mode); |
7466 | OUT_RING(obj->gtt_offset); | 7469 | OUT_RING(obj->gtt_offset); |
7467 | 7470 | ||
7468 | pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE; | 7471 | /* Contrary to the suggestions in the documentation, |
7472 | * "Enable Panel Fitter" does not seem to be required when page | ||
7473 | * flipping with a non-native mode, and worse causes a normal | ||
7474 | * modeset to fail. | ||
7475 | * pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE; | ||
7476 | */ | ||
7477 | pf = 0; | ||
7469 | pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff; | 7478 | pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff; |
7470 | OUT_RING(pf | pipesrc); | 7479 | OUT_RING(pf | pipesrc); |
7471 | ADVANCE_LP_RING(); | 7480 | ADVANCE_LP_RING(); |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 5a14149b3794..715afa153025 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -105,6 +105,10 @@ | |||
105 | #define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0) | 105 | #define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0) |
106 | #define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT) | 106 | #define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT) |
107 | #define INTEL_MODE_DP_FORCE_6BPC (0x10) | 107 | #define INTEL_MODE_DP_FORCE_6BPC (0x10) |
108 | /* This flag must be set by the encoder's mode_fixup if it changes the crtc | ||
109 | * timings in the mode to prevent the crtc fixup from overwriting them. | ||
110 | * Currently only lvds needs that. */ | ||
111 | #define INTEL_MODE_CRTC_TIMINGS_SET (0x20) | ||
108 | 112 | ||
109 | static inline void | 113 | static inline void |
110 | intel_mode_set_pixel_multiplier(struct drm_display_mode *mode, | 114 | intel_mode_set_pixel_multiplier(struct drm_display_mode *mode, |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 19ecd78b8a2c..6e9ee33fd412 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -279,6 +279,8 @@ void intel_fb_restore_mode(struct drm_device *dev) | |||
279 | struct drm_mode_config *config = &dev->mode_config; | 279 | struct drm_mode_config *config = &dev->mode_config; |
280 | struct drm_plane *plane; | 280 | struct drm_plane *plane; |
281 | 281 | ||
282 | mutex_lock(&dev->mode_config.mutex); | ||
283 | |||
282 | ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper); | 284 | ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper); |
283 | if (ret) | 285 | if (ret) |
284 | DRM_DEBUG("failed to restore crtc mode\n"); | 286 | DRM_DEBUG("failed to restore crtc mode\n"); |
@@ -286,4 +288,6 @@ void intel_fb_restore_mode(struct drm_device *dev) | |||
286 | /* Be sure to shut off any planes that may be active */ | 288 | /* Be sure to shut off any planes that may be active */ |
287 | list_for_each_entry(plane, &config->plane_list, head) | 289 | list_for_each_entry(plane, &config->plane_list, head) |
288 | plane->funcs->disable_plane(plane); | 290 | plane->funcs->disable_plane(plane); |
291 | |||
292 | mutex_unlock(&dev->mode_config.mutex); | ||
289 | } | 293 | } |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 95db2e988227..30e2c82101de 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -187,6 +187,8 @@ centre_horizontally(struct drm_display_mode *mode, | |||
187 | 187 | ||
188 | mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos; | 188 | mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos; |
189 | mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width; | 189 | mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width; |
190 | |||
191 | mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET; | ||
190 | } | 192 | } |
191 | 193 | ||
192 | static void | 194 | static void |
@@ -208,6 +210,8 @@ centre_vertically(struct drm_display_mode *mode, | |||
208 | 210 | ||
209 | mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos; | 211 | mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos; |
210 | mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width; | 212 | mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width; |
213 | |||
214 | mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET; | ||
211 | } | 215 | } |
212 | 216 | ||
213 | static inline u32 panel_fitter_scaling(u32 source, u32 target) | 217 | static inline u32 panel_fitter_scaling(u32 source, u32 target) |
@@ -283,6 +287,8 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, | |||
283 | for_each_pipe(pipe) | 287 | for_each_pipe(pipe) |
284 | I915_WRITE(BCLRPAT(pipe), 0); | 288 | I915_WRITE(BCLRPAT(pipe), 0); |
285 | 289 | ||
290 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
291 | |||
286 | switch (intel_lvds->fitting_mode) { | 292 | switch (intel_lvds->fitting_mode) { |
287 | case DRM_MODE_SCALE_CENTER: | 293 | case DRM_MODE_SCALE_CENTER: |
288 | /* | 294 | /* |
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index 230a141dbea3..48177ec4720e 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c | |||
@@ -47,8 +47,6 @@ intel_fixed_panel_mode(struct drm_display_mode *fixed_mode, | |||
47 | adjusted_mode->vtotal = fixed_mode->vtotal; | 47 | adjusted_mode->vtotal = fixed_mode->vtotal; |
48 | 48 | ||
49 | adjusted_mode->clock = fixed_mode->clock; | 49 | adjusted_mode->clock = fixed_mode->clock; |
50 | |||
51 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
52 | } | 50 | } |
53 | 51 | ||
54 | /* adjusted_mode has been preset to be the panel's fixed mode */ | 52 | /* adjusted_mode has been preset to be the panel's fixed mode */ |
diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index 34d591b7d4ef..da3e7c3abab7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c | |||
@@ -235,6 +235,7 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile) | |||
235 | return -EPERM; | 235 | return -EPERM; |
236 | 236 | ||
237 | strncpy(string, profile, sizeof(string)); | 237 | strncpy(string, profile, sizeof(string)); |
238 | string[sizeof(string) - 1] = 0; | ||
238 | if ((ptr = strchr(string, '\n'))) | 239 | if ((ptr = strchr(string, '\n'))) |
239 | *ptr = '\0'; | 240 | *ptr = '\0'; |
240 | 241 | ||
diff --git a/drivers/gpu/drm/nouveau/nv50_sor.c b/drivers/gpu/drm/nouveau/nv50_sor.c index a7844ab6a50c..274640212475 100644 --- a/drivers/gpu/drm/nouveau/nv50_sor.c +++ b/drivers/gpu/drm/nouveau/nv50_sor.c | |||
@@ -42,7 +42,7 @@ nv50_sor_dp_lane_map(struct drm_device *dev, struct dcb_entry *dcb, u8 lane) | |||
42 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 42 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
43 | static const u8 nvaf[] = { 24, 16, 8, 0 }; /* thanks, apple.. */ | 43 | static const u8 nvaf[] = { 24, 16, 8, 0 }; /* thanks, apple.. */ |
44 | static const u8 nv50[] = { 16, 8, 0, 24 }; | 44 | static const u8 nv50[] = { 16, 8, 0, 24 }; |
45 | if (dev_priv->card_type == 0xaf) | 45 | if (dev_priv->chipset == 0xaf) |
46 | return nvaf[lane]; | 46 | return nvaf[lane]; |
47 | return nv50[lane]; | 47 | return nv50[lane]; |
48 | } | 48 | } |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index de71243b591f..c8187c4b6ae8 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1135,7 +1135,7 @@ static void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc | |||
1135 | } | 1135 | } |
1136 | if (rdev->flags & RADEON_IS_AGP) { | 1136 | if (rdev->flags & RADEON_IS_AGP) { |
1137 | size_bf = mc->gtt_start; | 1137 | size_bf = mc->gtt_start; |
1138 | size_af = 0xFFFFFFFF - mc->gtt_end + 1; | 1138 | size_af = 0xFFFFFFFF - mc->gtt_end; |
1139 | if (size_bf > size_af) { | 1139 | if (size_bf > size_af) { |
1140 | if (mc->mc_vram_size > size_bf) { | 1140 | if (mc->mc_vram_size > size_bf) { |
1141 | dev_warn(rdev->dev, "limiting VRAM\n"); | 1141 | dev_warn(rdev->dev, "limiting VRAM\n"); |
@@ -1149,7 +1149,7 @@ static void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc | |||
1149 | mc->real_vram_size = size_af; | 1149 | mc->real_vram_size = size_af; |
1150 | mc->mc_vram_size = size_af; | 1150 | mc->mc_vram_size = size_af; |
1151 | } | 1151 | } |
1152 | mc->vram_start = mc->gtt_end; | 1152 | mc->vram_start = mc->gtt_end + 1; |
1153 | } | 1153 | } |
1154 | mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; | 1154 | mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; |
1155 | dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n", | 1155 | dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n", |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index bd05156edbdb..3c2e7a000a2a 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -970,7 +970,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) | |||
970 | 970 | ||
971 | encoder = obj_to_encoder(obj); | 971 | encoder = obj_to_encoder(obj); |
972 | 972 | ||
973 | if (encoder->encoder_type != DRM_MODE_ENCODER_DAC || | 973 | if (encoder->encoder_type != DRM_MODE_ENCODER_DAC && |
974 | encoder->encoder_type != DRM_MODE_ENCODER_TVDAC) | 974 | encoder->encoder_type != DRM_MODE_ENCODER_TVDAC) |
975 | continue; | 975 | continue; |
976 | 976 | ||
@@ -1000,6 +1000,7 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) | |||
1000 | * cases the DVI port is actually a virtual KVM port connected to the service | 1000 | * cases the DVI port is actually a virtual KVM port connected to the service |
1001 | * processor. | 1001 | * processor. |
1002 | */ | 1002 | */ |
1003 | out: | ||
1003 | if ((!rdev->is_atom_bios) && | 1004 | if ((!rdev->is_atom_bios) && |
1004 | (ret == connector_status_disconnected) && | 1005 | (ret == connector_status_disconnected) && |
1005 | rdev->mode_info.bios_hardcoded_edid_size) { | 1006 | rdev->mode_info.bios_hardcoded_edid_size) { |
@@ -1007,7 +1008,6 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) | |||
1007 | ret = connector_status_connected; | 1008 | ret = connector_status_connected; |
1008 | } | 1009 | } |
1009 | 1010 | ||
1010 | out: | ||
1011 | /* updated in get modes as well since we need to know if it's analog or digital */ | 1011 | /* updated in get modes as well since we need to know if it's analog or digital */ |
1012 | radeon_connector_update_scratch_regs(connector, ret); | 1012 | radeon_connector_update_scratch_regs(connector, ret); |
1013 | return ret; | 1013 | return ret; |
diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 66d5fe1c8174..65060b77c805 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c | |||
@@ -147,6 +147,12 @@ static bool radeon_msi_ok(struct radeon_device *rdev) | |||
147 | (rdev->pdev->subsystem_device == 0x01fd)) | 147 | (rdev->pdev->subsystem_device == 0x01fd)) |
148 | return true; | 148 | return true; |
149 | 149 | ||
150 | /* RV515 seems to have MSI issues where it loses | ||
151 | * MSI rearms occasionally. This leads to lockups and freezes. | ||
152 | * disable it by default. | ||
153 | */ | ||
154 | if (rdev->family == CHIP_RV515) | ||
155 | return false; | ||
150 | if (rdev->flags & RADEON_IS_IGP) { | 156 | if (rdev->flags & RADEON_IS_IGP) { |
151 | /* APUs work fine with MSIs */ | 157 | /* APUs work fine with MSIs */ |
152 | if (rdev->family >= CHIP_PALM) | 158 | if (rdev->family >= CHIP_PALM) |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index c62ae4be3845..cdab1aeaed6e 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -969,7 +969,7 @@ void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | |||
969 | } | 969 | } |
970 | if (rdev->flags & RADEON_IS_AGP) { | 970 | if (rdev->flags & RADEON_IS_AGP) { |
971 | size_bf = mc->gtt_start; | 971 | size_bf = mc->gtt_start; |
972 | size_af = 0xFFFFFFFF - mc->gtt_end + 1; | 972 | size_af = 0xFFFFFFFF - mc->gtt_end; |
973 | if (size_bf > size_af) { | 973 | if (size_bf > size_af) { |
974 | if (mc->mc_vram_size > size_bf) { | 974 | if (mc->mc_vram_size > size_bf) { |
975 | dev_warn(rdev->dev, "limiting VRAM\n"); | 975 | dev_warn(rdev->dev, "limiting VRAM\n"); |
@@ -983,7 +983,7 @@ void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | |||
983 | mc->real_vram_size = size_af; | 983 | mc->real_vram_size = size_af; |
984 | mc->mc_vram_size = size_af; | 984 | mc->mc_vram_size = size_af; |
985 | } | 985 | } |
986 | mc->vram_start = mc->gtt_end; | 986 | mc->vram_start = mc->gtt_end + 1; |
987 | } | 987 | } |
988 | mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; | 988 | mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; |
989 | dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n", | 989 | dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n", |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index ac7a199ffece..27bda986fc2b 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -2999,8 +2999,8 @@ int si_rlc_init(struct radeon_device *rdev) | |||
2999 | } | 2999 | } |
3000 | r = radeon_bo_pin(rdev->rlc.save_restore_obj, RADEON_GEM_DOMAIN_VRAM, | 3000 | r = radeon_bo_pin(rdev->rlc.save_restore_obj, RADEON_GEM_DOMAIN_VRAM, |
3001 | &rdev->rlc.save_restore_gpu_addr); | 3001 | &rdev->rlc.save_restore_gpu_addr); |
3002 | radeon_bo_unreserve(rdev->rlc.save_restore_obj); | ||
3002 | if (r) { | 3003 | if (r) { |
3003 | radeon_bo_unreserve(rdev->rlc.save_restore_obj); | ||
3004 | dev_warn(rdev->dev, "(%d) pin RLC sr bo failed\n", r); | 3004 | dev_warn(rdev->dev, "(%d) pin RLC sr bo failed\n", r); |
3005 | si_rlc_fini(rdev); | 3005 | si_rlc_fini(rdev); |
3006 | return r; | 3006 | return r; |
@@ -3023,9 +3023,8 @@ int si_rlc_init(struct radeon_device *rdev) | |||
3023 | } | 3023 | } |
3024 | r = radeon_bo_pin(rdev->rlc.clear_state_obj, RADEON_GEM_DOMAIN_VRAM, | 3024 | r = radeon_bo_pin(rdev->rlc.clear_state_obj, RADEON_GEM_DOMAIN_VRAM, |
3025 | &rdev->rlc.clear_state_gpu_addr); | 3025 | &rdev->rlc.clear_state_gpu_addr); |
3026 | radeon_bo_unreserve(rdev->rlc.clear_state_obj); | ||
3026 | if (r) { | 3027 | if (r) { |
3027 | |||
3028 | radeon_bo_unreserve(rdev->rlc.clear_state_obj); | ||
3029 | dev_warn(rdev->dev, "(%d) pin RLC c bo failed\n", r); | 3028 | dev_warn(rdev->dev, "(%d) pin RLC c bo failed\n", r); |
3030 | si_rlc_fini(rdev); | 3029 | si_rlc_fini(rdev); |
3031 | return r; | 3030 | return r; |