Skip to content

Commit 2ba0478

Browse files
committed
Merge tag 'drm-intel-next-2021-05-19-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
Core Changes: - drm: Rename DP_PSR_SELECTIVE_UPDATE to better mach eDP spec (Jose). Driver Changes: - Display plane clock rates fixes and improvements (Ville). - Uninint DMC FW loader state during shutdown (Imre). - Convert snprintf to sysfs_emit (Xuezhi). - Fix invalid access to ACPI _DSM objects (Takashi). - A big refactor around how i915 addresses the graphics and display IP versions. (Matt, Lucas). - Backlight fix (Lyude). - Display watermark and DBUF fixes (Ville). - HDCP fix (Anshuman). - Improve cases where display is not available (Jose). - Defeature PSR2 for RKL and ALD-S (Jose). - VLV DSI panel power fixes and improvements (Hans). - display-12 workaround (Jose). - Fix modesetting (Imre). - Drop redundant address-of op before lttpr_common_caps array (Imre). - Fix compiler checks (Jose, Jason). - GLK display fixes (Ville). - Fix error code returns (Dan). - eDP novel: back again to slow and wide link training everywhere (Kai-Heng). - Abstract DMC FW path (Rodrigo). - Preparation and changes for upcoming XeLPD display IP (Jose, Matt, Ville, Juha-Pekka, Animesh). - Fix comment typo in DSI code (zuoqilin). - Simplify CCS and UV plane alignment handling (Imre). - PSR Fixes on TGL (Gwan-gyeong, Jose). - Add intel_dp_hdcp.h and rename init (Jani). - Move crtc and dpll declarations around (Jani). - Fix pre-skl DP AUX precharge length (Ville). - Remove stray newlines from random files (Ville). - crtc->index and intel_crtc+drm_crtc pointer clean-up (Ville). - Add frontbuffer tracking tracepoints (Ville). - ADL-S PCI ID updates (Anand). - Use unique backlight device names (Jani). - A few clean-ups on i915/audio (Jani). - Use intel_framebuffer instead of drm one on intel_fb functions (Imre). - Add the missing MC CCS/XYUV8888 format support on display >= 12 (Imre). - Nuke display error state (Ville). - ADL-P initial enablement patches starting to land (Clint, Imre, Jose, Umesh, Vandita, Mika). - Display clean-up around VBT and the strap bits (Lucas). - Try YCbCr420 color when RGB fails (Werner). - More PSR fixes and improvements (Jose). - Other generic display code clean-up (Jose, Ville). - Use correct downstream caps for check Src-Ctl mode for PCON (Ankit). - Disable HiZ Raw Stall Optimization on broken gen7 (Simon). Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents ae25ec2 + ec27938 commit 2ba0478

File tree

107 files changed

+2799
-1374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+2799
-1374
lines changed

arch/x86/kernel/early-quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ static const struct pci_device_id intel_early_ids[] __initconst = {
552552
INTEL_TGL_12_IDS(&gen11_early_ops),
553553
INTEL_RKL_IDS(&gen11_early_ops),
554554
INTEL_ADLS_IDS(&gen11_early_ops),
555+
INTEL_ADLP_IDS(&gen11_early_ops),
555556
};
556557

557558
struct resource intel_graphics_stolen_res __ro_after_init = DEFINE_RES_MEM(0, 0);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "g4x_dp.h"
99
#include "intel_audio.h"
1010
#include "intel_connector.h"
11+
#include "intel_de.h"
1112
#include "intel_display_types.h"
1213
#include "intel_dp.h"
1314
#include "intel_dp_link_training.h"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "g4x_hdmi.h"
99
#include "intel_audio.h"
1010
#include "intel_connector.h"
11+
#include "intel_de.h"
1112
#include "intel_display_types.h"
1213
#include "intel_dpio_phy.h"
1314
#include "intel_fifo_underrun.h"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "intel_atomic.h"
1212
#include "intel_atomic_plane.h"
13+
#include "intel_de.h"
1314
#include "intel_display_types.h"
1415
#include "intel_fb.h"
1516
#include "intel_sprite.h"
@@ -144,7 +145,7 @@ static bool i9xx_plane_has_windowing(struct intel_plane *plane)
144145
return i9xx_plane == PLANE_B;
145146
else if (DISPLAY_VER(dev_priv) >= 5 || IS_G4X(dev_priv))
146147
return false;
147-
else if (IS_DISPLAY_VER(dev_priv, 4))
148+
else if (DISPLAY_VER(dev_priv) == 4)
148149
return i9xx_plane == PLANE_C;
149150
else
150151
return i9xx_plane == PLANE_B ||
@@ -1039,4 +1040,3 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
10391040

