Skip to content

Commit a81bfdf

Browse files
committed
Merge tag 'drm-fixes-2021-02-12' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Regular fixes for final, there is a ttm regression fix, dp-mst fix, one amdgpu revert, two i915 fixes, and some misc fixes for sun4i, xlnx, and vc4. All pretty quiet and don't think we have any known outstanding regressions. ttm: - page pool regression fix. dp_mst: - don't report un-attached ports as connected amdgpu: - blank screen fix i915: - ensure Type-C FIA is powered when initializing - fix overlay frontbuffer tracking sun4i: - tcon1 sync polarity fix - always set HDMI clock rate - fix H6 HDMI PHY config - fix H6 max frequency vc4: - fix buffer overflow xlnx: - fix memory leak" * tag 'drm-fixes-2021-02-12' of git://anongit.freedesktop.org/drm/drm: drm/ttm: make sure pool pages are cleared drm/sun4i: dw-hdmi: Fix max. frequency for H6 drm/sun4i: Fix H6 HDMI PHY configuration drm/sun4i: dw-hdmi: always set clock rate drm/sun4i: tcon: set sync polarity for tcon1 channel drm/i915: Fix overlay frontbuffer tracking Revert "drm/amd/display: Update NV1x SR latency values" drm/i915/tgl+: Make sure TypeC FIA is powered up when initializing it drm/dp_mst: Don't report ports connected if nothing is attached to them drm/xlnx: fix kmemleak by sending vblank_event in atomic_disable drm/vc4: hvs: Fix buffer overflow with the dlist handling
2 parents e77a681 + 551c818 commit a81bfdf

File tree

12 files changed

+122
-78
lines changed

12 files changed

+122
-78
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ static struct _vcs_dpi_soc_bounding_box_st dcn2_0_soc = {
297297
},
298298
},
299299
.num_states = 5,
300-
.sr_exit_time_us = 11.6,
301-
.sr_enter_plus_exit_time_us = 13.9,
300+
.sr_exit_time_us = 8.6,
301+
.sr_enter_plus_exit_time_us = 10.9,
302302
.urgent_latency_us = 4.0,
303303
.urgent_latency_pixel_data_only_us = 4.0,
304304
.urgent_latency_pixel_mixed_with_vm_data_us = 4.0,

