Skip to content

Commit a4a2739

Browse files
committed
Merge tag 'drm-misc-fixes-2020-07-28' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
* drm: fix possible use-after-free * dbi: fix SPI Type 1 transfer * drm_fb_helper: use memcpy_io on bochs' sparc64 * mcde: fix stability * panel: fix display noise on auo,kd101n80-45na * panel: delay HPD checks for boe_nv133fhm_n61 * bridge: drop connector check in nwl-dsi bridge * bridge: set proper bridge type for adv7511 * of: fix a double free Signed-off-by: Dave Airlie <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20200728110446.GA8076@linux-uq9g
2 parents 0d78698 + 8490d6a commit a4a2739

File tree

11 files changed

+51
-23
lines changed

11 files changed

+51
-23
lines changed

drivers/gpu/drm/bochs/bochs_kms.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ int bochs_kms_init(struct bochs_device *bochs)
146146
bochs->dev->mode_config.preferred_depth = 24;
147147
bochs->dev->mode_config.prefer_shadow = 0;
148148
bochs->dev->mode_config.prefer_shadow_fbdev = 1;
149+
bochs->dev->mode_config.fbdev_use_iomem = true;
149150
bochs->dev->mode_config.quirk_addfb_prefer_host_byte_order = true;
150151

151152
bochs->dev->mode_config.funcs = &bochs_mode_funcs;

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,7 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
12241224

12251225
adv7511->bridge.funcs = &adv7511_bridge_funcs;
12261226
adv7511->bridge.of_node = dev->of_node;
1227+
adv7511->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
12271228

12281229
drm_bridge_add(&adv7511->bridge);
12291230

drivers/gpu/drm/bridge/nwl-dsi.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -917,11 +917,6 @@ static int nwl_dsi_bridge_attach(struct drm_bridge *bridge,
917917
struct drm_panel *panel;
918918
int ret;
919919

920-
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
921-
DRM_ERROR("Fix bridge driver to make connector optional!");
922-
return -EINVAL;
923-
}
924-
925920
ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel,
926921
&panel_bridge);
927922
if (ret)

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ static void drm_fb_helper_dirty_blit_real(struct drm_fb_helper *fb_helper,
399399
unsigned int y;
400400

401401
for (y = clip->y1; y < clip->y2; y++) {
402-
memcpy(dst, src, len);
402+
if (!fb_helper->dev->mode_config.fbdev_use_iomem)
403+
memcpy(dst, src, len);
404+
else
405+
memcpy_toio((void __iomem *)dst, src, len);
406+
403407
src += fb->pitches[0];
404408
dst += fb->pitches[0];
405409
}

drivers/gpu/drm/drm_gem.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -871,9 +871,6 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
871871
* @file_priv: drm file-private structure
872872
*
873873
* Open an object using the global name, returning a handle and the size.
874-
*
875-
* This handle (of course) holds a reference to the object, so the object
876-
* will not go away until the handle is deleted.
877874
*/
878875
int
879876
drm_gem_open_ioctl(struct drm_device *dev, void *data,
@@ -898,14 +895,15 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data,
898895

899896
/* drm_gem_handle_create_tail unlocks dev->object_name_lock. */
900897
ret = drm_gem_handle_create_tail(file_priv, obj, &handle);
901-
drm_gem_object_put_unlocked(obj);
902898
if (ret)
903-
return ret;
899+
goto err;
904900

905901
args->handle = handle;
906902
args->size = obj->size;
907903

908-
return 0;
904+
err:
905+
drm_gem_object_put_unlocked(obj);
906+
return ret;
909907
}
910908

911909
/**

drivers/gpu/drm/drm_mipi_dbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *dbi, int dc,
923923
}
924924
}
925925

926-
tr.len = chunk;
926+
tr.len = chunk * 2;
927927
len -= chunk;
928928

929929
ret = spi_sync(spi, &m);

drivers/gpu/drm/drm_of.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,8 @@ static int drm_of_lvds_get_remote_pixels_type(
322322
* configurations by passing the endpoints explicitly to
323323
* drm_of_lvds_get_dual_link_pixel_order().
324324
*/
325-
if (!current_pt || pixels_type != current_pt) {
326-
of_node_put(remote_port);
325+
if (!current_pt || pixels_type != current_pt)
327326
return -EINVAL;
328-
}
329327
}
330328

331329
return pixels_type;

drivers/gpu/drm/mcde/mcde_display.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,9 +1060,14 @@ static void mcde_display_update(struct drm_simple_display_pipe *pipe,
10601060
*/
10611061
if (fb) {
10621062
mcde_set_extsrc(mcde, drm_fb_cma_get_gem_addr(fb, pstate, 0));
1063-
if (!mcde->video_mode)
1064-
/* Send a single frame using software sync */
1065-
mcde_display_send_one_frame(mcde);
1063+
if (!mcde->video_mode) {
1064+
/*
1065+
* Send a single frame using software sync if the flow
1066+
* is not active yet.
1067+
*/
1068+
if (mcde->flow_active == 0)
1069+
mcde_display_send_one_frame(mcde);
1070+
}
10661071
dev_info_once(mcde->dev, "sent first display update\n");
10671072
} else {
10681073
/*

drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -615,9 +615,9 @@ static const struct panel_desc boe_tv101wum_nl6_desc = {
615615
static const struct drm_display_mode auo_kd101n80_45na_default_mode = {
616616
.clock = 157000,
617617
.hdisplay = 1200,
618-
.hsync_start = 1200 + 80,
619-
.hsync_end = 1200 + 80 + 24,
620-
.htotal = 1200 + 80 + 24 + 36,
618+
.hsync_start = 1200 + 60,
619+
.hsync_end = 1200 + 60 + 24,
620+
.htotal = 1200 + 60 + 24 + 56,
621621
.vdisplay = 1920,
622622
.vsync_start = 1920 + 16,
623623
.vsync_end = 1920 + 16 + 4,

drivers/gpu/drm/panel/panel-simple.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,21 @@ static const struct panel_desc boe_nv133fhm_n61 = {
12501250
.height = 165,
12511251
},
12521252
.delay = {
1253-
.hpd_absent_delay = 200,
1253+
/*
1254+
* When power is first given to the panel there's a short
1255+
* spike on the HPD line. It was explained that this spike
1256+
* was until the TCON data download was complete. On
1257+
* one system this was measured at 8 ms. We'll put 15 ms
1258+
* in the prepare delay just to be safe and take it away
1259+
* from the hpd_absent_delay (which would otherwise be 200 ms)
1260+
* to handle this. That means:
1261+
* - If HPD isn't hooked up you still have 200 ms delay.
1262+
* - If HPD is hooked up we won't try to look at it for the
1263+
* first 15 ms.
1264+
*/
1265+
.prepare = 15,
1266+
.hpd_absent_delay = 185,
1267+
12541268
.unprepare = 500,
12551269
},
12561270
.bus_format = MEDIA_BUS_FMT_RGB888_1X24,

0 commit comments

Comments
 (0)