Skip to content

Commit a24deb9

Browse files
committed
Merge tag 'drm-fixes-2020-05-23' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Things seemed to have quieten down, though no i915 pull (I even gave them an extra 12 hours in case they were late). The amdgpu floating point fix is probably the largest, but it just moves some code around to it doesn't do fpu stuff outside the fpu boundaries. Otherwise it's just a couple of vmwgfx fixes (maintainer change) and two etnaviv fixes. vmwgfx: - change maintainers - fix redundant assignment - fix parameter name - fix return value etnaviv: - memory leak fix when userspace passes a invalid softpin address - off-by-one crashing the kernel in the perfmon domain iteration when the GPU core has both 2D and 3D capabilities amdgpu: - DP fix - Floating point fix - Fix cursor stutter issue" * tag 'drm-fixes-2020-05-23' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: Defer cursor lock until after VUPDATE drm/amd/display: Remove dml_common_def file drm/amd/display: DP training to set properly SCRAMBLING_DISABLE drm/edid: Add Oculus Rift S to non-desktop list drm/etnaviv: Fix a leak in submit_pin_objects() drm/etnaviv: fix perfmon domain interation drm/vmwgfx: Return true in function vmw_fence_obj_signaled() drm/vmwgfx: remove redundant assignment to variable ret drm/vmwgfx: Fix parameter name in vmw_bo_init drm/vmwgfx: update MAINTAINERS entry
2 parents 4445656 + 7d9ff5e commit a24deb9

25 files changed

+137
-103
lines changed

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5507,10 +5507,10 @@ F: drivers/gpu/drm/vboxvideo/
55075507

55085508
DRM DRIVER FOR VMWARE VIRTUAL GPU
55095509
M: "VMware Graphics" <[email protected]>
5510-
M: Thomas Hellstrom <thellstrom@vmware.com>
5510+
M: Roland Scheidegger <sroland@vmware.com>
55115511
55125512
S: Supported
5513-
T: git git://people.freedesktop.org/~thomash/linux
5513+
T: git git://people.freedesktop.org/~sroland/linux
55145514
F: drivers/gpu/drm/vmwgfx/
55155515
F: include/uapi/drm/vmwgfx_drm.h
55165516

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,30 @@ static enum dpcd_training_patterns
220220
return dpcd_tr_pattern;
221221
}
222222

