Skip to content

Commit 1226716

Browse files
committed
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "Nothing too astounding or major: radeon, i915, vmwgfx, armada and exynos. Biggest ones: - vmwgfx has one big locking regression fix - i915 has come displayport fixes - radeon has some stability and a memory alloc failure - armada and exynos have some vblank fixes" * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (24 commits) drm/exynos: correct connector->dpms field before resuming drm/exynos: enable vblank after DPMS on drm/exynos: init kms poll at the end of initialization drm/exynos: propagate plane initialization errors drm/exynos: vidi: fix build warning drm/exynos: remove explicit encoder/connector de-initialization drm/exynos: init vblank with real number of crtcs drm/vmwgfx: Filter out modes those cannot be supported by the current VRAM size. drm/vmwgfx: Fix hash key computation drm/vmwgfx: fix lock breakage drm/i915/dp: only use training pattern 3 on platforms that support it drm/radeon: remove some buggy dead code drm/i915: Ignore VBT backlight check on Macbook 2, 1 drm/radeon: remove invalid pci id drm/radeon: dpm fixes for asrock systems radeon: clean up coding style differences in radeon_get_bios() drm/radeon: Use drm_malloc_ab instead of kmalloc_array drm/radeon/dpm: disable ulv support on SI drm/i915: Fix GMBUSFREQ on vlv/chv drm/i915: Ignore long hpds on eDP ports ...
2 parents 3c43de0 + 66338fe commit 1226716

22 files changed

+116
-83
lines changed

drivers/gpu/drm/armada/armada_crtc.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static void armada_drm_vblank_off(struct armada_crtc *dcrtc)
260260
* Tell the DRM core that vblank IRQs aren't going to happen for
261261
* a while. This cleans up any pending vblank events for us.
262262
*/
263-
drm_vblank_off(dev, dcrtc->num);
263+
drm_crtc_vblank_off(&dcrtc->crtc);
264264

265265
/* Handle any pending flip event. */
266266
spin_lock_irq(&dev->event_lock);
@@ -289,6 +289,8 @@ static void armada_drm_crtc_dpms(struct drm_crtc *crtc, int dpms)
289289
armada_drm_crtc_update(dcrtc);
290290
if (dpms_blanked(dpms))
291291
armada_drm_vblank_off(dcrtc);
292+
else
293+
drm_crtc_vblank_on(&dcrtc->crtc);
292294
}
293295
}
294296

@@ -526,7 +528,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
526528
/* Wait for pending flips to complete */
527529
wait_event(dcrtc->frame_wait, !dcrtc->frame_work);
528530

529-
drm_vblank_pre_modeset(crtc->dev, dcrtc->num);
531+
drm_crtc_vblank_off(crtc);
530532

531533
crtc->mode = *adj;
532534

@@ -617,7 +619,7 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
617619

618620
armada_drm_crtc_update(dcrtc);
619621

620-
drm_vblank_post_modeset(crtc->dev, dcrtc->num);
622+
drm_crtc_vblank_on(crtc);
621623
armada_drm_crtc_finish_fb(dcrtc, old_fb, dpms_blanked(dcrtc->dpms));
622624

623625
return 0;
@@ -945,18 +947,15 @@ static int armada_drm_crtc_page_flip(struct drm_crtc *crtc,
945947
armada_reg_queue_end(work->regs, i);
946948

947949
/*
948-
* Hold the old framebuffer for the work - DRM appears to drop our
949-
* reference to the old framebuffer in drm_mode_page_flip_ioctl().
950+
* Ensure that we hold a reference on the new framebuffer.
951+
* This has to match the behaviour in mode_set.
950952
*/
951-
drm_framebuffer_reference(work->old_fb);
953+
drm_framebuffer_reference(fb);
952954

953955
ret = armada_drm_crtc_queue_frame_work(dcrtc, work);
954956
if (ret) {
955-
/*
956-
* Undo our reference above; DRM does not drop the reference
957-
* to this object on error, so that's okay.
958-
*/
959-
drm_framebuffer_unreference(work->old_fb);
957+
/* Undo our reference above */
958+
drm_framebuffer_unreference(fb);
960959
kfree(work);
961960
return ret;
962961
}

drivers/gpu/drm/armada/armada_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
190190
if (ret)
191191
goto err_comp;
192192

193+
dev->irq_enabled = true;
193194
dev->vblank_disable_allowed = 1;
194195

195196
ret = armada_fbdev_init(dev);
@@ -331,7 +332,7 @@ static struct drm_driver armada_drm_driver = {
331332
.desc = "Armada SoC DRM",
332333
.date = "20120730",
333334
.driver_features = DRIVER_GEM | DRIVER_MODESET |
334-
DRIVER_PRIME,
335+
DRIVER_HAVE_IRQ | DRIVER_PRIME,
335336
.ioctls = armada_ioctls,
336337
.fops = &armada_drm_fops,
337338
};

drivers/gpu/drm/exynos/exynos_dp_core.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,13 +1355,8 @@ static void exynos_dp_unbind(struct device *dev, struct device *master,
13551355
void *data)
13561356
{
13571357
struct exynos_drm_display *display = dev_get_drvdata(dev);
1358-
struct exynos_dp_device *dp = display->ctx;
1359-
struct drm_encoder *encoder = dp->encoder;
13601358

13611359
exynos_dp_dpms(display, DRM_MODE_DPMS_OFF);
1362-
1363-
exynos_dp_connector_destroy(&dp->connector);
1364-
encoder->funcs->destroy(encoder);
13651360
}
13661361

13671362
static const struct component_ops exynos_dp_ops = {

drivers/gpu/drm/exynos/exynos_drm_crtc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
7171
!atomic_read(&exynos_crtc->pending_flip),
7272
HZ/20))
7373
atomic_set(&exynos_crtc->pending_flip, 0);
74-
drm_vblank_off(crtc->dev, exynos_crtc->pipe);
74+
drm_crtc_vblank_off(crtc);
7575
}
7676

