Skip to content

Commit 6d25ef7

Browse files
committed
Merge tag 'drm-fixes-2020-01-10' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Pre-LCA pull request I'm not sure how things will look next week, myself and Daniel are at LCA and I'm speaking quite late, so if I get my talk finished I'll probably process fixes. This week has a bunch of i915 fixes, some amdgpu fixes, one sun4i, one core MST, and one core fb_helper fix. More details below: core: - mst Fix NO_STOP_BIT bit offset (Wayne) fb_helper: - fb_helper: Fix bits_per_pixel param set behavior to round up (Geert) sun4i: - Fix RGB_DIV clock min divider on old hardware (Chen-Yu) amdgpu: - Stability fix for raven - Reduce pixel encoding to if max clock is exceeded on HDMI to allow additional high res modes - enable DRIVER_SYNCOBJ_TIMELINE for amdgpu i915: - Fix GitLab issue #446 causing GPU hangs: Do not restore invalid RS state - Fix GitLab issue #846: Restore coarse power gating that was disabled by initial RC66 context corruption security fixes. - Revert f6ec948 ("drm/i915: extend audio CDCLK>=2*BCLK constraint to more platforms") to avoid screen flicker - Fix to fill in unitialized uabi_instance in virtual engine uAPI - Add two missing W/As for ICL and EHL" * tag 'drm-fixes-2020-01-10' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: add DRIVER_SYNCOBJ_TIMELINE to amdgpu drm/amd/display: Reduce HDMI pixel encoding if max clock is exceeded Revert "drm/amdgpu: Set no-retry as default." drm/fb-helper: Round up bits_per_pixel if possible drm/sun4i: tcon: Set RGB DCLK min. divider based on hardware model drm/i915/dp: Disable Port sync mode correctly on teardown drm/i915: Add Wa_1407352427:icl,ehl drm/i915: Add Wa_1408615072 and Wa_1407596294 to icl,ehl drm/i915/gt: Restore coarse power gating drm/i915/gt: Do not restore invalid RS state drm/i915: Limit audio CDCLK>=2*BCLK constraint back to GLK only drm/i915/gt: Mark up virtual engine uabi_instance drm/dp_mst: correct the shifting in DP_REMOTE_I2C_READ
2 parents 5e7c1b7 + 023b3b0 commit 6d25ef7

File tree

13 files changed

+85
-61
lines changed

13 files changed

+85
-61
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int amdgpu_async_gfx_ring = 1;
142142
int amdgpu_mcbp = 0;
143143
int amdgpu_discovery = -1;
144144
int amdgpu_mes = 0;
145-
int amdgpu_noretry = 1;
145+
int amdgpu_noretry;
146146
int amdgpu_force_asic_type = -1;
147147

