Skip to content

Commit 3590b44

Browse files
committed
Merge tag 'drm-misc-fixes-2022-07-07-1' of ssh://git.freedesktop.org/git/drm/drm-misc into drm-fixes
Three mode setting fixes for fsl-ldb, a fbdev removal use-after-free fix, a dma-buf fence use-after-free fix, a DMA setup fix for rockchip, an error path fix and memory corruption fix for panfrost and one more orientation quirk Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20220708054306.wr6jcfdunuypftbq@houat
2 parents 42e0a87 + b68277f commit 3590b44

File tree

7 files changed

+39
-24
lines changed

7 files changed

+39
-24
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/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"),

drivers/gpu/drm/panfrost/panfrost_drv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ static int panfrost_ioctl_madvise(struct drm_device *dev, void *data,
433433

434434
if (args->retained) {
435435
if (args->madv == PANFROST_MADV_DONTNEED)
436-
list_add_tail(&bo->base.madv_list,
437-
&pfdev->shrinker_list);
436+
list_move_tail(&bo->base.madv_list,
437+
&pfdev->shrinker_list);
438438
else if (args->madv == PANFROST_MADV_WILLNEED)
439439
list_del_init(&bo->base.madv_list);
440440
}

drivers/gpu/drm/panfrost/panfrost_mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as,
518518
err_pages:
519519
drm_gem_shmem_put_pages(&bo->base);
520520
err_bo:
521-
drm_gem_object_put(&bo->base.base);
521+
panfrost_gem_mapping_put(bomapping);
522522
return ret;
523523
}
524524

drivers/gpu/drm/rockchip/rockchip_drm_drv.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
#include <drm/drm_probe_helper.h>
2424
#include <drm/drm_vblank.h>
2525

26+
#if defined(CONFIG_ARM_DMA_USE_IOMMU)
27+
#include <asm/dma-iommu.h>
28+
#else
29+
#define arm_iommu_detach_device(...) ({ })
30+
#define arm_iommu_release_mapping(...) ({ })
31+
#define to_dma_iommu_mapping(dev) NULL
32+
#endif
33+
2634
#include "rockchip_drm_drv.h"
2735
#include "rockchip_drm_fb.h"
2836
#include "rockchip_drm_gem.h"
@@ -49,6 +57,15 @@ int rockchip_drm_dma_attach_device(struct drm_device *drm_dev,
4957
if (!private->domain)
5058
return 0;
5159

60+
if (IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)) {
61+
struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
62+
63+
if (mapping) {
64+
arm_iommu_detach_device(dev);
65+
arm_iommu_release_mapping(mapping);
66+
}
67+
}
68+
5269
ret = iommu_attach_device(private->domain, dev);
5370
if (ret) {
5471
DRM_DEV_ERROR(dev, "Failed to attach iommu device\n");

drivers/gpu/drm/solomon/ssd130x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static int ssd130x_init(struct ssd130x_device *ssd130x)
350350

351351
/* Set precharge period in number of ticks from the internal clock */
352352
precharge = (SSD130X_SET_PRECHARGE_PERIOD1_SET(ssd130x->prechargep1) |
353-
SSD130X_SET_PRECHARGE_PERIOD1_SET(ssd130x->prechargep2));
353+
SSD130X_SET_PRECHARGE_PERIOD2_SET(ssd130x->prechargep2));
354354
ret = ssd130x_write_cmd(ssd130x, 2, SSD130X_SET_PRECHARGE_PERIOD, precharge);
355355
if (ret < 0)
356356
return ret;

0 commit comments

Comments
 (0)