Skip to content

Commit 58890f3

Browse files
committed
Merge tag 'drm-fixes-2019-04-12' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Fixes across the driver spectrum this week, the mediatek fbdev support might be a bit late for this round, but I looked over it and it's not very large and seems like a useful feature for them. Otherwise the main thing is a regression fix for i915 5.0 bug that caused black screens on a bunch of Dell XPS 15s I think, I know at least Fedora is waiting for this to land, and the udl fix is also for a regression since 5.0 where unplugging the device would end badly. core: - make atomic hooks optional i915: - Revert a 5.0 regression where some eDP panels stopped working - DSI related fixes for platforms up to IceLake - GVT (regression fix, warning fix, use-after free fix) amdgpu: - Cursor fixes - missing PCI ID fix for KFD - XGMI fix - shadow buffer handling after reset fix udl: - fix unplugging device crashes. mediatek: - stabilise MT2701 HDMI support - fbdev support tegra: - fix for build regression in rc1. sun4i: - Allwinner A6 max freq improvements - null ptr deref fix dw-hdmi: - SCDC configuration improvements omap: - CEC clock management policy fix" * tag 'drm-fixes-2019-04-12' of git://anongit.freedesktop.org/drm/drm: (32 commits) gpu: host1x: Fix compile error when IOMMU API is not available drm/i915/gvt: Roundup fb->height into tile's height at calucation fb->size drm/i915/dp: revert back to max link rate and lane count on eDP drm/i915/icl: Fix port disable sequence for mipi-dsi drm/i915/icl: Ungate ddi clocks before IO enable drm/mediatek: no change parent rate in round_rate() for MT2701 hdmi phy drm/mediatek: using new factor for tvdpll for MT2701 hdmi phy drm/mediatek: remove flag CLK_SET_RATE_PARENT for MT2701 hdmi phy drm/mediatek: make implementation of recalc_rate() for MT2701 hdmi phy drm/mediatek: fix the rate and divder of hdmi phy for MT2701 drm/mediatek: fix possible object reference leak drm/i915: Get power refs in encoder->get_power_domains() drm/i915: Fix pipe_bpp readout for BXT/GLK DSI drm/amd/display: Fix negative cursor pos programming (v2) drm/sun4i: tcon top: Fix NULL/invalid pointer dereference in sun8i_tcon_top_un/bind drm/udl: add a release method and delay modeset teardown drm/i915/gvt: Prevent use-after-free in ppgtt_free_all_spt() drm/i915/gvt: Annotate iomem usage drm/sun4i: DW HDMI: Lower max. supported rate for H6 Revert "Documentation/gpu/meson: Remove link to meson_canvas.c" ...
2 parents 2d06b23 + 788f07e commit 58890f3

34 files changed

Lines changed: 321 additions & 202 deletions

‎drivers/gpu/drm/amd/amdgpu/amdgpu_device.c‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3173,11 +3173,16 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
31733173
break;
31743174

31753175
if (fence) {
3176-
r = dma_fence_wait_timeout(fence, false, tmo);
3176+
tmo = dma_fence_wait_timeout(fence, false, tmo);
31773177
dma_fence_put(fence);
31783178
fence = next;
3179-
if (r <= 0)
3179+
if (tmo == 0) {
3180+
r = -ETIMEDOUT;
31803181
break;
3182+
} else if (tmo < 0) {
3183+
r = tmo;
3184+
break;
3185+
}
31813186
} else {
31823187
fence = next;
31833188
}
@@ -3188,8 +3193,8 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
31883193
tmo = dma_fence_wait_timeout(fence, false, tmo);
31893194
dma_fence_put(fence);
31903195

