Skip to content

Commit d5b3a31

Browse files
committed
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
2 parents 7876320 + 558a9ef commit d5b3a31

File tree

11 files changed

+22
-50
lines changed

11 files changed

+22
-50
lines changed

drivers/gpu/drm/drm_atomic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ static void __drm_state_dump(struct drm_device *dev, struct drm_printer *p,
20672067
struct drm_connector *connector;
20682068
struct drm_connector_list_iter conn_iter;
20692069

2070-
if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
2070+
if (!drm_drv_uses_atomic_modeset(dev))
20712071
return;
20722072

20732073
list_for_each_entry(plane, &config->plane_list, head) {

drivers/gpu/drm/drm_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
151151
return ret;
152152
}
153153

154-
if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
154+
if (drm_drv_uses_atomic_modeset(dev)) {
155155
ret = drm_atomic_debugfs_init(minor);
156156
if (ret) {
157157
DRM_ERROR("Failed to create atomic debugfs files\n");

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,7 +2370,6 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
23702370
{
23712371
int c, o;
23722372
struct drm_connector *connector;
2373-
const struct drm_connector_helper_funcs *connector_funcs;
23742373
int my_score, best_score, score;
23752374
struct drm_fb_helper_crtc **crtcs, *crtc;
23762375
struct drm_fb_helper_connector *fb_helper_conn;
@@ -2399,8 +2398,6 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
23992398
if (drm_has_preferred_mode(fb_helper_conn, width, height))
24002399
my_score++;
24012400

2402-
connector_funcs = connector->helper_private;
2403-
24042401
/*
24052402
* select a crtc for this connector and then attempt to configure
24062403
* remaining connectors

drivers/gpu/drm/pl111/pl111_vexpress.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ static int vexpress_muxfpga_probe(struct platform_device *pdev)
111111
}
112112

113113
static const struct of_device_id vexpress_muxfpga_match[] = {
114-
{ .compatible = "arm,vexpress-muxfpga", }
114+
{ .compatible = "arm,vexpress-muxfpga", },
115+
{}
115116
};
116117

117118
static struct platform_driver vexpress_muxfpga_driver = {

drivers/gpu/drm/sun4i/sun4i_drv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ static const struct of_device_id sun4i_drv_of_table[] = {
418418
{ .compatible = "allwinner,sun8i-a33-display-engine" },
419419
{ .compatible = "allwinner,sun8i-a83t-display-engine" },
420420
{ .compatible = "allwinner,sun8i-h3-display-engine" },
421-
{ .compatible = "allwinner,sun8i-r40-display-engine" },
422421
{ .compatible = "allwinner,sun8i-v3s-display-engine" },
423422
{ .compatible = "allwinner,sun9i-a80-display-engine" },
424423
{ }

drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ static struct regmap_config sun8i_hdmi_phy_regmap_config = {
398398

399399
static const struct sun8i_hdmi_phy_variant sun50i_a64_hdmi_phy = {
400400
.has_phy_clk = true,
401-
.has_second_pll = true,
402401
.phy_init = &sun8i_hdmi_phy_init_h3,
403402
.phy_disable = &sun8i_hdmi_phy_disable_h3,
404403
.phy_config = &sun8i_hdmi_phy_config_h3,

drivers/gpu/drm/sun4i/sun8i_mixer.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -545,22 +545,6 @@ static const struct sun8i_mixer_cfg sun8i_h3_mixer0_cfg = {
545545
.vi_num = 1,
546546
};
547547

548-
static 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-
556-
static 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-
564548
static const struct sun8i_mixer_cfg sun8i_v3s_mixer_cfg = {
565549
.vi_num = 2,
566550
.ui_num = 1,
@@ -582,14 +566,6 @@ static const struct of_device_id sun8i_mixer_of_table[] = {
582566
.compatible = "allwinner,sun8i-h3-de2-mixer-0",
583567
.data = &sun8i_h3_mixer0_cfg,
584568
},
585-
{
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-
},
593569
{
594570
.compatible = "allwinner,sun8i-v3s-de2-mixer",
595571
.data = &sun8i_v3s_mixer_cfg,

drivers/gpu/drm/sun4i/sun8i_tcon_top.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ static int sun8i_tcon_top_remove(struct platform_device *pdev)
253253

254254
/* sun4i_drv uses this list to check if a device node is a TCON TOP */
255255
const struct of_device_id sun8i_tcon_top_of_table[] = {
256-
{ .compatible = "allwinner,sun8i-r40-tcon-top" },
257256
{ /* sentinel */ }
258257
};
259258
MODULE_DEVICE_TABLE(of, sun8i_tcon_top_of_table);

drivers/gpu/drm/udl/udl_fb.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,11 @@ static void udl_fbdev_destroy(struct drm_device *dev,
432432
{
433433
drm_fb_helper_unregister_fbi(&ufbdev->helper);
434434
drm_fb_helper_fini(&ufbdev->helper);
435-
drm_framebuffer_unregister_private(&ufbdev->ufb.base);
436-
drm_framebuffer_cleanup(&ufbdev->ufb.base);
437-
drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base);
435+
if (ufbdev->ufb.obj) {
436+
drm_framebuffer_unregister_private(&ufbdev->ufb.base);
437+
drm_framebuffer_cleanup(&ufbdev->ufb.base);
438+
drm_gem_object_put_unlocked(&ufbdev->ufb.obj->base);
439+
}
438440
}
439441

440442
int udl_fbdev_init(struct drm_device *dev)

drivers/gpu/drm/vc4/vc4_plane.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
297297
vc4_state->y_scaling[0] = vc4_get_scaling_mode(vc4_state->src_h[0],
298298
vc4_state->crtc_h);
299299

300+
vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE &&
301+
vc4_state->y_scaling[0] == VC4_SCALING_NONE);
302+
300303
if (num_planes > 1) {
301304
vc4_state->is_yuv = true;
302305

@@ -312,24 +315,17 @@ static int vc4_plane_setup_clipping_and_scaling(struct drm_plane_state *state)
312315
vc4_get_scaling_mode(vc4_state->src_h[1],
313316
vc4_state->crtc_h);
314317

315-
/* YUV conversion requires that scaling be enabled,
316-
* even on a plane that's otherwise 1:1. Choose TPZ
317-
* for simplicity.
318+
/* YUV conversion requires that horizontal scaling be enabled,
319+
* even on a plane that's otherwise 1:1. Looks like only PPF
320+
* works in that case, so let's pick that one.
318321
*/
319-
if (vc4_state->x_scaling[0] == VC4_SCALING_NONE)
320-
vc4_state->x_scaling[0] = VC4_SCALING_TPZ;
321-
if (vc4_state->y_scaling[0] == VC4_SCALING_NONE)
322-
vc4_state->y_scaling[0] = VC4_SCALING_TPZ;
322+
if (vc4_state->is_unity)
323+
vc4_state->x_scaling[0] = VC4_SCALING_PPF;
323324
} else {
324325
vc4_state->x_scaling[1] = VC4_SCALING_NONE;
325326
vc4_state->y_scaling[1] = VC4_SCALING_NONE;
326327
}
327328

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-
333329
/* No configuring scaling on the cursor plane, since it gets
334330
non-vblank-synced updates, and scaling requires requires
335331
LBM changes which have to be vblank-synced.
@@ -672,7 +668,10 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
672668
vc4_dlist_write(vc4_state, SCALER_CSC2_ITR_R_601_5);
673669
}
674670

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) {
676675
/* LBM Base Address. */
677676
if (vc4_state->y_scaling[0] != VC4_SCALING_NONE ||
678677
vc4_state->y_scaling[1] != VC4_SCALING_NONE) {

include/drm/drm_drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ static inline bool drm_core_check_feature(struct drm_device *dev, int feature)
675675
static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev)
676676
{
677677
return drm_core_check_feature(dev, DRIVER_ATOMIC) ||
678-
dev->mode_config.funcs->atomic_commit != NULL;
678+
(dev->mode_config.funcs && dev->mode_config.funcs->atomic_commit != NULL);
679679
}
680680

681681

0 commit comments

Comments
 (0)