Skip to content

Commit 0b45ac1

Browse files
committed
Merge tag 'drm-intel-next-2023-01-12' of git://anongit.freedesktop.org/drm/drm-intel into drm-next
drm/i915 feature pull #1 for v6.3: Features and functionality: - Meteorlake display enabling (Animesh, Luca, Stan, Jouni, Anusha) - DP MST DSC support (Stan) - Gamma/degamma readout support for the state checker (Ville) - Enable SDP split support for DP 2.0 (Vinod) - Add probe blocking support to i915.force_probe parameter (Rodrigo) - Enable Xe HP 4tile support (Jonathan) Refactoring and cleanups: - Color refactoring, especially related to DSB usage (Ville) - DSB refactoring (Ville) - DVO refactoring (Ville) - Backlight register and logging cleanups (Jani) - Avoid display direct calls to uncore (Maarten, Jani) - Add new "soc" sub-directory (Jani) - Refactor DSC platform support checks (Swati) Fixes: - Interlace modes are no longer supported starting at display version 12 (Ankit) - Use polling read for aux control (Arun) - DMC firmware no longer requires specific versions (Gustavo) - Fix PSR flickering and freeze issues (Jouni) - Fix ICL+ DSI GPIO handling (Jani) - Ratelimit errors in display engine irqs (Lucas) - Fix DP MST DSC bpp and timeslot calculations (Stan) - Fix CDCLK squash and crawl sequences (Ville, Anusha) - Fix bigjoiner checks for fused pipes (Ville) - Fix ADP+ degamma LUT size (Ville) - Fix DVO ch7xxx and sil164 suspend/resume (Ville) - Fix memory leak in VBT parsing (Xia Fukun) - Fix VBT packet port selection for dual link DSI (Mikko Kovanen) - Fix SDP infoframe product string for discrete graphics (Clint) - Fix VLV/CHV HDMI/DP audio enable (Ville) - Fix VRR delays and calculations (Ville) - No longer disable transcoder for PHY test pattern change (Khaled) - Fix dual PPS handling (Ville) - Fix timeout and wait for DDI BUF CTL active after enabling (Ankit) Merges: - Backmerge drm-next to sync up with v6.2-rc1 (Jani) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/87tu0wez34.fsf@intel.com
2 parents c37ea39 + f71c9b7 commit 0b45ac1

65 files changed

Lines changed: 3116 additions & 1475 deletions

Some content is hidden

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

drivers/gpu/drm/i915/Kconfig

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,33 @@ config DRM_I915
5656
If "M" is selected, the module will be called i915.
5757

5858
config DRM_I915_FORCE_PROBE
59-
string "Force probe driver for selected new Intel hardware"
59+
string "Force probe i915 for selected Intel hardware IDs"
6060
depends on DRM_I915
6161
help
6262
This is the default value for the i915.force_probe module
6363
parameter. Using the module parameter overrides this option.
6464

65-
Force probe the driver for new Intel graphics devices that are
65+
Force probe the i915 for Intel graphics devices that are
6666
recognized but not properly supported by this kernel version. It is
6767
recommended to upgrade to a kernel version with proper support as soon
6868
as it is available.
6969

70+
It can also be used to block the probe of recognized and fully
71+
supported devices.
72+
7073
Use "" to disable force probe. If in doubt, use this.
7174

72-
Use "<pci-id>[,<pci-id>,...]" to force probe the driver for listed
75+
Use "<pci-id>[,<pci-id>,...]" to force probe the i915 for listed
7376
devices. For example, "4500" or "4500,4571".
7477

7578
Use "*" to force probe the driver for all known devices.
7679

80+
Use "!" right before the ID to block the probe of the device. For
81+
example, "4500,!4571" forces the probe of 4500 and blocks the probe of
82+
4571.
83+
84+
Use "!*" to block the probe of the driver for all known devices.
85+
7786
config DRM_I915_CAPTURE_ERROR
7887
bool "Enable capturing GPU state following a hang"
7988
depends on DRM_I915

