Skip to content

Commit aecde27

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull DRM fixes from Dave Airlie: "I was going to leave this until post -rc1 but sysfs fixes broke hotplug in userspace, so I had to fix it harder, otherwise a set of pulls from intel, radeon and vmware, The vmware/ttm changes are bit larger but since its early and they are unlikely to break anything else I put them in, it lets vmware work with dri3" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (36 commits) drm/sysfs: fix hotplug regression since lifetime changes drm/exynos: g2d: fix memory leak to userptr drm/i915: Fix gen3 self-refresh watermarks drm/ttm: Remove set_need_resched from the ttm fault handler drm/ttm: Don't move non-existing data drm/radeon: hook up backlight functions for CI and KV family. drm/i915: Replicate BIOS eDP bpp clamping hack for hsw drm/i915: Do not enable package C8 on unsupported hardware drm/i915: Hold pc8 lock around toggling pc8.gpu_idle drm/i915: encoder->get_config is no longer optional drm/i915/tv: add ->get_config callback drm/radeon/cik: Add macrotile mode array query drm/radeon/cik: Return backend map information to userspace drm/vmwgfx: Make vmwgfx dma buffers prime aware drm/vmwgfx: Make surfaces prime-aware drm/vmwgfx: Hook up the prime ioctls drm/ttm: Add a minimal prime implementation for ttm base objects drm/vmwgfx: Fix false lockdep warning drm/ttm: Allow execbuf util reserves without ticket drm/i915: restore the early forcewake cleanup ...
2 parents e341478 + 760c960 commit aecde27

54 files changed

Lines changed: 1057 additions & 324 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/x86/kernel/early-quirks.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ static struct pci_device_id intel_stolen_ids[] __initdata = {
330330
INTEL_I915GM_IDS(gen3_stolen_size),
331331
INTEL_I945G_IDS(gen3_stolen_size),
332332
INTEL_I945GM_IDS(gen3_stolen_size),
333-
INTEL_VLV_M_IDS(gen3_stolen_size),
334-
INTEL_VLV_D_IDS(gen3_stolen_size),
333+
INTEL_VLV_M_IDS(gen6_stolen_size),
334+
INTEL_VLV_D_IDS(gen6_stolen_size),
335335
INTEL_PINEVIEW_IDS(gen3_stolen_size),
336336
INTEL_I965G_IDS(gen3_stolen_size),
337337
INTEL_G33_IDS(gen3_stolen_size),

‎drivers/gpu/drm/drm_sysfs.c‎

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,11 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)
489489
}
490490
EXPORT_SYMBOL(drm_sysfs_hotplug_event);
491491

