Skip to content

Commit c305ae9

Browse files
committed
Merge tag 'drm-intel-next-2021-11-30' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
drm/i915 feature pull for v5.17: Features and functionality: - Implement per-lane DP drive settings for ICL+ (Ville) - Enable runtime pm autosuspend by default (Tilak Tangudu) - ADL-P DSI support (Vandita) - Add support for pipe C and D DMC firmware (Anusha) - Implement (near)atomic gamma LUT updates via vblank workers (Ville) - Split plane updates to noarm+arm phases (Ville) - Remove the CCS FB stride restrictions on ADL-P (Imre) - Add PSR selective fetch support for biplanar formats (Jouni) - Add support for display audio codec keepalive (Kai) - VRR platform support for display 11 (Manasi) Refactoring and cleanups: - FBC refactoring and cleanups preparing for multiple FBC instances (Ville) - PCH modeset refactoring, move to its own file (Ville) - Refactor and simplify handling of modifiers (Imre) - PXP cleanups (Ville) - Display header and include refactoring (Jani) - Some register macro cleanups (Ville) - Refactor DP HDMI DFP limit code (Ville) Fixes: - Disable DSB usage for now due to incorrect gamma LUT updates (Ville) - Check async flip state of every crtc and plane only once (José) - Fix DPT FB suspend/resume (Imre) - Fix black screen on reboot due to disabled DP++ TMDS output buffers (Ville) - Don't request GMBUS to generate irqs when called while irqs are off (Ville) - Fix type1 DVI DP dual mode adapter heuristics for modern platforms (Ville) - Fix fix integer overflow in 128b/132b data rate calculation (Jani) - Fix bigjoiner state readout (Ville) - Build fix for non-x86 (Siva) - PSR fixes (José, Jouni, Ville) - Disable ADL-P underrun recovery (José) - Fix DP link parameter usage before valid DPCD (Imre) - VRR vblank and frame counter fixes (Ville) - Fix fastsets on TypeC ports following a non-blocking modeset (Imre) - Compiler warning fixes (Nathan Chancellor) - Fix DSI HS mode commands (William Tseng) - Error return fixes (Dan Carpenter) - Update memory bandwidth calculations (Radhakrishna) - Implement WM0 cursor WA for DG2 (Stan) - Fix DSI Double pixelclock on read-back for dual-link panels (Hans de Goede) - HDMI 2.1 PCON FRL configuration fixes (Ankit) Merges: - DP link training delay helpers, via topic branch (Jani) - Backmerge drm-next (Jani) Signed-off-by: Dave Airlie <[email protected]> From: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents c18c889 + 74ba89c commit c305ae9

Some content is hidden

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

91 files changed

+5395
-3890
lines changed

drivers/char/agp/intel-gtt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/kernel.h>
2121
#include <linux/pagemap.h>
2222
#include <linux/agp_backend.h>
23+
#include <linux/intel-iommu.h>
2324
#include <linux/delay.h>
2425
#include <asm/smp.h>
2526
#include "agp.h"

drivers/gpu/drm/i915/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ config DRM_I915
2121
select ACPI_VIDEO if ACPI
2222
select ACPI_BUTTON if ACPI
2323
select SYNC_FILE
24-
select IOSF_MBI
24+
select IOSF_MBI if X86
2525
select CRC32
2626
select SND_HDA_I915 if SND_HDA_CORE
2727
select CEC_CORE if CEC_NOTIFIER

drivers/gpu/drm/i915/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ subdir-ccflags-y += -I$(srctree)/$(src)
3030
# Please keep these build lists sorted!
3131

3232
# core driver code
33-
i915-y += i915_drv.o \
33+
i915-y += i915_driver.o \
3434
i915_config.o \
3535
i915_irq.o \
3636
i915_getparam.o \
@@ -226,6 +226,8 @@ i915-y += \
226226
display/intel_hotplug.o \
227227
display/intel_lpe_audio.o \
228228
display/intel_overlay.o \
229+
display/intel_pch_display.o \
230+
display/intel_pch_refclk.o \
229231
display/intel_plane_initial.o \
230232
display/intel_psr.o \
231233
display/intel_quirks.o \

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

