Skip to content

Commit 2985156

Browse files
committed
Merge tag 'drm-fixes-2022-07-12' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "I see you picked up one of the fbdev fixes, this is the other stuff that was queued up last week. A bit of a scattering of fixes, three for i915, one amdgpu, and a couple of panfrost, rockchip, panel and bridge ones. amdgpu: - Hibernation fix dma-buf: - fix use after free of fence i915: - Fix a possible refcount leak in DP MST connector (Hangyu) - Fix on loading guc on ADL-N (Daniele) - Fix vm use-after-free in vma destruction (Thomas) bridge: - fsl-ldb : 3 LVDS modesetting fixes rockchip: - iommu domain fix panfrost: - fix memory corruption - error path fix panel: - orientation quirk fix for Yoga tablet 2 ssd130x: - fix pre-charge period setting" * tag 'drm-fixes-2022-07-12' of git://anongit.freedesktop.org/drm/drm: drm/ssd130x: Fix pre-charge period setting dma-buf: Fix one use-after-free of fence drm/i915: Fix vm use-after-free in vma destruction drm/i915/guc: ADL-N should use the same GuC FW as ADL-S drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector() drm/amdgpu/display: disable prefer_shadow for generic fb helpers drm/amdgpu: keep fbdev buffers pinned during suspend drm/panfrost: Fix shrinker list corruption by madvise IOCTL drm/panfrost: Put mapping instead of shmem obj on panfrost_mmu_map_fault_addr() error drm/rockchip: Detach from ARM DMA domain in attach_device drm/bridge: fsl-ldb: Drop DE signal polarity inversion drm/bridge: fsl-ldb: Enable split mode for LVDS dual link drm/bridge: fsl-ldb: Fix mode clock rate validation drm/aperture: Run fbdev removal before internal helpers drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Tablet 2 830
2 parents 0d8ba24 + 3590b44 commit 2985156

File tree

17 files changed

+90
-38
lines changed

17 files changed

+90
-38
lines changed

drivers/dma-buf/dma-resv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ void dma_resv_replace_fences(struct dma_resv *obj, uint64_t context,
343343
if (old->context != context)
344344
continue;
345345

346-
dma_resv_list_set(list, i, replacement, usage);
346+
dma_resv_list_set(list, i, dma_fence_get(replacement), usage);
347347
dma_fence_put(old);
348348
}
349349
}

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,21 @@ bool amdgpu_crtc_get_scanout_position(struct drm_crtc *crtc,
15281528
stime, etime, mode);
15291529
}
15301530

1531+
static bool
1532+
amdgpu_display_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj)
1533+
{
1534+
struct drm_device *dev = adev_to_drm(adev);
1535+
struct drm_fb_helper *fb_helper = dev->fb_helper;
1536+
1537+
if (!fb_helper || !fb_helper->buffer)
1538+
return false;
1539+
1540+
if (gem_to_amdgpu_bo(fb_helper->buffer->gem) != robj)
1541+
return false;
1542+
1543+
return true;
1544+
}
1545+
15311546
int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
15321547
{
15331548
struct drm_device *dev = adev_to_drm(adev);
@@ -1563,10 +1578,12 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
15631578
continue;
15641579
}
15651580
robj = gem_to_amdgpu_bo(fb->obj[0]);
1566-
r = amdgpu_bo_reserve(robj, true);
1567-
if (r == 0) {
1568-
amdgpu_bo_unpin(robj);
1569-
amdgpu_bo_unreserve(robj);
1581+
if (!amdgpu_display_robj_is_fb(adev, robj)) {
1582+
r = amdgpu_bo_reserve(robj, true);
1583+
if (r == 0) {
1584+
amdgpu_bo_unpin(robj);
1585+
amdgpu_bo_unreserve(robj);
1586+
}
15701587
}
15711588
}
15721589
return 0;

drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ static int amdgpu_vkms_sw_init(void *handle)
496496
adev_to_drm(adev)->mode_config.max_height = YRES_MAX;
497497

498498
adev_to_drm(adev)->mode_config.preferred_depth = 24;
499-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
499+
/* disable prefer shadow for now due to hibernation issues */
500+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
500501

501502
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
502503

drivers/gpu/drm/amd/amdgpu/dce_v10_0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2796,7 +2796,8 @@ static int dce_v10_0_sw_init(void *handle)
27962796
adev_to_drm(adev)->mode_config.max_height = 16384;
27972797

27982798
adev_to_drm(adev)->mode_config.preferred_depth = 24;
2799-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
2799+
/* disable prefer shadow for now due to hibernation issues */
2800+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
28002801

28012802
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
28022803

drivers/gpu/drm/amd/amdgpu/dce_v11_0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,8 @@ static int dce_v11_0_sw_init(void *handle)
29142914
adev_to_drm(adev)->mode_config.max_height = 16384;
29152915

29162916
adev_to_drm(adev)->mode_config.preferred_depth = 24;
2917-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
2917+
/* disable prefer shadow for now due to hibernation issues */
2918+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
29182919

29192920
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
29202921