drivers/gpu/drm/i915/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ i915-y += i915_driver.o \
4848
i915_sysfs.o \
4949
i915_utils.o \
5050
intel_device_info.o \
51-
intel_dram.o \
5251
intel_memory_region.o \
53-
intel_pch.o \
5452
intel_pcode.o \
5553
intel_pm.o \
5654
intel_region_ttm.o \
@@ -62,6 +60,11 @@ i915-y += i915_driver.o \
6260
vlv_sideband.o \
6361
vlv_suspend.o
6462

63+
# core peripheral code
64+
i915-y += \
65+
soc/intel_dram.o \
66+
soc/intel_pch.o
67+
6568
# core library code
6669
i915-y += \
6770
i915_memcpy.o \

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,26 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5050
#define CH7xxx_INPUT_CLOCK 0x1d
5151
#define CH7xxx_GPIO 0x1e
5252
#define CH7xxx_GPIO_HPIR (1<<3)
53-
#define CH7xxx_IDF 0x1f
5453

54+
#define CH7xxx_IDF 0x1f
55+
#define CH7xxx_IDF_IBS (1<<7)
56+
#define CH7xxx_IDF_DES (1<<6)
5557
#define CH7xxx_IDF_HSP (1<<3)
5658
#define CH7xxx_IDF_VSP (1<<4)
5759

5860
#define CH7xxx_CONNECTION_DETECT 0x20
5961
#define CH7xxx_CDET_DVI (1<<5)
6062

