mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 15:11:31 +00:00
Merge tag 'drm-intel-next-2021-12-14' of ssh://git.freedesktop.org/git/drm/drm-intel into drm-next
drm/i915 feature pull #2 for v5.17: Features and functionality: - Add eDP privacy screen support (Hans) - Add Raptor Lake S (RPL-S) support (Anusha) - Add CD clock squashing support (Mika) - Properly support ADL-P without force probe (Clint) - Enable pipe color support (10 bit gamma) for display 13 platforms (Uma) - Update ADL-P DMC firmware to v2.14 (Madhumitha) Refactoring and cleanups: - More FBC refactoring preparing for multiple FBC instances (Ville) - Plane register cleanups (Ville) - Header refactoring and include cleanups (Jani) - Crtc helper and vblank wait function cleanups (Jani, Ville) - Move pipe/transcoder/abox masks under intel_device_info.display (Ville) Fixes: - Add a delay to let eDP source OUI write take effect (Lyude) - Use div32 version of MPLLB word clock for UHBR on SNPS PHY (Jani) - Fix DMC firmware loader overflow check (Harshit Mogalapalli) - Fully disable FBC on FIFO underruns (Ville) - Disable FBC with double wide pipe as mutually exclusive (Ville) - DG2 workarounds (Matt) - Non-x86 build fixes (Siva) - Fix HDR plane max width for NV12 (Vidya) - Disable IRQ for selftest timestamp calculation (Anshuman) - ADL-P VBT DDC pin mapping fix (Tejas) Merges: - Backmerge drm-next for privacy screen plumbing (Jani) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/87ee6f5h9u.fsf@intel.com
This commit is contained in:
commit
eacef9fd61
@ -554,6 +554,7 @@ static const struct pci_device_id intel_early_ids[] __initconst = {
|
||||
INTEL_RKL_IDS(&gen11_early_ops),
|
||||
INTEL_ADLS_IDS(&gen11_early_ops),
|
||||
INTEL_ADLP_IDS(&gen11_early_ops),
|
||||
INTEL_RPLS_IDS(&gen11_early_ops),
|
||||
};
|
||||
|
||||
struct resource intel_graphics_stolen_res __ro_after_init = DEFINE_RES_MEM(0, 0);
|
||||
|
@ -259,6 +259,7 @@ i915-y += \
|
||||
display/intel_crt.o \
|
||||
display/intel_ddi.o \
|
||||
display/intel_ddi_buf_trans.o \
|
||||
display/intel_display_trace.o \
|
||||
display/intel_dp.o \
|
||||
display/intel_dp_aux.o \
|
||||
display/intel_dp_aux_backlight.o \
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "intel_audio.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp.h"
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "g4x_hdmi.h"
|
||||
#include "intel_audio.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dpio_phy.h"
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_fb.h"
|
||||
#include "intel_fbc.h"
|
||||
#include "intel_sprite.h"
|
||||
#include "i9xx_plane.h"
|
||||
|
||||
@ -120,6 +121,15 @@ static bool i9xx_plane_has_fbc(struct drm_i915_private *dev_priv,
|
||||
return i9xx_plane == PLANE_A;
|
||||
}
|
||||
|
||||
static struct intel_fbc *i9xx_plane_fbc(struct drm_i915_private *dev_priv,
|
||||
enum i9xx_plane_id i9xx_plane)
|
||||
{
|
||||
if (i9xx_plane_has_fbc(dev_priv, i9xx_plane))
|
||||
return dev_priv->fbc;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool i9xx_plane_has_windowing(struct intel_plane *plane)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
|
||||
@ -807,10 +817,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
plane->id = PLANE_PRIMARY;
|
||||
plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
|
||||
|
||||
if (i9xx_plane_has_fbc(dev_priv, plane->i9xx_plane))
|
||||
plane->fbc = &dev_priv->fbc;
|
||||
if (plane->fbc)
|
||||
plane->fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
|
||||
intel_fbc_add_plane(i9xx_plane_fbc(dev_priv, plane->i9xx_plane), plane);
|
||||
|
||||
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
|
||||
formats = vlv_primary_formats;
|
||||
|
@ -139,6 +139,7 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
|
||||
new_conn_state->base.picture_aspect_ratio != old_conn_state->base.picture_aspect_ratio ||
|
||||
new_conn_state->base.content_type != old_conn_state->base.content_type ||
|
||||
new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode ||
|
||||
new_conn_state->base.privacy_screen_sw_state != old_conn_state->base.privacy_screen_sw_state ||
|
||||
!drm_connector_atomic_hdr_metadata_equal(old_state, new_state))
|
||||
crtc_state->mode_changed = true;
|
||||
|
||||
|
@ -35,15 +35,16 @@
|
||||
#include <drm/drm_fourcc.h>
|
||||
#include <drm/drm_plane_helper.h>
|
||||
|
||||
#include "i915_trace.h"
|
||||
#include "gt/intel_rps.h"
|
||||
|
||||
#include "intel_atomic_plane.h"
|
||||
#include "intel_cdclk.h"
|
||||
#include "intel_display_trace.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_fb.h"
|
||||
#include "intel_fb_pin.h"
|
||||
#include "intel_pm.h"
|
||||
#include "intel_sprite.h"
|
||||
#include "gt/intel_rps.h"
|
||||
|
||||
static void intel_plane_state_reset(struct intel_plane_state *plane_state,
|
||||
struct intel_plane *plane)
|
||||
@ -395,7 +396,7 @@ int intel_plane_atomic_check(struct intel_atomic_state *state,
|
||||
const struct intel_plane_state *old_plane_state =
|
||||
intel_atomic_get_old_plane_state(state, plane);
|
||||
const struct intel_plane_state *new_master_plane_state;
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(i915, plane->pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(i915, plane->pipe);
|
||||
const struct intel_crtc_state *old_crtc_state =
|
||||
intel_atomic_get_old_crtc_state(state, crtc);
|
||||
struct intel_crtc_state *new_crtc_state =
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_audio.h"
|
||||
#include "intel_cdclk.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_lpe_audio.h"
|
||||
@ -1019,7 +1020,7 @@ static void glk_force_audio_cdclk(struct drm_i915_private *dev_priv,
|
||||
struct intel_crtc *crtc;
|
||||
int ret;
|
||||
|
||||
crtc = intel_get_first_crtc(dev_priv);
|
||||
crtc = intel_first_crtc(dev_priv);
|
||||
if (!crtc)
|
||||
return;
|
||||
|
||||
|
@ -1555,12 +1555,24 @@ static const u8 gen9bc_tgp_ddc_pin_map[] = {
|
||||
[DDC_BUS_DDI_D] = GMBUS_PIN_10_TC2_ICP,
|
||||
};
|
||||
|
||||
static const u8 adlp_ddc_pin_map[] = {
|
||||
[ICL_DDC_BUS_DDI_A] = GMBUS_PIN_1_BXT,
|
||||
[ICL_DDC_BUS_DDI_B] = GMBUS_PIN_2_BXT,
|
||||
[ADLP_DDC_BUS_PORT_TC1] = GMBUS_PIN_9_TC1_ICP,
|
||||
[ADLP_DDC_BUS_PORT_TC2] = GMBUS_PIN_10_TC2_ICP,
|
||||
[ADLP_DDC_BUS_PORT_TC3] = GMBUS_PIN_11_TC3_ICP,
|
||||
[ADLP_DDC_BUS_PORT_TC4] = GMBUS_PIN_12_TC4_ICP,
|
||||
};
|
||||
|
||||
static u8 map_ddc_pin(struct drm_i915_private *i915, u8 vbt_pin)
|
||||
{
|
||||
const u8 *ddc_pin_map;
|
||||
int n_entries;
|
||||
|
||||
if (IS_ALDERLAKE_S(i915)) {
|
||||
if (IS_ALDERLAKE_P(i915)) {
|
||||
ddc_pin_map = adlp_ddc_pin_map;
|
||||
n_entries = ARRAY_SIZE(adlp_ddc_pin_map);
|
||||
} else if (IS_ALDERLAKE_S(i915)) {
|
||||
ddc_pin_map = adls_ddc_pin_map;
|
||||
n_entries = ARRAY_SIZE(adls_ddc_pin_map);
|
||||
} else if (INTEL_PCH_TYPE(i915) >= PCH_DG1) {
|
||||
|
@ -24,9 +24,11 @@
|
||||
#include <linux/time.h>
|
||||
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_atomic_plane.h"
|
||||
#include "intel_audio.h"
|
||||
#include "intel_bw.h"
|
||||
#include "intel_cdclk.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_pcode.h"
|
||||
@ -67,7 +69,7 @@ void intel_cdclk_get_cdclk(struct drm_i915_private *dev_priv,
|
||||
dev_priv->cdclk_funcs->get_cdclk(dev_priv, cdclk_config);
|
||||
}
|
||||
|
||||
int intel_cdclk_bw_calc_min_cdclk(struct intel_atomic_state *state)
|
||||
static int intel_cdclk_bw_calc_min_cdclk(struct intel_atomic_state *state)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
return dev_priv->cdclk_funcs->bw_calc_min_cdclk(state);
|
||||
@ -1212,6 +1214,19 @@ static void skl_cdclk_uninit_hw(struct drm_i915_private *dev_priv)
|
||||
skl_set_cdclk(dev_priv, &cdclk_config, INVALID_PIPE);
|
||||
}
|
||||
|
||||
static bool has_cdclk_squasher(struct drm_i915_private *i915)
|
||||
{
|
||||
return IS_DG2(i915);
|
||||
}
|
||||
|
||||
struct intel_cdclk_vals {
|
||||
u32 cdclk;
|
||||
u16 refclk;
|
||||
u16 waveform;
|
||||
u8 divider; /* CD2X divider * 2 */
|
||||
u8 ratio;
|
||||
};
|
||||
|
||||
static const struct intel_cdclk_vals bxt_cdclk_table[] = {
|
||||
{ .refclk = 19200, .cdclk = 144000, .divider = 8, .ratio = 60 },
|
||||
{ .refclk = 19200, .cdclk = 288000, .divider = 4, .ratio = 60 },
|
||||
@ -1313,12 +1328,19 @@ static const struct intel_cdclk_vals adlp_cdclk_table[] = {
|
||||
};
|
||||
|
||||
static const struct intel_cdclk_vals dg2_cdclk_table[] = {
|
||||
{ .refclk = 38400, .cdclk = 172800, .divider = 2, .ratio = 9 },
|
||||
{ .refclk = 38400, .cdclk = 192000, .divider = 2, .ratio = 10 },
|
||||
{ .refclk = 38400, .cdclk = 307200, .divider = 2, .ratio = 16 },
|
||||
{ .refclk = 38400, .cdclk = 326400, .divider = 4, .ratio = 34 },
|
||||
{ .refclk = 38400, .cdclk = 556800, .divider = 2, .ratio = 29 },
|
||||
{ .refclk = 38400, .cdclk = 652800, .divider = 2, .ratio = 34 },
|
||||
{ .refclk = 38400, .cdclk = 163200, .divider = 2, .ratio = 34, .waveform = 0x8888 },
|
||||
{ .refclk = 38400, .cdclk = 204000, .divider = 2, .ratio = 34, .waveform = 0x9248 },
|
||||
{ .refclk = 38400, .cdclk = 244800, .divider = 2, .ratio = 34, .waveform = 0xa4a4 },
|
||||
{ .refclk = 38400, .cdclk = 285600, .divider = 2, .ratio = 34, .waveform = 0xa54a },
|
||||
{ .refclk = 38400, .cdclk = 326400, .divider = 2, .ratio = 34, .waveform = 0xaaaa },
|
||||
{ .refclk = 38400, .cdclk = 367200, .divider = 2, .ratio = 34, .waveform = 0xad5a },
|
||||
{ .refclk = 38400, .cdclk = 408000, .divider = 2, .ratio = 34, .waveform = 0xb6b6 },
|
||||
{ .refclk = 38400, .cdclk = 448800, .divider = 2, .ratio = 34, .waveform = 0xdbb6 },
|
||||
{ .refclk = 38400, .cdclk = 489600, .divider = 2, .ratio = 34, .waveform = 0xeeee },
|
||||
{ .refclk = 38400, .cdclk = 530400, .divider = 2, .ratio = 34, .waveform = 0xf7de },
|
||||
{ .refclk = 38400, .cdclk = 571200, .divider = 2, .ratio = 34, .waveform = 0xfefe },
|
||||
{ .refclk = 38400, .cdclk = 612000, .divider = 2, .ratio = 34, .waveform = 0xfffe },
|
||||
{ .refclk = 38400, .cdclk = 652800, .divider = 2, .ratio = 34, .waveform = 0xffff },
|
||||
{}
|
||||
};
|
||||
|
||||
@ -1454,6 +1476,7 @@ static void bxt_de_pll_readout(struct drm_i915_private *dev_priv,
|
||||
static void bxt_get_cdclk(struct drm_i915_private *dev_priv,
|
||||
struct intel_cdclk_config *cdclk_config)
|
||||
{
|
||||
u32 squash_ctl = 0;
|
||||
u32 divider;
|
||||
int div;
|
||||
|
||||
@ -1491,7 +1514,21 @@ static void bxt_get_cdclk(struct drm_i915_private *dev_priv,
|
||||
return;
|
||||
}
|
||||
|
||||
cdclk_config->cdclk = DIV_ROUND_CLOSEST(cdclk_config->vco, div);
|
||||
if (has_cdclk_squasher(dev_priv))
|
||||
squash_ctl = intel_de_read(dev_priv, CDCLK_SQUASH_CTL);
|
||||
|
||||
if (squash_ctl & CDCLK_SQUASH_ENABLE) {
|
||||
u16 waveform;
|
||||
int size;
|
||||
|
||||
size = REG_FIELD_GET(CDCLK_SQUASH_WINDOW_SIZE_MASK, squash_ctl) + 1;
|
||||
waveform = REG_FIELD_GET(CDCLK_SQUASH_WAVEFORM_MASK, squash_ctl) >> (16 - size);
|
||||
|
||||
cdclk_config->cdclk = DIV_ROUND_CLOSEST(hweight16(waveform) *
|
||||
cdclk_config->vco, size * div);
|
||||
} else {
|
||||
cdclk_config->cdclk = DIV_ROUND_CLOSEST(cdclk_config->vco, div);
|
||||
}
|
||||
|
||||
out:
|
||||
/*
|
||||
@ -1626,6 +1663,26 @@ static u32 bxt_cdclk_cd2x_div_sel(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
}
|
||||
|
||||
static u32 cdclk_squash_waveform(struct drm_i915_private *dev_priv,
|
||||
int cdclk)
|
||||
{
|
||||
const struct intel_cdclk_vals *table = dev_priv->cdclk.table;
|
||||
int i;
|
||||
|
||||
if (cdclk == dev_priv->cdclk.hw.bypass)
|
||||
return 0;
|
||||
|
||||
for (i = 0; table[i].refclk; i++)
|
||||
if (table[i].refclk == dev_priv->cdclk.hw.ref &&
|
||||
table[i].cdclk == cdclk)
|
||||
return table[i].waveform;
|
||||
|
||||
drm_WARN(&dev_priv->drm, 1, "cdclk %d not valid for refclk %u\n",
|
||||
cdclk, dev_priv->cdclk.hw.ref);
|
||||
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
|
||||
const struct intel_cdclk_config *cdclk_config,
|
||||
enum pipe pipe)
|
||||
@ -1633,6 +1690,8 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
|
||||
int cdclk = cdclk_config->cdclk;
|
||||
int vco = cdclk_config->vco;
|
||||
u32 val;
|
||||
u16 waveform;
|
||||
int clock;
|
||||
int ret;
|
||||
|
||||
/* Inform power controller of upcoming frequency change. */
|
||||
@ -1676,7 +1735,24 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
|
||||
bxt_de_pll_enable(dev_priv, vco);
|
||||
}
|
||||
|
||||
val = bxt_cdclk_cd2x_div_sel(dev_priv, cdclk, vco) |
|
||||
waveform = cdclk_squash_waveform(dev_priv, cdclk);
|
||||
|
||||
if (waveform)
|
||||
clock = vco / 2;
|
||||
else
|
||||
clock = cdclk;
|
||||
|
||||
if (has_cdclk_squasher(dev_priv)) {
|
||||
u32 squash_ctl = 0;
|
||||
|
||||
if (waveform)
|
||||
squash_ctl = CDCLK_SQUASH_ENABLE |
|
||||
CDCLK_SQUASH_WINDOW_SIZE(0xf) | waveform;
|
||||
|
||||
intel_de_write(dev_priv, CDCLK_SQUASH_CTL, squash_ctl);
|
||||
}
|
||||
|
||||
val = bxt_cdclk_cd2x_div_sel(dev_priv, clock, vco) |
|
||||
bxt_cdclk_cd2x_pipe(dev_priv, pipe) |
|
||||
skl_cdclk_decimal(cdclk);
|
||||
|
||||
@ -1690,7 +1766,7 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
|
||||
intel_de_write(dev_priv, CDCLK_CTL, val);
|
||||
|
||||
if (pipe != INVALID_PIPE)
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(intel_crtc_for_pipe(dev_priv, pipe));
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 11) {
|
||||
ret = sandybridge_pcode_write(dev_priv, SKL_PCODE_CDCLK_CONTROL,
|
||||
@ -1728,7 +1804,7 @@ static void bxt_set_cdclk(struct drm_i915_private *dev_priv,
|
||||
static void bxt_sanitize_cdclk(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
u32 cdctl, expected;
|
||||
int cdclk, vco;
|
||||
int cdclk, clock, vco;
|
||||
|
||||
intel_update_cdclk(dev_priv);
|
||||
intel_dump_cdclk_config(&dev_priv->cdclk.hw, "Current CDCLK");
|
||||
@ -1764,8 +1840,12 @@ static void bxt_sanitize_cdclk(struct drm_i915_private *dev_priv)
|
||||
expected = skl_cdclk_decimal(cdclk);
|
||||
|
||||
/* Figure out what CD2X divider we should be using for this cdclk */
|
||||
expected |= bxt_cdclk_cd2x_div_sel(dev_priv,
|
||||
dev_priv->cdclk.hw.cdclk,
|
||||
if (has_cdclk_squasher(dev_priv))
|
||||
clock = dev_priv->cdclk.hw.vco / 2;
|
||||
else
|
||||
clock = dev_priv->cdclk.hw.cdclk;
|
||||
|
||||
expected |= bxt_cdclk_cd2x_div_sel(dev_priv, clock,
|
||||
dev_priv->cdclk.hw.vco);
|
||||
|
||||
/*
|
||||
@ -1881,6 +1961,25 @@ static bool intel_cdclk_can_crawl(struct drm_i915_private *dev_priv,
|
||||
a->ref == b->ref;
|
||||
}
|
||||
|
||||
static bool intel_cdclk_can_squash(struct drm_i915_private *dev_priv,
|
||||
const struct intel_cdclk_config *a,
|
||||
const struct intel_cdclk_config *b)
|
||||
{
|
||||
/*
|
||||
* FIXME should store a bit more state in intel_cdclk_config
|
||||
* to differentiate squasher vs. cd2x divider properly. For
|
||||
* the moment all platforms with squasher use a fixed cd2x
|
||||
* divider.
|
||||
*/
|
||||
if (!has_cdclk_squasher(dev_priv))
|
||||
return false;
|
||||
|
||||
return a->cdclk != b->cdclk &&
|
||||
a->vco != 0 &&
|
||||
a->vco == b->vco &&
|
||||
a->ref == b->ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* intel_cdclk_needs_modeset - Determine if changong between the CDCLK
|
||||
* configurations requires a modeset on all pipes
|
||||
@ -1918,7 +2017,17 @@ static bool intel_cdclk_can_cd2x_update(struct drm_i915_private *dev_priv,
|
||||
if (DISPLAY_VER(dev_priv) < 10 && !IS_BROXTON(dev_priv))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* FIXME should store a bit more state in intel_cdclk_config
|
||||
* to differentiate squasher vs. cd2x divider properly. For
|
||||
* the moment all platforms with squasher use a fixed cd2x
|
||||
* divider.
|
||||
*/
|
||||
if (has_cdclk_squasher(dev_priv))
|
||||
return false;
|
||||
|
||||
return a->cdclk != b->cdclk &&
|
||||
a->vco != 0 &&
|
||||
a->vco == b->vco &&
|
||||
a->ref == b->ref;
|
||||
}
|
||||
@ -2529,6 +2638,58 @@ intel_atomic_get_cdclk_state(struct intel_atomic_state *state)
|
||||
return to_intel_cdclk_state(cdclk_state);
|
||||
}
|
||||
|
||||
int intel_cdclk_atomic_check(struct intel_atomic_state *state,
|
||||
bool *need_cdclk_calc)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
const struct intel_cdclk_state *old_cdclk_state;
|
||||
const struct intel_cdclk_state *new_cdclk_state;
|
||||
struct intel_plane_state *plane_state;
|
||||
struct intel_bw_state *new_bw_state;
|
||||
struct intel_plane *plane;
|
||||
int min_cdclk = 0;
|
||||
enum pipe pipe;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* active_planes bitmask has been updated, and potentially affected
|
||||
* planes are part of the state. We can now compute the minimum cdclk
|
||||
* for each plane.
|
||||
*/
|
||||
for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
|
||||
ret = intel_plane_calc_min_cdclk(state, plane, need_cdclk_calc);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
old_cdclk_state = intel_atomic_get_old_cdclk_state(state);
|
||||
new_cdclk_state = intel_atomic_get_new_cdclk_state(state);
|
||||
|
||||
if (new_cdclk_state &&
|
||||
old_cdclk_state->force_min_cdclk != new_cdclk_state->force_min_cdclk)
|
||||
*need_cdclk_calc = true;
|
||||
|
||||
ret = intel_cdclk_bw_calc_min_cdclk(state);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
new_bw_state = intel_atomic_get_new_bw_state(state);
|
||||
|
||||
if (!new_cdclk_state || !new_bw_state)
|
||||
return 0;
|
||||
|
||||
for_each_pipe(i915, pipe) {
|
||||
min_cdclk = max(new_cdclk_state->min_cdclk[pipe], min_cdclk);
|
||||
|
||||
/* Currently do this change only if we need to increase */
|
||||
if (new_bw_state->min_cdclk > min_cdclk)
|
||||
*need_cdclk_calc = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int intel_cdclk_init(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
struct intel_cdclk_state *cdclk_state;
|
||||
@ -2592,7 +2753,7 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
|
||||
struct intel_crtc_state *crtc_state;
|
||||
|
||||
pipe = ilog2(new_cdclk_state->active_pipes);
|
||||
crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
|
||||
crtc_state = intel_atomic_get_crtc_state(&state->base, crtc);
|
||||
if (IS_ERR(crtc_state))
|
||||
@ -2602,9 +2763,14 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
|
||||
pipe = INVALID_PIPE;
|
||||
}
|
||||
|
||||
if (intel_cdclk_can_crawl(dev_priv,
|
||||
&old_cdclk_state->actual,
|
||||
&new_cdclk_state->actual)) {
|
||||
if (intel_cdclk_can_squash(dev_priv,
|
||||
&old_cdclk_state->actual,
|
||||
&new_cdclk_state->actual)) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"Can change cdclk via squasher\n");
|
||||
} else if (intel_cdclk_can_crawl(dev_priv,
|
||||
&old_cdclk_state->actual,
|
||||
&new_cdclk_state->actual)) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"Can change cdclk via crawl\n");
|
||||
} else if (pipe != INVALID_PIPE) {
|
||||
|
@ -16,13 +16,6 @@ struct drm_i915_private;
|
||||
struct intel_atomic_state;
|
||||
struct intel_crtc_state;
|
||||
|
||||
struct intel_cdclk_vals {
|
||||
u32 cdclk;
|
||||
u16 refclk;
|
||||
u8 divider; /* CD2X divider * 2 */
|
||||
u8 ratio;
|
||||
};
|
||||
|
||||
struct intel_cdclk_state {
|
||||
struct intel_global_state base;
|
||||
|
||||
@ -70,7 +63,8 @@ void intel_dump_cdclk_config(const struct intel_cdclk_config *cdclk_config,
|
||||
int intel_modeset_calc_cdclk(struct intel_atomic_state *state);
|
||||
void intel_cdclk_get_cdclk(struct drm_i915_private *dev_priv,
|
||||
struct intel_cdclk_config *cdclk_config);
|
||||
int intel_cdclk_bw_calc_min_cdclk(struct intel_atomic_state *state);
|
||||
int intel_cdclk_atomic_check(struct intel_atomic_state *state,
|
||||
bool *need_cdclk_calc);
|
||||
struct intel_cdclk_state *
|
||||
intel_atomic_get_cdclk_state(struct intel_atomic_state *state);
|
||||
|
||||
|
@ -808,6 +808,14 @@ static void bdw_load_luts(const struct intel_crtc_state *crtc_state)
|
||||
}
|
||||
}
|
||||
|
||||
static int glk_degamma_lut_size(struct drm_i915_private *i915)
|
||||
{
|
||||
if (DISPLAY_VER(i915) >= 13)
|
||||
return 131;
|
||||
else
|
||||
return 35;
|
||||
}
|
||||
|
||||
static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
@ -827,8 +835,8 @@ static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state)
|
||||
|
||||
for (i = 0; i < lut_size; i++) {
|
||||
/*
|
||||
* First 33 entries represent range from 0 to 1.0
|
||||
* 34th and 35th entry will represent extended range
|
||||
* First lut_size entries represent range from 0 to 1.0
|
||||
* 3 additional lut entries will represent extended range
|
||||
* inputs 3.0 and 7.0 respectively, currently clamped
|
||||
* at 1.0. Since the precision is 16bit, the user
|
||||
* value can be directly filled to register.
|
||||
@ -844,7 +852,7 @@ static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state)
|
||||
}
|
||||
|
||||
/* Clamp values > 1.0. */
|
||||
while (i++ < 35)
|
||||
while (i++ < glk_degamma_lut_size(dev_priv))
|
||||
intel_de_write_fw(dev_priv, PRE_CSC_GAMC_DATA(pipe), 1 << 16);
|
||||
|
||||
intel_de_write_fw(dev_priv, PRE_CSC_GAMC_INDEX(pipe), 0);
|
||||
@ -1574,6 +1582,8 @@ static int glk_color_check(struct intel_crtc_state *crtc_state)
|
||||
|
||||
static u32 icl_gamma_mode(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
|
||||
u32 gamma_mode = 0;
|
||||
|
||||
if (crtc_state->hw.degamma_lut)
|
||||
@ -1586,6 +1596,13 @@ static u32 icl_gamma_mode(const struct intel_crtc_state *crtc_state)
|
||||
if (!crtc_state->hw.gamma_lut ||
|
||||
crtc_state_is_legacy_gamma(crtc_state))
|
||||
gamma_mode |= GAMMA_MODE_MODE_8BIT;
|
||||
/*
|
||||
* Enable 10bit gamma for D13
|
||||
* ToDo: Extend to Logarithmic Gamma once the new UAPI
|
||||
* is acccepted and implemented by a userspace consumer
|
||||
*/
|
||||
else if (DISPLAY_VER(i915) >= 13)
|
||||
gamma_mode |= GAMMA_MODE_MODE_10BIT;
|
||||
else
|
||||
gamma_mode |= GAMMA_MODE_MODE_12BIT_MULTI_SEGMENTED;
|
||||
|
||||
|
@ -321,8 +321,8 @@ static void hsw_enable_crt(struct intel_atomic_state *state,
|
||||
|
||||
intel_crt_set_dpms(encoder, crtc_state, DRM_MODE_DPMS_ON);
|
||||
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
|
||||
intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, true);
|
||||
}
|
||||
@ -721,7 +721,7 @@ intel_crt_load_detect(struct intel_crt *crt, u32 pipe)
|
||||
intel_uncore_posting_read(uncore, pipeconf_reg);
|
||||
/* Wait for next Vblank to substitue
|
||||
* border color for Color info */
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(intel_crtc_for_pipe(dev_priv, pipe));
|
||||
st00 = intel_uncore_read8(uncore, _VGA_MSR_WRITE);
|
||||
status = ((st00 & (1 << 4)) != 0) ?
|
||||
connector_status_connected :
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include <drm/drm_plane_helper.h>
|
||||
#include <drm/drm_vblank_work.h>
|
||||
|
||||
#include "i915_trace.h"
|
||||
#include "i915_vgpu.h"
|
||||
#include "i9xx_plane.h"
|
||||
#include "icl_dsi.h"
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_atomic_plane.h"
|
||||
@ -21,13 +21,13 @@
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_cursor.h"
|
||||
#include "intel_display_debugfs.h"
|
||||
#include "intel_display_trace.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dsi.h"
|
||||
#include "intel_pipe_crc.h"
|
||||
#include "intel_psr.h"
|
||||
#include "intel_sprite.h"
|
||||
#include "intel_vrr.h"
|
||||
#include "i9xx_plane.h"
|
||||
#include "skl_universal_plane.h"
|
||||
|
||||
static void assert_vblank_disabled(struct drm_crtc *crtc)
|
||||
@ -36,6 +36,38 @@ static void assert_vblank_disabled(struct drm_crtc *crtc)
|
||||
drm_crtc_vblank_put(crtc);
|
||||
}
|
||||
|
||||
struct intel_crtc *intel_first_crtc(struct drm_i915_private *i915)
|
||||
{
|
||||
return to_intel_crtc(drm_crtc_from_index(&i915->drm, 0));
|
||||
}
|
||||
|
||||
struct intel_crtc *intel_crtc_for_pipe(struct drm_i915_private *i915,
|
||||
enum pipe pipe)
|
||||
{
|
||||
struct intel_crtc *crtc;
|
||||
|
||||
for_each_intel_crtc(&i915->drm, crtc) {
|
||||
if (crtc->pipe == pipe)
|
||||
return crtc;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc)
|
||||
{
|
||||
drm_crtc_wait_one_vblank(&crtc->base);
|
||||
}
|
||||
|
||||
void intel_wait_for_vblank_if_active(struct drm_i915_private *i915,
|
||||
enum pipe pipe)
|
||||
{
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(i915, pipe);
|
||||
|
||||
if (crtc->active)
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
}
|
||||
|
||||
u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_device *dev = crtc->base.dev;
|
||||
@ -327,18 +359,6 @@ int intel_crtc_init(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
BUG_ON(pipe >= ARRAY_SIZE(dev_priv->pipe_to_crtc_mapping) ||
|
||||
dev_priv->pipe_to_crtc_mapping[pipe] != NULL);
|
||||
dev_priv->pipe_to_crtc_mapping[pipe] = crtc;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) < 9) {
|
||||
enum i9xx_plane_id i9xx_plane = primary->i9xx_plane;
|
||||
|
||||
BUG_ON(i9xx_plane >= ARRAY_SIZE(dev_priv->plane_to_crtc_mapping) ||
|
||||
dev_priv->plane_to_crtc_mapping[i9xx_plane] != NULL);
|
||||
dev_priv->plane_to_crtc_mapping[i9xx_plane] = crtc;
|
||||
}
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 11)
|
||||
drm_crtc_create_scaling_filter_property(&crtc->base,
|
||||
BIT(DRM_SCALING_FILTER_DEFAULT) |
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum i9xx_plane_id;
|
||||
enum pipe;
|
||||
struct drm_display_mode;
|
||||
struct drm_i915_private;
|
||||
@ -28,5 +29,11 @@ void intel_crtc_vblank_off(const struct intel_crtc_state *crtc_state);
|
||||
void intel_pipe_update_start(struct intel_crtc_state *new_crtc_state);
|
||||
void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);
|
||||
void intel_wait_for_vblank_workers(struct intel_atomic_state *state);
|
||||
struct intel_crtc *intel_first_crtc(struct drm_i915_private *i915);
|
||||
struct intel_crtc *intel_crtc_for_pipe(struct drm_i915_private *i915,
|
||||
enum pipe pipe);
|
||||
void intel_wait_for_vblank_if_active(struct drm_i915_private *i915,
|
||||
enum pipe pipe);
|
||||
void intel_crtc_wait_for_next_vblank(struct intel_crtc *crtc);
|
||||
|
||||
#endif
|
||||
|
@ -25,6 +25,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <drm/drm_privacy_screen_consumer.h>
|
||||
#include <drm/drm_scdc_helper.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
@ -2905,6 +2906,7 @@ static void intel_enable_ddi_dp(struct intel_atomic_state *state,
|
||||
if (port == PORT_A && DISPLAY_VER(dev_priv) < 9)
|
||||
intel_dp_stop_link_train(intel_dp, crtc_state);
|
||||
|
||||
drm_connector_update_privacy_screen(conn_state);
|
||||
intel_edp_backlight_on(crtc_state, conn_state);
|
||||
|
||||
if (!dig_port->lspcon.active || dig_port->dp.has_hdmi_sink)
|
||||
@ -3111,6 +3113,7 @@ static void intel_ddi_update_pipe_dp(struct intel_atomic_state *state,
|
||||
intel_drrs_update(intel_dp, crtc_state);
|
||||
|
||||
intel_backlight_update(state, encoder, crtc_state, conn_state);
|
||||
drm_connector_update_privacy_screen(conn_state);
|
||||
}
|
||||
|
||||
void intel_ddi_update_pipe(struct intel_atomic_state *state,
|
||||
@ -3922,6 +3925,19 @@ intel_ddi_init_dp_connector(struct intel_digital_port *dig_port)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (dig_port->base.type == INTEL_OUTPUT_EDP) {
|
||||
struct drm_device *dev = dig_port->base.base.dev;
|
||||
struct drm_privacy_screen *privacy_screen;
|
||||
|
||||
privacy_screen = drm_privacy_screen_get(dev->dev, NULL);
|
||||
if (!IS_ERR(privacy_screen)) {
|
||||
drm_connector_attach_privacy_screen_provider(&connector->base,
|
||||
privacy_screen);
|
||||
} else if (PTR_ERR(privacy_screen) != -ENODEV) {
|
||||
drm_warn(dev, "Error getting privacy-screen\n");
|
||||
}
|
||||
}
|
||||
|
||||
return connector;
|
||||
}
|
||||
|
||||
|
@ -1032,6 +1032,21 @@ bool is_hobl_buf_trans(const struct intel_ddi_buf_trans *table)
|
||||
return table == &tgl_combo_phy_trans_edp_hbr2_hobl;
|
||||
}
|
||||
|
||||
static bool use_edp_hobl(struct intel_encoder *encoder)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||
|
||||
return i915->vbt.edp.hobl && !intel_dp->hobl_failed;
|
||||
}
|
||||
|
||||
static bool use_edp_low_vswing(struct intel_encoder *encoder)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
return i915->vbt.edp.low_vswing;
|
||||
}
|
||||
|
||||
static const struct intel_ddi_buf_trans *
|
||||
intel_get_buf_trans(const struct intel_ddi_buf_trans *trans, int *num_entries)
|
||||
{
|
||||
@ -1057,14 +1072,12 @@ bdw_get_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_ANALOG))
|
||||
return intel_get_buf_trans(&bdw_trans_fdi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&bdw_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
i915->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return intel_get_buf_trans(&bdw_trans_edp, n_entries);
|
||||
else
|
||||
return intel_get_buf_trans(&bdw_trans_dp, n_entries);
|
||||
@ -1094,12 +1107,10 @@ skl_y_get_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&skl_y_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
i915->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return _skl_get_buf_trans_dp(encoder, &skl_y_trans_edp, n_entries);
|
||||
else
|
||||
return _skl_get_buf_trans_dp(encoder, &skl_y_trans_dp, n_entries);
|
||||
@ -1110,12 +1121,10 @@ skl_u_get_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&skl_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
i915->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return _skl_get_buf_trans_dp(encoder, &skl_u_trans_edp, n_entries);
|
||||
else
|
||||
return _skl_get_buf_trans_dp(encoder, &skl_u_trans_dp, n_entries);
|
||||
@ -1126,12 +1135,10 @@ skl_get_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&skl_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
i915->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return _skl_get_buf_trans_dp(encoder, &skl_trans_edp, n_entries);
|
||||
else
|
||||
return _skl_get_buf_trans_dp(encoder, &skl_trans_dp, n_entries);
|
||||
@ -1142,12 +1149,10 @@ kbl_y_get_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&skl_y_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
i915->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return _skl_get_buf_trans_dp(encoder, &skl_y_trans_edp, n_entries);
|
||||
else
|
||||
return _skl_get_buf_trans_dp(encoder, &kbl_y_trans_dp, n_entries);
|
||||
@ -1158,12 +1163,10 @@ kbl_u_get_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&skl_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
i915->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return _skl_get_buf_trans_dp(encoder, &skl_u_trans_edp, n_entries);
|
||||
else
|
||||
return _skl_get_buf_trans_dp(encoder, &kbl_u_trans_dp, n_entries);
|
||||
@ -1174,12 +1177,10 @@ kbl_get_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&skl_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
i915->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return _skl_get_buf_trans_dp(encoder, &skl_trans_edp, n_entries);
|
||||
else
|
||||
return _skl_get_buf_trans_dp(encoder, &kbl_trans_dp, n_entries);
|
||||
@ -1190,12 +1191,10 @@ bxt_get_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&bxt_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
i915->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return intel_get_buf_trans(&bxt_trans_edp, n_entries);
|
||||
else
|
||||
return intel_get_buf_trans(&bxt_trans_dp, n_entries);
|
||||
@ -1215,12 +1214,10 @@ icl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
|
||||
if (crtc_state->port_clock > 540000) {
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_dp_hbr2_edp_hbr3,
|
||||
n_entries);
|
||||
} else if (dev_priv->vbt.edp.low_vswing) {
|
||||
} else if (use_edp_low_vswing(encoder)) {
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_edp_hbr2,
|
||||
n_entries);
|
||||
}
|
||||
@ -1282,12 +1279,10 @@ ehl_get_combo_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
dev_priv->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return ehl_get_combo_buf_trans_edp(encoder, crtc_state, n_entries);
|
||||
else
|
||||
return intel_get_buf_trans(&ehl_combo_phy_trans_dp, n_entries);
|
||||
@ -1309,12 +1304,10 @@ jsl_get_combo_buf_trans(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_hdmi, n_entries);
|
||||
else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP) &&
|
||||
dev_priv->vbt.edp.low_vswing)
|
||||
use_edp_low_vswing(encoder))
|
||||
return jsl_get_combo_buf_trans_edp(encoder, crtc_state, n_entries);
|
||||
else
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_dp_hbr2_edp_hbr3, n_entries);
|
||||
@ -1346,16 +1339,13 @@ tgl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||
|
||||
if (crtc_state->port_clock > 540000) {
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_dp_hbr2_edp_hbr3,
|
||||
n_entries);
|
||||
} else if (dev_priv->vbt.edp.hobl && !intel_dp->hobl_failed) {
|
||||
} else if (use_edp_hobl(encoder)) {
|
||||
return intel_get_buf_trans(&tgl_combo_phy_trans_edp_hbr2_hobl,
|
||||
n_entries);
|
||||
} else if (dev_priv->vbt.edp.low_vswing) {
|
||||
} else if (use_edp_low_vswing(encoder)) {
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_edp_hbr2,
|
||||
n_entries);
|
||||
}
|
||||
@ -1394,16 +1384,13 @@ dg1_get_combo_buf_trans_edp(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||
|
||||
if (crtc_state->port_clock > 540000)
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_dp_hbr2_edp_hbr3,
|
||||
n_entries);
|
||||
else if (dev_priv->vbt.edp.hobl && !intel_dp->hobl_failed)
|
||||
else if (use_edp_hobl(encoder))
|
||||
return intel_get_buf_trans(&tgl_combo_phy_trans_edp_hbr2_hobl,
|
||||
n_entries);
|
||||
else if (dev_priv->vbt.edp.low_vswing)
|
||||
else if (use_edp_low_vswing(encoder))
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_edp_hbr2,
|
||||
n_entries);
|
||||
else
|
||||
@ -1439,16 +1426,13 @@ rkl_get_combo_buf_trans_edp(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||
|
||||
if (crtc_state->port_clock > 540000) {
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_dp_hbr2_edp_hbr3,
|
||||
n_entries);
|
||||
} else if (dev_priv->vbt.edp.hobl && !intel_dp->hobl_failed) {
|
||||
} else if (use_edp_hobl(encoder)) {
|
||||
return intel_get_buf_trans(&tgl_combo_phy_trans_edp_hbr2_hobl,
|
||||
n_entries);
|
||||
} else if (dev_priv->vbt.edp.low_vswing) {
|
||||
} else if (use_edp_low_vswing(encoder)) {
|
||||
return intel_get_buf_trans(&icl_combo_phy_trans_edp_hbr2,
|
||||
n_entries);
|
||||
}
|
||||
@ -1485,14 +1469,11 @@ adls_get_combo_buf_trans_edp(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||
|
||||
if (crtc_state->port_clock > 540000)
|
||||
return intel_get_buf_trans(&adls_combo_phy_trans_edp_hbr3, n_entries);
|
||||
else if (i915->vbt.edp.hobl && !intel_dp->hobl_failed)
|
||||
else if (use_edp_hobl(encoder))
|
||||
return intel_get_buf_trans(&tgl_combo_phy_trans_edp_hbr2_hobl, n_entries);
|
||||
else if (i915->vbt.edp.low_vswing)
|
||||
else if (use_edp_low_vswing(encoder))
|
||||
return intel_get_buf_trans(&adls_combo_phy_trans_edp_hbr2, n_entries);
|
||||
else
|
||||
return adls_get_combo_buf_trans_dp(encoder, crtc_state, n_entries);
|
||||
@ -1527,16 +1508,13 @@ adlp_get_combo_buf_trans_edp(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int *n_entries)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||
|
||||
if (crtc_state->port_clock > 540000) {
|
||||
return intel_get_buf_trans(&adlp_combo_phy_trans_edp_hbr3,
|
||||
n_entries);
|
||||
} else if (dev_priv->vbt.edp.hobl && !intel_dp->hobl_failed) {
|
||||
} else if (use_edp_hobl(encoder)) {
|
||||
return intel_get_buf_trans(&tgl_combo_phy_trans_edp_hbr2_hobl,
|
||||
n_entries);
|
||||
} else if (dev_priv->vbt.edp.low_vswing) {
|
||||
} else if (use_edp_low_vswing(encoder)) {
|
||||
return intel_get_buf_trans(&adlp_combo_phy_trans_edp_up_to_hbr2,
|
||||
n_entries);
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/dma-resv.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/vga_switcheroo.h>
|
||||
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
@ -41,6 +42,7 @@
|
||||
#include <drm/drm_edid.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
#include <drm/drm_plane_helper.h>
|
||||
#include <drm/drm_privacy_screen_consumer.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
#include <drm/drm_rect.h>
|
||||
|
||||
@ -697,7 +699,7 @@ u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
|
||||
* the highest stride limits of them all,
|
||||
* if in case pipe A is disabled, use the first pipe from pipe_mask.
|
||||
*/
|
||||
crtc = intel_get_first_crtc(dev_priv);
|
||||
crtc = intel_first_crtc(dev_priv);
|
||||
if (!crtc)
|
||||
return 0;
|
||||
|
||||
@ -775,7 +777,7 @@ void intel_plane_disable_noatomic(struct intel_crtc *crtc,
|
||||
*/
|
||||
if (HAS_GMCH(dev_priv) &&
|
||||
intel_set_memory_cxsr(dev_priv, false))
|
||||
intel_wait_for_vblank(dev_priv, crtc->pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
/*
|
||||
* Gen2 reports pipe underruns whenever all planes are disabled.
|
||||
@ -785,7 +787,7 @@ void intel_plane_disable_noatomic(struct intel_crtc *crtc,
|
||||
intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false);
|
||||
|
||||
intel_plane_disable_arm(plane, crtc_state);
|
||||
intel_wait_for_vblank(dev_priv, crtc->pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
@ -991,6 +993,10 @@ static void icl_set_pipe_chicken(const struct intel_crtc_state *crtc_state)
|
||||
else if (DISPLAY_VER(dev_priv) >= 13)
|
||||
tmp |= UNDERRUN_RECOVERY_DISABLE_ADLP;
|
||||
|
||||
/* Wa_14010547955:dg2 */
|
||||
if (IS_DG2_DISPLAY_STEP(dev_priv, STEP_B0, STEP_FOREVER))
|
||||
tmp |= DG2_RENDER_CCSTAG_4_3_EN;
|
||||
|
||||
intel_de_write(dev_priv, PIPE_CHICKEN(pipe), tmp);
|
||||
}
|
||||
|
||||
@ -1011,7 +1017,7 @@ bool intel_has_pending_fb_unpin(struct drm_i915_private *dev_priv)
|
||||
if (cleanup_done)
|
||||
continue;
|
||||
|
||||
drm_crtc_wait_one_vblank(crtc);
|
||||
intel_crtc_wait_for_next_vblank(to_intel_crtc(crtc));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1158,7 +1164,7 @@ void hsw_disable_ips(const struct intel_crtc_state *crtc_state)
|
||||
}
|
||||
|
||||
/* We need to wait for a vblank before we can disable the plane. */
|
||||
intel_wait_for_vblank(dev_priv, crtc->pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
}
|
||||
|
||||
static void intel_crtc_dpms_overlay_disable(struct intel_crtc *crtc)
|
||||
@ -1389,7 +1395,6 @@ static void intel_crtc_disable_flip_done(struct intel_atomic_state *state,
|
||||
static void intel_crtc_async_flip_disable_wa(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
const struct intel_crtc_state *old_crtc_state =
|
||||
intel_atomic_get_old_crtc_state(state, crtc);
|
||||
const struct intel_crtc_state *new_crtc_state =
|
||||
@ -1415,7 +1420,7 @@ static void intel_crtc_async_flip_disable_wa(struct intel_atomic_state *state,
|
||||
}
|
||||
|
||||
if (need_vbl_wait)
|
||||
intel_wait_for_vblank(i915, crtc->pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
}
|
||||
|
||||
static void intel_pre_plane_update(struct intel_atomic_state *state,
|
||||
@ -1434,7 +1439,7 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
|
||||
hsw_disable_ips(old_crtc_state);
|
||||
|
||||
if (intel_fbc_pre_update(state, crtc))
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
if (!needs_async_flip_vtd_wa(old_crtc_state) &&
|
||||
needs_async_flip_vtd_wa(new_crtc_state))
|
||||
@ -1466,7 +1471,7 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
|
||||
*/
|
||||
if (HAS_GMCH(dev_priv) && old_crtc_state->hw.active &&
|
||||
new_crtc_state->disable_cxsr && intel_set_memory_cxsr(dev_priv, false))
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
/*
|
||||
* IVB workaround: must disable low power watermarks for at least
|
||||
@ -1477,7 +1482,7 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
|
||||
*/
|
||||
if (old_crtc_state->hw.active &&
|
||||
new_crtc_state->disable_lp_wm && ilk_disable_lp_wm(dev_priv))
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
/*
|
||||
* If we're doing a modeset we don't need to do any
|
||||
@ -1893,8 +1898,8 @@ static void ilk_crtc_enable(struct intel_atomic_state *state,
|
||||
* in case there are more corner cases we don't know about.
|
||||
*/
|
||||
if (new_crtc_state->has_pch_encoder) {
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
}
|
||||
intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true);
|
||||
intel_set_pch_fifo_underrun_reporting(dev_priv, pipe, true);
|
||||
@ -2094,7 +2099,7 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,
|
||||
intel_encoders_enable(state, crtc);
|
||||
|
||||
if (psl_clkgate_wa) {
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
glk_pipe_scaler_clock_gating_wa(dev_priv, pipe, false);
|
||||
}
|
||||
|
||||
@ -2102,8 +2107,12 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,
|
||||
* to change the workaround. */
|
||||
hsw_workaround_pipe = new_crtc_state->hsw_workaround_pipe;
|
||||
if (IS_HASWELL(dev_priv) && hsw_workaround_pipe != INVALID_PIPE) {
|
||||
intel_wait_for_vblank(dev_priv, hsw_workaround_pipe);
|
||||
intel_wait_for_vblank(dev_priv, hsw_workaround_pipe);
|
||||
struct intel_crtc *wa_crtc;
|
||||
|
||||
wa_crtc = intel_crtc_for_pipe(dev_priv, hsw_workaround_pipe);
|
||||
|
||||
intel_crtc_wait_for_next_vblank(wa_crtc);
|
||||
intel_crtc_wait_for_next_vblank(wa_crtc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2529,7 +2538,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,
|
||||
|
||||
/* prevents spurious underruns */
|
||||
if (DISPLAY_VER(dev_priv) == 2)
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
}
|
||||
|
||||
static void i9xx_pfit_disable(const struct intel_crtc_state *old_crtc_state)
|
||||
@ -2560,7 +2569,7 @@ static void i9xx_crtc_disable(struct intel_atomic_state *state,
|
||||
* wait for planes to fully turn off before disabling the pipe.
|
||||
*/
|
||||
if (DISPLAY_VER(dev_priv) == 2)
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
intel_encoders_disable(state, crtc);
|
||||
|
||||
@ -4645,7 +4654,8 @@ found:
|
||||
drm_atomic_state_put(state);
|
||||
|
||||
/* let the connector get through one full cycle before testing */
|
||||
intel_wait_for_vblank(dev_priv, crtc->pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
return true;
|
||||
|
||||
fail:
|
||||
@ -4830,7 +4840,7 @@ intel_encoder_current_mode(struct intel_encoder *encoder)
|
||||
if (!encoder->get_hw_state(encoder, &pipe))
|
||||
return NULL;
|
||||
|
||||
crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
|
||||
mode = kzalloc(sizeof(*mode), GFP_KERNEL);
|
||||
if (!mode)
|
||||
@ -5159,13 +5169,13 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
|
||||
|
||||
if (icl_is_hdr_plane(dev_priv, plane->id)) {
|
||||
if (linked->id == PLANE_SPRITE5)
|
||||
plane_state->cus_ctl |= PLANE_CUS_PLANE_7;
|
||||
plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_7_ICL;
|
||||
else if (linked->id == PLANE_SPRITE4)
|
||||
plane_state->cus_ctl |= PLANE_CUS_PLANE_6;
|
||||
plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_6_ICL;
|
||||
else if (linked->id == PLANE_SPRITE3)
|
||||
plane_state->cus_ctl |= PLANE_CUS_PLANE_5_RKL;
|
||||
plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_5_RKL;
|
||||
else if (linked->id == PLANE_SPRITE2)
|
||||
plane_state->cus_ctl |= PLANE_CUS_PLANE_4_RKL;
|
||||
plane_state->cus_ctl |= PLANE_CUS_Y_PLANE_4_RKL;
|
||||
else
|
||||
MISSING_CASE(linked->id);
|
||||
}
|
||||
@ -7546,59 +7556,6 @@ static int intel_atomic_check_planes(struct intel_atomic_state *state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int intel_atomic_check_cdclk(struct intel_atomic_state *state,
|
||||
bool *need_cdclk_calc)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
const struct intel_cdclk_state *old_cdclk_state;
|
||||
const struct intel_cdclk_state *new_cdclk_state;
|
||||
struct intel_plane_state *plane_state;
|
||||
struct intel_bw_state *new_bw_state;
|
||||
struct intel_plane *plane;
|
||||
int min_cdclk = 0;
|
||||
enum pipe pipe;
|
||||
int ret;
|
||||
int i;
|
||||
/*
|
||||
* active_planes bitmask has been updated, and potentially
|
||||
* affected planes are part of the state. We can now
|
||||
* compute the minimum cdclk for each plane.
|
||||
*/
|
||||
for_each_new_intel_plane_in_state(state, plane, plane_state, i) {
|
||||
ret = intel_plane_calc_min_cdclk(state, plane, need_cdclk_calc);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
old_cdclk_state = intel_atomic_get_old_cdclk_state(state);
|
||||
new_cdclk_state = intel_atomic_get_new_cdclk_state(state);
|
||||
|
||||
if (new_cdclk_state &&
|
||||
old_cdclk_state->force_min_cdclk != new_cdclk_state->force_min_cdclk)
|
||||
*need_cdclk_calc = true;
|
||||
|
||||
ret = intel_cdclk_bw_calc_min_cdclk(state);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
new_bw_state = intel_atomic_get_new_bw_state(state);
|
||||
|
||||
if (!new_cdclk_state || !new_bw_state)
|
||||
return 0;
|
||||
|
||||
for_each_pipe(dev_priv, pipe) {
|
||||
min_cdclk = max(new_cdclk_state->min_cdclk[pipe], min_cdclk);
|
||||
|
||||
/*
|
||||
* Currently do this change only if we need to increase
|
||||
*/
|
||||
if (new_bw_state->min_cdclk > min_cdclk)
|
||||
*need_cdclk_calc = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int intel_atomic_check_crtcs(struct intel_atomic_state *state)
|
||||
{
|
||||
struct intel_crtc_state *crtc_state;
|
||||
@ -8039,7 +7996,6 @@ static int intel_atomic_check(struct drm_device *dev,
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
intel_fbc_choose_crtc(dev_priv, state);
|
||||
ret = intel_compute_global_watermarks(state);
|
||||
if (ret)
|
||||
goto fail;
|
||||
@ -8048,7 +8004,7 @@ static int intel_atomic_check(struct drm_device *dev,
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
ret = intel_atomic_check_cdclk(state, &any_ms);
|
||||
ret = intel_cdclk_atomic_check(state, &any_ms);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
@ -8071,6 +8027,10 @@ static int intel_atomic_check(struct drm_device *dev,
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
ret = intel_fbc_atomic_check(state);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
|
||||
new_crtc_state, i) {
|
||||
if (new_crtc_state->uapi.async_flip) {
|
||||
@ -8462,7 +8422,7 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)
|
||||
if (!skl_ddb_entry_equal(&new_crtc_state->wm.skl.ddb,
|
||||
&old_crtc_state->wm.skl.ddb) &&
|
||||
(update_pipes | modeset_pipes))
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -8962,8 +8922,8 @@ static void intel_plane_possible_crtcs_init(struct drm_i915_private *dev_priv)
|
||||
struct intel_plane *plane;
|
||||
|
||||
for_each_intel_plane(&dev_priv->drm, plane) {
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv,
|
||||
plane->pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv,
|
||||
plane->pipe);
|
||||
|
||||
plane->base.possible_crtcs = drm_crtc_mask(&crtc->base);
|
||||
}
|
||||
@ -9956,7 +9916,7 @@ int intel_modeset_init(struct drm_i915_private *i915)
|
||||
|
||||
void i830_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
{
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
/* 640x480@60Hz, ~25175 kHz */
|
||||
struct dpll clock = {
|
||||
.m1 = 18,
|
||||
@ -10029,7 +9989,7 @@ void i830_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
|
||||
void i830_disable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
{
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "disabling pipe %c due to force quirk\n",
|
||||
pipe_name(pipe));
|
||||
@ -10081,7 +10041,7 @@ intel_sanitize_plane_mapping(struct drm_i915_private *dev_priv)
|
||||
"[PLANE:%d:%s] attached to the wrong pipe, disabling plane\n",
|
||||
plane->base.base.id, plane->base.name);
|
||||
|
||||
plane_crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
plane_crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
intel_plane_disable_noatomic(plane_crtc, plane);
|
||||
}
|
||||
}
|
||||
@ -10334,7 +10294,7 @@ static void readout_plane_state(struct drm_i915_private *dev_priv)
|
||||
|
||||
visible = plane->get_hw_state(plane, &pipe);
|
||||
|
||||
crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
crtc_state = to_intel_crtc_state(crtc->base.state);
|
||||
|
||||
intel_set_plane_visible(crtc_state, plane_state, visible);
|
||||
@ -10401,7 +10361,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
|
||||
pipe = 0;
|
||||
|
||||
if (encoder->get_hw_state(encoder, &pipe)) {
|
||||
crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
crtc_state = to_intel_crtc_state(crtc->base.state);
|
||||
|
||||
encoder->base.crtc = &crtc->base;
|
||||
@ -10854,6 +10814,27 @@ void intel_modeset_driver_remove_nogem(struct drm_i915_private *i915)
|
||||
intel_bios_driver_remove(i915);
|
||||
}
|
||||
|
||||
bool intel_modeset_probe_defer(struct pci_dev *pdev)
|
||||
{
|
||||
struct drm_privacy_screen *privacy_screen;
|
||||
|
||||
/*
|
||||
* apple-gmux is needed on dual GPU MacBook Pro
|
||||
* to probe the panel if we're the inactive GPU.
|
||||
*/
|
||||
if (vga_switcheroo_client_probe_defer(pdev))
|
||||
return true;
|
||||
|
||||
/* If the LCD panel has a privacy-screen, wait for it */
|
||||
privacy_screen = drm_privacy_screen_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(privacy_screen) && PTR_ERR(privacy_screen) == -EPROBE_DEFER)
|
||||
return true;
|
||||
|
||||
drm_privacy_screen_put(privacy_screen);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void intel_display_driver_register(struct drm_i915_private *i915)
|
||||
{
|
||||
if (!HAS_DISPLAY(i915))
|
||||
|
@ -57,6 +57,7 @@ struct intel_plane;
|
||||
struct intel_plane_state;
|
||||
struct intel_remapped_info;
|
||||
struct intel_rotation_info;
|
||||
struct pci_dev;
|
||||
|
||||
enum i915_gpio {
|
||||
GPIOA,
|
||||
@ -346,9 +347,33 @@ enum phy_fia {
|
||||
FIA3,
|
||||
};
|
||||
|
||||
enum hpd_pin {
|
||||
HPD_NONE = 0,
|
||||
HPD_TV = HPD_NONE, /* TV is known to be unreliable */
|
||||
HPD_CRT,
|
||||
HPD_SDVO_B,
|
||||
HPD_SDVO_C,
|
||||
HPD_PORT_A,
|
||||
HPD_PORT_B,
|
||||
HPD_PORT_C,
|
||||
HPD_PORT_D,
|
||||
HPD_PORT_E,
|
||||
HPD_PORT_TC1,
|
||||
HPD_PORT_TC2,
|
||||
HPD_PORT_TC3,
|
||||
HPD_PORT_TC4,
|
||||
HPD_PORT_TC5,
|
||||
HPD_PORT_TC6,
|
||||
|
||||
HPD_NUM_PINS
|
||||
};
|
||||
|
||||
#define for_each_hpd_pin(__pin) \
|
||||
for ((__pin) = (HPD_NONE + 1); (__pin) < HPD_NUM_PINS; (__pin)++)
|
||||
|
||||
#define for_each_pipe(__dev_priv, __p) \
|
||||
for ((__p) = 0; (__p) < I915_MAX_PIPES; (__p)++) \
|
||||
for_each_if(INTEL_INFO(__dev_priv)->pipe_mask & BIT(__p))
|
||||
for_each_if(INTEL_INFO(__dev_priv)->display.pipe_mask & BIT(__p))
|
||||
|
||||
#define for_each_pipe_masked(__dev_priv, __p, __mask) \
|
||||
for_each_pipe(__dev_priv, __p) \
|
||||
@ -356,7 +381,7 @@ enum phy_fia {
|
||||
|
||||
#define for_each_cpu_transcoder(__dev_priv, __t) \
|
||||
for ((__t) = 0; (__t) < I915_MAX_TRANSCODERS; (__t)++) \
|
||||
for_each_if (INTEL_INFO(__dev_priv)->cpu_transcoder_mask & BIT(__t))
|
||||
for_each_if (INTEL_INFO(__dev_priv)->display.cpu_transcoder_mask & BIT(__t))
|
||||
|
||||
#define for_each_cpu_transcoder_masked(__dev_priv, __t, __mask) \
|
||||
for_each_cpu_transcoder(__dev_priv, __t) \
|
||||
@ -616,6 +641,7 @@ void intel_display_driver_register(struct drm_i915_private *i915);
|
||||
void intel_display_driver_unregister(struct drm_i915_private *i915);
|
||||
|
||||
/* modesetting */
|
||||
bool intel_modeset_probe_defer(struct pci_dev *pdev);
|
||||
void intel_modeset_init_hw(struct drm_i915_private *i915);
|
||||
int intel_modeset_init_noirq(struct drm_i915_private *i915);
|
||||
int intel_modeset_init_nogem(struct drm_i915_private *i915);
|
||||
|
@ -40,52 +40,6 @@ static int i915_frontbuffer_tracking(struct seq_file *m, void *unused)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int i915_fbc_status(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = node_to_i915(m->private);
|
||||
struct intel_fbc *fbc = &dev_priv->fbc;
|
||||
intel_wakeref_t wakeref;
|
||||
|
||||
if (!HAS_FBC(dev_priv))
|
||||
return -ENODEV;
|
||||
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
mutex_lock(&fbc->lock);
|
||||
|
||||
if (intel_fbc_is_active(fbc)) {
|
||||
seq_puts(m, "FBC enabled\n");
|
||||
seq_printf(m, "Compressing: %s\n",
|
||||
yesno(intel_fbc_is_compressing(fbc)));
|
||||
} else {
|
||||
seq_printf(m, "FBC disabled: %s\n", fbc->no_fbc_reason);
|
||||
}
|
||||
|
||||
mutex_unlock(&fbc->lock);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int i915_fbc_false_color_get(void *data, u64 *val)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = data;
|
||||
|
||||
*val = dev_priv->fbc.false_color;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int i915_fbc_false_color_set(void *data, u64 val)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = data;
|
||||
|
||||
return intel_fbc_set_false_color(&dev_priv->fbc, val);
|
||||
}
|
||||
|
||||
DEFINE_SIMPLE_ATTRIBUTE(i915_fbc_false_color_fops,
|
||||
i915_fbc_false_color_get, i915_fbc_false_color_set,
|
||||
"%llu\n");
|
||||
|
||||
static int i915_ips_status(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = node_to_i915(m->private);
|
||||
@ -2044,9 +1998,7 @@ i915_fifo_underrun_reset_write(struct file *filp,
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = intel_fbc_reset_underrun(&dev_priv->fbc);
|
||||
if (ret)
|
||||
return ret;
|
||||
intel_fbc_reset_underrun(dev_priv);
|
||||
|
||||
return cnt;
|
||||
}
|
||||
@ -2060,7 +2012,6 @@ static const struct file_operations i915_fifo_underrun_reset_ops = {
|
||||
|
||||
static const struct drm_info_list intel_display_debugfs_list[] = {
|
||||
{"i915_frontbuffer_tracking", i915_frontbuffer_tracking, 0},
|
||||
{"i915_fbc_status", i915_fbc_status, 0},
|
||||
{"i915_ips_status", i915_ips_status, 0},
|
||||
{"i915_sr_status", i915_sr_status, 0},
|
||||
{"i915_opregion", i915_opregion, 0},
|
||||
@ -2085,7 +2036,6 @@ static const struct {
|
||||
{"i915_pri_wm_latency", &i915_pri_wm_latency_fops},
|
||||
{"i915_spr_wm_latency", &i915_spr_wm_latency_fops},
|
||||
{"i915_cur_wm_latency", &i915_cur_wm_latency_fops},
|
||||
{"i915_fbc_false_color", &i915_fbc_false_color_fops},
|
||||
{"i915_dp_test_data", &i915_displayport_test_data_fops},
|
||||
{"i915_dp_test_type", &i915_displayport_test_type_fops},
|
||||
{"i915_dp_test_active", &i915_displayport_test_active_fops},
|
||||
@ -2112,6 +2062,8 @@ void intel_display_debugfs_register(struct drm_i915_private *i915)
|
||||
drm_debugfs_create_files(intel_display_debugfs_list,
|
||||
ARRAY_SIZE(intel_display_debugfs_list),
|
||||
minor->debugfs_root, minor);
|
||||
|
||||
intel_fbc_debugfs_register(i915);
|
||||
}
|
||||
|
||||
static int i915_panel_show(struct seq_file *m, void *data)
|
||||
|
@ -5370,7 +5370,7 @@ static void gen12_dbuf_slices_config(struct drm_i915_private *dev_priv)
|
||||
|
||||
static void icl_mbus_init(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
unsigned long abox_regs = INTEL_INFO(dev_priv)->abox_mask;
|
||||
unsigned long abox_regs = INTEL_INFO(dev_priv)->display.abox_mask;
|
||||
u32 mask, val, i;
|
||||
|
||||
if (IS_ALDERLAKE_P(dev_priv))
|
||||
@ -5830,7 +5830,7 @@ static void tgl_bw_buddy_init(struct drm_i915_private *dev_priv)
|
||||
enum intel_dram_type type = dev_priv->dram_info.type;
|
||||
u8 num_channels = dev_priv->dram_info.num_channels;
|
||||
const struct buddy_page_mask *table;
|
||||
unsigned long abox_mask = INTEL_INFO(dev_priv)->abox_mask;
|
||||
unsigned long abox_mask = INTEL_INFO(dev_priv)->display.abox_mask;
|
||||
int config, i;
|
||||
|
||||
/* BW_BUDDY registers are not used on dgpu's beyond DG1 */
|
||||
|
9
drivers/gpu/drm/i915/display/intel_display_trace.c
Normal file
9
drivers/gpu/drm/i915/display/intel_display_trace.c
Normal file
@ -0,0 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright © 2021 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __CHECKER__
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include "intel_display_trace.h"
|
||||
#endif
|
587
drivers/gpu/drm/i915/display/intel_display_trace.h
Normal file
587
drivers/gpu/drm/i915/display/intel_display_trace.h
Normal file
@ -0,0 +1,587 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright © 2021 Intel Corporation
|
||||
*/
|
||||
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM i915
|
||||
|
||||
#if !defined(__INTEL_DISPLAY_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define __INTEL_DISPLAY_TRACE_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_display_types.h"
|
||||
|
||||
TRACE_EVENT(intel_pipe_enable,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array(u32, frame, 3)
|
||||
__array(u32, scanline, 3)
|
||||
__field(enum pipe, pipe)
|
||||
),
|
||||
TP_fast_assign(
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_crtc *it__;
|
||||
for_each_intel_crtc(&dev_priv->drm, it__) {
|
||||
__entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
|
||||
__entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
|
||||
}
|
||||
__entry->pipe = crtc->pipe;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c enable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe),
|
||||
__entry->frame[PIPE_A], __entry->scanline[PIPE_A],
|
||||
__entry->frame[PIPE_B], __entry->scanline[PIPE_B],
|
||||
__entry->frame[PIPE_C], __entry->scanline[PIPE_C])
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_disable,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array(u32, frame, 3)
|
||||
__array(u32, scanline, 3)
|
||||
__field(enum pipe, pipe)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_crtc *it__;
|
||||
for_each_intel_crtc(&dev_priv->drm, it__) {
|
||||
__entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
|
||||
__entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
|
||||
}
|
||||
__entry->pipe = crtc->pipe;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c disable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe),
|
||||
__entry->frame[PIPE_A], __entry->scanline[PIPE_A],
|
||||
__entry->frame[PIPE_B], __entry->scanline[PIPE_B],
|
||||
__entry->frame[PIPE_C], __entry->scanline[PIPE_C])
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_crc,
|
||||
TP_PROTO(struct intel_crtc *crtc, const u32 *crcs),
|
||||
TP_ARGS(crtc, crcs),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__array(u32, crcs, 5)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
memcpy(__entry->crcs, crcs, sizeof(__entry->crcs));
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u crc=%08x %08x %08x %08x %08x",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline,
|
||||
__entry->crcs[0], __entry->crcs[1], __entry->crcs[2],
|
||||
__entry->crcs[3], __entry->crcs[4])
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_cpu_fifo_underrun,
|
||||
TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe),
|
||||
TP_ARGS(dev_priv, pipe),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
__entry->pipe = pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe),
|
||||
__entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pch_fifo_underrun,
|
||||
TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pch_transcoder),
|
||||
TP_ARGS(dev_priv, pch_transcoder),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
enum pipe pipe = pch_transcoder;
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
__entry->pipe = pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pch transcoder %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe),
|
||||
__entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_memory_cxsr,
|
||||
TP_PROTO(struct drm_i915_private *dev_priv, bool old, bool new),
|
||||
TP_ARGS(dev_priv, old, new),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array(u32, frame, 3)
|
||||
__array(u32, scanline, 3)
|
||||
__field(bool, old)
|
||||
__field(bool, new)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct intel_crtc *crtc;
|
||||
for_each_intel_crtc(&dev_priv->drm, crtc) {
|
||||
__entry->frame[crtc->pipe] = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline[crtc->pipe] = intel_get_crtc_scanline(crtc);
|
||||
}
|
||||
__entry->old = old;
|
||||
__entry->new = new;
|
||||
),
|
||||
|
||||
TP_printk("%s->%s, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
|
||||
onoff(__entry->old), onoff(__entry->new),
|
||||
__entry->frame[PIPE_A], __entry->scanline[PIPE_A],
|
||||
__entry->frame[PIPE_B], __entry->scanline[PIPE_B],
|
||||
__entry->frame[PIPE_C], __entry->scanline[PIPE_C])
|
||||
);
|
||||
|
||||
TRACE_EVENT(g4x_wm,
|
||||
TP_PROTO(struct intel_crtc *crtc, const struct g4x_wm_values *wm),
|
||||
TP_ARGS(crtc, wm),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u16, primary)
|
||||
__field(u16, sprite)
|
||||
__field(u16, cursor)
|
||||
__field(u16, sr_plane)
|
||||
__field(u16, sr_cursor)
|
||||
__field(u16, sr_fbc)
|
||||
__field(u16, hpll_plane)
|
||||
__field(u16, hpll_cursor)
|
||||
__field(u16, hpll_fbc)
|
||||
__field(bool, cxsr)
|
||||
__field(bool, hpll)
|
||||
__field(bool, fbc)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
__entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
|
||||
__entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
|
||||
__entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR];
|
||||
__entry->sr_plane = wm->sr.plane;
|
||||
__entry->sr_cursor = wm->sr.cursor;
|
||||
__entry->sr_fbc = wm->sr.fbc;
|
||||
__entry->hpll_plane = wm->hpll.plane;
|
||||
__entry->hpll_cursor = wm->hpll.cursor;
|
||||
__entry->hpll_fbc = wm->hpll.fbc;
|
||||
__entry->cxsr = wm->cxsr;
|
||||
__entry->hpll = wm->hpll_en;
|
||||
__entry->fbc = wm->fbc_en;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, wm %d/%d/%d, sr %s/%d/%d/%d, hpll %s/%d/%d/%d, fbc %s",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline,
|
||||
__entry->primary, __entry->sprite, __entry->cursor,
|
||||
yesno(__entry->cxsr), __entry->sr_plane, __entry->sr_cursor, __entry->sr_fbc,
|
||||
yesno(__entry->hpll), __entry->hpll_plane, __entry->hpll_cursor, __entry->hpll_fbc,
|
||||
yesno(__entry->fbc))
|
||||
);
|
||||
|
||||
TRACE_EVENT(vlv_wm,
|
||||
TP_PROTO(struct intel_crtc *crtc, const struct vlv_wm_values *wm),
|
||||
TP_ARGS(crtc, wm),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u32, level)
|
||||
__field(u32, cxsr)
|
||||
__field(u32, primary)
|
||||
__field(u32, sprite0)
|
||||
__field(u32, sprite1)
|
||||
__field(u32, cursor)
|
||||
__field(u32, sr_plane)
|
||||
__field(u32, sr_cursor)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
__entry->level = wm->level;
|
||||
__entry->cxsr = wm->cxsr;
|
||||
__entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
|
||||
__entry->sprite0 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
|
||||
__entry->sprite1 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE1];
|
||||
__entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR];
|
||||
__entry->sr_plane = wm->sr.plane;
|
||||
__entry->sr_cursor = wm->sr.cursor;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, level=%d, cxsr=%d, wm %d/%d/%d/%d, sr %d/%d",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline, __entry->level, __entry->cxsr,
|
||||
__entry->primary, __entry->sprite0, __entry->sprite1, __entry->cursor,
|
||||
__entry->sr_plane, __entry->sr_cursor)
|
||||
);
|
||||
|
||||
TRACE_EVENT(vlv_fifo_size,
|
||||
TP_PROTO(struct intel_crtc *crtc, u32 sprite0_start, u32 sprite1_start, u32 fifo_size),
|
||||
TP_ARGS(crtc, sprite0_start, sprite1_start, fifo_size),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u32, sprite0_start)
|
||||
__field(u32, sprite1_start)
|
||||
__field(u32, fifo_size)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
__entry->sprite0_start = sprite0_start;
|
||||
__entry->sprite1_start = sprite1_start;
|
||||
__entry->fifo_size = fifo_size;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, %d/%d/%d",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline, __entry->sprite0_start,
|
||||
__entry->sprite1_start, __entry->fifo_size)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_plane_update_noarm,
|
||||
TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
|
||||
TP_ARGS(plane, crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__array(int, src, 4)
|
||||
__array(int, dst, 4)
|
||||
__string(name, plane->name)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, plane->name);
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
|
||||
memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
|
||||
pipe_name(__entry->pipe), __get_str(name),
|
||||
__entry->frame, __entry->scanline,
|
||||
DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src),
|
||||
DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_plane_update_arm,
|
||||
TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
|
||||
TP_ARGS(plane, crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__array(int, src, 4)
|
||||
__array(int, dst, 4)
|
||||
__string(name, plane->name)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, plane->name);
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
|
||||
memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
|
||||
pipe_name(__entry->pipe), __get_str(name),
|
||||
__entry->frame, __entry->scanline,
|
||||
DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src),
|
||||
DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_plane_disable_arm,
|
||||
TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
|
||||
TP_ARGS(plane, crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__string(name, plane->name)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, plane->name);
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, plane %s, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __get_str(name),
|
||||
__entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_fbc_activate,
|
||||
TP_PROTO(struct intel_plane *plane),
|
||||
TP_ARGS(plane),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev),
|
||||
plane->pipe);
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_fbc_deactivate,
|
||||
TP_PROTO(struct intel_plane *plane),
|
||||
TP_ARGS(plane),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev),
|
||||
plane->pipe);
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_fbc_nuke,
|
||||
TP_PROTO(struct intel_plane *plane),
|
||||
TP_ARGS(plane),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(plane->base.dev),
|
||||
plane->pipe);
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_crtc_vblank_work_start,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_crtc_vblank_work_end,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_update_start,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u32, min)
|
||||
__field(u32, max)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
__entry->min = crtc->debug.min_vbl;
|
||||
__entry->max = crtc->debug.max_vbl;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline, __entry->min, __entry->max)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_update_vblank_evaded,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u32, min)
|
||||
__field(u32, max)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = crtc->debug.start_vbl_count;
|
||||
__entry->scanline = crtc->debug.scanline_start;
|
||||
__entry->min = crtc->debug.min_vbl;
|
||||
__entry->max = crtc->debug.max_vbl;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline, __entry->min, __entry->max)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_update_end,
|
||||
TP_PROTO(struct intel_crtc *crtc, u32 frame, int scanline_end),
|
||||
TP_ARGS(crtc, frame, scanline_end),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = frame;
|
||||
__entry->scanline = scanline_end;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_frontbuffer_invalidate,
|
||||
TP_PROTO(unsigned int frontbuffer_bits, unsigned int origin),
|
||||
TP_ARGS(frontbuffer_bits, origin),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(unsigned int, frontbuffer_bits)
|
||||
__field(unsigned int, origin)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->frontbuffer_bits = frontbuffer_bits;
|
||||
__entry->origin = origin;
|
||||
),
|
||||
|
||||
TP_printk("frontbuffer_bits=0x%08x, origin=%u",
|
||||
__entry->frontbuffer_bits, __entry->origin)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_frontbuffer_flush,
|
||||
TP_PROTO(unsigned int frontbuffer_bits, unsigned int origin),
|
||||
TP_ARGS(frontbuffer_bits, origin),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(unsigned int, frontbuffer_bits)
|
||||
__field(unsigned int, origin)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->frontbuffer_bits = frontbuffer_bits;
|
||||
__entry->origin = origin;
|
||||
),
|
||||
|
||||
TP_printk("frontbuffer_bits=0x%08x, origin=%u",
|
||||
__entry->frontbuffer_bits, __entry->origin)
|
||||
);
|
||||
|
||||
#endif /* __INTEL_DISPLAY_TRACE_H__ */
|
||||
|
||||
/* This part must be outside protection */
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#undef TRACE_INCLUDE_FILE
|
||||
#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915/display
|
||||
#define TRACE_INCLUDE_FILE intel_display_trace
|
||||
#include <trace/define_trace.h>
|
@ -36,6 +36,7 @@
|
||||
#include <drm/drm_crtc.h>
|
||||
#include <drm/drm_dp_dual_mode_helper.h>
|
||||
#include <drm/drm_dp_mst_helper.h>
|
||||
#include <drm/drm_dsc.h>
|
||||
#include <drm/drm_encoder.h>
|
||||
#include <drm/drm_fb_helper.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
@ -46,12 +47,19 @@
|
||||
#include <drm/i915_mei_hdcp_interface.h>
|
||||
#include <media/cec-notifier.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_vma.h"
|
||||
#include "i915_vma_types.h"
|
||||
#include "intel_bios.h"
|
||||
#include "intel_display.h"
|
||||
#include "intel_display_power.h"
|
||||
#include "intel_dpll_mgr.h"
|
||||
#include "intel_pm_types.h"
|
||||
|
||||
struct drm_printer;
|
||||
struct __intel_global_objs_state;
|
||||
struct intel_ddi_buf_trans;
|
||||
struct intel_fbc;
|
||||
struct intel_connector;
|
||||
|
||||
/*
|
||||
* Display related stuff
|
||||
@ -687,6 +695,8 @@ struct intel_plane_state {
|
||||
|
||||
/* Clear Color Value */
|
||||
u64 ccval;
|
||||
|
||||
const char *no_fbc_reason;
|
||||
};
|
||||
|
||||
struct intel_initial_plane_config {
|
||||
@ -1117,8 +1127,6 @@ struct intel_crtc_state {
|
||||
|
||||
bool crc_enabled;
|
||||
|
||||
bool enable_fbc;
|
||||
|
||||
bool double_wide;
|
||||
|
||||
int pbn;
|
||||
@ -1773,35 +1781,6 @@ vlv_pipe_to_channel(enum pipe pipe)
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool intel_pipe_valid(struct drm_i915_private *i915, enum pipe pipe)
|
||||
{
|
||||
return (pipe >= 0 &&
|
||||
pipe < ARRAY_SIZE(i915->pipe_to_crtc_mapping) &&
|
||||
INTEL_INFO(i915)->pipe_mask & BIT(pipe) &&
|
||||
i915->pipe_to_crtc_mapping[pipe]);
|
||||
}
|
||||
|
||||
static inline struct intel_crtc *
|
||||
intel_get_first_crtc(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
return to_intel_crtc(drm_crtc_from_index(&dev_priv->drm, 0));
|
||||
}
|
||||
|
||||
static inline struct intel_crtc *
|
||||
intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
{
|
||||
/* pipe_to_crtc_mapping may have hole on any of 3 display pipe system */
|
||||
drm_WARN_ON(&dev_priv->drm,
|
||||
!(INTEL_INFO(dev_priv)->pipe_mask & BIT(pipe)));
|
||||
return dev_priv->pipe_to_crtc_mapping[pipe];
|
||||
}
|
||||
|
||||
static inline struct intel_crtc *
|
||||
intel_get_crtc_for_plane(struct drm_i915_private *dev_priv, enum i9xx_plane_id plane)
|
||||
{
|
||||
return dev_priv->plane_to_crtc_mapping[plane];
|
||||
}
|
||||
|
||||
struct intel_load_detect_pipe {
|
||||
struct drm_atomic_state *restore_state;
|
||||
};
|
||||
@ -1911,11 +1890,7 @@ dp_to_lspcon(struct intel_dp *intel_dp)
|
||||
return &dp_to_dig_port(intel_dp)->lspcon;
|
||||
}
|
||||
|
||||
static inline struct drm_i915_private *
|
||||
dp_to_i915(struct intel_dp *intel_dp)
|
||||
{
|
||||
return to_i915(dp_to_dig_port(intel_dp)->base.base.dev);
|
||||
}
|
||||
#define dp_to_i915(__intel_dp) to_i915(dp_to_dig_port(__intel_dp)->base.base.dev)
|
||||
|
||||
#define CAN_PSR(intel_dp) ((intel_dp)->psr.sink_support && \
|
||||
(intel_dp)->psr.source_support)
|
||||
@ -2019,33 +1994,6 @@ intel_crtc_needs_modeset(const struct intel_crtc_state *crtc_state)
|
||||
return drm_atomic_crtc_needs_modeset(&crtc_state->uapi);
|
||||
}
|
||||
|
||||
static inline void
|
||||
intel_wait_for_vblank(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
{
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
|
||||
drm_crtc_wait_one_vblank(&crtc->base);
|
||||
}
|
||||
|
||||
static inline void
|
||||
intel_wait_for_vblank_if_active(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
{
|
||||
const struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
|
||||
if (crtc->active)
|
||||
intel_wait_for_vblank(dev_priv, pipe);
|
||||
}
|
||||
|
||||
static inline bool intel_modifier_uses_dpt(struct drm_i915_private *i915, u64 modifier)
|
||||
{
|
||||
return DISPLAY_VER(i915) >= 13 && modifier != DRM_FORMAT_MOD_LINEAR;
|
||||
}
|
||||
|
||||
static inline bool intel_fb_uses_dpt(const struct drm_framebuffer *fb)
|
||||
{
|
||||
return fb && intel_modifier_uses_dpt(to_i915(fb->dev), fb->modifier);
|
||||
}
|
||||
|
||||
static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *plane_state)
|
||||
{
|
||||
return i915_ggtt_offset(plane_state->ggtt_vma);
|
||||
|
@ -45,8 +45,10 @@
|
||||
|
||||
#define GEN12_DMC_MAX_FW_SIZE ICL_DMC_MAX_FW_SIZE
|
||||
|
||||
#define ADLP_DMC_PATH DMC_PATH(adlp, 2, 12)
|
||||
#define ADLP_DMC_VERSION_REQUIRED DMC_VERSION(2, 12)
|
||||
#define GEN13_DMC_MAX_FW_SIZE 0x20000
|
||||
|
||||
#define ADLP_DMC_PATH DMC_PATH(adlp, 2, 14)
|
||||
#define ADLP_DMC_VERSION_REQUIRED DMC_VERSION(2, 14)
|
||||
MODULE_FIRMWARE(ADLP_DMC_PATH);
|
||||
|
||||
#define ADLS_DMC_PATH DMC_PATH(adls, 2, 01)
|
||||
@ -596,7 +598,7 @@ static void parse_dmc_fw(struct drm_i915_private *dev_priv,
|
||||
continue;
|
||||
|
||||
offset = readcount + dmc->dmc_info[id].dmc_offset * 4;
|
||||
if (fw->size - offset < 0) {
|
||||
if (offset > fw->size) {
|
||||
drm_err(&dev_priv->drm, "Reading beyond the fw_size\n");
|
||||
continue;
|
||||
}
|
||||
@ -682,7 +684,7 @@ void intel_dmc_ucode_init(struct drm_i915_private *dev_priv)
|
||||
if (IS_ALDERLAKE_P(dev_priv)) {
|
||||
dmc->fw_path = ADLP_DMC_PATH;
|
||||
dmc->required_version = ADLP_DMC_VERSION_REQUIRED;
|
||||
dmc->max_fw_size = GEN12_DMC_MAX_FW_SIZE;
|
||||
dmc->max_fw_size = GEN13_DMC_MAX_FW_SIZE;
|
||||
} else if (IS_ALDERLAKE_S(dev_priv)) {
|
||||
dmc->fw_path = ADLS_DMC_PATH;
|
||||
dmc->required_version = ADLS_DMC_VERSION_REQUIRED;
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "intel_audio.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_ddi.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
@ -3905,7 +3906,7 @@ int intel_dp_retrain_link(struct intel_encoder *encoder,
|
||||
to_intel_crtc_state(crtc->base.state);
|
||||
|
||||
/* Keep underrun reporting disabled until things are stable */
|
||||
intel_wait_for_vblank(dev_priv, crtc->pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, true);
|
||||
if (crtc_state->has_pch_encoder)
|
||||
|
@ -34,6 +34,7 @@
|
||||
* for some reason.
|
||||
*/
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp.h"
|
||||
|
@ -21,11 +21,11 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp.h"
|
||||
#include "intel_dp_link_training.h"
|
||||
|
||||
|
||||
static void intel_dp_reset_lttpr_common_caps(struct intel_dp *intel_dp)
|
||||
{
|
||||
memset(intel_dp->lttpr_common_caps, 0, sizeof(intel_dp->lttpr_common_caps));
|
||||
|
@ -1823,7 +1823,7 @@ void chv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
|
||||
const struct dpll *dpll)
|
||||
{
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
struct intel_crtc_state *crtc_state;
|
||||
|
||||
crtc_state = intel_crtc_state_alloc(crtc);
|
||||
|
@ -4,6 +4,8 @@
|
||||
*/
|
||||
|
||||
#include <drm/drm_mipi_dsi.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_dsi.h"
|
||||
#include "intel_panel.h"
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <drm/drm_framebuffer.h>
|
||||
#include <drm/drm_modeset_helper.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_display.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dpt.h"
|
||||
@ -658,6 +659,16 @@ static unsigned int intel_fb_modifier_to_tiling(u64 fb_modifier)
|
||||
}
|
||||
}
|
||||
|
||||
static bool intel_modifier_uses_dpt(struct drm_i915_private *i915, u64 modifier)
|
||||
{
|
||||
return DISPLAY_VER(i915) >= 13 && modifier != DRM_FORMAT_MOD_LINEAR;
|
||||
}
|
||||
|
||||
bool intel_fb_uses_dpt(const struct drm_framebuffer *fb)
|
||||
{
|
||||
return fb && intel_modifier_uses_dpt(to_i915(fb->dev), fb->modifier);
|
||||
}
|
||||
|
||||
unsigned int intel_cursor_alignment(const struct drm_i915_private *i915)
|
||||
{
|
||||
if (IS_I830(i915))
|
||||
|
@ -90,4 +90,6 @@ intel_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *filp,
|
||||
const struct drm_mode_fb_cmd2 *user_mode_cmd);
|
||||
|
||||
bool intel_fb_uses_dpt(const struct drm_framebuffer *fb);
|
||||
|
||||
#endif /* __INTEL_FB_H__ */
|
||||
|
@ -7,14 +7,14 @@
|
||||
* DOC: display pinning helpers
|
||||
*/
|
||||
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_fb_pin.h"
|
||||
#include "intel_fb.h"
|
||||
|
||||
#include "intel_dpt.h"
|
||||
|
||||
#include "gem/i915_gem_object.h"
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dpt.h"
|
||||
#include "intel_fb.h"
|
||||
#include "intel_fb_pin.h"
|
||||
|
||||
static struct i915_vma *
|
||||
intel_pin_fb_obj_dpt(struct drm_framebuffer *fb,
|
||||
const struct i915_ggtt_view *view,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,19 +8,16 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "intel_frontbuffer.h"
|
||||
|
||||
enum fb_op_origin;
|
||||
struct drm_i915_private;
|
||||
struct intel_atomic_state;
|
||||
struct intel_crtc;
|
||||
struct intel_crtc_state;
|
||||
struct intel_fbc;
|
||||
struct intel_plane;
|
||||
struct intel_plane_state;
|
||||
|
||||
void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
|
||||
struct intel_atomic_state *state);
|
||||
bool intel_fbc_is_active(struct intel_fbc *fbc);
|
||||
bool intel_fbc_is_compressing(struct intel_fbc *fbc);
|
||||
int intel_fbc_atomic_check(struct intel_atomic_state *state);
|
||||
bool intel_fbc_pre_update(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc);
|
||||
void intel_fbc_post_update(struct intel_atomic_state *state,
|
||||
@ -36,8 +33,9 @@ void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
|
||||
enum fb_op_origin origin);
|
||||
void intel_fbc_flush(struct drm_i915_private *dev_priv,
|
||||
unsigned int frontbuffer_bits, enum fb_op_origin origin);
|
||||
void intel_fbc_handle_fifo_underrun_irq(struct intel_fbc *fbc);
|
||||
int intel_fbc_reset_underrun(struct intel_fbc *fbc);
|
||||
int intel_fbc_set_false_color(struct intel_fbc *fbc, bool enable);
|
||||
void intel_fbc_add_plane(struct intel_fbc *fbc, struct intel_plane *plane);
|
||||
void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *i915);
|
||||
void intel_fbc_reset_underrun(struct drm_i915_private *i915);
|
||||
void intel_fbc_debugfs_register(struct drm_i915_private *i915);
|
||||
|
||||
#endif /* __INTEL_FBC_H__ */
|
||||
|
@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_ddi.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
@ -157,7 +158,7 @@ static int ilk_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,
|
||||
if (pipe_config->fdi_lanes <= 2)
|
||||
return 0;
|
||||
|
||||
other_crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_C);
|
||||
other_crtc = intel_crtc_for_pipe(dev_priv, PIPE_C);
|
||||
other_crtc_state =
|
||||
intel_atomic_get_crtc_state(state, other_crtc);
|
||||
if (IS_ERR(other_crtc_state))
|
||||
@ -178,7 +179,7 @@ static int ilk_check_fdi_lanes(struct drm_device *dev, enum pipe pipe,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
other_crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_B);
|
||||
other_crtc = intel_crtc_for_pipe(dev_priv, PIPE_B);
|
||||
other_crtc_state =
|
||||
intel_atomic_get_crtc_state(state, other_crtc);
|
||||
if (IS_ERR(other_crtc_state))
|
||||
|
@ -26,8 +26,8 @@
|
||||
*/
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_trace.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_trace.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_fbc.h"
|
||||
#include "intel_fifo_underrun.h"
|
||||
@ -61,7 +61,7 @@ static bool ivb_can_enable_err_int(struct drm_device *dev)
|
||||
lockdep_assert_held(&dev_priv->irq_lock);
|
||||
|
||||
for_each_pipe(dev_priv, pipe) {
|
||||
crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
|
||||
if (crtc->cpu_fifo_underrun_disabled)
|
||||
return false;
|
||||
@ -79,7 +79,7 @@ static bool cpt_can_enable_serr_int(struct drm_device *dev)
|
||||
lockdep_assert_held(&dev_priv->irq_lock);
|
||||
|
||||
for_each_pipe(dev_priv, pipe) {
|
||||
crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
|
||||
if (crtc->pch_fifo_underrun_disabled)
|
||||
return false;
|
||||
@ -279,7 +279,7 @@ static bool __intel_set_cpu_fifo_underrun_reporting(struct drm_device *dev,
|
||||
enum pipe pipe, bool enable)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
bool old;
|
||||
|
||||
lockdep_assert_held(&dev_priv->irq_lock);
|
||||
@ -348,7 +348,7 @@ bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv,
|
||||
bool enable)
|
||||
{
|
||||
struct intel_crtc *crtc =
|
||||
intel_get_crtc_for_pipe(dev_priv, pch_transcoder);
|
||||
intel_crtc_for_pipe(dev_priv, pch_transcoder);
|
||||
unsigned long flags;
|
||||
bool old;
|
||||
|
||||
@ -391,7 +391,7 @@ bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv,
|
||||
void intel_cpu_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
|
||||
enum pipe pipe)
|
||||
{
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
u32 underruns = 0;
|
||||
|
||||
/* We may be called too early in init, thanks BIOS! */
|
||||
@ -434,7 +434,7 @@ void intel_cpu_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv,
|
||||
drm_err(&dev_priv->drm, "CPU pipe %c FIFO underrun\n", pipe_name(pipe));
|
||||
}
|
||||
|
||||
intel_fbc_handle_fifo_underrun_irq(&dev_priv->fbc);
|
||||
intel_fbc_handle_fifo_underrun_irq(dev_priv);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -55,14 +55,13 @@
|
||||
* cancelled as soon as busyness is detected.
|
||||
*/
|
||||
|
||||
#include "display/intel_dp.h"
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_trace.h"
|
||||
#include "intel_display_trace.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp.h"
|
||||
#include "intel_drrs.h"
|
||||
#include "intel_fbc.h"
|
||||
#include "intel_frontbuffer.h"
|
||||
#include "intel_drrs.h"
|
||||
#include "intel_psr.h"
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <linux/kref.h>
|
||||
|
||||
#include "gem/i915_gem_object_types.h"
|
||||
#include "i915_active.h"
|
||||
#include "i915_active_types.h"
|
||||
|
||||
struct drm_i915_private;
|
||||
|
||||
|
@ -3,11 +3,12 @@
|
||||
* Copyright © 2021 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_plane_initial.h"
|
||||
#include "i915_drv.h"
|
||||
#include "intel_atomic_plane.h"
|
||||
#include "intel_display.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_fb.h"
|
||||
#include "intel_plane_initial.h"
|
||||
|
||||
static bool
|
||||
intel_reuse_initial_plane_obj(struct drm_i915_private *i915,
|
||||
|
@ -6,18 +6,19 @@
|
||||
#ifndef __INTEL_PSR_H__
|
||||
#define __INTEL_PSR_H__
|
||||
|
||||
#include "intel_frontbuffer.h"
|
||||
#include <linux/types.h>
|
||||
|
||||
enum fb_op_origin;
|
||||
struct drm_connector;
|
||||
struct drm_connector_state;
|
||||
struct drm_i915_private;
|
||||
struct intel_atomic_state;
|
||||
struct intel_crtc;
|
||||
struct intel_crtc_state;
|
||||
struct intel_dp;
|
||||
struct intel_crtc;
|
||||
struct intel_atomic_state;
|
||||
struct intel_plane_state;
|
||||
struct intel_plane;
|
||||
struct intel_encoder;
|
||||
struct intel_plane;
|
||||
struct intel_plane_state;
|
||||
|
||||
void intel_psr_init_dpcd(struct intel_dp *intel_dp);
|
||||
void intel_psr_pre_plane_update(struct intel_atomic_state *state,
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include <linux/dmi.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_quirks.h"
|
||||
|
||||
|
@ -1842,7 +1842,7 @@ static void intel_enable_sdvo(struct intel_atomic_state *state,
|
||||
intel_sdvo_write_sdvox(intel_sdvo, temp);
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
intel_wait_for_vblank(dev_priv, crtc->pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
success = intel_sdvo_get_trained_inputs(intel_sdvo, &input1, &input2);
|
||||
/*
|
||||
|
@ -186,6 +186,7 @@ static const struct intel_mpllb_state dg2_dp_uhbr10_100 = {
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) |
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_WORD_DIV2_EN, 1) |
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_DP2_MODE, 1) |
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_SHIM_DIV32_CLK_SEL, 1) |
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2),
|
||||
.mpllb_div2 =
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 2) |
|
||||
@ -369,6 +370,7 @@ static const struct intel_mpllb_state dg2_dp_uhbr10_38_4 = {
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_PMIX_EN, 1) |
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_WORD_DIV2_EN, 1) |
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_DP2_MODE, 1) |
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_SHIM_DIV32_CLK_SEL, 1) |
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_V2I, 2),
|
||||
.mpllb_div2 =
|
||||
REG_FIELD_PREP(SNPS_PHY_MPLLB_REF_CLK_DIV, 1) |
|
||||
|
@ -40,15 +40,15 @@
|
||||
#include <drm/drm_rect.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_trace.h"
|
||||
#include "i915_vgpu.h"
|
||||
#include "i9xx_plane.h"
|
||||
#include "intel_atomic_plane.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_fb.h"
|
||||
#include "intel_frontbuffer.h"
|
||||
#include "intel_sprite.h"
|
||||
#include "i9xx_plane.h"
|
||||
#include "intel_vrr.h"
|
||||
|
||||
int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state)
|
||||
@ -431,10 +431,6 @@ vlv_sprite_update_noarm(struct intel_plane *plane,
|
||||
u32 crtc_h = drm_rect_height(&plane_state->uapi.dst);
|
||||
unsigned long irqflags;
|
||||
|
||||
/* Sizes are 0 based */
|
||||
crtc_w--;
|
||||
crtc_h--;
|
||||
|
||||
spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
|
||||
|
||||
intel_de_write_fw(dev_priv, SPSTRIDE(pipe, plane_id),
|
||||
@ -442,7 +438,7 @@ vlv_sprite_update_noarm(struct intel_plane *plane,
|
||||
intel_de_write_fw(dev_priv, SPPOS(pipe, plane_id),
|
||||
(crtc_y << 16) | crtc_x);
|
||||
intel_de_write_fw(dev_priv, SPSIZE(pipe, plane_id),
|
||||
(crtc_h << 16) | crtc_w);
|
||||
((crtc_h - 1) << 16) | (crtc_w - 1));
|
||||
|
||||
spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
|
||||
}
|
||||
@ -866,21 +862,15 @@ ivb_sprite_update_noarm(struct intel_plane *plane,
|
||||
u32 sprscale = 0;
|
||||
unsigned long irqflags;
|
||||
|
||||
/* Sizes are 0 based */
|
||||
src_w--;
|
||||
src_h--;
|
||||
crtc_w--;
|
||||
crtc_h--;
|
||||
|
||||
if (crtc_w != src_w || crtc_h != src_h)
|
||||
sprscale = SPRITE_SCALE_ENABLE | (src_w << 16) | src_h;
|
||||
sprscale = SPRITE_SCALE_ENABLE | ((src_w - 1) << 16) | (src_h - 1);
|
||||
|
||||
spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
|
||||
|
||||
intel_de_write_fw(dev_priv, SPRSTRIDE(pipe),
|
||||
plane_state->view.color_plane[0].mapping_stride);
|
||||
intel_de_write_fw(dev_priv, SPRPOS(pipe), (crtc_y << 16) | crtc_x);
|
||||
intel_de_write_fw(dev_priv, SPRSIZE(pipe), (crtc_h << 16) | crtc_w);
|
||||
intel_de_write_fw(dev_priv, SPRSIZE(pipe), ((crtc_h - 1) << 16) | (crtc_w - 1));
|
||||
if (IS_IVYBRIDGE(dev_priv))
|
||||
intel_de_write_fw(dev_priv, SPRSCALE(pipe), sprscale);
|
||||
|
||||
@ -1208,21 +1198,15 @@ g4x_sprite_update_noarm(struct intel_plane *plane,
|
||||
u32 dvsscale = 0;
|
||||
unsigned long irqflags;
|
||||
|
||||
/* Sizes are 0 based */
|
||||
src_w--;
|
||||
src_h--;
|
||||
crtc_w--;
|
||||
crtc_h--;
|
||||
|
||||
if (crtc_w != src_w || crtc_h != src_h)
|
||||
dvsscale = DVS_SCALE_ENABLE | (src_w << 16) | src_h;
|
||||
dvsscale = DVS_SCALE_ENABLE | ((src_w - 1) << 16) | (src_h - 1);
|
||||
|
||||
spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
|
||||
|
||||
intel_de_write_fw(dev_priv, DVSSTRIDE(pipe),
|
||||
plane_state->view.color_plane[0].mapping_stride);
|
||||
intel_de_write_fw(dev_priv, DVSPOS(pipe), (crtc_y << 16) | crtc_x);
|
||||
intel_de_write_fw(dev_priv, DVSSIZE(pipe), (crtc_h << 16) | crtc_w);
|
||||
intel_de_write_fw(dev_priv, DVSSIZE(pipe), ((crtc_h - 1) << 16) | (crtc_w - 1));
|
||||
intel_de_write_fw(dev_priv, DVSSCALE(pipe), dvsscale);
|
||||
|
||||
spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
|
||||
@ -1584,8 +1568,8 @@ int intel_sprite_set_colorkey_ioctl(struct drm_device *dev, void *data,
|
||||
*/
|
||||
if (!ret && has_dst_key_in_primary_plane(dev_priv)) {
|
||||
struct intel_crtc *crtc =
|
||||
intel_get_crtc_for_pipe(dev_priv,
|
||||
to_intel_plane(plane)->pipe);
|
||||
intel_crtc_for_pipe(dev_priv,
|
||||
to_intel_plane(plane)->pipe);
|
||||
|
||||
plane_state = drm_atomic_get_plane_state(state,
|
||||
crtc->base.primary);
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_hotplug.h"
|
||||
@ -924,8 +925,7 @@ intel_enable_tv(struct intel_atomic_state *state,
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
|
||||
/* Prevents vblank waits from timing out in intel_tv_detect_type() */
|
||||
intel_wait_for_vblank(dev_priv,
|
||||
to_intel_crtc(pipe_config->uapi.crtc)->pipe);
|
||||
intel_crtc_wait_for_next_vblank(to_intel_crtc(pipe_config->uapi.crtc));
|
||||
|
||||
intel_de_write(dev_priv, TV_CTL,
|
||||
intel_de_read(dev_priv, TV_CTL) | TV_ENC_ENABLE);
|
||||
@ -1618,7 +1618,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
|
||||
intel_de_write(dev_priv, TV_DAC, tv_dac);
|
||||
intel_de_posting_read(dev_priv, TV_DAC);
|
||||
|
||||
intel_wait_for_vblank(dev_priv, crtc->pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
type = -1;
|
||||
tv_dac = intel_de_read(dev_priv, TV_DAC);
|
||||
@ -1651,7 +1651,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
|
||||
intel_de_posting_read(dev_priv, TV_CTL);
|
||||
|
||||
/* For unknown reasons the hw barfs if we don't do this vblank wait. */
|
||||
intel_wait_for_vblank(dev_priv, crtc->pipe);
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
/* Restore interrupt config */
|
||||
if (connector->polled & DRM_CONNECTOR_POLL_HPD) {
|
||||
|
@ -330,7 +330,12 @@ enum vbt_gmbus_ddi {
|
||||
ADLS_DDC_BUS_PORT_TC1 = 0x2,
|
||||
ADLS_DDC_BUS_PORT_TC2,
|
||||
ADLS_DDC_BUS_PORT_TC3,
|
||||
ADLS_DDC_BUS_PORT_TC4
|
||||
ADLS_DDC_BUS_PORT_TC4,
|
||||
ADLP_DDC_BUS_PORT_TC1 = 0x3,
|
||||
ADLP_DDC_BUS_PORT_TC2,
|
||||
ADLP_DDC_BUS_PORT_TC3,
|
||||
ADLP_DDC_BUS_PORT_TC4
|
||||
|
||||
};
|
||||
|
||||
#define DP_AUX_A 0x40
|
||||
|
@ -6,12 +6,14 @@
|
||||
* Manasi Navare <manasi.d.navare@intel.com>
|
||||
*/
|
||||
#include <linux/limits.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dsi.h"
|
||||
#include "intel_vdsc.h"
|
||||
#include "intel_qp_tables.h"
|
||||
#include "intel_vdsc.h"
|
||||
|
||||
enum ROW_INDEX_BPP {
|
||||
ROW_INDEX_6BPP = 0,
|
||||
@ -1110,25 +1112,16 @@ static i915_reg_t dss_ctl2_reg(struct intel_crtc *crtc, enum transcoder cpu_tran
|
||||
ICL_PIPE_DSS_CTL2(crtc->pipe) : DSS_CTL2;
|
||||
}
|
||||
|
||||
static struct intel_crtc *
|
||||
_get_crtc_for_pipe(struct drm_i915_private *i915, enum pipe pipe)
|
||||
{
|
||||
if (!intel_pipe_valid(i915, pipe))
|
||||
return NULL;
|
||||
|
||||
return intel_get_crtc_for_pipe(i915, pipe);
|
||||
}
|
||||
|
||||
struct intel_crtc *
|
||||
intel_dsc_get_bigjoiner_secondary(const struct intel_crtc *primary_crtc)
|
||||
{
|
||||
return _get_crtc_for_pipe(to_i915(primary_crtc->base.dev), primary_crtc->pipe + 1);
|
||||
return intel_crtc_for_pipe(to_i915(primary_crtc->base.dev), primary_crtc->pipe + 1);
|
||||
}
|
||||
|
||||
static struct intel_crtc *
|
||||
intel_dsc_get_bigjoiner_primary(const struct intel_crtc *secondary_crtc)
|
||||
{
|
||||
return _get_crtc_for_pipe(to_i915(secondary_crtc->base.dev), secondary_crtc->pipe - 1);
|
||||
return intel_crtc_for_pipe(to_i915(secondary_crtc->base.dev), secondary_crtc->pipe - 1);
|
||||
}
|
||||
|
||||
void intel_uncompressed_joiner_enable(const struct intel_crtc_state *crtc_state)
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_fb.h"
|
||||
#include "intel_fbc.h"
|
||||
#include "intel_pm.h"
|
||||
#include "intel_psr.h"
|
||||
#include "intel_sprite.h"
|
||||
@ -420,9 +421,19 @@ static int icl_plane_min_width(const struct drm_framebuffer *fb,
|
||||
}
|
||||
}
|
||||
|
||||
static int icl_plane_max_width(const struct drm_framebuffer *fb,
|
||||
int color_plane,
|
||||
unsigned int rotation)
|
||||
static int icl_hdr_plane_max_width(const struct drm_framebuffer *fb,
|
||||
int color_plane,
|
||||
unsigned int rotation)
|
||||
{
|
||||
if (intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier))
|
||||
return 4096;
|
||||
else
|
||||
return 5120;
|
||||
}
|
||||
|
||||
static int icl_sdr_plane_max_width(const struct drm_framebuffer *fb,
|
||||
int color_plane,
|
||||
unsigned int rotation)
|
||||
{
|
||||
return 5120;
|
||||
}
|
||||
@ -672,13 +683,13 @@ static u32 skl_plane_ctl_format(u32 pixel_format)
|
||||
case DRM_FORMAT_XYUV8888:
|
||||
return PLANE_CTL_FORMAT_XYUV;
|
||||
case DRM_FORMAT_YUYV:
|
||||
return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YUYV;
|
||||
return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_ORDER_YUYV;
|
||||
case DRM_FORMAT_YVYU:
|
||||
return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YVYU;
|
||||
return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_ORDER_YVYU;
|
||||
case DRM_FORMAT_UYVY:
|
||||
return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_UYVY;
|
||||
return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_ORDER_UYVY;
|
||||
case DRM_FORMAT_VYUY:
|
||||
return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_VYUY;
|
||||
return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_ORDER_VYUY;
|
||||
case DRM_FORMAT_NV12:
|
||||
return PLANE_CTL_FORMAT_NV12;
|
||||
case DRM_FORMAT_P010:
|
||||
@ -1022,10 +1033,6 @@ skl_program_plane_noarm(struct intel_plane *plane,
|
||||
u32 src_h = drm_rect_height(&plane_state->uapi.src) >> 16;
|
||||
unsigned long irqflags;
|
||||
|
||||
/* Sizes are 0 based */
|
||||
src_w--;
|
||||
src_h--;
|
||||
|
||||
/* The scaler will handle the output position */
|
||||
if (plane_state->scaler_id >= 0) {
|
||||
crtc_x = 0;
|
||||
@ -1045,7 +1052,14 @@ skl_program_plane_noarm(struct intel_plane *plane,
|
||||
intel_de_write_fw(dev_priv, PLANE_POS(pipe, plane_id),
|
||||
(crtc_y << 16) | crtc_x);
|
||||
intel_de_write_fw(dev_priv, PLANE_SIZE(pipe, plane_id),
|
||||
(src_h << 16) | src_w);
|
||||
((src_h - 1) << 16) | (src_w - 1));
|
||||
|
||||
if (intel_fb_is_rc_ccs_cc_modifier(fb->modifier)) {
|
||||
intel_de_write_fw(dev_priv, PLANE_CC_VAL(pipe, plane_id, 0),
|
||||
lower_32_bits(plane_state->ccval));
|
||||
intel_de_write_fw(dev_priv, PLANE_CC_VAL(pipe, plane_id, 1),
|
||||
upper_32_bits(plane_state->ccval));
|
||||
}
|
||||
|
||||
if (icl_is_hdr_plane(dev_priv, plane_id))
|
||||
intel_de_write_fw(dev_priv, PLANE_CUS_CTL(pipe, plane_id),
|
||||
@ -1054,10 +1068,6 @@ skl_program_plane_noarm(struct intel_plane *plane,
|
||||
if (fb->format->is_yuv && icl_is_hdr_plane(dev_priv, plane_id))
|
||||
icl_program_input_csc(plane, crtc_state, plane_state);
|
||||
|
||||
if (intel_fb_is_rc_ccs_cc_modifier(fb->modifier))
|
||||
intel_uncore_write64_fw(&dev_priv->uncore,
|
||||
PLANE_CC_VAL(pipe, plane_id), plane_state->ccval);
|
||||
|
||||
skl_write_plane_wm(plane, crtc_state);
|
||||
|
||||
intel_psr2_program_plane_sel_fetch(plane, crtc_state, plane_state, color_plane);
|
||||
@ -1815,6 +1825,15 @@ static bool skl_plane_has_fbc(struct drm_i915_private *dev_priv,
|
||||
return pipe == PIPE_A && plane_id == PLANE_PRIMARY;
|
||||
}
|
||||
|
||||
static struct intel_fbc *skl_plane_fbc(struct drm_i915_private *dev_priv,
|
||||
enum pipe pipe, enum plane_id plane_id)
|
||||
{
|
||||
if (skl_plane_has_fbc(dev_priv, pipe, plane_id))
|
||||
return dev_priv->fbc;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
|
||||
enum pipe pipe, enum plane_id plane_id)
|
||||
{
|
||||
@ -2101,14 +2120,14 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
|
||||
plane->id = plane_id;
|
||||
plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane_id);
|
||||
|
||||
if (skl_plane_has_fbc(dev_priv, pipe, plane_id))
|
||||
plane->fbc = &dev_priv->fbc;
|
||||
if (plane->fbc)
|
||||
plane->fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
|
||||
intel_fbc_add_plane(skl_plane_fbc(dev_priv, pipe, plane_id), plane);
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 11) {
|
||||
plane->min_width = icl_plane_min_width;
|
||||
plane->max_width = icl_plane_max_width;
|
||||
if (icl_is_hdr_plane(dev_priv, plane_id))
|
||||
plane->max_width = icl_hdr_plane_max_width;
|
||||
else
|
||||
plane->max_width = icl_sdr_plane_max_width;
|
||||
plane->max_height = icl_plane_max_height;
|
||||
plane->min_cdclk = icl_plane_min_cdclk;
|
||||
} else if (DISPLAY_VER(dev_priv) >= 10) {
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "i915_gem_ioctls.h"
|
||||
#include "i915_gem_object.h"
|
||||
#include "i915_gem_mman.h"
|
||||
#include "i915_mm.h"
|
||||
#include "i915_trace.h"
|
||||
#include "i915_user_extensions.h"
|
||||
#include "i915_gem_ttm.h"
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <linux/sched/mm.h>
|
||||
#include <linux/stop_machine.h>
|
||||
|
||||
#include "display/intel_display_types.h"
|
||||
#include "display/intel_display.h"
|
||||
#include "display/intel_overlay.h"
|
||||
|
||||
#include "gem/i915_gem_context.h"
|
||||
|
@ -43,7 +43,7 @@ static void measure_clocks(struct intel_engine_cs *engine,
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
preempt_disable();
|
||||
local_irq_disable();
|
||||
cycles[i] = -ENGINE_READ_FW(engine, RING_TIMESTAMP);
|
||||
dt[i] = ktime_get();
|
||||
|
||||
@ -51,7 +51,7 @@ static void measure_clocks(struct intel_engine_cs *engine,
|
||||
|
||||
dt[i] = ktime_sub(ktime_get(), dt[i]);
|
||||
cycles[i] += ENGINE_READ_FW(engine, RING_TIMESTAMP);
|
||||
preempt_enable();
|
||||
local_irq_enable();
|
||||
}
|
||||
|
||||
/* Use the median of both cycle/dt; close enough */
|
||||
|
@ -35,7 +35,7 @@ static void uc_expand_default_options(struct intel_uc *uc)
|
||||
}
|
||||
|
||||
/* Intermediate platforms are HuC authentication only */
|
||||
if (IS_ALDERLAKE_S(i915)) {
|
||||
if (IS_ALDERLAKE_S(i915) && !IS_ADLS_RPLS(i915)) {
|
||||
i915->params.enable_guc = ENABLE_GUC_LOAD_HUC;
|
||||
return;
|
||||
}
|
||||
|
@ -427,7 +427,7 @@ int intel_vgpu_decode_sprite_plane(struct intel_vgpu *vgpu,
|
||||
|
||||
plane->tiled = !!(val & SPRITE_TILED);
|
||||
color_order = !!(val & SPRITE_RGB_ORDER_RGBX);
|
||||
yuv_order = (val & SPRITE_YUV_BYTE_ORDER_MASK) >>
|
||||
yuv_order = (val & SPRITE_YUV_ORDER_MASK) >>
|
||||
_SPRITE_YUV_ORDER_SHIFT;
|
||||
|
||||
fmt = (val & SPRITE_PIXFORMAT_MASK) >> _SPRITE_FMT_SHIFT;
|
||||
|
@ -15,8 +15,6 @@
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
#include "i915_utils.h"
|
||||
|
||||
struct i915_active_fence {
|
||||
struct dma_fence __rcu *fence;
|
||||
struct dma_fence_cb cb;
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "i915_debugfs_params.h"
|
||||
#include "i915_irq.h"
|
||||
#include "i915_scheduler.h"
|
||||
#include "i915_trace.h"
|
||||
#include "intel_pm.h"
|
||||
|
||||
static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
|
||||
|
@ -82,7 +82,6 @@
|
||||
#include "i915_suspend.h"
|
||||
#include "i915_switcheroo.h"
|
||||
#include "i915_sysfs.h"
|
||||
#include "i915_trace.h"
|
||||
#include "i915_vgpu.h"
|
||||
#include "intel_dram.h"
|
||||
#include "intel_gvt.h"
|
||||
|
@ -89,6 +89,7 @@
|
||||
#include "intel_device_info.h"
|
||||
#include "intel_memory_region.h"
|
||||
#include "intel_pch.h"
|
||||
#include "intel_pm_types.h"
|
||||
#include "intel_runtime_pm.h"
|
||||
#include "intel_step.h"
|
||||
#include "intel_uncore.h"
|
||||
@ -116,30 +117,6 @@
|
||||
|
||||
struct drm_i915_gem_object;
|
||||
|
||||
enum hpd_pin {
|
||||
HPD_NONE = 0,
|
||||
HPD_TV = HPD_NONE, /* TV is known to be unreliable */
|
||||
HPD_CRT,
|
||||
HPD_SDVO_B,
|
||||
HPD_SDVO_C,
|
||||
HPD_PORT_A,
|
||||
HPD_PORT_B,
|
||||
HPD_PORT_C,
|
||||
HPD_PORT_D,
|
||||
HPD_PORT_E,
|
||||
HPD_PORT_TC1,
|
||||
HPD_PORT_TC2,
|
||||
HPD_PORT_TC3,
|
||||
HPD_PORT_TC4,
|
||||
HPD_PORT_TC5,
|
||||
HPD_PORT_TC6,
|
||||
|
||||
HPD_NUM_PINS
|
||||
};
|
||||
|
||||
#define for_each_hpd_pin(__pin) \
|
||||
for ((__pin) = (HPD_NONE + 1); (__pin) < HPD_NUM_PINS; (__pin)++)
|
||||
|
||||
/* Threshold == 5 for long IRQs, 50 for short */
|
||||
#define HPD_STORM_DEFAULT_THRESHOLD 50
|
||||
|
||||
@ -399,106 +376,8 @@ struct drm_i915_display_funcs {
|
||||
void (*commit_modeset_enables)(struct intel_atomic_state *state);
|
||||
};
|
||||
|
||||
struct intel_fbc_funcs;
|
||||
|
||||
#define I915_COLOR_UNEVICTABLE (-1) /* a non-vma sharing the address space */
|
||||
|
||||
struct intel_fbc {
|
||||
struct drm_i915_private *i915;
|
||||
const struct intel_fbc_funcs *funcs;
|
||||
|
||||
/* This is always the inner lock when overlapping with struct_mutex and
|
||||
* it's the outer lock when overlapping with stolen_lock. */
|
||||
struct mutex lock;
|
||||
unsigned int possible_framebuffer_bits;
|
||||
unsigned int busy_bits;
|
||||
struct intel_crtc *crtc;
|
||||
|
||||
struct drm_mm_node compressed_fb;
|
||||
struct drm_mm_node compressed_llb;
|
||||
|
||||
u8 limit;
|
||||
|
||||
bool false_color;
|
||||
|
||||
bool active;
|
||||
bool activated;
|
||||
bool flip_pending;
|
||||
|
||||
bool underrun_detected;
|
||||
struct work_struct underrun_work;
|
||||
|
||||
/*
|
||||
* Due to the atomic rules we can't access some structures without the
|
||||
* appropriate locking, so we cache information here in order to avoid
|
||||
* these problems.
|
||||
*/
|
||||
struct intel_fbc_state_cache {
|
||||
struct {
|
||||
unsigned int mode_flags;
|
||||
u32 hsw_bdw_pixel_rate;
|
||||
} crtc;
|
||||
|
||||
struct {
|
||||
unsigned int rotation;
|
||||
int src_w;
|
||||
int src_h;
|
||||
bool visible;
|
||||
/*
|
||||
* Display surface base address adjustement for
|
||||
* pageflips. Note that on gen4+ this only adjusts up
|
||||
* to a tile, offsets within a tile are handled in
|
||||
* the hw itself (with the TILEOFF register).
|
||||
*/
|
||||
int adjusted_x;
|
||||
int adjusted_y;
|
||||
|
||||
u16 pixel_blend_mode;
|
||||
} plane;
|
||||
|
||||
struct {
|
||||
const struct drm_format_info *format;
|
||||
unsigned int stride;
|
||||
u64 modifier;
|
||||
} fb;
|
||||
|
||||
unsigned int fence_y_offset;
|
||||
u16 interval;
|
||||
s8 fence_id;
|
||||
bool psr2_active;
|
||||
} state_cache;
|
||||
|
||||
/*
|
||||
* This structure contains everything that's relevant to program the
|
||||
* hardware registers. When we want to figure out if we need to disable
|
||||
* and re-enable FBC for a new configuration we just check if there's
|
||||
* something different in the struct. The genx_fbc_activate functions
|
||||
* are supposed to read from it in order to program the registers.
|
||||
*/
|
||||
struct intel_fbc_reg_params {
|
||||
struct {
|
||||
enum pipe pipe;
|
||||
enum i9xx_plane_id i9xx_plane;
|
||||
} crtc;
|
||||
|
||||
struct {
|
||||
const struct drm_format_info *format;
|
||||
unsigned int stride;
|
||||
u64 modifier;
|
||||
} fb;
|
||||
|
||||
unsigned int cfb_stride;
|
||||
unsigned int cfb_size;
|
||||
unsigned int fence_y_offset;
|
||||
u16 override_cfb_stride;
|
||||
u16 interval;
|
||||
s8 fence_id;
|
||||
bool plane_visible;
|
||||
} params;
|
||||
|
||||
const char *no_fbc_reason;
|
||||
};
|
||||
|
||||
/*
|
||||
* HIGH_RR is the highest eDP panel refresh rate read from EDID
|
||||
* LOW_RR is the lowest eDP panel refresh rate found from EDID
|
||||
@ -535,7 +414,6 @@ struct i915_drrs {
|
||||
#define QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK (1<<8)
|
||||
|
||||
struct intel_fbdev;
|
||||
struct intel_fbc_work;
|
||||
|
||||
struct intel_gmbus {
|
||||
struct i2c_adapter adapter;
|
||||
@ -730,69 +608,6 @@ struct intel_vbt_data {
|
||||
struct sdvo_device_mapping sdvo_mappings[2];
|
||||
};
|
||||
|
||||
enum intel_ddb_partitioning {
|
||||
INTEL_DDB_PART_1_2,
|
||||
INTEL_DDB_PART_5_6, /* IVB+ */
|
||||
};
|
||||
|
||||
struct ilk_wm_values {
|
||||
u32 wm_pipe[3];
|
||||
u32 wm_lp[3];
|
||||
u32 wm_lp_spr[3];
|
||||
bool enable_fbc_wm;
|
||||
enum intel_ddb_partitioning partitioning;
|
||||
};
|
||||
|
||||
struct g4x_pipe_wm {
|
||||
u16 plane[I915_MAX_PLANES];
|
||||
u16 fbc;
|
||||
};
|
||||
|
||||
struct g4x_sr_wm {
|
||||
u16 plane;
|
||||
u16 cursor;
|
||||
u16 fbc;
|
||||
};
|
||||
|
||||
struct vlv_wm_ddl_values {
|
||||
u8 plane[I915_MAX_PLANES];
|
||||
};
|
||||
|
||||
struct vlv_wm_values {
|
||||
struct g4x_pipe_wm pipe[3];
|
||||
struct g4x_sr_wm sr;
|
||||
struct vlv_wm_ddl_values ddl[3];
|
||||
u8 level;
|
||||
bool cxsr;
|
||||
};
|
||||
|
||||
struct g4x_wm_values {
|
||||
struct g4x_pipe_wm pipe[2];
|
||||
struct g4x_sr_wm sr;
|
||||
struct g4x_sr_wm hpll;
|
||||
bool cxsr;
|
||||
bool hpll_en;
|
||||
bool fbc_en;
|
||||
};
|
||||
|
||||
struct skl_ddb_entry {
|
||||
u16 start, end; /* in number of blocks, 'end' is exclusive */
|
||||
};
|
||||
|
||||
static inline u16 skl_ddb_entry_size(const struct skl_ddb_entry *entry)
|
||||
{
|
||||
return entry->end - entry->start;
|
||||
}
|
||||
|
||||
static inline bool skl_ddb_entry_equal(const struct skl_ddb_entry *e1,
|
||||
const struct skl_ddb_entry *e2)
|
||||
{
|
||||
if (e1->start == e2->start && e1->end == e2->end)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
struct i915_frontbuffer_tracking {
|
||||
spinlock_t lock;
|
||||
|
||||
@ -934,7 +749,7 @@ struct drm_i915_private {
|
||||
u32 pipestat_irq_mask[I915_MAX_PIPES];
|
||||
|
||||
struct i915_hotplug hotplug;
|
||||
struct intel_fbc fbc;
|
||||
struct intel_fbc *fbc;
|
||||
struct i915_drrs drrs;
|
||||
struct intel_opregion opregion;
|
||||
struct intel_vbt_data vbt;
|
||||
@ -1029,9 +844,6 @@ struct drm_i915_private {
|
||||
|
||||
/* Kernel Modesetting */
|
||||
|
||||
struct intel_crtc *plane_to_crtc_mapping[I915_MAX_PIPES];
|
||||
struct intel_crtc *pipe_to_crtc_mapping[I915_MAX_PIPES];
|
||||
|
||||
/**
|
||||
* dpll and cdclk state is protected by connection_mutex
|
||||
* dpll.lock serializes intel_{prepare,enable,disable}_shared_dpll.
|
||||
@ -1469,6 +1281,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
|
||||
IS_SUBPLATFORM(dev_priv, INTEL_DG2, INTEL_SUBPLATFORM_G10)
|
||||
#define IS_DG2_G11(dev_priv) \
|
||||
IS_SUBPLATFORM(dev_priv, INTEL_DG2, INTEL_SUBPLATFORM_G11)
|
||||
#define IS_ADLS_RPLS(dev_priv) \
|
||||
IS_SUBPLATFORM(dev_priv, INTEL_ALDERLAKE_S, INTEL_SUBPLATFORM_RPL_S)
|
||||
#define IS_HSW_EARLY_SDV(dev_priv) (IS_HASWELL(dev_priv) && \
|
||||
(INTEL_DEVID(dev_priv) & 0xFF00) == 0x0C00)
|
||||
#define IS_BDW_ULT(dev_priv) \
|
||||
@ -1598,7 +1412,7 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
|
||||
(IS_SUBPLATFORM(__i915, INTEL_DG2, INTEL_SUBPLATFORM_##variant) && \
|
||||
IS_GRAPHICS_STEP(__i915, since, until))
|
||||
|
||||
#define IS_DG2_DISP_STEP(__i915, since, until) \
|
||||
#define IS_DG2_DISPLAY_STEP(__i915, since, until) \
|
||||
(IS_DG2(__i915) && \
|
||||
IS_DISPLAY_STEP(__i915, since, until))
|
||||
|
||||
@ -1695,7 +1509,7 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
|
||||
#define HAS_PSR_HW_TRACKING(dev_priv) \
|
||||
(INTEL_INFO(dev_priv)->display.has_psr_hw_tracking)
|
||||
#define HAS_PSR2_SEL_FETCH(dev_priv) (GRAPHICS_VER(dev_priv) >= 12)
|
||||
#define HAS_TRANSCODER(dev_priv, trans) ((INTEL_INFO(dev_priv)->cpu_transcoder_mask & BIT(trans)) != 0)
|
||||
#define HAS_TRANSCODER(dev_priv, trans) ((INTEL_INFO(dev_priv)->display.cpu_transcoder_mask & BIT(trans)) != 0)
|
||||
|
||||
#define HAS_RC6(dev_priv) (INTEL_INFO(dev_priv)->has_rc6)
|
||||
#define HAS_RC6p(dev_priv) (INTEL_INFO(dev_priv)->has_rc6p)
|
||||
@ -1740,9 +1554,9 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
|
||||
#define GT_FREQUENCY_MULTIPLIER 50
|
||||
#define GEN9_FREQ_SCALER 3
|
||||
|
||||
#define INTEL_NUM_PIPES(dev_priv) (hweight8(INTEL_INFO(dev_priv)->pipe_mask))
|
||||
#define INTEL_NUM_PIPES(dev_priv) (hweight8(INTEL_INFO(dev_priv)->display.pipe_mask))
|
||||
|
||||
#define HAS_DISPLAY(dev_priv) (INTEL_INFO(dev_priv)->pipe_mask != 0)
|
||||
#define HAS_DISPLAY(dev_priv) (INTEL_INFO(dev_priv)->display.pipe_mask != 0)
|
||||
|
||||
#define HAS_VRR(i915) (GRAPHICS_VER(i915) >= 11)
|
||||
|
||||
@ -1968,14 +1782,6 @@ mkwrite_device_info(struct drm_i915_private *dev_priv)
|
||||
int i915_reg_read_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_file *file);
|
||||
|
||||
/* i915_mm.c */
|
||||
int remap_io_mapping(struct vm_area_struct *vma,
|
||||
unsigned long addr, unsigned long pfn, unsigned long size,
|
||||
struct io_mapping *iomap);
|
||||
int remap_io_sg(struct vm_area_struct *vma,
|
||||
unsigned long addr, unsigned long size,
|
||||
struct scatterlist *sgl, resource_size_t iobase);
|
||||
|
||||
static inline int intel_hws_csb_write_index(struct drm_i915_private *i915)
|
||||
{
|
||||
if (GRAPHICS_VER(i915) >= 11)
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <drm/drm_drv.h>
|
||||
|
||||
#include "display/intel_de.h"
|
||||
#include "display/intel_display_trace.h"
|
||||
#include "display/intel_display_types.h"
|
||||
#include "display/intel_fifo_underrun.h"
|
||||
#include "display/intel_hotplug.h"
|
||||
@ -49,7 +50,6 @@
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_irq.h"
|
||||
#include "i915_trace.h"
|
||||
#include "intel_pm.h"
|
||||
|
||||
/**
|
||||
@ -224,7 +224,7 @@ static void intel_hpd_init_pins(struct drm_i915_private *dev_priv)
|
||||
static void
|
||||
intel_handle_vblank(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
{
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
|
||||
drm_crtc_handle_vblank(&crtc->base);
|
||||
}
|
||||
@ -1318,7 +1318,7 @@ static void display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
|
||||
u32 crc2, u32 crc3,
|
||||
u32 crc4)
|
||||
{
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(dev_priv, pipe);
|
||||
struct intel_pipe_crc *pipe_crc = &crtc->pipe_crc;
|
||||
u32 crcs[5] = { crc0, crc1, crc2, crc3, crc4 };
|
||||
|
||||
@ -1357,7 +1357,7 @@ display_pipe_crc_irq_handler(struct drm_i915_private *dev_priv,
|
||||
static void flip_done_handler(struct drm_i915_private *i915,
|
||||
enum pipe pipe)
|
||||
{
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(i915, pipe);
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(i915, pipe);
|
||||
struct drm_crtc_state *crtc_state = crtc->base.state;
|
||||
struct drm_pending_vblank_event *e = crtc_state->event;
|
||||
struct drm_device *dev = &i915->drm;
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_mm.h"
|
||||
|
||||
struct remap_pfn {
|
||||
struct mm_struct *mm;
|
||||
@ -37,17 +38,6 @@ struct remap_pfn {
|
||||
resource_size_t iobase;
|
||||
};
|
||||
|
||||
static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
|
||||
{
|
||||
struct remap_pfn *r = data;
|
||||
|
||||
/* Special PTE are not associated with any struct page */
|
||||
set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
|
||||
r->pfn++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define use_dma(io) ((io) != -1)
|
||||
|
||||
static inline unsigned long sgt_pfn(const struct remap_pfn *r)
|
||||
@ -77,6 +67,20 @@ static int remap_sg(pte_t *pte, unsigned long addr, void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
|
||||
|
||||
#if IS_ENABLED(CONFIG_X86)
|
||||
static int remap_pfn(pte_t *pte, unsigned long addr, void *data)
|
||||
{
|
||||
struct remap_pfn *r = data;
|
||||
|
||||
/* Special PTE are not associated with any struct page */
|
||||
set_pte_at(r->mm, addr, pte, pte_mkspecial(pfn_pte(r->pfn, r->prot)));
|
||||
r->pfn++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* remap_io_mapping - remap an IO mapping to userspace
|
||||
* @vma: user vma to map to
|
||||
@ -94,7 +98,6 @@ int remap_io_mapping(struct vm_area_struct *vma,
|
||||
struct remap_pfn r;
|
||||
int err;
|
||||
|
||||
#define EXPECTED_FLAGS (VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP)
|
||||
GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
|
||||
|
||||
/* We rely on prevalidation of the io-mapping to skip track_pfn(). */
|
||||
@ -111,6 +114,7 @@ int remap_io_mapping(struct vm_area_struct *vma,
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* remap_io_sg - remap an IO mapping to userspace
|
||||
|
35
drivers/gpu/drm/i915/i915_mm.h
Normal file
35
drivers/gpu/drm/i915/i915_mm.h
Normal file
@ -0,0 +1,35 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2021 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __I915_MM_H__
|
||||
#define __I915_MM_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct vm_area_struct;
|
||||
struct io_mapping;
|
||||
struct scatterlist;
|
||||
|
||||
#if IS_ENABLED(CONFIG_X86)
|
||||
int remap_io_mapping(struct vm_area_struct *vma,
|
||||
unsigned long addr, unsigned long pfn, unsigned long size,
|
||||
struct io_mapping *iomap);
|
||||
#else
|
||||
static inline
|
||||
int remap_io_mapping(struct vm_area_struct *vma,
|
||||
unsigned long addr, unsigned long pfn, unsigned long size,
|
||||
struct io_mapping *iomap)
|
||||
{
|
||||
pr_err("Architecture has no %s() and shouldn't be calling this function\n", __func__);
|
||||
WARN_ON_ONCE(1);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int remap_io_sg(struct vm_area_struct *vma,
|
||||
unsigned long addr, unsigned long size,
|
||||
struct scatterlist *sgl, resource_size_t iobase);
|
||||
|
||||
#endif /* __I915_MM_H__ */
|
@ -22,8 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/vga_switcheroo.h>
|
||||
|
||||
#include <drm/drm_drv.h>
|
||||
#include <drm/i915_pciids.h>
|
||||
|
||||
@ -164,8 +162,8 @@
|
||||
#define I830_FEATURES \
|
||||
GEN(2), \
|
||||
.is_mobile = 1, \
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.has_overlay = 1, \
|
||||
.display.cursor_needs_physical = 1, \
|
||||
.display.overlay_needs_physical = 1, \
|
||||
@ -185,8 +183,8 @@
|
||||
|
||||
#define I845_FEATURES \
|
||||
GEN(2), \
|
||||
.pipe_mask = BIT(PIPE_A), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A), \
|
||||
.display.pipe_mask = BIT(PIPE_A), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A), \
|
||||
.display.has_overlay = 1, \
|
||||
.display.overlay_needs_physical = 1, \
|
||||
.display.has_gmch = 1, \
|
||||
@ -227,8 +225,8 @@ static const struct intel_device_info i865g_info = {
|
||||
|
||||
#define GEN3_FEATURES \
|
||||
GEN(3), \
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.has_gmch = 1, \
|
||||
.gpu_reset_clobbers_display = true, \
|
||||
.platform_engine_mask = BIT(RCS0), \
|
||||
@ -317,8 +315,8 @@ static const struct intel_device_info pnv_m_info = {
|
||||
|
||||
#define GEN4_FEATURES \
|
||||
GEN(4), \
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.has_hotplug = 1, \
|
||||
.display.has_gmch = 1, \
|
||||
.gpu_reset_clobbers_display = true, \
|
||||
@ -370,8 +368,8 @@ static const struct intel_device_info gm45_info = {
|
||||
|
||||
#define GEN5_FEATURES \
|
||||
GEN(5), \
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.has_hotplug = 1, \
|
||||
.platform_engine_mask = BIT(RCS0) | BIT(VCS0), \
|
||||
.has_snoop = true, \
|
||||
@ -400,8 +398,8 @@ static const struct intel_device_info ilk_m_info = {
|
||||
|
||||
#define GEN6_FEATURES \
|
||||
GEN(6), \
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B), \
|
||||
.display.has_hotplug = 1, \
|
||||
.display.has_fbc = 1, \
|
||||
.platform_engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0), \
|
||||
@ -451,8 +449,8 @@ static const struct intel_device_info snb_m_gt2_info = {
|
||||
|
||||
#define GEN7_FEATURES \
|
||||
GEN(7), \
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | BIT(TRANSCODER_C), \
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | BIT(TRANSCODER_C), \
|
||||
.display.has_hotplug = 1, \
|
||||
.display.has_fbc = 1, \
|
||||
.platform_engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0), \
|
||||
@ -506,8 +504,8 @@ static const struct intel_device_info ivb_q_info = {
|
||||
GEN7_FEATURES,
|
||||
PLATFORM(INTEL_IVYBRIDGE),
|
||||
.gt = 2,
|
||||
.pipe_mask = 0, /* legal, last one wins */
|
||||
.cpu_transcoder_mask = 0,
|
||||
.display.pipe_mask = 0, /* legal, last one wins */
|
||||
.display.cpu_transcoder_mask = 0,
|
||||
.has_l3_dpf = 1,
|
||||
};
|
||||
|
||||
@ -515,8 +513,8 @@ static const struct intel_device_info vlv_info = {
|
||||
PLATFORM(INTEL_VALLEYVIEW),
|
||||
GEN(7),
|
||||
.is_lp = 1,
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B),
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B),
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B),
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B),
|
||||
.has_runtime_pm = 1,
|
||||
.has_rc6 = 1,
|
||||
.has_reset_engine = true,
|
||||
@ -540,7 +538,7 @@ static const struct intel_device_info vlv_info = {
|
||||
#define G75_FEATURES \
|
||||
GEN7_FEATURES, \
|
||||
.platform_engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
|
||||
BIT(TRANSCODER_C) | BIT(TRANSCODER_EDP), \
|
||||
.display.has_ddi = 1, \
|
||||
.display.has_fpga_dbg = 1, \
|
||||
@ -610,8 +608,8 @@ static const struct intel_device_info bdw_gt3_info = {
|
||||
static const struct intel_device_info chv_info = {
|
||||
PLATFORM(INTEL_CHERRYVIEW),
|
||||
GEN(8),
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C),
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | BIT(TRANSCODER_C),
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C),
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | BIT(TRANSCODER_C),
|
||||
.display.has_hotplug = 1,
|
||||
.is_lp = 1,
|
||||
.platform_engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0),
|
||||
@ -688,8 +686,8 @@ static const struct intel_device_info skl_gt4_info = {
|
||||
.dbuf.slice_mask = BIT(DBUF_S1), \
|
||||
.display.has_hotplug = 1, \
|
||||
.platform_engine_mask = BIT(RCS0) | BIT(VCS0) | BIT(BCS0) | BIT(VECS0), \
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
|
||||
BIT(TRANSCODER_C) | BIT(TRANSCODER_EDP) | \
|
||||
BIT(TRANSCODER_DSI_A) | BIT(TRANSCODER_DSI_C), \
|
||||
.has_64bit_reloc = 1, \
|
||||
@ -797,8 +795,8 @@ static const struct intel_device_info cml_gt2_info = {
|
||||
#define GEN11_FEATURES \
|
||||
GEN9_FEATURES, \
|
||||
GEN11_DEFAULT_PAGE_SIZES, \
|
||||
.abox_mask = BIT(0), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
|
||||
.display.abox_mask = BIT(0), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
|
||||
BIT(TRANSCODER_C) | BIT(TRANSCODER_EDP) | \
|
||||
BIT(TRANSCODER_DSI_0) | BIT(TRANSCODER_DSI_1), \
|
||||
.pipe_offsets = { \
|
||||
@ -849,9 +847,9 @@ static const struct intel_device_info jsl_info = {
|
||||
#define GEN12_FEATURES \
|
||||
GEN11_FEATURES, \
|
||||
GEN(12), \
|
||||
.abox_mask = GENMASK(2, 1), \
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), \
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
|
||||
.display.abox_mask = GENMASK(2, 1), \
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), \
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) | \
|
||||
BIT(TRANSCODER_C) | BIT(TRANSCODER_D) | \
|
||||
BIT(TRANSCODER_DSI_0) | BIT(TRANSCODER_DSI_1), \
|
||||
.pipe_offsets = { \
|
||||
@ -886,9 +884,9 @@ static const struct intel_device_info tgl_info = {
|
||||
static const struct intel_device_info rkl_info = {
|
||||
GEN12_FEATURES,
|
||||
PLATFORM(INTEL_ROCKETLAKE),
|
||||
.abox_mask = BIT(0),
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C),
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |
|
||||
.display.abox_mask = BIT(0),
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C),
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |
|
||||
BIT(TRANSCODER_C),
|
||||
.display.has_hti = 1,
|
||||
.display.has_psr_hw_tracking = 0,
|
||||
@ -908,7 +906,7 @@ static const struct intel_device_info dg1_info = {
|
||||
DGFX_FEATURES,
|
||||
.graphics.rel = 10,
|
||||
PLATFORM(INTEL_DG1),
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),
|
||||
.require_force_probe = 1,
|
||||
.platform_engine_mask =
|
||||
BIT(RCS0) | BIT(BCS0) | BIT(VECS0) |
|
||||
@ -920,7 +918,7 @@ static const struct intel_device_info dg1_info = {
|
||||
static const struct intel_device_info adl_s_info = {
|
||||
GEN12_FEATURES,
|
||||
PLATFORM(INTEL_ALDERLAKE_S),
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D),
|
||||
.display.has_hti = 1,
|
||||
.display.has_psr_hw_tracking = 0,
|
||||
.platform_engine_mask =
|
||||
@ -937,8 +935,11 @@ static const struct intel_device_info adl_s_info = {
|
||||
}
|
||||
|
||||
#define XE_LPD_FEATURES \
|
||||
.abox_mask = GENMASK(1, 0), \
|
||||
.color = { .degamma_lut_size = 0, .gamma_lut_size = 0 }, \
|
||||
.display.abox_mask = GENMASK(1, 0), \
|
||||
.color = { .degamma_lut_size = 128, .gamma_lut_size = 1024, \
|
||||
.degamma_lut_tests = DRM_COLOR_LUT_NON_DECREASING | \
|
||||
DRM_COLOR_LUT_EQUAL_CHANNELS, \
|
||||
}, \
|
||||
.dbuf.size = 4096, \
|
||||
.dbuf.slice_mask = BIT(DBUF_S1) | BIT(DBUF_S2) | BIT(DBUF_S3) | \
|
||||
BIT(DBUF_S4), \
|
||||
@ -954,7 +955,7 @@ static const struct intel_device_info adl_s_info = {
|
||||
.display.has_ipc = 1, \
|
||||
.display.has_psr = 1, \
|
||||
.display.ver = 13, \
|
||||
.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), \
|
||||
.display.pipe_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C) | BIT(PIPE_D), \
|
||||
.pipe_offsets = { \
|
||||
[TRANSCODER_A] = PIPE_A_OFFSET, \
|
||||
[TRANSCODER_B] = PIPE_B_OFFSET, \
|
||||
@ -977,8 +978,7 @@ static const struct intel_device_info adl_p_info = {
|
||||
GEN12_FEATURES,
|
||||
XE_LPD_FEATURES,
|
||||
PLATFORM(INTEL_ALDERLAKE_P),
|
||||
.require_force_probe = 1,
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |
|
||||
BIT(TRANSCODER_C) | BIT(TRANSCODER_D) |
|
||||
BIT(TRANSCODER_DSI_0) | BIT(TRANSCODER_DSI_1),
|
||||
.display.has_cdclk_crawl = 1,
|
||||
@ -1027,7 +1027,6 @@ static const struct intel_device_info xehpsdv_info = {
|
||||
DGFX_FEATURES,
|
||||
PLATFORM(INTEL_XEHPSDV),
|
||||
.display = { },
|
||||
.pipe_mask = 0,
|
||||
.platform_engine_mask =
|
||||
BIT(RCS0) | BIT(BCS0) |
|
||||
BIT(VECS0) | BIT(VECS1) | BIT(VECS2) | BIT(VECS3) |
|
||||
@ -1050,7 +1049,7 @@ static const struct intel_device_info dg2_info = {
|
||||
BIT(VECS0) | BIT(VECS1) |
|
||||
BIT(VCS0) | BIT(VCS2),
|
||||
.require_force_probe = 1,
|
||||
.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |
|
||||
.display.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |
|
||||
BIT(TRANSCODER_C) | BIT(TRANSCODER_D),
|
||||
};
|
||||
|
||||
@ -1131,6 +1130,7 @@ static const struct pci_device_id pciidlist[] = {
|
||||
INTEL_ADLS_IDS(&adl_s_info),
|
||||
INTEL_ADLP_IDS(&adl_p_info),
|
||||
INTEL_DG1_IDS(&dg1_info),
|
||||
INTEL_RPLS_IDS(&adl_s_info),
|
||||
{0, 0, 0}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, pciidlist);
|
||||
@ -1203,11 +1203,8 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
if (PCI_FUNC(pdev->devfn))
|
||||
return -ENODEV;
|
||||
|
||||
/*
|
||||
* apple-gmux is needed on dual GPU MacBook Pro
|
||||
* to probe the panel if we're the inactive GPU.
|
||||
*/
|
||||
if (vga_switcheroo_client_probe_defer(pdev))
|
||||
/* Detect if we need to wait for other drivers early on */
|
||||
if (intel_modeset_probe_defer(pdev))
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
err = i915_driver_probe(pdev, ent);
|
||||
|
@ -2265,6 +2265,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
|
||||
#define SNPS_PHY_MPLLB_DP2_MODE REG_BIT(9)
|
||||
#define SNPS_PHY_MPLLB_WORD_DIV2_EN REG_BIT(8)
|
||||
#define SNPS_PHY_MPLLB_TX_CLK_DIV REG_GENMASK(7, 5)
|
||||
#define SNPS_PHY_MPLLB_SHIM_DIV32_CLK_SEL REG_BIT(0)
|
||||
|
||||
#define SNPS_PHY_MPLLB_FRACN1(phy) _MMIO_SNPS(phy, 0x168008)
|
||||
#define SNPS_PHY_MPLLB_FRACN_EN REG_BIT(31)
|
||||
@ -6966,7 +6967,7 @@ enum {
|
||||
#define DVS_SOURCE_KEY (1 << 22)
|
||||
#define DVS_RGB_ORDER_XBGR (1 << 20)
|
||||
#define DVS_YUV_FORMAT_BT709 (1 << 18)
|
||||
#define DVS_YUV_BYTE_ORDER_MASK (3 << 16)
|
||||
#define DVS_YUV_ORDER_MASK (3 << 16)
|
||||
#define DVS_YUV_ORDER_YUYV (0 << 16)
|
||||
#define DVS_YUV_ORDER_UYVY (1 << 16)
|
||||
#define DVS_YUV_ORDER_YVYU (2 << 16)
|
||||
@ -7045,7 +7046,7 @@ enum {
|
||||
#define SPRITE_RGB_ORDER_RGBX (1 << 20) /* only for 888 and 161616 */
|
||||
#define SPRITE_YUV_TO_RGB_CSC_DISABLE (1 << 19)
|
||||
#define SPRITE_YUV_TO_RGB_CSC_FORMAT_BT709 (1 << 18) /* 0 is BT601 */
|
||||
#define SPRITE_YUV_BYTE_ORDER_MASK (3 << 16)
|
||||
#define SPRITE_YUV_ORDER_MASK (3 << 16)
|
||||
#define SPRITE_YUV_ORDER_YUYV (0 << 16)
|
||||
#define SPRITE_YUV_ORDER_UYVY (1 << 16)
|
||||
#define SPRITE_YUV_ORDER_YVYU (2 << 16)
|
||||
@ -7130,7 +7131,7 @@ enum {
|
||||
#define SP_ALPHA_PREMULTIPLY (1 << 23) /* CHV pipe B */
|
||||
#define SP_SOURCE_KEY (1 << 22)
|
||||
#define SP_YUV_FORMAT_BT709 (1 << 18)
|
||||
#define SP_YUV_BYTE_ORDER_MASK (3 << 16)
|
||||
#define SP_YUV_ORDER_MASK (3 << 16)
|
||||
#define SP_YUV_ORDER_YUYV (0 << 16)
|
||||
#define SP_YUV_ORDER_UYVY (1 << 16)
|
||||
#define SP_YUV_ORDER_YVYU (2 << 16)
|
||||
@ -7271,10 +7272,10 @@ enum {
|
||||
#define PLANE_CTL_YUV420_Y_PLANE (1 << 19)
|
||||
#define PLANE_CTL_YUV_TO_RGB_CSC_FORMAT_BT709 (1 << 18)
|
||||
#define PLANE_CTL_YUV422_ORDER_MASK (0x3 << 16)
|
||||
#define PLANE_CTL_YUV422_YUYV (0 << 16)
|
||||
#define PLANE_CTL_YUV422_UYVY (1 << 16)
|
||||
#define PLANE_CTL_YUV422_YVYU (2 << 16)
|
||||
#define PLANE_CTL_YUV422_VYUY (3 << 16)
|
||||
#define PLANE_CTL_YUV422_ORDER_YUYV (0 << 16)
|
||||
#define PLANE_CTL_YUV422_ORDER_UYVY (1 << 16)
|
||||
#define PLANE_CTL_YUV422_ORDER_YVYU (2 << 16)
|
||||
#define PLANE_CTL_YUV422_ORDER_VYUY (3 << 16)
|
||||
#define PLANE_CTL_RENDER_DECOMPRESSION_ENABLE (1 << 15)
|
||||
#define PLANE_CTL_TRICKLE_FEED_DISABLE (1 << 14)
|
||||
#define PLANE_CTL_CLEAR_COLOR_DISABLE (1 << 13) /* TGL+ */
|
||||
@ -7328,10 +7329,10 @@ enum {
|
||||
#define _PLANE_CUS_CTL_1_A 0x701c8
|
||||
#define _PLANE_CUS_CTL_2_A 0x702c8
|
||||
#define PLANE_CUS_ENABLE (1 << 31)
|
||||
#define PLANE_CUS_PLANE_4_RKL (0 << 30)
|
||||
#define PLANE_CUS_PLANE_5_RKL (1 << 30)
|
||||
#define PLANE_CUS_PLANE_6 (0 << 30)
|
||||
#define PLANE_CUS_PLANE_7 (1 << 30)
|
||||
#define PLANE_CUS_Y_PLANE_4_RKL (0 << 30)
|
||||
#define PLANE_CUS_Y_PLANE_5_RKL (1 << 30)
|
||||
#define PLANE_CUS_Y_PLANE_6_ICL (0 << 30)
|
||||
#define PLANE_CUS_Y_PLANE_7_ICL (1 << 30)
|
||||
#define PLANE_CUS_HPHASE_SIGN_NEGATIVE (1 << 19)
|
||||
#define PLANE_CUS_HPHASE_0 (0 << 16)
|
||||
#define PLANE_CUS_HPHASE_0_25 (1 << 16)
|
||||
@ -7363,12 +7364,12 @@ enum {
|
||||
#define _PLANE_NV12_BUF_CFG_1_A 0x70278
|
||||
#define _PLANE_NV12_BUF_CFG_2_A 0x70378
|
||||
|
||||
#define _PLANE_CC_VAL_1_B 0x711b4
|
||||
#define _PLANE_CC_VAL_2_B 0x712b4
|
||||
#define _PLANE_CC_VAL_1(pipe) _PIPE(pipe, _PLANE_CC_VAL_1_A, _PLANE_CC_VAL_1_B)
|
||||
#define _PLANE_CC_VAL_2(pipe) _PIPE(pipe, _PLANE_CC_VAL_2_A, _PLANE_CC_VAL_2_B)
|
||||
#define PLANE_CC_VAL(pipe, plane) \
|
||||
_MMIO_PLANE(plane, _PLANE_CC_VAL_1(pipe), _PLANE_CC_VAL_2(pipe))
|
||||
#define _PLANE_CC_VAL_1_B 0x711b4
|
||||
#define _PLANE_CC_VAL_2_B 0x712b4
|
||||
#define _PLANE_CC_VAL_1(pipe, dw) (_PIPE(pipe, _PLANE_CC_VAL_1_A, _PLANE_CC_VAL_1_B) + (dw) * 4)
|
||||
#define _PLANE_CC_VAL_2(pipe, dw) (_PIPE(pipe, _PLANE_CC_VAL_2_A, _PLANE_CC_VAL_2_B) + (dw) * 4)
|
||||
#define PLANE_CC_VAL(pipe, plane, dw) \
|
||||
_MMIO_PLANE((plane), _PLANE_CC_VAL_1((pipe), (dw)), _PLANE_CC_VAL_2((pipe), (dw)))
|
||||
|
||||
/* Input CSC Register Definitions */
|
||||
#define _PLANE_INPUT_CSC_RY_GY_1_A 0x701E0
|
||||
@ -8573,8 +8574,9 @@ enum {
|
||||
_PIPEB_CHICKEN)
|
||||
#define UNDERRUN_RECOVERY_DISABLE_ADLP REG_BIT(30)
|
||||
#define UNDERRUN_RECOVERY_ENABLE_DG2 REG_BIT(30)
|
||||
#define PIXEL_ROUNDING_TRUNC_FB_PASSTHRU (1 << 15)
|
||||
#define PER_PIXEL_ALPHA_BYPASS_EN (1 << 7)
|
||||
#define PIXEL_ROUNDING_TRUNC_FB_PASSTHRU REG_BIT(15)
|
||||
#define DG2_RENDER_CCSTAG_4_3_EN REG_BIT(12)
|
||||
#define PER_PIXEL_ALPHA_BYPASS_EN REG_BIT(7)
|
||||
|
||||
#define VFLSKPD _MMIO(0x62a8)
|
||||
#define DIS_OVER_FETCH_CACHE REG_BIT(1)
|
||||
@ -10654,6 +10656,14 @@ enum skl_power_gate {
|
||||
#define BXT_CDCLK_SSA_PRECHARGE_ENABLE (1 << 16)
|
||||
#define CDCLK_FREQ_DECIMAL_MASK (0x7ff)
|
||||
|
||||
/* CDCLK_SQUASH_CTL */
|
||||
#define CDCLK_SQUASH_CTL _MMIO(0x46008)
|
||||
#define CDCLK_SQUASH_ENABLE REG_BIT(31)
|
||||
#define CDCLK_SQUASH_WINDOW_SIZE_MASK REG_GENMASK(27, 24)
|
||||
#define CDCLK_SQUASH_WINDOW_SIZE(x) REG_FIELD_PREP(CDCLK_SQUASH_WINDOW_SIZE_MASK, (x))
|
||||
#define CDCLK_SQUASH_WAVEFORM_MASK REG_GENMASK(15, 0)
|
||||
#define CDCLK_SQUASH_WAVEFORM(x) REG_FIELD_PREP(CDCLK_SQUASH_WAVEFORM_MASK, (x))
|
||||
|
||||
/* LCPLL_CTL */
|
||||
#define LCPLL1_CTL _MMIO(0x46010)
|
||||
#define LCPLL2_CTL _MMIO(0x46014)
|
||||
|
@ -1,4 +1,8 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM i915
|
||||
|
||||
#if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _I915_TRACE_H_
|
||||
|
||||
@ -8,582 +12,11 @@
|
||||
|
||||
#include <drm/drm_drv.h>
|
||||
|
||||
#include "display/intel_crtc.h"
|
||||
#include "display/intel_display_types.h"
|
||||
#include "gt/intel_engine.h"
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_irq.h"
|
||||
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM i915
|
||||
#define TRACE_INCLUDE_FILE i915_trace
|
||||
|
||||
/* watermark/fifo updates */
|
||||
|
||||
TRACE_EVENT(intel_pipe_enable,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array(u32, frame, 3)
|
||||
__array(u32, scanline, 3)
|
||||
__field(enum pipe, pipe)
|
||||
),
|
||||
TP_fast_assign(
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_crtc *it__;
|
||||
for_each_intel_crtc(&dev_priv->drm, it__) {
|
||||
__entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
|
||||
__entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
|
||||
}
|
||||
__entry->pipe = crtc->pipe;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c enable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe),
|
||||
__entry->frame[PIPE_A], __entry->scanline[PIPE_A],
|
||||
__entry->frame[PIPE_B], __entry->scanline[PIPE_B],
|
||||
__entry->frame[PIPE_C], __entry->scanline[PIPE_C])
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_disable,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array(u32, frame, 3)
|
||||
__array(u32, scanline, 3)
|
||||
__field(enum pipe, pipe)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_crtc *it__;
|
||||
for_each_intel_crtc(&dev_priv->drm, it__) {
|
||||
__entry->frame[it__->pipe] = intel_crtc_get_vblank_counter(it__);
|
||||
__entry->scanline[it__->pipe] = intel_get_crtc_scanline(it__);
|
||||
}
|
||||
__entry->pipe = crtc->pipe;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c disable, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe),
|
||||
__entry->frame[PIPE_A], __entry->scanline[PIPE_A],
|
||||
__entry->frame[PIPE_B], __entry->scanline[PIPE_B],
|
||||
__entry->frame[PIPE_C], __entry->scanline[PIPE_C])
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_crc,
|
||||
TP_PROTO(struct intel_crtc *crtc, const u32 *crcs),
|
||||
TP_ARGS(crtc, crcs),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__array(u32, crcs, 5)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
memcpy(__entry->crcs, crcs, sizeof(__entry->crcs));
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u crc=%08x %08x %08x %08x %08x",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline,
|
||||
__entry->crcs[0], __entry->crcs[1], __entry->crcs[2],
|
||||
__entry->crcs[3], __entry->crcs[4])
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_cpu_fifo_underrun,
|
||||
TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pipe),
|
||||
TP_ARGS(dev_priv, pipe),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
__entry->pipe = pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe),
|
||||
__entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pch_fifo_underrun,
|
||||
TP_PROTO(struct drm_i915_private *dev_priv, enum pipe pch_transcoder),
|
||||
TP_ARGS(dev_priv, pch_transcoder),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
enum pipe pipe = pch_transcoder;
|
||||
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
|
||||
__entry->pipe = pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pch transcoder %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe),
|
||||
__entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_memory_cxsr,
|
||||
TP_PROTO(struct drm_i915_private *dev_priv, bool old, bool new),
|
||||
TP_ARGS(dev_priv, old, new),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array(u32, frame, 3)
|
||||
__array(u32, scanline, 3)
|
||||
__field(bool, old)
|
||||
__field(bool, new)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
struct intel_crtc *crtc;
|
||||
for_each_intel_crtc(&dev_priv->drm, crtc) {
|
||||
__entry->frame[crtc->pipe] = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline[crtc->pipe] = intel_get_crtc_scanline(crtc);
|
||||
}
|
||||
__entry->old = old;
|
||||
__entry->new = new;
|
||||
),
|
||||
|
||||
TP_printk("%s->%s, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
|
||||
onoff(__entry->old), onoff(__entry->new),
|
||||
__entry->frame[PIPE_A], __entry->scanline[PIPE_A],
|
||||
__entry->frame[PIPE_B], __entry->scanline[PIPE_B],
|
||||
__entry->frame[PIPE_C], __entry->scanline[PIPE_C])
|
||||
);
|
||||
|
||||
TRACE_EVENT(g4x_wm,
|
||||
TP_PROTO(struct intel_crtc *crtc, const struct g4x_wm_values *wm),
|
||||
TP_ARGS(crtc, wm),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u16, primary)
|
||||
__field(u16, sprite)
|
||||
__field(u16, cursor)
|
||||
__field(u16, sr_plane)
|
||||
__field(u16, sr_cursor)
|
||||
__field(u16, sr_fbc)
|
||||
__field(u16, hpll_plane)
|
||||
__field(u16, hpll_cursor)
|
||||
__field(u16, hpll_fbc)
|
||||
__field(bool, cxsr)
|
||||
__field(bool, hpll)
|
||||
__field(bool, fbc)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
__entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
|
||||
__entry->sprite = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
|
||||
__entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR];
|
||||
__entry->sr_plane = wm->sr.plane;
|
||||
__entry->sr_cursor = wm->sr.cursor;
|
||||
__entry->sr_fbc = wm->sr.fbc;
|
||||
__entry->hpll_plane = wm->hpll.plane;
|
||||
__entry->hpll_cursor = wm->hpll.cursor;
|
||||
__entry->hpll_fbc = wm->hpll.fbc;
|
||||
__entry->cxsr = wm->cxsr;
|
||||
__entry->hpll = wm->hpll_en;
|
||||
__entry->fbc = wm->fbc_en;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, wm %d/%d/%d, sr %s/%d/%d/%d, hpll %s/%d/%d/%d, fbc %s",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline,
|
||||
__entry->primary, __entry->sprite, __entry->cursor,
|
||||
yesno(__entry->cxsr), __entry->sr_plane, __entry->sr_cursor, __entry->sr_fbc,
|
||||
yesno(__entry->hpll), __entry->hpll_plane, __entry->hpll_cursor, __entry->hpll_fbc,
|
||||
yesno(__entry->fbc))
|
||||
);
|
||||
|
||||
TRACE_EVENT(vlv_wm,
|
||||
TP_PROTO(struct intel_crtc *crtc, const struct vlv_wm_values *wm),
|
||||
TP_ARGS(crtc, wm),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u32, level)
|
||||
__field(u32, cxsr)
|
||||
__field(u32, primary)
|
||||
__field(u32, sprite0)
|
||||
__field(u32, sprite1)
|
||||
__field(u32, cursor)
|
||||
__field(u32, sr_plane)
|
||||
__field(u32, sr_cursor)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
__entry->level = wm->level;
|
||||
__entry->cxsr = wm->cxsr;
|
||||
__entry->primary = wm->pipe[crtc->pipe].plane[PLANE_PRIMARY];
|
||||
__entry->sprite0 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE0];
|
||||
__entry->sprite1 = wm->pipe[crtc->pipe].plane[PLANE_SPRITE1];
|
||||
__entry->cursor = wm->pipe[crtc->pipe].plane[PLANE_CURSOR];
|
||||
__entry->sr_plane = wm->sr.plane;
|
||||
__entry->sr_cursor = wm->sr.cursor;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, level=%d, cxsr=%d, wm %d/%d/%d/%d, sr %d/%d",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline, __entry->level, __entry->cxsr,
|
||||
__entry->primary, __entry->sprite0, __entry->sprite1, __entry->cursor,
|
||||
__entry->sr_plane, __entry->sr_cursor)
|
||||
);
|
||||
|
||||
TRACE_EVENT(vlv_fifo_size,
|
||||
TP_PROTO(struct intel_crtc *crtc, u32 sprite0_start, u32 sprite1_start, u32 fifo_size),
|
||||
TP_ARGS(crtc, sprite0_start, sprite1_start, fifo_size),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u32, sprite0_start)
|
||||
__field(u32, sprite1_start)
|
||||
__field(u32, fifo_size)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
__entry->sprite0_start = sprite0_start;
|
||||
__entry->sprite1_start = sprite1_start;
|
||||
__entry->fifo_size = fifo_size;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, %d/%d/%d",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline, __entry->sprite0_start,
|
||||
__entry->sprite1_start, __entry->fifo_size)
|
||||
);
|
||||
|
||||
/* plane updates */
|
||||
|
||||
TRACE_EVENT(intel_plane_update_noarm,
|
||||
TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
|
||||
TP_ARGS(plane, crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__array(int, src, 4)
|
||||
__array(int, dst, 4)
|
||||
__string(name, plane->name)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, plane->name);
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
|
||||
memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
|
||||
pipe_name(__entry->pipe), __get_str(name),
|
||||
__entry->frame, __entry->scanline,
|
||||
DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src),
|
||||
DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_plane_update_arm,
|
||||
TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
|
||||
TP_ARGS(plane, crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__array(int, src, 4)
|
||||
__array(int, dst, 4)
|
||||
__string(name, plane->name)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, plane->name);
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
memcpy(__entry->src, &plane->state->src, sizeof(__entry->src));
|
||||
memcpy(__entry->dst, &plane->state->dst, sizeof(__entry->dst));
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, plane %s, frame=%u, scanline=%u, " DRM_RECT_FP_FMT " -> " DRM_RECT_FMT,
|
||||
pipe_name(__entry->pipe), __get_str(name),
|
||||
__entry->frame, __entry->scanline,
|
||||
DRM_RECT_FP_ARG((const struct drm_rect *)__entry->src),
|
||||
DRM_RECT_ARG((const struct drm_rect *)__entry->dst))
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_plane_disable_arm,
|
||||
TP_PROTO(struct drm_plane *plane, struct intel_crtc *crtc),
|
||||
TP_ARGS(plane, crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__string(name, plane->name)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, plane->name);
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, plane %s, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __get_str(name),
|
||||
__entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
/* fbc */
|
||||
|
||||
TRACE_EVENT(intel_fbc_activate,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_fbc_deactivate,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_fbc_nuke,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame, __entry->scanline)
|
||||
);
|
||||
|
||||
/* pipe updates */
|
||||
|
||||
TRACE_EVENT(intel_crtc_vblank_work_start,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_crtc_vblank_work_end,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_update_start,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u32, min)
|
||||
__field(u32, max)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = intel_crtc_get_vblank_counter(crtc);
|
||||
__entry->scanline = intel_get_crtc_scanline(crtc);
|
||||
__entry->min = crtc->debug.min_vbl;
|
||||
__entry->max = crtc->debug.max_vbl;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline, __entry->min, __entry->max)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_update_vblank_evaded,
|
||||
TP_PROTO(struct intel_crtc *crtc),
|
||||
TP_ARGS(crtc),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
__field(u32, min)
|
||||
__field(u32, max)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = crtc->debug.start_vbl_count;
|
||||
__entry->scanline = crtc->debug.scanline_start;
|
||||
__entry->min = crtc->debug.min_vbl;
|
||||
__entry->max = crtc->debug.max_vbl;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u, min=%u, max=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline, __entry->min, __entry->max)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_pipe_update_end,
|
||||
TP_PROTO(struct intel_crtc *crtc, u32 frame, int scanline_end),
|
||||
TP_ARGS(crtc, frame, scanline_end),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(enum pipe, pipe)
|
||||
__field(u32, frame)
|
||||
__field(u32, scanline)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->pipe = crtc->pipe;
|
||||
__entry->frame = frame;
|
||||
__entry->scanline = scanline_end;
|
||||
),
|
||||
|
||||
TP_printk("pipe %c, frame=%u, scanline=%u",
|
||||
pipe_name(__entry->pipe), __entry->frame,
|
||||
__entry->scanline)
|
||||
);
|
||||
|
||||
/* frontbuffer tracking */
|
||||
|
||||
TRACE_EVENT(intel_frontbuffer_invalidate,
|
||||
TP_PROTO(unsigned int frontbuffer_bits, unsigned int origin),
|
||||
TP_ARGS(frontbuffer_bits, origin),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(unsigned int, frontbuffer_bits)
|
||||
__field(unsigned int, origin)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->frontbuffer_bits = frontbuffer_bits;
|
||||
__entry->origin = origin;
|
||||
),
|
||||
|
||||
TP_printk("frontbuffer_bits=0x%08x, origin=%u",
|
||||
__entry->frontbuffer_bits, __entry->origin)
|
||||
);
|
||||
|
||||
TRACE_EVENT(intel_frontbuffer_flush,
|
||||
TP_PROTO(unsigned int frontbuffer_bits, unsigned int origin),
|
||||
TP_ARGS(frontbuffer_bits, origin),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__field(unsigned int, frontbuffer_bits)
|
||||
__field(unsigned int, origin)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__entry->frontbuffer_bits = frontbuffer_bits;
|
||||
__entry->origin = origin;
|
||||
),
|
||||
|
||||
TP_printk("frontbuffer_bits=0x%08x, origin=%u",
|
||||
__entry->frontbuffer_bits, __entry->origin)
|
||||
);
|
||||
|
||||
/* object tracking */
|
||||
|
||||
TRACE_EVENT(i915_gem_object_create,
|
||||
@ -1331,5 +764,7 @@ DEFINE_EVENT(i915_context, i915_context_free,
|
||||
|
||||
/* This part must be outside protection */
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#undef TRACE_INCLUDE_FILE
|
||||
#define TRACE_INCLUDE_PATH ../../drivers/gpu/drm/i915
|
||||
#define TRACE_INCLUDE_FILE i915_trace
|
||||
#include <trace/define_trace.h>
|
||||
|
@ -170,6 +170,10 @@ static const u16 subplatform_portf_ids[] = {
|
||||
INTEL_ICL_PORT_F_IDS(0),
|
||||
};
|
||||
|
||||
static const u16 subplatform_rpls_ids[] = {
|
||||
INTEL_RPLS_IDS(0),
|
||||
};
|
||||
|
||||
static bool find_devid(u16 id, const u16 *p, unsigned int num)
|
||||
{
|
||||
for (; num; num--, p++) {
|
||||
@ -206,6 +210,9 @@ void intel_device_info_subplatform_init(struct drm_i915_private *i915)
|
||||
} else if (find_devid(devid, subplatform_portf_ids,
|
||||
ARRAY_SIZE(subplatform_portf_ids))) {
|
||||
mask = BIT(INTEL_SUBPLATFORM_PORTF);
|
||||
} else if (find_devid(devid, subplatform_rpls_ids,
|
||||
ARRAY_SIZE(subplatform_rpls_ids))) {
|
||||
mask = BIT(INTEL_SUBPLATFORM_RPL_S);
|
||||
}
|
||||
|
||||
if (IS_TIGERLAKE(i915)) {
|
||||
@ -319,33 +326,33 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
|
||||
!(sfuse_strap & SFUSE_STRAP_FUSE_LOCK))) {
|
||||
drm_info(&dev_priv->drm,
|
||||
"Display fused off, disabling\n");
|
||||
info->pipe_mask = 0;
|
||||
info->cpu_transcoder_mask = 0;
|
||||
info->display.pipe_mask = 0;
|
||||
info->display.cpu_transcoder_mask = 0;
|
||||
} else if (fuse_strap & IVB_PIPE_C_DISABLE) {
|
||||
drm_info(&dev_priv->drm, "PipeC fused off\n");
|
||||
info->pipe_mask &= ~BIT(PIPE_C);
|
||||
info->cpu_transcoder_mask &= ~BIT(TRANSCODER_C);
|
||||
info->display.pipe_mask &= ~BIT(PIPE_C);
|
||||
info->display.cpu_transcoder_mask &= ~BIT(TRANSCODER_C);
|
||||
}
|
||||
} else if (HAS_DISPLAY(dev_priv) && DISPLAY_VER(dev_priv) >= 9) {
|
||||
u32 dfsm = intel_de_read(dev_priv, SKL_DFSM);
|
||||
|
||||
if (dfsm & SKL_DFSM_PIPE_A_DISABLE) {
|
||||
info->pipe_mask &= ~BIT(PIPE_A);
|
||||
info->cpu_transcoder_mask &= ~BIT(TRANSCODER_A);
|
||||
info->display.pipe_mask &= ~BIT(PIPE_A);
|
||||
info->display.cpu_transcoder_mask &= ~BIT(TRANSCODER_A);
|
||||
}
|
||||
if (dfsm & SKL_DFSM_PIPE_B_DISABLE) {
|
||||
info->pipe_mask &= ~BIT(PIPE_B);
|
||||
info->cpu_transcoder_mask &= ~BIT(TRANSCODER_B);
|
||||
info->display.pipe_mask &= ~BIT(PIPE_B);
|
||||
info->display.cpu_transcoder_mask &= ~BIT(TRANSCODER_B);
|
||||
}
|
||||
if (dfsm & SKL_DFSM_PIPE_C_DISABLE) {
|
||||
info->pipe_mask &= ~BIT(PIPE_C);
|
||||
info->cpu_transcoder_mask &= ~BIT(TRANSCODER_C);
|
||||
info->display.pipe_mask &= ~BIT(PIPE_C);
|
||||
info->display.cpu_transcoder_mask &= ~BIT(TRANSCODER_C);
|
||||
}
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 12 &&
|
||||
(dfsm & TGL_DFSM_PIPE_D_DISABLE)) {
|
||||
info->pipe_mask &= ~BIT(PIPE_D);
|
||||
info->cpu_transcoder_mask &= ~BIT(TRANSCODER_D);
|
||||
info->display.pipe_mask &= ~BIT(PIPE_D);
|
||||
info->display.cpu_transcoder_mask &= ~BIT(TRANSCODER_D);
|
||||
}
|
||||
|
||||
if (dfsm & SKL_DFSM_DISPLAY_HDCP_DISABLE)
|
||||
|
@ -110,6 +110,9 @@ enum intel_platform {
|
||||
#define INTEL_SUBPLATFORM_G10 0
|
||||
#define INTEL_SUBPLATFORM_G11 1
|
||||
|
||||
/* ADL-S */
|
||||
#define INTEL_SUBPLATFORM_RPL_S 0
|
||||
|
||||
enum intel_ppgtt_type {
|
||||
INTEL_PPGTT_NONE = I915_GEM_PPGTT_NONE,
|
||||
INTEL_PPGTT_ALIASING = I915_GEM_PPGTT_ALIASING,
|
||||
@ -192,11 +195,6 @@ struct intel_device_info {
|
||||
|
||||
u8 gt; /* GT number, 0 if undefined */
|
||||
|
||||
u8 pipe_mask;
|
||||
u8 cpu_transcoder_mask;
|
||||
|
||||
u8 abox_mask;
|
||||
|
||||
#define DEFINE_FLAG(name) u8 name:1
|
||||
DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG);
|
||||
#undef DEFINE_FLAG
|
||||
@ -205,6 +203,10 @@ struct intel_device_info {
|
||||
u8 ver;
|
||||
u8 rel;
|
||||
|
||||
u8 pipe_mask;
|
||||
u8 cpu_transcoder_mask;
|
||||
u8 abox_mask;
|
||||
|
||||
#define DEFINE_FLAG(name) u8 name:1
|
||||
DEV_INFO_DISPLAY_FOR_EACH_FLAG(DEFINE_FLAG);
|
||||
#undef DEFINE_FLAG
|
||||
|
@ -129,6 +129,7 @@ intel_pch_type(const struct drm_i915_private *dev_priv, unsigned short id)
|
||||
return PCH_JSP;
|
||||
case INTEL_PCH_ADP_DEVICE_ID_TYPE:
|
||||
case INTEL_PCH_ADP2_DEVICE_ID_TYPE:
|
||||
case INTEL_PCH_ADP3_DEVICE_ID_TYPE:
|
||||
drm_dbg_kms(&dev_priv->drm, "Found Alder Lake PCH\n");
|
||||
drm_WARN_ON(&dev_priv->drm, !IS_ALDERLAKE_S(dev_priv) &&
|
||||
!IS_ALDERLAKE_P(dev_priv));
|
||||
|
@ -57,6 +57,7 @@ enum intel_pch {
|
||||
#define INTEL_PCH_JSP2_DEVICE_ID_TYPE 0x3880
|
||||
#define INTEL_PCH_ADP_DEVICE_ID_TYPE 0x7A80
|
||||
#define INTEL_PCH_ADP2_DEVICE_ID_TYPE 0x5180
|
||||
#define INTEL_PCH_ADP3_DEVICE_ID_TYPE 0x7A00
|
||||
#define INTEL_PCH_P2X_DEVICE_ID_TYPE 0x7100
|
||||
#define INTEL_PCH_P3X_DEVICE_ID_TYPE 0x7000
|
||||
#define INTEL_PCH_QEMU_DEVICE_ID_TYPE 0x2900 /* qemu q35 has 2918 */
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "display/intel_atomic_plane.h"
|
||||
#include "display/intel_bw.h"
|
||||
#include "display/intel_de.h"
|
||||
#include "display/intel_display_trace.h"
|
||||
#include "display/intel_display_types.h"
|
||||
#include "display/intel_fb.h"
|
||||
#include "display/intel_fbc.h"
|
||||
@ -47,7 +48,6 @@
|
||||
#include "i915_drv.h"
|
||||
#include "i915_fixed.h"
|
||||
#include "i915_irq.h"
|
||||
#include "i915_trace.h"
|
||||
#include "intel_pcode.h"
|
||||
#include "intel_pm.h"
|
||||
#include "vlv_sideband.h"
|
||||
@ -989,7 +989,7 @@ static void g4x_write_wm_values(struct drm_i915_private *dev_priv,
|
||||
enum pipe pipe;
|
||||
|
||||
for_each_pipe(dev_priv, pipe)
|
||||
trace_g4x_wm(intel_get_crtc_for_pipe(dev_priv, pipe), wm);
|
||||
trace_g4x_wm(intel_crtc_for_pipe(dev_priv, pipe), wm);
|
||||
|
||||
intel_uncore_write(&dev_priv->uncore, DSPFW1,
|
||||
FW_WM(wm->sr.plane, SR) |
|
||||
@ -1021,7 +1021,7 @@ static void vlv_write_wm_values(struct drm_i915_private *dev_priv,
|
||||
enum pipe pipe;
|
||||
|
||||
for_each_pipe(dev_priv, pipe) {
|
||||
trace_vlv_wm(intel_get_crtc_for_pipe(dev_priv, pipe), wm);
|
||||
trace_vlv_wm(intel_crtc_for_pipe(dev_priv, pipe), wm);
|
||||
|
||||
intel_uncore_write(&dev_priv->uncore, VLV_DDL(pipe),
|
||||
(wm->ddl[pipe].plane[PLANE_CURSOR] << DDL_CURSOR_SHIFT) |
|
||||
@ -2336,6 +2336,20 @@ static void i965_update_wm(struct drm_i915_private *dev_priv)
|
||||
|
||||
#undef FW_WM
|
||||
|
||||
static struct intel_crtc *intel_crtc_for_plane(struct drm_i915_private *i915,
|
||||
enum i9xx_plane_id i9xx_plane)
|
||||
{
|
||||
struct intel_plane *plane;
|
||||
|
||||
for_each_intel_plane(&i915->drm, plane) {
|
||||
if (plane->id == PLANE_PRIMARY &&
|
||||
plane->i9xx_plane == i9xx_plane)
|
||||
return intel_crtc_for_pipe(i915, plane->pipe);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void i9xx_update_wm(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
const struct intel_watermark_params *wm_info;
|
||||
@ -2357,7 +2371,7 @@ static void i9xx_update_wm(struct drm_i915_private *dev_priv)
|
||||
fifo_size = i830_get_fifo_size(dev_priv, PLANE_A);
|
||||
else
|
||||
fifo_size = i9xx_get_fifo_size(dev_priv, PLANE_A);
|
||||
crtc = intel_get_crtc_for_plane(dev_priv, PLANE_A);
|
||||
crtc = intel_crtc_for_plane(dev_priv, PLANE_A);
|
||||
if (intel_crtc_active(crtc)) {
|
||||
const struct drm_display_mode *pipe_mode =
|
||||
&crtc->config->hw.pipe_mode;
|
||||
@ -2387,7 +2401,7 @@ static void i9xx_update_wm(struct drm_i915_private *dev_priv)
|
||||
fifo_size = i830_get_fifo_size(dev_priv, PLANE_B);
|
||||
else
|
||||
fifo_size = i9xx_get_fifo_size(dev_priv, PLANE_B);
|
||||
crtc = intel_get_crtc_for_plane(dev_priv, PLANE_B);
|
||||
crtc = intel_crtc_for_plane(dev_priv, PLANE_B);
|
||||
if (intel_crtc_active(crtc)) {
|
||||
const struct drm_display_mode *pipe_mode =
|
||||
&crtc->config->hw.pipe_mode;
|
||||
@ -3369,13 +3383,8 @@ static void ilk_wm_merge(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
|
||||
/* ILK: LP2+ must be disabled when FBC WM is disabled but FBC enabled */
|
||||
/*
|
||||
* FIXME this is racy. FBC might get enabled later.
|
||||
* What we should check here is whether FBC can be
|
||||
* enabled sometime later.
|
||||
*/
|
||||
if (DISPLAY_VER(dev_priv) == 5 && !merged->fbc_wm_enabled &&
|
||||
intel_fbc_is_active(&dev_priv->fbc)) {
|
||||
if (DISPLAY_VER(dev_priv) == 5 && HAS_FBC(dev_priv) &&
|
||||
dev_priv->params.enable_fbc && !merged->fbc_wm_enabled) {
|
||||
for (level = 2; level <= max_level; level++) {
|
||||
struct intel_wm_level *wm = &merged->wm[level];
|
||||
|
||||
@ -6909,7 +6918,7 @@ void g4x_wm_sanitize(struct drm_i915_private *dev_priv)
|
||||
|
||||
for_each_intel_plane(&dev_priv->drm, plane) {
|
||||
struct intel_crtc *crtc =
|
||||
intel_get_crtc_for_pipe(dev_priv, plane->pipe);
|
||||
intel_crtc_for_pipe(dev_priv, plane->pipe);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
to_intel_crtc_state(crtc->base.state);
|
||||
struct intel_plane_state *plane_state =
|
||||
@ -7065,7 +7074,7 @@ void vlv_wm_sanitize(struct drm_i915_private *dev_priv)
|
||||
|
||||
for_each_intel_plane(&dev_priv->drm, plane) {
|
||||
struct intel_crtc *crtc =
|
||||
intel_get_crtc_for_pipe(dev_priv, plane->pipe);
|
||||
intel_crtc_for_pipe(dev_priv, plane->pipe);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
to_intel_crtc_state(crtc->base.state);
|
||||
struct intel_plane_state *plane_state =
|
||||
@ -7452,9 +7461,9 @@ static void icl_init_clock_gating(struct drm_i915_private *dev_priv)
|
||||
|
||||
static void gen12lp_init_clock_gating(struct drm_i915_private *dev_priv)
|
||||
{
|
||||
/* Wa_1409120013:tgl,rkl,adl-s,dg1 */
|
||||
/* Wa_1409120013:tgl,rkl,adl-s,dg1,dg2 */
|
||||
if (IS_TIGERLAKE(dev_priv) || IS_ROCKETLAKE(dev_priv) ||
|
||||
IS_ALDERLAKE_S(dev_priv) || IS_DG1(dev_priv))
|
||||
IS_ALDERLAKE_S(dev_priv) || IS_DG1(dev_priv) || IS_DG2(dev_priv))
|
||||
intel_uncore_write(&dev_priv->uncore, ILK_DPFC_CHICKEN,
|
||||
DPFC_CHICKEN_COMP_DUMMY_PIXEL);
|
||||
|
||||
|
76
drivers/gpu/drm/i915/intel_pm_types.h
Normal file
76
drivers/gpu/drm/i915/intel_pm_types.h
Normal file
@ -0,0 +1,76 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2021 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __INTEL_PM_TYPES_H__
|
||||
#define __INTEL_PM_TYPES_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "display/intel_display.h"
|
||||
|
||||
enum intel_ddb_partitioning {
|
||||
INTEL_DDB_PART_1_2,
|
||||
INTEL_DDB_PART_5_6, /* IVB+ */
|
||||
};
|
||||
|
||||
struct ilk_wm_values {
|
||||
u32 wm_pipe[3];
|
||||
u32 wm_lp[3];
|
||||
u32 wm_lp_spr[3];
|
||||
bool enable_fbc_wm;
|
||||
enum intel_ddb_partitioning partitioning;
|
||||
};
|
||||
|
||||
struct g4x_pipe_wm {
|
||||
u16 plane[I915_MAX_PLANES];
|
||||
u16 fbc;
|
||||
};
|
||||
|
||||
struct g4x_sr_wm {
|
||||
u16 plane;
|
||||
u16 cursor;
|
||||
u16 fbc;
|
||||
};
|
||||
|
||||
struct vlv_wm_ddl_values {
|
||||
u8 plane[I915_MAX_PLANES];
|
||||
};
|
||||
|
||||
struct vlv_wm_values {
|
||||
struct g4x_pipe_wm pipe[3];
|
||||
struct g4x_sr_wm sr;
|
||||
struct vlv_wm_ddl_values ddl[3];
|
||||
u8 level;
|
||||
bool cxsr;
|
||||
};
|
||||
|
||||
struct g4x_wm_values {
|
||||
struct g4x_pipe_wm pipe[2];
|
||||
struct g4x_sr_wm sr;
|
||||
struct g4x_sr_wm hpll;
|
||||
bool cxsr;
|
||||
bool hpll_en;
|
||||
bool fbc_en;
|
||||
};
|
||||
|
||||
struct skl_ddb_entry {
|
||||
u16 start, end; /* in number of blocks, 'end' is exclusive */
|
||||
};
|
||||
|
||||
static inline u16 skl_ddb_entry_size(const struct skl_ddb_entry *entry)
|
||||
{
|
||||
return entry->end - entry->start;
|
||||
}
|
||||
|
||||
static inline bool skl_ddb_entry_equal(const struct skl_ddb_entry *e1,
|
||||
const struct skl_ddb_entry *e2)
|
||||
{
|
||||
if (e1->start == e2->start && e1->end == e2->end)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* __INTEL_PM_TYPES_H__ */
|
@ -44,6 +44,11 @@ struct intel_gt *pxp_to_gt(const struct intel_pxp *pxp)
|
||||
return container_of(pxp, struct intel_gt, pxp);
|
||||
}
|
||||
|
||||
bool intel_pxp_is_enabled(const struct intel_pxp *pxp)
|
||||
{
|
||||
return pxp->ce;
|
||||
}
|
||||
|
||||
bool intel_pxp_is_active(const struct intel_pxp *pxp)
|
||||
{
|
||||
return pxp->arb_is_valid;
|
||||
|
@ -6,17 +6,15 @@
|
||||
#ifndef __INTEL_PXP_H__
|
||||
#define __INTEL_PXP_H__
|
||||
|
||||
#include "intel_pxp_types.h"
|
||||
#include <linux/errno.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct intel_pxp;
|
||||
struct drm_i915_gem_object;
|
||||
|
||||
static inline bool intel_pxp_is_enabled(const struct intel_pxp *pxp)
|
||||
{
|
||||
return pxp->ce;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DRM_I915_PXP
|
||||
struct intel_gt *pxp_to_gt(const struct intel_pxp *pxp);
|
||||
bool intel_pxp_is_enabled(const struct intel_pxp *pxp);
|
||||
bool intel_pxp_is_active(const struct intel_pxp *pxp);
|
||||
|
||||
void intel_pxp_init(struct intel_pxp *pxp);
|
||||
@ -48,6 +46,11 @@ static inline int intel_pxp_start(struct intel_pxp *pxp)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline bool intel_pxp_is_enabled(const struct intel_pxp *pxp)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool intel_pxp_is_active(const struct intel_pxp *pxp)
|
||||
{
|
||||
return false;
|
||||
|
@ -7,9 +7,7 @@
|
||||
#define __INTEL_PXP_TYPES_H__
|
||||
|
||||
#include <linux/completion.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/workqueue.h>
|
||||
|
||||
|
@ -666,4 +666,13 @@
|
||||
INTEL_VGA_DEVICE(0x46C2, info), \
|
||||
INTEL_VGA_DEVICE(0x46C3, info)
|
||||
|
||||
/* RPL-S */
|
||||
#define INTEL_RPLS_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0xA780, info), \
|
||||
INTEL_VGA_DEVICE(0xA781, info), \
|
||||
INTEL_VGA_DEVICE(0xA782, info), \
|
||||
INTEL_VGA_DEVICE(0xA783, info), \
|
||||
INTEL_VGA_DEVICE(0xA788, info), \
|
||||
INTEL_VGA_DEVICE(0xA789, info)
|
||||
|
||||
#endif /* _I915_PCIIDS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user