Skip to content

Commit df2bb4d

Browse files
committed
Merge tag 'drm-misc-fixes-2022-02-10' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
* drm/panel: simple: Fix assignments from panel_dpi_probe() * drm/privacy-screen: Cleanups * drm/rockchip: Fix HDMI error cleanup; Fix RK3399 VOP register fields * drm/vc4: HDMI fixes; Cleanups * fbdev: Add fbdev core module with Daniel as maintainer; Cleanups Signed-off-by: Dave Airlie <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/YgTf1Zsflzq3JSFo@linux-uq9g
2 parents dfd42fa + 9da1e9a commit df2bb4d

File tree

10 files changed

+48
-25
lines changed

10 files changed

+48
-25
lines changed

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7575,6 +7575,12 @@ S: Maintained
75757575
W: http://floatingpoint.sourceforge.net/emulator/index.html
75767576
F: arch/x86/math-emu/
75777577

7578+
FRAMEBUFFER CORE
7579+
M: Daniel Vetter <[email protected]>
7580+
F: drivers/video/fbdev/core/
7581+
S: Odd Fixes
7582+
T: git git://anongit.freedesktop.org/drm/drm-misc
7583+
75787584
FRAMEBUFFER LAYER
75797585
M: Helge Deller <[email protected]>
75807586

drivers/gpu/drm/drm_privacy_screen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ EXPORT_SYMBOL(drm_privacy_screen_get_state);
269269
*
270270
* The notifier is called with no locks held. The new hw_state and sw_state
271271
* can be retrieved using the drm_privacy_screen_get_state() function.
272-
* A pointer to the drm_privacy_screen's struct is passed as the void *data
272+
* A pointer to the drm_privacy_screen's struct is passed as the ``void *data``
273273
* argument of the notifier_block's notifier_call.
274274
*
275275
* The notifier will NOT be called when changes are made through

drivers/gpu/drm/panel/panel-simple.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
588588
err = panel_dpi_probe(dev, panel);
589589
if (err)
590590
goto free_ddc;
591+
desc = panel->desc;
591592
} else {
592593
if (!of_get_display_timing(dev->of_node, "panel-timing", &dt))
593594
panel_simple_parse_panel_timing_node(dev, panel, &dt);

drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,6 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
529529
return ret;
530530
}
531531

532-
ret = clk_prepare_enable(hdmi->vpll_clk);
533-
if (ret) {
534-
DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI vpll: %d\n",
535-
ret);
536-
return ret;
537-
}
538-
539532
hdmi->phy = devm_phy_optional_get(dev, "hdmi");
540533
if (IS_ERR(hdmi->phy)) {
541534
ret = PTR_ERR(hdmi->phy);
@@ -544,6 +537,13 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
544537
return ret;
545538
}
546539

540+
ret = clk_prepare_enable(hdmi->vpll_clk);
541+
if (ret) {
542+
DRM_DEV_ERROR(hdmi->dev, "Failed to enable HDMI vpll: %d\n",
543+
ret);
544+
return ret;
545+
}
546+
547547
drm_encoder_helper_add(encoder, &dw_hdmi_rockchip_encoder_helper_funcs);
548548
drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
549549

drivers/gpu/drm/rockchip/rockchip_vop_reg.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ static const struct vop_win_phy rk3399_win01_data = {
902902
.enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0),
903903
.format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1),
904904
.rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12),
905+
.x_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 21),
905906
.y_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 22),
906907
.act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0),
907908
.dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0),
@@ -912,6 +913,7 @@ static const struct vop_win_phy rk3399_win01_data = {
912913
.uv_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 16),
913914
.src_alpha_ctl = VOP_REG(RK3288_WIN0_SRC_ALPHA_CTRL, 0xff, 0),
914915
.dst_alpha_ctl = VOP_REG(RK3288_WIN0_DST_ALPHA_CTRL, 0xff, 0),
916+
.channel = VOP_REG(RK3288_WIN0_CTRL2, 0xff, 0),
915917
};
916918