61-
#define CH7301_DAC_CNTL 0x21
63+
#define CH7xxx_DAC_CNTL 0x21
64+
#define CH7xxx_SYNCO_MASK (3 << 3)
65+
#define CH7xxx_SYNCO_VGA_HSYNC (1 << 3)
66+
67+
#define CH7xxx_CLOCK_OUTPUT 0x22
68+
#define CH7xxx_BCOEN (1 << 4)
69+
#define CH7xxx_BCOP (1 << 3)
70+
#define CH7xxx_BCO_MASK (7 << 0)
71+
#define CH7xxx_BCO_VGA_VSYNC (6 << 0)
72+
6273
#define CH7301_HOTPLUG 0x23
6374
#define CH7xxx_TCTL 0x31
6475
#define CH7xxx_TVCO 0x32
@@ -301,6 +312,8 @@ static void ch7xxx_mode_set(struct intel_dvo_device *dvo,
301312

302313
ch7xxx_readb(dvo, CH7xxx_IDF, &idf);
303314

315+
idf |= CH7xxx_IDF_IBS;
316+
304317
idf &= ~(CH7xxx_IDF_HSP | CH7xxx_IDF_VSP);
305318
if (mode->flags & DRM_MODE_FLAG_PHSYNC)
306319
idf |= CH7xxx_IDF_HSP;
@@ -309,6 +322,11 @@ static void ch7xxx_mode_set(struct intel_dvo_device *dvo,
309322
idf |= CH7xxx_IDF_VSP;
310323

311324
ch7xxx_writeb(dvo, CH7xxx_IDF, idf);
325+
326+
ch7xxx_writeb(dvo, CH7xxx_DAC_CNTL,
327+
CH7xxx_SYNCO_VGA_HSYNC);
328+
ch7xxx_writeb(dvo, CH7xxx_CLOCK_OUTPUT,
329+
CH7xxx_BCOEN | CH7xxx_BCO_VGA_VSYNC);
312330
}
313331

314332
/* set the CH7xxx power state */

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5858
#define SIL164_9_MDI (1<<0)
5959

6060
#define SIL164_REGC 0x0c
61+
#define SIL164_C_SCNT (1<<7)
62+
#define SIL164_C_PLLF_MASK (0xf<<1)
63+
#define SIL164_C_PLLF_REC (4<<1)
64+
#define SIL164_C_PFEN (1<<0)
6165

6266
struct sil164_priv {
6367
//I2CDevRec d;
@@ -205,7 +209,13 @@ static void sil164_mode_set(struct intel_dvo_device *dvo,
205209
sil164_writeb(sil, 0x0c, 0x89);
206210
sil164_writeb(sil, 0x08, 0x31);*/
207211
/* don't do much */
208-
return;
212+
213+
sil164_writeb(dvo, SIL164_REG8,
214+
SIL164_8_VEN | SIL164_8_HEN);
215+
sil164_writeb(dvo, SIL164_REG9,
216+
SIL164_9_TSEL);
217+
sil164_writeb(dvo, SIL164_REGC,
218+
SIL164_C_PLLF_REC | SIL164_C_PFEN);
209219
}
210220

211221
/* set the SIL164 power state */
@@ -224,7 +234,6 @@ static void sil164_dpms(struct intel_dvo_device *dvo, bool enable)
224234
ch &= ~SIL164_8_PD;
225235

226236
sil164_writeb(dvo, SIL164_REG8, ch);
227-
return;
228237
}
229238

230239
static bool sil164_get_hw_state(struct intel_dvo_device *dvo)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
20432043
/* attach connector to encoder */
20442044
intel_connector_attach_encoder(intel_connector, encoder);
20452045

2046-
intel_bios_init_panel(dev_priv, &intel_connector->panel, NULL, NULL);
2046+
intel_bios_init_panel_late(dev_priv, &intel_connector->panel, NULL, NULL);
20472047

20482048
mutex_lock(&dev_priv->drm.mode_config.mutex);
20492049
intel_panel_add_vbt_lfp_fixed_mode(intel_connector);

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

Lines changed: 75 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "intel_global_state.h"
4242
#include "intel_hdcp.h"
4343
#include "intel_psr.h"
44+
#include "intel_fb.h"
4445
#include "skl_universal_plane.h"
4546

4647
/**
@@ -310,11 +311,11 @@ intel_crtc_destroy_state(struct drm_crtc *crtc,
310311
kfree(crtc_state);
311312
}
312313

313-
static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_state,
314-
int num_scalers_need, struct intel_crtc *intel_crtc,
315-
const char *name, int idx,
316-
struct intel_plane_state *plane_state,
317-
int *scaler_id)
314+
static int intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_state,
315+
int num_scalers_need, struct intel_crtc *intel_crtc,
316+
const char *name, int idx,
317+
struct intel_plane_state *plane_state,
318+
int *scaler_id)
318319
{
319320
struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
320321
int j;
@@ -334,7 +335,7 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta
334335

335336
if (drm_WARN(&dev_priv->drm, *scaler_id < 0,
336337
"Cannot find scaler for %s:%d\n", name, idx))
337-
return;
338+
return -EINVAL;
338339

339340
/* set scaler mode */
340341
if (plane_state && plane_state->hw.fb &&
@@ -375,9 +376,71 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta
375376
mode = SKL_PS_SCALER_MODE_DYN;
376377
}
377378

379+
/*
380+
* FIXME: we should also check the scaler factors for pfit, so
381+
* this shouldn't be tied directly to planes.
382+
*/
383+
if (plane_state && plane_state->hw.fb) {
384+
const struct drm_framebuffer *fb = plane_state->hw.fb;
385+
const struct drm_rect *src = &plane_state->uapi.src;
386+
const struct drm_rect *dst = &plane_state->uapi.dst;
387+
int hscale, vscale, max_vscale, max_hscale;
388+
389+
/*
390+
* FIXME: When two scalers are needed, but only one of
391+
* them needs to downscale, we should make sure that
392+
* the one that needs downscaling support is assigned
393+
* as the first scaler, so we don't reject downscaling
394+
* unnecessarily.
395+
*/
396+
397+
if (DISPLAY_VER(dev_priv) >= 14) {
398+
/*
399+
* On versions 14 and up, only the first
400+
* scaler supports a vertical scaling factor
401+
* of more than 1.0, while a horizontal
402+
* scaling factor of 3.0 is supported.
403+
*/
404+
max_hscale = 0x30000 - 1;
405+
if (*scaler_id == 0)
406+
max_vscale = 0x30000 - 1;
407+
else
408+
max_vscale = 0x10000;
409+
410+
} else if (DISPLAY_VER(dev_priv) >= 10 ||
411+
!intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier)) {
412+
max_hscale = 0x30000 - 1;
413+
max_vscale = 0x30000 - 1;
414+
} else {
415+
max_hscale = 0x20000 - 1;
416+
max_vscale = 0x20000 - 1;
417+
}
418+
419+
/*
420+
* FIXME: We should change the if-else block above to
421+
* support HQ vs dynamic scaler properly.
422+
*/
423+
424+
/* Check if required scaling is within limits */
425+
hscale = drm_rect_calc_hscale(src, dst, 1, max_hscale);
426+
vscale = drm_rect_calc_vscale(src, dst, 1, max_vscale);
427+
428+
if (hscale < 0 || vscale < 0) {
429+
drm_dbg_kms(&dev_priv->drm,
430+
"Scaler %d doesn't support required plane scaling\n",
431+
*scaler_id);
432+
drm_rect_debug_print("src: ", src, true);
433+
drm_rect_debug_print("dst: ", dst, false);
434+
435+
return -EINVAL;
436+
}
437+
}
438+
378439
drm_dbg_kms(&dev_priv->drm, "Attached scaler id %u.%u to %s:%d\n",
379440
intel_crtc->pipe, *scaler_id, name, idx);
380441
scaler_state->scalers[*scaler_id].mode = mode;
442+
443+
return 0;
381444
}
382445

