Skip to content

Commit 244dc26

Browse files
committed
Merge tag 'drm-fixes-2020-01-19' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Back from LCA2020, fixes wasn't too busy last week, seems to have quieten down appropriately, some amdgpu, i915, then a core mst fix and one fix for virtio-gpu and one for rockchip: core mst: - serialize down messages and clear timeslots are on unplug amdgpu: - Update golden settings for renoir - eDP fix i915: - uAPI fix: Remove dash and colon from PMU names to comply with tools/perf - Fix for include file that was indirectly included - Two fixes to make sure VMA are marked active for error capture virtio: - maintain obj reservation lock when submitting cmds rockchip: - increase link rate var size to accommodate rates" * tag 'drm-fixes-2020-01-19' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: Reorder detect_edp_sink_caps before link settings read. drm/amdgpu: update goldensetting for renoir drm/dp_mst: Have DP_Tx send one msg at a time drm/dp_mst: clear time slots for ports invalid drm/i915/pmu: Do not use colons or dashes in PMU names drm/rockchip: fix integer type used for storing dp data rate drm/i915/gt: Mark ring->vma as active while pinned drm/i915/gt: Mark context->state vma as active while pinned drm/i915/gt: Skip trying to unbind in restore_ggtt_mappings drm/i915: Add missing include file <linux/math64.h> drm/virtio: add missing virtio_gpu_array_lock_resv call
2 parents 0cc2682 + f66d84c commit 244dc26

File tree

10 files changed

+94
-17
lines changed

10 files changed

+94
-17
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static const struct soc15_reg_golden golden_settings_sdma_4_3[] = {
254254
SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC0_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000),
255255
SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC1_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000),
256256
SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_PAGE, 0x000003ff, 0x000003c0),
257-
SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_WATERMK, 0xfc000000, 0x00000000)
257+
SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_WATERMK, 0xfc000000, 0x03fbe1fe)
258258
};
259259

260260
static u32 sdma_v4_0_get_reg_offset(struct amdgpu_device *adev,

drivers/gpu/drm/amd/display/dc/core/dc_link.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,8 @@ static bool dc_link_detect_helper(struct dc_link *link,
817817
}
818818

819819
case SIGNAL_TYPE_EDP: {
820-
read_current_link_settings_on_detect(link);
821820
detect_edp_sink_caps(link);
821+
read_current_link_settings_on_detect(link);
822822
sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C_OVER_AUX;
823823
sink_caps.signal = SIGNAL_TYPE_EDP;
824824
break;

drivers/gpu/drm/drm_dp_mst_topology.c

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,8 @@ static int drm_dp_mst_wait_tx_reply(struct drm_dp_mst_branch *mstb,
11901190
txmsg->state == DRM_DP_SIDEBAND_TX_SENT) {
11911191
mstb->tx_slots[txmsg->seqno] = NULL;
11921192
}
1193+
mgr->is_waiting_for_dwn_reply = false;
1194+
11931195
}
11941196
out:
11951197
if (unlikely(ret == -EIO) && drm_debug_enabled(DRM_UT_DP)) {
@@ -1199,6 +1201,7 @@ static int drm_dp_mst_wait_tx_reply(struct drm_dp_mst_branch *mstb,
11991201
}
12001202
mutex_unlock(&mgr->qlock);
12011203

1204+
drm_dp_mst_kick_tx(mgr);
12021205
return ret;
12031206
}
12041207

@@ -2318,7 +2321,7 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb,
23182321
{
23192322
struct drm_dp_mst_topology_mgr *mgr = mstb->mgr;
23202323
struct drm_dp_mst_port *port;
2321-
int old_ddps, ret;
2324+
int old_ddps, old_input, ret, i;
23222325
u8 new_pdt;
23232326
bool dowork = false, create_connector = false;
23242327

@@ -2349,6 +2352,7 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb,
23492352
}
23502353

23512354
old_ddps = port->ddps;
2355+
old_input = port->input;
23522356
port->input = conn_stat->input_port;
23532357
port->mcs = conn_stat->message_capability_status;
23542358
port->ldps = conn_stat->legacy_device_plug_status;
@@ -2373,6 +2377,28 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb,
23732377
dowork = false;
23742378
}
23752379

