Skip to content

Commit 06debd6

Browse files
committed
Merge tag 'drm-intel-next-2021-03-16' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
Highlights: - Alderlake S enabling, via topic branch (Aditya, Anusha, Caz, José, Lucas, Matt, Tejas) - Refactor display code to shrink intel_display.c etc. (Dave) - Support more gen 9 and Tigerlake PCH combinations (Lyude, Tejas) - Add eDP MSO support (Jani) Display: - Refactor to support multiple PSR instances (Gwan-gyeong) - Link training debug logging updates (Sean) - Updates to eDP fixed mode handling (Jani) - Disable PSR2 on JSL/EHL (Edmund) - Support DDR5 and LPDDR5 for bandwidth computation (Clint, José) - Update VBT DP max link rate table (Shawn) - Disable the QSES check for HDCP2.2 over MST (Juston) - PSR updates, refactoring, selective fetch (José, Gwan-gyeong) - Display init sequence refactoring (Lucas) - Limit LSPCON to gen 9 and 10 platforms (Ankit) - Fix DDI lane polarity per VBT info (Uma) - Fix HDMI vswing programming location in mode set (Ville) - Various display improvements and refactorings and cleanups (Ville) - Clean up DDI clock routing and readout (Ville) - Workaround async flip + VT-d corruption on HSW/BDW (Ville) - SAGV watermark fixes and cleanups (Ville) - Silence pipe tracepoint WARNs (Ville) Other: - Remove require_force_probe protection from RKL, may need to be revisited (Tejas) - Detect loss of MMIO access (Matt) - GVT display improvements - drm/i915: Disable runtime power management during shutdown (Imre) - Perf/OA updates (Umesh) - Remove references to struct drm_device.pdev, via topic branch (Thomas) - Backmerge (Jani) Signed-off-by: Dave Airlie <[email protected]> From: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 51c3b91 + 2b25fb3 commit 06debd6

File tree

107 files changed

+8885
-7170
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

+8885
-7170
lines changed

arch/x86/kernel/early-quirks.c

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

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

drivers/gpu/drm/i915/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ i915-y += \
223223
display/intel_sprite.o \
224224
display/intel_tc.o \
225225
display/intel_vga.o \
226-
display/i9xx_plane.o
226+
display/i9xx_plane.o \
227+
display/skl_scaler.o \
228+
display/skl_universal_plane.o
227229
i915-$(CONFIG_ACPI) += \
228230
display/intel_acpi.o \
229231
display/intel_opregion.o
@@ -241,6 +243,7 @@ i915-y += \
241243
display/icl_dsi.o \
242244
display/intel_crt.o \
243245
display/intel_ddi.o \
246+
display/intel_ddi_buf_trans.o \
244247
display/intel_dp.o \
245248
display/intel_dp_aux.o \
246249
display/intel_dp_aux_backlight.o \

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

Lines changed: 119 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,10 +770,6 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
770770
int num_formats;
771771
int ret, zpos;
772772

773-
if (INTEL_GEN(dev_priv) >= 9)
774-
return skl_universal_plane_create(dev_priv, pipe,
775-
PLANE_PRIMARY);
776-
777773
plane = intel_plane_alloc();
778774
if (IS_ERR(plane))
779775
return plane;
@@ -924,3 +920,122 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
924920
return ERR_PTR(ret);
925921
}
926922