7777
if (manager->ops->dpms)
7878
manager->ops->dpms(manager, mode);
7979

8080
exynos_crtc->dpms = mode;
81+
82+
if (mode == DRM_MODE_DPMS_ON)
83+
drm_crtc_vblank_on(crtc);
8184
}
8285

8386
static void exynos_drm_crtc_prepare(struct drm_crtc *crtc)

drivers/gpu/drm/exynos/exynos_drm_dpi.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,10 @@ struct exynos_drm_display *exynos_dpi_probe(struct device *dev)
338338

339339
int exynos_dpi_remove(struct device *dev)
340340
{
341-
struct drm_encoder *encoder = exynos_dpi_display.encoder;
342341
struct exynos_dpi *ctx = exynos_dpi_display.ctx;
343342

344343
exynos_dpi_dpms(&exynos_dpi_display, DRM_MODE_DPMS_OFF);
345344

346-
exynos_dpi_connector_destroy(&ctx->connector);
347-
encoder->funcs->destroy(encoder);
348-
349345
if (ctx->panel)
350346
drm_panel_detach(ctx->panel);
351347

drivers/gpu/drm/exynos/exynos_drm_drv.c

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,12 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
8787

8888
plane = exynos_plane_init(dev, possible_crtcs,
8989
DRM_PLANE_TYPE_OVERLAY);
90-
if (IS_ERR(plane))
91-
goto err_mode_config_cleanup;
92-
}
93-
94-
/* init kms poll for handling hpd */
95-
drm_kms_helper_poll_init(dev);
90+
if (!IS_ERR(plane))
91+
continue;
9692

97-
ret = drm_vblank_init(dev, MAX_CRTC);
98-
if (ret)
93+
ret = PTR_ERR(plane);
9994
goto err_mode_config_cleanup;
95+
}
10096

10197
/* setup possible_clones. */
10298
exynos_drm_encoder_setup(dev);
@@ -106,15 +102,16 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
106102
/* Try to bind all sub drivers. */
107103
ret = component_bind_all(dev->dev, dev);
108104
if (ret)
109-
goto err_cleanup_vblank;
105+
goto err_mode_config_cleanup;
110106

111-
/* Probe non kms sub drivers and virtual display driver. */
112-
ret = exynos_drm_device_subdrv_probe(dev);
107+
ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
113108
if (ret)
114109
goto err_unbind_all;
115110

116-
/* force connectors detection */
117-
drm_helper_hpd_irq_event(dev);
111+
/* Probe non kms sub drivers and virtual display driver. */
112+
ret = exynos_drm_device_subdrv_probe(dev);
113+
if (ret)
114+
goto err_cleanup_vblank;
118115

119116
/*
120117
* enable drm irq mode.
@@ -133,12 +130,18 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
133130
*/
134131
dev->vblank_disable_allowed = true;
135132

133+
/* init kms poll for handling hpd */
134+
drm_kms_helper_poll_init(dev);
135+
136+
/* force connectors detection */
137+
drm_helper_hpd_irq_event(dev);
138+
136139
return 0;
137140