drivers/gpu/drm/amd/amdgpu/dce_v6_0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2673,7 +2673,8 @@ static int dce_v6_0_sw_init(void *handle)
26732673
adev_to_drm(adev)->mode_config.max_width = 16384;
26742674
adev_to_drm(adev)->mode_config.max_height = 16384;
26752675
adev_to_drm(adev)->mode_config.preferred_depth = 24;
2676-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
2676+
/* disable prefer shadow for now due to hibernation issues */
2677+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
26772678
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
26782679
adev_to_drm(adev)->mode_config.fb_base = adev->gmc.aper_base;
26792680

drivers/gpu/drm/amd/amdgpu/dce_v8_0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2693,7 +2693,8 @@ static int dce_v8_0_sw_init(void *handle)
26932693
adev_to_drm(adev)->mode_config.max_height = 16384;
26942694

26952695
adev_to_drm(adev)->mode_config.preferred_depth = 24;
2696-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
2696+
/* disable prefer shadow for now due to hibernation issues */
2697+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
26972698

26982699
adev_to_drm(adev)->mode_config.fb_modifiers_not_supported = true;
26992700

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3822,7 +3822,8 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev)
38223822
adev_to_drm(adev)->mode_config.max_height = 16384;
38233823

38243824
adev_to_drm(adev)->mode_config.preferred_depth = 24;
3825-
adev_to_drm(adev)->mode_config.prefer_shadow = 1;
3825+
/* disable prefer shadow for now due to hibernation issues */
3826+
adev_to_drm(adev)->mode_config.prefer_shadow = 0;
38263827
/* indicates support for immediate flip */
38273828
adev_to_drm(adev)->mode_config.async_page_flip = true;
38283829

drivers/gpu/drm/bridge/fsl-ldb.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,6 @@ static int fsl_ldb_attach(struct drm_bridge *bridge,
7474
bridge, flags);
7575
}
7676

77-
static int fsl_ldb_atomic_check(struct drm_bridge *bridge,
78-
struct drm_bridge_state *bridge_state,
79-
struct drm_crtc_state *crtc_state,
80-
struct drm_connector_state *conn_state)
81-
{
82-
/* Invert DE signal polarity. */
83-
bridge_state->input_bus_cfg.flags &= ~(DRM_BUS_FLAG_DE_LOW |
84-
DRM_BUS_FLAG_DE_HIGH);
85-
if (bridge_state->output_bus_cfg.flags & DRM_BUS_FLAG_DE_LOW)
86-
bridge_state->input_bus_cfg.flags |= DRM_BUS_FLAG_DE_HIGH;
87-
else if (bridge_state->output_bus_cfg.flags & DRM_BUS_FLAG_DE_HIGH)
88-
bridge_state->input_bus_cfg.flags |= DRM_BUS_FLAG_DE_LOW;
89-
90-
return 0;
91-
}
92-
9377
static void fsl_ldb_atomic_enable(struct drm_bridge *bridge,
9478
struct drm_bridge_state *old_bridge_state)
9579
{
@@ -153,7 +137,7 @@ static void fsl_ldb_atomic_enable(struct drm_bridge *bridge,
153137
reg = LDB_CTRL_CH0_ENABLE;
154138

155139
if (fsl_ldb->lvds_dual_link)
156-
reg |= LDB_CTRL_CH1_ENABLE;
140+
reg |= LDB_CTRL_CH1_ENABLE | LDB_CTRL_SPLIT_MODE;
157141

158142
if (lvds_format_24bpp) {
159143
reg |= LDB_CTRL_CH0_DATA_WIDTH;
@@ -233,15 +217,14 @@ fsl_ldb_mode_valid(struct drm_bridge *bridge,
233217
{
234218
struct fsl_ldb *fsl_ldb = to_fsl_ldb(bridge);
235219

236-
if (mode->clock > (fsl_ldb->lvds_dual_link ? 80000 : 160000))
220+
if (mode->clock > (fsl_ldb->lvds_dual_link ? 160000 : 80000))
237221
return MODE_CLOCK_HIGH;
238222

239223
return MODE_OK;
240224
}
241225

242226
static const struct drm_bridge_funcs funcs = {
243227
.attach = fsl_ldb_attach,
244-
.atomic_check = fsl_ldb_atomic_check,
245228
.atomic_enable = fsl_ldb_atomic_enable,
246229
.atomic_disable = fsl_ldb_atomic_disable,
247230
.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,

drivers/gpu/drm/drm_panel_orientation_quirks.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,21 @@ static const struct dmi_system_id orientation_data[] = {
286286
DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"),
287287
},
288288
.driver_data = (void *)&lcd1200x1920_rightside_up,
289+
}, { /* Lenovo Yoga Tablet 2 830F / 830L */
290+
.matches = {
291+
/*
292+
* Note this also matches the Lenovo Yoga Tablet 2 1050F/L
293+
* since that uses the same mainboard. The resolution match
294+
* will limit this to only matching on the 830F/L. Neither has
295+
* any external video outputs so those are not a concern.
296+
*/
297+
DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
298+
DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
299+
DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
300+
/* Partial match on beginning of BIOS version */
301+
DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"),
302+
},
303+
.driver_data = (void *)&lcd1200x1920_rightside_up,
289304
}, { /* OneGX1 Pro */
290305
.matches = {
291306
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SYSTEM_MANUFACTURER"),

0 commit comments

Comments
 (0)