492+
static void drm_sysfs_release(struct device *dev)
493+
{
494+
kfree(dev);
495+
}
496+
492497
/**
493498
* drm_sysfs_device_add - adds a class device to sysfs for a character driver
494499
* @dev: DRM device to be added
@@ -501,6 +506,7 @@ EXPORT_SYMBOL(drm_sysfs_hotplug_event);
501506
int drm_sysfs_device_add(struct drm_minor *minor)
502507
{
503508
char *minor_str;
509+
int r;
504510

505511
if (minor->type == DRM_MINOR_CONTROL)
506512
minor_str = "controlD%d";
@@ -509,14 +515,34 @@ int drm_sysfs_device_add(struct drm_minor *minor)
509515
else
510516
minor_str = "card%d";
511517

512-
minor->kdev = device_create(drm_class, minor->dev->dev,
513-
MKDEV(DRM_MAJOR, minor->index),
514-
minor, minor_str, minor->index);
515-
if (IS_ERR(minor->kdev)) {
516-
DRM_ERROR("device create failed %ld\n", PTR_ERR(minor->kdev));
517-
return PTR_ERR(minor->kdev);
518+
minor->kdev = kzalloc(sizeof(*minor->kdev), GFP_KERNEL);
519+
if (!minor->dev) {
520+
r = -ENOMEM;
521+
goto error;
518522
}
523+
524+
device_initialize(minor->kdev);
525+
minor->kdev->devt = MKDEV(DRM_MAJOR, minor->index);
526+
minor->kdev->class = drm_class;
527+
minor->kdev->type = &drm_sysfs_device_minor;
528+
minor->kdev->parent = minor->dev->dev;
529+
minor->kdev->release = drm_sysfs_release;
530+
dev_set_drvdata(minor->kdev, minor);
531+
532+
r = dev_set_name(minor->kdev, minor_str, minor->index);
533+
if (r < 0)
534+
goto error;
535+
536+
r = device_add(minor->kdev);
537+
if (r < 0)
538+
goto error;
539+
519540
return 0;
541+
542+
error:
543+
DRM_ERROR("device create failed %d\n", r);
544+
put_device(minor->kdev);
545+
return r;
520546
}
521547

522548
/**
@@ -529,7 +555,7 @@ int drm_sysfs_device_add(struct drm_minor *minor)
529555
void drm_sysfs_device_remove(struct drm_minor *minor)
530556
{
531557
if (minor->kdev)
532-
device_destroy(drm_class, MKDEV(DRM_MAJOR, minor->index));
558+
device_unregister(minor->kdev);
533559
minor->kdev = NULL;
534560
}
535561

‎drivers/gpu/drm/exynos/exynos_drm_g2d.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ static void g2d_userptr_put_dma_addr(struct drm_device *drm_dev,
383383
g2d_userptr->npages,
384384
g2d_userptr->vma);
385385

386+
exynos_gem_put_vma(g2d_userptr->vma);
387+
386388
if (!g2d_userptr->out_of_list)
387389
list_del_init(&g2d_userptr->list);
388390

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,7 @@ struct drm_i915_file_private {
18161816
#define HAS_POWER_WELL(dev) (IS_HASWELL(dev) || IS_BROADWELL(dev))
18171817
#define HAS_FPGA_DBG_UNCLAIMED(dev) (INTEL_INFO(dev)->has_fpga_dbg)
18181818
#define HAS_PSR(dev) (IS_HASWELL(dev) || IS_BROADWELL(dev))
1819+
#define HAS_PC8(dev) (IS_HASWELL(dev)) /* XXX HSW:ULX */
18191820

18201821
#define INTEL_PCH_DEVICE_ID_MASK 0xff00
18211822
#define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,12 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
790790

791791
/* Default to using SSC */
792792
dev_priv->vbt.lvds_use_ssc = 1;
793-
dev_priv->vbt.lvds_ssc_freq = intel_bios_ssc_frequency(dev, 1);
793+
/*
794+
* Core/SandyBridge/IvyBridge use alternative (120MHz) reference
795+
* clock for LVDS.
796+
*/
797+
dev_priv->vbt.lvds_ssc_freq = intel_bios_ssc_frequency(dev,
798+
!HAS_PCH_SPLIT(dev));
794799
DRM_DEBUG_KMS("Set default to SSC at %dMHz\n", dev_priv->vbt.lvds_ssc_freq);
795800

796801
for (port = PORT_A; port < I915_MAX_PORTS; port++) {

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,26 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
14061406
default:
14071407
break;
14081408
}
1409+
1410+
if (encoder->type == INTEL_OUTPUT_EDP && dev_priv->vbt.edp_bpp &&
1411+
pipe_config->pipe_bpp > dev_priv->vbt.edp_bpp) {
1412+
/*
1413+
* This is a big fat ugly hack.
1414+
*
1415+
* Some machines in UEFI boot mode provide us a VBT that has 18
1416+
* bpp and 1.62 GHz link bandwidth for eDP, which for reasons
1417+
* unknown we fail to light up. Yet the same BIOS boots up with
1418+
* 24 bpp and 2.7 GHz link. Use the same bpp as the BIOS uses as
1419+
* max, not what it tells us to use.
1420+
*
1421+
* Note: This will still be broken if the eDP panel is not lit
1422+
* up by the BIOS, and thus we can't get the mode at module
1423+
* load.
1424+
*/
1425+
DRM_DEBUG_KMS("pipe has %d bpp for eDP panel, overriding BIOS-provided max %d bpp\n",
1426+
pipe_config->pipe_bpp, dev_priv->vbt.edp_bpp);
1427+
dev_priv->vbt.edp_bpp = pipe_config->pipe_bpp;
1428+
}
14091429
}
14101430

