Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/YgTf1Zsflzq3JSFo@linux-uq9g

+48 -25
+6
MAINTAINERS
··· 7575 7575 W: http://floatingpoint.sourceforge.net/emulator/index.html 7576 7576 F: arch/x86/math-emu/ 7577 7577 7578 + FRAMEBUFFER CORE 7579 + M: Daniel Vetter <daniel@ffwll.ch> 7580 + F: drivers/video/fbdev/core/ 7581 + S: Odd Fixes 7582 + T: git git://anongit.freedesktop.org/drm/drm-misc 7583 + 7578 7584 FRAMEBUFFER LAYER 7579 7585 M: Helge Deller <deller@gmx.de> 7580 7586 L: linux-fbdev@vger.kernel.org
+1 -1
drivers/gpu/drm/drm_privacy_screen.c
··· 269 269 * 270 270 * The notifier is called with no locks held. The new hw_state and sw_state 271 271 * 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`` 273 273 * argument of the notifier_block's notifier_call. 274 274 * 275 275 * The notifier will NOT be called when changes are made through
+1
drivers/gpu/drm/panel/panel-simple.c
··· 588 588 err = panel_dpi_probe(dev, panel); 589 589 if (err) 590 590 goto free_ddc; 591 + desc = panel->desc; 591 592 } else { 592 593 if (!of_get_display_timing(dev->of_node, "panel-timing", &dt)) 593 594 panel_simple_parse_panel_timing_node(dev, panel, &dt);
+7 -7
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
··· 529 529 return ret; 530 530 } 531 531 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 - 539 532 hdmi->phy = devm_phy_optional_get(dev, "hdmi"); 540 533 if (IS_ERR(hdmi->phy)) { 541 534 ret = PTR_ERR(hdmi->phy); 542 535 if (ret != -EPROBE_DEFER) 543 536 DRM_DEV_ERROR(hdmi->dev, "failed to get phy\n"); 537 + return ret; 538 + } 539 + 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 544 return ret; 545 545 } 546 546
+5 -3
drivers/gpu/drm/rockchip/rockchip_vop_reg.c
··· 902 902 .enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0), 903 903 .format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1), 904 904 .rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12), 905 + .x_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 21), 905 906 .y_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 22), 906 907 .act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0), 907 908 .dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0), ··· 913 912 .uv_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 16), 914 913 .src_alpha_ctl = VOP_REG(RK3288_WIN0_SRC_ALPHA_CTRL, 0xff, 0), 915 914 .dst_alpha_ctl = VOP_REG(RK3288_WIN0_DST_ALPHA_CTRL, 0xff, 0), 915 + .channel = VOP_REG(RK3288_WIN0_CTRL2, 0xff, 0), 916 916 }; 917 917 918 918 /* ··· 924 922 static const struct vop_win_data rk3399_vop_win_data[] = { 925 923 { .base = 0x00, .phy = &rk3399_win01_data, 926 924 .type = DRM_PLANE_TYPE_PRIMARY }, 927 - { .base = 0x40, .phy = &rk3288_win01_data, 925 + { .base = 0x40, .phy = &rk3368_win01_data, 928 926 .type = DRM_PLANE_TYPE_OVERLAY }, 929 - { .base = 0x00, .phy = &rk3288_win23_data, 927 + { .base = 0x00, .phy = &rk3368_win23_data, 930 928 .type = DRM_PLANE_TYPE_OVERLAY }, 931 - { .base = 0x50, .phy = &rk3288_win23_data, 929 + { .base = 0x50, .phy = &rk3368_win23_data, 932 930 .type = DRM_PLANE_TYPE_CURSOR }, 933 931 }; 934 932
-1
drivers/gpu/drm/vc4/vc4_crtc.c
··· 671 671 const struct drm_display_mode *mode = &crtc_state->adjusted_mode; 672 672 struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); 673 673 674 - mode = &crtc_state->adjusted_mode; 675 674 if (vc4_encoder->type == VC4_ENCODER_TYPE_HDMI0) { 676 675 vc4_state->hvs_load = max(mode->clock * mode->hdisplay / mode->htotal + 1000, 677 676 mode->clock * 9 / 10) * 1000;
+20 -9
drivers/gpu/drm/vc4/vc4_hdmi.c
··· 196 196 if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) 197 197 connected = true; 198 198 } 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)) 207 201 connected = true; 208 202 } 209 203 ··· 1245 1251 unsigned long long tmds_rate; 1246 1252 1247 1253 if (vc4_hdmi->variant->unsupported_odd_h_timings && 1254 + !(mode->flags & DRM_MODE_FLAG_DBLCLK) && 1248 1255 ((mode->hdisplay % 2) || (mode->hsync_start % 2) || 1249 1256 (mode->hsync_end % 2) || (mode->htotal % 2))) 1250 1257 return -EINVAL; ··· 1293 1298 struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); 1294 1299 1295 1300 if (vc4_hdmi->variant->unsupported_odd_h_timings && 1301 + !(mode->flags & DRM_MODE_FLAG_DBLCLK) && 1296 1302 ((mode->hdisplay % 2) || (mode->hsync_start % 2) || 1297 1303 (mode->hsync_end % 2) || (mode->htotal % 2))) 1298 1304 return MODE_H_ILLEGAL; ··· 1337 1341 channel_map |= i << (4 * i); 1338 1342 } 1339 1343 return channel_map; 1344 + } 1345 + 1346 + static bool vc5_hdmi_hp_detect(struct vc4_hdmi *vc4_hdmi) 1347 + { 1348 + unsigned long flags; 1349 + u32 hotplug; 1350 + 1351 + spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); 1352 + hotplug = HDMI_READ(HDMI_HOTPLUG); 1353 + spin_unlock_irqrestore(&vc4_hdmi->hw_lock, flags); 1354 + 1355 + return !!(hotplug & VC4_HDMI_HOTPLUG_CONNECTED); 1340 1356 } 1341 1357 1342 1358 /* HDMI audio codec callbacks */ ··· 2512 2504 * vc4_hdmi_disable_scrambling() will thus run at boot, make 2513 2505 * sure it's disabled, and avoid any inconsistency. 2514 2506 */ 2515 - vc4_hdmi->scdc_enabled = true; 2507 + if (variant->max_pixel_clock > HDMI_14_MAX_TMDS_CLK) 2508 + vc4_hdmi->scdc_enabled = true; 2516 2509 2517 2510 ret = variant->init_resources(vc4_hdmi); 2518 2511 if (ret) ··· 2732 2723 .phy_rng_disable = vc5_hdmi_phy_rng_disable, 2733 2724 .channel_map = vc5_hdmi_channel_map, 2734 2725 .supports_hdr = true, 2726 + .hp_detect = vc5_hdmi_hp_detect, 2735 2727 }; 2736 2728 2737 2729 static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { ··· 2761 2751 .phy_rng_disable = vc5_hdmi_phy_rng_disable, 2762 2752 .channel_map = vc5_hdmi_channel_map, 2763 2753 .supports_hdr = true, 2754 + .hp_detect = vc5_hdmi_hp_detect, 2764 2755 }; 2765 2756 2766 2757 static const struct of_device_id vc4_hdmi_dt_match[] = {
+3
drivers/gpu/drm/vc4/vc4_hdmi.h
··· 102 102 103 103 /* Enables HDR metadata */ 104 104 bool supports_hdr; 105 + 106 + /* Callback for hardware specific hotplug detect */ 107 + bool (*hp_detect)(struct vc4_hdmi *vc4_hdmi); 105 108 }; 106 109 107 110 /* HDMI audio information */
+3 -4
drivers/video/fbdev/core/fbcon.c
··· 1025 1025 struct vc_data *svc = *default_mode; 1026 1026 struct fbcon_display *t, *p = &fb_display[vc->vc_num]; 1027 1027 int logo = 1, new_rows, new_cols, rows, cols; 1028 - int cap, ret; 1028 + int ret; 1029 1029 1030 1030 if (WARN_ON(info_idx == -1)) 1031 1031 return; ··· 1034 1034 con2fb_map[vc->vc_num] = info_idx; 1035 1035 1036 1036 info = registered_fb[con2fb_map[vc->vc_num]]; 1037 - cap = info->flags; 1038 1037 1039 1038 if (logo_shown < 0 && console_loglevel <= CONSOLE_LOGLEVEL_QUIET) 1040 1039 logo_shown = FBCON_LOGO_DONTSHOW; ··· 1136 1137 ops->graphics = 0; 1137 1138 1138 1139 #ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION 1139 - if ((cap & FBINFO_HWACCEL_COPYAREA) && 1140 - !(cap & FBINFO_HWACCEL_DISABLED)) 1140 + if ((info->flags & FBINFO_HWACCEL_COPYAREA) && 1141 + !(info->flags & FBINFO_HWACCEL_DISABLED)) 1141 1142 p->scrollmode = SCROLL_MOVE; 1142 1143 else /* default to something safe */ 1143 1144 p->scrollmode = SCROLL_REDRAW;
+2
drivers/video/fbdev/core/fbmem.c
··· 1160 1160 ret = fbcon_set_con2fb_map_ioctl(argp); 1161 1161 break; 1162 1162 case FBIOBLANK: 1163 + if (arg > FB_BLANK_POWERDOWN) 1164 + return -EINVAL; 1163 1165 console_lock(); 1164 1166 lock_fb_info(info); 1165 1167 ret = fb_blank(info, arg);