223+
static uint8_t dc_dp_initialize_scrambling_data_symbols(
224+
struct dc_link *link,
225+
enum dc_dp_training_pattern pattern)
226+
{
227+
uint8_t disable_scrabled_data_symbols = 0;
228+
229+
switch (pattern) {
230+
case DP_TRAINING_PATTERN_SEQUENCE_1:
231+
case DP_TRAINING_PATTERN_SEQUENCE_2:
232+
case DP_TRAINING_PATTERN_SEQUENCE_3:
233+
disable_scrabled_data_symbols = 1;
234+
break;
235+
case DP_TRAINING_PATTERN_SEQUENCE_4:
236+
disable_scrabled_data_symbols = 0;
237+
break;
238+
default:
239+
ASSERT(0);
240+
DC_LOG_HW_LINK_TRAINING("%s: Invalid HW Training pattern: %d\n",
241+
__func__, pattern);
242+
break;
243+
}
244+
return disable_scrabled_data_symbols;
245+
}
246+
223247
static inline bool is_repeater(struct dc_link *link, uint32_t offset)
224248
{
225249
return (!link->is_lttpr_mode_transparent && offset != 0);
@@ -252,6 +276,9 @@ static void dpcd_set_lt_pattern_and_lane_settings(
252276
dpcd_pattern.v1_4.TRAINING_PATTERN_SET =
253277
dc_dp_training_pattern_to_dpcd_training_pattern(link, pattern);
254278

279+
dpcd_pattern.v1_4.SCRAMBLING_DISABLE =
280+
dc_dp_initialize_scrambling_data_symbols(link, pattern);
281+
255282
dpcd_lt_buffer[DP_TRAINING_PATTERN_SET - DP_TRAINING_PATTERN_SET]
256283
= dpcd_pattern.raw;
257284

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,12 +1625,79 @@ void dcn10_pipe_control_lock(
16251625
hws->funcs.verify_allow_pstate_change_high(dc);
16261626
}
16271627

1628+
/**
1629+
* delay_cursor_until_vupdate() - Delay cursor update if too close to VUPDATE.
1630+
*
1631+
* Software keepout workaround to prevent cursor update locking from stalling
1632+
* out cursor updates indefinitely or from old values from being retained in
1633+
* the case where the viewport changes in the same frame as the cursor.
1634+
*
1635+
* The idea is to calculate the remaining time from VPOS to VUPDATE. If it's
1636+
* too close to VUPDATE, then stall out until VUPDATE finishes.
1637+
*
1638+
* TODO: Optimize cursor programming to be once per frame before VUPDATE
1639+
* to avoid the need for this workaround.
1640+
*/
1641+
static void delay_cursor_until_vupdate(struct dc *dc, struct pipe_ctx *pipe_ctx)
1642+
{
1643+
struct dc_stream_state *stream = pipe_ctx->stream;
1644+
struct crtc_position position;
1645+
uint32_t vupdate_start, vupdate_end;
1646+
unsigned int lines_to_vupdate, us_to_vupdate, vpos;
1647+
unsigned int us_per_line, us_vupdate;
1648+
1649+
if (!dc->hwss.calc_vupdate_position || !dc->hwss.get_position)
1650+
return;
1651+
1652+
if (!pipe_ctx->stream_res.stream_enc || !pipe_ctx->stream_res.tg)
1653+
return;
1654+
1655+
dc->hwss.calc_vupdate_position(dc, pipe_ctx, &vupdate_start,
1656+
&vupdate_end);
1657+
1658+
dc->hwss.get_position(&pipe_ctx, 1, &position);
1659+
vpos = position.vertical_count;
1660+
1661+
/* Avoid wraparound calculation issues */
1662+
vupdate_start += stream->timing.v_total;
1663+
vupdate_end += stream->timing.v_total;
1664+
vpos += stream->timing.v_total;
1665+
1666+
if (vpos <= vupdate_start) {
1667+
/* VPOS is in VACTIVE or back porch. */
1668+
lines_to_vupdate = vupdate_start - vpos;
1669+
} else if (vpos > vupdate_end) {
1670+
/* VPOS is in the front porch. */
1671+
return;
1672+
} else {
1673+
/* VPOS is in VUPDATE. */
1674+
lines_to_vupdate = 0;
1675+
}
1676+
1677+
/* Calculate time until VUPDATE in microseconds. */
1678+
us_per_line =
1679+
stream->timing.h_total * 10000u / stream->timing.pix_clk_100hz;
1680+
us_to_vupdate = lines_to_vupdate * us_per_line;
1681+
1682+
/* 70 us is a conservative estimate of cursor update time*/
1683+
if (us_to_vupdate > 70)
1684+
return;
1685+
1686+
/* Stall out until the cursor update completes. */
1687+
us_vupdate = (vupdate_end - vupdate_start + 1) * us_per_line;
1688+
udelay(us_to_vupdate + us_vupdate);
1689+
}
1690+
16281691
void dcn10_cursor_lock(struct dc *dc, struct pipe_ctx *pipe, bool lock)
16291692
{
16301693
/* cursor lock is per MPCC tree, so only need to lock one pipe per stream */
16311694
if (!pipe || pipe->top_pipe)
16321695
return;
16331696

1697+
/* Prevent cursor lock from stalling out cursor updates. */
1698+
if (lock)
1699+
delay_cursor_until_vupdate(dc, pipe);
1700+
16341701
dc->res_pool->mpc->funcs->cursor_lock(dc->res_pool->mpc,
16351702
pipe->stream_res.opp->inst, lock);
16361703
}
@@ -3236,7 +3303,7 @@ int dcn10_get_vupdate_offset_from_vsync(struct pipe_ctx *pipe_ctx)
32363303
return vertical_line_start;
32373304
}
32383305

3239-
static void dcn10_calc_vupdate_position(
3306+
void dcn10_calc_vupdate_position(
32403307
struct dc *dc,
32413308
struct pipe_ctx *pipe_ctx,
32423309
uint32_t *start_line,

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ struct dc;
3434
void dcn10_hw_sequencer_construct(struct dc *dc);
3535

3636
int dcn10_get_vupdate_offset_from_vsync(struct pipe_ctx *pipe_ctx);
37+
void dcn10_calc_vupdate_position(
38+
struct dc *dc,
39+
struct pipe_ctx *pipe_ctx,
40+
uint32_t *start_line,
41+
uint32_t *end_line);
3742
void dcn10_setup_vupdate_interrupt(struct dc *dc, struct pipe_ctx *pipe_ctx);
3843
enum dc_status dcn10_enable_stream_timing(
3944
struct pipe_ctx *pipe_ctx,

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = {
7272
.set_clock = dcn10_set_clock,
7373
.get_clock = dcn10_get_clock,
7474
.get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync,
75+
.calc_vupdate_position = dcn10_calc_vupdate_position,
7576
};
7677

7778
static const struct hwseq_private_funcs dcn10_private_funcs = {

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ static const struct hw_sequencer_funcs dcn20_funcs = {
8383
.init_vm_ctx = dcn20_init_vm_ctx,
8484
.set_flip_control_gsl = dcn20_set_flip_control_gsl,
8585
.get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync,
86+
.calc_vupdate_position = dcn10_calc_vupdate_position,
8687
};
8788

8889
static const struct hwseq_private_funcs dcn20_private_funcs = {

drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static const struct hw_sequencer_funcs dcn21_funcs = {
8686
.optimize_pwr_state = dcn21_optimize_pwr_state,
8787
.exit_optimized_pwr_state = dcn21_exit_optimized_pwr_state,
8888
.get_vupdate_offset_from_vsync = dcn10_get_vupdate_offset_from_vsync,
89+
.calc_vupdate_position = dcn10_calc_vupdate_position,
8990
.set_cursor_position = dcn10_set_cursor_position,
9091
.set_cursor_attribute = dcn10_set_cursor_attribute,
9192
.set_cursor_sdr_white_level = dcn10_set_cursor_sdr_white_level,

drivers/gpu/drm/amd/display/dc/dml/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,8 @@ CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_rq_dlg_calc_21.o := $(dml_ccflags)
6363
endif
6464
CFLAGS_$(AMDDALPATH)/dc/dml/dml1_display_rq_dlg_calc.o := $(dml_ccflags)
6565
CFLAGS_$(AMDDALPATH)/dc/dml/display_rq_dlg_helpers.o := $(dml_ccflags)
66-
CFLAGS_$(AMDDALPATH)/dc/dml/dml_common_defs.o := $(dml_ccflags)
6766

6867
DML = display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
69-
dml_common_defs.o
7068

7169
ifdef CONFIG_DRM_AMD_DC_DCN
7270
DML += display_mode_vba.o dcn20/display_rq_dlg_calc_20.o dcn20/display_mode_vba_20.o

drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#ifndef __DML20_DISPLAY_RQ_DLG_CALC_H__
2727
#define __DML20_DISPLAY_RQ_DLG_CALC_H__
2828

29-
#include "../dml_common_defs.h"
3029
#include "../display_rq_dlg_helpers.h"
3130

3231
struct display_mode_lib;

drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#ifndef __DML20V2_DISPLAY_RQ_DLG_CALC_H__
2727
#define __DML20V2_DISPLAY_RQ_DLG_CALC_H__
2828

29-
#include "../dml_common_defs.h"
3029
#include "../display_rq_dlg_helpers.h"
3130

3231
struct display_mode_lib;

0 commit comments

Comments
 (0)