14111431
static void intel_ddi_destroy(struct drm_encoder *encoder)

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

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6518,13 +6518,19 @@ static void __hsw_disable_package_c8(struct drm_i915_private *dev_priv)
65186518

65196519
void hsw_enable_package_c8(struct drm_i915_private *dev_priv)
65206520
{
6521+
if (!HAS_PC8(dev_priv->dev))
6522+
return;
6523+
65216524
mutex_lock(&dev_priv->pc8.lock);
65226525
__hsw_enable_package_c8(dev_priv);
65236526
mutex_unlock(&dev_priv->pc8.lock);
65246527
}
65256528

65266529
void hsw_disable_package_c8(struct drm_i915_private *dev_priv)
65276530
{
6531+
if (!HAS_PC8(dev_priv->dev))
6532+
return;
6533+
65286534
mutex_lock(&dev_priv->pc8.lock);
65296535
__hsw_disable_package_c8(dev_priv);
65306536
mutex_unlock(&dev_priv->pc8.lock);
@@ -6562,6 +6568,9 @@ static void hsw_update_package_c8(struct drm_device *dev)
65626568
struct drm_i915_private *dev_priv = dev->dev_private;
65636569
bool allow;
65646570

6571+
if (!HAS_PC8(dev_priv->dev))
6572+
return;
6573+
65656574
if (!i915_enable_pc8)
65666575
return;
65676576

@@ -6585,18 +6594,28 @@ static void hsw_update_package_c8(struct drm_device *dev)
65856594

65866595
static void hsw_package_c8_gpu_idle(struct drm_i915_private *dev_priv)
65876596
{
6597+
if (!HAS_PC8(dev_priv->dev))
6598+
return;
6599+
6600+
mutex_lock(&dev_priv->pc8.lock);
65886601
if (!dev_priv->pc8.gpu_idle) {
65896602
dev_priv->pc8.gpu_idle = true;
6590-
hsw_enable_package_c8(dev_priv);
6603+
__hsw_enable_package_c8(dev_priv);
65916604
}
6605+
mutex_unlock(&dev_priv->pc8.lock);
65926606
}
65936607

65946608
static void hsw_package_c8_gpu_busy(struct drm_i915_private *dev_priv)
65956609
{
6610+
if (!HAS_PC8(dev_priv->dev))
6611+
return;
6612+
6613+
mutex_lock(&dev_priv->pc8.lock);
65966614
if (dev_priv->pc8.gpu_idle) {
65976615
dev_priv->pc8.gpu_idle = false;
6598-
hsw_disable_package_c8(dev_priv);
6616+
__hsw_disable_package_c8(dev_priv);
65996617
}
6618+
mutex_unlock(&dev_priv->pc8.lock);
66006619
}
66016620

66026621
#define for_each_power_domain(domain, mask) \
@@ -7184,7 +7203,9 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
71847203
intel_crtc->cursor_visible = visible;
71857204
}
71867205
/* and commit changes on next vblank */
7206+
POSTING_READ(CURCNTR(pipe));
71877207
I915_WRITE(CURBASE(pipe), base);
7208+
POSTING_READ(CURBASE(pipe));
71887209
}
71897210