10401041
plane_config->fb = intel_fb;
10411042
}
1042-

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
#include "intel_atomic.h"
3232
#include "intel_combo_phy.h"
3333
#include "intel_connector.h"
34+
#include "intel_crtc.h"
3435
#include "intel_ddi.h"
36+
#include "intel_de.h"
3537
#include "intel_dsi.h"
3638
#include "intel_panel.h"
3739
#include "intel_vdsc.h"
@@ -592,7 +594,7 @@ gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder,
592594
* a value '0' inside TA_PARAM_REGISTERS otherwise
593595
* leave all fields at HW default values.
594596
*/
595-
if (IS_DISPLAY_VER(dev_priv, 11)) {
597+
if (DISPLAY_VER(dev_priv) == 11) {
596598
if (afe_clk(encoder, crtc_state) <= 800000) {
597599
for_each_dsi_port(port, intel_dsi->ports) {
598600
tmp = intel_de_read(dev_priv,
@@ -1158,7 +1160,7 @@ gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder,
11581160
gen11_dsi_configure_transcoder(encoder, crtc_state);
11591161

11601162
/* Step 4l: Gate DDI clocks */
1161-
if (IS_DISPLAY_VER(dev_priv, 11))
1163+
if (DISPLAY_VER(dev_priv) == 11)
11621164
gen11_dsi_gate_clocks(encoder);
11631165
}
11641166

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta
321321
plane_state->hw.fb->format->is_yuv &&
322322
plane_state->hw.fb->format->num_planes > 1) {
323323
struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
324-
if (IS_DISPLAY_VER(dev_priv, 9)) {
324+
if (DISPLAY_VER(dev_priv) == 9) {
325325
mode = SKL_PS_SCALER_MODE_NV12;
326326
} else if (icl_is_hdr_plane(dev_priv, plane->id)) {
327327
/*

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

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ intel_plane_duplicate_state(struct drm_plane *plane)
102102

103103
__drm_atomic_helper_plane_duplicate_state(plane, &intel_state->uapi);
104104

105-
intel_state->vma = NULL;
105+
intel_state->ggtt_vma = NULL;
106+
intel_state->dpt_vma = NULL;
106107
intel_state->flags = 0;
107108

108109
/* add reference to fb */
@@ -125,33 +126,55 @@ intel_plane_destroy_state(struct drm_plane *plane,
125126
struct drm_plane_state *state)
126127
{
127128
struct intel_plane_state *plane_state = to_intel_plane_state(state);
128-
drm_WARN_ON(plane->dev, plane_state->vma);
129+
130+
drm_WARN_ON(plane->dev, plane_state->ggtt_vma);
131+
drm_WARN_ON(plane->dev, plane_state->dpt_vma);
129132

130133
__drm_atomic_helper_plane_destroy_state(&plane_state->uapi);
131134
if (plane_state->hw.fb)
132135
drm_framebuffer_put(plane_state->hw.fb);
133136
kfree(plane_state);
134137
}
135138

136-
unsigned int intel_plane_pixel_rate(const struct intel_crtc_state *crtc_state,
137-
const struct intel_plane_state *plane_state)
139+
unsigned int intel_adjusted_rate(const struct drm_rect *src,
140+
const struct drm_rect *dst,
141+
unsigned int rate)
138142
{
139143
unsigned int src_w, src_h, dst_w, dst_h;
140-
unsigned int pixel_rate = crtc_state->pixel_rate;
141144

142-
src_w = drm_rect_width(&plane_state->uapi.src) >> 16;
143-
src_h = drm_rect_height(&plane_state->uapi.src) >> 16;
144-
dst_w = drm_rect_width(&plane_state->uapi.dst);
145-
dst_h = drm_rect_height(&plane_state->uapi.dst);
145+
src_w = drm_rect_width(src) >> 16;
146+
src_h = drm_rect_height(src) >> 16;
147+
dst_w = drm_rect_width(dst);
148+
dst_h = drm_rect_height(dst);
146149

147150
/* Downscaling limits the maximum pixel rate */
148151
dst_w = min(src_w, dst_w);
149152
dst_h = min(src_h, dst_h);
150153

151-
return DIV_ROUND_UP_ULL(mul_u32_u32(pixel_rate, src_w * src_h),
154+
return DIV_ROUND_UP_ULL(mul_u32_u32(rate, src_w * src_h),
152155
dst_w * dst_h);
153156
}
154157

158+
unsigned int intel_plane_pixel_rate(const struct intel_crtc_state *crtc_state,
159+
const struct intel_plane_state *plane_state)
160+
{
161+
/*
162+
* Note we don't check for plane visibility here as
163+
* we want to use this when calculating the cursor
164+
* watermarks even if the cursor is fully offscreen.
165+
* That depends on the src/dst rectangles being
166+
* correctly populated whenever the watermark code
167+
* considers the cursor to be visible, whether or not
168+
* it is actually visible.
169+
*
170+
* See: intel_wm_plane_visible() and intel_check_cursor()
171+
*/
172+
173+
return intel_adjusted_rate(&plane_state->uapi.src,
174+
&plane_state->uapi.dst,
175+
crtc_state->pixel_rate);
176+
}
177+
155178
unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
156179
const struct intel_plane_state *plane_state)
157180
{

drivers/gpu/drm/i915/display/intel_atomic_plane.h

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

1111
struct drm_plane;
1212
struct drm_property;
13+
struct drm_rect;
1314
struct intel_atomic_state;
1415
struct intel_crtc;
1516
struct intel_crtc_state;
@@ -18,6 +19,9 @@ struct intel_plane_state;
1819

1920
extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
2021

22+
unsigned int intel_adjusted_rate(const struct drm_rect *src,
23+
const struct drm_rect *dst,
24+
unsigned int rate);
2125
unsigned int intel_plane_pixel_rate(const struct intel_crtc_state *crtc_state,
2226
const struct intel_plane_state *plane_state);
2327

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

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "intel_atomic.h"
3232
#include "intel_audio.h"
3333
#include "intel_cdclk.h"
34+
#include "intel_de.h"
3435
#include "intel_display_types.h"
3536
#include "intel_lpe_audio.h"
3637

@@ -591,40 +592,33 @@ static void enable_audio_dsc_wa(struct intel_encoder *encoder,
591592

592593
val = intel_de_read(i915, AUD_CONFIG_BE);
593594

594-
if (IS_DISPLAY_VER(i915, 11))
595+
if (DISPLAY_VER(i915) == 11)
595596
val |= HBLANK_EARLY_ENABLE_ICL(pipe);
596597
else if (DISPLAY_VER(i915) >= 12)
597598
val |= HBLANK_EARLY_ENABLE_TGL(pipe);
598599

599600
if (crtc_state->dsc.compression_enable &&
600-
(crtc_state->hw.adjusted_mode.hdisplay >= 3840 &&
601-
crtc_state->hw.adjusted_mode.vdisplay >= 2160)) {
601+
crtc_state->hw.adjusted_mode.hdisplay >= 3840 &&
602+
crtc_state->hw.adjusted_mode.vdisplay >= 2160) {
602603
/* Get hblank early enable value required */
604+
val &= ~HBLANK_START_COUNT_MASK(pipe);
603605
hblank_early_prog = calc_hblank_early_prog(encoder, crtc_state);
604-
if (hblank_early_prog < 32) {
605-
val &= ~HBLANK_START_COUNT_MASK(pipe);
606+
if (hblank_early_prog < 32)
606607
val |= HBLANK_START_COUNT(pipe, HBLANK_START_COUNT_32);
607-
} else if (hblank_early_prog < 64) {
608-
val &= ~HBLANK_START_COUNT_MASK(pipe);
608+
else if (hblank_early_prog < 64)
609609
val |= HBLANK_START_COUNT(pipe, HBLANK_START_COUNT_64);
610-
} else if (hblank_early_prog < 96) {
611-
val &= ~HBLANK_START_COUNT_MASK(pipe);
610+
else if (hblank_early_prog < 96)
612611
val |= HBLANK_START_COUNT(pipe, HBLANK_START_COUNT_96);
613-
} else {
614-
val &= ~HBLANK_START_COUNT_MASK(pipe);
612+
else
615613
val |= HBLANK_START_COUNT(pipe, HBLANK_START_COUNT_128);
616-
}
617614

618615
/* Get samples room value required */
616+
val &= ~NUMBER_SAMPLES_PER_LINE_MASK(pipe);
619617
samples_room = calc_samples_room(crtc_state);
620-
if (samples_room < 3) {
621-
val &= ~NUMBER_SAMPLES_PER_LINE_MASK(pipe);
618+
if (samples_room < 3)
622619
val |= NUMBER_SAMPLES_PER_LINE(pipe, samples_room);
623-
} else {
624-
/* Program 0 i.e "All Samples available in buffer" */
625-
val &= ~NUMBER_SAMPLES_PER_LINE_MASK(pipe);
620+
else /* Program 0 i.e "All Samples available in buffer" */
626621
val |= NUMBER_SAMPLES_PER_LINE(pipe, 0x0);
627-
}
628622
}
629623

630624
intel_de_write(i915, AUD_CONFIG_BE, val);
@@ -1309,7 +1303,7 @@ static void i915_audio_component_init(struct drm_i915_private *dev_priv)
13091303
if (DISPLAY_VER(dev_priv) >= 9) {
13101304
aud_freq_init = intel_de_read(dev_priv, AUD_FREQ_CNTRL);
13111305

1312-
if (INTEL_GEN(dev_priv) >= 12)
1306+
if (DISPLAY_VER(dev_priv) >= 12)
13131307
aud_freq = AUD_FREQ_GEN12;
13141308
else
13151309
aud_freq = aud_freq_init;

0 commit comments

Comments
 (0)