Skip to content

Commit cb0d93a

Browse files
committed
Merge tag 'drm-fixes-for-4.8-rc2' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "This contains a bunch of amdgpu fixes, and some i915 regression fixes. It also contains some fixes for an older regression with some EDID changes and some 6bpc panels. Then there are the lockdep, cirrus and rcar-du regression fixes from this window" * tag 'drm-fixes-for-4.8-rc2' of git://people.freedesktop.org/~airlied/linux: drm/cirrus: Fix NULL pointer dereference when registering the fbdev drm/edid: Set 8 bpc color depth for displays with "DFP 1.x compliant TMDS". drm/i915/dp: Revert "drm/i915/dp: fall back to 18 bpp when sink capability is unknown" drm/edid: Add 6 bpc quirk for display AEO model 0. drm: Paper over locking inversion after registration rework drm: rcar-du: Link HDMI encoder with bridge drm/ttm: Wait for a BO to become idle before unbinding it from GTT drm/i915/fbdev: Check for the framebuffer before use drm/amdgpu: update golden setting of polaris10 drm/amdgpu: update golden setting of stoney drm/amdgpu: update golden setting of polaris11 drm/amdgpu: update golden setting of carrizo drm/amdgpu: update golden setting of iceland drm/amd/amdgpu: change pptable output format from ASCII to binary drm/amdgpu/ci: add mullins to default case for smc ucode drm/amdgpu/gmc7: add missing mullins case drm/i915: Never fully mask the the EI up rps interrupt on SNB/IVB drm/i915: Wait up to 3ms for the pcu to ack the cdclk change request on SKL
2 parents a3d1ddd + 36e9d08 commit cb0d93a

File tree

18 files changed

+95
-64
lines changed

18 files changed

+95
-64
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static ssize_t amdgpu_get_pp_table(struct device *dev,
305305
struct drm_device *ddev = dev_get_drvdata(dev);
306306
struct amdgpu_device *adev = ddev->dev_private;
307307
char *table = NULL;
308-
int size, i;
308+
int size;
309309

310310
if (adev->pp_enabled)
311311
size = amdgpu_dpm_get_pp_table(adev, &table);
@@ -315,10 +315,7 @@ static ssize_t amdgpu_get_pp_table(struct device *dev,
315315
if (size >= PAGE_SIZE)
316316
size = PAGE_SIZE - 1;
317317

318-
for (i = 0; i < size; i++) {
319-
sprintf(buf + i, "%02x", table[i]);
320-
}
321-
sprintf(buf + i, "\n");
318+
memcpy(buf, table, size);
322319

323320
return size;
324321
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo,
335335
if (unlikely(r)) {
336336
goto out_cleanup;
337337
}
338-
r = ttm_bo_move_ttm(bo, true, no_wait_gpu, new_mem);
338+
r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, new_mem);
339339
out_cleanup:
340340
ttm_bo_mem_put(bo, &tmp_mem);
341341
return r;
@@ -368,7 +368,7 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo,
368368
if (unlikely(r)) {
369369
return r;
370370
}
371-
r = ttm_bo_move_ttm(bo, true, no_wait_gpu, &tmp_mem);
371+
r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, &tmp_mem);
372372
if (unlikely(r)) {
373373
goto out_cleanup;
374374
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5779,6 +5779,7 @@ static int ci_dpm_init_microcode(struct amdgpu_device *adev)
57795779
break;
57805780
case CHIP_KAVERI:
57815781
case CHIP_KABINI:
5782+
case CHIP_MULLINS:
57825783
default: BUG();
57835784
}
57845785

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ static const u32 tonga_mgcg_cgcg_init[] =
270270

