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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'drm-fixes-for-v4.17-rc8' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
"A few final fixes:

i915:
- fix for potential Spectre vector in the new query uAPI
- fix NULL pointer deref (FDO #106559)
- DMI fix to hide LVDS for Radiant P845 (FDO #105468)

amdgpu:
- suspend/resume DC regression fix
- underscan flicker fix on fiji
- gamma setting fix after dpms

omap:
- fix oops regression

core:
- fix PSR timing

dw-hdmi:
- fix oops regression"

* tag 'drm-fixes-for-v4.17-rc8' of git://people.freedesktop.org/~airlied/linux:
drm/amd/display: Update color props when modeset is required
drm/amd/display: Make atomic-check validate underscan changes
drm/bridge/synopsys: dw-hdmi: fix dw_hdmi_setup_rx_sense
drm/amd/display: Fix BUG_ON during CRTC atomic check update
drm/i915/query: nospec expects no more than an unsigned long
drm/i915/query: Protect tainted function pointer lookup
drm/i915/lvds: Move acpi lid notification registration to registration phase
drm/i915: Disable LVDS on Radiant P845
drm/omap: fix NULL deref crash with SDI displays
drm/psr: Fix missed entry in PSR setup time table.

+91 -44
+29 -15
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 4555 4555 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { 4556 4556 struct amdgpu_crtc *acrtc = NULL; 4557 4557 struct amdgpu_dm_connector *aconnector = NULL; 4558 - struct drm_connector_state *new_con_state = NULL; 4559 - struct dm_connector_state *dm_conn_state = NULL; 4558 + struct drm_connector_state *drm_new_conn_state = NULL, *drm_old_conn_state = NULL; 4559 + struct dm_connector_state *dm_new_conn_state = NULL, *dm_old_conn_state = NULL; 4560 4560 struct drm_plane_state *new_plane_state = NULL; 4561 4561 4562 4562 new_stream = NULL; ··· 4577 4577 /* TODO This hack should go away */ 4578 4578 if (aconnector && enable) { 4579 4579 // Make sure fake sink is created in plug-in scenario 4580 - new_con_state = drm_atomic_get_connector_state(state, 4580 + drm_new_conn_state = drm_atomic_get_new_connector_state(state, 4581 4581 &aconnector->base); 4582 + drm_old_conn_state = drm_atomic_get_old_connector_state(state, 4583 + &aconnector->base); 4582 4584 4583 - if (IS_ERR(new_con_state)) { 4584 - ret = PTR_ERR_OR_ZERO(new_con_state); 4585 + 4586 + if (IS_ERR(drm_new_conn_state)) { 4587 + ret = PTR_ERR_OR_ZERO(drm_new_conn_state); 4585 4588 break; 4586 4589 } 4587 4590 4588 - dm_conn_state = to_dm_connector_state(new_con_state); 4591 + dm_new_conn_state = to_dm_connector_state(drm_new_conn_state); 4592 + dm_old_conn_state = to_dm_connector_state(drm_old_conn_state); 4589 4593 4590 4594 new_stream = create_stream_for_sink(aconnector, 4591 4595 &new_crtc_state->mode, 4592 - dm_conn_state); 4596 + dm_new_conn_state); 4593 4597 4594 4598 /* 4595 4599 * we can have no stream on ACTION_SET if a display ··· 4699 4695 * We want to do dc stream updates that do not require a 4700 4696 * full modeset below. 4701 4697 */ 4702 - if (!enable || !aconnector || modereset_required(new_crtc_state)) 4698 + if (!(enable && aconnector && new_crtc_state->enable && 4699 + new_crtc_state->active)) 4703 4700 continue; 4704 4701 /* 4705 4702 * Given above conditions, the dc state cannot be NULL because: 4706 - * 1. We're attempting to enable a CRTC. Which has a... 4707 - * 2. Valid connector attached, and 4708 - * 3. User does not want to reset it (disable or mark inactive, 4709 - * which can happen on a CRTC that's already disabled). 4710 - * => It currently exists. 4703 + * 1. We're in the process of enabling CRTCs (just been added 4704 + * to the dc context, or already is on the context) 4705 + * 2. Has a valid connector attached, and 4706 + * 3. Is currently active and enabled. 4707 + * => The dc stream state currently exists. 4711 4708 */ 4712 4709 BUG_ON(dm_new_crtc_state->stream == NULL); 4713 4710 4714 - /* Color managment settings */ 4715 - if (dm_new_crtc_state->base.color_mgmt_changed) { 4711 + /* Scaling or underscan settings */ 4712 + if (is_scaling_state_different(dm_old_conn_state, dm_new_conn_state)) 4713 + update_stream_scaling_settings( 4714 + &new_crtc_state->mode, dm_new_conn_state, dm_new_crtc_state->stream); 4715 + 4716 + /* 4717 + * Color management settings. We also update color properties 4718 + * when a modeset is needed, to ensure it gets reprogrammed. 4719 + */ 4720 + if (dm_new_crtc_state->base.color_mgmt_changed || 4721 + drm_atomic_crtc_needs_modeset(new_crtc_state)) { 4716 4722 ret = amdgpu_dm_set_regamma_lut(dm_new_crtc_state); 4717 4723 if (ret) 4718 4724 goto fail;
+4 -11
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
··· 2077 2077 return ret; 2078 2078 } 2079 2079 2080 - void __dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense) 2080 + void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense) 2081 2081 { 2082 2082 mutex_lock(&hdmi->mutex); 2083 2083 ··· 2102 2102 dw_hdmi_update_phy_mask(hdmi); 2103 2103 } 2104 2104 mutex_unlock(&hdmi->mutex); 2105 - } 2106 - 2107 - void dw_hdmi_setup_rx_sense(struct device *dev, bool hpd, bool rx_sense) 2108 - { 2109 - struct dw_hdmi *hdmi = dev_get_drvdata(dev); 2110 - 2111 - __dw_hdmi_setup_rx_sense(hdmi, hpd, rx_sense); 2112 2105 } 2113 2106 EXPORT_SYMBOL_GPL(dw_hdmi_setup_rx_sense); 2114 2107 ··· 2138 2145 */ 2139 2146 if (intr_stat & 2140 2147 (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD)) { 2141 - __dw_hdmi_setup_rx_sense(hdmi, 2142 - phy_stat & HDMI_PHY_HPD, 2143 - phy_stat & HDMI_PHY_RX_SENSE); 2148 + dw_hdmi_setup_rx_sense(hdmi, 2149 + phy_stat & HDMI_PHY_HPD, 2150 + phy_stat & HDMI_PHY_RX_SENSE); 2144 2151 2145 2152 if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) 2146 2153 cec_notifier_set_phys_addr(hdmi->cec_notifier,
+1
drivers/gpu/drm/drm_dp_helper.c
··· 1145 1145 static const u16 psr_setup_time_us[] = { 1146 1146 PSR_SETUP_TIME(330), 1147 1147 PSR_SETUP_TIME(275), 1148 + PSR_SETUP_TIME(220), 1148 1149 PSR_SETUP_TIME(165), 1149 1150 PSR_SETUP_TIME(110), 1150 1151 PSR_SETUP_TIME(55),
+11 -4
drivers/gpu/drm/i915/i915_query.c
··· 4 4 * Copyright © 2018 Intel Corporation 5 5 */ 6 6 7 + #include <linux/nospec.h> 8 + 7 9 #include "i915_drv.h" 8 10 #include "i915_query.h" 9 11 #include <uapi/drm/i915_drm.h> ··· 102 100 103 101 for (i = 0; i < args->num_items; i++, user_item_ptr++) { 104 102 struct drm_i915_query_item item; 105 - u64 func_idx; 103 + unsigned long func_idx; 106 104 int ret; 107 105 108 106 if (copy_from_user(&item, user_item_ptr, sizeof(item))) ··· 111 109 if (item.query_id == 0) 112 110 return -EINVAL; 113 111 112 + if (overflows_type(item.query_id - 1, unsigned long)) 113 + return -EINVAL; 114 + 114 115 func_idx = item.query_id - 1; 115 116 116 - if (func_idx < ARRAY_SIZE(i915_query_funcs)) 117 + ret = -EINVAL; 118 + if (func_idx < ARRAY_SIZE(i915_query_funcs)) { 119 + func_idx = array_index_nospec(func_idx, 120 + ARRAY_SIZE(i915_query_funcs)); 117 121 ret = i915_query_funcs[func_idx](dev_priv, &item); 118 - else 119 - ret = -EINVAL; 122 + } 120 123 121 124 /* Only write the length back to userspace if they differ. */ 122 125 if (ret != item.length && put_user(ret, &user_item_ptr->length))
+40 -11
drivers/gpu/drm/i915/intel_lvds.c
··· 574 574 return NOTIFY_OK; 575 575 } 576 576 577 + static int 578 + intel_lvds_connector_register(struct drm_connector *connector) 579 + { 580 + struct intel_lvds_connector *lvds = to_lvds_connector(connector); 581 + int ret; 582 + 583 + ret = intel_connector_register(connector); 584 + if (ret) 585 + return ret; 586 + 587 + lvds->lid_notifier.notifier_call = intel_lid_notify; 588 + if (acpi_lid_notifier_register(&lvds->lid_notifier)) { 589 + DRM_DEBUG_KMS("lid notifier registration failed\n"); 590 + lvds->lid_notifier.notifier_call = NULL; 591 + } 592 + 593 + return 0; 594 + } 595 + 596 + static void 597 + intel_lvds_connector_unregister(struct drm_connector *connector) 598 + { 599 + struct intel_lvds_connector *lvds = to_lvds_connector(connector); 600 + 601 + if (lvds->lid_notifier.notifier_call) 602 + acpi_lid_notifier_unregister(&lvds->lid_notifier); 603 + 604 + intel_connector_unregister(connector); 605 + } 606 + 577 607 /** 578 608 * intel_lvds_destroy - unregister and free LVDS structures 579 609 * @connector: connector to free ··· 615 585 { 616 586 struct intel_lvds_connector *lvds_connector = 617 587 to_lvds_connector(connector); 618 - 619 - if (lvds_connector->lid_notifier.notifier_call) 620 - acpi_lid_notifier_unregister(&lvds_connector->lid_notifier); 621 588 622 589 if (!IS_ERR_OR_NULL(lvds_connector->base.edid)) 623 590 kfree(lvds_connector->base.edid); ··· 636 609 .fill_modes = drm_helper_probe_single_connector_modes, 637 610 .atomic_get_property = intel_digital_connector_atomic_get_property, 638 611 .atomic_set_property = intel_digital_connector_atomic_set_property, 639 - .late_register = intel_connector_register, 640 - .early_unregister = intel_connector_unregister, 612 + .late_register = intel_lvds_connector_register, 613 + .early_unregister = intel_lvds_connector_unregister, 641 614 .destroy = intel_lvds_destroy, 642 615 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, 643 616 .atomic_duplicate_state = intel_digital_connector_duplicate_state, ··· 852 825 .matches = { 853 826 DMI_MATCH(DMI_BOARD_VENDOR, "Intel"), 854 827 DMI_EXACT_MATCH(DMI_BOARD_NAME, "D525MW"), 828 + }, 829 + }, 830 + { 831 + .callback = intel_no_lvds_dmi_callback, 832 + .ident = "Radiant P845", 833 + .matches = { 834 + DMI_MATCH(DMI_SYS_VENDOR, "Radiant Systems Inc"), 835 + DMI_MATCH(DMI_PRODUCT_NAME, "P845"), 855 836 }, 856 837 }, 857 838 ··· 1184 1149 lvds_encoder->is_dual_link ? "dual" : "single"); 1185 1150 1186 1151 lvds_encoder->a3_power = lvds & LVDS_A3_POWER_MASK; 1187 - 1188 - lvds_connector->lid_notifier.notifier_call = intel_lid_notify; 1189 - if (acpi_lid_notifier_register(&lvds_connector->lid_notifier)) { 1190 - DRM_DEBUG_KMS("lid notifier registration failed\n"); 1191 - lvds_connector->lid_notifier.notifier_call = NULL; 1192 - } 1193 1152 1194 1153 return; 1195 1154
+1 -1
drivers/gpu/drm/meson/meson_dw_hdmi.c
··· 529 529 if (stat & HDMITX_TOP_INTR_HPD_RISE) 530 530 hpd_connected = true; 531 531 532 - dw_hdmi_setup_rx_sense(dw_hdmi->dev, hpd_connected, 532 + dw_hdmi_setup_rx_sense(dw_hdmi->hdmi, hpd_connected, 533 533 hpd_connected); 534 534 535 535 drm_helper_hpd_irq_event(dw_hdmi->encoder.dev);
+4 -1
drivers/gpu/drm/omapdrm/dss/sdi.c
··· 82 82 struct dispc_clock_info *dispc_cinfo) 83 83 { 84 84 int i; 85 - struct sdi_clk_calc_ctx ctx = { .sdi = sdi }; 85 + struct sdi_clk_calc_ctx ctx; 86 86 87 87 /* 88 88 * DSS fclk gives us very few possibilities, so finding a good pixel ··· 95 95 bool ok; 96 96 97 97 memset(&ctx, 0, sizeof(ctx)); 98 + 99 + ctx.sdi = sdi; 100 + 98 101 if (pclk > 1000 * i * i * i) 99 102 ctx.pck_min = max(pclk - 1000 * i * i * i, 0lu); 100 103 else
+1 -1
include/drm/bridge/dw_hdmi.h
··· 151 151 struct drm_encoder *encoder, 152 152 const struct dw_hdmi_plat_data *plat_data); 153 153 154 - void dw_hdmi_setup_rx_sense(struct device *dev, bool hpd, bool rx_sense); 154 + void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense); 155 155 156 156 void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate); 157 157 void dw_hdmi_audio_enable(struct dw_hdmi *hdmi);