923+
static int i9xx_format_to_fourcc(int format)
924+
{
925+
switch (format) {
926+
case DISPPLANE_8BPP:
927+
return DRM_FORMAT_C8;
928+
case DISPPLANE_BGRA555:
929+
return DRM_FORMAT_ARGB1555;
930+
case DISPPLANE_BGRX555:
931+
return DRM_FORMAT_XRGB1555;
932+
case DISPPLANE_BGRX565:
933+
return DRM_FORMAT_RGB565;
934+
default:
935+
case DISPPLANE_BGRX888:
936+
return DRM_FORMAT_XRGB8888;
937+
case DISPPLANE_RGBX888:
938+
return DRM_FORMAT_XBGR8888;
939+
case DISPPLANE_BGRA888:
940+
return DRM_FORMAT_ARGB8888;
941+
case DISPPLANE_RGBA888:
942+
return DRM_FORMAT_ABGR8888;
943+
case DISPPLANE_BGRX101010:
944+
return DRM_FORMAT_XRGB2101010;
945+
case DISPPLANE_RGBX101010:
946+
return DRM_FORMAT_XBGR2101010;
947+
case DISPPLANE_BGRA101010:
948+
return DRM_FORMAT_ARGB2101010;
949+
case DISPPLANE_RGBA101010:
950+
return DRM_FORMAT_ABGR2101010;
951+
case DISPPLANE_RGBX161616:
952+
return DRM_FORMAT_XBGR16161616F;
953+
}
954+
}
955+
956+
void
957+
i9xx_get_initial_plane_config(struct intel_crtc *crtc,
958+
struct intel_initial_plane_config *plane_config)
959+
{
960+
struct drm_device *dev = crtc->base.dev;
961+
struct drm_i915_private *dev_priv = to_i915(dev);
962+
struct intel_plane *plane = to_intel_plane(crtc->base.primary);
963+
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
964+
enum pipe pipe;
965+
u32 val, base, offset;
966+
int fourcc, pixel_format;
967+
unsigned int aligned_height;
968+
struct drm_framebuffer *fb;
969+
struct intel_framebuffer *intel_fb;
970+
971+
if (!plane->get_hw_state(plane, &pipe))
972+
return;
973+
974+
drm_WARN_ON(dev, pipe != crtc->pipe);
975+
976+
intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
977+
if (!intel_fb) {
978+
drm_dbg_kms(&dev_priv->drm, "failed to alloc fb\n");
979+
return;
980+
}
981+
982+
fb = &intel_fb->base;
983+
984+
fb->dev = dev;
985+
986+
val = intel_de_read(dev_priv, DSPCNTR(i9xx_plane));
987+
988+
if (INTEL_GEN(dev_priv) >= 4) {
989+
if (val & DISPPLANE_TILED) {
990+
plane_config->tiling = I915_TILING_X;
991+
fb->modifier = I915_FORMAT_MOD_X_TILED;
992+
}
993+
994+
if (val & DISPPLANE_ROTATE_180)
995+
plane_config->rotation = DRM_MODE_ROTATE_180;
996+
}
997+
998+
if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B &&
999+
val & DISPPLANE_MIRROR)
1000+
plane_config->rotation |= DRM_MODE_REFLECT_X;
1001+
1002+
pixel_format = val & DISPPLANE_PIXFORMAT_MASK;
1003+
fourcc = i9xx_format_to_fourcc(pixel_format);
1004+
fb->format = drm_format_info(fourcc);
1005+
1006+
if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv)) {
1007+
offset = intel_de_read(dev_priv, DSPOFFSET(i9xx_plane));
1008+
base = intel_de_read(dev_priv, DSPSURF(i9xx_plane)) & 0xfffff000;
1009+
} else if (INTEL_GEN(dev_priv) >= 4) {
1010+
if (plane_config->tiling)
1011+
offset = intel_de_read(dev_priv,
1012+
DSPTILEOFF(i9xx_plane));
1013+
else
1014+
offset = intel_de_read(dev_priv,
1015+
DSPLINOFF(i9xx_plane));
1016+
base = intel_de_read(dev_priv, DSPSURF(i9xx_plane)) & 0xfffff000;
1017+
} else {
1018+
base = intel_de_read(dev_priv, DSPADDR(i9xx_plane));
1019+
}
1020+
plane_config->base = base;
1021+
1022+
val = intel_de_read(dev_priv, PIPESRC(pipe));
1023+
fb->width = ((val >> 16) & 0xfff) + 1;
1024+
fb->height = ((val >> 0) & 0xfff) + 1;
1025+
1026+
val = intel_de_read(dev_priv, DSPSTRIDE(i9xx_plane));
1027+
fb->pitches[0] = val & 0xffffffc0;
1028+
1029+
aligned_height = intel_fb_align_height(fb, 0, fb->height);
1030+
1031+
plane_config->size = fb->pitches[0] * aligned_height;
1032+
1033+
drm_dbg_kms(&dev_priv->drm,
1034+
"%s/%s with fb: size=%dx%d@%d, offset=%x, pitch %d, size 0x%x\n",
1035+
crtc->base.name, plane->base.name, fb->width, fb->height,
1036+
fb->format->cpp[0] * 8, base, fb->pitches[0],
1037+
plane_config->size);
1038+
1039+
plane_config->fb = intel_fb;
1040+
}
1041+

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

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