383446
/**
@@ -437,7 +500,7 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
437500
for (i = 0; i < sizeof(scaler_state->scaler_users) * 8; i++) {
438501
int *scaler_id;
439502
const char *name;
440-
int idx;
503+
int idx, ret;
441504

442505
/* skip if scaler not required */
443506
if (!(scaler_state->scaler_users & (1 << i)))
@@ -494,9 +557,11 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
494557
scaler_id = &plane_state->scaler_id;
495558
}
496559

497-
intel_atomic_setup_scaler(scaler_state, num_scalers_need,
498-
intel_crtc, name, idx,
499-
plane_state, scaler_id);
560+
ret = intel_atomic_setup_scaler(scaler_state, num_scalers_need,
561+
intel_crtc, name, idx,
562+
plane_state, scaler_id);
563+
if (ret < 0)
564+
return ret;
500565
}
501566

502567
return 0;

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,17 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,
798798
mutex_unlock(&i915->display.audio.mutex);
799799
}
800800

801+
void intel_audio_sdp_split_update(struct intel_encoder *encoder,
802+
const struct intel_crtc_state *crtc_state)
803+
{
804+
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
805+
enum transcoder trans = crtc_state->cpu_transcoder;
806+
807+
if (HAS_DP20(i915))
808+
intel_de_rmw(i915, AUD_DP_2DOT0_CTRL(trans), AUD_ENABLE_SDP_SPLIT,
809+
crtc_state->sdp_split_enable ? AUD_ENABLE_SDP_SPLIT : 0);
810+
}
811+
801812
/**
802813
* intel_audio_codec_enable - Enable the audio codec for HD audio
803814
* @encoder: encoder on which to enable audio

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ void intel_audio_cdclk_change_pre(struct drm_i915_private *dev_priv);
2222
void intel_audio_cdclk_change_post(struct drm_i915_private *dev_priv);
2323
void intel_audio_init(struct drm_i915_private *dev_priv);
2424
void intel_audio_deinit(struct drm_i915_private *dev_priv);
25+
void intel_audio_sdp_split_update(struct intel_encoder *encoder,
26+
const struct intel_crtc_state *crtc_state);
2527

2628
#endif /* __INTEL_AUDIO_H__ */

0 commit comments

Comments
 (0)