Skip to content

Commit 1985330

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "It's like a grab bag of one liners: - core: fix page flip error path, reorder object teardown. - usb: fix the drm_usb module license. - i915: VT switch on SNB with non-native modes fix, and a regression fix from 3.3. - radeon: missing unreserve on SI, AGP/VRAM setup fix (fixes radeon on IA64, but its a generic bug), an rn50 regression from 3.3, turn off MSIs on rv515 (it loses rearms every so often)." * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: nouveau: Set special lane map for the right chipset drm/radeon: fix load detect on rn50 with hardcoded EDIDs. drm: Releasing FBs before releasing GEM objects during drm_release drm/nouveau/pm: don't read/write beyond end of stack buffer drivers: gpu: drm: gma500: mdfld_dsi_output.h: Remove not unneeded include of version.h radeon: fix r600/agp when vram is after AGP (v3) drm: fix page_flip error handling drm/radeon/kms: fix the regression of DVI connector check drm/usb: fix module license on drm/usb layer. drm/i915: Do not set "Enable Panel Fitter" on SNB pageflips drm/i915: Hold mode_config lock whilst changing mode for lastclose() drm/radeon/si: add missing radeon_bo_unreserve in si_rlc_init() v2 drm/radeon: disable MSI on RV515 drm/i915: don't clobber the special upscaling lvds timings
2 parents 9e01297 + 273a50f commit 1985330

16 files changed

Lines changed: 56 additions & 24 deletions

‎drivers/gpu/drm/drm_crtc.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3335,10 +3335,12 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
33353335

33363336
ret = crtc->funcs->page_flip(crtc, fb, e);
33373337
if (ret) {
3338-
spin_lock_irqsave(&dev->event_lock, flags);
3339-
file_priv->event_space += sizeof e->event;
3340-
spin_unlock_irqrestore(&dev->event_lock, flags);
3341-
kfree(e);
3338+
if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) {
3339+
spin_lock_irqsave(&dev->event_lock, flags);
3340+
file_priv->event_space += sizeof e->event;
3341+
spin_unlock_irqrestore(&dev->event_lock, flags);
3342+
kfree(e);
3343+
}
33423344
}
33433345

33443346
out:

‎drivers/gpu/drm/drm_fops.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,12 +507,12 @@ int drm_release(struct inode *inode, struct file *filp)
507507

508508
drm_events_release(file_priv);
509509

510-
if (dev->driver->driver_features & DRIVER_GEM)
511-
drm_gem_release(dev, file_priv);
512-
513510
if (dev->driver->driver_features & DRIVER_MODESET)
514511
drm_fb_release(file_priv);
515512

513+
if (dev->driver->driver_features & DRIVER_GEM)
514+
drm_gem_release(dev, file_priv);
515+
516516
mutex_lock(&dev->ctxlist_mutex);
517517
if (!list_empty(&dev->ctxlist)) {
518518
struct drm_ctx_list *pos, *n;

‎drivers/gpu/drm/drm_usb.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "drmP.h"
22
#include <linux/usb.h>
3-
#include <linux/export.h>
3+
#include <linux/module.h>
44

55
int drm_get_usb_dev(struct usb_interface *interface,
66
const struct usb_device_id *id,
@@ -114,3 +114,7 @@ void drm_usb_exit(struct drm_driver *driver,
114114
usb_deregister(udriver);
115115
}
116116
EXPORT_SYMBOL(drm_usb_exit);
117+
118+
MODULE_AUTHOR("David Airlie");
119+
MODULE_DESCRIPTION("USB DRM support");
120+
MODULE_LICENSE("GPL and additional rights");

‎drivers/gpu/drm/gma500/mdfld_dsi_output.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#define __MDFLD_DSI_OUTPUT_H__
3030

3131
#include <linux/backlight.h>
32-
#include <linux/version.h>
3332
#include <drm/drmP.h>
3433
#include <drm/drm.h>
3534
#include <drm/drm_crtc.h>

‎drivers/gpu/drm/i915/intel_display.c‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,8 +3478,11 @@ static bool intel_crtc_mode_fixup(struct drm_crtc *crtc,
34783478
return false;
34793479
}
34803480

3481-
/* All interlaced capable intel hw wants timings in frames. */
3482-
drm_mode_set_crtcinfo(adjusted_mode, 0);
3481+
/* All interlaced capable intel hw wants timings in frames. Note though
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);
34833486

34843487
return true;
34853488
}
@@ -7465,7 +7468,13 @@ static int intel_gen6_queue_flip(struct drm_device *dev,
74657468
OUT_RING(fb->pitches[0] | obj->tiling_mode);
74667469
OUT_RING(obj->gtt_offset);
74677470

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;
74697478
pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
74707479
OUT_RING(pf | pipesrc);
74717480
ADVANCE_LP_RING();

‎drivers/gpu/drm/i915/intel_drv.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@
105105
#define INTEL_MODE_PIXEL_MULTIPLIER_SHIFT (0x0)
106106
#define INTEL_MODE_PIXEL_MULTIPLIER_MASK (0xf << INTEL_MODE_PIXEL_MULTIPLIER_SHIFT)
107107
#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)
108112

109113
static inline void
110114
intel_mode_set_pixel_multiplier(struct drm_display_mode *mode,

‎drivers/gpu/drm/i915/intel_fb.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,15 @@ void intel_fb_restore_mode(struct drm_device *dev)
279279
struct drm_mode_config *config = &dev->mode_config;
280280
struct drm_plane *plane;
281281

282+
mutex_lock(&dev->mode_config.mutex);
283+
282284
ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper);
283285
if (ret)
284286
DRM_DEBUG("failed to restore crtc mode\n");
285287

286288
/* Be sure to shut off any planes that may be active */
287289
list_for_each_entry(plane, &config->plane_list, head)
288290
plane->funcs->disable_plane(plane);
291+
292+
mutex_unlock(&dev->mode_config.mutex);
289293
}

‎drivers/gpu/drm/i915/intel_lvds.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ centre_horizontally(struct drm_display_mode *mode,
187187

188188
mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos;
189189
mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width;
190+
191+
mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET;
190192
}
191193

192194
static void
@@ -208,6 +210,8 @@ centre_vertically(struct drm_display_mode *mode,
208210

209211
mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos;
210212
mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width;
213+
214+
mode->private_flags |= INTEL_MODE_CRTC_TIMINGS_SET;
211215
}
212216

213217
static inline u32 panel_fitter_scaling(u32 source, u32 target)
@@ -283,6 +287,8 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder,
283287
for_each_pipe(pipe)
284288
I915_WRITE(BCLRPAT(pipe), 0);
285289

290+
drm_mode_set_crtcinfo(adjusted_mode, 0);
291+
286292
switch (intel_lvds->fitting_mode) {
287293
case DRM_MODE_SCALE_CENTER:
288294
/*

‎drivers/gpu/drm/i915/intel_panel.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
4747
adjusted_mode->vtotal = fixed_mode->vtotal;
4848

4949
adjusted_mode->clock = fixed_mode->clock;
50-
51-
drm_mode_set_crtcinfo(adjusted_mode, 0);
5250
}
5351

5452
/* adjusted_mode has been preset to be the panel's fixed mode */

‎drivers/gpu/drm/nouveau/nouveau_pm.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ nouveau_pm_profile_set(struct drm_device *dev, const char *profile)
235235
return -EPERM;
236236

237237
strncpy(string, profile, sizeof(string));
238+
string[sizeof(string) - 1] = 0;
238239
if ((ptr = strchr(string, '\n')))
239240
*ptr = '\0';
240241

0 commit comments

Comments
 (0)