138-
err_unbind_all:
139-
component_unbind_all(dev->dev, dev);
140141
err_cleanup_vblank:
141142
drm_vblank_cleanup(dev);
143+
err_unbind_all:
144+
component_unbind_all(dev->dev, dev);
142145
err_mode_config_cleanup:
143146
drm_mode_config_cleanup(dev);
144147
drm_release_iommu_mapping(dev);
@@ -155,8 +158,8 @@ static int exynos_drm_unload(struct drm_device *dev)
155158
exynos_drm_fbdev_fini(dev);
156159
drm_kms_helper_poll_fini(dev);
157160

158-
component_unbind_all(dev->dev, dev);
159161
drm_vblank_cleanup(dev);
162+
component_unbind_all(dev->dev, dev);
160163
drm_mode_config_cleanup(dev);
161164
drm_release_iommu_mapping(dev);
162165

@@ -191,8 +194,12 @@ static int exynos_drm_resume(struct drm_device *dev)
191194

192195
drm_modeset_lock_all(dev);
193196
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
194-
if (connector->funcs->dpms)
195-
connector->funcs->dpms(connector, connector->dpms);
197+
if (connector->funcs->dpms) {
198+
int dpms = connector->dpms;
199+
200+
connector->dpms = DRM_MODE_DPMS_OFF;
201+
connector->funcs->dpms(connector, dpms);
202+
}
196203
}
197204
drm_modeset_unlock_all(dev);
198205

drivers/gpu/drm/exynos/exynos_drm_dsi.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,13 +1660,9 @@ static void exynos_dsi_unbind(struct device *dev, struct device *master,
16601660
void *data)
16611661
{
16621662
struct exynos_dsi *dsi = exynos_dsi_display.ctx;
1663-
struct drm_encoder *encoder = dsi->encoder;
16641663

16651664
exynos_dsi_dpms(&exynos_dsi_display, DRM_MODE_DPMS_OFF);
16661665

1667-
exynos_dsi_connector_destroy(&dsi->connector);
1668-
encoder->funcs->destroy(encoder);
1669-
16701666
mipi_dsi_host_unregister(&dsi->dsi_host);
16711667
}
16721668

drivers/gpu/drm/exynos/exynos_drm_vidi.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ static int vidi_remove(struct platform_device *pdev)
630630
{
631631
struct exynos_drm_manager *mgr = platform_get_drvdata(pdev);
632632
struct vidi_context *ctx = mgr->ctx;
633-
struct drm_encoder *encoder = ctx->encoder;
634633

635634
if (ctx->raw_edid != (struct edid *)fake_edid_info) {
636635
kfree(ctx->raw_edid);
@@ -639,9 +638,6 @@ static int vidi_remove(struct platform_device *pdev)
639638
return -EINVAL;
640639
}
641640

642-
encoder->funcs->destroy(encoder);
643-
drm_connector_cleanup(&ctx->connector);
644-
645641
return 0;
646642
}
647643

drivers/gpu/drm/exynos/exynos_hdmi.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,12 +2312,6 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
23122312

23132313
static void hdmi_unbind(struct device *dev, struct device *master, void *data)
23142314
{
2315-
struct exynos_drm_display *display = get_hdmi_display(dev);
2316-
struct drm_encoder *encoder = display->encoder;
2317-
struct hdmi_context *hdata = display->ctx;
2318-
2319-
hdmi_connector_destroy(&hdata->connector);
2320-
encoder->funcs->destroy(encoder);
23212315
}
23222316

23232317
static const struct component_ops hdmi_component_ops = {

drivers/gpu/drm/i915/intel_display.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4585,7 +4585,7 @@ static void vlv_update_cdclk(struct drm_device *dev)
45854585
* BSpec erroneously claims we should aim for 4MHz, but
45864586
* in fact 1MHz is the correct frequency.
45874587
*/
4588-
I915_WRITE(GMBUSFREQ_VLV, dev_priv->vlv_cdclk_freq);
4588+
I915_WRITE(GMBUSFREQ_VLV, DIV_ROUND_UP(dev_priv->vlv_cdclk_freq, 1000));
45894589
}
45904590

45914591
/* Adjust CDclk dividers to allow high res or save power if possible */
@@ -12885,6 +12885,9 @@ static struct intel_quirk intel_quirks[] = {
1288512885
/* Acer C720 Chromebook (Core i3 4005U) */
1288612886
{ 0x0a16, 0x1025, 0x0a11, quirk_backlight_present },
1288712887

12888+
/* Apple Macbook 2,1 (Core 2 T7400) */
12889+
{ 0x27a2, 0x8086, 0x7270, quirk_backlight_present },
12890+
1288812891
/* Toshiba CB35 Chromebook (Celeron 2955U) */
1288912892
{ 0x0a06, 0x1179, 0x0a88, quirk_backlight_present },
1289012893

0 commit comments

Comments
 (0)