Lines changed: 80 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,11 @@ static const u32 vlv_primary_formats[] = {
6060
DRM_FORMAT_XBGR16161616F,
6161
};
6262

63-
static const u64 i9xx_format_modifiers[] = {
64-
I915_FORMAT_MOD_X_TILED,
65-
DRM_FORMAT_MOD_LINEAR,
66-
DRM_FORMAT_MOD_INVALID
67-
};
68-
6963
static bool i8xx_plane_format_mod_supported(struct drm_plane *_plane,
7064
u32 format, u64 modifier)
7165
{
72-
switch (modifier) {
73-
case DRM_FORMAT_MOD_LINEAR:
74-
case I915_FORMAT_MOD_X_TILED:
75-
break;
76-
default:
66+
if (!intel_fb_plane_supports_modifier(to_intel_plane(_plane), modifier))
7767
return false;
78-
}
7968

8069
switch (format) {
8170
case DRM_FORMAT_C8:
@@ -92,13 +81,8 @@ static bool i8xx_plane_format_mod_supported(struct drm_plane *_plane,
9281
static bool i965_plane_format_mod_supported(struct drm_plane *_plane,
9382
u32 format, u64 modifier)
9483
{
95-
switch (modifier) {
96-
case DRM_FORMAT_MOD_LINEAR:
97-
case I915_FORMAT_MOD_X_TILED:
98-
break;
99-
default:
84+
if (!intel_fb_plane_supports_modifier(to_intel_plane(_plane), modifier))
10085
return false;
101-
}
10286

10387
switch (format) {
10488
case DRM_FORMAT_C8:
@@ -272,7 +256,7 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
272256
u32 alignment = intel_surf_alignment(fb, 0);
273257
int cpp = fb->format->cpp[0];
274258

275-
while ((src_x + src_w) * cpp > plane_state->view.color_plane[0].stride) {
259+
while ((src_x + src_w) * cpp > plane_state->view.color_plane[0].mapping_stride) {
276260
if (offset == 0) {
277261
drm_dbg_kms(&dev_priv->drm,
278262
"Unable to find suitable display surface offset due to X-tiling\n");
@@ -418,38 +402,25 @@ static int i9xx_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
418402
return DIV_ROUND_UP(pixel_rate * num, den);
419403
}
420404

421-
static void i9xx_update_plane(struct intel_plane *plane,
422-
const struct intel_crtc_state *crtc_state,
423-
const struct intel_plane_state *plane_state)
405+
static void i9xx_plane_update_noarm(struct intel_plane *plane,
406+
const struct intel_crtc_state *crtc_state,
407+
const struct intel_plane_state *plane_state)
424408
{
425409
struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
426410
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
427-
u32 linear_offset;
428-
int x = plane_state->view.color_plane[0].x;
429-
int y = plane_state->view.color_plane[0].y;
430-
int crtc_x = plane_state->uapi.dst.x1;
431-
int crtc_y = plane_state->uapi.dst.y1;
432-
int crtc_w = drm_rect_width(&plane_state->uapi.dst);
433-
int crtc_h = drm_rect_height(&plane_state->uapi.dst);
434411
unsigned long irqflags;
435-
u32 dspaddr_offset;
436-
u32 dspcntr;
437-
438-
dspcntr = plane_state->ctl | i9xx_plane_ctl_crtc(crtc_state);
439-
440-
linear_offset = intel_fb_xy_to_linear(x, y, plane_state, 0);
441-
442-
if (DISPLAY_VER(dev_priv) >= 4)
443-
dspaddr_offset = plane_state->view.color_plane[0].offset;
444-
else
445-
dspaddr_offset = linear_offset;
446412

447413
spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
448414

449415
intel_de_write_fw(dev_priv, DSPSTRIDE(i9xx_plane),
450-
plane_state->view.color_plane[0].stride);
416+
plane_state->view.color_plane[0].mapping_stride);
451417

452418
if (DISPLAY_VER(dev_priv) < 4) {
419+
int crtc_x = plane_state->uapi.dst.x1;
420+
int crtc_y = plane_state->uapi.dst.y1;
421+
int crtc_w = drm_rect_width(&plane_state->uapi.dst);
422+
int crtc_h = drm_rect_height(&plane_state->uapi.dst);
423+
453424
/*
454425
* PLANE_A doesn't actually have a full window
455426
* generator but let's assume we still need to
@@ -459,7 +430,39 @@ static void i9xx_update_plane(struct intel_plane *plane,
459430
(crtc_y << 16) | crtc_x);
460431
intel_de_write_fw(dev_priv, DSPSIZE(i9xx_plane),
461432
((crtc_h - 1) << 16) | (crtc_w - 1));
462-
} else if (IS_CHERRYVIEW(dev_priv) && i9xx_plane == PLANE_B) {
433+
}
434+
435+
spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
436+
}
437+
438+
static void i9xx_plane_update_arm(struct intel_plane *plane,
439+
const struct intel_crtc_state *crtc_state,
440+
const struct intel_plane_state *plane_state)
441+
{
442+
struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
443+
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
444+
int x = plane_state->view.color_plane[0].x;
445+
int y = plane_state->view.color_plane[0].y;
446+
u32 dspcntr, dspaddr_offset, linear_offset;
447+
unsigned long irqflags;
448+
449+
dspcntr = plane_state->ctl | i9xx_plane_ctl_crtc(crtc_state);
450+
451+
linear_offset = intel_fb_xy_to_linear(x, y, plane_state, 0);
452+
453+
if (DISPLAY_VER(dev_priv) >= 4)
454+
dspaddr_offset = plane_state->view.color_plane[0].offset;
455+
else
456+
dspaddr_offset = linear_offset;
457+
458+
spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
459+
460+
if (IS_CHERRYVIEW(dev_priv) && i9xx_plane == PLANE_B) {
461+
int crtc_x = plane_state->uapi.dst.x1;
462+
int crtc_y = plane_state->uapi.dst.y1;
463+
int crtc_w = drm_rect_width(&plane_state->uapi.dst);
464+
int crtc_h = drm_rect_height(&plane_state->uapi.dst);
465+
463466
intel_de_write_fw(dev_priv, PRIMPOS(i9xx_plane),
464467
(crtc_y << 16) | crtc_x);
465468
intel_de_write_fw(dev_priv, PRIMSIZE(i9xx_plane),
@@ -493,8 +496,22 @@ static void i9xx_update_plane(struct intel_plane *plane,
493496
spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
494497
}
495498

496-
static void i9xx_disable_plane(struct intel_plane *plane,
497-
const struct intel_crtc_state *crtc_state)
499+
static void i830_plane_update_arm(struct intel_plane *plane,
500+
const struct intel_crtc_state *crtc_state,
501+
const struct intel_plane_state *plane_state)
502+
{
503+
/*
504+
* On i830/i845 all registers are self-arming [ALM040].
505+
*
506+
* Additional breakage on i830 causes register reads to return
507+
* the last latched value instead of the last written value [ALM026].
508+
*/
509+
i9xx_plane_update_noarm(plane, crtc_state, plane_state);
510+
i9xx_plane_update_arm(plane, crtc_state, plane_state);
511+
}
512+
513+
static void i9xx_plane_disable_arm(struct intel_plane *plane,
514+
const struct intel_crtc_state *crtc_state)
498515
{
499516
struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
500517
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
@@ -768,6 +785,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
768785
struct intel_plane *plane;
769786
const struct drm_plane_funcs *plane_funcs;
770787
unsigned int supported_rotations;
788+
const u64 *modifiers;
771789
const u32 *formats;
772790
int num_formats;
773791
int ret, zpos;
@@ -789,12 +807,10 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
789807
plane->id = PLANE_PRIMARY;
790808
plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
791809

792-
plane->has_fbc = i9xx_plane_has_fbc(dev_priv, plane->i9xx_plane);
793-
if (plane->has_fbc) {
794-
struct intel_fbc *fbc = &dev_priv->fbc;
795-
796-
fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
797-
}
810+
if (i9xx_plane_has_fbc(dev_priv, plane->i9xx_plane))
811+
plane->fbc = &dev_priv->fbc;
812+
if (plane->fbc)
813+
plane->fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
798814

799815
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
800816
formats = vlv_primary_formats;
@@ -851,8 +867,13 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
851867
plane->max_stride = ilk_primary_max_stride;
852868
}
853869

854-
plane->update_plane = i9xx_update_plane;
855-
plane->disable_plane = i9xx_disable_plane;
870+
if (IS_I830(dev_priv) || IS_I845G(dev_priv)) {
871+
plane->update_arm = i830_plane_update_arm;
872+
} else {
873+
plane->update_noarm = i9xx_plane_update_noarm;
874+
plane->update_arm = i9xx_plane_update_arm;
875+
}
876+
plane->disable_arm = i9xx_plane_disable_arm;
856877
plane->get_hw_state = i9xx_plane_get_hw_state;
857878
plane->check_plane = i9xx_plane_check;
858879

@@ -875,21 +896,26 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
875896
plane->disable_flip_done = ilk_primary_disable_flip_done;
876897
}
877898

899+
modifiers = intel_fb_plane_get_modifiers(dev_priv, INTEL_PLANE_CAP_TILING_X);
900+
878901
if (DISPLAY_VER(dev_priv) >= 5 || IS_G4X(dev_priv))
879902
ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
880903
0, plane_funcs,
881904
formats, num_formats,
882-
i9xx_format_modifiers,
905+
modifiers,
883906
DRM_PLANE_TYPE_PRIMARY,
884907
"primary %c", pipe_name(pipe));
885908
else
886909
ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
887910
0, plane_funcs,
888911
formats, num_formats,
889-
i9xx_format_modifiers,
912+
modifiers,
890913
DRM_PLANE_TYPE_PRIMARY,
891914
"plane %c",
892915
plane_name(plane->i9xx_plane));
916+
917+
kfree(modifiers);
918+
893919
if (ret)
894920
goto fail;
895921

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <drm/drm_atomic_helper.h>
2929
#include <drm/drm_mipi_dsi.h>
3030

31+
#include "icl_dsi.h"
3132
#include "intel_atomic.h"
3233
#include "intel_backlight.h"
3334
#include "intel_combo_phy.h"
@@ -36,6 +37,7 @@
3637
#include "intel_ddi.h"
3738
#include "intel_de.h"
3839
#include "intel_dsi.h"
40+
#include "intel_dsi_vbt.h"
3941
#include "intel_panel.h"
4042
#include "intel_vdsc.h"
4143
#include "skl_scaler.h"
@@ -183,6 +185,8 @@ static int dsi_send_pkt_hdr(struct intel_dsi_host *host,
183185

184186
if (enable_lpdt)
185187
tmp |= LP_DATA_TRANSFER;
188+
else
189+
tmp &= ~LP_DATA_TRANSFER;
186190

187191
tmp &= ~(PARAM_WC_MASK | VC_MASK | DT_MASK);
188192
tmp |= ((packet->header[0] & VC_MASK) << VC_SHIFT);
@@ -1226,7 +1230,9 @@ static void gen11_dsi_pre_enable(struct intel_atomic_state *state,
12261230
/* step5: program and powerup panel */
12271231
gen11_dsi_powerup_panel(encoder);
12281232

1229-
intel_dsc_enable(encoder, pipe_config);
1233+
intel_dsc_dsi_pps_write(encoder, pipe_config);
1234+
1235+
intel_dsc_enable(pipe_config);
12301236

12311237
/* step6c: configure transcoder timings */
12321238
gen11_dsi_set_transcoder_timings(encoder, pipe_config);
@@ -1623,7 +1629,7 @@ static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,
16231629
/* FIXME: initialize from VBT */
16241630
vdsc_cfg->rc_model_size = DSC_RC_MODEL_SIZE_CONST;
16251631

1626-
ret = intel_dsc_compute_params(encoder, crtc_state);
1632+
ret = intel_dsc_compute_params(crtc_state);
16271633
if (ret)
16281634
return ret;
16291635

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/*
3+
* Copyright © 2021 Intel Corporation
4+
*/
5+
6+
#ifndef __ICL_DSI_H__
7+
#define __ICL_DSI_H__
8+
9+
struct drm_i915_private;
10+
struct intel_crtc_state;
11+
12+
void icl_dsi_init(struct drm_i915_private *i915);
13+
void icl_dsi_frame_update(struct intel_crtc_state *crtc_state);
14+
15+
#endif /* __ICL_DSI_H__ */

0 commit comments

Comments
 (0)