#include <drm/drm_print.h>
-#include "i915_drv.h"
#include "i915_reg.h"
#include "i9xx_wm.h"
#include "i9xx_wm_regs.h"
#include "intel_display.h"
#include "intel_display_regs.h"
#include "intel_display_trace.h"
+#include "intel_display_utils.h"
#include "intel_dram.h"
#include "intel_fb.h"
#include "intel_mchbar_regs.h"
struct intel_crtc *crtc)
{
struct intel_display *display = to_intel_display(crtc);
- struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
- struct intel_uncore *uncore = &dev_priv->uncore;
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
const struct intel_crtc_state *crtc_state =
intel_atomic_get_new_crtc_state(state, crtc);
const struct vlv_fifo_state *fifo_state =
static void hsw_read_wm_latency(struct intel_display *display, u16 wm[])
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u64 sskpd;
display->wm.num_levels = 5;
- sskpd = intel_uncore_read64(&i915->uncore, MCH_SSKPD);
+ sskpd = intel_uncore_read64(uncore, MCH_SSKPD);
wm[0] = REG_FIELD_GET64(SSKPD_NEW_WM0_MASK_HSW, sskpd);
if (wm[0] == 0)
static void snb_read_wm_latency(struct intel_display *display, u16 wm[])
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u32 sskpd;
display->wm.num_levels = 4;
- sskpd = intel_uncore_read(&i915->uncore, MCH_SSKPD);
+ sskpd = intel_uncore_read(uncore, MCH_SSKPD);
wm[0] = REG_FIELD_GET(SSKPD_WM0_MASK_SNB, sskpd);
wm[1] = REG_FIELD_GET(SSKPD_WM1_MASK_SNB, sskpd);
static void ilk_read_wm_latency(struct intel_display *display, u16 wm[])
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u32 mltr;
display->wm.num_levels = 3;
- mltr = intel_uncore_read(&i915->uncore, MLTR_ILK);
+ mltr = intel_uncore_read(uncore, MLTR_ILK);
/* ILK primary LP0 latency is 700 ns */
wm[0] = 7;
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_print.h>
-#include "i915_drv.h"
#include "i915_reg.h"
#include "intel_bw.h"
#include "intel_crtc.h"
struct intel_qgv_point *sp,
int point)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u32 dclk_ratio, dclk_reference;
u32 val;
- val = intel_uncore_read(&i915->uncore, SA_PERF_STATUS_0_0_0_MCHBAR_PC);
+ val = intel_uncore_read(uncore, SA_PERF_STATUS_0_0_0_MCHBAR_PC);
dclk_ratio = REG_FIELD_GET(DG1_QCLK_RATIO_MASK, val);
if (val & DG1_QCLK_REFERENCE)
dclk_reference = 6; /* 6 * 16.666 MHz = 100 MHz */
dclk_reference = 8; /* 8 * 16.666 MHz = 133 MHz */
sp->dclk = DIV_ROUND_UP((16667 * dclk_ratio * dclk_reference) + 500, 1000);
- val = intel_uncore_read(&i915->uncore, SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU);
+ val = intel_uncore_read(uncore, SKL_MC_BIOS_DATA_0_0_0_MCHBAR_PCU);
if (val & DG1_GEAR_TYPE)
sp->dclk *= 2;
if (sp->dclk == 0)
return -EINVAL;
- val = intel_uncore_read(&i915->uncore, MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR);
+ val = intel_uncore_read(uncore, MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR);
sp->t_rp = REG_FIELD_GET(DG1_DRAM_T_RP_MASK, val);
sp->t_rdpre = REG_FIELD_GET(DG1_DRAM_T_RDPRE_MASK, val);
- val = intel_uncore_read(&i915->uncore, MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR_HIGH);
+ val = intel_uncore_read(uncore, MCHBAR_CH0_CR_TC_PRE_0_0_0_MCHBAR_HIGH);
sp->t_rcd = REG_FIELD_GET(DG1_DRAM_T_RCD_MASK, val);
sp->t_ras = REG_FIELD_GET(DG1_DRAM_T_RAS_MASK, val);
static int mtl_read_qgv_point_info(struct intel_display *display,
struct intel_qgv_point *sp, int point)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u32 val, val2;
u16 dclk;
- val = intel_uncore_read(&i915->uncore,
- MTL_MEM_SS_INFO_QGV_POINT_LOW(point));
- val2 = intel_uncore_read(&i915->uncore,
- MTL_MEM_SS_INFO_QGV_POINT_HIGH(point));
+ val = intel_uncore_read(uncore, MTL_MEM_SS_INFO_QGV_POINT_LOW(point));
+ val2 = intel_uncore_read(uncore, MTL_MEM_SS_INFO_QGV_POINT_HIGH(point));
dclk = REG_FIELD_GET(MTL_DCLK_MASK, val);
sp->dclk = DIV_ROUND_CLOSEST(16667 * dclk, 1000);
sp->t_rp = REG_FIELD_GET(MTL_TRP_MASK, val);
static void intel_atomic_commit_tail(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
- struct drm_i915_private *dev_priv = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
struct intel_crtc_state *new_crtc_state, *old_crtc_state;
struct intel_crtc *crtc;
struct intel_power_domain_mask put_domains[I915_MAX_PIPES] = {};
* so enable debugging for the next modeset - and hope we catch
* the culprit.
*/
- intel_uncore_arm_unclaimed_mmio_detection(&dev_priv->uncore);
+ intel_uncore_arm_unclaimed_mmio_detection(uncore);
}
/*
* Delay re-enabling DC states by 17 ms to avoid the off->on->off
#include <drm/drm_managed.h>
#include <drm/drm_print.h>
-#include "i915_drv.h"
#include "i915_reg.h"
#include "intel_display_core.h"
#include "intel_display_utils.h"
static enum intel_dram_type pnv_dram_type(struct intel_display *display)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
- return intel_uncore_read(&i915->uncore, CSHRDDR3CTL) & CSHRDDR3CTL_DDR3 ?
+ return intel_uncore_read(uncore, CSHRDDR3CTL) & CSHRDDR3CTL_DDR3 ?
INTEL_DRAM_DDR3 : INTEL_DRAM_DDR2;
}
static unsigned int pnv_mem_freq(struct intel_display *display)
{
- struct drm_i915_private *dev_priv = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u32 tmp;
- tmp = intel_uncore_read(&dev_priv->uncore, CLKCFG);
+ tmp = intel_uncore_read(uncore, CLKCFG);
switch (tmp & CLKCFG_MEM_MASK) {
case CLKCFG_MEM_533:
static unsigned int ilk_mem_freq(struct intel_display *display)
{
- struct drm_i915_private *dev_priv = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u16 ddrpll;
- ddrpll = intel_uncore_read16(&dev_priv->uncore, DDRMPLL1);
+ ddrpll = intel_uncore_read16(uncore, DDRMPLL1);
switch (ddrpll & 0xff) {
case 0xc:
return 800000;
static unsigned int i9xx_fsb_freq(struct intel_display *display)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u32 fsb;
/*
* don't know which registers have that information,
* and all the relevant docs have gone to bit heaven :(
*/
- fsb = intel_uncore_read(&i915->uncore, CLKCFG) & CLKCFG_FSB_MASK;
+ fsb = intel_uncore_read(uncore, CLKCFG) & CLKCFG_FSB_MASK;
if (display->platform.pineview || display->platform.mobile) {
switch (fsb) {
static unsigned int ilk_fsb_freq(struct intel_display *display)
{
- struct drm_i915_private *dev_priv = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u16 fsb;
- fsb = intel_uncore_read16(&dev_priv->uncore, CSIPLL0) & 0x3ff;
+ fsb = intel_uncore_read16(uncore, CSIPLL0) & 0x3ff;
switch (fsb) {
case 0x00c:
static int
skl_dram_get_channels_info(struct intel_display *display, struct dram_info *dram_info)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
struct dram_channel_info ch0 = {}, ch1 = {};
u32 val;
int ret;
/* Assume 16Gb+ DIMMs are present until proven otherwise */
dram_info->has_16gb_dimms = true;
- val = intel_uncore_read(&i915->uncore,
- SKL_MAD_DIMM_CH0_0_0_0_MCHBAR_MCMAIN);
+ val = intel_uncore_read(uncore, SKL_MAD_DIMM_CH0_0_0_0_MCHBAR_MCMAIN);
ret = skl_dram_get_channel_info(display, &ch0, 0, val);
if (ret == 0)
dram_info->num_channels++;
- val = intel_uncore_read(&i915->uncore,
- SKL_MAD_DIMM_CH1_0_0_0_MCHBAR_MCMAIN);
+ val = intel_uncore_read(uncore, SKL_MAD_DIMM_CH1_0_0_0_MCHBAR_MCMAIN);
ret = skl_dram_get_channel_info(display, &ch1, 1, val);
if (ret == 0)
dram_info->num_channels++;
static enum intel_dram_type
skl_get_dram_type(struct intel_display *display)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u32 val;
- val = intel_uncore_read(&i915->uncore,
- SKL_MAD_INTER_CHANNEL_0_0_0_MCHBAR_MCMAIN);
+ val = intel_uncore_read(uncore, SKL_MAD_INTER_CHANNEL_0_0_0_MCHBAR_MCMAIN);
switch (val & SKL_DRAM_DDR_TYPE_MASK) {
case SKL_DRAM_DDR_TYPE_DDR3:
static int bxt_get_dram_info(struct intel_display *display, struct dram_info *dram_info)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
u32 val;
u8 valid_ranks = 0;
int i;
struct dram_dimm_info dimm;
enum intel_dram_type type;
- val = intel_uncore_read(&i915->uncore, BXT_D_CR_DRP0_DUNIT(i));
+ val = intel_uncore_read(uncore, BXT_D_CR_DRP0_DUNIT(i));
if (val == 0xFFFFFFFF)
continue;
static int xelpdp_get_dram_info(struct intel_display *display, struct dram_info *dram_info)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
- u32 val = intel_uncore_read(&i915->uncore, MTL_MEM_SS_INFO_GLOBAL);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
+ u32 val = intel_uncore_read(uncore, MTL_MEM_SS_INFO_GLOBAL);
switch (REG_FIELD_GET(MTL_DDR_TYPE_MASK, val)) {
case 0:
* Copyright © 2024 Intel Corporation
*/
-#include "i915_drv.h"
+#include <linux/pci.h>
+
+#include <drm/drm_device.h>
+
#include "i915_reg.h"
#include "intel_rom.h"
struct intel_rom *intel_rom_spi(struct drm_device *drm)
{
- struct drm_i915_private *i915 = to_i915(drm);
struct intel_rom *rom;
u32 static_region;
if (!rom)
return NULL;
- rom->uncore = &i915->uncore;
+ rom->uncore = to_intel_uncore(drm);
static_region = intel_uncore_read(rom->uncore, SPI_STATIC_REGIONS);
static_region &= OPTIONROM_SPI_REGIONID_MASK;
#include <drm/drm_print.h>
#include <drm/drm_vblank.h>
-#include "i915_drv.h"
#include "intel_color.h"
#include "intel_crtc.h"
#include "intel_de.h"
*/
#ifdef I915
static void intel_vblank_section_enter(struct intel_display *display)
- __acquires(i915->uncore.lock)
+ __acquires(uncore->lock)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
- spin_lock(&i915->uncore.lock);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
+ spin_lock(&uncore->lock);
}
static void intel_vblank_section_exit(struct intel_display *display)
- __releases(i915->uncore.lock)
+ __releases(uncore->lock)
{
- struct drm_i915_private *i915 = to_i915(display->drm);
- spin_unlock(&i915->uncore.lock);
+ struct intel_uncore *uncore = to_intel_uncore(display->drm);
+ spin_unlock(&uncore->lock);
}
#else
static void intel_vblank_section_enter(struct intel_display *display)