71907211
static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
@@ -7213,7 +7234,9 @@ static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
72137234
intel_crtc->cursor_visible = visible;
72147235
}
72157236
/* and commit changes on next vblank */
7237+
POSTING_READ(CURCNTR_IVB(pipe));
72167238
I915_WRITE(CURBASE_IVB(pipe), base);
7239+
POSTING_READ(CURBASE_IVB(pipe));
72177240
}
72187241

72197242
/* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
@@ -9248,8 +9271,7 @@ check_crtc_state(struct drm_device *dev)
92489271
enum pipe pipe;
92499272
if (encoder->base.crtc != &crtc->base)
92509273
continue;
9251-
if (encoder->get_config &&
9252-
encoder->get_hw_state(encoder, &pipe))
9274+
if (encoder->get_hw_state(encoder, &pipe))
92539275
encoder->get_config(encoder, &pipe_config);
92549276
}
92559277

@@ -10909,8 +10931,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
1090910931
if (encoder->get_hw_state(encoder, &pipe)) {
1091010932
crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
1091110933
encoder->base.crtc = &crtc->base;
10912-
if (encoder->get_config)
10913-
encoder->get_config(encoder, &crtc->config);
10934+
encoder->get_config(encoder, &crtc->config);
1091410935
} else {
1091510936
encoder->base.crtc = NULL;
1091610937
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ static void intel_disable_dp(struct intel_encoder *encoder)
17741774
* ensure that we have vdd while we switch off the panel. */
17751775
ironlake_edp_panel_vdd_on(intel_dp);
17761776
ironlake_edp_backlight_off(intel_dp);
1777-
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
1777+
intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
17781778
ironlake_edp_panel_off(intel_dp);
17791779

17801780
/* cpu edp my only be disable _after_ the cpu pipe/plane is disabled. */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,7 @@ static void i9xx_update_wm(struct drm_crtc *unused_crtc)
16251625
&to_intel_crtc(enabled)->config.adjusted_mode;
16261626
int clock = adjusted_mode->crtc_clock;
16271627
int htotal = adjusted_mode->htotal;
1628-
int hdisplay = to_intel_crtc(crtc)->config.pipe_src_w;
1628+
int hdisplay = to_intel_crtc(enabled)->config.pipe_src_w;
16291629
int pixel_size = enabled->fb->bits_per_pixel / 8;
16301630
unsigned long line_time_us;
16311631
int entries;
@@ -3888,7 +3888,7 @@ static void gen6_enable_rps(struct drm_device *dev)
38883888

38893889
I915_WRITE(GEN6_RC_SLEEP, 0);
38903890
I915_WRITE(GEN6_RC1e_THRESHOLD, 1000);
3891-
if (INTEL_INFO(dev)->gen <= 6 || IS_IVYBRIDGE(dev))
3891+
if (IS_IVYBRIDGE(dev))
38923892
I915_WRITE(GEN6_RC6_THRESHOLD, 125000);
38933893
else
38943894
I915_WRITE(GEN6_RC6_THRESHOLD, 50000);

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,13 @@ intel_tv_mode_valid(struct drm_connector *connector,
902902
}
903903

904904

905+
static void
906+
intel_tv_get_config(struct intel_encoder *encoder,
907+
struct intel_crtc_config *pipe_config)
908+
{
909+
pipe_config->adjusted_mode.crtc_clock = pipe_config->port_clock;
910+
}
911+
905912
static bool
906913
intel_tv_compute_config(struct intel_encoder *encoder,
907914
struct intel_crtc_config *pipe_config)
@@ -1621,6 +1628,7 @@ intel_tv_init(struct drm_device *dev)
16211628
DRM_MODE_ENCODER_TVDAC);
16221629

16231630
intel_encoder->compute_config = intel_tv_compute_config;
1631+
intel_encoder->get_config = intel_tv_get_config;
16241632
intel_encoder->mode_set = intel_tv_mode_set;
16251633
intel_encoder->enable = intel_enable_tv;
16261634
intel_encoder->disable = intel_disable_tv;

0 commit comments

Comments
 (0)