148148
struct amdgpu_mgpu_info mgpu_info = {
@@ -588,7 +588,7 @@ MODULE_PARM_DESC(mes,
588588
module_param_named(mes, amdgpu_mes, int, 0444);
589589

590590
MODULE_PARM_DESC(noretry,
591-
"Disable retry faults (0 = retry enabled, 1 = retry disabled (default))");
591+
"Disable retry faults (0 = retry enabled (default), 1 = retry disabled)");
592592
module_param_named(noretry, amdgpu_noretry, int, 0644);
593593

594594
/**
@@ -1359,7 +1359,8 @@ static struct drm_driver kms_driver = {
13591359
.driver_features =
13601360
DRIVER_USE_AGP | DRIVER_ATOMIC |
13611361
DRIVER_GEM |
1362-
DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ,
1362+
DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ |
1363+
DRIVER_SYNCOBJ_TIMELINE,
13631364
.load = amdgpu_driver_load_kms,
13641365
.open = amdgpu_driver_open_kms,
13651366
.postclose = amdgpu_driver_postclose_kms,

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

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3356,27 +3356,21 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing)
33563356
return color_space;
33573357
}
33583358

3359-
static void reduce_mode_colour_depth(struct dc_crtc_timing *timing_out)
3360-
{
3361-
if (timing_out->display_color_depth <= COLOR_DEPTH_888)
3362-
return;
3363-
3364-
timing_out->display_color_depth--;
3365-
}
3366-
3367-
static void adjust_colour_depth_from_display_info(struct dc_crtc_timing *timing_out,
3368-
const struct drm_display_info *info)
3359+
static bool adjust_colour_depth_from_display_info(
3360+
struct dc_crtc_timing *timing_out,
3361+
const struct drm_display_info *info)
33693362
{
3363+
enum dc_color_depth depth = timing_out->display_color_depth;
33703364
int normalized_clk;
3371-
if (timing_out->display_color_depth <= COLOR_DEPTH_888)
3372-
return;
33733365
do {
33743366
normalized_clk = timing_out->pix_clk_100hz / 10;
33753367
/* YCbCr 4:2:0 requires additional adjustment of 1/2 */
33763368
if (timing_out->pixel_encoding == PIXEL_ENCODING_YCBCR420)
33773369
normalized_clk /= 2;
33783370
/* Adjusting pix clock following on HDMI spec based on colour depth */
3379-
switch (timing_out->display_color_depth) {
3371+
switch (depth) {
3372+
case COLOR_DEPTH_888:
3373+
break;
33803374
case COLOR_DEPTH_101010:
33813375
normalized_clk = (normalized_clk * 30) / 24;
33823376
break;
@@ -3387,14 +3381,15 @@ static void adjust_colour_depth_from_display_info(struct dc_crtc_timing *timing_
33873381
normalized_clk = (normalized_clk * 48) / 24;
33883382
break;
33893383
default:
3390-
return;
3384+
/* The above depths are the only ones valid for HDMI. */
3385+
return false;
33913386
}
3392-
if (normalized_clk <= info->max_tmds_clock)
3393-
return;
3394-
reduce_mode_colour_depth(timing_out);
3395-
3396-
} while (timing_out->display_color_depth > COLOR_DEPTH_888);
3397-
3387+
if (normalized_clk <= info->max_tmds_clock) {
3388+
timing_out->display_color_depth = depth;
3389+
return true;
3390+
}
3391+
} while (--depth > COLOR_DEPTH_666);
3392+
return false;
33983393
}
33993394

34003395
static void fill_stream_properties_from_drm_display_mode(
@@ -3474,8 +3469,14 @@ static void fill_stream_properties_from_drm_display_mode(
34743469

34753470
stream->out_transfer_func->type = TF_TYPE_PREDEFINED;
34763471
stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB;
3477-
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A)
3478-
adjust_colour_depth_from_display_info(timing_out, info);
3472+
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {
3473+
if (!adjust_colour_depth_from_display_info(timing_out, info) &&
3474+
drm_mode_is_420_also(info, mode_in) &&
3475+
timing_out->pixel_encoding != PIXEL_ENCODING_YCBCR420) {
3476+
timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420;
3477+
adjust_colour_depth_from_display_info(timing_out, info);
3478+
}
3479+
}
34793480
}
34803481

34813482
static void fill_audio_info(struct audio_info *audio_info,

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/i915/display/intel_audio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ static unsigned long i915_audio_component_get_power(struct device *kdev)
856856
}
857857

858858
/* Force CDCLK to 2*BCLK as long as we need audio powered. */
859-
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
859+
if (IS_GEMINILAKE(dev_priv))
860860
glk_force_audio_cdclk(dev_priv, true);
861861