drivers/gpu/drm/drm_dp_mst_topology.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4224,6 +4224,7 @@ drm_dp_mst_detect_port(struct drm_connector *connector,
42244224

42254225
switch (port->pdt) {
42264226
case DP_PEER_DEVICE_NONE:
4227+
break;
42274228
case DP_PEER_DEVICE_MST_BRANCHING:
42284229
if (!port->mcs)
42294230
ret = connector_status_connected;

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ struct intel_overlay {
182182
struct intel_crtc *crtc;
183183
struct i915_vma *vma;
184184
struct i915_vma *old_vma;
185+
struct intel_frontbuffer *frontbuffer;
185186
bool active;
186187
bool pfit_active;
187188
u32 pfit_vscale_ratio; /* shifted-point number, (1<<12) == 1.0 */
@@ -282,21 +283,19 @@ static void intel_overlay_flip_prepare(struct intel_overlay *overlay,
282283
struct i915_vma *vma)
283284
{
284285
enum pipe pipe = overlay->crtc->pipe;
285-
struct intel_frontbuffer *from = NULL, *to = NULL;
286+
struct intel_frontbuffer *frontbuffer = NULL;
286287

287288
drm_WARN_ON(&overlay->i915->drm, overlay->old_vma);
288289

289-
if (overlay->vma)
290-
from = intel_frontbuffer_get(overlay->vma->obj);
291290
if (vma)
292-
to = intel_frontbuffer_get(vma->obj);
291+
frontbuffer = intel_frontbuffer_get(vma->obj);
293292

294-
intel_frontbuffer_track(from, to, INTEL_FRONTBUFFER_OVERLAY(pipe));
293+
intel_frontbuffer_track(overlay->frontbuffer, frontbuffer,
294+
INTEL_FRONTBUFFER_OVERLAY(pipe));
295295

296-
if (to)
297-
intel_frontbuffer_put(to);
298-
if (from)
299-
intel_frontbuffer_put(from);
296+
if (overlay->frontbuffer)
297+
intel_frontbuffer_put(overlay->frontbuffer);
298+
overlay->frontbuffer = frontbuffer;
300299

301300
intel_frontbuffer_flip_prepare(overlay->i915,
302301
INTEL_FRONTBUFFER_OVERLAY(pipe));

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

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,6 @@ static const char *tc_port_mode_name(enum tc_port_mode mode)
2323
return names[mode];
2424
}
2525

26-
static void
27-
tc_port_load_fia_params(struct drm_i915_private *i915,
28-
struct intel_digital_port *dig_port)
29-
{
30-
enum port port = dig_port->base.port;
31-
enum tc_port tc_port = intel_port_to_tc(i915, port);
32-
u32 modular_fia;
33-
34-
if (INTEL_INFO(i915)->display.has_modular_fia) {
35-
modular_fia = intel_uncore_read(&i915->uncore,
36-
PORT_TX_DFLEXDPSP(FIA1));
37-
drm_WARN_ON(&i915->drm, modular_fia == 0xffffffff);
38-
modular_fia &= MODULAR_FIA_MASK;
39-
} else {
40-
modular_fia = 0;
41-
}
42-
43-
/*
44-
* Each Modular FIA instance houses 2 TC ports. In SOC that has more
45-
* than two TC ports, there are multiple instances of Modular FIA.
46-
*/
47-
if (modular_fia) {
48-
dig_port->tc_phy_fia = tc_port / 2;
49-
dig_port->tc_phy_fia_idx = tc_port % 2;
50-
} else {
51-
dig_port->tc_phy_fia = FIA1;
52-
dig_port->tc_phy_fia_idx = tc_port;
53-
}
54-
}
55-
5626
static enum intel_display_power_domain
5727
tc_cold_get_power_domain(struct intel_digital_port *dig_port)
5828
{
@@ -646,6 +616,43 @@ void intel_tc_port_put_link(struct intel_digital_port *dig_port)
646616
mutex_unlock(&dig_port->tc_lock);
647617
}
648618

619+
static bool
620+
tc_has_modular_fia(struct drm_i915_private *i915, struct intel_digital_port *dig_port)
621+
{
622+
intel_wakeref_t wakeref;
623+
u32 val;
624+
625+
if (!INTEL_INFO(i915)->display.has_modular_fia)
626+
return false;
627+
628+
wakeref = tc_cold_block(dig_port);
629+
val = intel_uncore_read(&i915->uncore, PORT_TX_DFLEXDPSP(FIA1));
630+
tc_cold_unblock(dig_port, wakeref);
631+
632+
drm_WARN_ON(&i915->drm, val == 0xffffffff);
633+
634+
return val & MODULAR_FIA_MASK;
635+
}
636+
637+
static void
638+
tc_port_load_fia_params(struct drm_i915_private *i915, struct intel_digital_port *dig_port)
639+
{
640+
enum port port = dig_port->base.port;
641+
enum tc_port tc_port = intel_port_to_tc(i915, port);
642+
643+
/*
644+
* Each Modular FIA instance houses 2 TC ports. In SOC that has more
645+
* than two TC ports, there are multiple instances of Modular FIA.
646+
*/
647+
if (tc_has_modular_fia(i915, dig_port)) {
648+
dig_port->tc_phy_fia = tc_port / 2;
649+
dig_port->tc_phy_fia_idx = tc_port % 2;
650+
} else {
651+
dig_port->tc_phy_fia = FIA1;
652+
dig_port->tc_phy_fia_idx = tc_port;
653+
}
654+
}
655+
649656
void intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy)
650657
{
651658
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);

drivers/gpu/drm/sun4i/sun4i_tcon.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,30 @@ static void sun4i_tcon1_mode_set(struct sun4i_tcon *tcon,
689689
SUN4I_TCON1_BASIC5_V_SYNC(vsync) |
690690
SUN4I_TCON1_BASIC5_H_SYNC(hsync));
691691

692+
/* Setup the polarity of multiple signals */
693+
if (tcon->quirks->polarity_in_ch0) {
694+
val = 0;
695+
696+
if (mode->flags & DRM_MODE_FLAG_PHSYNC)
697+
val |= SUN4I_TCON0_IO_POL_HSYNC_POSITIVE;
698+
699+
if (mode->flags & DRM_MODE_FLAG_PVSYNC)
700+
val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE;
701+
702+
regmap_write(tcon->regs, SUN4I_TCON0_IO_POL_REG, val);
703+
} else {
704+
/* according to vendor driver, this bit must be always set */
705+
val = SUN4I_TCON1_IO_POL_UNKNOWN;
706+
707+
if (mode->flags & DRM_MODE_FLAG_PHSYNC)
708+
val |= SUN4I_TCON1_IO_POL_HSYNC_POSITIVE;
709+
710+
if (mode->flags & DRM_MODE_FLAG_PVSYNC)
711+
val |= SUN4I_TCON1_IO_POL_VSYNC_POSITIVE;
712+
713+
regmap_write(tcon->regs, SUN4I_TCON1_IO_POL_REG, val);
714+
}
715+
692716
/* Map output pins to channel 1 */
693717
regmap_update_bits(tcon->regs, SUN4I_TCON_GCTL_REG,
694718
SUN4I_TCON_GCTL_IOMAP_MASK,
@@ -1517,6 +1541,7 @@ static const struct sun4i_tcon_quirks sun8i_a83t_tv_quirks = {
15171541

15181542
static const struct sun4i_tcon_quirks sun8i_r40_tv_quirks = {
15191543
.has_channel_1 = true,
1544+
.polarity_in_ch0 = true,
15201545
.set_mux = sun8i_r40_tcon_tv_set_mux,
15211546
};
15221547

drivers/gpu/drm/sun4i/sun4i_tcon.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@
153153
#define SUN4I_TCON1_BASIC5_V_SYNC(height) (((height) - 1) & 0x3ff)
154154

155155
#define SUN4I_TCON1_IO_POL_REG 0xf0
156+
/* there is no documentation about this bit */
157+
#define SUN4I_TCON1_IO_POL_UNKNOWN BIT(26)
158+
#define SUN4I_TCON1_IO_POL_HSYNC_POSITIVE BIT(25)
159+
#define SUN4I_TCON1_IO_POL_VSYNC_POSITIVE BIT(24)
160+
156161
#define SUN4I_TCON1_IO_TRI_REG 0xf4
157162

158163
#define SUN4I_TCON_ECC_FIFO_REG 0xf8
@@ -235,6 +240,7 @@ struct sun4i_tcon_quirks {
235240
bool needs_de_be_mux; /* sun6i needs mux to select backend */
236241
bool needs_edp_reset; /* a80 edp reset needed for tcon0 access */
237242
bool supports_lvds; /* Does the TCON support an LVDS output? */
243+
bool polarity_in_ch0; /* some tcon1 channels have polarity bits in tcon0 pol register */
238244
u8 dclk_min_div; /* minimum divider for TCON0 DCLK */
239245

240246
/* callback to handle tcon muxing options */

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ static void sun8i_dw_hdmi_encoder_mode_set(struct drm_encoder *encoder,
2121
{
2222
struct sun8i_dw_hdmi *hdmi = encoder_to_sun8i_dw_hdmi(encoder);
2323

24-
if (hdmi->quirks->set_rate)
25-
clk_set_rate(hdmi->clk_tmds, mode->crtc_clock * 1000);
24+
clk_set_rate(hdmi->clk_tmds, mode->crtc_clock * 1000);
2625
}
2726

2827
static const struct drm_encoder_helper_funcs
@@ -48,11 +47,9 @@ sun8i_dw_hdmi_mode_valid_h6(struct dw_hdmi *hdmi, void *data,
4847
{
4948
/*
5049
* Controller support maximum of 594 MHz, which correlates to
51-
* 4K@60Hz 4:4:4 or RGB. However, for frequencies greater than
52-
* 340 MHz scrambling has to be enabled. Because scrambling is
53-
* not yet implemented, just limit to 340 MHz for now.
50+
* 4K@60Hz 4:4:4 or RGB.
5451
*/
55-
if (mode->clock > 340000)
52+
if (mode->clock > 594000)
5653
return MODE_CLOCK_HIGH;
5754

5855
return MODE_OK;
@@ -295,7 +292,6 @@ static int sun8i_dw_hdmi_remove(struct platform_device *pdev)
295292

296293
static const struct sun8i_dw_hdmi_quirks sun8i_a83t_quirks = {
297294
.mode_valid = sun8i_dw_hdmi_mode_valid_a83t,
298-
.set_rate = true,
299295
};
300296

301297
static const struct sun8i_dw_hdmi_quirks sun50i_h6_quirks = {

drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ struct sun8i_dw_hdmi_quirks {
179179
enum drm_mode_status (*mode_valid)(struct dw_hdmi *hdmi, void *data,
180180
const struct drm_display_info *info,
181181
const struct drm_display_mode *mode);
182-
unsigned int set_rate : 1;
183182
unsigned int use_drm_infoframe : 1;
184183
};
185184

drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,21 @@ static const struct dw_hdmi_mpll_config sun50i_h6_mpll_cfg[] = {
104104

105105
static const struct dw_hdmi_curr_ctrl sun50i_h6_cur_ctr[] = {
106106
/* pixelclk bpp8 bpp10 bpp12 */
107-
{ 25175000, { 0x0000, 0x0000, 0x0000 }, },
108107
{ 27000000, { 0x0012, 0x0000, 0x0000 }, },
109-
{ 59400000, { 0x0008, 0x0008, 0x0008 }, },
110-
{ 72000000, { 0x0008, 0x0008, 0x001b }, },
111-
{ 74250000, { 0x0013, 0x0013, 0x0013 }, },
112-
{ 90000000, { 0x0008, 0x001a, 0x001b }, },
113-
{ 118800000, { 0x001b, 0x001a, 0x001b }, },
114-
{ 144000000, { 0x001b, 0x001a, 0x0034 }, },
115-
{ 180000000, { 0x001b, 0x0033, 0x0034 }, },
116-
{ 216000000, { 0x0036, 0x0033, 0x0034 }, },
117-
{ 237600000, { 0x0036, 0x0033, 0x001b }, },
118-
{ 288000000, { 0x0036, 0x001b, 0x001b }, },
119-
{ 297000000, { 0x0019, 0x001b, 0x0019 }, },
120-
{ 330000000, { 0x0036, 0x001b, 0x001b }, },
121-
{ 594000000, { 0x003f, 0x001b, 0x001b }, },
108+
{ 74250000, { 0x0013, 0x001a, 0x001b }, },
109+
{ 148500000, { 0x0019, 0x0033, 0x0034 }, },
110+
{ 297000000, { 0x0019, 0x001b, 0x001b }, },
111+
{ 594000000, { 0x0010, 0x001b, 0x001b }, },
122112
{ ~0UL, { 0x0000, 0x0000, 0x0000 }, }
123113
};
124114

125115
static const struct dw_hdmi_phy_config sun50i_h6_phy_config[] = {
126116
/*pixelclk symbol term vlev*/
127-
{ 74250000, 0x8009, 0x0004, 0x0232},
128-
{ 148500000, 0x8029, 0x0004, 0x0273},
129-
{ 594000000, 0x8039, 0x0004, 0x014a},
117+
{ 27000000, 0x8009, 0x0007, 0x02b0 },
118+
{ 74250000, 0x8009, 0x0006, 0x022d },
119+
{ 148500000, 0x8029, 0x0006, 0x0270 },
120+
{ 297000000, 0x8039, 0x0005, 0x01ab },
121+
{ 594000000, 0x8029, 0x0000, 0x008a },
130122
{ ~0UL, 0x0000, 0x0000, 0x0000}
131123
};
132124

drivers/gpu/drm/ttm/ttm_pool.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
#include <linux/module.h>
3535
#include <linux/dma-mapping.h>
36+
#include <linux/highmem.h>
3637

3738
#ifdef CONFIG_X86
3839
#include <asm/set_memory.h>
@@ -218,6 +219,15 @@ static void ttm_pool_unmap(struct ttm_pool *pool, dma_addr_t dma_addr,
218219
/* Give pages into a specific pool_type */
219220
static void ttm_pool_type_give(struct ttm_pool_type *pt, struct page *p)
220221
{
222+
unsigned int i, num_pages = 1 << pt->order;
223+
224+
for (i = 0; i < num_pages; ++i) {
225+
if (PageHighMem(p))
226+
clear_highpage(p + i);
227+
else
228+
clear_page(page_address(p + i));
229+
}
230+
221231
spin_lock(&pt->lock);
222232
list_add(&p->lru, &pt->pages);
223233
spin_unlock(&pt->lock);

0 commit comments

Comments
 (0)