271271
static const u32 golden_settings_polaris11_a11[] =
272272
{
273-
mmCB_HW_CONTROL, 0xfffdf3cf, 0x00006208,
273+
mmCB_HW_CONTROL, 0x0000f3cf, 0x00007208,
274+
mmCB_HW_CONTROL_2, 0x0f000000, 0x0f000000,
274275
mmCB_HW_CONTROL_3, 0x000001ff, 0x00000040,
275276
mmDB_DEBUG2, 0xf00fffff, 0x00000400,
276277
mmPA_SC_ENHANCE, 0xffffffff, 0x20000001,
@@ -279,7 +280,7 @@ static const u32 golden_settings_polaris11_a11[] =
279280
mmPA_SC_RASTER_CONFIG_1, 0x0000003f, 0x00000000,
280281
mmRLC_CGCG_CGLS_CTRL, 0x00000003, 0x0001003c,
281282
mmRLC_CGCG_CGLS_CTRL_3D, 0xffffffff, 0x0001003c,
282-
mmSQ_CONFIG, 0x07f80000, 0x07180000,
283+
mmSQ_CONFIG, 0x07f80000, 0x01180000,
283284
mmTA_CNTL_AUX, 0x000f000f, 0x000b0000,
284285
mmTCC_CTRL, 0x00100000, 0xf31fff7f,
285286
mmTCP_ADDR_CONFIG, 0x000003ff, 0x000000f3,
@@ -301,8 +302,8 @@ static const u32 polaris11_golden_common_all[] =
301302
static const u32 golden_settings_polaris10_a11[] =
302303
{
303304
mmATC_MISC_CG, 0x000c0fc0, 0x000c0200,
304-
mmCB_HW_CONTROL, 0xfffdf3cf, 0x00007208,
305-
mmCB_HW_CONTROL_2, 0, 0x0f000000,
305+
mmCB_HW_CONTROL, 0x0001f3cf, 0x00007208,
306+
mmCB_HW_CONTROL_2, 0x0f000000, 0x0f000000,
306307
mmCB_HW_CONTROL_3, 0x000001ff, 0x00000040,
307308
mmDB_DEBUG2, 0xf00fffff, 0x00000400,
308309
mmPA_SC_ENHANCE, 0xffffffff, 0x20000001,
@@ -409,6 +410,7 @@ static const u32 golden_settings_iceland_a11[] =
409410
mmPA_SC_LINE_STIPPLE_STATE, 0x0000ff0f, 0x00000000,
410411
mmPA_SC_RASTER_CONFIG, 0x3f3fffff, 0x00000002,
411412
mmPA_SC_RASTER_CONFIG_1, 0x0000003f, 0x00000000,
413+
mmRLC_CGCG_CGLS_CTRL, 0x00000003, 0x0000003c,
412414
mmSQ_RANDOM_WAVE_PRI, 0x001fffff, 0x000006fd,
413415
mmTA_CNTL_AUX, 0x000f000f, 0x000b0000,
414416
mmTCC_CTRL, 0x00100000, 0xf31fff7f,
@@ -505,8 +507,10 @@ static const u32 cz_golden_settings_a11[] =
505507
mmGB_GPU_ID, 0x0000000f, 0x00000000,
506508
mmPA_SC_ENHANCE, 0xffffffff, 0x00000001,
507509
mmPA_SC_LINE_STIPPLE_STATE, 0x0000ff0f, 0x00000000,
510+
mmRLC_CGCG_CGLS_CTRL, 0x00000003, 0x0000003c,
508511
mmSQ_RANDOM_WAVE_PRI, 0x001fffff, 0x000006fd,
509512
mmTA_CNTL_AUX, 0x000f000f, 0x00010000,
513+
mmTCC_CTRL, 0x00100000, 0xf31fff7f,
510514
mmTCC_EXE_DISABLE, 0x00000002, 0x00000002,
511515
mmTCP_ADDR_CONFIG, 0x0000000f, 0x000000f3,
512516
mmTCP_CHAN_STEER_LO, 0xffffffff, 0x00001302

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ static int gmc_v7_0_init_microcode(struct amdgpu_device *adev)
144144
break;
145145
case CHIP_KAVERI:
146146
case CHIP_KABINI:
147+
case CHIP_MULLINS:
147148
return 0;
148149
default: BUG();
149150
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ static const u32 stoney_mgcg_cgcg_init[] =
103103
mmMC_MEM_POWER_LS, 0xffffffff, 0x00000104
104104
};
105105

106+
static const u32 golden_settings_stoney_common[] =
107+
{
108+
mmMC_HUB_RDREQ_UVD, MC_HUB_RDREQ_UVD__PRESCALE_MASK, 0x00000004,
109+
mmMC_RD_GRP_OTH, MC_RD_GRP_OTH__UVD_MASK, 0x00600000
110+
};
106111

107112
static void gmc_v8_0_init_golden_registers(struct amdgpu_device *adev)
108113
{
@@ -142,6 +147,9 @@ static void gmc_v8_0_init_golden_registers(struct amdgpu_device *adev)
142147
amdgpu_program_register_sequence(adev,
143148
stoney_mgcg_cgcg_init,
144149
(const u32)ARRAY_SIZE(stoney_mgcg_cgcg_init));
150+
amdgpu_program_register_sequence(adev,
151+
golden_settings_stoney_common,
152+
(const u32)ARRAY_SIZE(golden_settings_stoney_common));
145153
break;
146154
default:
147155
break;

drivers/gpu/drm/cirrus/cirrus_main.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,23 @@ int cirrus_driver_load(struct drm_device *dev, unsigned long flags)
185185
goto out;
186186
}
187187

188+
/*
189+
* cirrus_modeset_init() is initializing/registering the emulated fbdev
190+
* and DRM internals can access/test some of the fields in
191+
* mode_config->funcs as part of the fbdev registration process.
192+
* Make sure dev->mode_config.funcs is properly set to avoid
193+
* dereferencing a NULL pointer.
194+
* FIXME: mode_config.funcs assignment should probably be done in
195+
* cirrus_modeset_init() (that's a common pattern seen in other DRM
196+
* drivers).
197+
*/
198+
dev->mode_config.funcs = &cirrus_mode_funcs;
188199
r = cirrus_modeset_init(cdev);
189200
if (r) {
190201
dev_err(&dev->pdev->dev, "Fatal error during modeset init: %d\n", r);
191202
goto out;
192203
}
193204

194-
dev->mode_config.funcs = (void *)&cirrus_mode_funcs;
195-
196205
return 0;
197206
out:
198207
cirrus_driver_unload(dev);

drivers/gpu/drm/drm_crtc.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,16 +1121,14 @@ static int drm_connector_register_all(struct drm_device *dev)
11211121
struct drm_connector *connector;
11221122
int ret;
11231123

1124-
mutex_lock(&dev->mode_config.mutex);
1125-
1126-
drm_for_each_connector(connector, dev) {
1124+
/* FIXME: taking the mode config mutex ends up in a clash with
1125+
* fbcon/backlight registration */
1126+
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
11271127
ret = drm_connector_register(connector);
11281128
if (ret)
11291129
goto err;
11301130
}
11311131

1132-
mutex_unlock(&dev->mode_config.mutex);
1133-
11341132
return 0;
11351133

11361134
err:

drivers/gpu/drm/drm_edid.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
#define EDID_QUIRK_FORCE_8BPC (1 << 8)
7575
/* Force 12bpc */
7676
#define EDID_QUIRK_FORCE_12BPC (1 << 9)
77+
/* Force 6bpc */
78+
#define EDID_QUIRK_FORCE_6BPC (1 << 10)
7779

7880
struct detailed_mode_closure {
7981
struct drm_connector *connector;
@@ -100,6 +102,9 @@ static struct edid_quirk {
100102
/* Unknown Acer */
101103
{ "ACR", 2423, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
102104

105+
/* AEO model 0 reports 8 bpc, but is a 6 bpc panel */
106+
{ "AEO", 0, EDID_QUIRK_FORCE_6BPC },
107+
103108
/* Belinea 10 15 55 */
104109
{ "MAX", 1516, EDID_QUIRK_PREFER_LARGE_60 },
105110
{ "MAX", 0x77e, EDID_QUIRK_PREFER_LARGE_60 },
@@ -3862,6 +3867,20 @@ static void drm_add_display_info(struct edid *edid,
38623867
/* HDMI deep color modes supported? Assign to info, if so */
38633868
drm_assign_hdmi_deep_color_info(edid, info, connector);
38643869

3870+
/*
3871+
* Digital sink with "DFP 1.x compliant TMDS" according to EDID 1.3?
3872+
*
3873+
* For such displays, the DFP spec 1.0, section 3.10 "EDID support"
3874+
* tells us to assume 8 bpc color depth if the EDID doesn't have
3875+
* extensions which tell otherwise.
3876+
*/
3877+
if ((info->bpc == 0) && (edid->revision < 4) &&
3878+
(edid->input & DRM_EDID_DIGITAL_TYPE_DVI)) {
3879+
info->bpc = 8;
3880+
DRM_DEBUG("%s: Assigning DFP sink color depth as %d bpc.\n",
3881+
connector->name, info->bpc);
3882+
}
3883+
38653884
/* Only defined for 1.4 with digital displays */
38663885
if (edid->revision < 4)
38673886
return;
@@ -4082,6 +4101,9 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
40824101

40834102
drm_add_display_info(edid, &connector->display_info, connector);
40844103

4104+
if (quirks & EDID_QUIRK_FORCE_6BPC)
4105+
connector->display_info.bpc = 6;
4106+
40854107
if (quirks & EDID_QUIRK_FORCE_8BPC)
40864108
connector->display_info.bpc = 8;
40874109

drivers/gpu/drm/i915/intel_display.c

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5691,15 +5691,7 @@ static bool skl_cdclk_pcu_ready(struct drm_i915_private *dev_priv)
56915691

56925692
static bool skl_cdclk_wait_for_pcu_ready(struct drm_i915_private *dev_priv)
56935693
{
5694-
unsigned int i;
5695-
5696-
for (i = 0; i < 15; i++) {
5697-
if (skl_cdclk_pcu_ready(dev_priv))
5698-
return true;
5699-
udelay(10);
5700-
}
5701-
5702-
return false;
5694+
return _wait_for(skl_cdclk_pcu_ready(dev_priv), 3000, 10) == 0;
57035695
}
57045696

57055697
static void skl_set_cdclk(struct drm_i915_private *dev_priv, int cdclk, int vco)
@@ -12114,21 +12106,11 @@ connected_sink_compute_bpp(struct intel_connector *connector,
1211412106
pipe_config->pipe_bpp = connector->base.display_info.bpc*3;
1211512107
}
1211612108

12117-
/* Clamp bpp to default limit on screens without EDID 1.4 */
12118-
if (connector->base.display_info.bpc == 0) {
12119-
int type = connector->base.connector_type;
12120-
int clamp_bpp = 24;
12121-
12122-
/* Fall back to 18 bpp when DP sink capability is unknown. */
12123-
if (type == DRM_MODE_CONNECTOR_DisplayPort ||
12124-
type == DRM_MODE_CONNECTOR_eDP)
12125-
clamp_bpp = 18;
12126-
12127-
if (bpp > clamp_bpp) {
12128-
DRM_DEBUG_KMS("clamping display bpp (was %d) to default limit of %d\n",
12129-
bpp, clamp_bpp);
12130-
pipe_config->pipe_bpp = clamp_bpp;
12131-
}
12109+
/* Clamp bpp to 8 on screens without EDID 1.4 */
12110+
if (connector->base.display_info.bpc == 0 && bpp > 24) {
12111+
DRM_DEBUG_KMS("clamping display bpp (was %d) to default limit of 24\n",
12112+
bpp);
12113+
pipe_config->pipe_bpp = 24;
1213212114
}
1213312115
}
1213412116

drivers/gpu/drm/i915/intel_fbdev.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
782782
struct intel_fbdev *ifbdev = dev_priv->fbdev;
783783
struct fb_info *info;
784784

785-
if (!ifbdev)
785+
if (!ifbdev || !ifbdev->fb)
786786
return;
787787

788788
info = ifbdev->helper.fbdev;
@@ -827,31 +827,28 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
827827

828828
void intel_fbdev_output_poll_changed(struct drm_device *dev)
829829
{
830-
struct drm_i915_private *dev_priv = to_i915(dev);
831-
if (dev_priv->fbdev)
832-
drm_fb_helper_hotplug_event(&dev_priv->fbdev->helper);
830+
struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
831+
832+
if (ifbdev && ifbdev->fb)
833+
drm_fb_helper_hotplug_event(&ifbdev->helper);
833834
}
834835

835836
void intel_fbdev_restore_mode(struct drm_device *dev)
836837
{
837-
int ret;
838-
struct drm_i915_private *dev_priv = to_i915(dev);
839-
struct intel_fbdev *ifbdev = dev_priv->fbdev;
840-
struct drm_fb_helper *fb_helper;
838+
struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
841839

842840
if (!ifbdev)
843841
return;
844842

845843
intel_fbdev_sync(ifbdev);
844+
if (!ifbdev->fb)
845+
return;
846846

847-
fb_helper = &ifbdev->helper;
848-
849-
ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
850-
if (ret) {
847+
if (drm_fb_helper_restore_fbdev_mode_unlocked(&ifbdev->helper)) {
851848
DRM_DEBUG("failed to restore crtc mode\n");
852849
} else {
853-
mutex_lock(&fb_helper->dev->struct_mutex);
850+
mutex_lock(&dev->struct_mutex);
854851
intel_fb_obj_invalidate(ifbdev->fb->obj, ORIGIN_GTT);
855-
mutex_unlock(&fb_helper->dev->struct_mutex);
852+
mutex_unlock(&dev->struct_mutex);
856853
}
857854
}

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4892,7 +4892,8 @@ void gen6_rps_idle(struct drm_i915_private *dev_priv)
48924892
else
48934893
gen6_set_rps(dev_priv, dev_priv->rps.idle_freq);
48944894
dev_priv->rps.last_adj = 0;
4895-
I915_WRITE(GEN6_PMINTRMSK, 0xffffffff);
4895+
I915_WRITE(GEN6_PMINTRMSK,
4896+
gen6_sanitize_rps_pm_mask(dev_priv, ~0));
48964897
}
48974898
mutex_unlock(&dev_priv->rps.hw_lock);
48984899

drivers/gpu/drm/nouveau/nouveau_bo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr,
11511151
if (ret)
11521152
goto out;
11531153

1154-
ret = ttm_bo_move_ttm(bo, true, no_wait_gpu, new_mem);
1154+
ret = ttm_bo_move_ttm(bo, true, intr, no_wait_gpu, new_mem);
11551155
out:
11561156
ttm_bo_mem_put(bo, &tmp_mem);
11571157
return ret;
@@ -1179,7 +1179,7 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr,
11791179
if (ret)
11801180
return ret;
11811181

1182-
ret = ttm_bo_move_ttm(bo, true, no_wait_gpu, &tmp_mem);
1182+
ret = ttm_bo_move_ttm(bo, true, intr, no_wait_gpu, &tmp_mem);
11831183
if (ret)
11841184
goto out;
11851185

drivers/gpu/drm/radeon/radeon_ttm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
346346
if (unlikely(r)) {
347347
goto out_cleanup;
348348
}
349-
r = ttm_bo_move_ttm(bo, true, no_wait_gpu, new_mem);
349+
r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, new_mem);
350350
out_cleanup:
351351
ttm_bo_mem_put(bo, &tmp_mem);
352352
return r;
@@ -379,7 +379,7 @@ static int radeon_move_ram_vram(struct ttm_buffer_object *bo,
379379
if (unlikely(r)) {
380380
return r;
381381
}
382-
r = ttm_bo_move_ttm(bo, true, no_wait_gpu, &tmp_mem);
382+
r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, &tmp_mem);
383383
if (unlikely(r)) {
384384
goto out_cleanup;
385385
}

drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ int rcar_du_hdmienc_init(struct rcar_du_device *rcdu,
125125

126126
/* Link drm_bridge to encoder */
127127
bridge->encoder = encoder;
128+
encoder->bridge = bridge;
128129

129130
ret = drm_bridge_attach(rcdu->ddev, bridge);
130131
if (ret) {

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
354354

355355
if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) &&
356356
!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED))
357-
ret = ttm_bo_move_ttm(bo, evict, no_wait_gpu, mem);
357+
ret = ttm_bo_move_ttm(bo, evict, interruptible, no_wait_gpu,
358+
mem);
358359
else if (bdev->driver->move)
359360
ret = bdev->driver->move(bo, evict, interruptible,
360361
no_wait_gpu, mem);

0 commit comments

Comments
 (0)