aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-09-19 20:00:31 -0400
committerDave Airlie <airlied@redhat.com>2018-09-19 20:00:46 -0400
commitd5b3a31b1ceaa9d6f44646848ebde590f2a03d84 (patch)
treee3be87cec0cfd87e394eea0d2201881123dafb74 /drivers/gpu/drm
parent7876320f88802b22d4e2daf7eb027dd14175a0f8 (diff)
parent558a9ef94a329a1ac75613407ad15d0d0071ff4c (diff)
Merge tag 'drm-misc-fixes-2018-09-19' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
drm-misc-fixes for v4.19-rc5: - Fix crash in vgem in drm_drv_uses_atomic_modeset. - Allow atomic drivers that don't set DRIVER_ATOMIC to create debugfs entries. - Fix compiler warning for unused connector_funcs. - Fix null pointer deref on UDL unplug. - Disable DRM support for sun4i's R40 for now. (Not all patches went in for v4.19, so it has to wait a cycle.) - NULL-terminate the of_device_id table in pl111. - Make sure vc4 NV12 planar format works when displaying an unscaled fb. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/dda393bb-f13f-8d36-711b-cacfc578e5a3@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/drm_atomic.c2
-rw-r--r--drivers/gpu/drm/drm_debugfs.c2
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c3
-rw-r--r--drivers/gpu/drm/pl111/pl111_vexpress.c3
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_drv.c1
-rw-r--r--drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c1
-rw-r--r--drivers/gpu/drm/sun4i/sun8i_mixer.c24
-rw-r--r--drivers/gpu/drm/sun4i/sun8i_tcon_top.c1
-rw-r--r--drivers/gpu/drm/udl/udl_fb.c8
-rw-r--r--drivers/gpu/drm/vc4/vc4_plane.c25
10 files changed, 21 insertions, 49 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 3eb061e11e2e..018fcdb353d2 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -2067,7 +2067,7 @@ static void __drm_state_dump(struct drm_device *dev, struct drm_printer *p,
2067 struct drm_connector *connector; 2067 struct drm_connector *connector;
2068 struct drm_connector_list_iter conn_iter; 2068 struct drm_connector_list_iter conn_iter;
2069 2069
2070 if (!drm_core_check_feature(dev, DRIVER_ATOMIC)) 2070 if (!drm_drv_uses_atomic_modeset(dev))
2071 return; 2071 return;
2072 2072
2073 list_for_each_entry(plane, &config->plane_list, head) { 2073 list_for_each_entry(plane, &config->plane_list, head) {
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 6f28fe58f169..373bd4c2b698 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -151,7 +151,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
151 return ret; 151 return ret;
152 } 152 }
153 153
154 if (drm_core_check_feature(dev, DRIVER_ATOMIC)) { 154 if (drm_drv_uses_atomic_modeset(dev)) {
155 ret = drm_atomic_debugfs_init(minor); 155 ret = drm_atomic_debugfs_init(minor);
156 if (ret) { 156 if (ret) {
157 DRM_ERROR("Failed to create atomic debugfs files\n"); 157 DRM_ERROR("Failed to create atomic debugfs files\n");
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 4b0dd20bccb8..16ec93b75dbf 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -2370,7 +2370,6 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
2370{ 2370{
2371 int c, o; 2371 int c, o;
2372 struct drm_connector *connector; 2372 struct drm_connector *connector;
2373 const struct drm_connector_helper_funcs *connector_funcs;
2374 int my_score, best_score, score; 2373 int my_score, best_score, score;
2375 struct drm_fb_helper_crtc **crtcs, *crtc; 2374 struct drm_fb_helper_crtc **crtcs, *crtc;
2376 struct drm_fb_helper_connector *fb_helper_conn; 2375 struct drm_fb_helper_connector *fb_helper_conn;
@@ -2399,8 +2398,6 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
2399 if (drm_has_preferred_mode(fb_helper_conn, width, height)) 2398 if (drm_has_preferred_mode(fb_helper_conn, width, height))
2400 my_score++; 2399 my_score++;
2401 2400
2402 connector_funcs = connector->helper_private;
2403
2404 /* 2401 /*
2405 * select a crtc for this connector and then attempt to configure 2402 * select a crtc for this connector and then attempt to configure
2406 * remaining connectors 2403 * remaining connectors
diff --git a/drivers/gpu/drm/pl111/pl111_vexpress.c b/drivers/gpu/drm/pl111/pl111_vexpress.c
index a534b225e31b..5fa0441bb6df 100644
--- a/drivers/gpu/drm/pl111/pl111_vexpress.c
+++ b/drivers/gpu/drm/pl111/pl111_vexpress.c
@@ -111,7 +111,8 @@ static int vexpress_muxfpga_probe(struct platform_device *pdev)
111} 111}
112 112
113static const struct of_device_id vexpress_muxfpga_match[] = { 113static const struct of_device_id vexpress_muxfpga_match[] = {
114 { .compatible = "arm,vexpress-muxfpga", } 114 { .compatible = "arm,vexpress-muxfpga", },
115 {}
115}; 116};
116 117
117static struct platform_driver vexpress_muxfpga_driver = { 118static struct platform_driver vexpress_muxfpga_driver = {
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index dd19d674055c..8b0cd08034e0 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -418,7 +418,6 @@ static const struct of_device_id sun4i_drv_of_table[] = {
418 { .compatible = "allwinner,sun8i-a33-display-engine" }, 418 { .compatible = "allwinner,sun8i-a33-display-engine" },
419 { .compatible = "allwinner,sun8i-a83t-display-engine" }, 419 { .compatible = "allwinner,sun8i-a83t-display-engine" },
420 { .compatible = "allwinner,sun8i-h3-display-engine" }, 420 { .compatible = "allwinner,sun8i-h3-display-engine" },
421 { .compatible = "allwinner,sun8i-r40-display-engine" },
422 { .compatible = "allwinner,sun8i-v3s-display-engine" }, 421 { .compatible = "allwinner,sun8i-v3s-display-engine" },
423 { .compatible = "allwinner,sun9i-a80-display-engine" }, 422 { .compatible = "allwinner,sun9i-a80-display-engine" },
424 { } 423 { }
diff --git a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
index 82502b351aec..a564b5dfe082 100644
--- a/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
+++ b/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c
@@ -398,7 +398,6 @@ static struct regmap_config sun8i_hdmi_phy_regmap_config = {
398 398
399static const struct sun8i_hdmi_phy_variant sun50i_a64_hdmi_phy = { 399static const struct sun8i_hdmi_phy_variant sun50i_a64_hdmi_phy = {
400 .has_phy_clk = true, 400 .has_phy_clk = true,
401 .has_second_pll = true,
402 .phy_init = &sun8i_hdmi_phy_init_h3, 401 .phy_init = &sun8i_hdmi_phy_init_h3,
403 .phy_disable = &sun8i_hdmi_phy_disable_h3, 402 .phy_disable = &sun8i_hdmi_phy_disable_h3,
404 .phy_config = &sun8i_hdmi_phy_config_h3, 403 .phy_config = &sun8i_hdmi_phy_config_h3,
diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
index fc3713608f78..cb65b0ed53fd 100644
--- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
@@ -545,22 +545,6 @@ static const struct sun8i_mixer_cfg sun8i_h3_mixer0_cfg = {
545 .vi_num = 1, 545 .vi_num = 1,
546}; 546};
547 547
548static const struct sun8i_mixer_cfg sun8i_r40_mixer0_cfg = {
549 .ccsc = 0,
550 .mod_rate = 297000000,
551 .scaler_mask = 0xf,
552 .ui_num = 3,
553 .vi_num = 1,
554};
555
556static const struct sun8i_mixer_cfg sun8i_r40_mixer1_cfg = {
557 .ccsc = 1,
558 .mod_rate = 297000000,
559 .scaler_mask = 0x3,
560 .ui_num = 1,
561 .vi_num = 1,
562};
563
564static const struct sun8i_mixer_cfg sun8i_v3s_mixer_cfg = { 548static const struct sun8i_mixer_cfg sun8i_v3s_mixer_cfg = {
565 .vi_num = 2, 549 .vi_num = 2,
566 .ui_num = 1, 550 .ui_num = 1,
@@ -583,14 +567,6 @@ static const struct of_device_id sun8i_mixer_of_table[] = {
583 .data = &sun8i_h3_mixer0_cfg, 567 .data = &sun8i_h3_mixer0_cfg,
584 }, 568 },
585 { 569 {
586 .compatible = "allwinner,sun8i-r40-de2-mixer-0",
587 .data = &sun8i_r40_mixer0_cfg,
588 },
589 {
590 .compatible = "allwinner,sun8i-r40-de2-mixer-1",
591 .data = &sun8i_r40_mixer1_cfg,
592 },
593 {
594 .compatible = "allwinner,sun8i-v3s-de2-mixer", 570 .compatible = "allwinner,sun8i-v3s-de2-mixer",
595 .data = &sun8i_v3s_mixer_cfg, 571 .data = &sun8i_v3s_mixer_cfg,
596 }, 572 },
diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
index 55fe398d8290..d5240b777a8f 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -253,7 +253,6 @@ static int sun8i_tcon_top_remove(struct platform_device *pdev)
253 253
254/* sun4i_drv uses this list to check if a device node is a TCON TOP */ 254/* sun4i_drv uses this list to check if a device node is a TCON TOP */
255const struct of_device_id sun8i_tcon_top_of_table[] = { 255const struct of_device_id sun8i_tcon_top_of_table[] = {
256 { .compatible = "allwinner,sun8i-r40-tcon-top" },
257 { /* sentinel */ } 256 { /* sentinel */ }
258}; 257};
259MODULE_DEVICE_TABLE(of, sun8i_tcon_top_of_table); 258MODULE_DEVICE_TABLE(of, sun8i_tcon_top_of_table);
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
index dbb62f6eb48a..dd9ffded223b 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
@@ -432,9 +432,11 @@ static void udl_fbdev_destroy(struct drm_device *dev,
432{ 432{
433 drm_fb_helper_unregister_fbi(&ufbdev->helper); 433 drm_fb_helper_unregister_fbi(&ufbdev->helper);
434 drm_fb_helper_fini(&ufbdev->helper); 434 drm_fb_helper_fini(&ufbdev->helper);
435 drm_framebuffer_unregister_private(&ufbdev->ufb.base); 435 if (ufbdev->ufb.obj) {
436 drm_framebuffer_cleanup(&ufbdev->ufb.base); 436 drm_framebuffer_unregister_private(&ufbdev->ufb.base);
437 drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base); 437 drm_framebuffer_cleanup(&ufbdev->ufb.base);
438 drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base);
439 }
438} 440}
439 441
440int udl_fbdev_init(struct drm_device *dev) 442int udl_fbdev_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index cfb50fedfa2b..a3275fa66b7b 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -297,6 +297,9 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
297 vc4_state->y_scaling[0] = vc4_get_scaling_mode(vc4_state->src_h[0], 297 vc4_state->y_scaling[0] = vc4_get_scaling_mode(vc4_state->src_h[0],
298 vc4_state->crtc_h); 298 vc4_state->crtc_h);
299 299
300 vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE &&
301 vc4_state->y_scaling[0] == VC4_SCALING_NONE);
302
300 if (num_planes > 1) { 303 if (num_planes > 1) {
301 vc4_state->is_yuv = true; 304 vc4_state->is_yuv = true;
302 305
@@ -312,24 +315,17 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
312 vc4_get_scaling_mode(vc4_state->src_h[1], 315 vc4_get_scaling_mode(vc4_state->src_h[1],
313 vc4_state->crtc_h); 316 vc4_state->crtc_h);
314 317
315 /* YUV conversion requires that scaling be enabled, 318 /* YUV conversion requires that horizontal scaling be enabled,
316 * even on a plane that's otherwise 1:1. Choose TPZ 319 * even on a plane that's otherwise 1:1. Looks like only PPF
317 * for simplicity. 320 * works in that case, so let's pick that one.
318 */ 321 */
319 if (vc4_state->x_scaling[0] == VC4_SCALING_NONE) 322 if (vc4_state->is_unity)
320 vc4_state->x_scaling[0] = VC4_SCALING_TPZ; 323 vc4_state->x_scaling[0] = VC4_SCALING_PPF;
321 if (vc4_state->y_scaling[0] == VC4_SCALING_NONE)
322 vc4_state->y_scaling[0] = VC4_SCALING_TPZ;
323 } else { 324 } else {
324 vc4_state->x_scaling[1] = VC4_SCALING_NONE; 325 vc4_state->x_scaling[1] = VC4_SCALING_NONE;
325 vc4_state->y_scaling[1] = VC4_SCALING_NONE; 326 vc4_state->y_scaling[1] = VC4_SCALING_NONE;
326 } 327 }
327 328
328 vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE &&
329 vc4_state->y_scaling[0] == VC4_SCALING_NONE &&
330 vc4_state->x_scaling[1] == VC4_SCALING_NONE &&
331 vc4_state->y_scaling[1] == VC4_SCALING_NONE);
332
333 /* No configuring scaling on the cursor plane, since it gets 329 /* No configuring scaling on the cursor plane, since it gets
334 non-vblank-synced updates, and scaling requires requires 330 non-vblank-synced updates, and scaling requires requires
335 LBM changes which have to be vblank-synced. 331 LBM changes which have to be vblank-synced.
@@ -672,7 +668,10 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
672 vc4_dlist_write(vc4_state, SCALER_CSC2_ITR_R_601_5); 668 vc4_dlist_write(vc4_state, SCALER_CSC2_ITR_R_601_5);
673 } 669 }
674 670
675 if (!vc4_state->is_unity) { 671 if (vc4_state->x_scaling[0] != VC4_SCALING_NONE ||
672 vc4_state->x_scaling[1] != VC4_SCALING_NONE ||
673 vc4_state->y_scaling[0] != VC4_SCALING_NONE ||
674 vc4_state->y_scaling[1] != VC4_SCALING_NONE) {
676 /* LBM Base Address. */ 675 /* LBM Base Address. */
677 if (vc4_state->y_scaling[0] != VC4_SCALING_NONE || 676 if (vc4_state->y_scaling[0] != VC4_SCALING_NONE ||
678 vc4_state->y_scaling[1] != VC4_SCALING_NONE) { 677 vc4_state->y_scaling[1] != VC4_SCALING_NONE) {