917919
/*
@@ -922,11 +924,11 @@ static const struct vop_win_phy rk3399_win01_data = {
922924
static const struct vop_win_data rk3399_vop_win_data[] = {
923925
{ .base = 0x00, .phy = &rk3399_win01_data,
924926
.type = DRM_PLANE_TYPE_PRIMARY },
925-
{ .base = 0x40, .phy = &rk3288_win01_data,
927+
{ .base = 0x40, .phy = &rk3368_win01_data,
926928
.type = DRM_PLANE_TYPE_OVERLAY },
927-
{ .base = 0x00, .phy = &rk3288_win23_data,
929+
{ .base = 0x00, .phy = &rk3368_win23_data,
928930
.type = DRM_PLANE_TYPE_OVERLAY },
929-
{ .base = 0x50, .phy = &rk3288_win23_data,
931+
{ .base = 0x50, .phy = &rk3368_win23_data,
930932
.type = DRM_PLANE_TYPE_CURSOR },
931933
};
932934

drivers/gpu/drm/vc4/vc4_crtc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc,
671671
const struct drm_display_mode *mode = &crtc_state->adjusted_mode;
672672
struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
673673

674-
mode = &crtc_state->adjusted_mode;
675674
if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) {
676675
vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000,
677676
mode->clock * 9 / 10) * 1000;

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,8 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
196196
if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio))
197197
connected = true;
198198
} else {
199-
unsigned long flags;
200-
u32 hotplug;
201-
202-
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
203-
hotplug = HDMI_READ(HDMI_HOTPLUG);
204-
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
205-
206-
if (hotplug & VC4_HDMI_HOTPLUG_CONNECTED)
199+
if (vc4_hdmi->variant->hp_detect &&
200+
vc4_hdmi->variant->hp_detect(vc4_hdmi))
207201
connected = true;
208202
}
209203

@@ -1251,6 +1245,7 @@ static int vc4_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
12511245
unsigned long long tmds_rate;
12521246

12531247
if (vc4_hdmi->variant->unsupported_odd_h_timings &&
1248+
!(mode->flags & DRM_MODE_FLAG_DBLCLK) &&
12541249
((mode->hdisplay % 2) || (mode->hsync_start % 2) ||
12551250
(mode->hsync_end % 2) || (mode->htotal % 2)))
12561251
return -EINVAL;
@@ -1298,6 +1293,7 @@ vc4_hdmi_encoder_mode_valid(struct drm_encoder *encoder,
12981293
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
12991294

13001295
if (vc4_hdmi->variant->unsupported_odd_h_timings &&
1296+
!(mode->flags & DRM_MODE_FLAG_DBLCLK) &&
13011297
((mode->hdisplay % 2) || (mode->hsync_start % 2) ||
13021298
(mode->hsync_end % 2) || (mode->htotal % 2)))
13031299
return MODE_H_ILLEGAL;
@@ -1343,6 +1339,18 @@ static u32 vc5_hdmi_channel_map(struct vc4_hdmi *vc4_hdmi, u32 channel_mask)
13431339
return channel_map;
13441340
}
13451341

1342+
static bool vc5_hdmi_hp_detect(struct vc4_hdmi *vc4_hdmi)
1343+
{
1344+
unsigned long flags;
1345+
u32 hotplug;
1346+
1347+
spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
1348+
hotplug = HDMI_READ(HDMI_HOTPLUG);
1349+
spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags);
1350+
1351+
return !!(hotplug & VC4_HDMI_HOTPLUG_CONNECTED);
1352+
}
1353+
13461354
/* HDMI audio codec callbacks */
13471355
static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi,
13481356
unsigned int samplerate)
@@ -2504,7 +2512,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
25042512
* vc4_hdmi_disable_scrambling() will thus run at boot, make
25052513
* sure it's disabled, and avoid any inconsistency.
25062514
*/
2507-
vc4_hdmi->scdc_enabled = true;
2515+
if (variant->max_pixel_clock > HDMI_14_MAX_TMDS_CLK)
2516+
vc4_hdmi->scdc_enabled = true;
25082517

25092518
ret = variant->init_resources(vc4_hdmi);
25102519
if (ret)
@@ -2723,6 +2732,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = {
27232732
.phy_rng_disable = vc5_hdmi_phy_rng_disable,
27242733
.channel_map = vc5_hdmi_channel_map,
27252734
.supports_hdr = true,
2735+
.hp_detect = vc5_hdmi_hp_detect,
27262736
};
27272737

27282738
static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
@@ -2751,6 +2761,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
27512761
.phy_rng_disable = vc5_hdmi_phy_rng_disable,
27522762
.channel_map = vc5_hdmi_channel_map,
27532763
.supports_hdr = true,
2764+
.hp_detect = vc5_hdmi_hp_detect,
27542765
};
27552766

27562767
static const struct of_device_id vc4_hdmi_dt_match[] = {

drivers/gpu/drm/vc4/vc4_hdmi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ struct vc4_hdmi_variant {
102102

103103
/* Enables HDR metadata */
104104
bool supports_hdr;
105+
106+
/* Callback for hardware specific hotplug detect */
107+
bool (*hp_detect)(struct vc4_hdmi *vc4_hdmi);
105108
};
106109

107110
/* HDMI audio information */

drivers/video/fbdev/core/fbcon.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ static void fbcon_init(struct vc_data *vc, int init)
10251025
struct vc_data *svc = *default_mode;
10261026
struct fbcon_display *t, *p = &fb_display[vc->vc_num];
10271027
int logo = 1, new_rows, new_cols, rows, cols;
1028-
int cap, ret;
1028+
int ret;
10291029

10301030
if (WARN_ON(info_idx == -1))
10311031
return;
@@ -1034,7 +1034,6 @@ static void fbcon_init(struct vc_data *vc, int init)
10341034
con2fb_map[vc->vc_num] = info_idx;
10351035

10361036
info = registered_fb[con2fb_map[vc->vc_num]];
1037-
cap = info->flags;
10381037

10391038
if (logo_shown < 0 && console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
10401039
logo_shown = FBCON_LOGO_DONTSHOW;
@@ -1137,8 +1136,8 @@ static void fbcon_init(struct vc_data *vc, int init)
11371136
ops->graphics = 0;
11381137

11391138
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
1140-
if ((cap & FBINFO_HWACCEL_COPYAREA) &&
1141-
!(cap & FBINFO_HWACCEL_DISABLED))
1139+
if ((info->flags & FBINFO_HWACCEL_COPYAREA) &&
1140+
!(info->flags & FBINFO_HWACCEL_DISABLED))
11421141
p->scrollmode = SCROLL_MOVE;
11431142
else /* default to something safe */
11441143
p->scrollmode = SCROLL_REDRAW;

drivers/video/fbdev/core/fbmem.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,8 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
11601160
ret = fbcon_set_con2fb_map_ioctl(argp);
11611161
break;
11621162
case FBIOBLANK:
1163+
if (arg > FB_BLANK_POWERDOWN)
1164+
return -EINVAL;
11631165
console_lock();
11641166
lock_fb_info(info);
11651167
ret = fb_blank(info, arg);

0 commit comments

Comments
 (0)