1111
enum pipe;
1212
struct drm_i915_private;
13+
struct intel_crtc;
14+
struct intel_initial_plane_config;
1315
struct intel_plane;
1416
struct intel_plane_state;
1517

@@ -21,4 +23,6 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state);
2123
struct intel_plane *
2224
intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe);
2325

26+
void i9xx_get_initial_plane_config(struct intel_crtc *crtc,
27+
struct intel_initial_plane_config *plane_config);
2428
#endif

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

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#include "intel_dsi.h"
3636
#include "intel_panel.h"
3737
#include "intel_vdsc.h"
38+
#include "skl_scaler.h"
39+
#include "skl_universal_plane.h"
3840

3941
static int header_credits_available(struct drm_i915_private *dev_priv,
4042
enum transcoder dsi_trans)
@@ -653,6 +655,24 @@ static void gen11_dsi_ungate_clocks(struct intel_encoder *encoder)
653655
mutex_unlock(&dev_priv->dpll.lock);
654656
}
655657

658+
static bool gen11_dsi_is_clock_enabled(struct intel_encoder *encoder)
659+
{
660+
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
661+
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
662+
bool clock_enabled = false;
663+
enum phy phy;
664+
u32 tmp;
665+
666+
tmp = intel_de_read(dev_priv, ICL_DPCLKA_CFGCR0);
667+
668+
for_each_dsi_phy(phy, intel_dsi->phys) {
669+
if (!(tmp & ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy)))
670+
clock_enabled = true;
671+
}
672+
673+
return clock_enabled;
674+
}
675+
656676
static void gen11_dsi_map_pll(struct intel_encoder *encoder,
657677
const struct intel_crtc_state *crtc_state)
658678
{
@@ -1488,14 +1508,10 @@ static void gen11_dsi_get_cmd_mode_config(struct intel_dsi *intel_dsi,
14881508
static void gen11_dsi_get_config(struct intel_encoder *encoder,
14891509
struct intel_crtc_state *pipe_config)
14901510
{
1491-
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
14921511
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
14931512
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
14941513

1495-
/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */
1496-
pipe_config->port_clock = intel_dpll_get_freq(i915,
1497-
pipe_config->shared_dpll,
1498-
&pipe_config->dpll_hw_state);
1514+
intel_ddi_get_clock(encoder, pipe_config, icl_ddi_combo_get_pll(encoder));
14991515

15001516
pipe_config->hw.adjusted_mode.crtc_clock = intel_dsi->pclk;
15011517
if (intel_dsi->dual_link)
@@ -1940,6 +1956,8 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
19401956
encoder->pipe_mask = ~0;
19411957
encoder->power_domain = POWER_DOMAIN_PORT_DSI;
19421958
encoder->get_power_domains = gen11_dsi_get_power_domains;
1959+
encoder->disable_clock = gen11_dsi_gate_clocks;
1960+
encoder->is_clock_enabled = gen11_dsi_is_clock_enabled;
19431961

19441962
/* register DSI connector with DRM subsystem */
19451963
drm_connector_init(dev, connector, &gen11_dsi_connector_funcs,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "intel_global_state.h"
4141
#include "intel_hdcp.h"
4242
#include "intel_psr.h"
43-
#include "intel_sprite.h"
43+
#include "skl_universal_plane.h"
4444

4545
/**
4646
* intel_digital_connector_atomic_get_property - hook for connector->atomic_get_property.

0 commit comments

Comments
 (0)