862862
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
@@ -875,7 +875,7 @@ static void i915_audio_component_put_power(struct device *kdev,
875875

876876
/* Stop forcing CDCLK to 2*BCLK if no need for audio to be powered. */
877877
if (--dev_priv->audio_power_refcount == 0)
878-
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
878+
if (IS_GEMINILAKE(dev_priv))
879879
glk_force_audio_cdclk(dev_priv, false);
880880

881881
intel_display_power_put(dev_priv, POWER_DOMAIN_AUDIO, cookie);

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4515,19 +4515,14 @@ static void icl_disable_transcoder_port_sync(const struct intel_crtc_state *old_
45154515
{
45164516
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
45174517
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
4518-
i915_reg_t reg;
4519-
u32 trans_ddi_func_ctl2_val;
45204518

45214519
if (old_crtc_state->master_transcoder == INVALID_TRANSCODER)
45224520
return;
45234521

45244522
DRM_DEBUG_KMS("Disabling Transcoder Port Sync on Slave Transcoder %s\n",
45254523
transcoder_name(old_crtc_state->cpu_transcoder));
45264524

4527-
reg = TRANS_DDI_FUNC_CTL2(old_crtc_state->cpu_transcoder);
4528-
trans_ddi_func_ctl2_val = ~(PORT_SYNC_MODE_ENABLE |
4529-
PORT_SYNC_MODE_MASTER_SELECT_MASK);
4530-
I915_WRITE(reg, trans_ddi_func_ctl2_val);
4525+
I915_WRITE(TRANS_DDI_FUNC_CTL2(old_crtc_state->cpu_transcoder), 0);
45314526
}
45324527

45334528
static void intel_fdi_normal_train(struct intel_crtc *crtc)

drivers/gpu/drm/i915/gt/intel_lrc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4416,9 +4416,11 @@ intel_execlists_create_virtual(struct i915_gem_context *ctx,
44164416
ve->base.gt = siblings[0]->gt;
44174417
ve->base.uncore = siblings[0]->uncore;
44184418
ve->base.id = -1;
4419+
44194420
ve->base.class = OTHER_CLASS;
44204421
ve->base.uabi_class = I915_ENGINE_CLASS_INVALID;
44214422
ve->base.instance = I915_ENGINE_CLASS_INVALID_VIRTUAL;
4423+
ve->base.uabi_instance = I915_ENGINE_CLASS_INVALID_VIRTUAL;
44224424

44234425
/*
44244426
* The decision on whether to submit a request using semaphores

drivers/gpu/drm/i915/gt/intel_ring_submission.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,14 +1413,6 @@ static inline int mi_set_context(struct i915_request *rq, u32 flags)
14131413
int len;
14141414
u32 *cs;
14151415

1416-
flags |= MI_MM_SPACE_GTT;
1417-
if (IS_HASWELL(i915))
1418-
/* These flags are for resource streamer on HSW+ */
1419-
flags |= HSW_MI_RS_SAVE_STATE_EN | HSW_MI_RS_RESTORE_STATE_EN;
1420-
else
1421-
/* We need to save the extended state for powersaving modes */
1422-
flags |= MI_SAVE_EXT_STATE_EN | MI_RESTORE_EXT_STATE_EN;
1423-
14241416
len = 4;
14251417
if (IS_GEN(i915, 7))
14261418
len += 2 + (num_engines ? 4 * num_engines + 6 : 0);
@@ -1589,22 +1581,21 @@ static int switch_context(struct i915_request *rq)
15891581
}
15901582

15911583
if (ce->state) {
1592-
u32 hw_flags;
1584+
u32 flags;
15931585

15941586
GEM_BUG_ON(rq->engine->id != RCS0);
15951587

1596-
/*
1597-
* The kernel context(s) is treated as pure scratch and is not
1598-
* expected to retain any state (as we sacrifice it during
1599-
* suspend and on resume it may be corrupted). This is ok,
1600-
* as nothing actually executes using the kernel context; it
1601-
* is purely used for flushing user contexts.
1602-
*/
1603-
hw_flags = 0;
1604-
if (i915_gem_context_is_kernel(rq->gem_context))
1605-
hw_flags = MI_RESTORE_INHIBIT;
1588+
/* For resource streamer on HSW+ and power context elsewhere */
1589+
BUILD_BUG_ON(HSW_MI_RS_SAVE_STATE_EN != MI_SAVE_EXT_STATE_EN);
1590+
BUILD_BUG_ON(HSW_MI_RS_RESTORE_STATE_EN != MI_RESTORE_EXT_STATE_EN);
1591+
1592+
flags = MI_SAVE_EXT_STATE_EN | MI_MM_SPACE_GTT;
1593+
if (!i915_gem_context_is_kernel(rq->gem_context))
1594+
flags |= MI_RESTORE_EXT_STATE_EN;
1595+
else
1596+
flags |= MI_RESTORE_INHIBIT;
16061597

1607-
ret = mi_set_context(rq, hw_flags);
1598+
ret = mi_set_context(rq, flags);
16081599
if (ret)
16091600
return ret;
16101601
}

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,8 +1660,10 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
16601660
(IS_BROADWELL(dev_priv) || IS_GEN(dev_priv, 9))
16611661

16621662
/* WaRsDisableCoarsePowerGating:skl,cnl */
1663-
#define NEEDS_WaRsDisableCoarsePowerGating(dev_priv) \
1664-
(IS_CANNONLAKE(dev_priv) || IS_GEN(dev_priv, 9))
1663+
#define NEEDS_WaRsDisableCoarsePowerGating(dev_priv) \
1664+
(IS_CANNONLAKE(dev_priv) || \
1665+
IS_SKL_GT3(dev_priv) || \
1666+
IS_SKL_GT4(dev_priv))
16651667

16661668
#define HAS_GMBUS_IRQ(dev_priv) (INTEL_GEN(dev_priv) >= 4)
16671669
#define HAS_GMBUS_BURST_READ(dev_priv) (INTEL_GEN(dev_priv) >= 10 || \

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4177,7 +4177,13 @@ enum {
41774177
#define CPSSUNIT_CLKGATE_DIS REG_BIT(9)
41784178

41794179
#define UNSLICE_UNIT_LEVEL_CLKGATE _MMIO(0x9434)
4180-
#define VFUNIT_CLKGATE_DIS (1 << 20)
4180+
#define VFUNIT_CLKGATE_DIS REG_BIT(20)
4181+
#define HSUNIT_CLKGATE_DIS REG_BIT(8)
4182+
#define VSUNIT_CLKGATE_DIS REG_BIT(3)
4183+
4184+
#define UNSLICE_UNIT_LEVEL_CLKGATE2 _MMIO(0x94e4)
4185+
#define VSUNIT_CLKGATE_DIS_TGL REG_BIT(19)
4186+
#define PSDUNIT_CLKGATE_DIS REG_BIT(5)
41814187

41824188
#define INF_UNIT_LEVEL_CLKGATE _MMIO(0x9560)
41834189
#define CGPSF_CLKGATE_DIS (1 << 3)

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6565,6 +6565,17 @@ static void icl_init_clock_gating(struct drm_i915_private *dev_priv)
65656565
/* WaEnable32PlaneMode:icl */
65666566
I915_WRITE(GEN9_CSFE_CHICKEN1_RCS,
65676567
_MASKED_BIT_ENABLE(GEN11_ENABLE_32_PLANE_MODE));
6568+
6569+
/*
6570+
* Wa_1408615072:icl,ehl (vsunit)
6571+
* Wa_1407596294:icl,ehl (hsunit)
6572+
*/
6573+
intel_uncore_rmw(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE,
6574+
0, VSUNIT_CLKGATE_DIS | HSUNIT_CLKGATE_DIS);
6575+
6576+
/* Wa_1407352427:icl,ehl */
6577+
intel_uncore_rmw(&dev_priv->uncore, UNSLICE_UNIT_LEVEL_CLKGATE2,
6578+
0, PSDUNIT_CLKGATE_DIS);
65686579
}
65696580

65706581
static void tgl_init_clock_gating(struct drm_i915_private *dev_priv)

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)