2380+
if (!old_input && old_ddps != port->ddps && !port->ddps) {
2381+
for (i = 0; i < mgr->max_payloads; i++) {
2382+
struct drm_dp_vcpi *vcpi = mgr->proposed_vcpis[i];
2383+
struct drm_dp_mst_port *port_validated;
2384+
2385+
if (!vcpi)
2386+
continue;
2387+
2388+
port_validated =
2389+
container_of(vcpi, struct drm_dp_mst_port, vcpi);
2390+
port_validated =
2391+
drm_dp_mst_topology_get_port_validated(mgr, port_validated);
2392+
if (!port_validated) {
2393+
mutex_lock(&mgr->payload_lock);
2394+
vcpi->num_slots = 0;
2395+
mutex_unlock(&mgr->payload_lock);
2396+
} else {
2397+
drm_dp_mst_topology_put_port(port_validated);
2398+
}
2399+
}
2400+
}
2401+
23762402
if (port->connector)
23772403
drm_modeset_unlock(&mgr->base.lock);
23782404
else if (create_connector)
@@ -2718,9 +2744,11 @@ static void process_single_down_tx_qlock(struct drm_dp_mst_topology_mgr *mgr)
27182744
ret = process_single_tx_qlock(mgr, txmsg, false);
27192745
if (ret == 1) {
27202746
/* txmsg is sent it should be in the slots now */
2747+
mgr->is_waiting_for_dwn_reply = true;
27212748
list_del(&txmsg->next);
27222749
} else if (ret) {
27232750
DRM_DEBUG_KMS("failed to send msg in q %d\n", ret);
2751+
mgr->is_waiting_for_dwn_reply = false;
27242752
list_del(&txmsg->next);
27252753
if (txmsg->seqno != -1)
27262754
txmsg->dst->tx_slots[txmsg->seqno] = NULL;
@@ -2760,7 +2788,8 @@ static void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr,
27602788
drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
27612789
}
27622790

2763-
if (list_is_singular(&mgr->tx_msg_downq))
2791+
if (list_is_singular(&mgr->tx_msg_downq) &&
2792+
!mgr->is_waiting_for_dwn_reply)
27642793
process_single_down_tx_qlock(mgr);
27652794
mutex_unlock(&mgr->qlock);
27662795
}
@@ -3678,6 +3707,7 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr)
36783707
mutex_lock(&mgr->qlock);
36793708
txmsg->state = DRM_DP_SIDEBAND_TX_RX;
36803709
mstb->tx_slots[slot] = NULL;
3710+
mgr->is_waiting_for_dwn_reply = false;
36813711
mutex_unlock(&mgr->qlock);
36823712

36833713
wake_up_all(&mgr->tx_waitq);
@@ -3687,6 +3717,9 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr)
36873717
no_msg:
36883718
drm_dp_mst_topology_put_mstb(mstb);
36893719
clear_down_rep_recv:
3720+
mutex_lock(&mgr->qlock);
3721+
mgr->is_waiting_for_dwn_reply = false;
3722+
mutex_unlock(&mgr->qlock);
36903723
memset(&mgr->down_rep_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
36913724

36923725
return 0;
@@ -4497,7 +4530,7 @@ static void drm_dp_tx_work(struct work_struct *work)
44974530
struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, tx_work);
44984531

44994532
mutex_lock(&mgr->qlock);
4500-
if (!list_empty(&mgr->tx_msg_downq))
4533+
if (!list_empty(&mgr->tx_msg_downq) && !mgr->is_waiting_for_dwn_reply)
45014534
process_single_down_tx_qlock(mgr);
45024535
mutex_unlock(&mgr->qlock);
45034536
}

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

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ static int __context_pin_state(struct i915_vma *vma)
123123
if (err)
124124
return err;
125125