3191-
if (r <= 0 || tmo <= 0) {
3192-
DRM_ERROR("recover vram bo from shadow failed\n");
3196+
if (r < 0 || tmo <= 0) {
3197+
DRM_ERROR("recover vram bo from shadow failed, r is %ld, tmo is %ld\n", r, tmo);
31933198
return -EIO;
31943199
}
31953200

‎drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "amdgpu_trace.h"
3636

3737
#define AMDGPU_IB_TEST_TIMEOUT msecs_to_jiffies(1000)
38+
#define AMDGPU_IB_TEST_GFX_XGMI_TIMEOUT msecs_to_jiffies(2000)
3839

3940
/*
4041
* IB
@@ -344,6 +345,8 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev)
344345
* cost waiting for it coming back under RUNTIME only
345346
*/
346347
tmo_gfx = 8 * AMDGPU_IB_TEST_TIMEOUT;
348+
} else if (adev->gmc.xgmi.hive_id) {
349+
tmo_gfx = AMDGPU_IB_TEST_GFX_XGMI_TIMEOUT;
347350
}
348351

349352
for (i = 0; i < adev->num_rings; ++i) {

‎drivers/gpu/drm/amd/amdkfd/kfd_device.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ static const struct kfd_deviceid supported_devices[] = {
320320
{ 0x9876, &carrizo_device_info }, /* Carrizo */
321321
{ 0x9877, &carrizo_device_info }, /* Carrizo */
322322
{ 0x15DD, &raven_device_info }, /* Raven */
323+
{ 0x15D8, &raven_device_info }, /* Raven */
323324
#endif
324325
{ 0x67A0, &hawaii_device_info }, /* Hawaii */
325326
{ 0x67A1, &hawaii_device_info }, /* Hawaii */

‎drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4533,6 +4533,7 @@ static void handle_cursor_update(struct drm_plane *plane,
45334533
amdgpu_crtc->cursor_width = plane->state->crtc_w;
45344534
amdgpu_crtc->cursor_height = plane->state->crtc_h;
45354535

4536+
memset(&attributes, 0, sizeof(attributes));
45364537
attributes.address.high_part = upper_32_bits(address);
45374538
attributes.address.low_part = lower_32_bits(address);
45384539
attributes.width = plane->state->crtc_w;

‎drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c‎

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,28 +1150,9 @@ void hubp1_cursor_set_position(
11501150
REG_UPDATE(CURSOR_CONTROL,
11511151
CURSOR_ENABLE, cur_en);
11521152

1153-
//account for cases where we see negative offset relative to overlay plane
1154-
if (src_x_offset < 0 && src_y_offset < 0) {
1155-
REG_SET_2(CURSOR_POSITION, 0,
1156-
CURSOR_X_POSITION, 0,
1157-
CURSOR_Y_POSITION, 0);
1158-
x_hotspot -= src_x_offset;
1159-
y_hotspot -= src_y_offset;
1160-
} else if (src_x_offset < 0) {
1161-
REG_SET_2(CURSOR_POSITION, 0,
1162-
CURSOR_X_POSITION, 0,
1163-
CURSOR_Y_POSITION, pos->y);
1164-
x_hotspot -= src_x_offset;
1165-
} else if (src_y_offset < 0) {
1166-
REG_SET_2(CURSOR_POSITION, 0,
1153+
REG_SET_2(CURSOR_POSITION, 0,
11671154
CURSOR_X_POSITION, pos->x,
1168-
CURSOR_Y_POSITION, 0);
1169-
y_hotspot -= src_y_offset;
1170-
} else {
1171-
REG_SET_2(CURSOR_POSITION, 0,
1172-
CURSOR_X_POSITION, pos->x,
1173-
CURSOR_Y_POSITION, pos->y);
1174-
}
1155+
CURSOR_Y_POSITION, pos->y);
11751156

11761157
REG_SET_2(CURSOR_HOT_SPOT, 0,
11771158
CURSOR_HOT_SPOT_X, x_hotspot,

‎drivers/gpu/drm/bridge/synopsys/dw-hdmi.c‎

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,31 @@ void dw_hdmi_phy_i2c_write(struct dw_hdmi *hdmi, unsigned short data,
10371037
}
10381038
EXPORT_SYMBOL_GPL(dw_hdmi_phy_i2c_write);
10391039

1040+
/* Filter out invalid setups to avoid configuring SCDC and scrambling */
1041+
static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi)
1042+
{
1043+
struct drm_display_info *display = &hdmi->connector.display_info;
1044+
1045+
/* Completely disable SCDC support for older controllers */
1046+
if (hdmi->version < 0x200a)
1047+
return false;
1048+
1049+
/* Disable if SCDC is not supported, or if an HF-VSDB block is absent */
1050+
if (!display->hdmi.scdc.supported ||
1051+
!display->hdmi.scdc.scrambling.supported)
1052+
return false;
1053+
1054+
/*
1055+
* Disable if display only support low TMDS rates and scrambling
1056+
* for low rates is not supported either
1057+
*/
1058+
if (!display->hdmi.scdc.scrambling.low_rates &&
1059+
display->max_tmds_clock <= 340000)
1060+
return false;
1061+
1062+
return true;
1063+
}
1064+
10401065
/*
10411066
* HDMI2.0 Specifies the following procedure for High TMDS Bit Rates:
10421067
* - The Source shall suspend transmission of the TMDS clock and data
@@ -1055,7 +1080,7 @@ void dw_hdmi_set_high_tmds_clock_ratio(struct dw_hdmi *hdmi)
10551080
unsigned long mtmdsclock = hdmi->hdmi_data.video_mode.mtmdsclock;
10561081

10571082
/* Control for TMDS Bit Period/TMDS Clock-Period Ratio */
1058-
if (hdmi->connector.display_info.hdmi.scdc.supported) {
1083+
if (dw_hdmi_support_scdc(hdmi)) {
10591084
if (mtmdsclock > HDMI14_MAX_TMDSCLK)
10601085
drm_scdc_set_high_tmds_clock_ratio(hdmi->ddc, 1);
10611086
else
@@ -1579,8 +1604,9 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
15791604

15801605
/* Set up HDMI_FC_INVIDCONF */
15811606
inv_val = (hdmi->hdmi_data.hdcp_enable ||
1582-
vmode->mtmdsclock > HDMI14_MAX_TMDSCLK ||
1583-
hdmi_info->scdc.scrambling.low_rates ?
1607+
(dw_hdmi_support_scdc(hdmi) &&
1608+
(vmode->mtmdsclock > HDMI14_MAX_TMDSCLK ||
1609+
hdmi_info->scdc.scrambling.low_rates)) ?
15841610
HDMI_FC_INVIDCONF_HDCP_KEEPOUT_ACTIVE :
15851611
HDMI_FC_INVIDCONF_HDCP_KEEPOUT_INACTIVE);
15861612

@@ -1646,7 +1672,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
16461672
}
16471673

16481674
/* Scrambling Control */
1649-
if (hdmi_info->scdc.supported) {
1675+
if (dw_hdmi_support_scdc(hdmi)) {
16501676
if (vmode->mtmdsclock > HDMI14_MAX_TMDSCLK ||
16511677
hdmi_info->scdc.scrambling.low_rates) {
16521678
/*

‎drivers/gpu/drm/drm_atomic_helper.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
10341034
funcs->atomic_disable(crtc, old_crtc_state);
10351035
else if (funcs->disable)
10361036
funcs->disable(crtc);
1037-
else
1037+
else if (funcs->dpms)
10381038
funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
10391039

10401040
if (!(dev->irq_enabled && dev->num_crtcs))
@@ -1277,10 +1277,9 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev,
12771277
if (new_crtc_state->enable) {
12781278
DRM_DEBUG_ATOMIC("enabling [CRTC:%d:%s]\n",
12791279
crtc->base.id, crtc->name);
1280-
12811280
if (funcs->atomic_enable)
12821281
funcs->atomic_enable(crtc, old_crtc_state);
1283-
else
1282+
else if (funcs->commit)
12841283
funcs->commit(crtc);
12851284
}
12861285
}

‎drivers/gpu/drm/i915/gvt/dmabuf.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static int vgpu_get_plane_info(struct drm_device *dev,
209209
struct drm_i915_private *dev_priv = to_i915(dev);
210210
struct intel_vgpu_primary_plane_format p;
211211
struct intel_vgpu_cursor_plane_format c;
212-
int ret;
212+
int ret, tile_height = 1;
213213

214214
if (plane_id == DRM_PLANE_TYPE_PRIMARY) {
215215
ret = intel_vgpu_decode_primary_plane(vgpu, &p);
@@ -228,12 +228,15 @@ static int vgpu_get_plane_info(struct drm_device *dev,
228228
break;
229229
case PLANE_CTL_TILED_X:
230230
info->drm_format_mod = I915_FORMAT_MOD_X_TILED;
231+
tile_height = 8;
231232
break;
232233
case PLANE_CTL_TILED_Y:
233234
info->drm_format_mod = I915_FORMAT_MOD_Y_TILED;
235+
tile_height = 32;
234236
break;
235237
case PLANE_CTL_TILED_YF:
236238
info->drm_format_mod = I915_FORMAT_MOD_Yf_TILED;
239+
tile_height = 32;
237240
break;
238241
default:
239242
gvt_vgpu_err("invalid tiling mode: %x\n", p.tiled);
@@ -264,8 +267,8 @@ static int vgpu_get_plane_info(struct drm_device *dev,
264267
return -EINVAL;
265268
}
266269

267-
info->size = (info->stride * info->height + PAGE_SIZE - 1)
268-
>> PAGE_SHIFT;
270+
info->size = (info->stride * roundup(info->height, tile_height)
271+
+ PAGE_SIZE - 1) >> PAGE_SHIFT;
269272
if (info->size == 0) {
270273
gvt_vgpu_err("fb size is zero\n");
271274
return -EINVAL;

‎drivers/gpu/drm/i915/gvt/gtt.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,14 +750,20 @@ static void ppgtt_free_spt(struct intel_vgpu_ppgtt_spt *spt)
750750

751751
static void ppgtt_free_all_spt(struct intel_vgpu *vgpu)
752752
{
753-
struct intel_vgpu_ppgtt_spt *spt;
753+
struct intel_vgpu_ppgtt_spt *spt, *spn;
754754
struct radix_tree_iter iter;
755-
void **slot;
755+
LIST_HEAD(all_spt);
756+
void __rcu **slot;
756757

758+
rcu_read_lock();
757759
radix_tree_for_each_slot(slot, &vgpu->gtt.spt_tree, &iter, 0) {
758760
spt = radix_tree_deref_slot(slot);
759-
ppgtt_free_spt(spt);
761+
list_move(&spt->post_shadow_list, &all_spt);
760762
}
763+
rcu_read_unlock();
764+
765+
list_for_each_entry_safe(spt, spn, &all_spt, post_shadow_list)
766+
ppgtt_free_spt(spt);
761767
}
762768

763769
static int ppgtt_handle_guest_write_page_table_bytes(

‎drivers/gpu/drm/i915/gvt/kvmgt.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ static inline bool intel_vgpu_in_aperture(struct intel_vgpu *vgpu, u64 off)
905905
static int intel_vgpu_aperture_rw(struct intel_vgpu *vgpu, u64 off,
906906
void *buf, unsigned long count, bool is_write)
907907
{
908-
void *aperture_va;
908+
void __iomem *aperture_va;
909909

910910
if (!intel_vgpu_in_aperture(vgpu, off) ||
911911
!intel_vgpu_in_aperture(vgpu, off + count)) {
@@ -920,9 +920,9 @@ static int intel_vgpu_aperture_rw(struct intel_vgpu *vgpu, u64 off,
920920
return -EIO;
921921

922922
if (is_write)
923-
memcpy(aperture_va + offset_in_page(off), buf, count);
923+
memcpy_toio(aperture_va + offset_in_page(off), buf, count);
924924
else
925-
memcpy(buf, aperture_va + offset_in_page(off), count);
925+
memcpy_fromio(buf, aperture_va + offset_in_page(off), count);
926926

927927
io_mapping_unmap(aperture_va);
928928

0 commit comments

Comments
 (0)