Skip to content

Commit 2c3addd

Browse files
committed
Merge tag 'drm-misc-fixes-2020-01-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
mst: Fix NO_STOP_BIT bit offset (Wayne) sun4i: Fix RGB_DIV clock min divider on old hardware (Chen-Yu) fb_helper: Fix bits_per_pixel param set behavior to round up (Geert) Cc: Wayne Lin <[email protected]> Cc: Chen-Yu Tsai <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Signed-off-by: Dave Airlie <[email protected]> From: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20200108205949.GA233273@art_vandelay
2 parents c79f46a + f30e277 commit 2c3addd

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

drivers/gpu/drm/drm_dp_mst_topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ drm_dp_encode_sideband_req(const struct drm_dp_sideband_msg_req_body *req,
393393
memcpy(&buf[idx], req->u.i2c_read.transactions[i].bytes, req->u.i2c_read.transactions[i].num_bytes);
394394
idx += req->u.i2c_read.transactions[i].num_bytes;
395395

396-
buf[idx] = (req->u.i2c_read.transactions[i].no_stop_bit & 0x1) << 5;
396+
buf[idx] = (req->u.i2c_read.transactions[i].no_stop_bit & 0x1) << 4;
397397
buf[idx] |= (req->u.i2c_read.transactions[i].i2c_transaction_delay & 0xf);
398398
idx++;
399399
}

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
12831283
* Changes struct fb_var_screeninfo are currently not pushed back
12841284
* to KMS, hence fail if different settings are requested.
12851285
*/
1286-
if (var->bits_per_pixel != fb->format->cpp[0] * 8 ||
1286+
if (var->bits_per_pixel > fb->format->cpp[0] * 8 ||
12871287
var->xres > fb->width || var->yres > fb->height ||
12881288
var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
12891289
DRM_DEBUG("fb requested width/height/bpp can't fit in current fb "
@@ -1308,6 +1308,11 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
13081308
drm_fb_helper_fill_pixel_fmt(var, fb->format->depth);
13091309
}
13101310

1311+
/*
1312+
* Likewise, bits_per_pixel should be rounded up to a supported value.
1313+
*/
1314+
var->bits_per_pixel = fb->format->cpp[0] * 8;
1315+
13111316
/*
13121317
* drm fbdev emulation doesn't support changing the pixel format at all,
13131318
* so reject all pixel format changing requests.

drivers/gpu/drm/sun4i/sun4i_tcon.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
489489

490490
WARN_ON(!tcon->quirks->has_channel_0);
491491

492-
tcon->dclk_min_div = 1;
492+
tcon->dclk_min_div = tcon->quirks->dclk_min_div;
493493
tcon->dclk_max_div = 127;
494494
sun4i_tcon0_mode_set_common(tcon, mode);
495495

@@ -1426,12 +1426,14 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
14261426
static const struct sun4i_tcon_quirks sun4i_a10_quirks = {
14271427
.has_channel_0 = true,
14281428
.has_channel_1 = true,
1429+
.dclk_min_div = 4,
14291430
.set_mux = sun4i_a10_tcon_set_mux,
14301431
};
14311432

14321433
static const struct sun4i_tcon_quirks sun5i_a13_quirks = {
14331434
.has_channel_0 = true,
14341435
.has_channel_1 = true,
1436+
.dclk_min_div = 4,
14351437
.set_mux = sun5i_a13_tcon_set_mux,
14361438
};
14371439

@@ -1440,30 +1442,35 @@ static const struct sun4i_tcon_quirks sun6i_a31_quirks = {
14401442
.has_channel_1 = true,
14411443
.has_lvds_alt = true,
14421444
.needs_de_be_mux = true,
1445+
.dclk_min_div = 1,
14431446
.set_mux = sun6i_tcon_set_mux,
14441447
};
14451448

14461449
static const struct sun4i_tcon_quirks sun6i_a31s_quirks = {
14471450
.has_channel_0 = true,
14481451
.has_channel_1 = true,
14491452
.needs_de_be_mux = true,
1453+
.dclk_min_div = 1,
14501454
};
14511455

14521456
static const struct sun4i_tcon_quirks sun7i_a20_quirks = {
14531457
.has_channel_0 = true,
14541458
.has_channel_1 = true,
1459+
.dclk_min_div = 4,
14551460
/* Same display pipeline structure as A10 */
14561461
.set_mux = sun4i_a10_tcon_set_mux,
14571462
};
14581463

14591464
static const struct sun4i_tcon_quirks sun8i_a33_quirks = {
14601465
.has_channel_0 = true,
14611466
.has_lvds_alt = true,
1467+
.dclk_min_div = 1,
14621468
};
14631469

14641470
static const struct sun4i_tcon_quirks sun8i_a83t_lcd_quirks = {
14651471
.supports_lvds = true,
14661472
.has_channel_0 = true,
1473+
.dclk_min_div = 1,
14671474
};
14681475

14691476
static const struct sun4i_tcon_quirks sun8i_a83t_tv_quirks = {
@@ -1477,11 +1484,13 @@ static const struct sun4i_tcon_quirks sun8i_r40_tv_quirks = {
14771484

14781485
static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
14791486
.has_channel_0 = true,
1487+
.dclk_min_div = 1,
14801488
};
14811489

14821490
static const struct sun4i_tcon_quirks sun9i_a80_tcon_lcd_quirks = {
1483-
.has_channel_0 = true,
1484-
.needs_edp_reset = true,
1491+
.has_channel_0 = true,
1492+
.needs_edp_reset = true,
1493+
.dclk_min_div = 1,
14851494
};
14861495

14871496
static const struct sun4i_tcon_quirks sun9i_a80_tcon_tv_quirks = {

drivers/gpu/drm/sun4i/sun4i_tcon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ struct sun4i_tcon_quirks {
224224
bool needs_de_be_mux; /* sun6i needs mux to select backend */
225225
bool needs_edp_reset; /* a80 edp reset needed for tcon0 access */
226226
bool supports_lvds; /* Does the TCON support an LVDS output? */
227+
u8 dclk_min_div; /* minimum divider for TCON0 DCLK */
227228

228229
/* callback to handle tcon muxing options */
229230
int (*set_mux)(struct sun4i_tcon *, const struct drm_encoder *);

0 commit comments

Comments
 (0)