126+
err = i915_active_acquire(&vma->active);
127+
if (err)
128+
goto err_unpin;
129+
126130
/*
127131
* And mark it as a globally pinned object to let the shrinker know
128132
* it cannot reclaim the object until we release it.
@@ -131,14 +135,44 @@ static int __context_pin_state(struct i915_vma *vma)
131135
vma->obj->mm.dirty = true;
132136

133137
return 0;
138+
139+
err_unpin:
140+
i915_vma_unpin(vma);
141+
return err;
134142
}
135143

136144
static void __context_unpin_state(struct i915_vma *vma)
137145
{
138146
i915_vma_make_shrinkable(vma);
147+
i915_active_release(&vma->active);
139148
__i915_vma_unpin(vma);
140149
}
141150

151+
static int __ring_active(struct intel_ring *ring)
152+
{
153+
int err;
154+
155+
err = i915_active_acquire(&ring->vma->active);
156+
if (err)
157+
return err;
158+
159+
err = intel_ring_pin(ring);
160+
if (err)
161+
goto err_active;
162+
163+
return 0;
164+
165+
err_active:
166+
i915_active_release(&ring->vma->active);
167+
return err;
168+
}
169+
170+
static void __ring_retire(struct intel_ring *ring)
171+
{
172+
intel_ring_unpin(ring);
173+
i915_active_release(&ring->vma->active);
174+
}
175+
142176
__i915_active_call
143177
static void __intel_context_retire(struct i915_active *active)
144178
{
@@ -151,7 +185,7 @@ static void __intel_context_retire(struct i915_active *active)
151185
__context_unpin_state(ce->state);
152186

153187
intel_timeline_unpin(ce->timeline);
154-
intel_ring_unpin(ce->ring);
188+
__ring_retire(ce->ring);
155189

156190
intel_context_put(ce);
157191
}
@@ -163,7 +197,7 @@ static int __intel_context_active(struct i915_active *active)
163197

164198
intel_context_get(ce);
165199

166-
err = intel_ring_pin(ce->ring);
200+
err = __ring_active(ce->ring);
167201
if (err)
168202
goto err_put;
169203

@@ -183,7 +217,7 @@ static int __intel_context_active(struct i915_active *active)
183217
err_timeline:
184218
intel_timeline_unpin(ce->timeline);
185219
err_ring:
186-
intel_ring_unpin(ce->ring);
220+
__ring_retire(ce->ring);
187221
err_put:
188222
intel_context_put(ce);
189223
return err;

drivers/gpu/drm/i915/i915_gem_gtt.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3304,7 +3304,7 @@ void i915_ggtt_disable_guc(struct i915_ggtt *ggtt)
33043304

33053305
static void ggtt_restore_mappings(struct i915_ggtt *ggtt)
33063306
{
3307-
struct i915_vma *vma, *vn;
3307+
struct i915_vma *vma;
33083308
bool flush = false;
33093309
int open;
33103310

@@ -3319,15 +3319,12 @@ static void ggtt_restore_mappings(struct i915_ggtt *ggtt)
33193319
open = atomic_xchg(&ggtt->vm.open, 0);
33203320

33213321
/* clflush objects bound into the GGTT and rebind them. */
3322-
list_for_each_entry_safe(vma, vn, &ggtt->vm.bound_list, vm_link) {
3322+
list_for_each_entry(vma, &ggtt->vm.bound_list, vm_link) {
33233323
struct drm_i915_gem_object *obj = vma->obj;
33243324

33253325
if (!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND))
33263326
continue;
33273327

3328-
if (!__i915_vma_unbind(vma))
3329-
continue;
3330-
33313328
clear_bit(I915_VMA_GLOBAL_BIND_BIT, __i915_vma_flags(vma));
33323329
WARN_ON(i915_vma_bind(vma,
33333330
obj ? obj->cache_level : 0,

drivers/gpu/drm/i915/i915_pmu.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,12 +1074,17 @@ void i915_pmu_register(struct drm_i915_private *i915)
10741074
hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
10751075
pmu->timer.function = i915_sample;
10761076

1077-
if (!is_igp(i915))
1077+
if (!is_igp(i915)) {
10781078
pmu->name = kasprintf(GFP_KERNEL,
1079-
"i915-%s",
1079+
"i915_%s",
10801080
dev_name(i915->drm.dev));
1081-
else
1081+
if (pmu->name) {
1082+
/* tools/perf reserves colons as special. */
1083+
strreplace((char *)pmu->name, ':', '_');
1084+
}
1085+
} else {
10821086
pmu->name = "i915";
1087+
}
10831088
if (!pmu->name)
10841089
goto err;
10851090

drivers/gpu/drm/i915/selftests/i915_random.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#ifndef __I915_SELFTESTS_RANDOM_H__
2626
#define __I915_SELFTESTS_RANDOM_H__
2727

28+
#include <linux/math64.h>
2829
#include <linux/random.h>
2930

3031
#include "../i915_selftest.h"

drivers/gpu/drm/rockchip/cdn-dp-core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct cdn_dp_device {
9595
struct cdn_dp_port *port[MAX_PHY];
9696
u8 ports;
9797
u8 max_lanes;
98-
u8 max_rate;
98+
unsigned int max_rate;
9999
u8 lanes;
100100
int active_port;
101101

drivers/gpu/drm/virtio/virtgpu_plane.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
232232
if (!objs)
233233
return;
234234
virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]);
235+
virtio_gpu_array_lock_resv(objs);
235236
virtio_gpu_cmd_transfer_to_host_2d
236237
(vgdev, 0,
237238
plane->state->crtc_w,

include/drm/drm_dp_mst_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,12 @@ struct drm_dp_mst_topology_mgr {
605605
* &drm_dp_sideband_msg_tx.state once they are queued
606606
*/
607607
struct mutex qlock;
608+
609+
/**
610+
* @is_waiting_for_dwn_reply: indicate whether is waiting for down reply
611+
*/
612+
bool is_waiting_for_dwn_reply;
613+
608614
/**
609615
* @tx_msg_downq: List of pending down replies.
610616
*/

0 commit comments

Comments
 (0)