mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
Merge tag 'drm-intel-next-2025-04-11' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
Cross-subsystem Changes: - Update GVT MAINTAINERS (Jani) Driver Changes: - Updates for xe3lpd display (Gustavo) - Fix link training interrupted by HPD pulse (Imre) - Watermark bound checks for DSC (Ankit) - VRR Refactor and other fixes and improvements (Ankit) - More conversions towards intel_display struct (Gustavo, Jani) - Other clean-up patches towards a display separation (Jani) - Maintain asciibetical order for HAS_* macros (Ankit) - Fixes around probe/initialization (Janusz) - Fix build and doc build issue (Yue, Rodrigo) - DSI related fixes (Suraj, William, Jani) - Improve DC6 entry counter (Mohammed) - Fix xe2hpd memory type identification (Vivek) - PSR related fixes and improvements (Animesh, Jouni) - DP MST related fixes and improvements (Imre) - Fix scanline_offset for LNL+/BMG+ (Ville) - Some gvt related fixes and changes (Ville, Jani) - Some PLL code adjustment (Ville) - Display wa addition (Vinod) - DRAM type logging (Lucas) - Pimp the initial FB readout (Ville) - Some sagv/bw cleanup (Ville) - Remove i915_display_capabilities debugfs entry (Jani) - Move PCH type to display caps debugfs entry (Jani) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/Z_kTqPX5Mjruq1pL@intel.com
This commit is contained in:
@@ -11920,13 +11920,10 @@ F: drivers/gpio/gpio-tangier.c
|
||||
F: drivers/gpio/gpio-tangier.h
|
||||
|
||||
INTEL GVT-g DRIVERS (Intel GPU Virtualization)
|
||||
M: Zhenyu Wang <zhenyuw.linux@gmail.com>
|
||||
M: Zhi Wang <zhi.wang.linux@gmail.com>
|
||||
L: intel-gvt-dev@lists.freedesktop.org
|
||||
L: intel-gfx@lists.freedesktop.org
|
||||
S: Supported
|
||||
R: Zhenyu Wang <zhenyuw.linux@gmail.com>
|
||||
R: Zhi Wang <zhi.wang.linux@gmail.com>
|
||||
S: Odd Fixes
|
||||
W: https://github.com/intel/gvt-linux/wiki
|
||||
T: git https://github.com/intel/gvt-linux.git
|
||||
F: drivers/gpu/drm/i915/gvt/
|
||||
|
||||
INTEL HID EVENT DRIVER
|
||||
|
||||
@@ -53,6 +53,7 @@ struct intel_gtt_driver {
|
||||
* of the mmio register file, that's done in the generic code. */
|
||||
void (*cleanup)(void);
|
||||
void (*write_entry)(dma_addr_t addr, unsigned int entry, unsigned int flags);
|
||||
dma_addr_t (*read_entry)(unsigned int entry, bool *is_present, bool *is_local);
|
||||
/* Flags is a more or less chipset specific opaque value.
|
||||
* For chipsets that need to support old ums (non-gem) code, this
|
||||
* needs to be identical to the various supported agp memory types! */
|
||||
@@ -336,6 +337,19 @@ static void i810_write_entry(dma_addr_t addr, unsigned int entry,
|
||||
writel_relaxed(addr | pte_flags, intel_private.gtt + entry);
|
||||
}
|
||||
|
||||
static dma_addr_t i810_read_entry(unsigned int entry,
|
||||
bool *is_present, bool *is_local)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
val = readl(intel_private.gtt + entry);
|
||||
|
||||
*is_present = val & I810_PTE_VALID;
|
||||
*is_local = val & I810_PTE_LOCAL;
|
||||
|
||||
return val & ~0xfff;
|
||||
}
|
||||
|
||||
static resource_size_t intel_gtt_stolen_size(void)
|
||||
{
|
||||
u16 gmch_ctrl;
|
||||
@@ -741,6 +755,19 @@ static void i830_write_entry(dma_addr_t addr, unsigned int entry,
|
||||
writel_relaxed(addr | pte_flags, intel_private.gtt + entry);
|
||||
}
|
||||
|
||||
static dma_addr_t i830_read_entry(unsigned int entry,
|
||||
bool *is_present, bool *is_local)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
val = readl(intel_private.gtt + entry);
|
||||
|
||||
*is_present = val & I810_PTE_VALID;
|
||||
*is_local = false;
|
||||
|
||||
return val & ~0xfff;
|
||||
}
|
||||
|
||||
bool intel_gmch_enable_gtt(void)
|
||||
{
|
||||
u8 __iomem *reg;
|
||||
@@ -878,6 +905,13 @@ void intel_gmch_gtt_insert_sg_entries(struct sg_table *st,
|
||||
}
|
||||
EXPORT_SYMBOL(intel_gmch_gtt_insert_sg_entries);
|
||||
|
||||
dma_addr_t intel_gmch_gtt_read_entry(unsigned int pg,
|
||||
bool *is_present, bool *is_local)
|
||||
{
|
||||
return intel_private.driver->read_entry(pg, is_present, is_local);
|
||||
}
|
||||
EXPORT_SYMBOL(intel_gmch_gtt_read_entry);
|
||||
|
||||
#if IS_ENABLED(CONFIG_AGP_INTEL)
|
||||
static void intel_gmch_gtt_insert_pages(unsigned int first_entry,
|
||||
unsigned int num_entries,
|
||||
@@ -1126,6 +1160,19 @@ static void i965_write_entry(dma_addr_t addr,
|
||||
writel_relaxed(addr | pte_flags, intel_private.gtt + entry);
|
||||
}
|
||||
|
||||
static dma_addr_t i965_read_entry(unsigned int entry,
|
||||
bool *is_present, bool *is_local)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
val = readl(intel_private.gtt + entry);
|
||||
|
||||
*is_present = val & I810_PTE_VALID;
|
||||
*is_local = false;
|
||||
|
||||
return ((val & 0xf0) << 28) | (val & ~0xfff);
|
||||
}
|
||||
|
||||
static int i9xx_setup(void)
|
||||
{
|
||||
phys_addr_t reg_addr;
|
||||
@@ -1187,6 +1234,7 @@ static const struct intel_gtt_driver i81x_gtt_driver = {
|
||||
.cleanup = i810_cleanup,
|
||||
.check_flags = i830_check_flags,
|
||||
.write_entry = i810_write_entry,
|
||||
.read_entry = i810_read_entry,
|
||||
};
|
||||
static const struct intel_gtt_driver i8xx_gtt_driver = {
|
||||
.gen = 2,
|
||||
@@ -1194,6 +1242,7 @@ static const struct intel_gtt_driver i8xx_gtt_driver = {
|
||||
.setup = i830_setup,
|
||||
.cleanup = i830_cleanup,
|
||||
.write_entry = i830_write_entry,
|
||||
.read_entry = i830_read_entry,
|
||||
.dma_mask_size = 32,
|
||||
.check_flags = i830_check_flags,
|
||||
.chipset_flush = i830_chipset_flush,
|
||||
@@ -1205,6 +1254,7 @@ static const struct intel_gtt_driver i915_gtt_driver = {
|
||||
.cleanup = i9xx_cleanup,
|
||||
/* i945 is the last gpu to need phys mem (for overlay and cursors). */
|
||||
.write_entry = i830_write_entry,
|
||||
.read_entry = i830_read_entry,
|
||||
.dma_mask_size = 32,
|
||||
.check_flags = i830_check_flags,
|
||||
.chipset_flush = i9xx_chipset_flush,
|
||||
@@ -1215,6 +1265,7 @@ static const struct intel_gtt_driver g33_gtt_driver = {
|
||||
.setup = i9xx_setup,
|
||||
.cleanup = i9xx_cleanup,
|
||||
.write_entry = i965_write_entry,
|
||||
.read_entry = i965_read_entry,
|
||||
.dma_mask_size = 36,
|
||||
.check_flags = i830_check_flags,
|
||||
.chipset_flush = i9xx_chipset_flush,
|
||||
@@ -1225,6 +1276,7 @@ static const struct intel_gtt_driver pineview_gtt_driver = {
|
||||
.setup = i9xx_setup,
|
||||
.cleanup = i9xx_cleanup,
|
||||
.write_entry = i965_write_entry,
|
||||
.read_entry = i965_read_entry,
|
||||
.dma_mask_size = 36,
|
||||
.check_flags = i830_check_flags,
|
||||
.chipset_flush = i9xx_chipset_flush,
|
||||
@@ -1235,6 +1287,7 @@ static const struct intel_gtt_driver i965_gtt_driver = {
|
||||
.setup = i9xx_setup,
|
||||
.cleanup = i9xx_cleanup,
|
||||
.write_entry = i965_write_entry,
|
||||
.read_entry = i965_read_entry,
|
||||
.dma_mask_size = 36,
|
||||
.check_flags = i830_check_flags,
|
||||
.chipset_flush = i9xx_chipset_flush,
|
||||
@@ -1244,6 +1297,7 @@ static const struct intel_gtt_driver g4x_gtt_driver = {
|
||||
.setup = i9xx_setup,
|
||||
.cleanup = i9xx_cleanup,
|
||||
.write_entry = i965_write_entry,
|
||||
.read_entry = i965_read_entry,
|
||||
.dma_mask_size = 36,
|
||||
.check_flags = i830_check_flags,
|
||||
.chipset_flush = i9xx_chipset_flush,
|
||||
@@ -1254,6 +1308,7 @@ static const struct intel_gtt_driver ironlake_gtt_driver = {
|
||||
.setup = i9xx_setup,
|
||||
.cleanup = i9xx_cleanup,
|
||||
.write_entry = i965_write_entry,
|
||||
.read_entry = i965_read_entry,
|
||||
.dma_mask_size = 36,
|
||||
.check_flags = i830_check_flags,
|
||||
.chipset_flush = i9xx_chipset_flush,
|
||||
|
||||
@@ -247,6 +247,7 @@ i915-y += \
|
||||
display/intel_display_power_map.o \
|
||||
display/intel_display_power_well.o \
|
||||
display/intel_display_reset.o \
|
||||
display/intel_display_rpm.o \
|
||||
display/intel_display_rps.o \
|
||||
display/intel_display_snapshot.o \
|
||||
display/intel_display_wa.o \
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dvo_dev.h"
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dvo_dev.h"
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dvo_dev.h"
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dvo_dev.h"
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dvo_dev.h"
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dvo_dev.h"
|
||||
|
||||
|
||||
@@ -519,7 +519,7 @@ static void intel_disable_dp(struct intel_atomic_state *state,
|
||||
{
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
|
||||
|
||||
intel_dp->link_trained = false;
|
||||
intel_dp->link.active = false;
|
||||
|
||||
/*
|
||||
* Make sure the panel is off before trying to change the mode.
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "i915_reg.h"
|
||||
#include "intel_color_regs.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_pcode.h"
|
||||
|
||||
@@ -344,10 +345,9 @@ static int hsw_ips_debugfs_status_show(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct intel_crtc *crtc = m->private;
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
|
||||
seq_printf(m, "Enabled by kernel parameter: %s\n",
|
||||
str_yes_no(display->params.enable_ips));
|
||||
@@ -361,7 +361,7 @@ static int hsw_ips_debugfs_status_show(struct seq_file *m, void *unused)
|
||||
seq_puts(m, "Currently: disabled\n");
|
||||
}
|
||||
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -630,84 +630,92 @@ vlv_primary_async_flip(struct intel_dsb *dsb,
|
||||
static void
|
||||
bdw_primary_enable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
enum pipe pipe = plane->pipe;
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
bdw_enable_pipe_irq(i915, pipe, GEN8_PIPE_PRIMARY_FLIP_DONE);
|
||||
bdw_enable_pipe_irq(display, pipe, GEN8_PIPE_PRIMARY_FLIP_DONE);
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
bdw_primary_disable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
enum pipe pipe = plane->pipe;
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
bdw_disable_pipe_irq(i915, pipe, GEN8_PIPE_PRIMARY_FLIP_DONE);
|
||||
bdw_disable_pipe_irq(display, pipe, GEN8_PIPE_PRIMARY_FLIP_DONE);
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
ivb_primary_enable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
ilk_enable_display_irq(i915, DE_PLANE_FLIP_DONE_IVB(plane->i9xx_plane));
|
||||
ilk_enable_display_irq(display, DE_PLANE_FLIP_DONE_IVB(plane->i9xx_plane));
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
ivb_primary_disable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
ilk_disable_display_irq(i915, DE_PLANE_FLIP_DONE_IVB(plane->i9xx_plane));
|
||||
ilk_disable_display_irq(display, DE_PLANE_FLIP_DONE_IVB(plane->i9xx_plane));
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
ilk_primary_enable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
ilk_enable_display_irq(i915, DE_PLANE_FLIP_DONE(plane->i9xx_plane));
|
||||
ilk_enable_display_irq(display, DE_PLANE_FLIP_DONE(plane->i9xx_plane));
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
ilk_primary_disable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
ilk_disable_display_irq(i915, DE_PLANE_FLIP_DONE(plane->i9xx_plane));
|
||||
ilk_disable_display_irq(display, DE_PLANE_FLIP_DONE(plane->i9xx_plane));
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
vlv_primary_enable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
enum pipe pipe = plane->pipe;
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
i915_enable_pipestat(i915, pipe, PLANE_FLIP_DONE_INT_STATUS_VLV);
|
||||
i915_enable_pipestat(display, pipe, PLANE_FLIP_DONE_INT_STATUS_VLV);
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
vlv_primary_disable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
enum pipe pipe = plane->pipe;
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
i915_disable_pipestat(i915, pipe, PLANE_FLIP_DONE_INT_STATUS_VLV);
|
||||
i915_disable_pipestat(display, pipe, PLANE_FLIP_DONE_INT_STATUS_VLV);
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,28 +8,28 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_crtc_state;
|
||||
struct intel_display;
|
||||
struct intel_plane_state;
|
||||
|
||||
#ifdef I915
|
||||
bool ilk_disable_cxsr(struct drm_i915_private *i915);
|
||||
void ilk_wm_sanitize(struct drm_i915_private *i915);
|
||||
bool intel_set_memory_cxsr(struct drm_i915_private *i915, bool enable);
|
||||
void i9xx_wm_init(struct drm_i915_private *i915);
|
||||
bool ilk_disable_cxsr(struct intel_display *display);
|
||||
void ilk_wm_sanitize(struct intel_display *display);
|
||||
bool intel_set_memory_cxsr(struct intel_display *display, bool enable);
|
||||
void i9xx_wm_init(struct intel_display *display);
|
||||
#else
|
||||
static inline bool ilk_disable_cxsr(struct drm_i915_private *i915)
|
||||
static inline bool ilk_disable_cxsr(struct intel_display *display)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline void ilk_wm_sanitize(struct drm_i915_private *i915)
|
||||
static inline void ilk_wm_sanitize(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
static inline bool intel_set_memory_cxsr(struct drm_i915_private *i915, bool enable)
|
||||
static inline bool intel_set_memory_cxsr(struct intel_display *display, bool enable)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline void i9xx_wm_init(struct drm_i915_private *i915)
|
||||
static inline void i9xx_wm_init(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_fixed.h>
|
||||
#include <drm/drm_mipi_dsi.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include "i915_reg.h"
|
||||
@@ -1826,107 +1827,56 @@ static const struct mipi_dsi_host_ops gen11_dsi_host_ops = {
|
||||
.transfer = gen11_dsi_host_transfer,
|
||||
};
|
||||
|
||||
#define ICL_PREPARE_CNT_MAX 0x7
|
||||
#define ICL_CLK_ZERO_CNT_MAX 0xf
|
||||
#define ICL_TRAIL_CNT_MAX 0x7
|
||||
#define ICL_TCLK_PRE_CNT_MAX 0x3
|
||||
#define ICL_TCLK_POST_CNT_MAX 0x7
|
||||
#define ICL_HS_ZERO_CNT_MAX 0xf
|
||||
#define ICL_EXIT_ZERO_CNT_MAX 0x7
|
||||
|
||||
static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
struct intel_connector *connector = intel_dsi->attached_connector;
|
||||
struct mipi_config *mipi_config = connector->panel.vbt.dsi.config;
|
||||
u32 tlpx_ns;
|
||||
u32 prepare_cnt, exit_zero_cnt, clk_zero_cnt, trail_cnt;
|
||||
u32 ths_prepare_ns, tclk_trail_ns;
|
||||
u32 hs_zero_cnt;
|
||||
u32 tclk_pre_cnt;
|
||||
u32 tclk_prepare_esc_clk, tclk_zero_esc_clk, tclk_pre_esc_clk;
|
||||
u32 ths_prepare_esc_clk, ths_zero_esc_clk, ths_exit_esc_clk;
|
||||
|
||||
tlpx_ns = intel_dsi_tlpx_ns(intel_dsi);
|
||||
|
||||
tclk_trail_ns = max(mipi_config->tclk_trail, mipi_config->ths_trail);
|
||||
ths_prepare_ns = max(mipi_config->ths_prepare,
|
||||
mipi_config->tclk_prepare);
|
||||
|
||||
/*
|
||||
* prepare cnt in escape clocks
|
||||
* this field represents a hexadecimal value with a precision
|
||||
* of 1.2 – i.e. the most significant bit is the integer
|
||||
* and the least significant 2 bits are fraction bits.
|
||||
* so, the field can represent a range of 0.25 to 1.75
|
||||
* The clock and data lane prepare timing parameters are in expressed in
|
||||
* units of 1/4 escape clocks, and all the other timings parameters in
|
||||
* escape clocks.
|
||||
*/
|
||||
prepare_cnt = DIV_ROUND_UP(ths_prepare_ns * 4, tlpx_ns);
|
||||
if (prepare_cnt > ICL_PREPARE_CNT_MAX) {
|
||||
drm_dbg_kms(display->drm, "prepare_cnt out of range (%d)\n",
|
||||
prepare_cnt);
|
||||
prepare_cnt = ICL_PREPARE_CNT_MAX;
|
||||
}
|
||||
tclk_prepare_esc_clk = DIV_ROUND_UP(mipi_config->tclk_prepare * 4, tlpx_ns);
|
||||
tclk_prepare_esc_clk = min(tclk_prepare_esc_clk, 7);
|
||||
|
||||
/* clk zero count in escape clocks */
|
||||
clk_zero_cnt = DIV_ROUND_UP(mipi_config->tclk_prepare_clkzero -
|
||||
ths_prepare_ns, tlpx_ns);
|
||||
if (clk_zero_cnt > ICL_CLK_ZERO_CNT_MAX) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"clk_zero_cnt out of range (%d)\n", clk_zero_cnt);
|
||||
clk_zero_cnt = ICL_CLK_ZERO_CNT_MAX;
|
||||
}
|
||||
tclk_zero_esc_clk = DIV_ROUND_UP(mipi_config->tclk_prepare_clkzero -
|
||||
mipi_config->tclk_prepare, tlpx_ns);
|
||||
tclk_zero_esc_clk = min(tclk_zero_esc_clk, 15);
|
||||
|
||||
/* trail cnt in escape clocks*/
|
||||
trail_cnt = DIV_ROUND_UP(tclk_trail_ns, tlpx_ns);
|
||||
if (trail_cnt > ICL_TRAIL_CNT_MAX) {
|
||||
drm_dbg_kms(display->drm, "trail_cnt out of range (%d)\n",
|
||||
trail_cnt);
|
||||
trail_cnt = ICL_TRAIL_CNT_MAX;
|
||||
}
|
||||
tclk_pre_esc_clk = DIV_ROUND_UP(mipi_config->tclk_pre, tlpx_ns);
|
||||
tclk_pre_esc_clk = min(tclk_pre_esc_clk, 3);
|
||||
|
||||
/* tclk pre count in escape clocks */
|
||||
tclk_pre_cnt = DIV_ROUND_UP(mipi_config->tclk_pre, tlpx_ns);
|
||||
if (tclk_pre_cnt > ICL_TCLK_PRE_CNT_MAX) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"tclk_pre_cnt out of range (%d)\n", tclk_pre_cnt);
|
||||
tclk_pre_cnt = ICL_TCLK_PRE_CNT_MAX;
|
||||
}
|
||||
ths_prepare_esc_clk = DIV_ROUND_UP(mipi_config->ths_prepare * 4, tlpx_ns);
|
||||
ths_prepare_esc_clk = min(ths_prepare_esc_clk, 7);
|
||||
|
||||
/* hs zero cnt in escape clocks */
|
||||
hs_zero_cnt = DIV_ROUND_UP(mipi_config->ths_prepare_hszero -
|
||||
ths_prepare_ns, tlpx_ns);
|
||||
if (hs_zero_cnt > ICL_HS_ZERO_CNT_MAX) {
|
||||
drm_dbg_kms(display->drm, "hs_zero_cnt out of range (%d)\n",
|
||||
hs_zero_cnt);
|
||||
hs_zero_cnt = ICL_HS_ZERO_CNT_MAX;
|
||||
}
|
||||
ths_zero_esc_clk = DIV_ROUND_UP(mipi_config->ths_prepare_hszero -
|
||||
mipi_config->ths_prepare, tlpx_ns);
|
||||
ths_zero_esc_clk = min(ths_zero_esc_clk, 15);
|
||||
|
||||
/* hs exit zero cnt in escape clocks */
|
||||
exit_zero_cnt = DIV_ROUND_UP(mipi_config->ths_exit, tlpx_ns);
|
||||
if (exit_zero_cnt > ICL_EXIT_ZERO_CNT_MAX) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"exit_zero_cnt out of range (%d)\n",
|
||||
exit_zero_cnt);
|
||||
exit_zero_cnt = ICL_EXIT_ZERO_CNT_MAX;
|
||||
}
|
||||
ths_exit_esc_clk = DIV_ROUND_UP(mipi_config->ths_exit, tlpx_ns);
|
||||
ths_exit_esc_clk = min(ths_exit_esc_clk, 7);
|
||||
|
||||
/* clock lane dphy timings */
|
||||
intel_dsi->dphy_reg = (CLK_PREPARE_OVERRIDE |
|
||||
CLK_PREPARE(prepare_cnt) |
|
||||
CLK_PREPARE(tclk_prepare_esc_clk) |
|
||||
CLK_ZERO_OVERRIDE |
|
||||
CLK_ZERO(clk_zero_cnt) |
|
||||
CLK_ZERO(tclk_zero_esc_clk) |
|
||||
CLK_PRE_OVERRIDE |
|
||||
CLK_PRE(tclk_pre_cnt) |
|
||||
CLK_TRAIL_OVERRIDE |
|
||||
CLK_TRAIL(trail_cnt));
|
||||
CLK_PRE(tclk_pre_esc_clk));
|
||||
|
||||
/* data lanes dphy timings */
|
||||
intel_dsi->dphy_data_lane_reg = (HS_PREPARE_OVERRIDE |
|
||||
HS_PREPARE(prepare_cnt) |
|
||||
HS_PREPARE(ths_prepare_esc_clk) |
|
||||
HS_ZERO_OVERRIDE |
|
||||
HS_ZERO(hs_zero_cnt) |
|
||||
HS_TRAIL_OVERRIDE |
|
||||
HS_TRAIL(trail_cnt) |
|
||||
HS_ZERO(ths_zero_esc_clk) |
|
||||
HS_EXIT_OVERRIDE |
|
||||
HS_EXIT(exit_zero_cnt));
|
||||
HS_EXIT(ths_exit_esc_clk));
|
||||
|
||||
intel_dsi_log_params(intel_dsi);
|
||||
}
|
||||
|
||||
@@ -33,16 +33,17 @@
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_fourcc.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_cdclk.h"
|
||||
#include "intel_display_core.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp_tunnel.h"
|
||||
#include "intel_fb.h"
|
||||
#include "intel_global_state.h"
|
||||
#include "intel_hdcp.h"
|
||||
#include "intel_psr.h"
|
||||
#include "intel_fb.h"
|
||||
#include "skl_universal_plane.h"
|
||||
|
||||
/**
|
||||
@@ -59,17 +60,16 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector,
|
||||
struct drm_property *property,
|
||||
u64 *val)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_display *display = to_intel_display(connector->dev);
|
||||
const struct intel_digital_connector_state *intel_conn_state =
|
||||
to_intel_digital_connector_state(state);
|
||||
|
||||
if (property == dev_priv->display.properties.force_audio)
|
||||
if (property == display->properties.force_audio)
|
||||
*val = intel_conn_state->force_audio;
|
||||
else if (property == dev_priv->display.properties.broadcast_rgb)
|
||||
else if (property == display->properties.broadcast_rgb)
|
||||
*val = intel_conn_state->broadcast_rgb;
|
||||
else {
|
||||
drm_dbg_atomic(&dev_priv->drm,
|
||||
drm_dbg_atomic(display->drm,
|
||||
"Unknown property [PROP:%d:%s]\n",
|
||||
property->base.id, property->name);
|
||||
return -EINVAL;
|
||||
@@ -92,22 +92,21 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector,
|
||||
struct drm_property *property,
|
||||
u64 val)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_display *display = to_intel_display(connector->dev);
|
||||
struct intel_digital_connector_state *intel_conn_state =
|
||||
to_intel_digital_connector_state(state);
|
||||
|
||||
if (property == dev_priv->display.properties.force_audio) {
|
||||
if (property == display->properties.force_audio) {
|
||||
intel_conn_state->force_audio = val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (property == dev_priv->display.properties.broadcast_rgb) {
|
||||
if (property == display->properties.broadcast_rgb) {
|
||||
intel_conn_state->broadcast_rgb = val;
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_dbg_atomic(&dev_priv->drm, "Unknown property [PROP:%d:%s]\n",
|
||||
drm_dbg_atomic(display->drm, "Unknown property [PROP:%d:%s]\n",
|
||||
property->base.id, property->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "intel_backlight_regs.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp_aux_backlight.h"
|
||||
#include "intel_dsi_dcs_backlight.h"
|
||||
@@ -901,11 +902,9 @@ static int intel_backlight_device_get_brightness(struct backlight_device *bd)
|
||||
{
|
||||
struct intel_connector *connector = bl_get_data(bd);
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
intel_wakeref_t wakeref;
|
||||
int ret = 0;
|
||||
|
||||
with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
|
||||
with_intel_display_rpm(display) {
|
||||
u32 hw_level;
|
||||
|
||||
drm_modeset_lock(&display->drm->mode_config.connection_mutex, NULL);
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_display.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_gmbus.h"
|
||||
|
||||
@@ -3115,7 +3116,6 @@ static const struct vbt_header *intel_bios_get_vbt(struct intel_display *display
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
const struct vbt_header *vbt = NULL;
|
||||
intel_wakeref_t wakeref;
|
||||
|
||||
vbt = firmware_get_vbt(display, sizep);
|
||||
|
||||
@@ -3127,11 +3127,11 @@ static const struct vbt_header *intel_bios_get_vbt(struct intel_display *display
|
||||
* through MMIO or PCI mapping
|
||||
*/
|
||||
if (!vbt && IS_DGFX(i915))
|
||||
with_intel_runtime_pm(&i915->runtime_pm, wakeref)
|
||||
with_intel_display_rpm(display)
|
||||
vbt = oprom_get_vbt(display, intel_rom_spi(i915), sizep, "SPI flash");
|
||||
|
||||
if (!vbt)
|
||||
with_intel_runtime_pm(&i915->runtime_pm, wakeref)
|
||||
with_intel_display_rpm(display)
|
||||
vbt = oprom_get_vbt(display, intel_rom_pci(i915), sizep, "PCI ROM");
|
||||
|
||||
return vbt;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,6 @@
|
||||
#include "intel_display_power.h"
|
||||
#include "intel_global_state.h"
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_atomic_state;
|
||||
struct intel_crtc;
|
||||
struct intel_crtc_state;
|
||||
@@ -49,13 +48,6 @@ struct intel_bw_state {
|
||||
*/
|
||||
u16 qgv_points_mask;
|
||||
|
||||
/*
|
||||
* Flag to force the QGV comparison in atomic check right after the
|
||||
* hw state readout
|
||||
*/
|
||||
bool force_check_qgv;
|
||||
|
||||
int min_cdclk[I915_MAX_PIPES];
|
||||
unsigned int data_rate[I915_MAX_PIPES];
|
||||
u8 num_active_planes[I915_MAX_PIPES];
|
||||
};
|
||||
@@ -72,14 +64,14 @@ intel_atomic_get_new_bw_state(struct intel_atomic_state *state);
|
||||
struct intel_bw_state *
|
||||
intel_atomic_get_bw_state(struct intel_atomic_state *state);
|
||||
|
||||
void intel_bw_init_hw(struct drm_i915_private *dev_priv);
|
||||
int intel_bw_init(struct drm_i915_private *dev_priv);
|
||||
int intel_bw_atomic_check(struct intel_atomic_state *state);
|
||||
int icl_pcode_restrict_qgv_points(struct drm_i915_private *dev_priv,
|
||||
void intel_bw_init_hw(struct intel_display *display);
|
||||
int intel_bw_init(struct intel_display *display);
|
||||
int intel_bw_atomic_check(struct intel_atomic_state *state, bool any_ms);
|
||||
int icl_pcode_restrict_qgv_points(struct intel_display *display,
|
||||
u32 points_mask);
|
||||
int intel_bw_calc_min_cdclk(struct intel_atomic_state *state,
|
||||
bool *need_cdclk_calc);
|
||||
int intel_bw_min_cdclk(struct drm_i915_private *i915,
|
||||
int intel_bw_min_cdclk(struct intel_display *display,
|
||||
const struct intel_bw_state *bw_state);
|
||||
void intel_bw_update_hw_state(struct intel_display *display);
|
||||
void intel_bw_crtc_disable_noatomic(struct intel_crtc *crtc);
|
||||
|
||||
@@ -1972,9 +1972,7 @@ int intel_mdclk_cdclk_ratio(struct intel_display *display,
|
||||
static void xe2lpd_mdclk_cdclk_ratio_program(struct intel_display *display,
|
||||
const struct intel_cdclk_config *cdclk_config)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
intel_dbuf_mdclk_cdclk_ratio_update(i915,
|
||||
intel_dbuf_mdclk_cdclk_ratio_update(display,
|
||||
intel_mdclk_cdclk_ratio(display, cdclk_config),
|
||||
cdclk_config->joined_mbus);
|
||||
}
|
||||
@@ -2808,7 +2806,6 @@ static int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_stat
|
||||
static int intel_compute_min_cdclk(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_cdclk_state *cdclk_state =
|
||||
intel_atomic_get_new_cdclk_state(state);
|
||||
const struct intel_bw_state *bw_state;
|
||||
@@ -2836,7 +2833,7 @@ static int intel_compute_min_cdclk(struct intel_atomic_state *state)
|
||||
|
||||
bw_state = intel_atomic_get_new_bw_state(state);
|
||||
if (bw_state) {
|
||||
min_cdclk = intel_bw_min_cdclk(dev_priv, bw_state);
|
||||
min_cdclk = intel_bw_min_cdclk(display, bw_state);
|
||||
|
||||
if (cdclk_state->bw_min_cdclk != min_cdclk) {
|
||||
int ret;
|
||||
@@ -3342,6 +3339,8 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
|
||||
|
||||
void intel_cdclk_update_hw_state(struct intel_display *display)
|
||||
{
|
||||
const struct intel_bw_state *bw_state =
|
||||
to_intel_bw_state(display->bw.obj.state);
|
||||
struct intel_cdclk_state *cdclk_state =
|
||||
to_intel_cdclk_state(display->cdclk.obj.state);
|
||||
struct intel_crtc *crtc;
|
||||
@@ -3359,6 +3358,8 @@ void intel_cdclk_update_hw_state(struct intel_display *display)
|
||||
cdclk_state->min_cdclk[pipe] = intel_crtc_compute_min_cdclk(crtc_state);
|
||||
cdclk_state->min_voltage_level[pipe] = crtc_state->min_voltage_level;
|
||||
}
|
||||
|
||||
cdclk_state->bw_min_cdclk = intel_bw_min_cdclk(display, bw_state);
|
||||
}
|
||||
|
||||
void intel_cdclk_crtc_disable_noatomic(struct intel_crtc *crtc)
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_utils.h"
|
||||
#include "i9xx_plane_regs.h"
|
||||
#include "intel_color.h"
|
||||
#include "intel_color_regs.h"
|
||||
@@ -405,14 +407,13 @@ static void icl_read_csc(struct intel_crtc_state *crtc_state)
|
||||
static bool ilk_limited_range(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
/* icl+ have dedicated output CSC */
|
||||
if (DISPLAY_VER(display) >= 11)
|
||||
return false;
|
||||
|
||||
/* pre-hsw have TRANSCONF_COLOR_RANGE_SELECT */
|
||||
if (DISPLAY_VER(display) < 7 || IS_IVYBRIDGE(i915))
|
||||
if (DISPLAY_VER(display) < 7 || display->platform.ivybridge)
|
||||
return false;
|
||||
|
||||
return crtc_state->limited_color_range;
|
||||
@@ -516,7 +517,6 @@ static void ilk_csc_convert_ctm(const struct intel_crtc_state *crtc_state,
|
||||
static void ilk_assign_csc(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
bool limited_color_range = ilk_csc_limited_range(crtc_state);
|
||||
|
||||
if (crtc_state->hw.ctm) {
|
||||
@@ -538,7 +538,7 @@ static void ilk_assign_csc(struct intel_crtc_state *crtc_state)
|
||||
* LUT is needed but CSC is not we need to load an
|
||||
* identity matrix.
|
||||
*/
|
||||
drm_WARN_ON(display->drm, !IS_GEMINILAKE(i915));
|
||||
drm_WARN_ON(display->drm, !display->platform.geminilake);
|
||||
|
||||
ilk_csc_copy(display, &crtc_state->csc, &ilk_csc_matrix_identity);
|
||||
} else {
|
||||
@@ -3983,12 +3983,10 @@ int intel_color_init(struct intel_display *display)
|
||||
|
||||
void intel_color_init_hooks(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
if (HAS_GMCH(display)) {
|
||||
if (IS_CHERRYVIEW(i915))
|
||||
if (display->platform.cherryview)
|
||||
display->funcs.color = &chv_color_funcs;
|
||||
else if (IS_VALLEYVIEW(i915))
|
||||
else if (display->platform.valleyview)
|
||||
display->funcs.color = &vlv_color_funcs;
|
||||
else if (DISPLAY_VER(display) >= 4)
|
||||
display->funcs.color = &i965_color_funcs;
|
||||
@@ -4005,7 +4003,7 @@ void intel_color_init_hooks(struct intel_display *display)
|
||||
display->funcs.color = &skl_color_funcs;
|
||||
else if (DISPLAY_VER(display) == 8)
|
||||
display->funcs.color = &bdw_color_funcs;
|
||||
else if (IS_HASWELL(i915))
|
||||
else if (display->platform.haswell)
|
||||
display->funcs.color = &hsw_color_funcs;
|
||||
else if (DISPLAY_VER(display) == 7)
|
||||
display->funcs.color = &ivb_color_funcs;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
* Copyright © 2018 Intel Corporation
|
||||
*/
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_reg.h"
|
||||
#include "i915_utils.h"
|
||||
#include "intel_combo_phy.h"
|
||||
|
||||
@@ -31,8 +31,10 @@
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_utils.h"
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_display_core.h"
|
||||
#include "intel_display_debugfs.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_hdcp.h"
|
||||
@@ -154,13 +156,14 @@ void intel_connector_destroy(struct drm_connector *connector)
|
||||
int intel_connector_register(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_connector *intel_connector = to_intel_connector(connector);
|
||||
struct drm_i915_private *i915 = to_i915(connector->dev);
|
||||
int ret;
|
||||
|
||||
ret = intel_backlight_device_register(intel_connector);
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
if (i915_inject_probe_failure(to_i915(connector->dev))) {
|
||||
if (i915_inject_probe_failure(i915)) {
|
||||
ret = -EFAULT;
|
||||
goto err_backlight;
|
||||
}
|
||||
@@ -204,10 +207,10 @@ bool intel_connector_get_hw_state(struct intel_connector *connector)
|
||||
|
||||
enum pipe intel_connector_get_pipe(struct intel_connector *connector)
|
||||
{
|
||||
struct drm_device *dev = connector->base.dev;
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
|
||||
drm_WARN_ON(dev,
|
||||
!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
|
||||
drm_WARN_ON(display->drm,
|
||||
!drm_modeset_is_locked(&display->drm->mode_config.connection_mutex));
|
||||
|
||||
if (!connector->base.state->crtc)
|
||||
return INVALID_PIPE;
|
||||
@@ -264,20 +267,19 @@ static const struct drm_prop_enum_list force_audio_names[] = {
|
||||
void
|
||||
intel_attach_force_audio_property(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_display *display = to_intel_display(connector->dev);
|
||||
struct drm_property *prop;
|
||||
|
||||
prop = dev_priv->display.properties.force_audio;
|
||||
prop = display->properties.force_audio;
|
||||
if (prop == NULL) {
|
||||
prop = drm_property_create_enum(dev, 0,
|
||||
"audio",
|
||||
force_audio_names,
|
||||
ARRAY_SIZE(force_audio_names));
|
||||
prop = drm_property_create_enum(display->drm, 0,
|
||||
"audio",
|
||||
force_audio_names,
|
||||
ARRAY_SIZE(force_audio_names));
|
||||
if (prop == NULL)
|
||||
return;
|
||||
|
||||
dev_priv->display.properties.force_audio = prop;
|
||||
display->properties.force_audio = prop;
|
||||
}
|
||||
drm_object_attach_property(&connector->base, prop, 0);
|
||||
}
|
||||
@@ -291,20 +293,19 @@ static const struct drm_prop_enum_list broadcast_rgb_names[] = {
|
||||
void
|
||||
intel_attach_broadcast_rgb_property(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_display *display = to_intel_display(connector->dev);
|
||||
struct drm_property *prop;
|
||||
|
||||
prop = dev_priv->display.properties.broadcast_rgb;
|
||||
prop = display->properties.broadcast_rgb;
|
||||
if (prop == NULL) {
|
||||
prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM,
|
||||
"Broadcast RGB",
|
||||
broadcast_rgb_names,
|
||||
ARRAY_SIZE(broadcast_rgb_names));
|
||||
prop = drm_property_create_enum(display->drm, DRM_MODE_PROP_ENUM,
|
||||
"Broadcast RGB",
|
||||
broadcast_rgb_names,
|
||||
ARRAY_SIZE(broadcast_rgb_names));
|
||||
if (prop == NULL)
|
||||
return;
|
||||
|
||||
dev_priv->display.properties.broadcast_rgb = prop;
|
||||
display->properties.broadcast_rgb = prop;
|
||||
}
|
||||
|
||||
drm_object_attach_property(&connector->base, prop, 0);
|
||||
@@ -336,14 +337,14 @@ intel_attach_dp_colorspace_property(struct drm_connector *connector)
|
||||
void
|
||||
intel_attach_scaling_mode_property(struct drm_connector *connector)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->dev);
|
||||
struct intel_display *display = to_intel_display(connector->dev);
|
||||
u32 scaling_modes;
|
||||
|
||||
scaling_modes = BIT(DRM_MODE_SCALE_ASPECT) |
|
||||
BIT(DRM_MODE_SCALE_FULLSCREEN);
|
||||
|
||||
/* On GMCH platforms borders are only possible on the LVDS port */
|
||||
if (!HAS_GMCH(i915) || connector->connector_type == DRM_MODE_CONNECTOR_LVDS)
|
||||
if (!HAS_GMCH(display) || connector->connector_type == DRM_MODE_CONNECTOR_LVDS)
|
||||
scaling_modes |= BIT(DRM_MODE_SCALE_CENTER);
|
||||
|
||||
drm_connector_attach_scaling_mode_property(connector, scaling_modes);
|
||||
|
||||
@@ -532,8 +532,6 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(connector->dev);
|
||||
struct intel_crt *crt = intel_attached_crt(to_intel_connector(connector));
|
||||
struct drm_i915_private *dev_priv = to_i915(connector->dev);
|
||||
bool reenable_hpd;
|
||||
u32 adpa;
|
||||
bool ret;
|
||||
u32 save_adpa;
|
||||
@@ -550,7 +548,7 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
|
||||
*
|
||||
* Just disable HPD interrupts here to prevent this
|
||||
*/
|
||||
reenable_hpd = intel_hpd_disable(dev_priv, crt->base.hpd_pin);
|
||||
intel_hpd_block(&crt->base);
|
||||
|
||||
save_adpa = adpa = intel_de_read(display, crt->adpa_reg);
|
||||
drm_dbg_kms(display->drm,
|
||||
@@ -577,8 +575,7 @@ static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
|
||||
drm_dbg_kms(display->drm,
|
||||
"valleyview hotplug adpa=0x%x, result %d\n", adpa, ret);
|
||||
|
||||
if (reenable_hpd)
|
||||
intel_hpd_enable(dev_priv, crt->base.hpd_pin);
|
||||
intel_hpd_clear_and_unblock(&crt->base);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -609,7 +606,7 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)
|
||||
|
||||
for (i = 0; i < tries ; i++) {
|
||||
/* turn on the FORCE_DETECT */
|
||||
i915_hotplug_interrupt_update(dev_priv,
|
||||
i915_hotplug_interrupt_update(display,
|
||||
CRT_HOTPLUG_FORCE_DETECT,
|
||||
CRT_HOTPLUG_FORCE_DETECT);
|
||||
/* wait for FORCE_DETECT to go off */
|
||||
@@ -627,7 +624,7 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)
|
||||
intel_de_write(display, PORT_HOTPLUG_STAT(display),
|
||||
CRT_HOTPLUG_INT_STATUS);
|
||||
|
||||
i915_hotplug_interrupt_update(dev_priv, CRT_HOTPLUG_FORCE_DETECT, 0);
|
||||
i915_hotplug_interrupt_update(display, CRT_HOTPLUG_FORCE_DETECT, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -880,7 +877,7 @@ intel_crt_detect(struct drm_connector *connector,
|
||||
|
||||
wakeref = intel_display_power_get(display, encoder->power_domain);
|
||||
|
||||
if (I915_HAS_HOTPLUG(display)) {
|
||||
if (HAS_HOTPLUG(display)) {
|
||||
/* We can not rely on the HPD pin always being correctly wired
|
||||
* up, for example many KVM do not pass it through, and so
|
||||
* only trust an assertion that the monitor is connected.
|
||||
@@ -904,7 +901,7 @@ intel_crt_detect(struct drm_connector *connector,
|
||||
* broken monitor (without edid) to work behind a broken kvm (that fails
|
||||
* to have the right resistors for HP detection) needs to fix this up.
|
||||
* For now just bail out. */
|
||||
if (I915_HAS_HOTPLUG(display)) {
|
||||
if (HAS_HOTPLUG(display)) {
|
||||
status = connector_status_disconnected;
|
||||
goto out;
|
||||
}
|
||||
@@ -1084,7 +1081,7 @@ void intel_crt_init(struct intel_display *display)
|
||||
|
||||
crt->base.power_domain = POWER_DOMAIN_PORT_CRT;
|
||||
|
||||
if (I915_HAS_HOTPLUG(display) &&
|
||||
if (HAS_HOTPLUG(display) &&
|
||||
!dmi_check_system(intel_spurious_crt_detect)) {
|
||||
crt->base.hpd_pin = HPD_CRT;
|
||||
crt->base.hotplug = intel_encoder_hotplug;
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
|
||||
#include <drm/drm_edid.h>
|
||||
#include <drm/drm_eld.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_crtc_state_dump.h"
|
||||
#include "intel_display_core.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_hdmi.h"
|
||||
#include "intel_vblank.h"
|
||||
@@ -42,13 +43,13 @@ intel_dump_m_n_config(struct drm_printer *p,
|
||||
}
|
||||
|
||||
static void
|
||||
intel_dump_infoframe(struct drm_i915_private *i915,
|
||||
intel_dump_infoframe(struct intel_display *display,
|
||||
const union hdmi_infoframe *frame)
|
||||
{
|
||||
if (!drm_debug_enabled(DRM_UT_KMS))
|
||||
return;
|
||||
|
||||
hdmi_infoframe_log(KERN_DEBUG, i915->drm.dev, frame);
|
||||
hdmi_infoframe_log(KERN_DEBUG, display->drm->dev, frame);
|
||||
}
|
||||
|
||||
#define OUTPUT_TYPE(x) [INTEL_OUTPUT_ ## x] = #x
|
||||
@@ -136,7 +137,7 @@ static void intel_dump_plane_state(struct drm_printer *p,
|
||||
}
|
||||
|
||||
static void
|
||||
ilk_dump_csc(struct drm_i915_private *i915,
|
||||
ilk_dump_csc(struct intel_display *display,
|
||||
struct drm_printer *p,
|
||||
const char *name,
|
||||
const struct intel_csc_matrix *csc)
|
||||
@@ -152,7 +153,7 @@ ilk_dump_csc(struct drm_i915_private *i915,
|
||||
csc->coeff[3 * i + 1],
|
||||
csc->coeff[3 * i + 2]);
|
||||
|
||||
if (DISPLAY_VER(i915) < 7)
|
||||
if (DISPLAY_VER(display) < 7)
|
||||
return;
|
||||
|
||||
drm_printf(p, "%s: post offsets: 0x%04x 0x%04x 0x%04x\n", name,
|
||||
@@ -178,7 +179,6 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
|
||||
{
|
||||
struct intel_display *display = to_intel_display(pipe_config);
|
||||
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
|
||||
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
|
||||
const struct intel_plane_state *plane_state;
|
||||
struct intel_plane *plane;
|
||||
struct drm_printer p;
|
||||
@@ -188,7 +188,7 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
|
||||
if (!drm_debug_enabled(DRM_UT_KMS))
|
||||
return;
|
||||
|
||||
p = drm_dbg_printer(&i915->drm, DRM_UT_KMS, NULL);
|
||||
p = drm_dbg_printer(display->drm, DRM_UT_KMS, NULL);
|
||||
|
||||
drm_printf(&p, "[CRTC:%d:%s] enable: %s [%s]\n",
|
||||
crtc->base.base.id, crtc->base.name,
|
||||
@@ -262,19 +262,19 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
|
||||
drm_printf(&p, "GCP: 0x%x\n", pipe_config->infoframes.gcp);
|
||||
if (pipe_config->infoframes.enable &
|
||||
intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_AVI))
|
||||
intel_dump_infoframe(i915, &pipe_config->infoframes.avi);
|
||||
intel_dump_infoframe(display, &pipe_config->infoframes.avi);
|
||||
if (pipe_config->infoframes.enable &
|
||||
intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_SPD))
|
||||
intel_dump_infoframe(i915, &pipe_config->infoframes.spd);
|
||||
intel_dump_infoframe(display, &pipe_config->infoframes.spd);
|
||||
if (pipe_config->infoframes.enable &
|
||||
intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_VENDOR))
|
||||
intel_dump_infoframe(i915, &pipe_config->infoframes.hdmi);
|
||||
intel_dump_infoframe(display, &pipe_config->infoframes.hdmi);
|
||||
if (pipe_config->infoframes.enable &
|
||||
intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_DRM))
|
||||
intel_dump_infoframe(i915, &pipe_config->infoframes.drm);
|
||||
intel_dump_infoframe(display, &pipe_config->infoframes.drm);
|
||||
if (pipe_config->infoframes.enable &
|
||||
intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA))
|
||||
intel_dump_infoframe(i915, &pipe_config->infoframes.drm);
|
||||
intel_dump_infoframe(display, &pipe_config->infoframes.drm);
|
||||
if (pipe_config->infoframes.enable &
|
||||
intel_hdmi_infoframe_enable(DP_SDP_VSC))
|
||||
drm_dp_vsc_sdp_log(&p, &pipe_config->infoframes.vsc);
|
||||
@@ -294,8 +294,9 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
|
||||
pipe_config->hw.adjusted_mode.crtc_vdisplay,
|
||||
pipe_config->framestart_delay, pipe_config->msa_timing_delay);
|
||||
|
||||
drm_printf(&p, "vrr: %s, vmin: %d, vmax: %d, flipline: %d, pipeline full: %d, guardband: %d vsync start: %d, vsync end: %d\n",
|
||||
drm_printf(&p, "vrr: %s, fixed rr: %s, vmin: %d, vmax: %d, flipline: %d, pipeline full: %d, guardband: %d vsync start: %d, vsync end: %d\n",
|
||||
str_yes_no(pipe_config->vrr.enable),
|
||||
str_yes_no(intel_vrr_is_fixed_rr(pipe_config)),
|
||||
pipe_config->vrr.vmin, pipe_config->vrr.vmax, pipe_config->vrr.flipline,
|
||||
pipe_config->vrr.pipeline_full, pipe_config->vrr.guardband,
|
||||
pipe_config->vrr.vsync_start, pipe_config->vrr.vsync_end);
|
||||
@@ -319,14 +320,14 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
|
||||
drm_printf(&p, "linetime: %d, ips linetime: %d\n",
|
||||
pipe_config->linetime, pipe_config->ips_linetime);
|
||||
|
||||
if (DISPLAY_VER(i915) >= 9)
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
drm_printf(&p, "num_scalers: %d, scaler_users: 0x%x, scaler_id: %d, scaling_filter: %d\n",
|
||||
crtc->num_scalers,
|
||||
pipe_config->scaler_state.scaler_users,
|
||||
pipe_config->scaler_state.scaler_id,
|
||||
pipe_config->hw.scaling_filter);
|
||||
|
||||
if (HAS_GMCH(i915))
|
||||
if (HAS_GMCH(display))
|
||||
drm_printf(&p, "gmch pfit: control: 0x%08x, ratios: 0x%08x, lvds border: 0x%08x\n",
|
||||
pipe_config->gmch_pfit.control,
|
||||
pipe_config->gmch_pfit.pgm_ratios,
|
||||
@@ -343,7 +344,7 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
|
||||
|
||||
intel_dpll_dump_hw_state(display, &p, &pipe_config->dpll_hw_state);
|
||||
|
||||
if (IS_CHERRYVIEW(i915))
|
||||
if (display->platform.cherryview)
|
||||
drm_printf(&p, "cgm_mode: 0x%x gamma_mode: 0x%x gamma_enable: %d csc_enable: %d\n",
|
||||
pipe_config->cgm_mode, pipe_config->gamma_mode,
|
||||
pipe_config->gamma_enable, pipe_config->csc_enable);
|
||||
@@ -354,20 +355,20 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
|
||||
|
||||
drm_printf(&p, "pre csc lut: %s%d entries, post csc lut: %d entries\n",
|
||||
pipe_config->pre_csc_lut && pipe_config->pre_csc_lut ==
|
||||
i915->display.color.glk_linear_degamma_lut ? "(linear) " : "",
|
||||
display->color.glk_linear_degamma_lut ? "(linear) " : "",
|
||||
pipe_config->pre_csc_lut ?
|
||||
drm_color_lut_size(pipe_config->pre_csc_lut) : 0,
|
||||
pipe_config->post_csc_lut ?
|
||||
drm_color_lut_size(pipe_config->post_csc_lut) : 0);
|
||||
|
||||
if (DISPLAY_VER(i915) >= 11)
|
||||
ilk_dump_csc(i915, &p, "output csc", &pipe_config->output_csc);
|
||||
if (DISPLAY_VER(display) >= 11)
|
||||
ilk_dump_csc(display, &p, "output csc", &pipe_config->output_csc);
|
||||
|
||||
if (!HAS_GMCH(i915))
|
||||
ilk_dump_csc(i915, &p, "pipe csc", &pipe_config->csc);
|
||||
else if (IS_CHERRYVIEW(i915))
|
||||
if (!HAS_GMCH(display))
|
||||
ilk_dump_csc(display, &p, "pipe csc", &pipe_config->csc);
|
||||
else if (display->platform.cherryview)
|
||||
vlv_dump_csc(&p, "cgm csc", &pipe_config->csc);
|
||||
else if (IS_VALLEYVIEW(i915))
|
||||
else if (display->platform.valleyview)
|
||||
vlv_dump_csc(&p, "wgc csc", &pipe_config->csc);
|
||||
|
||||
intel_vdsc_state_dump(&p, 0, pipe_config);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -181,20 +181,18 @@ intel_de_wait_custom(struct intel_display *display, i915_reg_t reg,
|
||||
}
|
||||
|
||||
static inline int
|
||||
__intel_de_wait_for_set(struct intel_display *display, i915_reg_t reg,
|
||||
u32 mask, unsigned int timeout)
|
||||
intel_de_wait_for_set(struct intel_display *display, i915_reg_t reg,
|
||||
u32 mask, unsigned int timeout)
|
||||
{
|
||||
return intel_de_wait(display, reg, mask, mask, timeout);
|
||||
}
|
||||
#define intel_de_wait_for_set(p,...) __intel_de_wait_for_set(__to_intel_display(p), __VA_ARGS__)
|
||||
|
||||
static inline int
|
||||
__intel_de_wait_for_clear(struct intel_display *display, i915_reg_t reg,
|
||||
u32 mask, unsigned int timeout)
|
||||
intel_de_wait_for_clear(struct intel_display *display, i915_reg_t reg,
|
||||
u32 mask, unsigned int timeout)
|
||||
{
|
||||
return intel_de_wait(display, reg, mask, 0, timeout);
|
||||
}
|
||||
#define intel_de_wait_for_clear(p,...) __intel_de_wait_for_clear(__to_intel_display(p), __VA_ARGS__)
|
||||
|
||||
/*
|
||||
* Unlocked mmio-accessors, think carefully before using these.
|
||||
@@ -205,7 +203,7 @@ __intel_de_wait_for_clear(struct intel_display *display, i915_reg_t reg,
|
||||
* a more localised lock guarding all access to that bank of registers.
|
||||
*/
|
||||
static inline u32
|
||||
__intel_de_read_fw(struct intel_display *display, i915_reg_t reg)
|
||||
intel_de_read_fw(struct intel_display *display, i915_reg_t reg)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
@@ -214,15 +212,13 @@ __intel_de_read_fw(struct intel_display *display, i915_reg_t reg)
|
||||
|
||||
return val;
|
||||
}
|
||||
#define intel_de_read_fw(p,...) __intel_de_read_fw(__to_intel_display(p), __VA_ARGS__)
|
||||
|
||||
static inline void
|
||||
__intel_de_write_fw(struct intel_display *display, i915_reg_t reg, u32 val)
|
||||
intel_de_write_fw(struct intel_display *display, i915_reg_t reg, u32 val)
|
||||
{
|
||||
trace_i915_reg_rw(true, reg, val, sizeof(val), true);
|
||||
intel_uncore_write_fw(__to_uncore(display), reg, val);
|
||||
}
|
||||
#define intel_de_write_fw(p,...) __intel_de_write_fw(__to_intel_display(p), __VA_ARGS__)
|
||||
|
||||
static inline u32
|
||||
intel_de_read_notrace(struct intel_display *display, i915_reg_t reg)
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_driver.h"
|
||||
#include "intel_display_power.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dmc.h"
|
||||
#include "intel_dp.h"
|
||||
@@ -663,7 +664,6 @@ void intel_plane_disable_noatomic(struct intel_crtc *crtc,
|
||||
struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
to_intel_crtc_state(crtc->base.state);
|
||||
struct intel_plane_state *plane_state =
|
||||
@@ -696,7 +696,7 @@ void intel_plane_disable_noatomic(struct intel_crtc *crtc,
|
||||
* wait-for-vblank between disabling the plane and the pipe.
|
||||
*/
|
||||
if (HAS_GMCH(display) &&
|
||||
intel_set_memory_cxsr(dev_priv, false))
|
||||
intel_set_memory_cxsr(display, false))
|
||||
intel_plane_initial_vblank_wait(crtc);
|
||||
|
||||
/*
|
||||
@@ -1050,12 +1050,10 @@ static void intel_post_plane_update(struct intel_atomic_state *state,
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
intel_psr_post_plane_update(state, crtc);
|
||||
|
||||
intel_frontbuffer_flip(dev_priv, new_crtc_state->fb_bits);
|
||||
|
||||
if (new_crtc_state->update_wm_post && new_crtc_state->hw.active)
|
||||
intel_update_watermarks(dev_priv);
|
||||
intel_update_watermarks(display);
|
||||
|
||||
intel_fbc_post_update(state, crtc);
|
||||
|
||||
@@ -1080,6 +1078,8 @@ static void intel_post_plane_update(struct intel_atomic_state *state,
|
||||
|
||||
if (audio_enabling(old_crtc_state, new_crtc_state))
|
||||
intel_encoders_audio_enable(state, crtc);
|
||||
|
||||
intel_psr_post_plane_update(state, crtc);
|
||||
}
|
||||
|
||||
static void intel_post_plane_update_after_readout(struct intel_atomic_state *state,
|
||||
@@ -1168,13 +1168,14 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct drm_i915_private *dev_priv = 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 =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
intel_psr_pre_plane_update(state, crtc);
|
||||
|
||||
if (intel_crtc_vrr_disabling(state, crtc)) {
|
||||
intel_vrr_disable(old_crtc_state);
|
||||
intel_crtc_update_active_timings(old_crtc_state, false);
|
||||
@@ -1185,8 +1186,6 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
|
||||
|
||||
intel_drrs_deactivate(old_crtc_state);
|
||||
|
||||
intel_psr_pre_plane_update(state, crtc);
|
||||
|
||||
if (hsw_ips_pre_update(state, crtc))
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
@@ -1222,7 +1221,7 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
|
||||
* wait-for-vblank between disabling the plane and the pipe.
|
||||
*/
|
||||
if (HAS_GMCH(display) && old_crtc_state->hw.active &&
|
||||
new_crtc_state->disable_cxsr && intel_set_memory_cxsr(dev_priv, false))
|
||||
new_crtc_state->disable_cxsr && intel_set_memory_cxsr(display, false))
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
/*
|
||||
@@ -1233,7 +1232,7 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
|
||||
* WaCxSRDisabledForSpriteScaling:ivb
|
||||
*/
|
||||
if (!HAS_GMCH(display) && old_crtc_state->hw.active &&
|
||||
new_crtc_state->disable_cxsr && ilk_disable_cxsr(dev_priv))
|
||||
new_crtc_state->disable_cxsr && ilk_disable_cxsr(display))
|
||||
intel_crtc_wait_for_next_vblank(crtc);
|
||||
|
||||
/*
|
||||
@@ -1257,7 +1256,7 @@ static void intel_pre_plane_update(struct intel_atomic_state *state,
|
||||
*/
|
||||
if (!intel_initial_watermarks(state, crtc))
|
||||
if (new_crtc_state->update_wm_pre)
|
||||
intel_update_watermarks(dev_priv);
|
||||
intel_update_watermarks(display);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1662,13 +1661,8 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,
|
||||
|
||||
intel_encoders_pre_pll_enable(state, crtc);
|
||||
|
||||
for_each_pipe_crtc_modeset_enable(display, pipe_crtc, new_crtc_state, i) {
|
||||
const struct intel_crtc_state *pipe_crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, pipe_crtc);
|
||||
|
||||
if (pipe_crtc_state->shared_dpll)
|
||||
intel_enable_shared_dpll(pipe_crtc_state);
|
||||
}
|
||||
if (new_crtc_state->shared_dpll)
|
||||
intel_enable_shared_dpll(new_crtc_state);
|
||||
|
||||
intel_encoders_pre_enable(state, crtc);
|
||||
|
||||
@@ -1779,8 +1773,6 @@ static void ilk_crtc_disable(struct intel_atomic_state *state,
|
||||
|
||||
intel_set_cpu_fifo_underrun_reporting(display, pipe, true);
|
||||
intel_set_pch_fifo_underrun_reporting(display, pipe, true);
|
||||
|
||||
intel_disable_shared_dpll(old_crtc_state);
|
||||
}
|
||||
|
||||
static void hsw_crtc_disable(struct intel_atomic_state *state,
|
||||
@@ -1799,12 +1791,7 @@ static void hsw_crtc_disable(struct intel_atomic_state *state,
|
||||
intel_encoders_disable(state, crtc);
|
||||
intel_encoders_post_disable(state, crtc);
|
||||
|
||||
for_each_pipe_crtc_modeset_disable(display, pipe_crtc, old_crtc_state, i) {
|
||||
const struct intel_crtc_state *old_pipe_crtc_state =
|
||||
intel_atomic_get_old_crtc_state(state, pipe_crtc);
|
||||
|
||||
intel_disable_shared_dpll(old_pipe_crtc_state);
|
||||
}
|
||||
intel_disable_shared_dpll(old_crtc_state);
|
||||
|
||||
intel_encoders_post_pll_disable(state, crtc);
|
||||
|
||||
@@ -2083,7 +2070,6 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
const struct intel_crtc_state *new_crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
if (drm_WARN_ON(display->drm, crtc->active))
|
||||
@@ -2107,7 +2093,7 @@ static void i9xx_crtc_enable(struct intel_atomic_state *state,
|
||||
intel_color_modeset(new_crtc_state);
|
||||
|
||||
if (!intel_initial_watermarks(state, crtc))
|
||||
intel_update_watermarks(dev_priv);
|
||||
intel_update_watermarks(display);
|
||||
intel_enable_transcoder(new_crtc_state);
|
||||
|
||||
intel_crtc_vblank_on(new_crtc_state);
|
||||
@@ -2123,7 +2109,6 @@ static void i9xx_crtc_disable(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct intel_crtc_state *old_crtc_state =
|
||||
intel_atomic_get_old_crtc_state(state, crtc);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
@@ -2147,9 +2132,9 @@ static void i9xx_crtc_disable(struct intel_atomic_state *state,
|
||||
|
||||
if (!intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DSI)) {
|
||||
if (display->platform.cherryview)
|
||||
chv_disable_pll(dev_priv, pipe);
|
||||
chv_disable_pll(display, pipe);
|
||||
else if (display->platform.valleyview)
|
||||
vlv_disable_pll(dev_priv, pipe);
|
||||
vlv_disable_pll(display, pipe);
|
||||
else
|
||||
i9xx_disable_pll(old_crtc_state);
|
||||
}
|
||||
@@ -2160,7 +2145,7 @@ static void i9xx_crtc_disable(struct intel_atomic_state *state,
|
||||
intel_set_cpu_fifo_underrun_reporting(display, pipe, false);
|
||||
|
||||
if (!display->funcs.wm->initial_watermarks)
|
||||
intel_update_watermarks(dev_priv);
|
||||
intel_update_watermarks(display);
|
||||
|
||||
/* clock the pipe down to 640x480@60 to potentially save power */
|
||||
if (display->platform.i830)
|
||||
@@ -2343,7 +2328,6 @@ static int intel_crtc_compute_pipe_src(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
|
||||
|
||||
intel_joiner_compute_pipe_src(crtc_state);
|
||||
|
||||
@@ -2362,7 +2346,7 @@ static int intel_crtc_compute_pipe_src(struct intel_crtc_state *crtc_state)
|
||||
}
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS) &&
|
||||
intel_is_dual_link_lvds(i915)) {
|
||||
intel_is_dual_link_lvds(display)) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"[CRTC:%d:%s] Odd pipe source width not supported with dual link LVDS\n",
|
||||
crtc->base.base.id, crtc->base.name);
|
||||
@@ -2639,6 +2623,15 @@ void intel_cpu_transcoder_set_m2_n2(struct intel_crtc *crtc,
|
||||
PIPE_LINK_N2(display, transcoder));
|
||||
}
|
||||
|
||||
static bool
|
||||
transcoder_has_vrr(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
|
||||
|
||||
return HAS_VRR(display) && !transcoder_is_dsi(cpu_transcoder);
|
||||
}
|
||||
|
||||
static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
@@ -2703,6 +2696,15 @@ static void intel_set_transcoder_timings(const struct intel_crtc_state *crtc_sta
|
||||
HSYNC_START(adjusted_mode->crtc_hsync_start - 1) |
|
||||
HSYNC_END(adjusted_mode->crtc_hsync_end - 1));
|
||||
|
||||
/*
|
||||
* For platforms that always use VRR Timing Generator, the VTOTAL.Vtotal
|
||||
* bits are not required. Since the support for these bits is going to
|
||||
* be deprecated in upcoming platforms, avoid writing these bits for the
|
||||
* platforms that do not use legacy Timing Generator.
|
||||
*/
|
||||
if (intel_vrr_always_use_vrr_tg(display))
|
||||
crtc_vtotal = 1;
|
||||
|
||||
intel_de_write(display, TRANS_VTOTAL(display, cpu_transcoder),
|
||||
VACTIVE(crtc_vdisplay - 1) |
|
||||
VTOTAL(crtc_vtotal - 1));
|
||||
@@ -2763,6 +2765,15 @@ static void intel_set_transcoder_timings_lrr(const struct intel_crtc_state *crtc
|
||||
intel_de_write(display, TRANS_VBLANK(display, cpu_transcoder),
|
||||
VBLANK_START(crtc_vblank_start - 1) |
|
||||
VBLANK_END(crtc_vblank_end - 1));
|
||||
/*
|
||||
* For platforms that always use VRR Timing Generator, the VTOTAL.Vtotal
|
||||
* bits are not required. Since the support for these bits is going to
|
||||
* be deprecated in upcoming platforms, avoid writing these bits for the
|
||||
* platforms that do not use legacy Timing Generator.
|
||||
*/
|
||||
if (intel_vrr_always_use_vrr_tg(display))
|
||||
crtc_vtotal = 1;
|
||||
|
||||
/*
|
||||
* The double buffer latch point for TRANS_VTOTAL
|
||||
* is the transcoder's undelayed vblank.
|
||||
@@ -2770,6 +2781,9 @@ static void intel_set_transcoder_timings_lrr(const struct intel_crtc_state *crtc
|
||||
intel_de_write(display, TRANS_VTOTAL(display, cpu_transcoder),
|
||||
VACTIVE(crtc_vdisplay - 1) |
|
||||
VTOTAL(crtc_vtotal - 1));
|
||||
|
||||
intel_vrr_set_fixed_rr_timings(crtc_state);
|
||||
intel_vrr_transcoder_enable(crtc_state);
|
||||
}
|
||||
|
||||
static void intel_set_pipe_src_size(const struct intel_crtc_state *crtc_state)
|
||||
@@ -3835,7 +3849,6 @@ static bool bxt_get_dsi_transcoder_state(struct intel_crtc *crtc,
|
||||
struct intel_display_power_domain_set *power_domain_set)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
enum transcoder cpu_transcoder;
|
||||
enum port port;
|
||||
u32 tmp;
|
||||
@@ -3857,7 +3870,7 @@ static bool bxt_get_dsi_transcoder_state(struct intel_crtc *crtc,
|
||||
* registers/MIPI[BXT]. We can break out here early, since we
|
||||
* need the same DSI PLL to be enabled for both DSI ports.
|
||||
*/
|
||||
if (!bxt_dsi_pll_is_enabled(dev_priv))
|
||||
if (!bxt_dsi_pll_is_enabled(display))
|
||||
break;
|
||||
|
||||
/* XXX: this works for video mode only */
|
||||
@@ -3920,7 +3933,7 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,
|
||||
DISPLAY_VER(display) >= 11)
|
||||
intel_get_transcoder_timings(crtc, pipe_config);
|
||||
|
||||
if (HAS_VRR(display) && !transcoder_is_dsi(pipe_config->cpu_transcoder))
|
||||
if (transcoder_has_vrr(pipe_config))
|
||||
intel_vrr_get_config(pipe_config);
|
||||
|
||||
intel_get_pipe_src_size(crtc, pipe_config);
|
||||
@@ -4147,8 +4160,6 @@ static u16 hsw_ips_linetime_wm(const struct intel_crtc_state *crtc_state,
|
||||
static u16 skl_linetime_wm(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct drm_display_mode *pipe_mode =
|
||||
&crtc_state->hw.pipe_mode;
|
||||
int linetime_wm;
|
||||
@@ -4161,7 +4172,7 @@ static u16 skl_linetime_wm(const struct intel_crtc_state *crtc_state)
|
||||
|
||||
/* Display WA #1135: BXT:ALL GLK:ALL */
|
||||
if ((display->platform.geminilake || display->platform.broxton) &&
|
||||
skl_watermark_ipc_enabled(dev_priv))
|
||||
skl_watermark_ipc_enabled(display))
|
||||
linetime_wm /= 2;
|
||||
|
||||
return min(linetime_wm, 0x1ff);
|
||||
@@ -5387,8 +5398,6 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
|
||||
PIPE_CONF_CHECK_I(vrr.vmin);
|
||||
PIPE_CONF_CHECK_I(vrr.vmax);
|
||||
PIPE_CONF_CHECK_I(vrr.flipline);
|
||||
PIPE_CONF_CHECK_I(vrr.pipeline_full);
|
||||
PIPE_CONF_CHECK_I(vrr.guardband);
|
||||
PIPE_CONF_CHECK_I(vrr.vsync_start);
|
||||
PIPE_CONF_CHECK_I(vrr.vsync_end);
|
||||
PIPE_CONF_CHECK_LLI(cmrr.cmrr_m);
|
||||
@@ -5396,6 +5405,11 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
|
||||
PIPE_CONF_CHECK_BOOL(cmrr.enable);
|
||||
}
|
||||
|
||||
if (!fastset || intel_vrr_always_use_vrr_tg(display)) {
|
||||
PIPE_CONF_CHECK_I(vrr.pipeline_full);
|
||||
PIPE_CONF_CHECK_I(vrr.guardband);
|
||||
}
|
||||
|
||||
#undef PIPE_CONF_CHECK_X
|
||||
#undef PIPE_CONF_CHECK_I
|
||||
#undef PIPE_CONF_CHECK_LLI
|
||||
@@ -6429,7 +6443,7 @@ int intel_atomic_check(struct drm_device *dev,
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
ret = intel_bw_atomic_check(state);
|
||||
ret = intel_bw_atomic_check(state, any_ms);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
@@ -7231,7 +7245,7 @@ static void intel_atomic_dsb_finish(struct intel_atomic_state *state,
|
||||
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 drm_i915_private __maybe_unused *dev_priv = to_i915(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] = {};
|
||||
@@ -7445,7 +7459,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
|
||||
* toggling overhead at and above 60 FPS.
|
||||
*/
|
||||
intel_display_power_put_async_delay(display, POWER_DOMAIN_DC_OFF, wakeref, 17);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, state->wakeref);
|
||||
intel_display_rpm_put(display, state->wakeref);
|
||||
|
||||
/*
|
||||
* Defer the cleanup of the old state to a separate worker to not
|
||||
@@ -7517,10 +7531,9 @@ int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
|
||||
{
|
||||
struct intel_display *display = to_intel_display(dev);
|
||||
struct intel_atomic_state *state = to_intel_atomic_state(_state);
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
int ret = 0;
|
||||
|
||||
state->wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
state->wakeref = intel_display_rpm_get(display);
|
||||
|
||||
/*
|
||||
* The intel_legacy_cursor_update() fast path takes care
|
||||
@@ -7554,7 +7567,7 @@ int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
|
||||
if (ret) {
|
||||
drm_dbg_atomic(display->drm,
|
||||
"Preparing state failed with %i\n", ret);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, state->wakeref);
|
||||
intel_display_rpm_put(display, state->wakeref);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -7564,7 +7577,7 @@ int intel_atomic_commit(struct drm_device *dev, struct drm_atomic_state *_state,
|
||||
|
||||
if (ret) {
|
||||
drm_atomic_helper_unprepare_planes(dev, &state->base);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, state->wakeref);
|
||||
intel_display_rpm_put(display, state->wakeref);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -7672,7 +7685,7 @@ void intel_setup_outputs(struct intel_display *display)
|
||||
intel_bios_for_each_encoder(display, intel_ddi_init);
|
||||
|
||||
if (display->platform.geminilake || display->platform.broxton)
|
||||
vlv_dsi_init(dev_priv);
|
||||
vlv_dsi_init(display);
|
||||
} else if (HAS_PCH_SPLIT(dev_priv)) {
|
||||
int found;
|
||||
|
||||
@@ -7681,7 +7694,7 @@ void intel_setup_outputs(struct intel_display *display)
|
||||
* to prevent the registration of both eDP and LVDS and the
|
||||
* incorrect sharing of the PPS.
|
||||
*/
|
||||
intel_lvds_init(dev_priv);
|
||||
intel_lvds_init(display);
|
||||
intel_crt_init(display);
|
||||
|
||||
dpd_is_edp = intel_dp_is_port_edp(display, PORT_D);
|
||||
@@ -7756,15 +7769,15 @@ void intel_setup_outputs(struct intel_display *display)
|
||||
g4x_hdmi_init(display, CHV_HDMID, PORT_D);
|
||||
}
|
||||
|
||||
vlv_dsi_init(dev_priv);
|
||||
vlv_dsi_init(display);
|
||||
} else if (display->platform.pineview) {
|
||||
intel_lvds_init(dev_priv);
|
||||
intel_lvds_init(display);
|
||||
intel_crt_init(display);
|
||||
} else if (IS_DISPLAY_VER(display, 3, 4)) {
|
||||
bool found = false;
|
||||
|
||||
if (display->platform.mobile)
|
||||
intel_lvds_init(dev_priv);
|
||||
intel_lvds_init(display);
|
||||
|
||||
intel_crt_init(display);
|
||||
|
||||
@@ -7806,10 +7819,10 @@ void intel_setup_outputs(struct intel_display *display)
|
||||
intel_tv_init(display);
|
||||
} else if (DISPLAY_VER(display) == 2) {
|
||||
if (display->platform.i85x)
|
||||
intel_lvds_init(dev_priv);
|
||||
intel_lvds_init(display);
|
||||
|
||||
intel_crt_init(display);
|
||||
intel_dvo_init(dev_priv);
|
||||
intel_dvo_init(display);
|
||||
}
|
||||
|
||||
for_each_intel_encoder(display->drm, encoder) {
|
||||
@@ -7819,7 +7832,7 @@ void intel_setup_outputs(struct intel_display *display)
|
||||
intel_encoder_possible_clones(encoder);
|
||||
}
|
||||
|
||||
intel_init_pch_refclk(dev_priv);
|
||||
intel_init_pch_refclk(display);
|
||||
|
||||
drm_helper_move_panel_connectors_to_head(display->drm);
|
||||
}
|
||||
@@ -8083,6 +8096,9 @@ retry:
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!crtc_state->hw.active)
|
||||
crtc_state->inherited = false;
|
||||
|
||||
if (crtc_state->hw.active) {
|
||||
struct intel_encoder *encoder;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ struct intel_display_funcs {
|
||||
/* functions used for watermark calcs for display. */
|
||||
struct intel_wm_funcs {
|
||||
/* update_wm is for legacy wm management */
|
||||
void (*update_wm)(struct drm_i915_private *dev_priv);
|
||||
void (*update_wm)(struct intel_display *display);
|
||||
int (*compute_watermarks)(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc);
|
||||
void (*initial_watermarks)(struct intel_atomic_state *state,
|
||||
@@ -90,8 +90,8 @@ struct intel_wm_funcs {
|
||||
void (*optimize_watermarks)(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc);
|
||||
int (*compute_global_watermarks)(struct intel_atomic_state *state);
|
||||
void (*get_hw_state)(struct drm_i915_private *i915);
|
||||
void (*sanitize)(struct drm_i915_private *i915);
|
||||
void (*get_hw_state)(struct intel_display *display);
|
||||
void (*sanitize)(struct intel_display *display);
|
||||
};
|
||||
|
||||
struct intel_audio_state {
|
||||
@@ -160,6 +160,7 @@ struct intel_hotplug {
|
||||
struct {
|
||||
unsigned long last_jiffies;
|
||||
int count;
|
||||
int blocked_count;
|
||||
enum {
|
||||
HPD_ENABLED = 0,
|
||||
HPD_DISABLED = 1,
|
||||
@@ -170,8 +171,8 @@ struct intel_hotplug {
|
||||
u32 retry_bits;
|
||||
struct delayed_work reenable_work;
|
||||
|
||||
u32 long_port_mask;
|
||||
u32 short_port_mask;
|
||||
u32 long_hpd_pin_mask;
|
||||
u32 short_hpd_pin_mask;
|
||||
struct work_struct dig_port_work;
|
||||
|
||||
struct work_struct poll_init_work;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "intel_display_debugfs_params.h"
|
||||
#include "intel_display_power.h"
|
||||
#include "intel_display_power_well.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dmc.h"
|
||||
#include "intel_dp.h"
|
||||
@@ -52,8 +53,11 @@ static struct intel_display *node_to_intel_display(struct drm_info_node *node)
|
||||
static int intel_display_caps(struct seq_file *m, void *data)
|
||||
{
|
||||
struct intel_display *display = node_to_intel_display(m->private);
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct drm_printer p = drm_seq_file_printer(m);
|
||||
|
||||
drm_printf(&p, "PCH type: %d\n", INTEL_PCH_TYPE(i915));
|
||||
|
||||
intel_display_device_info_print(DISPLAY_INFO(display),
|
||||
DISPLAY_RUNTIME_INFO(display), &p);
|
||||
intel_display_params_dump(&display->params, display->drm->driver->name, &p);
|
||||
@@ -580,13 +584,12 @@ static void intel_crtc_info(struct seq_file *m, struct intel_crtc *crtc)
|
||||
static int i915_display_info(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct intel_display *display = node_to_intel_display(m->private);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct intel_crtc *crtc;
|
||||
struct drm_connector *connector;
|
||||
struct drm_connector_list_iter conn_iter;
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
|
||||
drm_modeset_lock_all(display->drm);
|
||||
|
||||
@@ -605,18 +608,7 @@ static int i915_display_info(struct seq_file *m, void *unused)
|
||||
|
||||
drm_modeset_unlock_all(display->drm);
|
||||
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int i915_display_capabilities(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct intel_display *display = node_to_intel_display(m->private);
|
||||
struct drm_printer p = drm_seq_file_printer(m);
|
||||
|
||||
intel_display_device_info_print(DISPLAY_INFO(display),
|
||||
DISPLAY_RUNTIME_INFO(display), &p);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -690,14 +682,11 @@ static bool
|
||||
intel_lpsp_power_well_enabled(struct intel_display *display,
|
||||
enum i915_power_well_id power_well_id)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
intel_wakeref_t wakeref;
|
||||
bool is_enabled;
|
||||
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
is_enabled = intel_display_power_well_is_enabled(display,
|
||||
power_well_id);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
with_intel_display_rpm(display)
|
||||
is_enabled = intel_display_power_well_is_enabled(display,
|
||||
power_well_id);
|
||||
|
||||
return is_enabled;
|
||||
}
|
||||
@@ -820,7 +809,6 @@ static const struct drm_info_list intel_display_debugfs_list[] = {
|
||||
{"i915_gem_framebuffer", i915_gem_framebuffer_info, 0},
|
||||
{"i915_power_domain_info", i915_power_domain_info, 0},
|
||||
{"i915_display_info", i915_display_info, 0},
|
||||
{"i915_display_capabilities", i915_display_capabilities, 0},
|
||||
{"i915_shared_dplls_info", i915_shared_dplls_info, 0},
|
||||
{"i915_dp_mst_info", i915_dp_mst_info, 0},
|
||||
{"i915_ddb_info", i915_ddb_info, 0},
|
||||
@@ -829,7 +817,6 @@ static const struct drm_info_list intel_display_debugfs_list[] = {
|
||||
|
||||
void intel_display_debugfs_register(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct drm_minor *minor = display->drm->primary;
|
||||
|
||||
debugfs_create_file("i915_fifo_underrun_reset", 0644, minor->debugfs_root,
|
||||
@@ -844,10 +831,10 @@ void intel_display_debugfs_register(struct intel_display *display)
|
||||
intel_dmc_debugfs_register(display);
|
||||
intel_dp_test_debugfs_register(display);
|
||||
intel_fbc_debugfs_register(display);
|
||||
intel_hpd_debugfs_register(i915);
|
||||
intel_hpd_debugfs_register(display);
|
||||
intel_opregion_debugfs_register(display);
|
||||
intel_psr_debugfs_register(display);
|
||||
intel_wm_debugfs_register(i915);
|
||||
intel_wm_debugfs_register(display);
|
||||
intel_display_debugfs_params(display);
|
||||
}
|
||||
|
||||
|
||||
@@ -143,9 +143,11 @@ struct intel_display_platforms {
|
||||
|
||||
#define HAS_4TILE(__display) ((__display)->platform.dg2 || DISPLAY_VER(__display) >= 14)
|
||||
#define HAS_ASYNC_FLIPS(__display) (DISPLAY_VER(__display) >= 5)
|
||||
#define HAS_AS_SDP(__display) (DISPLAY_VER(__display) >= 13)
|
||||
#define HAS_BIGJOINER(__display) (DISPLAY_VER(__display) >= 11 && HAS_DSC(__display))
|
||||
#define HAS_CDCLK_CRAWL(__display) (DISPLAY_INFO(__display)->has_cdclk_crawl)
|
||||
#define HAS_CDCLK_SQUASH(__display) (DISPLAY_INFO(__display)->has_cdclk_squash)
|
||||
#define HAS_CMRR(__display) (DISPLAY_VER(__display) >= 20)
|
||||
#define HAS_CMTG(__display) (!(__display)->platform.dg2 && DISPLAY_VER(__display) >= 13)
|
||||
#define HAS_CUR_FBC(__display) (!HAS_GMCH(__display) && IS_DISPLAY_VER(__display, 7, 13))
|
||||
#define HAS_D12_PLANE_MINIMIZATION(__display) ((__display)->platform.rocketlake || (__display)->platform.alderlake_s)
|
||||
@@ -156,9 +158,9 @@ struct intel_display_platforms {
|
||||
#define HAS_DMC_WAKELOCK(__display) (DISPLAY_VER(__display) >= 20)
|
||||
#define HAS_DOUBLE_BUFFERED_M_N(__display) (DISPLAY_VER(__display) >= 9 || (__display)->platform.broadwell)
|
||||
#define HAS_DOUBLE_WIDE(__display) (DISPLAY_VER(__display) < 4)
|
||||
#define HAS_DP_MST(__display) (DISPLAY_INFO(__display)->has_dp_mst)
|
||||
#define HAS_DP20(__display) ((__display)->platform.dg2 || DISPLAY_VER(__display) >= 14)
|
||||
#define HAS_DPT(__display) (DISPLAY_VER(__display) >= 13)
|
||||
#define HAS_DP_MST(__display) (DISPLAY_INFO(__display)->has_dp_mst)
|
||||
#define HAS_DSB(__display) (DISPLAY_INFO(__display)->has_dsb)
|
||||
#define HAS_DSC(__display) (DISPLAY_RUNTIME_INFO(__display)->has_dsc)
|
||||
#define HAS_DSC_MST(__display) (DISPLAY_VER(__display) >= 12 && HAS_DSC(__display))
|
||||
@@ -166,9 +168,10 @@ struct intel_display_platforms {
|
||||
#define HAS_FBC_DIRTY_RECT(__display) (DISPLAY_VER(__display) >= 30)
|
||||
#define HAS_FPGA_DBG_UNCLAIMED(__display) (DISPLAY_INFO(__display)->has_fpga_dbg)
|
||||
#define HAS_FW_BLC(__display) (DISPLAY_VER(__display) >= 3)
|
||||
#define HAS_GMBUS_IRQ(__display) (DISPLAY_VER(__display) >= 4)
|
||||
#define HAS_GMBUS_BURST_READ(__display) (DISPLAY_VER(__display) >= 10 || (__display)->platform.kabylake)
|
||||
#define HAS_GMBUS_IRQ(__display) (DISPLAY_VER(__display) >= 4)
|
||||
#define HAS_GMCH(__display) (DISPLAY_INFO(__display)->has_gmch)
|
||||
#define HAS_HOTPLUG(__display) (DISPLAY_INFO(__display)->has_hotplug)
|
||||
#define HAS_HW_SAGV_WM(__display) (DISPLAY_VER(__display) >= 13 && !(__display)->platform.dgfx)
|
||||
#define HAS_IPC(__display) (DISPLAY_INFO(__display)->has_ipc)
|
||||
#define HAS_IPS(__display) ((__display)->platform.haswell_ult || (__display)->platform.broadwell)
|
||||
@@ -189,10 +192,7 @@ struct intel_display_platforms {
|
||||
((__display)->platform.dgfx && DISPLAY_VER(__display) == 14)) && \
|
||||
HAS_DSC(__display))
|
||||
#define HAS_VRR(__display) (DISPLAY_VER(__display) >= 11)
|
||||
#define HAS_AS_SDP(__display) (DISPLAY_VER(__display) >= 13)
|
||||
#define HAS_CMRR(__display) (DISPLAY_VER(__display) >= 20)
|
||||
#define INTEL_NUM_PIPES(__display) (hweight8(DISPLAY_RUNTIME_INFO(__display)->pipe_mask))
|
||||
#define I915_HAS_HOTPLUG(__display) (DISPLAY_INFO(__display)->has_hotplug)
|
||||
#define OVERLAY_NEEDS_PHYSICAL(__display) (DISPLAY_INFO(__display)->overlay_needs_physical)
|
||||
#define SUPPORTS_TV(__display) (DISPLAY_INFO(__display)->supports_tv)
|
||||
|
||||
|
||||
@@ -82,7 +82,6 @@ bool intel_display_driver_probe_defer(struct pci_dev *pdev)
|
||||
|
||||
void intel_display_driver_init_hw(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct intel_cdclk_state *cdclk_state;
|
||||
|
||||
if (!HAS_DISPLAY(display))
|
||||
@@ -94,7 +93,7 @@ void intel_display_driver_init_hw(struct intel_display *display)
|
||||
intel_cdclk_dump_config(display, &display->cdclk.hw, "Current CDCLK");
|
||||
cdclk_state->logical = cdclk_state->actual = display->cdclk.hw;
|
||||
|
||||
intel_display_wa_apply(i915);
|
||||
intel_display_wa_apply(display);
|
||||
}
|
||||
|
||||
static const struct drm_mode_config_funcs intel_mode_funcs = {
|
||||
@@ -181,8 +180,6 @@ static void intel_plane_possible_crtcs_init(struct intel_display *display)
|
||||
|
||||
void intel_display_driver_early_probe(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
if (!HAS_DISPLAY(display))
|
||||
return;
|
||||
|
||||
@@ -193,12 +190,12 @@ void intel_display_driver_early_probe(struct intel_display *display)
|
||||
mutex_init(&display->pps.mutex);
|
||||
mutex_init(&display->hdcp.hdcp_mutex);
|
||||
|
||||
intel_display_irq_init(i915);
|
||||
intel_display_irq_init(display);
|
||||
intel_dkl_phy_init(display);
|
||||
intel_color_init_hooks(display);
|
||||
intel_init_cdclk_hooks(display);
|
||||
intel_audio_hooks_init(display);
|
||||
intel_dpll_init_clock_hook(i915);
|
||||
intel_dpll_init_clock_hook(display);
|
||||
intel_init_display_hooks(display);
|
||||
intel_fdi_init_hook(display);
|
||||
intel_dmc_wl_init(display);
|
||||
@@ -255,11 +252,11 @@ int intel_display_driver_probe_noirq(struct intel_display *display)
|
||||
if (ret)
|
||||
goto cleanup_vga_client_pw_domain_dmc;
|
||||
|
||||
ret = intel_dbuf_init(i915);
|
||||
ret = intel_dbuf_init(display);
|
||||
if (ret)
|
||||
goto cleanup_vga_client_pw_domain_dmc;
|
||||
|
||||
ret = intel_bw_init(i915);
|
||||
ret = intel_bw_init(display);
|
||||
if (ret)
|
||||
goto cleanup_vga_client_pw_domain_dmc;
|
||||
|
||||
@@ -315,11 +312,9 @@ static void set_display_access(struct intel_display *display,
|
||||
*/
|
||||
void intel_display_driver_enable_user_access(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
set_display_access(display, true, NULL);
|
||||
|
||||
intel_hpd_enable_detection_work(i915);
|
||||
intel_hpd_enable_detection_work(display);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,9 +336,7 @@ void intel_display_driver_enable_user_access(struct intel_display *display)
|
||||
*/
|
||||
void intel_display_driver_disable_user_access(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
intel_hpd_disable_detection_work(i915);
|
||||
intel_hpd_disable_detection_work(display);
|
||||
|
||||
set_display_access(display, false, current);
|
||||
}
|
||||
@@ -429,7 +422,7 @@ int intel_display_driver_probe_nogem(struct intel_display *display)
|
||||
if (!HAS_DISPLAY(display))
|
||||
return 0;
|
||||
|
||||
intel_wm_init(i915);
|
||||
intel_wm_init(display);
|
||||
|
||||
intel_panel_sanitize_ssc(display);
|
||||
|
||||
@@ -483,7 +476,7 @@ int intel_display_driver_probe_nogem(struct intel_display *display)
|
||||
* since the watermark calculation done here will use pstate->fb.
|
||||
*/
|
||||
if (!HAS_GMCH(display))
|
||||
ilk_wm_sanitize(i915);
|
||||
ilk_wm_sanitize(display);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -498,7 +491,6 @@ err_mode_config:
|
||||
/* part #3: call after gem init */
|
||||
int intel_display_driver_probe(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
int ret;
|
||||
|
||||
if (!HAS_DISPLAY(display))
|
||||
@@ -524,9 +516,9 @@ int intel_display_driver_probe(struct intel_display *display)
|
||||
intel_overlay_setup(display);
|
||||
|
||||
/* Only enable hotplug handling once the fbdev is fully set up. */
|
||||
intel_hpd_init(i915);
|
||||
intel_hpd_init(display);
|
||||
|
||||
skl_watermark_ipc_init(i915);
|
||||
skl_watermark_ipc_init(display);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -558,7 +550,7 @@ void intel_display_driver_register(struct intel_display *display)
|
||||
* fbdev->async_cookie.
|
||||
*/
|
||||
drm_kms_helper_poll_init(display->drm);
|
||||
intel_hpd_poll_disable(i915);
|
||||
intel_hpd_poll_disable(display);
|
||||
|
||||
intel_fbdev_setup(i915);
|
||||
|
||||
@@ -600,7 +592,7 @@ void intel_display_driver_remove_noirq(struct intel_display *display)
|
||||
* Due to the hpd irq storm handling the hotplug work can re-arm the
|
||||
* poll handlers. Hence disable polling after hpd handling is shut down.
|
||||
*/
|
||||
intel_hpd_poll_fini(i915);
|
||||
intel_hpd_poll_fini(display);
|
||||
|
||||
intel_unregister_dsm_handler();
|
||||
|
||||
@@ -733,7 +725,6 @@ __intel_display_driver_resume(struct intel_display *display,
|
||||
|
||||
void intel_display_driver_resume(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct drm_atomic_state *state = display->restore.modeset_state;
|
||||
struct drm_modeset_acquire_ctx ctx;
|
||||
int ret;
|
||||
@@ -761,7 +752,7 @@ void intel_display_driver_resume(struct intel_display *display)
|
||||
if (!ret)
|
||||
ret = __intel_display_driver_resume(display, state, &ctx);
|
||||
|
||||
skl_watermark_ipc_update(i915);
|
||||
skl_watermark_ipc_update(display);
|
||||
drm_modeset_drop_locks(&ctx);
|
||||
drm_modeset_acquire_fini(&ctx);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,28 +12,27 @@
|
||||
|
||||
enum pipe;
|
||||
struct drm_crtc;
|
||||
struct drm_i915_private;
|
||||
struct intel_display;
|
||||
|
||||
void valleyview_enable_display_irqs(struct drm_i915_private *i915);
|
||||
void valleyview_disable_display_irqs(struct drm_i915_private *i915);
|
||||
void valleyview_enable_display_irqs(struct intel_display *display);
|
||||
void valleyview_disable_display_irqs(struct intel_display *display);
|
||||
|
||||
void ilk_update_display_irq(struct drm_i915_private *i915,
|
||||
void ilk_update_display_irq(struct intel_display *display,
|
||||
u32 interrupt_mask, u32 enabled_irq_mask);
|
||||
void ilk_enable_display_irq(struct drm_i915_private *i915, u32 bits);
|
||||
void ilk_disable_display_irq(struct drm_i915_private *i915, u32 bits);
|
||||
void ilk_enable_display_irq(struct intel_display *display, u32 bits);
|
||||
void ilk_disable_display_irq(struct intel_display *display, u32 bits);
|
||||
|
||||
void bdw_update_port_irq(struct drm_i915_private *i915, u32 interrupt_mask, u32 enabled_irq_mask);
|
||||
void bdw_enable_pipe_irq(struct drm_i915_private *i915, enum pipe pipe, u32 bits);
|
||||
void bdw_disable_pipe_irq(struct drm_i915_private *i915, enum pipe pipe, u32 bits);
|
||||
void bdw_update_port_irq(struct intel_display *display, u32 interrupt_mask, u32 enabled_irq_mask);
|
||||
void bdw_enable_pipe_irq(struct intel_display *display, enum pipe pipe, u32 bits);
|
||||
void bdw_disable_pipe_irq(struct intel_display *display, enum pipe pipe, u32 bits);
|
||||
|
||||
void ibx_display_interrupt_update(struct drm_i915_private *i915,
|
||||
void ibx_display_interrupt_update(struct intel_display *display,
|
||||
u32 interrupt_mask, u32 enabled_irq_mask);
|
||||
void ibx_enable_display_interrupt(struct drm_i915_private *i915, u32 bits);
|
||||
void ibx_disable_display_interrupt(struct drm_i915_private *i915, u32 bits);
|
||||
void ibx_enable_display_interrupt(struct intel_display *display, u32 bits);
|
||||
void ibx_disable_display_interrupt(struct intel_display *display, u32 bits);
|
||||
|
||||
void gen8_irq_power_well_post_enable(struct drm_i915_private *i915, u8 pipe_mask);
|
||||
void gen8_irq_power_well_pre_disable(struct drm_i915_private *i915, u8 pipe_mask);
|
||||
void gen8_irq_power_well_post_enable(struct intel_display *display, u8 pipe_mask);
|
||||
void gen8_irq_power_well_pre_disable(struct intel_display *display, u8 pipe_mask);
|
||||
|
||||
int i8xx_enable_vblank(struct drm_crtc *crtc);
|
||||
int i915gm_enable_vblank(struct drm_crtc *crtc);
|
||||
@@ -46,41 +45,41 @@ void i965_disable_vblank(struct drm_crtc *crtc);
|
||||
void ilk_disable_vblank(struct drm_crtc *crtc);
|
||||
void bdw_disable_vblank(struct drm_crtc *crtc);
|
||||
|
||||
void ivb_display_irq_handler(struct drm_i915_private *i915, u32 de_iir);
|
||||
void ilk_display_irq_handler(struct drm_i915_private *i915, u32 de_iir);
|
||||
void gen8_de_irq_handler(struct drm_i915_private *i915, u32 master_ctl);
|
||||
void gen11_display_irq_handler(struct drm_i915_private *i915);
|
||||
void ivb_display_irq_handler(struct intel_display *display, u32 de_iir);
|
||||
void ilk_display_irq_handler(struct intel_display *display, u32 de_iir);
|
||||
void gen8_de_irq_handler(struct intel_display *display, u32 master_ctl);
|
||||
void gen11_display_irq_handler(struct intel_display *display);
|
||||
|
||||
u32 gen11_gu_misc_irq_ack(struct drm_i915_private *i915, const u32 master_ctl);
|
||||
void gen11_gu_misc_irq_handler(struct drm_i915_private *i915, const u32 iir);
|
||||
u32 gen11_gu_misc_irq_ack(struct intel_display *display, const u32 master_ctl);
|
||||
void gen11_gu_misc_irq_handler(struct intel_display *display, const u32 iir);
|
||||
|
||||
void i9xx_display_irq_reset(struct drm_i915_private *i915);
|
||||
void vlv_display_irq_reset(struct drm_i915_private *i915);
|
||||
void gen8_display_irq_reset(struct drm_i915_private *i915);
|
||||
void gen11_display_irq_reset(struct drm_i915_private *i915);
|
||||
void i9xx_display_irq_reset(struct intel_display *display);
|
||||
void vlv_display_irq_reset(struct intel_display *display);
|
||||
void gen8_display_irq_reset(struct intel_display *display);
|
||||
void gen11_display_irq_reset(struct intel_display *display);
|
||||
|
||||
void vlv_display_irq_postinstall(struct drm_i915_private *i915);
|
||||
void ilk_de_irq_postinstall(struct drm_i915_private *i915);
|
||||
void gen8_de_irq_postinstall(struct drm_i915_private *i915);
|
||||
void gen11_de_irq_postinstall(struct drm_i915_private *i915);
|
||||
void dg1_de_irq_postinstall(struct drm_i915_private *i915);
|
||||
void vlv_display_irq_postinstall(struct intel_display *display);
|
||||
void ilk_de_irq_postinstall(struct intel_display *display);
|
||||
void gen8_de_irq_postinstall(struct intel_display *display);
|
||||
void gen11_de_irq_postinstall(struct intel_display *display);
|
||||
void dg1_de_irq_postinstall(struct intel_display *display);
|
||||
|
||||
u32 i915_pipestat_enable_mask(struct intel_display *display, enum pipe pipe);
|
||||
void i915_enable_pipestat(struct drm_i915_private *i915, enum pipe pipe, u32 status_mask);
|
||||
void i915_disable_pipestat(struct drm_i915_private *i915, enum pipe pipe, u32 status_mask);
|
||||
void i915_enable_asle_pipestat(struct drm_i915_private *i915);
|
||||
void i915_enable_pipestat(struct intel_display *display, enum pipe pipe, u32 status_mask);
|
||||
void i915_disable_pipestat(struct intel_display *display, enum pipe pipe, u32 status_mask);
|
||||
void i915_enable_asle_pipestat(struct intel_display *display);
|
||||
|
||||
void i9xx_pipestat_irq_ack(struct drm_i915_private *i915, u32 iir, u32 pipe_stats[I915_MAX_PIPES]);
|
||||
void i9xx_pipestat_irq_ack(struct intel_display *display, u32 iir, u32 pipe_stats[I915_MAX_PIPES]);
|
||||
|
||||
void i915_pipestat_irq_handler(struct drm_i915_private *i915, u32 iir, u32 pipe_stats[I915_MAX_PIPES]);
|
||||
void i965_pipestat_irq_handler(struct drm_i915_private *i915, u32 iir, u32 pipe_stats[I915_MAX_PIPES]);
|
||||
void valleyview_pipestat_irq_handler(struct drm_i915_private *i915, u32 pipe_stats[I915_MAX_PIPES]);
|
||||
void i915_pipestat_irq_handler(struct intel_display *display, u32 iir, u32 pipe_stats[I915_MAX_PIPES]);
|
||||
void i965_pipestat_irq_handler(struct intel_display *display, u32 iir, u32 pipe_stats[I915_MAX_PIPES]);
|
||||
void valleyview_pipestat_irq_handler(struct intel_display *display, u32 pipe_stats[I915_MAX_PIPES]);
|
||||
|
||||
void vlv_display_error_irq_ack(struct intel_display *display, u32 *eir, u32 *dpinvgtt);
|
||||
void vlv_display_error_irq_handler(struct intel_display *display, u32 eir, u32 dpinvgtt);
|
||||
|
||||
void intel_display_irq_init(struct drm_i915_private *i915);
|
||||
void intel_display_irq_init(struct intel_display *display);
|
||||
|
||||
void i915gm_irq_cstate_wa(struct drm_i915_private *i915, bool enable);
|
||||
void i915gm_irq_cstate_wa(struct intel_display *display, bool enable);
|
||||
|
||||
#endif /* __INTEL_DISPLAY_IRQ_H__ */
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "intel_display_power.h"
|
||||
#include "intel_display_power_map.h"
|
||||
#include "intel_display_power_well.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dmc.h"
|
||||
#include "intel_mchbar_regs.h"
|
||||
@@ -204,7 +205,7 @@ static bool __intel_display_power_is_enabled(struct intel_display *display,
|
||||
struct i915_power_well *power_well;
|
||||
bool is_enabled;
|
||||
|
||||
if (pm_runtime_suspended(display->drm->dev))
|
||||
if (intel_display_rpm_suspended(display))
|
||||
return false;
|
||||
|
||||
is_enabled = true;
|
||||
@@ -455,7 +456,6 @@ static bool
|
||||
intel_display_power_grab_async_put_ref(struct intel_display *display,
|
||||
enum intel_display_power_domain domain)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct i915_power_domains *power_domains = &display->power.domains;
|
||||
struct intel_power_domain_mask async_put_mask;
|
||||
bool ret = false;
|
||||
@@ -473,8 +473,8 @@ intel_display_power_grab_async_put_ref(struct intel_display *display,
|
||||
goto out_verify;
|
||||
|
||||
cancel_async_put_work(power_domains, false);
|
||||
intel_runtime_pm_put_raw(&dev_priv->runtime_pm,
|
||||
fetch_and_zero(&power_domains->async_put_wakeref));
|
||||
intel_display_rpm_put_raw(display,
|
||||
fetch_and_zero(&power_domains->async_put_wakeref));
|
||||
out_verify:
|
||||
verify_async_put_domains_state(power_domains);
|
||||
|
||||
@@ -512,9 +512,10 @@ __intel_display_power_get_domain(struct intel_display *display,
|
||||
intel_wakeref_t intel_display_power_get(struct intel_display *display,
|
||||
enum intel_display_power_domain domain)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct i915_power_domains *power_domains = &display->power.domains;
|
||||
intel_wakeref_t wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
struct ref_tracker *wakeref;
|
||||
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
|
||||
mutex_lock(&power_domains->lock);
|
||||
__intel_display_power_get_domain(display, domain);
|
||||
@@ -539,12 +540,11 @@ intel_wakeref_t
|
||||
intel_display_power_get_if_enabled(struct intel_display *display,
|
||||
enum intel_display_power_domain domain)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct i915_power_domains *power_domains = &display->power.domains;
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
bool is_enabled;
|
||||
|
||||
wakeref = intel_runtime_pm_get_if_in_use(&dev_priv->runtime_pm);
|
||||
wakeref = intel_display_rpm_get_if_in_use(display);
|
||||
if (!wakeref)
|
||||
return NULL;
|
||||
|
||||
@@ -560,7 +560,7 @@ intel_display_power_get_if_enabled(struct intel_display *display,
|
||||
mutex_unlock(&power_domains->lock);
|
||||
|
||||
if (!is_enabled) {
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
wakeref = NULL;
|
||||
}
|
||||
|
||||
@@ -623,12 +623,10 @@ release_async_put_domains(struct i915_power_domains *power_domains,
|
||||
struct intel_display *display = container_of(power_domains,
|
||||
struct intel_display,
|
||||
power.domains);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
|
||||
enum intel_display_power_domain domain;
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
|
||||
wakeref = intel_runtime_pm_get_noresume(rpm);
|
||||
wakeref = intel_display_rpm_get_noresume(display);
|
||||
|
||||
for_each_power_domain(domain, mask) {
|
||||
/* Clear before put, so put's sanity check is happy. */
|
||||
@@ -636,7 +634,7 @@ release_async_put_domains(struct i915_power_domains *power_domains,
|
||||
__intel_display_power_put_domain(display, domain);
|
||||
}
|
||||
|
||||
intel_runtime_pm_put(rpm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -644,11 +642,10 @@ intel_display_power_put_async_work(struct work_struct *work)
|
||||
{
|
||||
struct intel_display *display = container_of(work, struct intel_display,
|
||||
power.domains.async_put_work.work);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct i915_power_domains *power_domains = &display->power.domains;
|
||||
struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
|
||||
intel_wakeref_t new_work_wakeref = intel_runtime_pm_get_raw(rpm);
|
||||
intel_wakeref_t old_work_wakeref = NULL;
|
||||
struct ref_tracker *new_work_wakeref, *old_work_wakeref = NULL;
|
||||
|
||||
new_work_wakeref = intel_display_rpm_get_raw(display);
|
||||
|
||||
mutex_lock(&power_domains->lock);
|
||||
|
||||
@@ -688,9 +685,9 @@ out_verify:
|
||||
mutex_unlock(&power_domains->lock);
|
||||
|
||||
if (old_work_wakeref)
|
||||
intel_runtime_pm_put_raw(rpm, old_work_wakeref);
|
||||
intel_display_rpm_put_raw(display, old_work_wakeref);
|
||||
if (new_work_wakeref)
|
||||
intel_runtime_pm_put_raw(rpm, new_work_wakeref);
|
||||
intel_display_rpm_put_raw(display, new_work_wakeref);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -711,10 +708,10 @@ void __intel_display_power_put_async(struct intel_display *display,
|
||||
intel_wakeref_t wakeref,
|
||||
int delay_ms)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct i915_power_domains *power_domains = &display->power.domains;
|
||||
struct intel_runtime_pm *rpm = &i915->runtime_pm;
|
||||
intel_wakeref_t work_wakeref = intel_runtime_pm_get_raw(rpm);
|
||||
struct ref_tracker *work_wakeref;
|
||||
|
||||
work_wakeref = intel_display_rpm_get_raw(display);
|
||||
|
||||
delay_ms = delay_ms >= 0 ? delay_ms : 100;
|
||||
|
||||
@@ -746,9 +743,9 @@ out_verify:
|
||||
mutex_unlock(&power_domains->lock);
|
||||
|
||||
if (work_wakeref)
|
||||
intel_runtime_pm_put_raw(rpm, work_wakeref);
|
||||
intel_display_rpm_put_raw(display, work_wakeref);
|
||||
|
||||
intel_runtime_pm_put(rpm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -765,7 +762,6 @@ out_verify:
|
||||
*/
|
||||
void intel_display_power_flush_work(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct i915_power_domains *power_domains = &display->power.domains;
|
||||
struct intel_power_domain_mask async_put_mask;
|
||||
intel_wakeref_t work_wakeref;
|
||||
@@ -786,7 +782,7 @@ out_verify:
|
||||
mutex_unlock(&power_domains->lock);
|
||||
|
||||
if (work_wakeref)
|
||||
intel_runtime_pm_put_raw(&i915->runtime_pm, work_wakeref);
|
||||
intel_display_rpm_put_raw(display, work_wakeref);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -824,10 +820,8 @@ void intel_display_power_put(struct intel_display *display,
|
||||
enum intel_display_power_domain domain,
|
||||
intel_wakeref_t wakeref)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
__intel_display_power_put(display, domain);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
}
|
||||
#else
|
||||
/**
|
||||
@@ -846,10 +840,8 @@ void intel_display_power_put(struct intel_display *display,
|
||||
void intel_display_power_put_unchecked(struct intel_display *display,
|
||||
enum intel_display_power_domain domain)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
__intel_display_power_put(display, domain);
|
||||
intel_runtime_pm_put_unchecked(&dev_priv->runtime_pm);
|
||||
intel_display_rpm_put_unchecked(display);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1381,18 +1373,18 @@ static void hsw_enable_pc8(struct intel_display *display)
|
||||
intel_de_rmw(display, SOUTH_DSPCLK_GATE_D,
|
||||
PCH_LP_PARTITION_LEVEL_DISABLE, 0);
|
||||
|
||||
lpt_disable_clkout_dp(dev_priv);
|
||||
lpt_disable_clkout_dp(display);
|
||||
hsw_disable_lcpll(display, true, true);
|
||||
}
|
||||
|
||||
static void hsw_disable_pc8(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct drm_i915_private __maybe_unused *dev_priv = to_i915(display->drm);
|
||||
|
||||
drm_dbg_kms(display->drm, "Disabling package C8+\n");
|
||||
|
||||
hsw_restore_lcpll(display);
|
||||
intel_init_pch_refclk(dev_priv);
|
||||
intel_init_pch_refclk(display);
|
||||
|
||||
/* Many display registers don't survive PC8+ */
|
||||
#ifdef I915 /* FIXME */
|
||||
@@ -1979,7 +1971,6 @@ void intel_power_domains_init_hw(struct intel_display *display, bool resume)
|
||||
*/
|
||||
void intel_power_domains_driver_remove(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
intel_wakeref_t wakeref __maybe_unused =
|
||||
fetch_and_zero(&display->power.domains.init_wakeref);
|
||||
|
||||
@@ -1993,7 +1984,7 @@ void intel_power_domains_driver_remove(struct intel_display *display)
|
||||
intel_power_domains_verify_state(display);
|
||||
|
||||
/* Keep the power well enabled, but cancel its rpm wakeref. */
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1696,6 +1696,7 @@ I915_DECL_PW_DOMAINS(xe3lpd_pwdoms_dc_off,
|
||||
XE3LPD_PW_C_POWER_DOMAINS,
|
||||
XE3LPD_PW_D_POWER_DOMAINS,
|
||||
POWER_DOMAIN_AUDIO_MMIO,
|
||||
POWER_DOMAIN_AUDIO_PLAYBACK,
|
||||
POWER_DOMAIN_INIT);
|
||||
|
||||
static const struct i915_power_well_desc xe3lpd_power_wells_dcoff[] = {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_irq.h"
|
||||
#include "intel_display_power_well.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dkl_phy.h"
|
||||
#include "intel_dkl_phy_regs.h"
|
||||
@@ -186,22 +187,18 @@ int intel_power_well_refcount(struct i915_power_well *power_well)
|
||||
static void hsw_power_well_post_enable(struct intel_display *display,
|
||||
u8 irq_pipe_mask, bool has_vga)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
if (has_vga)
|
||||
intel_vga_reset_io_mem(display);
|
||||
|
||||
if (irq_pipe_mask)
|
||||
gen8_irq_power_well_post_enable(dev_priv, irq_pipe_mask);
|
||||
gen8_irq_power_well_post_enable(display, irq_pipe_mask);
|
||||
}
|
||||
|
||||
static void hsw_power_well_pre_disable(struct intel_display *display,
|
||||
u8 irq_pipe_mask)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
if (irq_pipe_mask)
|
||||
gen8_irq_power_well_pre_disable(dev_priv, irq_pipe_mask);
|
||||
gen8_irq_power_well_pre_disable(display, irq_pipe_mask);
|
||||
}
|
||||
|
||||
#define ICL_AUX_PW_TO_PHY(pw_idx) \
|
||||
@@ -752,8 +749,9 @@ void gen9_sanitize_dc_state(struct intel_display *display)
|
||||
void gen9_set_dc_state(struct intel_display *display, u32 state)
|
||||
{
|
||||
struct i915_power_domains *power_domains = &display->power.domains;
|
||||
u32 val;
|
||||
bool dc6_was_enabled, enable_dc6;
|
||||
u32 mask;
|
||||
u32 val;
|
||||
|
||||
if (!HAS_DISPLAY(display))
|
||||
return;
|
||||
@@ -772,11 +770,19 @@ void gen9_set_dc_state(struct intel_display *display, u32 state)
|
||||
drm_err(display->drm, "DC state mismatch (0x%x -> 0x%x)\n",
|
||||
power_domains->dc_state, val & mask);
|
||||
|
||||
enable_dc6 = state & DC_STATE_EN_UPTO_DC6;
|
||||
dc6_was_enabled = val & DC_STATE_EN_UPTO_DC6;
|
||||
if (!dc6_was_enabled && enable_dc6)
|
||||
intel_dmc_update_dc6_allowed_count(display, true);
|
||||
|
||||
val &= ~mask;
|
||||
val |= state;
|
||||
|
||||
gen9_write_dc_state(display, val);
|
||||
|
||||
if (!enable_dc6 && dc6_was_enabled)
|
||||
intel_dmc_update_dc6_allowed_count(display, false);
|
||||
|
||||
power_domains->dc_state = val & mask;
|
||||
}
|
||||
|
||||
@@ -816,7 +822,8 @@ static void assert_can_enable_dc5(struct intel_display *display)
|
||||
(intel_de_read(display, DC_STATE_EN) &
|
||||
DC_STATE_EN_UPTO_DC5),
|
||||
"DC5 already programmed to be enabled.\n");
|
||||
assert_rpm_wakelock_held(&dev_priv->runtime_pm);
|
||||
|
||||
assert_display_rpm_held(display);
|
||||
|
||||
assert_dmc_loaded(display);
|
||||
}
|
||||
@@ -1226,7 +1233,7 @@ static void vlv_display_power_well_init(struct intel_display *display)
|
||||
vlv_init_display_clock_gating(display);
|
||||
|
||||
spin_lock_irq(&dev_priv->irq_lock);
|
||||
valleyview_enable_display_irqs(dev_priv);
|
||||
valleyview_enable_display_irqs(display);
|
||||
spin_unlock_irq(&dev_priv->irq_lock);
|
||||
|
||||
/*
|
||||
@@ -1236,8 +1243,8 @@ static void vlv_display_power_well_init(struct intel_display *display)
|
||||
if (display->power.domains.initializing)
|
||||
return;
|
||||
|
||||
intel_hpd_init(dev_priv);
|
||||
intel_hpd_poll_disable(dev_priv);
|
||||
intel_hpd_init(display);
|
||||
intel_hpd_poll_disable(display);
|
||||
|
||||
/* Re-enable the ADPA, if we have one */
|
||||
for_each_intel_encoder(display->drm, encoder) {
|
||||
@@ -1255,7 +1262,7 @@ static void vlv_display_power_well_deinit(struct intel_display *display)
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
spin_lock_irq(&dev_priv->irq_lock);
|
||||
valleyview_disable_display_irqs(dev_priv);
|
||||
valleyview_disable_display_irqs(display);
|
||||
spin_unlock_irq(&dev_priv->irq_lock);
|
||||
|
||||
/* make sure we're done processing display irqs */
|
||||
@@ -1265,7 +1272,7 @@ static void vlv_display_power_well_deinit(struct intel_display *display)
|
||||
|
||||
/* Prevent us from re-enabling polling on accident in late suspend */
|
||||
if (!display->drm->dev->power.is_suspended)
|
||||
intel_hpd_poll_enable(dev_priv);
|
||||
intel_hpd_poll_enable(display);
|
||||
}
|
||||
|
||||
static void vlv_display_power_well_enable(struct intel_display *display,
|
||||
|
||||
@@ -107,14 +107,14 @@ void intel_display_reset_finish(struct intel_display *display, bool test_only)
|
||||
intel_display_driver_init_hw(display);
|
||||
intel_clock_gating_init(i915);
|
||||
intel_cx0_pll_power_save_wa(display);
|
||||
intel_hpd_init(i915);
|
||||
intel_hpd_init(display);
|
||||
|
||||
ret = __intel_display_driver_resume(display, state, ctx);
|
||||
if (ret)
|
||||
drm_err(display->drm,
|
||||
"Restoring old state failed with %i\n", ret);
|
||||
|
||||
intel_hpd_poll_disable(i915);
|
||||
intel_hpd_poll_disable(display);
|
||||
}
|
||||
|
||||
drm_atomic_state_put(state);
|
||||
|
||||
68
drivers/gpu/drm/i915/display/intel_display_rpm.c
Normal file
68
drivers/gpu/drm/i915/display/intel_display_rpm.c
Normal file
@@ -0,0 +1,68 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
/* Copyright © 2025 Intel Corporation */
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_runtime_pm.h"
|
||||
|
||||
static struct intel_runtime_pm *display_to_rpm(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
return &i915->runtime_pm;
|
||||
}
|
||||
|
||||
struct ref_tracker *intel_display_rpm_get_raw(struct intel_display *display)
|
||||
{
|
||||
return intel_runtime_pm_get_raw(display_to_rpm(display));
|
||||
}
|
||||
|
||||
void intel_display_rpm_put_raw(struct intel_display *display, struct ref_tracker *wakeref)
|
||||
{
|
||||
intel_runtime_pm_put_raw(display_to_rpm(display), wakeref);
|
||||
}
|
||||
|
||||
struct ref_tracker *intel_display_rpm_get(struct intel_display *display)
|
||||
{
|
||||
return intel_runtime_pm_get(display_to_rpm(display));
|
||||
}
|
||||
|
||||
struct ref_tracker *intel_display_rpm_get_if_in_use(struct intel_display *display)
|
||||
{
|
||||
return intel_runtime_pm_get_if_in_use(display_to_rpm(display));
|
||||
}
|
||||
|
||||
struct ref_tracker *intel_display_rpm_get_noresume(struct intel_display *display)
|
||||
{
|
||||
return intel_runtime_pm_get_noresume(display_to_rpm(display));
|
||||
}
|
||||
|
||||
void intel_display_rpm_put(struct intel_display *display, struct ref_tracker *wakeref)
|
||||
{
|
||||
intel_runtime_pm_put(display_to_rpm(display), wakeref);
|
||||
}
|
||||
|
||||
void intel_display_rpm_put_unchecked(struct intel_display *display)
|
||||
{
|
||||
intel_runtime_pm_put_unchecked(display_to_rpm(display));
|
||||
}
|
||||
|
||||
bool intel_display_rpm_suspended(struct intel_display *display)
|
||||
{
|
||||
return intel_runtime_pm_suspended(display_to_rpm(display));
|
||||
}
|
||||
|
||||
void assert_display_rpm_held(struct intel_display *display)
|
||||
{
|
||||
assert_rpm_wakelock_held(display_to_rpm(display));
|
||||
}
|
||||
|
||||
void intel_display_rpm_assert_block(struct intel_display *display)
|
||||
{
|
||||
disable_rpm_wakeref_asserts(display_to_rpm(display));
|
||||
}
|
||||
|
||||
void intel_display_rpm_assert_unblock(struct intel_display *display)
|
||||
{
|
||||
enable_rpm_wakeref_asserts(display_to_rpm(display));
|
||||
}
|
||||
37
drivers/gpu/drm/i915/display/intel_display_rpm.h
Normal file
37
drivers/gpu/drm/i915/display/intel_display_rpm.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright © 2025 Intel Corporation */
|
||||
|
||||
#ifndef __INTEL_DISPLAY_RPM__
|
||||
#define __INTEL_DISPLAY_RPM__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct intel_display;
|
||||
struct ref_tracker;
|
||||
|
||||
struct ref_tracker *intel_display_rpm_get(struct intel_display *display);
|
||||
void intel_display_rpm_put(struct intel_display *display, struct ref_tracker *wakeref);
|
||||
|
||||
#define __with_intel_display_rpm(__display, __wakeref) \
|
||||
for (struct ref_tracker *(__wakeref) = intel_display_rpm_get(__display); (__wakeref); \
|
||||
intel_display_rpm_put((__display), (__wakeref)), (__wakeref) = NULL)
|
||||
|
||||
#define with_intel_display_rpm(__display) \
|
||||
__with_intel_display_rpm((__display), __UNIQUE_ID(wakeref))
|
||||
|
||||
/* Only for special cases. */
|
||||
bool intel_display_rpm_suspended(struct intel_display *display);
|
||||
|
||||
void assert_display_rpm_held(struct intel_display *display);
|
||||
void intel_display_rpm_assert_block(struct intel_display *display);
|
||||
void intel_display_rpm_assert_unblock(struct intel_display *display);
|
||||
|
||||
/* Only for display power implementation. */
|
||||
struct ref_tracker *intel_display_rpm_get_raw(struct intel_display *display);
|
||||
void intel_display_rpm_put_raw(struct intel_display *display, struct ref_tracker *wakeref);
|
||||
|
||||
struct ref_tracker *intel_display_rpm_get_if_in_use(struct intel_display *display);
|
||||
struct ref_tracker *intel_display_rpm_get_noresume(struct intel_display *display);
|
||||
void intel_display_rpm_put_unchecked(struct intel_display *display);
|
||||
|
||||
#endif /* __INTEL_DISPLAY_RPM__ */
|
||||
@@ -581,7 +581,7 @@ struct dpll {
|
||||
struct intel_atomic_state {
|
||||
struct drm_atomic_state base;
|
||||
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
|
||||
struct __intel_global_objs_state *global_objs;
|
||||
int num_global_objs;
|
||||
@@ -1620,7 +1620,7 @@ struct intel_psr {
|
||||
bool sink_support;
|
||||
bool source_support;
|
||||
bool enabled;
|
||||
bool paused;
|
||||
int pause_counter;
|
||||
enum pipe pipe;
|
||||
enum transcoder transcoder;
|
||||
bool active;
|
||||
@@ -1658,7 +1658,6 @@ struct intel_dp {
|
||||
int link_rate;
|
||||
u8 lane_count;
|
||||
u8 sink_count;
|
||||
bool link_trained;
|
||||
bool needs_modeset_retry;
|
||||
bool use_max_params;
|
||||
u8 dpcd[DP_RECEIVER_CAP_SIZE];
|
||||
@@ -1683,6 +1682,7 @@ struct intel_dp {
|
||||
int common_rates[DP_MAX_SUPPORTED_RATES];
|
||||
struct {
|
||||
/* TODO: move the rest of link specific fields to here */
|
||||
bool active;
|
||||
/* common rate,lane_count configs in bw order */
|
||||
int num_configs;
|
||||
#define INTEL_DP_MAX_LANE_COUNT 4
|
||||
@@ -1739,7 +1739,7 @@ struct intel_dp {
|
||||
struct {
|
||||
struct intel_dp_mst_encoder *stream_encoders[I915_MAX_PIPES];
|
||||
struct drm_dp_mst_topology_mgr mgr;
|
||||
int active_links;
|
||||
int active_streams;
|
||||
} mst;
|
||||
|
||||
u32 (*get_aux_clock_divider)(struct intel_dp *dp, int index);
|
||||
|
||||
@@ -3,38 +3,38 @@
|
||||
* Copyright © 2023 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_reg.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_core.h"
|
||||
#include "intel_display_wa.h"
|
||||
|
||||
static void gen11_display_wa_apply(struct drm_i915_private *i915)
|
||||
static void gen11_display_wa_apply(struct intel_display *display)
|
||||
{
|
||||
/* Wa_14010594013 */
|
||||
intel_de_rmw(i915, GEN8_CHICKEN_DCPR_1, 0, ICL_DELAY_PMRSP);
|
||||
intel_de_rmw(display, GEN8_CHICKEN_DCPR_1, 0, ICL_DELAY_PMRSP);
|
||||
}
|
||||
|
||||
static void xe_d_display_wa_apply(struct drm_i915_private *i915)
|
||||
static void xe_d_display_wa_apply(struct intel_display *display)
|
||||
{
|
||||
/* Wa_14013723622 */
|
||||
intel_de_rmw(i915, CLKREQ_POLICY, CLKREQ_POLICY_MEM_UP_OVRD, 0);
|
||||
intel_de_rmw(display, CLKREQ_POLICY, CLKREQ_POLICY_MEM_UP_OVRD, 0);
|
||||
}
|
||||
|
||||
static void adlp_display_wa_apply(struct drm_i915_private *i915)
|
||||
static void adlp_display_wa_apply(struct intel_display *display)
|
||||
{
|
||||
/* Wa_22011091694:adlp */
|
||||
intel_de_rmw(i915, GEN9_CLKGATE_DIS_5, 0, DPCE_GATING_DIS);
|
||||
intel_de_rmw(display, GEN9_CLKGATE_DIS_5, 0, DPCE_GATING_DIS);
|
||||
|
||||
/* Bspec/49189 Initialize Sequence */
|
||||
intel_de_rmw(i915, GEN8_CHICKEN_DCPR_1, DDI_CLOCK_REG_ACCESS, 0);
|
||||
intel_de_rmw(display, GEN8_CHICKEN_DCPR_1, DDI_CLOCK_REG_ACCESS, 0);
|
||||
}
|
||||
|
||||
void intel_display_wa_apply(struct drm_i915_private *i915)
|
||||
void intel_display_wa_apply(struct intel_display *display)
|
||||
{
|
||||
if (IS_ALDERLAKE_P(i915))
|
||||
adlp_display_wa_apply(i915);
|
||||
else if (DISPLAY_VER(i915) == 12)
|
||||
xe_d_display_wa_apply(i915);
|
||||
else if (DISPLAY_VER(i915) == 11)
|
||||
gen11_display_wa_apply(i915);
|
||||
if (display->platform.alderlake_p)
|
||||
adlp_display_wa_apply(display);
|
||||
else if (DISPLAY_VER(display) == 12)
|
||||
xe_d_display_wa_apply(display);
|
||||
else if (DISPLAY_VER(display) == 11)
|
||||
gen11_display_wa_apply(display);
|
||||
}
|
||||
|
||||
@@ -8,14 +8,17 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_display;
|
||||
|
||||
void intel_display_wa_apply(struct drm_i915_private *i915);
|
||||
void intel_display_wa_apply(struct intel_display *display);
|
||||
|
||||
#ifdef I915
|
||||
static inline bool intel_display_needs_wa_16023588340(struct drm_i915_private *i915) { return false; }
|
||||
static inline bool intel_display_needs_wa_16023588340(struct intel_display *display)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
bool intel_display_needs_wa_16023588340(struct drm_i915_private *i915);
|
||||
bool intel_display_needs_wa_16023588340(struct intel_display *display);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <drm/drm_device.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "intel_de.h"
|
||||
#include "intel_display.h"
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#include "i915_drv.h"
|
||||
#include "i915_reg.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_power_well.h"
|
||||
#include "intel_dmc.h"
|
||||
#include "intel_dmc_regs.h"
|
||||
#include "intel_step.h"
|
||||
@@ -57,6 +59,10 @@ struct intel_dmc {
|
||||
const char *fw_path;
|
||||
u32 max_fw_size; /* bytes */
|
||||
u32 version;
|
||||
struct {
|
||||
u32 dc5_start;
|
||||
u32 count;
|
||||
} dc6_allowed;
|
||||
struct dmc_fw_info {
|
||||
u32 mmio_count;
|
||||
i915_reg_t mmioaddr[20];
|
||||
@@ -595,7 +601,7 @@ void intel_dmc_load_program(struct intel_display *display)
|
||||
|
||||
disable_all_event_handlers(display);
|
||||
|
||||
assert_rpm_wakelock_held(&i915->runtime_pm);
|
||||
assert_display_rpm_held(display);
|
||||
|
||||
preempt_disable();
|
||||
|
||||
@@ -1232,18 +1238,57 @@ void intel_dmc_snapshot_print(const struct intel_dmc_snapshot *snapshot, struct
|
||||
DMC_VERSION_MINOR(snapshot->version));
|
||||
}
|
||||
|
||||
void intel_dmc_update_dc6_allowed_count(struct intel_display *display,
|
||||
bool start_tracking)
|
||||
{
|
||||
struct intel_dmc *dmc = display_to_dmc(display);
|
||||
u32 dc5_cur_count;
|
||||
|
||||
if (DISPLAY_VER(dmc->display) < 14)
|
||||
return;
|
||||
|
||||
dc5_cur_count = intel_de_read(dmc->display, DG1_DMC_DEBUG_DC5_COUNT);
|
||||
|
||||
if (!start_tracking)
|
||||
dmc->dc6_allowed.count += dc5_cur_count - dmc->dc6_allowed.dc5_start;
|
||||
|
||||
dmc->dc6_allowed.dc5_start = dc5_cur_count;
|
||||
}
|
||||
|
||||
static bool intel_dmc_get_dc6_allowed_count(struct intel_display *display, u32 *count)
|
||||
{
|
||||
struct i915_power_domains *power_domains = &display->power.domains;
|
||||
struct intel_dmc *dmc = display_to_dmc(display);
|
||||
bool dc6_enabled;
|
||||
|
||||
if (DISPLAY_VER(display) < 14)
|
||||
return false;
|
||||
|
||||
mutex_lock(&power_domains->lock);
|
||||
dc6_enabled = intel_de_read(display, DC_STATE_EN) &
|
||||
DC_STATE_EN_UPTO_DC6;
|
||||
if (dc6_enabled)
|
||||
intel_dmc_update_dc6_allowed_count(display, false);
|
||||
|
||||
*count = dmc->dc6_allowed.count;
|
||||
mutex_unlock(&power_domains->lock);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct intel_display *display = m->private;
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct intel_dmc *dmc = display_to_dmc(display);
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
i915_reg_t dc5_reg, dc6_reg = INVALID_MMIO_REG;
|
||||
u32 dc6_allowed_count;
|
||||
|
||||
if (!HAS_DMC(display))
|
||||
return -ENODEV;
|
||||
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
|
||||
seq_printf(m, "DMC initialized: %s\n", str_yes_no(dmc));
|
||||
seq_printf(m, "fw loaded: %s\n",
|
||||
@@ -1287,7 +1332,11 @@ static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
|
||||
}
|
||||
|
||||
seq_printf(m, "DC3 -> DC5 count: %d\n", intel_de_read(display, dc5_reg));
|
||||
if (i915_mmio_reg_valid(dc6_reg))
|
||||
|
||||
if (intel_dmc_get_dc6_allowed_count(display, &dc6_allowed_count))
|
||||
seq_printf(m, "DC5 -> DC6 allowed count: %d\n",
|
||||
dc6_allowed_count);
|
||||
else if (i915_mmio_reg_valid(dc6_reg))
|
||||
seq_printf(m, "DC5 -> DC6 count: %d\n",
|
||||
intel_de_read(display, dc6_reg));
|
||||
|
||||
@@ -1299,7 +1348,7 @@ out:
|
||||
intel_de_read(display, DMC_SSP_BASE));
|
||||
seq_printf(m, "htp: 0x%08x\n", intel_de_read(display, DMC_HTP_SKL));
|
||||
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ void intel_dmc_debugfs_register(struct intel_display *display);
|
||||
|
||||
struct intel_dmc_snapshot *intel_dmc_snapshot_capture(struct intel_display *display);
|
||||
void intel_dmc_snapshot_print(const struct intel_dmc_snapshot *snapshot, struct drm_printer *p);
|
||||
void intel_dmc_update_dc6_allowed_count(struct intel_display *display, bool start_tracking);
|
||||
|
||||
void assert_dmc_loaded(struct intel_display *display);
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
#include "intel_ddi.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_driver.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp.h"
|
||||
#include "intel_dp_aux.h"
|
||||
@@ -87,7 +88,6 @@
|
||||
#include "intel_pfit.h"
|
||||
#include "intel_pps.h"
|
||||
#include "intel_psr.h"
|
||||
#include "intel_runtime_pm.h"
|
||||
#include "intel_quirks.h"
|
||||
#include "intel_tc.h"
|
||||
#include "intel_vdsc.h"
|
||||
@@ -3222,7 +3222,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
|
||||
int link_rate, int lane_count)
|
||||
{
|
||||
memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
|
||||
intel_dp->link_trained = false;
|
||||
intel_dp->link.active = false;
|
||||
intel_dp->needs_modeset_retry = false;
|
||||
intel_dp->link_rate = link_rate;
|
||||
intel_dp->lane_count = lane_count;
|
||||
@@ -3586,7 +3586,7 @@ void intel_dp_sync_state(struct intel_encoder *encoder,
|
||||
if (crtc_state) {
|
||||
intel_dp_reset_link_params(intel_dp);
|
||||
intel_dp_set_link_params(intel_dp, crtc_state->port_clock, crtc_state->lane_count);
|
||||
intel_dp->link_trained = true;
|
||||
intel_dp->link.active = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5004,8 +5004,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
|
||||
bool link_ok = true;
|
||||
bool reprobe_needed = false;
|
||||
|
||||
drm_WARN_ON_ONCE(display->drm, intel_dp->mst.active_links < 0);
|
||||
|
||||
for (;;) {
|
||||
u8 esi[4] = {};
|
||||
u8 ack[4] = {};
|
||||
@@ -5020,7 +5018,7 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
|
||||
|
||||
drm_dbg_kms(display->drm, "DPRX ESI: %4ph\n", esi);
|
||||
|
||||
if (intel_dp->mst.active_links > 0 && link_ok &&
|
||||
if (intel_dp_mst_active_streams(intel_dp) > 0 && link_ok &&
|
||||
esi[3] & LINK_STATUS_CHANGED) {
|
||||
if (!intel_dp_mst_link_status(intel_dp))
|
||||
link_ok = false;
|
||||
@@ -5081,7 +5079,7 @@ intel_dp_needs_link_retrain(struct intel_dp *intel_dp)
|
||||
{
|
||||
u8 link_status[DP_LINK_STATUS_SIZE];
|
||||
|
||||
if (!intel_dp->link_trained)
|
||||
if (!intel_dp->link.active)
|
||||
return false;
|
||||
|
||||
/*
|
||||
@@ -6152,7 +6150,7 @@ static void intel_dp_oob_hotplug_event(struct drm_connector *connector,
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
|
||||
if (need_work)
|
||||
intel_hpd_schedule_detection(i915);
|
||||
intel_hpd_schedule_detection(display);
|
||||
}
|
||||
|
||||
static const struct drm_connector_funcs intel_dp_connector_funcs = {
|
||||
@@ -6179,13 +6177,12 @@ enum irqreturn
|
||||
intel_dp_hpd_pulse(struct intel_digital_port *dig_port, bool long_hpd)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(dig_port);
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
struct intel_dp *intel_dp = &dig_port->dp;
|
||||
u8 dpcd[DP_RECEIVER_CAP_SIZE];
|
||||
|
||||
if (dig_port->base.type == INTEL_OUTPUT_EDP &&
|
||||
(long_hpd ||
|
||||
intel_runtime_pm_suspended(&i915->runtime_pm) ||
|
||||
intel_display_rpm_suspended(display) ||
|
||||
!intel_pps_have_panel_power_or_vdd(intel_dp))) {
|
||||
/*
|
||||
* vdd off can generate a long/short pulse on eDP which
|
||||
@@ -6361,7 +6358,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
|
||||
* eDP and LVDS bail out early in this case to prevent interfering
|
||||
* with an already powered-on LVDS power sequencer.
|
||||
*/
|
||||
if (intel_get_lvds_encoder(dev_priv)) {
|
||||
if (intel_get_lvds_encoder(display)) {
|
||||
drm_WARN_ON(display->drm,
|
||||
!(HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv)));
|
||||
drm_info(display->drm,
|
||||
|
||||
@@ -247,7 +247,7 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
||||
u32 aux_clock_divider;
|
||||
enum intel_display_power_domain aux_domain;
|
||||
intel_wakeref_t aux_wakeref;
|
||||
intel_wakeref_t pps_wakeref;
|
||||
intel_wakeref_t pps_wakeref = NULL;
|
||||
int i, ret, recv_bytes;
|
||||
int try, clock = 0;
|
||||
u32 status;
|
||||
@@ -272,7 +272,20 @@ intel_dp_aux_xfer(struct intel_dp *intel_dp,
|
||||
aux_domain = intel_aux_power_domain(dig_port);
|
||||
|
||||
aux_wakeref = intel_display_power_get(display, aux_domain);
|
||||
pps_wakeref = intel_pps_lock(intel_dp);
|
||||
|
||||
/*
|
||||
* The PPS state needs to be locked for:
|
||||
* - eDP on all platforms, since AUX transfers on eDP need VDD power
|
||||
* (either forced or via panel power) which depends on the PPS
|
||||
* state.
|
||||
* - non-eDP on platforms where the PPS is a pipe instance (VLV/CHV),
|
||||
* since changing the PPS state (via a parallel modeset for
|
||||
* instance) may interfere with the AUX transfers on a non-eDP
|
||||
* output as well.
|
||||
*/
|
||||
if (intel_dp_is_edp(intel_dp) ||
|
||||
display->platform.valleyview || display->platform.cherryview)
|
||||
pps_wakeref = intel_pps_lock(intel_dp);
|
||||
|
||||
/*
|
||||
* We will be called with VDD already enabled for dpcd/edid/oui reads.
|
||||
@@ -430,7 +443,9 @@ out:
|
||||
if (vdd)
|
||||
intel_pps_vdd_off_unlocked(intel_dp, false);
|
||||
|
||||
intel_pps_unlock(intel_dp, pps_wakeref);
|
||||
if (pps_wakeref)
|
||||
intel_pps_unlock(intel_dp, pps_wakeref);
|
||||
|
||||
intel_display_power_put_async(display, aux_domain, aux_wakeref);
|
||||
out_unlock:
|
||||
intel_digital_port_unlock(encoder);
|
||||
|
||||
@@ -56,6 +56,8 @@
|
||||
lt_dbg(_intel_dp, _dp_phy, "Sink disconnected: " _format, ## __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define MAX_SEQ_TRAIN_FAILURES 2
|
||||
|
||||
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));
|
||||
@@ -164,7 +166,7 @@ static int intel_dp_init_lttpr_phys(struct intel_dp *intel_dp, const u8 dpcd[DP_
|
||||
* resetting its internal state when the mode is changed from
|
||||
* non-transparent to transparent.
|
||||
*/
|
||||
if (intel_dp->link_trained) {
|
||||
if (intel_dp->link.active) {
|
||||
if (lttpr_count < 0 || intel_dp_lttpr_transparent_mode_enabled(intel_dp))
|
||||
goto out_reset_lttpr_count;
|
||||
|
||||
@@ -711,8 +713,21 @@ void intel_dp_link_training_set_mode(struct intel_dp *intel_dp, int link_rate, b
|
||||
static void intel_dp_update_downspread_ctrl(struct intel_dp *intel_dp,
|
||||
const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
/*
|
||||
* Currently, we set the MSA ignore bit based on vrr.in_range.
|
||||
* We can't really read that out during driver load since we don't have
|
||||
* the connector information read in yet. So if we do end up doing a
|
||||
* modeset during initial_commit() we'll clear the MSA ignore bit.
|
||||
* GOP likely wouldn't have set this bit so after the initial commit,
|
||||
* if there are no modesets and we enable VRR mode seamlessly
|
||||
* (without a full modeset), the MSA ignore bit might never get set.
|
||||
*
|
||||
* #TODO: Implement readout of vrr.in_range.
|
||||
* We need fastset support for setting the MSA ignore bit in DPCD,
|
||||
* especially on the first real commit when clearing the inherited flag.
|
||||
*/
|
||||
intel_dp_link_training_set_mode(intel_dp,
|
||||
crtc_state->port_clock, crtc_state->vrr.flipline);
|
||||
crtc_state->port_clock, crtc_state->vrr.in_range);
|
||||
}
|
||||
|
||||
void intel_dp_link_training_set_bw(struct intel_dp *intel_dp,
|
||||
@@ -1110,7 +1125,10 @@ intel_dp_128b132b_intra_hop(struct intel_dp *intel_dp,
|
||||
void intel_dp_stop_link_train(struct intel_dp *intel_dp,
|
||||
const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
intel_dp->link_trained = true;
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
|
||||
|
||||
intel_dp->link.active = true;
|
||||
|
||||
intel_dp_disable_dpcd_training_pattern(intel_dp, DP_PHY_DPRX);
|
||||
intel_dp_program_link_training_pattern(intel_dp, crtc_state, DP_PHY_DPRX,
|
||||
@@ -1120,6 +1138,15 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp,
|
||||
wait_for(intel_dp_128b132b_intra_hop(intel_dp, crtc_state) == 0, 500)) {
|
||||
lt_dbg(intel_dp, DP_PHY_DPRX, "128b/132b intra-hop not clearing\n");
|
||||
}
|
||||
|
||||
intel_hpd_unblock(encoder);
|
||||
|
||||
if (!display->hotplug.ignore_long_hpd &&
|
||||
intel_dp->link.seq_train_failures < MAX_SEQ_TRAIN_FAILURES) {
|
||||
int delay_ms = intel_dp->link.seq_train_failures ? 0 : 2000;
|
||||
|
||||
intel_encoder_link_check_queue_work(encoder, delay_ms);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -1602,7 +1629,11 @@ void intel_dp_start_link_train(struct intel_atomic_state *state,
|
||||
* non-transparent mode. During an earlier LTTPR detection this
|
||||
* could've been prevented by an active link.
|
||||
*/
|
||||
int lttpr_count = intel_dp_init_lttpr_and_dprx_caps(intel_dp);
|
||||
int lttpr_count;
|
||||
|
||||
intel_hpd_block(encoder);
|
||||
|
||||
lttpr_count = intel_dp_init_lttpr_and_dprx_caps(intel_dp);
|
||||
|
||||
if (lttpr_count < 0)
|
||||
/* Still continue with enabling the port and link training. */
|
||||
@@ -1620,7 +1651,6 @@ void intel_dp_start_link_train(struct intel_atomic_state *state,
|
||||
lt_dbg(intel_dp, DP_PHY_DPRX, "Forcing link training failure\n");
|
||||
} else if (passed) {
|
||||
intel_dp->link.seq_train_failures = 0;
|
||||
intel_encoder_link_check_queue_work(encoder, 2000);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1643,10 +1673,8 @@ void intel_dp_start_link_train(struct intel_atomic_state *state,
|
||||
return;
|
||||
}
|
||||
|
||||
if (intel_dp->link.seq_train_failures < 2) {
|
||||
intel_encoder_link_check_queue_work(encoder, 0);
|
||||
if (intel_dp->link.seq_train_failures < MAX_SEQ_TRAIN_FAILURES)
|
||||
return;
|
||||
}
|
||||
|
||||
if (intel_dp_schedule_fallback_link_training(state, intel_dp, crtc_state))
|
||||
return;
|
||||
@@ -1693,7 +1721,7 @@ static int i915_dp_force_link_rate_show(struct seq_file *m, void *data)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (intel_dp->link_trained)
|
||||
if (intel_dp->link.active)
|
||||
current_rate = intel_dp->link_rate;
|
||||
force_rate = intel_dp->link.force_rate;
|
||||
|
||||
@@ -1791,7 +1819,7 @@ static int i915_dp_force_lane_count_show(struct seq_file *m, void *data)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (intel_dp->link_trained)
|
||||
if (intel_dp->link.active)
|
||||
current_lane_count = intel_dp->lane_count;
|
||||
force_lane_count = intel_dp->link.force_lane_count;
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "intel_pfit.h"
|
||||
#include "intel_psr.h"
|
||||
#include "intel_vdsc.h"
|
||||
#include "intel_vrr.h"
|
||||
#include "skl_scaler.h"
|
||||
|
||||
/*
|
||||
@@ -104,6 +105,34 @@ static struct intel_dp *to_primary_dp(struct intel_encoder *encoder)
|
||||
return &dig_port->dp;
|
||||
}
|
||||
|
||||
int intel_dp_mst_active_streams(struct intel_dp *intel_dp)
|
||||
{
|
||||
return intel_dp->mst.active_streams;
|
||||
}
|
||||
|
||||
static bool intel_dp_mst_dec_active_streams(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
|
||||
drm_dbg_kms(display->drm, "active MST streams %d -> %d\n",
|
||||
intel_dp->mst.active_streams, intel_dp->mst.active_streams - 1);
|
||||
|
||||
if (drm_WARN_ON(display->drm, intel_dp->mst.active_streams == 0))
|
||||
return true;
|
||||
|
||||
return --intel_dp->mst.active_streams == 0;
|
||||
}
|
||||
|
||||
static bool intel_dp_mst_inc_active_streams(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
|
||||
drm_dbg_kms(display->drm, "active MST streams %d -> %d\n",
|
||||
intel_dp->mst.active_streams, intel_dp->mst.active_streams + 1);
|
||||
|
||||
return intel_dp->mst.active_streams++ == 0;
|
||||
}
|
||||
|
||||
static int intel_dp_mst_max_dpt_bpp(const struct intel_crtc_state *crtc_state,
|
||||
bool dsc)
|
||||
{
|
||||
@@ -710,6 +739,8 @@ static int mst_stream_compute_config(struct intel_encoder *encoder,
|
||||
pipe_config->lane_lat_optim_mask =
|
||||
bxt_dpio_phy_calc_lane_lat_optim_mask(pipe_config->lane_count);
|
||||
|
||||
intel_vrr_compute_config(pipe_config, conn_state);
|
||||
|
||||
intel_dp_audio_compute_config(encoder, pipe_config, conn_state);
|
||||
|
||||
intel_ddi_compute_min_voltage_level(pipe_config);
|
||||
@@ -997,11 +1028,8 @@ static void mst_stream_disable(struct intel_atomic_state *state,
|
||||
to_intel_connector(old_conn_state->connector);
|
||||
enum transcoder trans = old_crtc_state->cpu_transcoder;
|
||||
|
||||
drm_dbg_kms(display->drm, "active links %d\n",
|
||||
intel_dp->mst.active_links);
|
||||
|
||||
if (intel_dp->mst.active_links == 1)
|
||||
intel_dp->link_trained = false;
|
||||
if (intel_dp_mst_active_streams(intel_dp) == 1)
|
||||
intel_dp->link.active = false;
|
||||
|
||||
intel_hdcp_disable(intel_mst->connector);
|
||||
|
||||
@@ -1034,8 +1062,8 @@ static void mst_stream_post_disable(struct intel_atomic_state *state,
|
||||
bool last_mst_stream;
|
||||
int i;
|
||||
|
||||
intel_dp->mst.active_links--;
|
||||
last_mst_stream = intel_dp->mst.active_links == 0;
|
||||
last_mst_stream = intel_dp_mst_dec_active_streams(intel_dp);
|
||||
|
||||
drm_WARN_ON(display->drm, DISPLAY_VER(display) >= 12 && last_mst_stream &&
|
||||
!intel_dp_mst_is_master_trans(old_crtc_state));
|
||||
|
||||
@@ -1062,6 +1090,8 @@ static void mst_stream_post_disable(struct intel_atomic_state *state,
|
||||
drm_dp_remove_payload_part2(&intel_dp->mst.mgr, new_mst_state,
|
||||
old_payload, new_payload);
|
||||
|
||||
intel_vrr_transcoder_disable(old_crtc_state);
|
||||
|
||||
intel_ddi_disable_transcoder_func(old_crtc_state);
|
||||
|
||||
for_each_pipe_crtc_modeset_disable(display, pipe_crtc, old_crtc_state, i) {
|
||||
@@ -1104,8 +1134,6 @@ static void mst_stream_post_disable(struct intel_atomic_state *state,
|
||||
primary_encoder->post_disable(state, primary_encoder,
|
||||
old_crtc_state, NULL);
|
||||
|
||||
drm_dbg_kms(display->drm, "active links %d\n",
|
||||
intel_dp->mst.active_links);
|
||||
}
|
||||
|
||||
static void mst_stream_post_pll_disable(struct intel_atomic_state *state,
|
||||
@@ -1116,7 +1144,7 @@ static void mst_stream_post_pll_disable(struct intel_atomic_state *state,
|
||||
struct intel_encoder *primary_encoder = to_primary_encoder(encoder);
|
||||
struct intel_dp *intel_dp = to_primary_dp(encoder);
|
||||
|
||||
if (intel_dp->mst.active_links == 0 &&
|
||||
if (intel_dp_mst_active_streams(intel_dp) == 0 &&
|
||||
primary_encoder->post_pll_disable)
|
||||
primary_encoder->post_pll_disable(state, primary_encoder, old_crtc_state, old_conn_state);
|
||||
}
|
||||
@@ -1129,7 +1157,7 @@ static void mst_stream_pre_pll_enable(struct intel_atomic_state *state,
|
||||
struct intel_encoder *primary_encoder = to_primary_encoder(encoder);
|
||||
struct intel_dp *intel_dp = to_primary_dp(encoder);
|
||||
|
||||
if (intel_dp->mst.active_links == 0)
|
||||
if (intel_dp_mst_active_streams(intel_dp) == 0)
|
||||
primary_encoder->pre_pll_enable(state, primary_encoder,
|
||||
pipe_config, NULL);
|
||||
else
|
||||
@@ -1189,13 +1217,11 @@ static void mst_stream_pre_enable(struct intel_atomic_state *state,
|
||||
*/
|
||||
connector->encoder = encoder;
|
||||
intel_mst->connector = connector;
|
||||
first_mst_stream = intel_dp->mst.active_links == 0;
|
||||
|
||||
first_mst_stream = intel_dp_mst_inc_active_streams(intel_dp);
|
||||
drm_WARN_ON(display->drm, DISPLAY_VER(display) >= 12 && first_mst_stream &&
|
||||
!intel_dp_mst_is_master_trans(pipe_config));
|
||||
|
||||
drm_dbg_kms(display->drm, "active links %d\n",
|
||||
intel_dp->mst.active_links);
|
||||
|
||||
if (first_mst_stream)
|
||||
intel_dp_set_power(intel_dp, DP_SET_POWER_D0);
|
||||
|
||||
@@ -1210,8 +1236,6 @@ static void mst_stream_pre_enable(struct intel_atomic_state *state,
|
||||
intel_mst_reprobe_topology(intel_dp, pipe_config);
|
||||
}
|
||||
|
||||
intel_dp->mst.active_links++;
|
||||
|
||||
ret = drm_dp_add_payload_part1(&intel_dp->mst.mgr, mst_state,
|
||||
drm_atomic_get_mst_payload_state(mst_state, connector->mst.port));
|
||||
if (ret < 0)
|
||||
@@ -1279,7 +1303,7 @@ static void mst_stream_enable(struct intel_atomic_state *state,
|
||||
struct drm_dp_mst_topology_state *mst_state =
|
||||
drm_atomic_get_new_mst_topology_state(&state->base, &intel_dp->mst.mgr);
|
||||
enum transcoder trans = pipe_config->cpu_transcoder;
|
||||
bool first_mst_stream = intel_dp->mst.active_links == 1;
|
||||
bool first_mst_stream = intel_dp_mst_active_streams(intel_dp) == 1;
|
||||
struct intel_crtc *pipe_crtc;
|
||||
int ret, i, min_hblank;
|
||||
|
||||
@@ -1323,14 +1347,13 @@ static void mst_stream_enable(struct intel_atomic_state *state,
|
||||
|
||||
intel_ddi_enable_transcoder_func(encoder, pipe_config);
|
||||
|
||||
intel_vrr_transcoder_enable(pipe_config);
|
||||
|
||||
intel_ddi_clear_act_sent(encoder, pipe_config);
|
||||
|
||||
intel_de_rmw(display, TRANS_DDI_FUNC_CTL(display, trans), 0,
|
||||
TRANS_DDI_DP_VC_PAYLOAD_ALLOC);
|
||||
|
||||
drm_dbg_kms(display->drm, "active links %d\n",
|
||||
intel_dp->mst.active_links);
|
||||
|
||||
intel_ddi_wait_for_act_sent(encoder, pipe_config);
|
||||
drm_dp_check_act_status(&intel_dp->mst.mgr);
|
||||
|
||||
@@ -1869,12 +1892,6 @@ mst_stream_encoders_create(struct intel_digital_port *dig_port)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port)
|
||||
{
|
||||
return dig_port->dp.mst.active_links;
|
||||
}
|
||||
|
||||
int
|
||||
intel_dp_mst_encoder_init(struct intel_digital_port *dig_port, int conn_base_id)
|
||||
{
|
||||
@@ -2101,7 +2118,7 @@ void intel_dp_mst_prepare_probe(struct intel_dp *intel_dp)
|
||||
u8 rate_select;
|
||||
u8 link_bw;
|
||||
|
||||
if (intel_dp->link_trained)
|
||||
if (intel_dp->link.active)
|
||||
return;
|
||||
|
||||
if (intel_mst_probed_link_params_valid(intel_dp, link_rate, lane_count))
|
||||
|
||||
@@ -18,7 +18,7 @@ struct intel_link_bw_limits;
|
||||
|
||||
int intel_dp_mst_encoder_init(struct intel_digital_port *dig_port, int conn_id);
|
||||
void intel_dp_mst_encoder_cleanup(struct intel_digital_port *dig_port);
|
||||
int intel_dp_mst_encoder_active_links(struct intel_digital_port *dig_port);
|
||||
int intel_dp_mst_active_streams(struct intel_dp *intel_dp);
|
||||
bool intel_dp_mst_is_master_trans(const struct intel_crtc_state *crtc_state);
|
||||
bool intel_dp_mst_is_slave_trans(const struct intel_crtc_state *crtc_state);
|
||||
bool intel_dp_mst_source_support(struct intel_dp *intel_dp);
|
||||
|
||||
@@ -373,14 +373,15 @@ int chv_calc_dpll_params(int refclk, struct dpll *clock)
|
||||
|
||||
static int i9xx_pll_refclk(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
|
||||
const struct i9xx_dpll_hw_state *hw_state = &crtc_state->dpll_hw_state.i9xx;
|
||||
|
||||
if ((hw_state->dpll & PLL_REF_INPUT_MASK) == PLLB_REF_INPUT_SPREADSPECTRUMIN)
|
||||
return i915->display.vbt.lvds_ssc_freq;
|
||||
return display->vbt.lvds_ssc_freq;
|
||||
else if (HAS_PCH_SPLIT(i915))
|
||||
return 120000;
|
||||
else if (DISPLAY_VER(i915) != 2)
|
||||
else if (DISPLAY_VER(display) != 2)
|
||||
return 96000;
|
||||
else
|
||||
return 48000;
|
||||
@@ -389,27 +390,27 @@ static int i9xx_pll_refclk(const struct intel_crtc_state *crtc_state)
|
||||
void i9xx_dpll_get_hw_state(struct intel_crtc *crtc,
|
||||
struct intel_dpll_hw_state *dpll_hw_state)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct i9xx_dpll_hw_state *hw_state = &dpll_hw_state->i9xx;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 4) {
|
||||
if (DISPLAY_VER(display) >= 4) {
|
||||
u32 tmp;
|
||||
|
||||
/* No way to read it out on pipes B and C */
|
||||
if (IS_CHERRYVIEW(dev_priv) && crtc->pipe != PIPE_A)
|
||||
tmp = dev_priv->display.state.chv_dpll_md[crtc->pipe];
|
||||
if (display->platform.cherryview && crtc->pipe != PIPE_A)
|
||||
tmp = display->state.chv_dpll_md[crtc->pipe];
|
||||
else
|
||||
tmp = intel_de_read(dev_priv,
|
||||
DPLL_MD(dev_priv, crtc->pipe));
|
||||
tmp = intel_de_read(display,
|
||||
DPLL_MD(display, crtc->pipe));
|
||||
|
||||
hw_state->dpll_md = tmp;
|
||||
}
|
||||
|
||||
hw_state->dpll = intel_de_read(dev_priv, DPLL(dev_priv, crtc->pipe));
|
||||
hw_state->dpll = intel_de_read(display, DPLL(display, crtc->pipe));
|
||||
|
||||
if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv)) {
|
||||
hw_state->fp0 = intel_de_read(dev_priv, FP0(crtc->pipe));
|
||||
hw_state->fp1 = intel_de_read(dev_priv, FP1(crtc->pipe));
|
||||
if (!display->platform.valleyview && !display->platform.cherryview) {
|
||||
hw_state->fp0 = intel_de_read(display, FP0(crtc->pipe));
|
||||
hw_state->fp1 = intel_de_read(display, FP1(crtc->pipe));
|
||||
} else {
|
||||
/* Mask out read-only status bits. */
|
||||
hw_state->dpll &= ~(DPLL_LOCK_VLV |
|
||||
@@ -421,8 +422,8 @@ void i9xx_dpll_get_hw_state(struct intel_crtc *crtc,
|
||||
/* Returns the clock of the currently programmed mode of the given pipe. */
|
||||
void i9xx_crtc_clock_get(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct i9xx_dpll_hw_state *hw_state = &crtc_state->dpll_hw_state.i9xx;
|
||||
u32 dpll = hw_state->dpll;
|
||||
u32 fp;
|
||||
@@ -436,7 +437,7 @@ void i9xx_crtc_clock_get(struct intel_crtc_state *crtc_state)
|
||||
fp = hw_state->fp1;
|
||||
|
||||
clock.m1 = (fp & FP_M1_DIV_MASK) >> FP_M1_DIV_SHIFT;
|
||||
if (IS_PINEVIEW(dev_priv)) {
|
||||
if (display->platform.pineview) {
|
||||
clock.n = ffs((fp & FP_N_PINEVIEW_DIV_MASK) >> FP_N_DIV_SHIFT) - 1;
|
||||
clock.m2 = (fp & FP_M2_PINEVIEW_DIV_MASK) >> FP_M2_DIV_SHIFT;
|
||||
} else {
|
||||
@@ -444,8 +445,8 @@ void i9xx_crtc_clock_get(struct intel_crtc_state *crtc_state)
|
||||
clock.m2 = (fp & FP_M2_DIV_MASK) >> FP_M2_DIV_SHIFT;
|
||||
}
|
||||
|
||||
if (DISPLAY_VER(dev_priv) != 2) {
|
||||
if (IS_PINEVIEW(dev_priv))
|
||||
if (DISPLAY_VER(display) != 2) {
|
||||
if (display->platform.pineview)
|
||||
clock.p1 = ffs((dpll & DPLL_FPA01_P1_POST_DIV_MASK_PINEVIEW) >>
|
||||
DPLL_FPA01_P1_POST_DIV_SHIFT_PINEVIEW);
|
||||
else
|
||||
@@ -462,23 +463,23 @@ void i9xx_crtc_clock_get(struct intel_crtc_state *crtc_state)
|
||||
7 : 14;
|
||||
break;
|
||||
default:
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Unknown DPLL mode %08x in programmed "
|
||||
"mode\n", (int)(dpll & DPLL_MODE_MASK));
|
||||
return;
|
||||
}
|
||||
|
||||
if (IS_PINEVIEW(dev_priv))
|
||||
if (display->platform.pineview)
|
||||
port_clock = pnv_calc_dpll_params(refclk, &clock);
|
||||
else
|
||||
port_clock = i9xx_calc_dpll_params(refclk, &clock);
|
||||
} else {
|
||||
enum pipe lvds_pipe;
|
||||
|
||||
if (IS_I85X(dev_priv) &&
|
||||
intel_lvds_port_enabled(dev_priv, LVDS, &lvds_pipe) &&
|
||||
if (display->platform.i85x &&
|
||||
intel_lvds_port_enabled(display, LVDS, &lvds_pipe) &&
|
||||
lvds_pipe == crtc->pipe) {
|
||||
u32 lvds = intel_de_read(dev_priv, LVDS);
|
||||
u32 lvds = intel_de_read(display, LVDS);
|
||||
|
||||
clock.p1 = ffs((dpll & DPLL_FPA01_P1_POST_DIV_MASK_I830_LVDS) >>
|
||||
DPLL_FPA01_P1_POST_DIV_SHIFT);
|
||||
@@ -577,7 +578,7 @@ void chv_crtc_clock_get(struct intel_crtc_state *crtc_state)
|
||||
* Returns whether the given set of divisors are valid for a given refclk with
|
||||
* the given connectors.
|
||||
*/
|
||||
static bool intel_pll_is_valid(struct drm_i915_private *dev_priv,
|
||||
static bool intel_pll_is_valid(struct intel_display *display,
|
||||
const struct intel_limit *limit,
|
||||
const struct dpll *clock)
|
||||
{
|
||||
@@ -590,14 +591,14 @@ static bool intel_pll_is_valid(struct drm_i915_private *dev_priv,
|
||||
if (clock->m1 < limit->m1.min || limit->m1.max < clock->m1)
|
||||
return false;
|
||||
|
||||
if (!IS_PINEVIEW(dev_priv) &&
|
||||
!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv) &&
|
||||
!IS_BROXTON(dev_priv) && !IS_GEMINILAKE(dev_priv))
|
||||
if (!display->platform.pineview &&
|
||||
!display->platform.valleyview && !display->platform.cherryview &&
|
||||
!display->platform.broxton && !display->platform.geminilake)
|
||||
if (clock->m1 <= clock->m2)
|
||||
return false;
|
||||
|
||||
if (!IS_VALLEYVIEW(dev_priv) && !IS_CHERRYVIEW(dev_priv) &&
|
||||
!IS_BROXTON(dev_priv) && !IS_GEMINILAKE(dev_priv)) {
|
||||
if (!display->platform.valleyview && !display->platform.cherryview &&
|
||||
!display->platform.broxton && !display->platform.geminilake) {
|
||||
if (clock->p < limit->p.min || limit->p.max < clock->p)
|
||||
return false;
|
||||
if (clock->m < limit->m.min || limit->m.max < clock->m)
|
||||
@@ -620,7 +621,7 @@ i9xx_select_p2_div(const struct intel_limit *limit,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
int target)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS)) {
|
||||
/*
|
||||
@@ -628,7 +629,7 @@ i9xx_select_p2_div(const struct intel_limit *limit,
|
||||
* We haven't figured out how to reliably set up different
|
||||
* single/dual channel state, if we even can.
|
||||
*/
|
||||
if (intel_is_dual_link_lvds(dev_priv))
|
||||
if (intel_is_dual_link_lvds(display))
|
||||
return limit->p2.p2_fast;
|
||||
else
|
||||
return limit->p2.p2_slow;
|
||||
@@ -656,7 +657,7 @@ i9xx_find_best_dpll(const struct intel_limit *limit,
|
||||
const struct dpll *match_clock,
|
||||
struct dpll *best_clock)
|
||||
{
|
||||
struct drm_device *dev = crtc_state->uapi.crtc->dev;
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct dpll clock;
|
||||
int err = target;
|
||||
|
||||
@@ -677,7 +678,7 @@ i9xx_find_best_dpll(const struct intel_limit *limit,
|
||||
int this_err;
|
||||
|
||||
i9xx_calc_dpll_params(refclk, &clock);
|
||||
if (!intel_pll_is_valid(to_i915(dev),
|
||||
if (!intel_pll_is_valid(display,
|
||||
limit,
|
||||
&clock))
|
||||
continue;
|
||||
@@ -714,7 +715,7 @@ pnv_find_best_dpll(const struct intel_limit *limit,
|
||||
const struct dpll *match_clock,
|
||||
struct dpll *best_clock)
|
||||
{
|
||||
struct drm_device *dev = crtc_state->uapi.crtc->dev;
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct dpll clock;
|
||||
int err = target;
|
||||
|
||||
@@ -733,7 +734,7 @@ pnv_find_best_dpll(const struct intel_limit *limit,
|
||||
int this_err;
|
||||
|
||||
pnv_calc_dpll_params(refclk, &clock);
|
||||
if (!intel_pll_is_valid(to_i915(dev),
|
||||
if (!intel_pll_is_valid(display,
|
||||
limit,
|
||||
&clock))
|
||||
continue;
|
||||
@@ -770,7 +771,7 @@ g4x_find_best_dpll(const struct intel_limit *limit,
|
||||
const struct dpll *match_clock,
|
||||
struct dpll *best_clock)
|
||||
{
|
||||
struct drm_device *dev = crtc_state->uapi.crtc->dev;
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct dpll clock;
|
||||
int max_n;
|
||||
bool found = false;
|
||||
@@ -794,7 +795,7 @@ g4x_find_best_dpll(const struct intel_limit *limit,
|
||||
int this_err;
|
||||
|
||||
i9xx_calc_dpll_params(refclk, &clock);
|
||||
if (!intel_pll_is_valid(to_i915(dev),
|
||||
if (!intel_pll_is_valid(display,
|
||||
limit,
|
||||
&clock))
|
||||
continue;
|
||||
@@ -817,7 +818,7 @@ g4x_find_best_dpll(const struct intel_limit *limit,
|
||||
* Check if the calculated PLL configuration is more optimal compared to the
|
||||
* best configuration and error found so far. Return the calculated error.
|
||||
*/
|
||||
static bool vlv_PLL_is_optimal(struct drm_device *dev, int target_freq,
|
||||
static bool vlv_PLL_is_optimal(struct intel_display *display, int target_freq,
|
||||
const struct dpll *calculated_clock,
|
||||
const struct dpll *best_clock,
|
||||
unsigned int best_error_ppm,
|
||||
@@ -827,13 +828,13 @@ static bool vlv_PLL_is_optimal(struct drm_device *dev, int target_freq,
|
||||
* For CHV ignore the error and consider only the P value.
|
||||
* Prefer a bigger P value based on HW requirements.
|
||||
*/
|
||||
if (IS_CHERRYVIEW(to_i915(dev))) {
|
||||
if (display->platform.cherryview) {
|
||||
*error_ppm = 0;
|
||||
|
||||
return calculated_clock->p > best_clock->p;
|
||||
}
|
||||
|
||||
if (drm_WARN_ON_ONCE(dev, !target_freq))
|
||||
if (drm_WARN_ON_ONCE(display->drm, !target_freq))
|
||||
return false;
|
||||
|
||||
*error_ppm = div_u64(1000000ULL *
|
||||
@@ -864,8 +865,7 @@ vlv_find_best_dpll(const struct intel_limit *limit,
|
||||
const struct dpll *match_clock,
|
||||
struct dpll *best_clock)
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_device *dev = crtc->base.dev;
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct dpll clock;
|
||||
unsigned int bestppm = 1000000;
|
||||
/* min update 19.2 MHz */
|
||||
@@ -889,12 +889,12 @@ vlv_find_best_dpll(const struct intel_limit *limit,
|
||||
|
||||
vlv_calc_dpll_params(refclk, &clock);
|
||||
|
||||
if (!intel_pll_is_valid(to_i915(dev),
|
||||
if (!intel_pll_is_valid(display,
|
||||
limit,
|
||||
&clock))
|
||||
continue;
|
||||
|
||||
if (!vlv_PLL_is_optimal(dev, target,
|
||||
if (!vlv_PLL_is_optimal(display, target,
|
||||
&clock,
|
||||
best_clock,
|
||||
bestppm, &ppm))
|
||||
@@ -922,8 +922,7 @@ chv_find_best_dpll(const struct intel_limit *limit,
|
||||
const struct dpll *match_clock,
|
||||
struct dpll *best_clock)
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_device *dev = crtc->base.dev;
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
unsigned int best_error_ppm;
|
||||
struct dpll clock;
|
||||
u64 m2;
|
||||
@@ -958,10 +957,10 @@ chv_find_best_dpll(const struct intel_limit *limit,
|
||||
|
||||
chv_calc_dpll_params(refclk, &clock);
|
||||
|
||||
if (!intel_pll_is_valid(to_i915(dev), limit, &clock))
|
||||
if (!intel_pll_is_valid(display, limit, &clock))
|
||||
continue;
|
||||
|
||||
if (!vlv_PLL_is_optimal(dev, target, &clock, best_clock,
|
||||
if (!vlv_PLL_is_optimal(display, target, &clock, best_clock,
|
||||
best_error_ppm, &error_ppm))
|
||||
continue;
|
||||
|
||||
@@ -1005,8 +1004,6 @@ static u32 i9xx_dpll(const struct intel_crtc_state *crtc_state,
|
||||
const struct dpll *reduced_clock)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
u32 dpll;
|
||||
|
||||
dpll = DPLL_VCO_ENABLE | DPLL_VGA_MODE_DIS;
|
||||
@@ -1016,8 +1013,8 @@ static u32 i9xx_dpll(const struct intel_crtc_state *crtc_state,
|
||||
else
|
||||
dpll |= DPLLB_MODE_DAC_SERIAL;
|
||||
|
||||
if (IS_I945G(dev_priv) || IS_I945GM(dev_priv) ||
|
||||
IS_G33(dev_priv) || IS_PINEVIEW(dev_priv)) {
|
||||
if (display->platform.i945g || display->platform.i945gm ||
|
||||
display->platform.g33 || display->platform.pineview) {
|
||||
dpll |= (crtc_state->pixel_multiplier - 1)
|
||||
<< SDVO_MULTIPLIER_SHIFT_HIRES;
|
||||
}
|
||||
@@ -1030,10 +1027,10 @@ static u32 i9xx_dpll(const struct intel_crtc_state *crtc_state,
|
||||
dpll |= DPLL_SDVO_HIGH_SPEED;
|
||||
|
||||
/* compute bitmask from p1 value */
|
||||
if (IS_G4X(dev_priv)) {
|
||||
if (display->platform.g4x) {
|
||||
dpll |= (1 << (clock->p1 - 1)) << DPLL_FPA01_P1_POST_DIV_SHIFT;
|
||||
dpll |= (1 << (reduced_clock->p1 - 1)) << DPLL_FPA1_P1_POST_DIV_SHIFT;
|
||||
} else if (IS_PINEVIEW(dev_priv)) {
|
||||
} else if (display->platform.pineview) {
|
||||
dpll |= (1 << (clock->p1 - 1)) << DPLL_FPA01_P1_POST_DIV_SHIFT_PINEVIEW;
|
||||
WARN_ON(reduced_clock->p1 != clock->p1);
|
||||
} else {
|
||||
@@ -1057,7 +1054,7 @@ static u32 i9xx_dpll(const struct intel_crtc_state *crtc_state,
|
||||
}
|
||||
WARN_ON(reduced_clock->p2 != clock->p2);
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 4)
|
||||
if (DISPLAY_VER(display) >= 4)
|
||||
dpll |= (6 << PLL_LOAD_PULSE_PHASE_SHIFT);
|
||||
|
||||
if (crtc_state->sdvo_tv_clock)
|
||||
@@ -1075,11 +1072,10 @@ static void i9xx_compute_dpll(struct intel_crtc_state *crtc_state,
|
||||
const struct dpll *clock,
|
||||
const struct dpll *reduced_clock)
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct i9xx_dpll_hw_state *hw_state = &crtc_state->dpll_hw_state.i9xx;
|
||||
|
||||
if (IS_PINEVIEW(dev_priv)) {
|
||||
if (display->platform.pineview) {
|
||||
hw_state->fp0 = pnv_dpll_compute_fp(clock);
|
||||
hw_state->fp1 = pnv_dpll_compute_fp(reduced_clock);
|
||||
} else {
|
||||
@@ -1089,7 +1085,7 @@ static void i9xx_compute_dpll(struct intel_crtc_state *crtc_state,
|
||||
|
||||
hw_state->dpll = i9xx_dpll(crtc_state, clock, reduced_clock);
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 4)
|
||||
if (DISPLAY_VER(display) >= 4)
|
||||
hw_state->dpll_md = i965_dpll_md(crtc_state);
|
||||
}
|
||||
|
||||
@@ -1098,8 +1094,6 @@ static u32 i8xx_dpll(const struct intel_crtc_state *crtc_state,
|
||||
const struct dpll *reduced_clock)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
u32 dpll;
|
||||
|
||||
dpll = DPLL_VCO_ENABLE | DPLL_VGA_MODE_DIS;
|
||||
@@ -1129,7 +1123,7 @@ static u32 i8xx_dpll(const struct intel_crtc_state *crtc_state,
|
||||
* both DPLLS. The spec says we should disable the DVO 2X clock
|
||||
* when not needed, but this seems to work fine in practice.
|
||||
*/
|
||||
if (IS_I830(dev_priv) ||
|
||||
if (display->platform.i830 ||
|
||||
intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DVO))
|
||||
dpll |= DPLL_DVO_2X_MODE;
|
||||
|
||||
@@ -1157,14 +1151,14 @@ static void i8xx_compute_dpll(struct intel_crtc_state *crtc_state,
|
||||
static int hsw_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
struct intel_encoder *encoder =
|
||||
intel_get_crtc_new_encoder(state, crtc_state);
|
||||
int ret;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) < 11 &&
|
||||
if (DISPLAY_VER(display) < 11 &&
|
||||
intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI))
|
||||
return 0;
|
||||
|
||||
@@ -1186,13 +1180,13 @@ static int hsw_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
static int hsw_crtc_get_shared_dpll(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
struct intel_encoder *encoder =
|
||||
intel_get_crtc_new_encoder(state, crtc_state);
|
||||
|
||||
if (DISPLAY_VER(dev_priv) < 11 &&
|
||||
if (DISPLAY_VER(display) < 11 &&
|
||||
intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI))
|
||||
return 0;
|
||||
|
||||
@@ -1245,8 +1239,8 @@ static int ilk_fb_cb_factor(const struct intel_crtc_state *crtc_state)
|
||||
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS) &&
|
||||
((intel_panel_use_ssc(display) && i915->display.vbt.lvds_ssc_freq == 100000) ||
|
||||
(HAS_PCH_IBX(i915) && intel_is_dual_link_lvds(i915))))
|
||||
((intel_panel_use_ssc(display) && display->vbt.lvds_ssc_freq == 100000) ||
|
||||
(HAS_PCH_IBX(i915) && intel_is_dual_link_lvds(display))))
|
||||
return 25;
|
||||
|
||||
if (crtc_state->sdvo_tv_clock)
|
||||
@@ -1276,8 +1270,6 @@ static u32 ilk_dpll(const struct intel_crtc_state *crtc_state,
|
||||
const struct dpll *reduced_clock)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
u32 dpll;
|
||||
|
||||
dpll = DPLL_VCO_ENABLE;
|
||||
@@ -1311,7 +1303,7 @@ static u32 ilk_dpll(const struct intel_crtc_state *crtc_state,
|
||||
* clear if it''s a win or loss power wise. No point in doing
|
||||
* this on ILK at all since it has a fixed DPLL<->pipe mapping.
|
||||
*/
|
||||
if (INTEL_NUM_PIPES(dev_priv) == 3 &&
|
||||
if (INTEL_NUM_PIPES(display) == 3 &&
|
||||
intel_crtc_has_type(crtc_state, INTEL_OUTPUT_ANALOG))
|
||||
dpll |= DPLL_SDVO_HIGH_SPEED;
|
||||
|
||||
@@ -1362,7 +1354,6 @@ static int ilk_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
const struct intel_limit *limit;
|
||||
@@ -1375,13 +1366,13 @@ static int ilk_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS)) {
|
||||
if (intel_panel_use_ssc(display)) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"using SSC reference clock of %d kHz\n",
|
||||
dev_priv->display.vbt.lvds_ssc_freq);
|
||||
refclk = dev_priv->display.vbt.lvds_ssc_freq;
|
||||
display->vbt.lvds_ssc_freq);
|
||||
refclk = display->vbt.lvds_ssc_freq;
|
||||
}
|
||||
|
||||
if (intel_is_dual_link_lvds(dev_priv)) {
|
||||
if (intel_is_dual_link_lvds(display)) {
|
||||
if (refclk == 100000)
|
||||
limit = &ilk_limits_dual_lvds_100m;
|
||||
else
|
||||
@@ -1539,7 +1530,6 @@ static int g4x_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
const struct intel_limit *limit;
|
||||
@@ -1547,13 +1537,13 @@ static int g4x_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS)) {
|
||||
if (intel_panel_use_ssc(display)) {
|
||||
refclk = dev_priv->display.vbt.lvds_ssc_freq;
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
refclk = display->vbt.lvds_ssc_freq;
|
||||
drm_dbg_kms(display->drm,
|
||||
"using SSC reference clock of %d kHz\n",
|
||||
refclk);
|
||||
}
|
||||
|
||||
if (intel_is_dual_link_lvds(dev_priv))
|
||||
if (intel_is_dual_link_lvds(display))
|
||||
limit = &intel_limits_g4x_dual_channel_lvds;
|
||||
else
|
||||
limit = &intel_limits_g4x_single_channel_lvds;
|
||||
@@ -1589,7 +1579,6 @@ static int pnv_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
const struct intel_limit *limit;
|
||||
@@ -1597,8 +1586,8 @@ static int pnv_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS)) {
|
||||
if (intel_panel_use_ssc(display)) {
|
||||
refclk = dev_priv->display.vbt.lvds_ssc_freq;
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
refclk = display->vbt.lvds_ssc_freq;
|
||||
drm_dbg_kms(display->drm,
|
||||
"using SSC reference clock of %d kHz\n",
|
||||
refclk);
|
||||
}
|
||||
@@ -1628,7 +1617,6 @@ static int i9xx_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
const struct intel_limit *limit;
|
||||
@@ -1636,8 +1624,8 @@ static int i9xx_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS)) {
|
||||
if (intel_panel_use_ssc(display)) {
|
||||
refclk = dev_priv->display.vbt.lvds_ssc_freq;
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
refclk = display->vbt.lvds_ssc_freq;
|
||||
drm_dbg_kms(display->drm,
|
||||
"using SSC reference clock of %d kHz\n",
|
||||
refclk);
|
||||
}
|
||||
@@ -1669,7 +1657,6 @@ static int i8xx_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
const struct intel_limit *limit;
|
||||
@@ -1677,8 +1664,8 @@ static int i8xx_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
|
||||
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_LVDS)) {
|
||||
if (intel_panel_use_ssc(display)) {
|
||||
refclk = dev_priv->display.vbt.lvds_ssc_freq;
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
refclk = display->vbt.lvds_ssc_freq;
|
||||
drm_dbg_kms(display->drm,
|
||||
"using SSC reference clock of %d kHz\n",
|
||||
refclk);
|
||||
}
|
||||
@@ -1751,12 +1738,12 @@ static const struct intel_dpll_funcs i8xx_dpll_funcs = {
|
||||
int intel_dpll_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
int ret;
|
||||
|
||||
drm_WARN_ON(&i915->drm, !intel_crtc_needs_modeset(crtc_state));
|
||||
drm_WARN_ON(display->drm, !intel_crtc_needs_modeset(crtc_state));
|
||||
|
||||
memset(&crtc_state->dpll_hw_state, 0,
|
||||
sizeof(crtc_state->dpll_hw_state));
|
||||
@@ -1764,9 +1751,9 @@ int intel_dpll_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
if (!crtc_state->hw.enable)
|
||||
return 0;
|
||||
|
||||
ret = i915->display.funcs.dpll->crtc_compute_clock(state, crtc);
|
||||
ret = display->funcs.dpll->crtc_compute_clock(state, crtc);
|
||||
if (ret) {
|
||||
drm_dbg_kms(&i915->drm, "[CRTC:%d:%s] Couldn't calculate DPLL settings\n",
|
||||
drm_dbg_kms(display->drm, "[CRTC:%d:%s] Couldn't calculate DPLL settings\n",
|
||||
crtc->base.base.id, crtc->base.name);
|
||||
return ret;
|
||||
}
|
||||
@@ -1777,23 +1764,23 @@ int intel_dpll_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
int intel_dpll_crtc_get_shared_dpll(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
int ret;
|
||||
|
||||
drm_WARN_ON(&i915->drm, !intel_crtc_needs_modeset(crtc_state));
|
||||
drm_WARN_ON(&i915->drm, !crtc_state->hw.enable && crtc_state->shared_dpll);
|
||||
drm_WARN_ON(display->drm, !intel_crtc_needs_modeset(crtc_state));
|
||||
drm_WARN_ON(display->drm, !crtc_state->hw.enable && crtc_state->shared_dpll);
|
||||
|
||||
if (!crtc_state->hw.enable || crtc_state->shared_dpll)
|
||||
return 0;
|
||||
|
||||
if (!i915->display.funcs.dpll->crtc_get_shared_dpll)
|
||||
if (!display->funcs.dpll->crtc_get_shared_dpll)
|
||||
return 0;
|
||||
|
||||
ret = i915->display.funcs.dpll->crtc_get_shared_dpll(state, crtc);
|
||||
ret = display->funcs.dpll->crtc_get_shared_dpll(state, crtc);
|
||||
if (ret) {
|
||||
drm_dbg_kms(&i915->drm, "[CRTC:%d:%s] Couldn't get a shared DPLL\n",
|
||||
drm_dbg_kms(display->drm, "[CRTC:%d:%s] Couldn't get a shared DPLL\n",
|
||||
crtc->base.base.id, crtc->base.name);
|
||||
return ret;
|
||||
}
|
||||
@@ -1802,43 +1789,44 @@ int intel_dpll_crtc_get_shared_dpll(struct intel_atomic_state *state,
|
||||
}
|
||||
|
||||
void
|
||||
intel_dpll_init_clock_hook(struct drm_i915_private *dev_priv)
|
||||
intel_dpll_init_clock_hook(struct intel_display *display)
|
||||
{
|
||||
if (DISPLAY_VER(dev_priv) >= 14)
|
||||
dev_priv->display.funcs.dpll = &mtl_dpll_funcs;
|
||||
else if (IS_DG2(dev_priv))
|
||||
dev_priv->display.funcs.dpll = &dg2_dpll_funcs;
|
||||
else if (DISPLAY_VER(dev_priv) >= 9 || HAS_DDI(dev_priv))
|
||||
dev_priv->display.funcs.dpll = &hsw_dpll_funcs;
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
if (DISPLAY_VER(display) >= 14)
|
||||
display->funcs.dpll = &mtl_dpll_funcs;
|
||||
else if (display->platform.dg2)
|
||||
display->funcs.dpll = &dg2_dpll_funcs;
|
||||
else if (DISPLAY_VER(display) >= 9 || HAS_DDI(display))
|
||||
display->funcs.dpll = &hsw_dpll_funcs;
|
||||
else if (HAS_PCH_SPLIT(dev_priv))
|
||||
dev_priv->display.funcs.dpll = &ilk_dpll_funcs;
|
||||
else if (IS_CHERRYVIEW(dev_priv))
|
||||
dev_priv->display.funcs.dpll = &chv_dpll_funcs;
|
||||
else if (IS_VALLEYVIEW(dev_priv))
|
||||
dev_priv->display.funcs.dpll = &vlv_dpll_funcs;
|
||||
else if (IS_G4X(dev_priv))
|
||||
dev_priv->display.funcs.dpll = &g4x_dpll_funcs;
|
||||
else if (IS_PINEVIEW(dev_priv))
|
||||
dev_priv->display.funcs.dpll = &pnv_dpll_funcs;
|
||||
else if (DISPLAY_VER(dev_priv) != 2)
|
||||
dev_priv->display.funcs.dpll = &i9xx_dpll_funcs;
|
||||
display->funcs.dpll = &ilk_dpll_funcs;
|
||||
else if (display->platform.cherryview)
|
||||
display->funcs.dpll = &chv_dpll_funcs;
|
||||
else if (display->platform.valleyview)
|
||||
display->funcs.dpll = &vlv_dpll_funcs;
|
||||
else if (display->platform.g4x)
|
||||
display->funcs.dpll = &g4x_dpll_funcs;
|
||||
else if (display->platform.pineview)
|
||||
display->funcs.dpll = &pnv_dpll_funcs;
|
||||
else if (DISPLAY_VER(display) != 2)
|
||||
display->funcs.dpll = &i9xx_dpll_funcs;
|
||||
else
|
||||
dev_priv->display.funcs.dpll = &i8xx_dpll_funcs;
|
||||
display->funcs.dpll = &i8xx_dpll_funcs;
|
||||
}
|
||||
|
||||
static bool i9xx_has_pps(struct drm_i915_private *dev_priv)
|
||||
static bool i9xx_has_pps(struct intel_display *display)
|
||||
{
|
||||
if (IS_I830(dev_priv))
|
||||
if (display->platform.i830)
|
||||
return false;
|
||||
|
||||
return IS_PINEVIEW(dev_priv) || IS_MOBILE(dev_priv);
|
||||
return display->platform.pineview || display->platform.mobile;
|
||||
}
|
||||
|
||||
void i9xx_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct i9xx_dpll_hw_state *hw_state = &crtc_state->dpll_hw_state.i9xx;
|
||||
enum pipe pipe = crtc->pipe;
|
||||
int i;
|
||||
@@ -1846,27 +1834,27 @@ void i9xx_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
assert_transcoder_disabled(display, crtc_state->cpu_transcoder);
|
||||
|
||||
/* PLL is protected by panel, make sure we can write it */
|
||||
if (i9xx_has_pps(dev_priv))
|
||||
if (i9xx_has_pps(display))
|
||||
assert_pps_unlocked(display, pipe);
|
||||
|
||||
intel_de_write(dev_priv, FP0(pipe), hw_state->fp0);
|
||||
intel_de_write(dev_priv, FP1(pipe), hw_state->fp1);
|
||||
intel_de_write(display, FP0(pipe), hw_state->fp0);
|
||||
intel_de_write(display, FP1(pipe), hw_state->fp1);
|
||||
|
||||
/*
|
||||
* Apparently we need to have VGA mode enabled prior to changing
|
||||
* the P1/P2 dividers. Otherwise the DPLL will keep using the old
|
||||
* dividers, even though the register value does change.
|
||||
*/
|
||||
intel_de_write(dev_priv, DPLL(dev_priv, pipe),
|
||||
intel_de_write(display, DPLL(display, pipe),
|
||||
hw_state->dpll & ~DPLL_VGA_MODE_DIS);
|
||||
intel_de_write(dev_priv, DPLL(dev_priv, pipe), hw_state->dpll);
|
||||
intel_de_write(display, DPLL(display, pipe), hw_state->dpll);
|
||||
|
||||
/* Wait for the clocks to stabilize. */
|
||||
intel_de_posting_read(dev_priv, DPLL(dev_priv, pipe));
|
||||
intel_de_posting_read(display, DPLL(display, pipe));
|
||||
udelay(150);
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 4) {
|
||||
intel_de_write(dev_priv, DPLL_MD(dev_priv, pipe),
|
||||
if (DISPLAY_VER(display) >= 4) {
|
||||
intel_de_write(display, DPLL_MD(display, pipe),
|
||||
hw_state->dpll_md);
|
||||
} else {
|
||||
/* The pixel multiplier can only be updated once the
|
||||
@@ -1874,20 +1862,21 @@ void i9xx_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
*
|
||||
* So write it again.
|
||||
*/
|
||||
intel_de_write(dev_priv, DPLL(dev_priv, pipe), hw_state->dpll);
|
||||
intel_de_write(display, DPLL(display, pipe), hw_state->dpll);
|
||||
}
|
||||
|
||||
/* We do this three times for luck */
|
||||
for (i = 0; i < 3; i++) {
|
||||
intel_de_write(dev_priv, DPLL(dev_priv, pipe), hw_state->dpll);
|
||||
intel_de_posting_read(dev_priv, DPLL(dev_priv, pipe));
|
||||
intel_de_write(display, DPLL(display, pipe), hw_state->dpll);
|
||||
intel_de_posting_read(display, DPLL(display, pipe));
|
||||
udelay(150); /* wait for warmup */
|
||||
}
|
||||
}
|
||||
|
||||
static void vlv_pllb_recal_opamp(struct drm_i915_private *dev_priv,
|
||||
static void vlv_pllb_recal_opamp(struct intel_display *display,
|
||||
enum dpio_phy phy, enum dpio_channel ch)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
u32 tmp;
|
||||
|
||||
/*
|
||||
@@ -1916,6 +1905,7 @@ static void vlv_pllb_recal_opamp(struct drm_i915_private *dev_priv,
|
||||
|
||||
static void vlv_prepare_pll(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct dpll *clock = &crtc_state->dpll;
|
||||
@@ -1930,7 +1920,7 @@ static void vlv_prepare_pll(const struct intel_crtc_state *crtc_state)
|
||||
|
||||
/* PLL B needs special handling */
|
||||
if (pipe == PIPE_B)
|
||||
vlv_pllb_recal_opamp(dev_priv, phy, ch);
|
||||
vlv_pllb_recal_opamp(display, phy, ch);
|
||||
|
||||
/* Set up Tx target for periodic Rcomp update */
|
||||
vlv_dpio_write(dev_priv, phy, VLV_PCS_DW17_BCAST, 0x0100000f);
|
||||
@@ -2003,24 +1993,23 @@ static void vlv_prepare_pll(const struct intel_crtc_state *crtc_state)
|
||||
|
||||
static void _vlv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct i9xx_dpll_hw_state *hw_state = &crtc_state->dpll_hw_state.i9xx;
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
intel_de_write(dev_priv, DPLL(dev_priv, pipe), hw_state->dpll);
|
||||
intel_de_posting_read(dev_priv, DPLL(dev_priv, pipe));
|
||||
intel_de_write(display, DPLL(display, pipe), hw_state->dpll);
|
||||
intel_de_posting_read(display, DPLL(display, pipe));
|
||||
udelay(150);
|
||||
|
||||
if (intel_de_wait_for_set(dev_priv, DPLL(dev_priv, pipe), DPLL_LOCK_VLV, 1))
|
||||
drm_err(&dev_priv->drm, "DPLL %d failed to lock\n", pipe);
|
||||
if (intel_de_wait_for_set(display, DPLL(display, pipe), DPLL_LOCK_VLV, 1))
|
||||
drm_err(display->drm, "DPLL %d failed to lock\n", pipe);
|
||||
}
|
||||
|
||||
void vlv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct i9xx_dpll_hw_state *hw_state = &crtc_state->dpll_hw_state.i9xx;
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
@@ -2030,7 +2019,7 @@ void vlv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
assert_pps_unlocked(display, pipe);
|
||||
|
||||
/* Enable Refclk */
|
||||
intel_de_write(dev_priv, DPLL(dev_priv, pipe),
|
||||
intel_de_write(display, DPLL(display, pipe),
|
||||
hw_state->dpll & ~(DPLL_VCO_ENABLE | DPLL_EXT_BUFFER_ENABLE_VLV));
|
||||
|
||||
if (hw_state->dpll & DPLL_VCO_ENABLE) {
|
||||
@@ -2038,8 +2027,8 @@ void vlv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
_vlv_enable_pll(crtc_state);
|
||||
}
|
||||
|
||||
intel_de_write(dev_priv, DPLL_MD(dev_priv, pipe), hw_state->dpll_md);
|
||||
intel_de_posting_read(dev_priv, DPLL_MD(dev_priv, pipe));
|
||||
intel_de_write(display, DPLL_MD(display, pipe), hw_state->dpll_md);
|
||||
intel_de_posting_read(display, DPLL_MD(display, pipe));
|
||||
}
|
||||
|
||||
static void chv_prepare_pll(const struct intel_crtc_state *crtc_state)
|
||||
@@ -2133,6 +2122,7 @@ static void chv_prepare_pll(const struct intel_crtc_state *crtc_state)
|
||||
|
||||
static void _chv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct i9xx_dpll_hw_state *hw_state = &crtc_state->dpll_hw_state.i9xx;
|
||||
@@ -2156,18 +2146,17 @@ static void _chv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
udelay(1);
|
||||
|
||||
/* Enable PLL */
|
||||
intel_de_write(dev_priv, DPLL(dev_priv, pipe), hw_state->dpll);
|
||||
intel_de_write(display, DPLL(display, pipe), hw_state->dpll);
|
||||
|
||||
/* Check PLL is locked */
|
||||
if (intel_de_wait_for_set(dev_priv, DPLL(dev_priv, pipe), DPLL_LOCK_VLV, 1))
|
||||
drm_err(&dev_priv->drm, "PLL %d failed to lock\n", pipe);
|
||||
if (intel_de_wait_for_set(display, DPLL(display, pipe), DPLL_LOCK_VLV, 1))
|
||||
drm_err(display->drm, "PLL %d failed to lock\n", pipe);
|
||||
}
|
||||
|
||||
void chv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct i9xx_dpll_hw_state *hw_state = &crtc_state->dpll_hw_state.i9xx;
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
@@ -2177,7 +2166,7 @@ void chv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
assert_pps_unlocked(display, pipe);
|
||||
|
||||
/* Enable Refclk and SSC */
|
||||
intel_de_write(dev_priv, DPLL(dev_priv, pipe),
|
||||
intel_de_write(display, DPLL(display, pipe),
|
||||
hw_state->dpll & ~DPLL_VCO_ENABLE);
|
||||
|
||||
if (hw_state->dpll & DPLL_VCO_ENABLE) {
|
||||
@@ -2192,29 +2181,29 @@ void chv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
* DPLLCMD is AWOL. Use chicken bits to propagate
|
||||
* the value from DPLLBMD to either pipe B or C.
|
||||
*/
|
||||
intel_de_write(dev_priv, CBR4_VLV, CBR_DPLLBMD_PIPE(pipe));
|
||||
intel_de_write(dev_priv, DPLL_MD(dev_priv, PIPE_B),
|
||||
intel_de_write(display, CBR4_VLV, CBR_DPLLBMD_PIPE(pipe));
|
||||
intel_de_write(display, DPLL_MD(display, PIPE_B),
|
||||
hw_state->dpll_md);
|
||||
intel_de_write(dev_priv, CBR4_VLV, 0);
|
||||
dev_priv->display.state.chv_dpll_md[pipe] = hw_state->dpll_md;
|
||||
intel_de_write(display, CBR4_VLV, 0);
|
||||
display->state.chv_dpll_md[pipe] = hw_state->dpll_md;
|
||||
|
||||
/*
|
||||
* DPLLB VGA mode also seems to cause problems.
|
||||
* We should always have it disabled.
|
||||
*/
|
||||
drm_WARN_ON(&dev_priv->drm,
|
||||
(intel_de_read(dev_priv, DPLL(dev_priv, PIPE_B)) &
|
||||
drm_WARN_ON(display->drm,
|
||||
(intel_de_read(display, DPLL(display, PIPE_B)) &
|
||||
DPLL_VGA_MODE_DIS) == 0);
|
||||
} else {
|
||||
intel_de_write(dev_priv, DPLL_MD(dev_priv, pipe),
|
||||
intel_de_write(display, DPLL_MD(display, pipe),
|
||||
hw_state->dpll_md);
|
||||
intel_de_posting_read(dev_priv, DPLL_MD(dev_priv, pipe));
|
||||
intel_de_posting_read(display, DPLL_MD(display, pipe));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* vlv_force_pll_on - forcibly enable just the PLL
|
||||
* @dev_priv: i915 private structure
|
||||
* @display: display device
|
||||
* @pipe: pipe PLL to enable
|
||||
* @dpll: PLL configuration
|
||||
*
|
||||
@@ -2222,10 +2211,9 @@ void chv_enable_pll(const struct intel_crtc_state *crtc_state)
|
||||
* in cases where we need the PLL enabled even when @pipe is not going to
|
||||
* be enabled.
|
||||
*/
|
||||
int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
|
||||
int vlv_force_pll_on(struct intel_display *display, enum pipe pipe,
|
||||
const struct dpll *dpll)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct intel_crtc *crtc = intel_crtc_for_pipe(display, pipe);
|
||||
struct intel_crtc_state *crtc_state;
|
||||
|
||||
@@ -2238,7 +2226,7 @@ int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
|
||||
crtc_state->dpll = *dpll;
|
||||
crtc_state->output_types = BIT(INTEL_OUTPUT_EDP);
|
||||
|
||||
if (IS_CHERRYVIEW(dev_priv)) {
|
||||
if (display->platform.cherryview) {
|
||||
chv_compute_dpll(crtc_state);
|
||||
chv_enable_pll(crtc_state);
|
||||
} else {
|
||||
@@ -2251,9 +2239,8 @@ int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
|
||||
return 0;
|
||||
}
|
||||
|
||||
void vlv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
void vlv_disable_pll(struct intel_display *display, enum pipe pipe)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
u32 val;
|
||||
|
||||
/* Make sure the pipe isn't still relying on us */
|
||||
@@ -2268,9 +2255,9 @@ void vlv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
intel_de_posting_read(display, DPLL(display, pipe));
|
||||
}
|
||||
|
||||
void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
void chv_disable_pll(struct intel_display *display, enum pipe pipe)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum dpio_channel ch = vlv_pipe_to_channel(pipe);
|
||||
enum dpio_phy phy = vlv_pipe_to_phy(pipe);
|
||||
u32 val;
|
||||
@@ -2316,18 +2303,18 @@ void i9xx_disable_pll(const struct intel_crtc_state *crtc_state)
|
||||
|
||||
/**
|
||||
* vlv_force_pll_off - forcibly disable just the PLL
|
||||
* @dev_priv: i915 private structure
|
||||
* @display: display device
|
||||
* @pipe: pipe PLL to disable
|
||||
*
|
||||
* Disable the PLL for @pipe. To be used in cases where we need
|
||||
* the PLL enabled even when @pipe is not going to be enabled.
|
||||
*/
|
||||
void vlv_force_pll_off(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||
void vlv_force_pll_off(struct intel_display *display, enum pipe pipe)
|
||||
{
|
||||
if (IS_CHERRYVIEW(dev_priv))
|
||||
chv_disable_pll(dev_priv, pipe);
|
||||
if (display->platform.cherryview)
|
||||
chv_disable_pll(display, pipe);
|
||||
else
|
||||
vlv_disable_pll(dev_priv, pipe);
|
||||
vlv_disable_pll(display, pipe);
|
||||
}
|
||||
|
||||
/* Only for pre-ILK configs */
|
||||
|
||||
@@ -8,16 +8,15 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
enum pipe;
|
||||
struct dpll;
|
||||
struct drm_i915_private;
|
||||
struct intel_atomic_state;
|
||||
struct intel_crtc;
|
||||
struct intel_crtc_state;
|
||||
struct intel_display;
|
||||
struct intel_dpll_hw_state;
|
||||
enum pipe;
|
||||
|
||||
void intel_dpll_init_clock_hook(struct drm_i915_private *dev_priv);
|
||||
void intel_dpll_init_clock_hook(struct intel_display *display);
|
||||
int intel_dpll_crtc_compute_clock(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc);
|
||||
int intel_dpll_crtc_get_shared_dpll(struct intel_atomic_state *state,
|
||||
@@ -29,14 +28,14 @@ void i9xx_dpll_get_hw_state(struct intel_crtc *crtc,
|
||||
void vlv_compute_dpll(struct intel_crtc_state *crtc_state);
|
||||
void chv_compute_dpll(struct intel_crtc_state *crtc_state);
|
||||
|
||||
int vlv_force_pll_on(struct drm_i915_private *dev_priv, enum pipe pipe,
|
||||
int vlv_force_pll_on(struct intel_display *display, enum pipe pipe,
|
||||
const struct dpll *dpll);
|
||||
void vlv_force_pll_off(struct drm_i915_private *dev_priv, enum pipe pipe);
|
||||
void vlv_force_pll_off(struct intel_display *display, enum pipe pipe);
|
||||
|
||||
void chv_enable_pll(const struct intel_crtc_state *crtc_state);
|
||||
void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe);
|
||||
void chv_disable_pll(struct intel_display *display, enum pipe pipe);
|
||||
void vlv_enable_pll(const struct intel_crtc_state *crtc_state);
|
||||
void vlv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe);
|
||||
void vlv_disable_pll(struct intel_display *display, enum pipe pipe);
|
||||
void i9xx_enable_pll(const struct intel_crtc_state *crtc_state);
|
||||
void i9xx_disable_pll(const struct intel_crtc_state *crtc_state);
|
||||
bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state,
|
||||
|
||||
@@ -257,7 +257,7 @@ void intel_enable_shared_dpll(const struct intel_crtc_state *crtc_state)
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct intel_shared_dpll *pll = crtc_state->shared_dpll;
|
||||
unsigned int pipe_mask = BIT(crtc->pipe);
|
||||
unsigned int pipe_mask = intel_crtc_joined_pipe_mask(crtc_state);
|
||||
unsigned int old_mask;
|
||||
|
||||
if (drm_WARN_ON(display->drm, !pll))
|
||||
@@ -303,7 +303,7 @@ void intel_disable_shared_dpll(const struct intel_crtc_state *crtc_state)
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct intel_shared_dpll *pll = crtc_state->shared_dpll;
|
||||
unsigned int pipe_mask = BIT(crtc->pipe);
|
||||
unsigned int pipe_mask = intel_crtc_joined_pipe_mask(crtc_state);
|
||||
|
||||
/* PCH only available on ILK+ */
|
||||
if (DISPLAY_VER(display) < 5)
|
||||
@@ -715,7 +715,6 @@ static void hsw_ddi_spll_enable(struct intel_display *display,
|
||||
static void hsw_ddi_wrpll_disable(struct intel_display *display,
|
||||
struct intel_shared_dpll *pll)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
const enum intel_dpll_id id = pll->info->id;
|
||||
|
||||
intel_de_rmw(display, WRPLL_CTL(id), WRPLL_PLL_ENABLE, 0);
|
||||
@@ -726,13 +725,12 @@ static void hsw_ddi_wrpll_disable(struct intel_display *display,
|
||||
* that depend on it have been shut down.
|
||||
*/
|
||||
if (display->dpll.pch_ssc_use & BIT(id))
|
||||
intel_init_pch_refclk(i915);
|
||||
intel_init_pch_refclk(display);
|
||||
}
|
||||
|
||||
static void hsw_ddi_spll_disable(struct intel_display *display,
|
||||
struct intel_shared_dpll *pll)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
enum intel_dpll_id id = pll->info->id;
|
||||
|
||||
intel_de_rmw(display, SPLL_CTL, SPLL_PLL_ENABLE, 0);
|
||||
@@ -743,7 +741,7 @@ static void hsw_ddi_spll_disable(struct intel_display *display,
|
||||
* that depend on it have been shut down.
|
||||
*/
|
||||
if (display->dpll.pch_ssc_use & BIT(id))
|
||||
intel_init_pch_refclk(i915);
|
||||
intel_init_pch_refclk(display);
|
||||
}
|
||||
|
||||
static bool hsw_ddi_wrpll_get_hw_state(struct intel_display *display,
|
||||
@@ -2606,10 +2604,8 @@ ehl_combo_pll_div_frac_wa_needed(struct intel_display *display)
|
||||
{
|
||||
return ((display->platform.elkhartlake &&
|
||||
IS_DISPLAY_STEP(display, STEP_B0, STEP_FOREVER)) ||
|
||||
display->platform.tigerlake ||
|
||||
display->platform.alderlake_s ||
|
||||
display->platform.alderlake_p) &&
|
||||
display->dpll.ref_clks.nssc == 38400;
|
||||
DISPLAY_VER(display) >= 12) &&
|
||||
display->dpll.ref_clks.nssc == 38400;
|
||||
}
|
||||
|
||||
struct icl_combo_pll_params {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "gt/gen8_ppgtt.h"
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dpt.h"
|
||||
#include "intel_fb.h"
|
||||
@@ -127,7 +128,7 @@ struct i915_vma *intel_dpt_pin_to_ggtt(struct i915_address_space *vm,
|
||||
struct drm_i915_private *i915 = vm->i915;
|
||||
struct intel_display *display = &i915->display;
|
||||
struct i915_dpt *dpt = i915_vm_to_dpt(vm);
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
struct i915_vma *vma;
|
||||
void __iomem *iomem;
|
||||
struct i915_gem_ww_ctx ww;
|
||||
@@ -137,7 +138,7 @@ struct i915_vma *intel_dpt_pin_to_ggtt(struct i915_address_space *vm,
|
||||
if (i915_gem_object_is_stolen(dpt->obj))
|
||||
pin_flags |= PIN_MAPPABLE;
|
||||
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
atomic_inc(&display->restore.pending_fb_pin);
|
||||
|
||||
for_i915_gem_ww(&ww, err, true) {
|
||||
@@ -169,7 +170,7 @@ struct i915_vma *intel_dpt_pin_to_ggtt(struct i915_address_space *vm,
|
||||
dpt->obj->mm.dirty = true;
|
||||
|
||||
atomic_dec(&display->restore.pending_fb_pin);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
|
||||
return err ? ERR_PTR(err) : vma;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "i915_reg.h"
|
||||
#include "intel_crtc.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dsb.h"
|
||||
#include "intel_dsb_buffer.h"
|
||||
@@ -142,10 +143,10 @@ static int dsb_vtotal(struct intel_atomic_state *state,
|
||||
static int dsb_dewake_scanline_start(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
const struct intel_crtc_state *crtc_state =
|
||||
intel_pre_commit_crtc_state(state, crtc);
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
unsigned int latency = skl_watermark_max_latency(i915, 0);
|
||||
unsigned int latency = skl_watermark_max_latency(display, 0);
|
||||
|
||||
return intel_mode_vdisplay(&crtc_state->hw.adjusted_mode) -
|
||||
intel_usecs_to_scanlines(&crtc_state->hw.adjusted_mode, latency);
|
||||
@@ -795,22 +796,22 @@ struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state,
|
||||
enum intel_dsb_id dsb_id,
|
||||
unsigned int max_cmds)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
intel_wakeref_t wakeref;
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct ref_tracker *wakeref;
|
||||
struct intel_dsb *dsb;
|
||||
unsigned int size;
|
||||
|
||||
if (!HAS_DSB(i915))
|
||||
if (!HAS_DSB(display))
|
||||
return NULL;
|
||||
|
||||
if (!i915->display.params.enable_dsb)
|
||||
if (!display->params.enable_dsb)
|
||||
return NULL;
|
||||
|
||||
dsb = kzalloc(sizeof(*dsb), GFP_KERNEL);
|
||||
if (!dsb)
|
||||
goto out;
|
||||
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
|
||||
/* ~1 qword per instruction, full cachelines */
|
||||
size = ALIGN(max_cmds * 8, CACHELINE_BYTES);
|
||||
@@ -818,7 +819,7 @@ struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state,
|
||||
if (!intel_dsb_buffer_create(crtc, &dsb->dsb_buf, size))
|
||||
goto out_put_rpm;
|
||||
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
|
||||
dsb->id = dsb_id;
|
||||
dsb->crtc = crtc;
|
||||
@@ -831,10 +832,10 @@ struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state,
|
||||
return dsb;
|
||||
|
||||
out_put_rpm:
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
kfree(dsb);
|
||||
out:
|
||||
drm_info_once(&i915->drm,
|
||||
drm_info_once(display->drm,
|
||||
"[CRTC:%d:%s] DSB %d queue setup failed, will fallback to MMIO for display HW programming\n",
|
||||
crtc->base.base.id, crtc->base.name, dsb_id);
|
||||
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
*/
|
||||
|
||||
#include <drm/drm_mipi_dsi.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <video/mipi_display.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_display_core.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dsi.h"
|
||||
#include "intel_dsi_dcs_backlight.h"
|
||||
@@ -162,7 +163,7 @@ static void dcs_enable_backlight(const struct intel_crtc_state *crtc_state,
|
||||
static int dcs_setup_backlight(struct intel_connector *connector,
|
||||
enum pipe unused)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
struct intel_panel *panel = &connector->panel;
|
||||
|
||||
if (panel->vbt.backlight.brightness_precision_bits > 8)
|
||||
@@ -172,7 +173,7 @@ static int dcs_setup_backlight(struct intel_connector *connector,
|
||||
|
||||
panel->backlight.level = panel->backlight.max;
|
||||
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"[CONNECTOR:%d:%s] Using DCS for backlight control\n",
|
||||
connector->base.base.id, connector->base.name);
|
||||
|
||||
|
||||
@@ -102,13 +102,13 @@ static enum port intel_dsi_seq_port_to_port(struct intel_dsi *intel_dsi,
|
||||
static const u8 *mipi_exec_send_packet(struct intel_dsi *intel_dsi,
|
||||
const u8 *data)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
struct mipi_dsi_device *dsi_device;
|
||||
u8 type, flags, seq_port;
|
||||
u16 len;
|
||||
enum port port;
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "\n");
|
||||
drm_dbg_kms(display->drm, "\n");
|
||||
|
||||
flags = *data++;
|
||||
type = *data++;
|
||||
@@ -120,12 +120,12 @@ static const u8 *mipi_exec_send_packet(struct intel_dsi *intel_dsi,
|
||||
|
||||
port = intel_dsi_seq_port_to_port(intel_dsi, seq_port);
|
||||
|
||||
if (drm_WARN_ON(&dev_priv->drm, !intel_dsi->dsi_hosts[port]))
|
||||
if (drm_WARN_ON(display->drm, !intel_dsi->dsi_hosts[port]))
|
||||
goto out;
|
||||
|
||||
dsi_device = intel_dsi->dsi_hosts[port]->device;
|
||||
if (!dsi_device) {
|
||||
drm_dbg_kms(&dev_priv->drm, "no dsi device for port %c\n",
|
||||
drm_dbg_kms(display->drm, "no dsi device for port %c\n",
|
||||
port_name(port));
|
||||
goto out;
|
||||
}
|
||||
@@ -150,8 +150,7 @@ static const u8 *mipi_exec_send_packet(struct intel_dsi *intel_dsi,
|
||||
case MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM:
|
||||
case MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM:
|
||||
case MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM:
|
||||
drm_dbg(&dev_priv->drm,
|
||||
"Generic Read not yet implemented or used\n");
|
||||
drm_dbg_kms(display->drm, "Generic Read not yet implemented or used\n");
|
||||
break;
|
||||
case MIPI_DSI_GENERIC_LONG_WRITE:
|
||||
mipi_dsi_generic_write(dsi_device, data, len);
|
||||
@@ -163,15 +162,14 @@ static const u8 *mipi_exec_send_packet(struct intel_dsi *intel_dsi,
|
||||
mipi_dsi_dcs_write_buffer(dsi_device, data, 2);
|
||||
break;
|
||||
case MIPI_DSI_DCS_READ:
|
||||
drm_dbg(&dev_priv->drm,
|
||||
"DCS Read not yet implemented or used\n");
|
||||
drm_dbg_kms(display->drm, "DCS Read not yet implemented or used\n");
|
||||
break;
|
||||
case MIPI_DSI_DCS_LONG_WRITE:
|
||||
mipi_dsi_dcs_write_buffer(dsi_device, data, len);
|
||||
break;
|
||||
}
|
||||
|
||||
if (DISPLAY_VER(dev_priv) < 11)
|
||||
if (DISPLAY_VER(display) < 11)
|
||||
vlv_dsi_wait_for_fifo_empty(intel_dsi, port);
|
||||
|
||||
out:
|
||||
@@ -182,10 +180,10 @@ out:
|
||||
|
||||
static const u8 *mipi_exec_delay(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
u32 delay = *((const u32 *) data);
|
||||
|
||||
drm_dbg_kms(&i915->drm, "%d usecs\n", delay);
|
||||
drm_dbg_kms(display->drm, "%d usecs\n", delay);
|
||||
|
||||
usleep_range(delay, delay + 10);
|
||||
data += 4;
|
||||
@@ -196,7 +194,7 @@ static const u8 *mipi_exec_delay(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
static void soc_gpio_set_value(struct intel_connector *connector, u8 gpio_index,
|
||||
const char *con_id, u8 idx, bool value)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
/* XXX: this table is a quick ugly hack. */
|
||||
static struct gpio_desc *soc_gpio_table[U8_MAX + 1];
|
||||
struct gpio_desc *gpio_desc = soc_gpio_table[gpio_index];
|
||||
@@ -204,10 +202,10 @@ static void soc_gpio_set_value(struct intel_connector *connector, u8 gpio_index,
|
||||
if (gpio_desc) {
|
||||
gpiod_set_value(gpio_desc, value);
|
||||
} else {
|
||||
gpio_desc = devm_gpiod_get_index(dev_priv->drm.dev, con_id, idx,
|
||||
gpio_desc = devm_gpiod_get_index(display->drm->dev, con_id, idx,
|
||||
value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
|
||||
if (IS_ERR(gpio_desc)) {
|
||||
drm_err(&dev_priv->drm,
|
||||
drm_err(display->drm,
|
||||
"GPIO index %u request failed (%pe)\n",
|
||||
gpio_index, gpio_desc);
|
||||
return;
|
||||
@@ -242,16 +240,16 @@ static void soc_opaque_gpio_set_value(struct intel_connector *connector,
|
||||
static void vlv_gpio_set_value(struct intel_connector *connector,
|
||||
u8 gpio_source, u8 gpio_index, bool value)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
|
||||
/* XXX: this assumes vlv_gpio_table only has NC GPIOs. */
|
||||
if (connector->panel.vbt.dsi.seq_version < 3) {
|
||||
if (gpio_source == 1) {
|
||||
drm_dbg_kms(&dev_priv->drm, "SC gpio not supported\n");
|
||||
drm_dbg_kms(display->drm, "SC gpio not supported\n");
|
||||
return;
|
||||
}
|
||||
if (gpio_source > 1) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"unknown gpio source %u\n", gpio_source);
|
||||
return;
|
||||
}
|
||||
@@ -264,7 +262,7 @@ static void vlv_gpio_set_value(struct intel_connector *connector,
|
||||
static void chv_gpio_set_value(struct intel_connector *connector,
|
||||
u8 gpio_source, u8 gpio_index, bool value)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
|
||||
if (connector->panel.vbt.dsi.seq_version >= 3) {
|
||||
if (gpio_index >= CHV_GPIO_IDX_START_SE) {
|
||||
@@ -284,13 +282,13 @@ static void chv_gpio_set_value(struct intel_connector *connector,
|
||||
} else {
|
||||
/* XXX: The spec is unclear about CHV GPIO on seq v2 */
|
||||
if (gpio_source != 0) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"unknown gpio source %u\n", gpio_source);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gpio_index >= CHV_GPIO_IDX_START_E) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"invalid gpio index %u for GPIO N\n",
|
||||
gpio_index);
|
||||
return;
|
||||
@@ -320,13 +318,13 @@ enum {
|
||||
MIPI_VIO_EN_2,
|
||||
};
|
||||
|
||||
static void icl_native_gpio_set_value(struct drm_i915_private *dev_priv,
|
||||
static void icl_native_gpio_set_value(struct intel_display *display,
|
||||
int gpio, bool value)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
int index;
|
||||
|
||||
if (drm_WARN_ON(&dev_priv->drm, DISPLAY_VER(dev_priv) == 11 && gpio >= MIPI_RESET_2))
|
||||
if (drm_WARN_ON(display->drm, DISPLAY_VER(display) == 11 && gpio >= MIPI_RESET_2))
|
||||
return;
|
||||
|
||||
switch (gpio) {
|
||||
@@ -344,7 +342,7 @@ static void icl_native_gpio_set_value(struct drm_i915_private *dev_priv,
|
||||
* modifications in irq setup and handling.
|
||||
*/
|
||||
spin_lock_irq(&dev_priv->irq_lock);
|
||||
intel_de_rmw(dev_priv, SHOTPLUG_CTL_DDI,
|
||||
intel_de_rmw(display, SHOTPLUG_CTL_DDI,
|
||||
SHOTPLUG_CTL_DDI_HPD_ENABLE(index) |
|
||||
SHOTPLUG_CTL_DDI_HPD_OUTPUT_DATA(index),
|
||||
value ? SHOTPLUG_CTL_DDI_HPD_OUTPUT_DATA(index) : 0);
|
||||
@@ -354,14 +352,14 @@ static void icl_native_gpio_set_value(struct drm_i915_private *dev_priv,
|
||||
case MIPI_AVDD_EN_2:
|
||||
index = gpio == MIPI_AVDD_EN_1 ? 0 : 1;
|
||||
|
||||
intel_de_rmw(dev_priv, PP_CONTROL(dev_priv, index), PANEL_POWER_ON,
|
||||
intel_de_rmw(display, PP_CONTROL(display, index), PANEL_POWER_ON,
|
||||
value ? PANEL_POWER_ON : 0);
|
||||
break;
|
||||
case MIPI_BKLT_EN_1:
|
||||
case MIPI_BKLT_EN_2:
|
||||
index = gpio == MIPI_BKLT_EN_1 ? 0 : 1;
|
||||
|
||||
intel_de_rmw(dev_priv, PP_CONTROL(dev_priv, index), EDP_BLC_ENABLE,
|
||||
intel_de_rmw(display, PP_CONTROL(display, index), EDP_BLC_ENABLE,
|
||||
value ? EDP_BLC_ENABLE : 0);
|
||||
break;
|
||||
case MIPI_AVEE_EN_1:
|
||||
@@ -389,13 +387,12 @@ static void icl_native_gpio_set_value(struct drm_i915_private *dev_priv,
|
||||
|
||||
static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
{
|
||||
struct drm_device *dev = intel_dsi->base.base.dev;
|
||||
struct drm_i915_private *i915 = to_i915(dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
struct intel_connector *connector = intel_dsi->attached_connector;
|
||||
u8 gpio_source = 0, gpio_index = 0, gpio_number;
|
||||
bool value;
|
||||
int size;
|
||||
bool native = DISPLAY_VER(i915) >= 11;
|
||||
bool native = DISPLAY_VER(display) >= 11;
|
||||
|
||||
if (connector->panel.vbt.dsi.seq_version >= 3) {
|
||||
size = 3;
|
||||
@@ -416,16 +413,16 @@ static const u8 *mipi_exec_gpio(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
gpio_source = (data[1] >> 1) & 3;
|
||||
}
|
||||
|
||||
drm_dbg_kms(&i915->drm, "GPIO index %u, number %u, source %u, native %s, set to %s\n",
|
||||
drm_dbg_kms(display->drm, "GPIO index %u, number %u, source %u, native %s, set to %s\n",
|
||||
gpio_index, gpio_number, gpio_source, str_yes_no(native), str_on_off(value));
|
||||
|
||||
if (native)
|
||||
icl_native_gpio_set_value(i915, gpio_number, value);
|
||||
else if (DISPLAY_VER(i915) >= 9)
|
||||
icl_native_gpio_set_value(display, gpio_number, value);
|
||||
else if (DISPLAY_VER(display) >= 9)
|
||||
bxt_gpio_set_value(connector, gpio_index, value);
|
||||
else if (IS_VALLEYVIEW(i915))
|
||||
else if (display->platform.valleyview)
|
||||
vlv_gpio_set_value(connector, gpio_source, gpio_number, value);
|
||||
else if (IS_CHERRYVIEW(i915))
|
||||
else if (display->platform.cherryview)
|
||||
chv_gpio_set_value(connector, gpio_source, gpio_number, value);
|
||||
|
||||
return data + size;
|
||||
@@ -463,8 +460,8 @@ static int i2c_adapter_lookup(struct acpi_resource *ares, void *data)
|
||||
static void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
|
||||
const u16 target_addr)
|
||||
{
|
||||
struct drm_device *drm_dev = intel_dsi->base.base.dev;
|
||||
struct acpi_device *adev = ACPI_COMPANION(drm_dev->dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
struct acpi_device *adev = ACPI_COMPANION(display->drm->dev);
|
||||
struct i2c_adapter_lookup lookup = {
|
||||
.target_addr = target_addr,
|
||||
.intel_dsi = intel_dsi,
|
||||
@@ -484,7 +481,7 @@ static inline void i2c_acpi_find_adapter(struct intel_dsi *intel_dsi,
|
||||
|
||||
static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
struct i2c_adapter *adapter;
|
||||
struct i2c_msg msg;
|
||||
int ret;
|
||||
@@ -494,7 +491,7 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
u8 payload_size = *(data + 6);
|
||||
u8 *payload_data;
|
||||
|
||||
drm_dbg_kms(&i915->drm, "bus %d target-addr 0x%02x reg 0x%02x data %*ph\n",
|
||||
drm_dbg_kms(display->drm, "bus %d target-addr 0x%02x reg 0x%02x data %*ph\n",
|
||||
vbt_i2c_bus_num, target_addr, reg_offset, payload_size, data + 7);
|
||||
|
||||
if (intel_dsi->i2c_bus_num < 0) {
|
||||
@@ -504,7 +501,7 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
|
||||
adapter = i2c_get_adapter(intel_dsi->i2c_bus_num);
|
||||
if (!adapter) {
|
||||
drm_err(&i915->drm, "Cannot find a valid i2c bus for xfer\n");
|
||||
drm_err(display->drm, "Cannot find a valid i2c bus for xfer\n");
|
||||
goto err_bus;
|
||||
}
|
||||
|
||||
@@ -522,7 +519,7 @@ static const u8 *mipi_exec_i2c(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
|
||||
ret = i2c_transfer(adapter, &msg, 1);
|
||||
if (ret < 0)
|
||||
drm_err(&i915->drm,
|
||||
drm_err(display->drm,
|
||||
"Failed to xfer payload of size (%u) to reg (%u)\n",
|
||||
payload_size, reg_offset);
|
||||
|
||||
@@ -535,16 +532,16 @@ err_bus:
|
||||
|
||||
static const u8 *mipi_exec_spi(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
|
||||
drm_dbg_kms(&i915->drm, "Skipping SPI element execution\n");
|
||||
drm_dbg_kms(display->drm, "Skipping SPI element execution\n");
|
||||
|
||||
return data + *(data + 5) + 6;
|
||||
}
|
||||
|
||||
static const u8 *mipi_exec_pmic(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
#ifdef CONFIG_PMIC_OPREGION
|
||||
u32 value, mask, reg_address;
|
||||
u16 i2c_address;
|
||||
@@ -560,9 +557,9 @@ static const u8 *mipi_exec_pmic(struct intel_dsi *intel_dsi, const u8 *data)
|
||||
reg_address,
|
||||
value, mask);
|
||||
if (ret)
|
||||
drm_err(&i915->drm, "%s failed, error: %d\n", __func__, ret);
|
||||
drm_err(display->drm, "%s failed, error: %d\n", __func__, ret);
|
||||
#else
|
||||
drm_err(&i915->drm,
|
||||
drm_err(display->drm,
|
||||
"Your hardware requires CONFIG_PMIC_OPREGION and it is not set\n");
|
||||
#endif
|
||||
|
||||
@@ -612,12 +609,12 @@ static const char *sequence_name(enum mipi_seq seq_id)
|
||||
static void intel_dsi_vbt_exec(struct intel_dsi *intel_dsi,
|
||||
enum mipi_seq seq_id)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
struct intel_connector *connector = intel_dsi->attached_connector;
|
||||
const u8 *data;
|
||||
fn_mipi_elem_exec mipi_elem_exec;
|
||||
|
||||
if (drm_WARN_ON(&dev_priv->drm,
|
||||
if (drm_WARN_ON(display->drm,
|
||||
seq_id >= ARRAY_SIZE(connector->panel.vbt.dsi.sequence)))
|
||||
return;
|
||||
|
||||
@@ -625,9 +622,9 @@ static void intel_dsi_vbt_exec(struct intel_dsi *intel_dsi,
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
drm_WARN_ON(&dev_priv->drm, *data != seq_id);
|
||||
drm_WARN_ON(display->drm, *data != seq_id);
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "Starting MIPI sequence %d - %s\n",
|
||||
drm_dbg_kms(display->drm, "Starting MIPI sequence %d - %s\n",
|
||||
seq_id, sequence_name(seq_id));
|
||||
|
||||
/* Skip Sequence Byte. */
|
||||
@@ -657,19 +654,19 @@ static void intel_dsi_vbt_exec(struct intel_dsi *intel_dsi,
|
||||
|
||||
/* Consistency check if we have size. */
|
||||
if (operation_size && data != next) {
|
||||
drm_err(&dev_priv->drm,
|
||||
drm_err(display->drm,
|
||||
"Inconsistent operation size\n");
|
||||
return;
|
||||
}
|
||||
} else if (operation_size) {
|
||||
/* We have size, skip. */
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Unsupported MIPI operation byte %u\n",
|
||||
operation_byte);
|
||||
data += operation_size;
|
||||
} else {
|
||||
/* No size, can't skip without parsing. */
|
||||
drm_err(&dev_priv->drm,
|
||||
drm_err(display->drm,
|
||||
"Unsupported MIPI operation byte %u\n",
|
||||
operation_byte);
|
||||
return;
|
||||
@@ -695,54 +692,44 @@ void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi,
|
||||
|
||||
void intel_dsi_log_params(struct intel_dsi *intel_dsi)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
struct drm_printer p = drm_dbg_printer(display->drm, DRM_UT_KMS,
|
||||
"DSI parameters:");
|
||||
|
||||
drm_dbg_kms(&i915->drm, "Pclk %d\n", intel_dsi->pclk);
|
||||
drm_dbg_kms(&i915->drm, "Pixel overlap %d\n",
|
||||
intel_dsi->pixel_overlap);
|
||||
drm_dbg_kms(&i915->drm, "Lane count %d\n", intel_dsi->lane_count);
|
||||
drm_dbg_kms(&i915->drm, "DPHY param reg 0x%x\n", intel_dsi->dphy_reg);
|
||||
drm_dbg_kms(&i915->drm, "Video mode format %s\n",
|
||||
intel_dsi->video_mode == NON_BURST_SYNC_PULSE ?
|
||||
"non-burst with sync pulse" :
|
||||
intel_dsi->video_mode == NON_BURST_SYNC_EVENTS ?
|
||||
"non-burst with sync events" :
|
||||
intel_dsi->video_mode == BURST_MODE ?
|
||||
"burst" : "<unknown>");
|
||||
drm_dbg_kms(&i915->drm, "Burst mode ratio %d\n",
|
||||
intel_dsi->burst_mode_ratio);
|
||||
drm_dbg_kms(&i915->drm, "Reset timer %d\n", intel_dsi->rst_timer_val);
|
||||
drm_dbg_kms(&i915->drm, "Eot %s\n",
|
||||
str_enabled_disabled(intel_dsi->eotp_pkt));
|
||||
drm_dbg_kms(&i915->drm, "Clockstop %s\n",
|
||||
str_enabled_disabled(!intel_dsi->clock_stop));
|
||||
drm_dbg_kms(&i915->drm, "Mode %s\n",
|
||||
intel_dsi->operation_mode ? "command" : "video");
|
||||
drm_printf(&p, "Pclk %d\n", intel_dsi->pclk);
|
||||
drm_printf(&p, "Pixel overlap %d\n", intel_dsi->pixel_overlap);
|
||||
drm_printf(&p, "Lane count %d\n", intel_dsi->lane_count);
|
||||
drm_printf(&p, "DPHY param reg 0x%x\n", intel_dsi->dphy_reg);
|
||||
drm_printf(&p, "Video mode format %s\n",
|
||||
intel_dsi->video_mode == NON_BURST_SYNC_PULSE ?
|
||||
"non-burst with sync pulse" :
|
||||
intel_dsi->video_mode == NON_BURST_SYNC_EVENTS ?
|
||||
"non-burst with sync events" :
|
||||
intel_dsi->video_mode == BURST_MODE ?
|
||||
"burst" : "<unknown>");
|
||||
drm_printf(&p, "Burst mode ratio %d\n", intel_dsi->burst_mode_ratio);
|
||||
drm_printf(&p, "Reset timer %d\n", intel_dsi->rst_timer_val);
|
||||
drm_printf(&p, "Eot %s\n", str_enabled_disabled(intel_dsi->eotp_pkt));
|
||||
drm_printf(&p, "Clockstop %s\n", str_enabled_disabled(!intel_dsi->clock_stop));
|
||||
drm_printf(&p, "Mode %s\n", intel_dsi->operation_mode ? "command" : "video");
|
||||
if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK)
|
||||
drm_dbg_kms(&i915->drm,
|
||||
"Dual link: DSI_DUAL_LINK_FRONT_BACK\n");
|
||||
drm_printf(&p, "Dual link: DSI_DUAL_LINK_FRONT_BACK\n");
|
||||
else if (intel_dsi->dual_link == DSI_DUAL_LINK_PIXEL_ALT)
|
||||
drm_dbg_kms(&i915->drm,
|
||||
"Dual link: DSI_DUAL_LINK_PIXEL_ALT\n");
|
||||
drm_printf(&p, "Dual link: DSI_DUAL_LINK_PIXEL_ALT\n");
|
||||
else
|
||||
drm_dbg_kms(&i915->drm, "Dual link: NONE\n");
|
||||
drm_dbg_kms(&i915->drm, "Pixel Format %d\n", intel_dsi->pixel_format);
|
||||
drm_dbg_kms(&i915->drm, "TLPX %d\n", intel_dsi->escape_clk_div);
|
||||
drm_dbg_kms(&i915->drm, "LP RX Timeout 0x%x\n",
|
||||
intel_dsi->lp_rx_timeout);
|
||||
drm_dbg_kms(&i915->drm, "Turnaround Timeout 0x%x\n",
|
||||
intel_dsi->turn_arnd_val);
|
||||
drm_dbg_kms(&i915->drm, "Init Count 0x%x\n", intel_dsi->init_count);
|
||||
drm_dbg_kms(&i915->drm, "HS to LP Count 0x%x\n",
|
||||
intel_dsi->hs_to_lp_count);
|
||||
drm_dbg_kms(&i915->drm, "LP Byte Clock %d\n", intel_dsi->lp_byte_clk);
|
||||
drm_dbg_kms(&i915->drm, "DBI BW Timer 0x%x\n", intel_dsi->bw_timer);
|
||||
drm_dbg_kms(&i915->drm, "LP to HS Clock Count 0x%x\n",
|
||||
intel_dsi->clk_lp_to_hs_count);
|
||||
drm_dbg_kms(&i915->drm, "HS to LP Clock Count 0x%x\n",
|
||||
intel_dsi->clk_hs_to_lp_count);
|
||||
drm_dbg_kms(&i915->drm, "BTA %s\n",
|
||||
str_enabled_disabled(!(intel_dsi->video_frmt_cfg_bits & DISABLE_VIDEO_BTA)));
|
||||
drm_printf(&p, "Dual link: NONE\n");
|
||||
drm_printf(&p, "Pixel Format %d\n", intel_dsi->pixel_format);
|
||||
drm_printf(&p, "TLPX %d\n", intel_dsi->escape_clk_div);
|
||||
drm_printf(&p, "LP RX Timeout 0x%x\n", intel_dsi->lp_rx_timeout);
|
||||
drm_printf(&p, "Turnaround Timeout 0x%x\n", intel_dsi->turn_arnd_val);
|
||||
drm_printf(&p, "Init Count 0x%x\n", intel_dsi->init_count);
|
||||
drm_printf(&p, "HS to LP Count 0x%x\n", intel_dsi->hs_to_lp_count);
|
||||
drm_printf(&p, "LP Byte Clock %d\n", intel_dsi->lp_byte_clk);
|
||||
drm_printf(&p, "DBI BW Timer 0x%x\n", intel_dsi->bw_timer);
|
||||
drm_printf(&p, "LP to HS Clock Count 0x%x\n", intel_dsi->clk_lp_to_hs_count);
|
||||
drm_printf(&p, "HS to LP Clock Count 0x%x\n", intel_dsi->clk_hs_to_lp_count);
|
||||
drm_printf(&p, "BTA %s\n",
|
||||
str_enabled_disabled(!(intel_dsi->video_frmt_cfg_bits & DISABLE_VIDEO_BTA)));
|
||||
}
|
||||
|
||||
static enum mipi_dsi_pixel_format vbt_to_dsi_pixel_format(unsigned int format)
|
||||
@@ -764,8 +751,7 @@ static enum mipi_dsi_pixel_format vbt_to_dsi_pixel_format(unsigned int format)
|
||||
|
||||
bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
|
||||
{
|
||||
struct drm_device *dev = intel_dsi->base.base.dev;
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
struct intel_connector *connector = intel_dsi->attached_connector;
|
||||
struct mipi_config *mipi_config = connector->panel.vbt.dsi.config;
|
||||
struct mipi_pps_data *pps = connector->panel.vbt.dsi.pps;
|
||||
@@ -773,7 +759,7 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
|
||||
u16 burst_mode_ratio;
|
||||
enum port port;
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "\n");
|
||||
drm_dbg_kms(display->drm, "\n");
|
||||
|
||||
intel_dsi->eotp_pkt = mipi_config->eot_pkt_disabled ? 0 : 1;
|
||||
intel_dsi->clock_stop = mipi_config->enable_clk_stop ? 1 : 0;
|
||||
@@ -819,7 +805,7 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
|
||||
u32 bitrate;
|
||||
|
||||
if (mipi_config->target_burst_mode_freq == 0) {
|
||||
drm_err(&dev_priv->drm, "Burst mode target is not set\n");
|
||||
drm_err(display->drm, "Burst mode target is not set\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -836,7 +822,7 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
|
||||
mipi_config->target_burst_mode_freq = bitrate;
|
||||
|
||||
if (mipi_config->target_burst_mode_freq < bitrate) {
|
||||
drm_err(&dev_priv->drm, "Burst mode freq is less than computed\n");
|
||||
drm_err(display->drm, "Burst mode freq is less than computed\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -900,8 +886,7 @@ static const struct pinctrl_map soc_pwm_pinctrl_map[] = {
|
||||
|
||||
void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on)
|
||||
{
|
||||
struct drm_device *dev = intel_dsi->base.base.dev;
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_display *display = to_intel_display(&intel_dsi->base);
|
||||
struct intel_connector *connector = intel_dsi->attached_connector;
|
||||
struct mipi_config *mipi_config = connector->panel.vbt.dsi.config;
|
||||
enum gpiod_flags flags = panel_is_on ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
|
||||
@@ -911,13 +896,13 @@ void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on)
|
||||
struct pinctrl *pinctrl;
|
||||
int ret;
|
||||
|
||||
if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
|
||||
if ((display->platform.valleyview || display->platform.cherryview) &&
|
||||
mipi_config->pwm_blc == PPS_BLC_PMIC) {
|
||||
gpiod_lookup_table = &pmic_panel_gpio_table;
|
||||
want_panel_gpio = true;
|
||||
}
|
||||
|
||||
if (IS_VALLEYVIEW(dev_priv) && mipi_config->pwm_blc == PPS_BLC_SOC) {
|
||||
if (display->platform.valleyview && mipi_config->pwm_blc == PPS_BLC_SOC) {
|
||||
gpiod_lookup_table = &soc_panel_gpio_table;
|
||||
want_panel_gpio = true;
|
||||
want_backlight_gpio = true;
|
||||
@@ -926,12 +911,12 @@ void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on)
|
||||
ret = pinctrl_register_mappings(soc_pwm_pinctrl_map,
|
||||
ARRAY_SIZE(soc_pwm_pinctrl_map));
|
||||
if (ret)
|
||||
drm_err(&dev_priv->drm,
|
||||
drm_err(display->drm,
|
||||
"Failed to register pwm0 pinmux mapping\n");
|
||||
|
||||
pinctrl = devm_pinctrl_get_select(dev->dev, "soc_pwm0");
|
||||
pinctrl = devm_pinctrl_get_select(display->drm->dev, "soc_pwm0");
|
||||
if (IS_ERR(pinctrl))
|
||||
drm_err(&dev_priv->drm,
|
||||
drm_err(display->drm,
|
||||
"Failed to set pinmux to PWM\n");
|
||||
}
|
||||
|
||||
@@ -939,9 +924,9 @@ void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on)
|
||||
gpiod_add_lookup_table(gpiod_lookup_table);
|
||||
|
||||
if (want_panel_gpio) {
|
||||
intel_dsi->gpio_panel = devm_gpiod_get(dev->dev, "panel", flags);
|
||||
intel_dsi->gpio_panel = devm_gpiod_get(display->drm->dev, "panel", flags);
|
||||
if (IS_ERR(intel_dsi->gpio_panel)) {
|
||||
drm_err(&dev_priv->drm,
|
||||
drm_err(display->drm,
|
||||
"Failed to own gpio for panel control\n");
|
||||
intel_dsi->gpio_panel = NULL;
|
||||
}
|
||||
@@ -949,9 +934,9 @@ void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on)
|
||||
|
||||
if (want_backlight_gpio) {
|
||||
intel_dsi->gpio_backlight =
|
||||
devm_gpiod_get(dev->dev, "backlight", flags);
|
||||
devm_gpiod_get(display->drm->dev, "backlight", flags);
|
||||
if (IS_ERR(intel_dsi->gpio_backlight)) {
|
||||
drm_err(&dev_priv->drm,
|
||||
drm_err(display->drm,
|
||||
"Failed to own gpio for backlight control\n");
|
||||
intel_dsi->gpio_backlight = NULL;
|
||||
}
|
||||
|
||||
@@ -31,10 +31,11 @@
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_crtc.h>
|
||||
#include <drm/drm_edid.h>
|
||||
#include <drm/drm_print.h>
|
||||
#include <drm/drm_probe_helper.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "i915_reg.h"
|
||||
#include "i915_utils.h"
|
||||
#include "intel_connector.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_driver.h"
|
||||
@@ -129,13 +130,13 @@ static struct intel_dvo *intel_attached_dvo(struct intel_connector *connector)
|
||||
|
||||
static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
struct intel_encoder *encoder = intel_attached_encoder(connector);
|
||||
struct intel_dvo *intel_dvo = enc_to_dvo(encoder);
|
||||
enum port port = encoder->port;
|
||||
u32 tmp;
|
||||
|
||||
tmp = intel_de_read(i915, DVO(port));
|
||||
tmp = intel_de_read(display, DVO(port));
|
||||
|
||||
if (!(tmp & DVO_ENABLE))
|
||||
return false;
|
||||
@@ -146,11 +147,11 @@ static bool intel_dvo_connector_get_hw_state(struct intel_connector *connector)
|
||||
static bool intel_dvo_get_hw_state(struct intel_encoder *encoder,
|
||||
enum pipe *pipe)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
enum port port = encoder->port;
|
||||
u32 tmp;
|
||||
|
||||
tmp = intel_de_read(i915, DVO(port));
|
||||
tmp = intel_de_read(display, DVO(port));
|
||||
|
||||
*pipe = REG_FIELD_GET(DVO_PIPE_SEL_MASK, tmp);
|
||||
|
||||
@@ -160,13 +161,13 @@ static bool intel_dvo_get_hw_state(struct intel_encoder *encoder,
|
||||
static void intel_dvo_get_config(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *pipe_config)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
enum port port = encoder->port;
|
||||
u32 tmp, flags = 0;
|
||||
|
||||
pipe_config->output_types |= BIT(INTEL_OUTPUT_DVO);
|
||||
|
||||
tmp = intel_de_read(i915, DVO(port));
|
||||
tmp = intel_de_read(display, DVO(port));
|
||||
if (tmp & DVO_HSYNC_ACTIVE_HIGH)
|
||||
flags |= DRM_MODE_FLAG_PHSYNC;
|
||||
else
|
||||
@@ -186,14 +187,14 @@ static void intel_disable_dvo(struct intel_atomic_state *state,
|
||||
const struct intel_crtc_state *old_crtc_state,
|
||||
const struct drm_connector_state *old_conn_state)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_dvo *intel_dvo = enc_to_dvo(encoder);
|
||||
enum port port = encoder->port;
|
||||
|
||||
intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, false);
|
||||
|
||||
intel_de_rmw(i915, DVO(port), DVO_ENABLE, 0);
|
||||
intel_de_posting_read(i915, DVO(port));
|
||||
intel_de_rmw(display, DVO(port), DVO_ENABLE, 0);
|
||||
intel_de_posting_read(display, DVO(port));
|
||||
}
|
||||
|
||||
static void intel_enable_dvo(struct intel_atomic_state *state,
|
||||
@@ -201,7 +202,7 @@ static void intel_enable_dvo(struct intel_atomic_state *state,
|
||||
const struct intel_crtc_state *pipe_config,
|
||||
const struct drm_connector_state *conn_state)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_dvo *intel_dvo = enc_to_dvo(encoder);
|
||||
enum port port = encoder->port;
|
||||
|
||||
@@ -209,8 +210,8 @@ static void intel_enable_dvo(struct intel_atomic_state *state,
|
||||
&pipe_config->hw.mode,
|
||||
&pipe_config->hw.adjusted_mode);
|
||||
|
||||
intel_de_rmw(i915, DVO(port), 0, DVO_ENABLE);
|
||||
intel_de_posting_read(i915, DVO(port));
|
||||
intel_de_rmw(display, DVO(port), 0, DVO_ENABLE);
|
||||
intel_de_posting_read(display, DVO(port));
|
||||
|
||||
intel_dvo->dev.dev_ops->dpms(&intel_dvo->dev, true);
|
||||
}
|
||||
@@ -288,7 +289,7 @@ static void intel_dvo_pre_enable(struct intel_atomic_state *state,
|
||||
const struct intel_crtc_state *pipe_config,
|
||||
const struct drm_connector_state *conn_state)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
|
||||
const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
|
||||
enum port port = encoder->port;
|
||||
@@ -296,7 +297,7 @@ static void intel_dvo_pre_enable(struct intel_atomic_state *state,
|
||||
u32 dvo_val;
|
||||
|
||||
/* Save the active data order, since I don't know what it should be set to. */
|
||||
dvo_val = intel_de_read(i915, DVO(port)) &
|
||||
dvo_val = intel_de_read(display, DVO(port)) &
|
||||
(DVO_DEDICATED_INT_ENABLE |
|
||||
DVO_PRESERVE_MASK | DVO_ACT_DATA_ORDER_MASK);
|
||||
dvo_val |= DVO_DATA_ORDER_FP | DVO_BORDER_ENABLE |
|
||||
@@ -309,10 +310,10 @@ static void intel_dvo_pre_enable(struct intel_atomic_state *state,
|
||||
if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
|
||||
dvo_val |= DVO_VSYNC_ACTIVE_HIGH;
|
||||
|
||||
intel_de_write(i915, DVO_SRCDIM(port),
|
||||
intel_de_write(display, DVO_SRCDIM(port),
|
||||
DVO_SRCDIM_HORIZONTAL(adjusted_mode->crtc_hdisplay) |
|
||||
DVO_SRCDIM_VERTICAL(adjusted_mode->crtc_vdisplay));
|
||||
intel_de_write(i915, DVO(port), dvo_val);
|
||||
intel_de_write(display, DVO(port), dvo_val);
|
||||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
@@ -320,10 +321,9 @@ intel_dvo_detect(struct drm_connector *_connector, bool force)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(_connector->dev);
|
||||
struct intel_connector *connector = to_intel_connector(_connector);
|
||||
struct drm_i915_private *i915 = to_i915(connector->base.dev);
|
||||
struct intel_dvo *intel_dvo = intel_attached_dvo(connector);
|
||||
|
||||
drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s]\n",
|
||||
drm_dbg_kms(display->drm, "[CONNECTOR:%d:%s]\n",
|
||||
connector->base.base.id, connector->base.name);
|
||||
|
||||
if (!intel_display_device_enabled(display))
|
||||
@@ -414,11 +414,10 @@ static int intel_dvo_connector_type(const struct intel_dvo_device *dvo)
|
||||
}
|
||||
}
|
||||
|
||||
static bool intel_dvo_init_dev(struct drm_i915_private *dev_priv,
|
||||
static bool intel_dvo_init_dev(struct intel_display *display,
|
||||
struct intel_dvo *intel_dvo,
|
||||
const struct intel_dvo_device *dvo)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct i2c_adapter *i2c;
|
||||
u32 dpll[I915_MAX_PIPES];
|
||||
enum pipe pipe;
|
||||
@@ -458,15 +457,15 @@ static bool intel_dvo_init_dev(struct drm_i915_private *dev_priv,
|
||||
* the clock enabled before we attempt to initialize
|
||||
* the device.
|
||||
*/
|
||||
for_each_pipe(dev_priv, pipe)
|
||||
dpll[pipe] = intel_de_rmw(dev_priv, DPLL(dev_priv, pipe), 0,
|
||||
for_each_pipe(display, pipe)
|
||||
dpll[pipe] = intel_de_rmw(display, DPLL(display, pipe), 0,
|
||||
DPLL_DVO_2X_MODE);
|
||||
|
||||
ret = dvo->dev_ops->init(&intel_dvo->dev, i2c);
|
||||
|
||||
/* restore the DVO 2x clock state to original */
|
||||
for_each_pipe(dev_priv, pipe) {
|
||||
intel_de_write(dev_priv, DPLL(dev_priv, pipe), dpll[pipe]);
|
||||
for_each_pipe(display, pipe) {
|
||||
intel_de_write(display, DPLL(display, pipe), dpll[pipe]);
|
||||
}
|
||||
|
||||
intel_gmbus_force_bit(i2c, false);
|
||||
@@ -474,14 +473,14 @@ static bool intel_dvo_init_dev(struct drm_i915_private *dev_priv,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool intel_dvo_probe(struct drm_i915_private *i915,
|
||||
static bool intel_dvo_probe(struct intel_display *display,
|
||||
struct intel_dvo *intel_dvo)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Now, try to find a controller */
|
||||
for (i = 0; i < ARRAY_SIZE(intel_dvo_devices); i++) {
|
||||
if (intel_dvo_init_dev(i915, intel_dvo,
|
||||
if (intel_dvo_init_dev(display, intel_dvo,
|
||||
&intel_dvo_devices[i]))
|
||||
return true;
|
||||
}
|
||||
@@ -489,9 +488,8 @@ static bool intel_dvo_probe(struct drm_i915_private *i915,
|
||||
return false;
|
||||
}
|
||||
|
||||
void intel_dvo_init(struct drm_i915_private *i915)
|
||||
void intel_dvo_init(struct intel_display *display)
|
||||
{
|
||||
struct intel_display *display = &i915->display;
|
||||
struct intel_connector *connector;
|
||||
struct intel_encoder *encoder;
|
||||
struct intel_dvo *intel_dvo;
|
||||
@@ -518,7 +516,7 @@ void intel_dvo_init(struct drm_i915_private *i915)
|
||||
encoder->pre_enable = intel_dvo_pre_enable;
|
||||
connector->get_hw_state = intel_dvo_connector_get_hw_state;
|
||||
|
||||
if (!intel_dvo_probe(i915, intel_dvo)) {
|
||||
if (!intel_dvo_probe(display, intel_dvo)) {
|
||||
kfree(intel_dvo);
|
||||
intel_connector_free(connector);
|
||||
return;
|
||||
@@ -535,12 +533,12 @@ void intel_dvo_init(struct drm_i915_private *i915)
|
||||
encoder->cloneable = BIT(INTEL_OUTPUT_ANALOG) |
|
||||
BIT(INTEL_OUTPUT_DVO);
|
||||
|
||||
drm_encoder_init(&i915->drm, &encoder->base,
|
||||
drm_encoder_init(display->drm, &encoder->base,
|
||||
&intel_dvo_enc_funcs,
|
||||
intel_dvo_encoder_type(&intel_dvo->dev),
|
||||
"DVO %c", port_name(encoder->port));
|
||||
|
||||
drm_dbg_kms(&i915->drm, "[ENCODER:%d:%s] detected %s\n",
|
||||
drm_dbg_kms(display->drm, "[ENCODER:%d:%s] detected %s\n",
|
||||
encoder->base.base.id, encoder->base.name,
|
||||
intel_dvo->dev.name);
|
||||
|
||||
@@ -549,7 +547,7 @@ void intel_dvo_init(struct drm_i915_private *i915)
|
||||
DRM_CONNECTOR_POLL_DISCONNECT;
|
||||
connector->base.polled = connector->polled;
|
||||
|
||||
drm_connector_init_with_ddc(&i915->drm, &connector->base,
|
||||
drm_connector_init_with_ddc(display->drm, &connector->base,
|
||||
&intel_dvo_connector_funcs,
|
||||
intel_dvo_connector_type(&intel_dvo->dev),
|
||||
intel_gmbus_get_adapter(display, GMBUS_PIN_DPC));
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
#ifndef __INTEL_DVO_H__
|
||||
#define __INTEL_DVO_H__
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_display;
|
||||
|
||||
#ifdef I915
|
||||
void intel_dvo_init(struct drm_i915_private *dev_priv);
|
||||
void intel_dvo_init(struct intel_display *display);
|
||||
#else
|
||||
static inline void intel_dvo_init(struct drm_i915_private *dev_priv)
|
||||
static inline void intel_dvo_init(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include "intel_atomic_plane.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dpt.h"
|
||||
#include "intel_fb.h"
|
||||
@@ -117,7 +118,7 @@ intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct drm_gem_object *_obj = intel_fb_bo(fb);
|
||||
struct drm_i915_gem_object *obj = to_intel_bo(_obj);
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
struct i915_gem_ww_ctx ww;
|
||||
struct i915_vma *vma;
|
||||
unsigned int pinctl;
|
||||
@@ -136,7 +137,7 @@ intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
|
||||
* intel_runtime_pm_put(), so it is correct to wrap only the
|
||||
* pin/unpin/fence and not more.
|
||||
*/
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
|
||||
atomic_inc(&display->restore.pending_fb_pin);
|
||||
|
||||
@@ -215,7 +216,7 @@ err:
|
||||
vma = ERR_PTR(ret);
|
||||
|
||||
atomic_dec(&display->restore.pending_fb_pin);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
return vma;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "intel_cdclk.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_device.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_trace.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_display_wa.h"
|
||||
@@ -519,6 +520,20 @@ static void ilk_fbc_activate(struct intel_fbc *fbc)
|
||||
DPFC_CTL_EN | g4x_dpfc_ctl(fbc));
|
||||
}
|
||||
|
||||
static void fbc_compressor_clkgate_disable_wa(struct intel_fbc *fbc,
|
||||
bool disable)
|
||||
{
|
||||
struct intel_display *display = fbc->display;
|
||||
|
||||
if (display->platform.dg2)
|
||||
intel_de_rmw(display, GEN9_CLKGATE_DIS_4, DG2_DPFC_GATING_DIS,
|
||||
disable ? DG2_DPFC_GATING_DIS : 0);
|
||||
else if (DISPLAY_VER(display) >= 14)
|
||||
intel_de_rmw(display, MTL_PIPE_CLKGATE_DIS2(fbc->id),
|
||||
MTL_DPFC_GATING_DIS,
|
||||
disable ? MTL_DPFC_GATING_DIS : 0);
|
||||
}
|
||||
|
||||
static void ilk_fbc_deactivate(struct intel_fbc *fbc)
|
||||
{
|
||||
struct intel_display *display = fbc->display;
|
||||
@@ -532,6 +547,10 @@ static void ilk_fbc_deactivate(struct intel_fbc *fbc)
|
||||
if (dpfc_ctl & DPFC_CTL_EN) {
|
||||
dpfc_ctl &= ~DPFC_CTL_EN;
|
||||
intel_de_write(display, ILK_DPFC_CONTROL(fbc->id), dpfc_ctl);
|
||||
|
||||
/* wa_18038517565 Enable DPFC clock gating after FBC disable */
|
||||
if (display->platform.dg2 || DISPLAY_VER(display) >= 14)
|
||||
fbc_compressor_clkgate_disable_wa(fbc, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -921,6 +940,10 @@ static void intel_fbc_program_workarounds(struct intel_fbc *fbc)
|
||||
if (DISPLAY_VER(display) >= 11 && !display->platform.dg2)
|
||||
intel_de_rmw(display, ILK_DPFC_CHICKEN(fbc->id),
|
||||
0, DPFC_CHICKEN_FORCE_SLB_INVALIDATION);
|
||||
|
||||
/* wa_18038517565 Disable DPFC clock gating before FBC enable */
|
||||
if (display->platform.dg2 || DISPLAY_VER(display) >= 14)
|
||||
fbc_compressor_clkgate_disable_wa(fbc, true);
|
||||
}
|
||||
|
||||
static void __intel_fbc_cleanup_cfb(struct intel_fbc *fbc)
|
||||
@@ -1436,7 +1459,7 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (intel_display_needs_wa_16023588340(i915)) {
|
||||
if (intel_display_needs_wa_16023588340(display)) {
|
||||
plane_state->no_fbc_reason = "Wa_16023588340";
|
||||
return 0;
|
||||
}
|
||||
@@ -1464,14 +1487,15 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,
|
||||
* Recommendation is to keep this combination disabled
|
||||
* Bspec: 50422 HSD: 14010260002
|
||||
*
|
||||
* In Xe3, PSR2 selective fetch and FBC dirty rect feature cannot
|
||||
* coexist. So if PSR2 selective fetch is supported then mark that
|
||||
* FBC is not supported.
|
||||
* TODO: Need a logic to decide between PSR2 and FBC Dirty rect
|
||||
* TODO: Implement a logic to select between PSR2 selective fetch and
|
||||
* FBC based on Bspec: 68881 in xe2lpd onwards.
|
||||
*
|
||||
* As we still see some strange underruns in those platforms while
|
||||
* disabling PSR2, keep FBC disabled in case of selective update is on
|
||||
* until the selection logic is implemented.
|
||||
*/
|
||||
if ((IS_DISPLAY_VER(display, 12, 14) || HAS_FBC_DIRTY_RECT(display)) &&
|
||||
crtc_state->has_sel_update && !crtc_state->has_panel_replay) {
|
||||
plane_state->no_fbc_reason = "PSR2 enabled";
|
||||
if (DISPLAY_VER(display) >= 12 && crtc_state->has_sel_update) {
|
||||
plane_state->no_fbc_reason = "Selective update enabled";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2120,13 +2144,12 @@ static int intel_fbc_debugfs_status_show(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct intel_fbc *fbc = m->private;
|
||||
struct intel_display *display = fbc->display;
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct intel_plane *plane;
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
|
||||
drm_modeset_lock_all(display->drm);
|
||||
|
||||
wakeref = intel_runtime_pm_get(&i915->runtime_pm);
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
mutex_lock(&fbc->lock);
|
||||
|
||||
if (fbc->active) {
|
||||
@@ -2151,7 +2174,7 @@ static int intel_fbc_debugfs_status_show(struct seq_file *m, void *unused)
|
||||
}
|
||||
|
||||
mutex_unlock(&fbc->lock);
|
||||
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
|
||||
drm_modeset_unlock_all(display->drm);
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "i915_drv.h"
|
||||
#include "i915_vma.h"
|
||||
#include "intel_bo.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_fb.h"
|
||||
#include "intel_fb_pin.h"
|
||||
@@ -213,7 +214,8 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
|
||||
struct intel_framebuffer *fb = ifbdev->fb;
|
||||
struct drm_device *dev = helper->dev;
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
intel_wakeref_t wakeref;
|
||||
struct intel_display *display = to_intel_display(dev);
|
||||
struct ref_tracker *wakeref;
|
||||
struct fb_info *info;
|
||||
struct i915_vma *vma;
|
||||
unsigned long flags = 0;
|
||||
@@ -247,7 +249,7 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
|
||||
sizes->fb_height = fb->base.height;
|
||||
}
|
||||
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
|
||||
/* Pin the GGTT vma for our access via info->screen_base.
|
||||
* This also validates that any existing fb inherited from the
|
||||
@@ -299,14 +301,15 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
|
||||
ifbdev->vma = vma;
|
||||
ifbdev->vma_flags = flags;
|
||||
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
|
||||
return 0;
|
||||
|
||||
out_unpin:
|
||||
intel_fb_unpin_vma(vma, flags);
|
||||
out_unlock:
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,14 +136,13 @@ static void i9xx_set_fifo_underrun_reporting(struct intel_display *display,
|
||||
static void ilk_set_fifo_underrun_reporting(struct intel_display *display,
|
||||
enum pipe pipe, bool enable)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
u32 bit = (pipe == PIPE_A) ?
|
||||
DE_PIPEA_FIFO_UNDERRUN : DE_PIPEB_FIFO_UNDERRUN;
|
||||
|
||||
if (enable)
|
||||
ilk_enable_display_irq(dev_priv, bit);
|
||||
ilk_enable_display_irq(display, bit);
|
||||
else
|
||||
ilk_disable_display_irq(dev_priv, bit);
|
||||
ilk_disable_display_irq(display, bit);
|
||||
}
|
||||
|
||||
static void ivb_check_fifo_underruns(struct intel_crtc *crtc)
|
||||
@@ -169,7 +168,6 @@ static void ivb_set_fifo_underrun_reporting(struct intel_display *display,
|
||||
enum pipe pipe, bool enable,
|
||||
bool old)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
if (enable) {
|
||||
intel_de_write(display, GEN7_ERR_INT,
|
||||
ERR_INT_FIFO_UNDERRUN(pipe));
|
||||
@@ -177,9 +175,9 @@ static void ivb_set_fifo_underrun_reporting(struct intel_display *display,
|
||||
if (!ivb_can_enable_err_int(display))
|
||||
return;
|
||||
|
||||
ilk_enable_display_irq(dev_priv, DE_ERR_INT_IVB);
|
||||
ilk_enable_display_irq(display, DE_ERR_INT_IVB);
|
||||
} else {
|
||||
ilk_disable_display_irq(dev_priv, DE_ERR_INT_IVB);
|
||||
ilk_disable_display_irq(display, DE_ERR_INT_IVB);
|
||||
|
||||
if (old &&
|
||||
intel_de_read(display, GEN7_ERR_INT) & ERR_INT_FIFO_UNDERRUN(pipe)) {
|
||||
@@ -193,26 +191,23 @@ static void ivb_set_fifo_underrun_reporting(struct intel_display *display,
|
||||
static void bdw_set_fifo_underrun_reporting(struct intel_display *display,
|
||||
enum pipe pipe, bool enable)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
if (enable)
|
||||
bdw_enable_pipe_irq(dev_priv, pipe, GEN8_PIPE_FIFO_UNDERRUN);
|
||||
bdw_enable_pipe_irq(display, pipe, GEN8_PIPE_FIFO_UNDERRUN);
|
||||
else
|
||||
bdw_disable_pipe_irq(dev_priv, pipe, GEN8_PIPE_FIFO_UNDERRUN);
|
||||
bdw_disable_pipe_irq(display, pipe, GEN8_PIPE_FIFO_UNDERRUN);
|
||||
}
|
||||
|
||||
static void ibx_set_fifo_underrun_reporting(struct intel_display *display,
|
||||
enum pipe pch_transcoder,
|
||||
bool enable)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
u32 bit = (pch_transcoder == PIPE_A) ?
|
||||
SDE_TRANSA_FIFO_UNDER : SDE_TRANSB_FIFO_UNDER;
|
||||
|
||||
if (enable)
|
||||
ibx_enable_display_interrupt(dev_priv, bit);
|
||||
ibx_enable_display_interrupt(display, bit);
|
||||
else
|
||||
ibx_disable_display_interrupt(dev_priv, bit);
|
||||
ibx_disable_display_interrupt(display, bit);
|
||||
}
|
||||
|
||||
static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc)
|
||||
@@ -240,8 +235,6 @@ static void cpt_set_fifo_underrun_reporting(struct intel_display *display,
|
||||
enum pipe pch_transcoder,
|
||||
bool enable, bool old)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
if (enable) {
|
||||
intel_de_write(display, SERR_INT,
|
||||
SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder));
|
||||
@@ -249,9 +242,9 @@ static void cpt_set_fifo_underrun_reporting(struct intel_display *display,
|
||||
if (!cpt_can_enable_serr_int(display))
|
||||
return;
|
||||
|
||||
ibx_enable_display_interrupt(dev_priv, SDE_ERROR_CPT);
|
||||
ibx_enable_display_interrupt(display, SDE_ERROR_CPT);
|
||||
} else {
|
||||
ibx_disable_display_interrupt(dev_priv, SDE_ERROR_CPT);
|
||||
ibx_disable_display_interrupt(display, SDE_ERROR_CPT);
|
||||
|
||||
if (old && intel_de_read(display, SERR_INT) &
|
||||
SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder)) {
|
||||
@@ -477,8 +470,6 @@ void intel_init_fifo_underrun_reporting(struct intel_display *display,
|
||||
struct intel_crtc *crtc,
|
||||
bool enable)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
crtc->cpu_fifo_underrun_disabled = !enable;
|
||||
|
||||
/*
|
||||
@@ -490,6 +481,6 @@ void intel_init_fifo_underrun_reporting(struct intel_display *display,
|
||||
* PCH transcoders B and C would prevent enabling the south
|
||||
* error interrupt (see cpt_can_enable_serr_int()).
|
||||
*/
|
||||
if (intel_has_pch_trancoder(i915, crtc->pipe))
|
||||
if (intel_has_pch_trancoder(display, crtc->pipe))
|
||||
crtc->pch_fifo_underrun_disabled = !enable;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_power.h"
|
||||
#include "intel_display_power_well.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp_mst.h"
|
||||
#include "intel_hdcp.h"
|
||||
#include "intel_hdcp_gsc.h"
|
||||
#include "intel_hdcp_regs.h"
|
||||
@@ -136,7 +138,7 @@ intel_hdcp_required_content_stream(struct intel_atomic_state *state,
|
||||
data->k++;
|
||||
|
||||
/* if there is only one active stream */
|
||||
if (dig_port->dp.mst.active_links <= 1)
|
||||
if (intel_dp_mst_active_streams(&dig_port->dp) <= 1)
|
||||
break;
|
||||
}
|
||||
drm_connector_list_iter_end(&conn_iter);
|
||||
@@ -334,9 +336,7 @@ static int intel_hdcp_poll_ksv_fifo(struct intel_digital_port *dig_port,
|
||||
|
||||
static bool hdcp_key_loadable(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
enum i915_power_well_id id;
|
||||
intel_wakeref_t wakeref;
|
||||
bool enabled = false;
|
||||
|
||||
/*
|
||||
@@ -349,7 +349,7 @@ static bool hdcp_key_loadable(struct intel_display *display)
|
||||
id = SKL_DISP_PW_1;
|
||||
|
||||
/* PG1 (power well #1) needs to be enabled */
|
||||
with_intel_runtime_pm(&i915->runtime_pm, wakeref)
|
||||
with_intel_display_rpm(display)
|
||||
enabled = intel_display_power_well_is_enabled(display, id);
|
||||
|
||||
/*
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "intel_panel.h"
|
||||
#include "intel_pfit.h"
|
||||
#include "intel_snps_phy.h"
|
||||
#include "intel_vrr.h"
|
||||
|
||||
static void
|
||||
assert_hdmi_port_disabled(struct intel_hdmi *intel_hdmi)
|
||||
@@ -2384,6 +2385,8 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,
|
||||
}
|
||||
}
|
||||
|
||||
intel_vrr_compute_config(pipe_config, conn_state);
|
||||
|
||||
intel_hdmi_compute_gcp_infoframe(encoder, pipe_config,
|
||||
conn_state);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,30 +8,31 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_i915_private;
|
||||
enum port;
|
||||
struct intel_connector;
|
||||
struct intel_digital_port;
|
||||
struct intel_display;
|
||||
struct intel_encoder;
|
||||
enum port;
|
||||
|
||||
void intel_hpd_poll_enable(struct drm_i915_private *dev_priv);
|
||||
void intel_hpd_poll_disable(struct drm_i915_private *dev_priv);
|
||||
void intel_hpd_poll_fini(struct drm_i915_private *i915);
|
||||
void intel_hpd_poll_enable(struct intel_display *display);
|
||||
void intel_hpd_poll_disable(struct intel_display *display);
|
||||
void intel_hpd_poll_fini(struct intel_display *display);
|
||||
enum intel_hotplug_state intel_encoder_hotplug(struct intel_encoder *encoder,
|
||||
struct intel_connector *connector);
|
||||
void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
|
||||
void intel_hpd_irq_handler(struct intel_display *display,
|
||||
u32 pin_mask, u32 long_mask);
|
||||
void intel_hpd_trigger_irq(struct intel_digital_port *dig_port);
|
||||
void intel_hpd_init(struct drm_i915_private *dev_priv);
|
||||
void intel_hpd_init_early(struct drm_i915_private *i915);
|
||||
void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
|
||||
void intel_hpd_init(struct intel_display *display);
|
||||
void intel_hpd_init_early(struct intel_display *display);
|
||||
void intel_hpd_cancel_work(struct intel_display *display);
|
||||
enum hpd_pin intel_hpd_pin_default(enum port port);
|
||||
bool intel_hpd_disable(struct drm_i915_private *dev_priv, enum hpd_pin pin);
|
||||
void intel_hpd_enable(struct drm_i915_private *dev_priv, enum hpd_pin pin);
|
||||
void intel_hpd_debugfs_register(struct drm_i915_private *i915);
|
||||
void intel_hpd_block(struct intel_encoder *encoder);
|
||||
void intel_hpd_unblock(struct intel_encoder *encoder);
|
||||
void intel_hpd_clear_and_unblock(struct intel_encoder *encoder);
|
||||
void intel_hpd_debugfs_register(struct intel_display *display);
|
||||
|
||||
void intel_hpd_enable_detection_work(struct drm_i915_private *i915);
|
||||
void intel_hpd_disable_detection_work(struct drm_i915_private *i915);
|
||||
bool intel_hpd_schedule_detection(struct drm_i915_private *i915);
|
||||
void intel_hpd_enable_detection_work(struct intel_display *display);
|
||||
void intel_hpd_disable_detection_work(struct intel_display *display);
|
||||
bool intel_hpd_schedule_detection(struct intel_display *display);
|
||||
|
||||
#endif /* __INTEL_HOTPLUG_H__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,28 +8,28 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_display;
|
||||
struct intel_encoder;
|
||||
|
||||
u32 i9xx_hpd_irq_ack(struct drm_i915_private *i915);
|
||||
u32 i9xx_hpd_irq_ack(struct intel_display *display);
|
||||
|
||||
void i9xx_hpd_irq_handler(struct drm_i915_private *i915, u32 hotplug_status);
|
||||
void ibx_hpd_irq_handler(struct drm_i915_private *i915, u32 hotplug_trigger);
|
||||
void ilk_hpd_irq_handler(struct drm_i915_private *i915, u32 hotplug_trigger);
|
||||
void gen11_hpd_irq_handler(struct drm_i915_private *i915, u32 iir);
|
||||
void bxt_hpd_irq_handler(struct drm_i915_private *i915, u32 hotplug_trigger);
|
||||
void xelpdp_pica_irq_handler(struct drm_i915_private *i915, u32 iir);
|
||||
void icp_irq_handler(struct drm_i915_private *i915, u32 pch_iir);
|
||||
void spt_irq_handler(struct drm_i915_private *i915, u32 pch_iir);
|
||||
void i9xx_hpd_irq_handler(struct intel_display *display, u32 hotplug_status);
|
||||
void ibx_hpd_irq_handler(struct intel_display *display, u32 hotplug_trigger);
|
||||
void ilk_hpd_irq_handler(struct intel_display *display, u32 hotplug_trigger);
|
||||
void gen11_hpd_irq_handler(struct intel_display *display, u32 iir);
|
||||
void bxt_hpd_irq_handler(struct intel_display *display, u32 hotplug_trigger);
|
||||
void xelpdp_pica_irq_handler(struct intel_display *display, u32 iir);
|
||||
void icp_irq_handler(struct intel_display *display, u32 pch_iir);
|
||||
void spt_irq_handler(struct intel_display *display, u32 pch_iir);
|
||||
|
||||
void i915_hotplug_interrupt_update_locked(struct drm_i915_private *i915,
|
||||
void i915_hotplug_interrupt_update_locked(struct intel_display *display,
|
||||
u32 mask, u32 bits);
|
||||
void i915_hotplug_interrupt_update(struct drm_i915_private *i915,
|
||||
void i915_hotplug_interrupt_update(struct intel_display *display,
|
||||
u32 mask, u32 bits);
|
||||
|
||||
void intel_hpd_enable_detection(struct intel_encoder *encoder);
|
||||
void intel_hpd_irq_setup(struct drm_i915_private *i915);
|
||||
void intel_hpd_irq_setup(struct intel_display *display);
|
||||
|
||||
void intel_hotplug_irq_init(struct drm_i915_private *i915);
|
||||
void intel_hotplug_irq_init(struct intel_display *display);
|
||||
|
||||
#endif /* __INTEL_HOTPLUG_IRQ_H__ */
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <drm/drm_device.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "intel_de.h"
|
||||
#include "intel_display.h"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_atomic_uapi.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_crtc.h"
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <drm/display/drm_hdmi_helper.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_edid.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_reg.h"
|
||||
#include "i915_utils.h"
|
||||
|
||||
@@ -84,12 +84,13 @@ static struct intel_lvds_encoder *to_lvds_encoder(struct intel_encoder *encoder)
|
||||
return container_of(encoder, struct intel_lvds_encoder, base);
|
||||
}
|
||||
|
||||
bool intel_lvds_port_enabled(struct drm_i915_private *i915,
|
||||
bool intel_lvds_port_enabled(struct intel_display *display,
|
||||
i915_reg_t lvds_reg, enum pipe *pipe)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
u32 val;
|
||||
|
||||
val = intel_de_read(i915, lvds_reg);
|
||||
val = intel_de_read(display, lvds_reg);
|
||||
|
||||
/* asserts want to know the pipe even if the port is disabled */
|
||||
if (HAS_PCH_CPT(i915))
|
||||
@@ -104,7 +105,6 @@ static bool intel_lvds_get_hw_state(struct intel_encoder *encoder,
|
||||
enum pipe *pipe)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder);
|
||||
intel_wakeref_t wakeref;
|
||||
bool ret;
|
||||
@@ -113,7 +113,7 @@ static bool intel_lvds_get_hw_state(struct intel_encoder *encoder,
|
||||
if (!wakeref)
|
||||
return false;
|
||||
|
||||
ret = intel_lvds_port_enabled(i915, lvds_encoder->reg, pipe);
|
||||
ret = intel_lvds_port_enabled(display, lvds_encoder->reg, pipe);
|
||||
|
||||
intel_display_power_put(display, encoder->power_domain, wakeref);
|
||||
|
||||
@@ -123,13 +123,13 @@ static bool intel_lvds_get_hw_state(struct intel_encoder *encoder,
|
||||
static void intel_lvds_get_config(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder);
|
||||
u32 tmp, flags = 0;
|
||||
|
||||
crtc_state->output_types |= BIT(INTEL_OUTPUT_LVDS);
|
||||
|
||||
tmp = intel_de_read(dev_priv, lvds_encoder->reg);
|
||||
tmp = intel_de_read(display, lvds_encoder->reg);
|
||||
if (tmp & LVDS_HSYNC_POLARITY)
|
||||
flags |= DRM_MODE_FLAG_NHSYNC;
|
||||
else
|
||||
@@ -141,13 +141,13 @@ static void intel_lvds_get_config(struct intel_encoder *encoder,
|
||||
|
||||
crtc_state->hw.adjusted_mode.flags |= flags;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) < 5)
|
||||
if (DISPLAY_VER(display) < 5)
|
||||
crtc_state->gmch_pfit.lvds_border_bits =
|
||||
tmp & LVDS_BORDER_ENABLE;
|
||||
|
||||
/* gen2/3 store dither state in pfit control, needs to match */
|
||||
if (DISPLAY_VER(dev_priv) < 4) {
|
||||
tmp = intel_de_read(dev_priv, PFIT_CONTROL(dev_priv));
|
||||
if (DISPLAY_VER(display) < 4) {
|
||||
tmp = intel_de_read(display, PFIT_CONTROL(display));
|
||||
|
||||
crtc_state->gmch_pfit.control |= tmp & PFIT_PANEL_8TO6_DITHER_ENABLE;
|
||||
}
|
||||
@@ -155,24 +155,24 @@ static void intel_lvds_get_config(struct intel_encoder *encoder,
|
||||
crtc_state->hw.adjusted_mode.crtc_clock = crtc_state->port_clock;
|
||||
}
|
||||
|
||||
static void intel_lvds_pps_get_hw_state(struct drm_i915_private *dev_priv,
|
||||
static void intel_lvds_pps_get_hw_state(struct intel_display *display,
|
||||
struct intel_lvds_pps *pps)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
pps->powerdown_on_reset = intel_de_read(dev_priv,
|
||||
PP_CONTROL(dev_priv, 0)) & PANEL_POWER_RESET;
|
||||
pps->powerdown_on_reset = intel_de_read(display,
|
||||
PP_CONTROL(display, 0)) & PANEL_POWER_RESET;
|
||||
|
||||
val = intel_de_read(dev_priv, PP_ON_DELAYS(dev_priv, 0));
|
||||
val = intel_de_read(display, PP_ON_DELAYS(display, 0));
|
||||
pps->port = REG_FIELD_GET(PANEL_PORT_SELECT_MASK, val);
|
||||
pps->delays.power_up = REG_FIELD_GET(PANEL_POWER_UP_DELAY_MASK, val);
|
||||
pps->delays.backlight_on = REG_FIELD_GET(PANEL_LIGHT_ON_DELAY_MASK, val);
|
||||
|
||||
val = intel_de_read(dev_priv, PP_OFF_DELAYS(dev_priv, 0));
|
||||
val = intel_de_read(display, PP_OFF_DELAYS(display, 0));
|
||||
pps->delays.power_down = REG_FIELD_GET(PANEL_POWER_DOWN_DELAY_MASK, val);
|
||||
pps->delays.backlight_off = REG_FIELD_GET(PANEL_LIGHT_OFF_DELAY_MASK, val);
|
||||
|
||||
val = intel_de_read(dev_priv, PP_DIVISOR(dev_priv, 0));
|
||||
val = intel_de_read(display, PP_DIVISOR(display, 0));
|
||||
pps->divider = REG_FIELD_GET(PP_REFERENCE_DIVIDER_MASK, val);
|
||||
val = REG_FIELD_GET(PANEL_POWER_CYCLE_DELAY_MASK, val);
|
||||
/*
|
||||
@@ -185,12 +185,12 @@ static void intel_lvds_pps_get_hw_state(struct drm_i915_private *dev_priv,
|
||||
/* Convert from 100ms to 100us units */
|
||||
pps->delays.power_cycle = val * 1000;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) < 5 &&
|
||||
if (DISPLAY_VER(display) < 5 &&
|
||||
pps->delays.power_up == 0 &&
|
||||
pps->delays.backlight_on == 0 &&
|
||||
pps->delays.power_down == 0 &&
|
||||
pps->delays.backlight_off == 0) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Panel power timings uninitialized, "
|
||||
"setting defaults\n");
|
||||
/* Set T2 to 40ms and T5 to 200ms in 100 usec units */
|
||||
@@ -201,7 +201,7 @@ static void intel_lvds_pps_get_hw_state(struct drm_i915_private *dev_priv,
|
||||
pps->delays.backlight_off = 200 * 10;
|
||||
}
|
||||
|
||||
drm_dbg(&dev_priv->drm, "LVDS PPS:power_up %d power_down %d power_cycle %d backlight_on %d backlight_off %d "
|
||||
drm_dbg(display->drm, "LVDS PPS:power_up %d power_down %d power_cycle %d backlight_on %d backlight_off %d "
|
||||
"divider %d port %d powerdown_on_reset %d\n",
|
||||
pps->delays.power_up, pps->delays.power_down,
|
||||
pps->delays.power_cycle, pps->delays.backlight_on,
|
||||
@@ -209,28 +209,28 @@ static void intel_lvds_pps_get_hw_state(struct drm_i915_private *dev_priv,
|
||||
pps->port, pps->powerdown_on_reset);
|
||||
}
|
||||
|
||||
static void intel_lvds_pps_init_hw(struct drm_i915_private *dev_priv,
|
||||
static void intel_lvds_pps_init_hw(struct intel_display *display,
|
||||
struct intel_lvds_pps *pps)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
val = intel_de_read(dev_priv, PP_CONTROL(dev_priv, 0));
|
||||
drm_WARN_ON(&dev_priv->drm,
|
||||
val = intel_de_read(display, PP_CONTROL(display, 0));
|
||||
drm_WARN_ON(display->drm,
|
||||
(val & PANEL_UNLOCK_MASK) != PANEL_UNLOCK_REGS);
|
||||
if (pps->powerdown_on_reset)
|
||||
val |= PANEL_POWER_RESET;
|
||||
intel_de_write(dev_priv, PP_CONTROL(dev_priv, 0), val);
|
||||
intel_de_write(display, PP_CONTROL(display, 0), val);
|
||||
|
||||
intel_de_write(dev_priv, PP_ON_DELAYS(dev_priv, 0),
|
||||
intel_de_write(display, PP_ON_DELAYS(display, 0),
|
||||
REG_FIELD_PREP(PANEL_PORT_SELECT_MASK, pps->port) |
|
||||
REG_FIELD_PREP(PANEL_POWER_UP_DELAY_MASK, pps->delays.power_up) |
|
||||
REG_FIELD_PREP(PANEL_LIGHT_ON_DELAY_MASK, pps->delays.backlight_on));
|
||||
|
||||
intel_de_write(dev_priv, PP_OFF_DELAYS(dev_priv, 0),
|
||||
intel_de_write(display, PP_OFF_DELAYS(display, 0),
|
||||
REG_FIELD_PREP(PANEL_POWER_DOWN_DELAY_MASK, pps->delays.power_down) |
|
||||
REG_FIELD_PREP(PANEL_LIGHT_OFF_DELAY_MASK, pps->delays.backlight_off));
|
||||
|
||||
intel_de_write(dev_priv, PP_DIVISOR(dev_priv, 0),
|
||||
intel_de_write(display, PP_DIVISOR(display, 0),
|
||||
REG_FIELD_PREP(PP_REFERENCE_DIVIDER_MASK, pps->divider) |
|
||||
REG_FIELD_PREP(PANEL_POWER_CYCLE_DELAY_MASK,
|
||||
DIV_ROUND_UP(pps->delays.power_cycle, 1000) + 1));
|
||||
@@ -256,7 +256,7 @@ static void intel_pre_enable_lvds(struct intel_atomic_state *state,
|
||||
assert_pll_disabled(display, pipe);
|
||||
}
|
||||
|
||||
intel_lvds_pps_init_hw(i915, &lvds_encoder->init_pps);
|
||||
intel_lvds_pps_init_hw(display, &lvds_encoder->init_pps);
|
||||
|
||||
temp = lvds_encoder->init_lvds_val;
|
||||
temp |= LVDS_PORT_EN | LVDS_A0A2_CLKA_POWER_UP;
|
||||
@@ -296,7 +296,7 @@ static void intel_pre_enable_lvds(struct intel_atomic_state *state,
|
||||
* special lvds dither control bit on pch-split platforms, dithering is
|
||||
* only controlled through the TRANSCONF reg.
|
||||
*/
|
||||
if (DISPLAY_VER(i915) == 4) {
|
||||
if (DISPLAY_VER(display) == 4) {
|
||||
/*
|
||||
* Bspec wording suggests that LVDS port dithering only exists
|
||||
* for 18bpp panels.
|
||||
@@ -312,7 +312,7 @@ static void intel_pre_enable_lvds(struct intel_atomic_state *state,
|
||||
if (adjusted_mode->flags & DRM_MODE_FLAG_NVSYNC)
|
||||
temp |= LVDS_VSYNC_POLARITY;
|
||||
|
||||
intel_de_write(i915, lvds_encoder->reg, temp);
|
||||
intel_de_write(display, lvds_encoder->reg, temp);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -323,16 +323,16 @@ static void intel_enable_lvds(struct intel_atomic_state *state,
|
||||
const struct intel_crtc_state *crtc_state,
|
||||
const struct drm_connector_state *conn_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
|
||||
intel_de_rmw(dev_priv, lvds_encoder->reg, 0, LVDS_PORT_EN);
|
||||
intel_de_rmw(display, lvds_encoder->reg, 0, LVDS_PORT_EN);
|
||||
|
||||
intel_de_rmw(dev_priv, PP_CONTROL(dev_priv, 0), 0, PANEL_POWER_ON);
|
||||
intel_de_posting_read(dev_priv, lvds_encoder->reg);
|
||||
intel_de_rmw(display, PP_CONTROL(display, 0), 0, PANEL_POWER_ON);
|
||||
intel_de_posting_read(display, lvds_encoder->reg);
|
||||
|
||||
if (intel_de_wait_for_set(dev_priv, PP_STATUS(dev_priv, 0), PP_ON, 5000))
|
||||
drm_err(&dev_priv->drm,
|
||||
if (intel_de_wait_for_set(display, PP_STATUS(display, 0), PP_ON, 5000))
|
||||
drm_err(display->drm,
|
||||
"timed out waiting for panel to power on\n");
|
||||
|
||||
intel_backlight_enable(crtc_state, conn_state);
|
||||
@@ -343,16 +343,16 @@ static void intel_disable_lvds(struct intel_atomic_state *state,
|
||||
const struct intel_crtc_state *old_crtc_state,
|
||||
const struct drm_connector_state *old_conn_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
|
||||
intel_de_rmw(dev_priv, PP_CONTROL(dev_priv, 0), PANEL_POWER_ON, 0);
|
||||
if (intel_de_wait_for_clear(dev_priv, PP_STATUS(dev_priv, 0), PP_ON, 1000))
|
||||
drm_err(&dev_priv->drm,
|
||||
intel_de_rmw(display, PP_CONTROL(display, 0), PANEL_POWER_ON, 0);
|
||||
if (intel_de_wait_for_clear(display, PP_STATUS(display, 0), PP_ON, 1000))
|
||||
drm_err(display->drm,
|
||||
"timed out waiting for panel to power off\n");
|
||||
|
||||
intel_de_rmw(dev_priv, lvds_encoder->reg, LVDS_PORT_EN, 0);
|
||||
intel_de_posting_read(dev_priv, lvds_encoder->reg);
|
||||
intel_de_rmw(display, lvds_encoder->reg, LVDS_PORT_EN, 0);
|
||||
intel_de_posting_read(display, lvds_encoder->reg);
|
||||
}
|
||||
|
||||
static void gmch_disable_lvds(struct intel_atomic_state *state,
|
||||
@@ -384,10 +384,10 @@ static void pch_post_disable_lvds(struct intel_atomic_state *state,
|
||||
|
||||
static void intel_lvds_shutdown(struct intel_encoder *encoder)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
|
||||
if (intel_de_wait_for_clear(dev_priv, PP_STATUS(dev_priv, 0), PP_CYCLE_DELAY_ACTIVE, 5000))
|
||||
drm_err(&dev_priv->drm,
|
||||
if (intel_de_wait_for_clear(display, PP_STATUS(display, 0), PP_CYCLE_DELAY_ACTIVE, 5000))
|
||||
drm_err(display->drm,
|
||||
"timed out waiting for panel power cycle delay\n");
|
||||
}
|
||||
|
||||
@@ -420,6 +420,7 @@ static int intel_lvds_compute_config(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *crtc_state,
|
||||
struct drm_connector_state *conn_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder);
|
||||
struct intel_connector *connector = lvds_encoder->attached_connector;
|
||||
@@ -429,8 +430,8 @@ static int intel_lvds_compute_config(struct intel_encoder *encoder,
|
||||
int ret;
|
||||
|
||||
/* Should never happen!! */
|
||||
if (DISPLAY_VER(i915) < 4 && crtc->pipe == 0) {
|
||||
drm_err(&i915->drm, "Can't support LVDS on pipe A\n");
|
||||
if (DISPLAY_VER(display) < 4 && crtc->pipe == 0) {
|
||||
drm_err(display->drm, "Can't support LVDS on pipe A\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -447,7 +448,7 @@ static int intel_lvds_compute_config(struct intel_encoder *encoder,
|
||||
|
||||
/* TODO: Check crtc_state->max_link_bpp_x16 instead of bw_constrained */
|
||||
if (lvds_bpp != crtc_state->pipe_bpp && !crtc_state->bw_constrained) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"forcing display bpp (was %d) to LVDS (%d)\n",
|
||||
crtc_state->pipe_bpp, lvds_bpp);
|
||||
crtc_state->pipe_bpp = lvds_bpp;
|
||||
@@ -775,11 +776,11 @@ static const struct dmi_system_id intel_dual_link_lvds[] = {
|
||||
{ } /* terminating entry */
|
||||
};
|
||||
|
||||
struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *i915)
|
||||
struct intel_encoder *intel_get_lvds_encoder(struct intel_display *display)
|
||||
{
|
||||
struct intel_encoder *encoder;
|
||||
|
||||
for_each_intel_encoder(&i915->drm, encoder) {
|
||||
for_each_intel_encoder(display->drm, encoder) {
|
||||
if (encoder->type == INTEL_OUTPUT_LVDS)
|
||||
return encoder;
|
||||
}
|
||||
@@ -787,15 +788,16 @@ struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *i915)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool intel_is_dual_link_lvds(struct drm_i915_private *i915)
|
||||
bool intel_is_dual_link_lvds(struct intel_display *display)
|
||||
{
|
||||
struct intel_encoder *encoder = intel_get_lvds_encoder(i915);
|
||||
struct intel_encoder *encoder = intel_get_lvds_encoder(display);
|
||||
|
||||
return encoder && to_lvds_encoder(encoder)->is_dual_link;
|
||||
}
|
||||
|
||||
static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(&lvds_encoder->base);
|
||||
struct drm_i915_private *i915 = to_i915(lvds_encoder->base.base.dev);
|
||||
struct intel_connector *connector = lvds_encoder->attached_connector;
|
||||
const struct drm_display_mode *fixed_mode =
|
||||
@@ -803,8 +805,8 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
|
||||
unsigned int val;
|
||||
|
||||
/* use the module option value if specified */
|
||||
if (i915->display.params.lvds_channel_mode > 0)
|
||||
return i915->display.params.lvds_channel_mode == 2;
|
||||
if (display->params.lvds_channel_mode > 0)
|
||||
return display->params.lvds_channel_mode == 2;
|
||||
|
||||
/* single channel LVDS is limited to 112 MHz */
|
||||
if (fixed_mode->clock > 112999)
|
||||
@@ -819,7 +821,7 @@ static bool compute_is_dual_link_lvds(struct intel_lvds_encoder *lvds_encoder)
|
||||
* we need to check "the value to be set" in VBT when LVDS
|
||||
* register is uninitialized.
|
||||
*/
|
||||
val = intel_de_read(i915, lvds_encoder->reg);
|
||||
val = intel_de_read(display, lvds_encoder->reg);
|
||||
if (HAS_PCH_CPT(i915))
|
||||
val &= ~(LVDS_DETECTED | LVDS_PIPE_SEL_MASK_CPT);
|
||||
else
|
||||
@@ -837,14 +839,14 @@ static void intel_lvds_add_properties(struct drm_connector *connector)
|
||||
|
||||
/**
|
||||
* intel_lvds_init - setup LVDS connectors on this device
|
||||
* @i915: i915 device
|
||||
* @display: display device
|
||||
*
|
||||
* Create the connector, register the LVDS DDC bus, and try to figure out what
|
||||
* modes we can display on the LVDS panel (if present).
|
||||
*/
|
||||
void intel_lvds_init(struct drm_i915_private *i915)
|
||||
void intel_lvds_init(struct intel_display *display)
|
||||
{
|
||||
struct intel_display *display = &i915->display;
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct intel_lvds_encoder *lvds_encoder;
|
||||
struct intel_connector *connector;
|
||||
const struct drm_edid *drm_edid;
|
||||
@@ -855,13 +857,13 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
|
||||
/* Skip init on machines we know falsely report LVDS */
|
||||
if (dmi_check_system(intel_no_lvds)) {
|
||||
drm_WARN(&i915->drm, !i915->display.vbt.int_lvds_support,
|
||||
drm_WARN(display->drm, !display->vbt.int_lvds_support,
|
||||
"Useless DMI match. Internal LVDS support disabled by VBT\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!i915->display.vbt.int_lvds_support) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
if (!display->vbt.int_lvds_support) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"Internal LVDS support disabled by VBT\n");
|
||||
return;
|
||||
}
|
||||
@@ -871,7 +873,7 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
else
|
||||
lvds_reg = LVDS;
|
||||
|
||||
lvds = intel_de_read(i915, lvds_reg);
|
||||
lvds = intel_de_read(display, lvds_reg);
|
||||
|
||||
if (HAS_PCH_SPLIT(i915)) {
|
||||
if ((lvds & LVDS_DETECTED) == 0)
|
||||
@@ -881,11 +883,11 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
ddc_pin = GMBUS_PIN_PANEL;
|
||||
if (!intel_bios_is_lvds_present(display, &ddc_pin)) {
|
||||
if ((lvds & LVDS_PORT_EN) == 0) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"LVDS is not present in VBT\n");
|
||||
return;
|
||||
}
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"LVDS is not present in VBT, but enabled anyway\n");
|
||||
}
|
||||
|
||||
@@ -902,12 +904,12 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
lvds_encoder->attached_connector = connector;
|
||||
encoder = &lvds_encoder->base;
|
||||
|
||||
drm_connector_init_with_ddc(&i915->drm, &connector->base,
|
||||
drm_connector_init_with_ddc(display->drm, &connector->base,
|
||||
&intel_lvds_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_LVDS,
|
||||
intel_gmbus_get_adapter(display, ddc_pin));
|
||||
|
||||
drm_encoder_init(&i915->drm, &encoder->base, &intel_lvds_enc_funcs,
|
||||
drm_encoder_init(display->drm, &encoder->base, &intel_lvds_enc_funcs,
|
||||
DRM_MODE_ENCODER_LVDS, "LVDS");
|
||||
|
||||
encoder->enable = intel_enable_lvds;
|
||||
@@ -931,7 +933,7 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
encoder->power_domain = POWER_DOMAIN_PORT_OTHER;
|
||||
encoder->port = PORT_NONE;
|
||||
encoder->cloneable = 0;
|
||||
if (DISPLAY_VER(i915) < 4)
|
||||
if (DISPLAY_VER(display) < 4)
|
||||
encoder->pipe_mask = BIT(PIPE_B);
|
||||
else
|
||||
encoder->pipe_mask = ~0;
|
||||
@@ -943,7 +945,7 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
|
||||
intel_lvds_add_properties(&connector->base);
|
||||
|
||||
intel_lvds_pps_get_hw_state(i915, &lvds_encoder->init_pps);
|
||||
intel_lvds_pps_get_hw_state(display, &lvds_encoder->init_pps);
|
||||
lvds_encoder->init_lvds_val = lvds;
|
||||
|
||||
/*
|
||||
@@ -958,7 +960,7 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
* Attempt to get the fixed panel mode from DDC. Assume that the
|
||||
* preferred mode is the right one.
|
||||
*/
|
||||
mutex_lock(&i915->drm.mode_config.mutex);
|
||||
mutex_lock(&display->drm->mode_config.mutex);
|
||||
if (vga_switcheroo_handler_flags() & VGA_SWITCHEROO_CAN_SWITCH_DDC)
|
||||
drm_edid = drm_edid_read_switcheroo(&connector->base, connector->base.ddc);
|
||||
else
|
||||
@@ -991,7 +993,7 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
if (!intel_panel_preferred_fixed_mode(connector))
|
||||
intel_panel_add_encoder_fixed_mode(connector, encoder);
|
||||
|
||||
mutex_unlock(&i915->drm.mode_config.mutex);
|
||||
mutex_unlock(&display->drm->mode_config.mutex);
|
||||
|
||||
/* If we still don't have a mode after all that, give up. */
|
||||
if (!intel_panel_preferred_fixed_mode(connector))
|
||||
@@ -1002,7 +1004,7 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
intel_backlight_setup(connector, INVALID_PIPE);
|
||||
|
||||
lvds_encoder->is_dual_link = compute_is_dual_link_lvds(lvds_encoder);
|
||||
drm_dbg_kms(&i915->drm, "detected %s-link lvds configuration\n",
|
||||
drm_dbg_kms(display->drm, "detected %s-link lvds configuration\n",
|
||||
lvds_encoder->is_dual_link ? "dual" : "single");
|
||||
|
||||
lvds_encoder->a3_power = lvds & LVDS_A3_POWER_MASK;
|
||||
@@ -1010,7 +1012,7 @@ void intel_lvds_init(struct drm_i915_private *i915)
|
||||
return;
|
||||
|
||||
failed:
|
||||
drm_dbg_kms(&i915->drm, "No LVDS modes found, disabling.\n");
|
||||
drm_dbg_kms(display->drm, "No LVDS modes found, disabling.\n");
|
||||
drm_connector_cleanup(&connector->base);
|
||||
drm_encoder_cleanup(&encoder->base);
|
||||
kfree(lvds_encoder);
|
||||
|
||||
@@ -11,28 +11,28 @@
|
||||
#include "i915_reg_defs.h"
|
||||
|
||||
enum pipe;
|
||||
struct drm_i915_private;
|
||||
struct intel_display;
|
||||
|
||||
#ifdef I915
|
||||
bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
|
||||
bool intel_lvds_port_enabled(struct intel_display *display,
|
||||
i915_reg_t lvds_reg, enum pipe *pipe);
|
||||
void intel_lvds_init(struct drm_i915_private *dev_priv);
|
||||
struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *dev_priv);
|
||||
bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv);
|
||||
void intel_lvds_init(struct intel_display *display);
|
||||
struct intel_encoder *intel_get_lvds_encoder(struct intel_display *display);
|
||||
bool intel_is_dual_link_lvds(struct intel_display *display);
|
||||
#else
|
||||
static inline bool intel_lvds_port_enabled(struct drm_i915_private *dev_priv,
|
||||
static inline bool intel_lvds_port_enabled(struct intel_display *display,
|
||||
i915_reg_t lvds_reg, enum pipe *pipe)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline void intel_lvds_init(struct drm_i915_private *dev_priv)
|
||||
static inline void intel_lvds_init(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
static inline struct intel_encoder *intel_get_lvds_encoder(struct drm_i915_private *dev_priv)
|
||||
static inline struct intel_encoder *intel_get_lvds_encoder(struct intel_display *display)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline bool intel_is_dual_link_lvds(struct drm_i915_private *dev_priv)
|
||||
static inline bool intel_is_dual_link_lvds(struct intel_display *display)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -155,9 +155,8 @@ static void reset_crtc_encoder_state(struct intel_crtc *crtc)
|
||||
static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
|
||||
struct intel_pmdemand_state *pmdemand_state =
|
||||
to_intel_pmdemand_state(i915->display.pmdemand.obj.state);
|
||||
to_intel_pmdemand_state(display->pmdemand.obj.state);
|
||||
struct intel_crtc_state *crtc_state =
|
||||
to_intel_crtc_state(crtc->base.state);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
@@ -169,7 +168,7 @@ static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc)
|
||||
reset_crtc_encoder_state(crtc);
|
||||
|
||||
intel_fbc_disable(crtc);
|
||||
intel_update_watermarks(i915);
|
||||
intel_update_watermarks(display);
|
||||
|
||||
intel_display_power_put_all_in_set(display, &crtc->enabled_power_domains);
|
||||
|
||||
@@ -821,18 +820,18 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915)
|
||||
to_intel_crtc_state(crtc->base.state);
|
||||
struct intel_plane *plane;
|
||||
|
||||
if (crtc_state->hw.active) {
|
||||
/*
|
||||
* The initial mode needs to be set in order to keep
|
||||
* the atomic core happy. It wants a valid mode if the
|
||||
* crtc's enabled, so we do the above call.
|
||||
*
|
||||
* But we don't set all the derived state fully, hence
|
||||
* set a flag to indicate that a full recalculation is
|
||||
* needed on the next commit.
|
||||
*/
|
||||
crtc_state->inherited = true;
|
||||
/*
|
||||
* The initial mode needs to be set in order to keep
|
||||
* the atomic core happy. It wants a valid mode if the
|
||||
* crtc's enabled, so we do the above call.
|
||||
*
|
||||
* But we don't set all the derived state fully, hence
|
||||
* set a flag to indicate that a full recalculation is
|
||||
* needed on the next commit.
|
||||
*/
|
||||
crtc_state->inherited = true;
|
||||
|
||||
if (crtc_state->hw.active) {
|
||||
intel_crtc_update_active_timings(crtc_state,
|
||||
crtc_state->vrr.enable);
|
||||
|
||||
@@ -874,7 +873,7 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915)
|
||||
|
||||
/* TODO move here (or even earlier?) on all platforms */
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
intel_wm_get_hw_state(i915);
|
||||
intel_wm_get_hw_state(display);
|
||||
|
||||
intel_bw_update_hw_state(display);
|
||||
intel_cdclk_update_hw_state(display);
|
||||
@@ -947,7 +946,7 @@ void intel_modeset_setup_hw_state(struct drm_i915_private *i915,
|
||||
/* HW state is read out, now we need to sanitize this mess. */
|
||||
get_encoder_power_domains(i915);
|
||||
|
||||
intel_pch_sanitize(i915);
|
||||
intel_pch_sanitize(display);
|
||||
|
||||
intel_cmtg_sanitize(display);
|
||||
|
||||
@@ -988,8 +987,8 @@ void intel_modeset_setup_hw_state(struct drm_i915_private *i915,
|
||||
|
||||
/* TODO move earlier on all platforms */
|
||||
if (DISPLAY_VER(display) < 9)
|
||||
intel_wm_get_hw_state(i915);
|
||||
intel_wm_sanitize(i915);
|
||||
intel_wm_get_hw_state(display);
|
||||
intel_wm_sanitize(display);
|
||||
|
||||
for_each_intel_crtc(&i915->drm, crtc) {
|
||||
struct intel_crtc_state *crtc_state =
|
||||
|
||||
@@ -20,9 +20,11 @@
|
||||
#include "intel_pps.h"
|
||||
#include "intel_sdvo.h"
|
||||
|
||||
bool intel_has_pch_trancoder(struct drm_i915_private *i915,
|
||||
bool intel_has_pch_trancoder(struct intel_display *display,
|
||||
enum pipe pch_transcoder)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
return HAS_PCH_IBX(i915) || HAS_PCH_CPT(i915) ||
|
||||
(HAS_PCH_LPT_H(i915) && pch_transcoder == PIPE_A);
|
||||
}
|
||||
@@ -37,11 +39,11 @@ enum pipe intel_crtc_pch_transcoder(struct intel_crtc *crtc)
|
||||
return crtc->pipe;
|
||||
}
|
||||
|
||||
static void assert_pch_dp_disabled(struct drm_i915_private *dev_priv,
|
||||
static void assert_pch_dp_disabled(struct intel_display *display,
|
||||
enum pipe pipe, enum port port,
|
||||
i915_reg_t dp_reg)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum pipe port_pipe;
|
||||
bool state;
|
||||
|
||||
@@ -57,11 +59,11 @@ static void assert_pch_dp_disabled(struct drm_i915_private *dev_priv,
|
||||
port_name(port));
|
||||
}
|
||||
|
||||
static void assert_pch_hdmi_disabled(struct drm_i915_private *dev_priv,
|
||||
static void assert_pch_hdmi_disabled(struct intel_display *display,
|
||||
enum pipe pipe, enum port port,
|
||||
i915_reg_t hdmi_reg)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum pipe port_pipe;
|
||||
bool state;
|
||||
|
||||
@@ -77,15 +79,14 @@ static void assert_pch_hdmi_disabled(struct drm_i915_private *dev_priv,
|
||||
port_name(port));
|
||||
}
|
||||
|
||||
static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv,
|
||||
static void assert_pch_ports_disabled(struct intel_display *display,
|
||||
enum pipe pipe)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
enum pipe port_pipe;
|
||||
|
||||
assert_pch_dp_disabled(dev_priv, pipe, PORT_B, PCH_DP_B);
|
||||
assert_pch_dp_disabled(dev_priv, pipe, PORT_C, PCH_DP_C);
|
||||
assert_pch_dp_disabled(dev_priv, pipe, PORT_D, PCH_DP_D);
|
||||
assert_pch_dp_disabled(display, pipe, PORT_B, PCH_DP_B);
|
||||
assert_pch_dp_disabled(display, pipe, PORT_C, PCH_DP_C);
|
||||
assert_pch_dp_disabled(display, pipe, PORT_D, PCH_DP_D);
|
||||
|
||||
INTEL_DISPLAY_STATE_WARN(display,
|
||||
intel_crt_port_enabled(display, PCH_ADPA, &port_pipe) && port_pipe == pipe,
|
||||
@@ -93,20 +94,19 @@ static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv,
|
||||
pipe_name(pipe));
|
||||
|
||||
INTEL_DISPLAY_STATE_WARN(display,
|
||||
intel_lvds_port_enabled(dev_priv, PCH_LVDS, &port_pipe) && port_pipe == pipe,
|
||||
intel_lvds_port_enabled(display, PCH_LVDS, &port_pipe) && port_pipe == pipe,
|
||||
"PCH LVDS enabled on transcoder %c, should be disabled\n",
|
||||
pipe_name(pipe));
|
||||
|
||||
/* PCH SDVOB multiplex with HDMIB */
|
||||
assert_pch_hdmi_disabled(dev_priv, pipe, PORT_B, PCH_HDMIB);
|
||||
assert_pch_hdmi_disabled(dev_priv, pipe, PORT_C, PCH_HDMIC);
|
||||
assert_pch_hdmi_disabled(dev_priv, pipe, PORT_D, PCH_HDMID);
|
||||
assert_pch_hdmi_disabled(display, pipe, PORT_B, PCH_HDMIB);
|
||||
assert_pch_hdmi_disabled(display, pipe, PORT_C, PCH_HDMIC);
|
||||
assert_pch_hdmi_disabled(display, pipe, PORT_D, PCH_HDMID);
|
||||
}
|
||||
|
||||
static void assert_pch_transcoder_disabled(struct drm_i915_private *dev_priv,
|
||||
static void assert_pch_transcoder_disabled(struct intel_display *display,
|
||||
enum pipe pipe)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
u32 val;
|
||||
bool enabled;
|
||||
|
||||
@@ -117,45 +117,45 @@ static void assert_pch_transcoder_disabled(struct drm_i915_private *dev_priv,
|
||||
pipe_name(pipe));
|
||||
}
|
||||
|
||||
static void ibx_sanitize_pch_hdmi_port(struct drm_i915_private *dev_priv,
|
||||
static void ibx_sanitize_pch_hdmi_port(struct intel_display *display,
|
||||
enum port port, i915_reg_t hdmi_reg)
|
||||
{
|
||||
u32 val = intel_de_read(dev_priv, hdmi_reg);
|
||||
u32 val = intel_de_read(display, hdmi_reg);
|
||||
|
||||
if (val & SDVO_ENABLE ||
|
||||
(val & SDVO_PIPE_SEL_MASK) == SDVO_PIPE_SEL(PIPE_A))
|
||||
return;
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Sanitizing transcoder select for HDMI %c\n",
|
||||
port_name(port));
|
||||
|
||||
val &= ~SDVO_PIPE_SEL_MASK;
|
||||
val |= SDVO_PIPE_SEL(PIPE_A);
|
||||
|
||||
intel_de_write(dev_priv, hdmi_reg, val);
|
||||
intel_de_write(display, hdmi_reg, val);
|
||||
}
|
||||
|
||||
static void ibx_sanitize_pch_dp_port(struct drm_i915_private *dev_priv,
|
||||
static void ibx_sanitize_pch_dp_port(struct intel_display *display,
|
||||
enum port port, i915_reg_t dp_reg)
|
||||
{
|
||||
u32 val = intel_de_read(dev_priv, dp_reg);
|
||||
u32 val = intel_de_read(display, dp_reg);
|
||||
|
||||
if (val & DP_PORT_EN ||
|
||||
(val & DP_PIPE_SEL_MASK) == DP_PIPE_SEL(PIPE_A))
|
||||
return;
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Sanitizing transcoder select for DP %c\n",
|
||||
port_name(port));
|
||||
|
||||
val &= ~DP_PIPE_SEL_MASK;
|
||||
val |= DP_PIPE_SEL(PIPE_A);
|
||||
|
||||
intel_de_write(dev_priv, dp_reg, val);
|
||||
intel_de_write(display, dp_reg, val);
|
||||
}
|
||||
|
||||
static void ibx_sanitize_pch_ports(struct drm_i915_private *dev_priv)
|
||||
static void ibx_sanitize_pch_ports(struct intel_display *display)
|
||||
{
|
||||
/*
|
||||
* The BIOS may select transcoder B on some of the PCH
|
||||
@@ -168,14 +168,14 @@ static void ibx_sanitize_pch_ports(struct drm_i915_private *dev_priv)
|
||||
* (see. intel_dp_link_down(), intel_disable_hdmi(),
|
||||
* intel_disable_sdvo()).
|
||||
*/
|
||||
ibx_sanitize_pch_dp_port(dev_priv, PORT_B, PCH_DP_B);
|
||||
ibx_sanitize_pch_dp_port(dev_priv, PORT_C, PCH_DP_C);
|
||||
ibx_sanitize_pch_dp_port(dev_priv, PORT_D, PCH_DP_D);
|
||||
ibx_sanitize_pch_dp_port(display, PORT_B, PCH_DP_B);
|
||||
ibx_sanitize_pch_dp_port(display, PORT_C, PCH_DP_C);
|
||||
ibx_sanitize_pch_dp_port(display, PORT_D, PCH_DP_D);
|
||||
|
||||
/* PCH SDVOB multiplex with HDMIB */
|
||||
ibx_sanitize_pch_hdmi_port(dev_priv, PORT_B, PCH_HDMIB);
|
||||
ibx_sanitize_pch_hdmi_port(dev_priv, PORT_C, PCH_HDMIC);
|
||||
ibx_sanitize_pch_hdmi_port(dev_priv, PORT_D, PCH_HDMID);
|
||||
ibx_sanitize_pch_hdmi_port(display, PORT_B, PCH_HDMIB);
|
||||
ibx_sanitize_pch_hdmi_port(display, PORT_C, PCH_HDMIC);
|
||||
ibx_sanitize_pch_hdmi_port(display, PORT_D, PCH_HDMID);
|
||||
}
|
||||
|
||||
static void intel_pch_transcoder_set_m1_n1(struct intel_crtc *crtc,
|
||||
@@ -225,31 +225,30 @@ void intel_pch_transcoder_get_m2_n2(struct intel_crtc *crtc,
|
||||
static void ilk_pch_transcoder_set_timings(const struct intel_crtc_state *crtc_state,
|
||||
enum pipe pch_transcoder)
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
|
||||
|
||||
intel_de_write(dev_priv, PCH_TRANS_HTOTAL(pch_transcoder),
|
||||
intel_de_read(dev_priv, TRANS_HTOTAL(dev_priv, cpu_transcoder)));
|
||||
intel_de_write(dev_priv, PCH_TRANS_HBLANK(pch_transcoder),
|
||||
intel_de_read(dev_priv, TRANS_HBLANK(dev_priv, cpu_transcoder)));
|
||||
intel_de_write(dev_priv, PCH_TRANS_HSYNC(pch_transcoder),
|
||||
intel_de_read(dev_priv, TRANS_HSYNC(dev_priv, cpu_transcoder)));
|
||||
intel_de_write(display, PCH_TRANS_HTOTAL(pch_transcoder),
|
||||
intel_de_read(display, TRANS_HTOTAL(display, cpu_transcoder)));
|
||||
intel_de_write(display, PCH_TRANS_HBLANK(pch_transcoder),
|
||||
intel_de_read(display, TRANS_HBLANK(display, cpu_transcoder)));
|
||||
intel_de_write(display, PCH_TRANS_HSYNC(pch_transcoder),
|
||||
intel_de_read(display, TRANS_HSYNC(display, cpu_transcoder)));
|
||||
|
||||
intel_de_write(dev_priv, PCH_TRANS_VTOTAL(pch_transcoder),
|
||||
intel_de_read(dev_priv, TRANS_VTOTAL(dev_priv, cpu_transcoder)));
|
||||
intel_de_write(dev_priv, PCH_TRANS_VBLANK(pch_transcoder),
|
||||
intel_de_read(dev_priv, TRANS_VBLANK(dev_priv, cpu_transcoder)));
|
||||
intel_de_write(dev_priv, PCH_TRANS_VSYNC(pch_transcoder),
|
||||
intel_de_read(dev_priv, TRANS_VSYNC(dev_priv, cpu_transcoder)));
|
||||
intel_de_write(dev_priv, PCH_TRANS_VSYNCSHIFT(pch_transcoder),
|
||||
intel_de_read(dev_priv, TRANS_VSYNCSHIFT(dev_priv, cpu_transcoder)));
|
||||
intel_de_write(display, PCH_TRANS_VTOTAL(pch_transcoder),
|
||||
intel_de_read(display, TRANS_VTOTAL(display, cpu_transcoder)));
|
||||
intel_de_write(display, PCH_TRANS_VBLANK(pch_transcoder),
|
||||
intel_de_read(display, TRANS_VBLANK(display, cpu_transcoder)));
|
||||
intel_de_write(display, PCH_TRANS_VSYNC(pch_transcoder),
|
||||
intel_de_read(display, TRANS_VSYNC(display, cpu_transcoder)));
|
||||
intel_de_write(display, PCH_TRANS_VSYNCSHIFT(pch_transcoder),
|
||||
intel_de_read(display, TRANS_VSYNCSHIFT(display, cpu_transcoder)));
|
||||
}
|
||||
|
||||
static void ilk_enable_pch_transcoder(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
i915_reg_t reg;
|
||||
@@ -326,18 +325,18 @@ static void ilk_disable_pch_transcoder(struct intel_crtc *crtc)
|
||||
assert_fdi_rx_disabled(display, pipe);
|
||||
|
||||
/* Ports must be off as well */
|
||||
assert_pch_ports_disabled(dev_priv, pipe);
|
||||
assert_pch_ports_disabled(display, pipe);
|
||||
|
||||
reg = PCH_TRANSCONF(pipe);
|
||||
intel_de_rmw(dev_priv, reg, TRANS_ENABLE, 0);
|
||||
intel_de_rmw(display, reg, TRANS_ENABLE, 0);
|
||||
/* wait for PCH transcoder off, transcoder state */
|
||||
if (intel_de_wait_for_clear(dev_priv, reg, TRANS_STATE_ENABLE, 50))
|
||||
drm_err(&dev_priv->drm, "failed to disable transcoder %c\n",
|
||||
if (intel_de_wait_for_clear(display, reg, TRANS_STATE_ENABLE, 50))
|
||||
drm_err(display->drm, "failed to disable transcoder %c\n",
|
||||
pipe_name(pipe));
|
||||
|
||||
if (HAS_PCH_CPT(dev_priv))
|
||||
/* Workaround: Clear the timing override chicken bit again. */
|
||||
intel_de_rmw(dev_priv, TRANS_CHICKEN2(pipe),
|
||||
intel_de_rmw(display, TRANS_CHICKEN2(pipe),
|
||||
TRANS_CHICKEN2_TIMING_OVERRIDE, 0);
|
||||
}
|
||||
|
||||
@@ -366,14 +365,14 @@ void ilk_pch_pre_enable(struct intel_atomic_state *state,
|
||||
void ilk_pch_enable(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
u32 temp;
|
||||
|
||||
assert_pch_transcoder_disabled(dev_priv, pipe);
|
||||
assert_pch_transcoder_disabled(display, pipe);
|
||||
|
||||
/* For PCH output, training FDI link */
|
||||
intel_fdi_link_train(crtc, crtc_state);
|
||||
@@ -459,23 +458,28 @@ void ilk_pch_disable(struct intel_atomic_state *state,
|
||||
void ilk_pch_post_disable(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
const struct intel_crtc_state *old_crtc_state =
|
||||
intel_atomic_get_old_crtc_state(state, crtc);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
ilk_disable_pch_transcoder(crtc);
|
||||
|
||||
if (HAS_PCH_CPT(dev_priv)) {
|
||||
/* disable TRANS_DP_CTL */
|
||||
intel_de_rmw(dev_priv, TRANS_DP_CTL(pipe),
|
||||
intel_de_rmw(display, TRANS_DP_CTL(pipe),
|
||||
TRANS_DP_OUTPUT_ENABLE | TRANS_DP_PORT_SEL_MASK,
|
||||
TRANS_DP_PORT_SEL_NONE);
|
||||
|
||||
/* disable DPLL_SEL */
|
||||
intel_de_rmw(dev_priv, PCH_DPLL_SEL,
|
||||
intel_de_rmw(display, PCH_DPLL_SEL,
|
||||
TRANS_DPLL_ENABLE(pipe) | TRANS_DPLLB_SEL(pipe), 0);
|
||||
}
|
||||
|
||||
ilk_fdi_pll_disable(crtc);
|
||||
|
||||
intel_disable_shared_dpll(old_crtc_state);
|
||||
}
|
||||
|
||||
static void ilk_pch_clock_get(struct intel_crtc_state *crtc_state)
|
||||
@@ -497,8 +501,8 @@ static void ilk_pch_clock_get(struct intel_crtc_state *crtc_state)
|
||||
|
||||
void ilk_pch_get_config(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_shared_dpll *pll;
|
||||
enum pipe pipe = crtc->pipe;
|
||||
@@ -550,8 +554,6 @@ void ilk_pch_get_config(struct intel_crtc_state *crtc_state)
|
||||
static void lpt_enable_pch_transcoder(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
|
||||
u32 val, pipeconf_val;
|
||||
|
||||
@@ -559,49 +561,49 @@ static void lpt_enable_pch_transcoder(const struct intel_crtc_state *crtc_state)
|
||||
assert_fdi_tx_enabled(display, (enum pipe)cpu_transcoder);
|
||||
assert_fdi_rx_enabled(display, PIPE_A);
|
||||
|
||||
val = intel_de_read(dev_priv, TRANS_CHICKEN2(PIPE_A));
|
||||
val = intel_de_read(display, TRANS_CHICKEN2(PIPE_A));
|
||||
/* Workaround: set timing override bit. */
|
||||
val |= TRANS_CHICKEN2_TIMING_OVERRIDE;
|
||||
/* Configure frame start delay to match the CPU */
|
||||
val &= ~TRANS_CHICKEN2_FRAME_START_DELAY_MASK;
|
||||
val |= TRANS_CHICKEN2_FRAME_START_DELAY(crtc_state->framestart_delay - 1);
|
||||
intel_de_write(dev_priv, TRANS_CHICKEN2(PIPE_A), val);
|
||||
intel_de_write(display, TRANS_CHICKEN2(PIPE_A), val);
|
||||
|
||||
val = TRANS_ENABLE;
|
||||
pipeconf_val = intel_de_read(dev_priv,
|
||||
TRANSCONF(dev_priv, cpu_transcoder));
|
||||
pipeconf_val = intel_de_read(display,
|
||||
TRANSCONF(display, cpu_transcoder));
|
||||
|
||||
if ((pipeconf_val & TRANSCONF_INTERLACE_MASK_HSW) == TRANSCONF_INTERLACE_IF_ID_ILK)
|
||||
val |= TRANS_INTERLACE_INTERLACED;
|
||||
else
|
||||
val |= TRANS_INTERLACE_PROGRESSIVE;
|
||||
|
||||
intel_de_write(dev_priv, LPT_TRANSCONF, val);
|
||||
if (intel_de_wait_for_set(dev_priv, LPT_TRANSCONF,
|
||||
intel_de_write(display, LPT_TRANSCONF, val);
|
||||
if (intel_de_wait_for_set(display, LPT_TRANSCONF,
|
||||
TRANS_STATE_ENABLE, 100))
|
||||
drm_err(&dev_priv->drm, "Failed to enable PCH transcoder\n");
|
||||
drm_err(display->drm, "Failed to enable PCH transcoder\n");
|
||||
}
|
||||
|
||||
static void lpt_disable_pch_transcoder(struct drm_i915_private *dev_priv)
|
||||
static void lpt_disable_pch_transcoder(struct intel_display *display)
|
||||
{
|
||||
intel_de_rmw(dev_priv, LPT_TRANSCONF, TRANS_ENABLE, 0);
|
||||
intel_de_rmw(display, LPT_TRANSCONF, TRANS_ENABLE, 0);
|
||||
/* wait for PCH transcoder off, transcoder state */
|
||||
if (intel_de_wait_for_clear(dev_priv, LPT_TRANSCONF,
|
||||
if (intel_de_wait_for_clear(display, LPT_TRANSCONF,
|
||||
TRANS_STATE_ENABLE, 50))
|
||||
drm_err(&dev_priv->drm, "Failed to disable PCH transcoder\n");
|
||||
drm_err(display->drm, "Failed to disable PCH transcoder\n");
|
||||
|
||||
/* Workaround: clear timing override bit. */
|
||||
intel_de_rmw(dev_priv, TRANS_CHICKEN2(PIPE_A), TRANS_CHICKEN2_TIMING_OVERRIDE, 0);
|
||||
intel_de_rmw(display, TRANS_CHICKEN2(PIPE_A), TRANS_CHICKEN2_TIMING_OVERRIDE, 0);
|
||||
}
|
||||
|
||||
void lpt_pch_enable(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
const struct intel_crtc_state *crtc_state =
|
||||
intel_atomic_get_new_crtc_state(state, crtc);
|
||||
|
||||
assert_pch_transcoder_disabled(dev_priv, PIPE_A);
|
||||
assert_pch_transcoder_disabled(display, PIPE_A);
|
||||
|
||||
lpt_program_iclkip(crtc_state);
|
||||
|
||||
@@ -614,36 +616,38 @@ void lpt_pch_enable(struct intel_atomic_state *state,
|
||||
void lpt_pch_disable(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
|
||||
lpt_disable_pch_transcoder(dev_priv);
|
||||
lpt_disable_pch_transcoder(display);
|
||||
|
||||
lpt_disable_iclkip(dev_priv);
|
||||
lpt_disable_iclkip(display);
|
||||
}
|
||||
|
||||
void lpt_pch_get_config(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
u32 tmp;
|
||||
|
||||
if ((intel_de_read(dev_priv, LPT_TRANSCONF) & TRANS_ENABLE) == 0)
|
||||
if ((intel_de_read(display, LPT_TRANSCONF) & TRANS_ENABLE) == 0)
|
||||
return;
|
||||
|
||||
crtc_state->has_pch_encoder = true;
|
||||
|
||||
tmp = intel_de_read(dev_priv, FDI_RX_CTL(PIPE_A));
|
||||
tmp = intel_de_read(display, FDI_RX_CTL(PIPE_A));
|
||||
crtc_state->fdi_lanes = ((FDI_DP_PORT_WIDTH_MASK & tmp) >>
|
||||
FDI_DP_PORT_WIDTH_SHIFT) + 1;
|
||||
|
||||
intel_cpu_transcoder_get_m1_n1(crtc, crtc_state->cpu_transcoder,
|
||||
&crtc_state->fdi_m_n);
|
||||
|
||||
crtc_state->hw.adjusted_mode.crtc_clock = lpt_get_iclkip(dev_priv);
|
||||
crtc_state->hw.adjusted_mode.crtc_clock = lpt_get_iclkip(display);
|
||||
}
|
||||
|
||||
void intel_pch_sanitize(struct drm_i915_private *i915)
|
||||
void intel_pch_sanitize(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
if (HAS_PCH_IBX(i915))
|
||||
ibx_sanitize_pch_ports(i915);
|
||||
ibx_sanitize_pch_ports(display);
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
#include <linux/types.h>
|
||||
|
||||
enum pipe;
|
||||
struct drm_i915_private;
|
||||
struct intel_atomic_state;
|
||||
struct intel_crtc;
|
||||
struct intel_crtc_state;
|
||||
struct intel_display;
|
||||
struct intel_link_m_n;
|
||||
|
||||
#ifdef I915
|
||||
bool intel_has_pch_trancoder(struct drm_i915_private *i915,
|
||||
bool intel_has_pch_trancoder(struct intel_display *display,
|
||||
enum pipe pch_transcoder);
|
||||
enum pipe intel_crtc_pch_transcoder(struct intel_crtc *crtc);
|
||||
|
||||
@@ -41,9 +41,9 @@ void intel_pch_transcoder_get_m1_n1(struct intel_crtc *crtc,
|
||||
void intel_pch_transcoder_get_m2_n2(struct intel_crtc *crtc,
|
||||
struct intel_link_m_n *m_n);
|
||||
|
||||
void intel_pch_sanitize(struct drm_i915_private *i915);
|
||||
void intel_pch_sanitize(struct intel_display *display);
|
||||
#else
|
||||
static inline bool intel_has_pch_trancoder(struct drm_i915_private *i915,
|
||||
static inline bool intel_has_pch_trancoder(struct intel_display *display,
|
||||
enum pipe pch_transcoder)
|
||||
{
|
||||
return false;
|
||||
@@ -90,7 +90,7 @@ static inline void intel_pch_transcoder_get_m2_n2(struct intel_crtc *crtc,
|
||||
struct intel_link_m_n *m_n)
|
||||
{
|
||||
}
|
||||
static inline void intel_pch_sanitize(struct drm_i915_private *i915)
|
||||
static inline void intel_pch_sanitize(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -11,27 +11,28 @@
|
||||
#include "intel_pch_refclk.h"
|
||||
#include "intel_sbi.h"
|
||||
|
||||
static void lpt_fdi_reset_mphy(struct drm_i915_private *dev_priv)
|
||||
static void lpt_fdi_reset_mphy(struct intel_display *display)
|
||||
{
|
||||
intel_de_rmw(dev_priv, SOUTH_CHICKEN2, 0, FDI_MPHY_IOSFSB_RESET_CTL);
|
||||
intel_de_rmw(display, SOUTH_CHICKEN2, 0, FDI_MPHY_IOSFSB_RESET_CTL);
|
||||
|
||||
if (wait_for_us(intel_de_read(dev_priv, SOUTH_CHICKEN2) &
|
||||
if (wait_for_us(intel_de_read(display, SOUTH_CHICKEN2) &
|
||||
FDI_MPHY_IOSFSB_RESET_STATUS, 100))
|
||||
drm_err(&dev_priv->drm, "FDI mPHY reset assert timeout\n");
|
||||
drm_err(display->drm, "FDI mPHY reset assert timeout\n");
|
||||
|
||||
intel_de_rmw(dev_priv, SOUTH_CHICKEN2, FDI_MPHY_IOSFSB_RESET_CTL, 0);
|
||||
intel_de_rmw(display, SOUTH_CHICKEN2, FDI_MPHY_IOSFSB_RESET_CTL, 0);
|
||||
|
||||
if (wait_for_us((intel_de_read(dev_priv, SOUTH_CHICKEN2) &
|
||||
if (wait_for_us((intel_de_read(display, SOUTH_CHICKEN2) &
|
||||
FDI_MPHY_IOSFSB_RESET_STATUS) == 0, 100))
|
||||
drm_err(&dev_priv->drm, "FDI mPHY reset de-assert timeout\n");
|
||||
drm_err(display->drm, "FDI mPHY reset de-assert timeout\n");
|
||||
}
|
||||
|
||||
/* WaMPhyProgramming:hsw */
|
||||
static void lpt_fdi_program_mphy(struct drm_i915_private *dev_priv)
|
||||
static void lpt_fdi_program_mphy(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
u32 tmp;
|
||||
|
||||
lpt_fdi_reset_mphy(dev_priv);
|
||||
lpt_fdi_reset_mphy(display);
|
||||
|
||||
tmp = intel_sbi_read(dev_priv, 0x8008, SBI_MPHY);
|
||||
tmp &= ~(0xFF << 24);
|
||||
@@ -103,11 +104,12 @@ static void lpt_fdi_program_mphy(struct drm_i915_private *dev_priv)
|
||||
intel_sbi_write(dev_priv, 0x21EC, tmp, SBI_MPHY);
|
||||
}
|
||||
|
||||
void lpt_disable_iclkip(struct drm_i915_private *dev_priv)
|
||||
void lpt_disable_iclkip(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
u32 temp;
|
||||
|
||||
intel_de_write(dev_priv, PIXCLK_GATE, PIXCLK_GATE_GATE);
|
||||
intel_de_write(display, PIXCLK_GATE, PIXCLK_GATE_GATE);
|
||||
|
||||
intel_sbi_lock(dev_priv);
|
||||
|
||||
@@ -175,24 +177,25 @@ int lpt_iclkip(const struct intel_crtc_state *crtc_state)
|
||||
/* Program iCLKIP clock to the desired frequency */
|
||||
void lpt_program_iclkip(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
int clock = crtc_state->hw.adjusted_mode.crtc_clock;
|
||||
struct iclkip_params p;
|
||||
u32 temp;
|
||||
|
||||
lpt_disable_iclkip(dev_priv);
|
||||
lpt_disable_iclkip(display);
|
||||
|
||||
lpt_compute_iclkip(&p, clock);
|
||||
drm_WARN_ON(&dev_priv->drm, lpt_iclkip_freq(&p) != clock);
|
||||
drm_WARN_ON(display->drm, lpt_iclkip_freq(&p) != clock);
|
||||
|
||||
/* This should not happen with any sane values */
|
||||
drm_WARN_ON(&dev_priv->drm, SBI_SSCDIVINTPHASE_DIVSEL(p.divsel) &
|
||||
drm_WARN_ON(display->drm, SBI_SSCDIVINTPHASE_DIVSEL(p.divsel) &
|
||||
~SBI_SSCDIVINTPHASE_DIVSEL_MASK);
|
||||
drm_WARN_ON(&dev_priv->drm, SBI_SSCDIVINTPHASE_DIR(p.phasedir) &
|
||||
drm_WARN_ON(display->drm, SBI_SSCDIVINTPHASE_DIR(p.phasedir) &
|
||||
~SBI_SSCDIVINTPHASE_INCVAL_MASK);
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"iCLKIP clock: found settings for %dKHz refresh rate: auxdiv=%x, divsel=%x, phasedir=%x, phaseinc=%x\n",
|
||||
clock, p.auxdiv, p.divsel, p.phasedir, p.phaseinc);
|
||||
|
||||
@@ -224,15 +227,16 @@ void lpt_program_iclkip(const struct intel_crtc_state *crtc_state)
|
||||
/* Wait for initialization time */
|
||||
udelay(24);
|
||||
|
||||
intel_de_write(dev_priv, PIXCLK_GATE, PIXCLK_GATE_UNGATE);
|
||||
intel_de_write(display, PIXCLK_GATE, PIXCLK_GATE_UNGATE);
|
||||
}
|
||||
|
||||
int lpt_get_iclkip(struct drm_i915_private *dev_priv)
|
||||
int lpt_get_iclkip(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct iclkip_params p;
|
||||
u32 temp;
|
||||
|
||||
if ((intel_de_read(dev_priv, PIXCLK_GATE) & PIXCLK_GATE_UNGATE) == 0)
|
||||
if ((intel_de_read(display, PIXCLK_GATE) & PIXCLK_GATE_UNGATE) == 0)
|
||||
return 0;
|
||||
|
||||
iclkip_params_init(&p);
|
||||
@@ -268,15 +272,16 @@ int lpt_get_iclkip(struct drm_i915_private *dev_priv)
|
||||
* - Sequence to enable CLKOUT_DP without spread
|
||||
* - Sequence to enable CLKOUT_DP for FDI usage and configure PCH FDI I/O
|
||||
*/
|
||||
static void lpt_enable_clkout_dp(struct drm_i915_private *dev_priv,
|
||||
static void lpt_enable_clkout_dp(struct intel_display *display,
|
||||
bool with_spread, bool with_fdi)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
u32 reg, tmp;
|
||||
|
||||
if (drm_WARN(&dev_priv->drm, with_fdi && !with_spread,
|
||||
if (drm_WARN(display->drm, with_fdi && !with_spread,
|
||||
"FDI requires downspread\n"))
|
||||
with_spread = true;
|
||||
if (drm_WARN(&dev_priv->drm, HAS_PCH_LPT_LP(dev_priv) &&
|
||||
if (drm_WARN(display->drm, HAS_PCH_LPT_LP(dev_priv) &&
|
||||
with_fdi, "LP PCH doesn't have FDI\n"))
|
||||
with_fdi = false;
|
||||
|
||||
@@ -295,7 +300,7 @@ static void lpt_enable_clkout_dp(struct drm_i915_private *dev_priv,
|
||||
intel_sbi_write(dev_priv, SBI_SSCCTL, tmp, SBI_ICLK);
|
||||
|
||||
if (with_fdi)
|
||||
lpt_fdi_program_mphy(dev_priv);
|
||||
lpt_fdi_program_mphy(display);
|
||||
}
|
||||
|
||||
reg = HAS_PCH_LPT_LP(dev_priv) ? SBI_GEN0 : SBI_DBUFF0;
|
||||
@@ -307,8 +312,9 @@ static void lpt_enable_clkout_dp(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
|
||||
/* Sequence to disable CLKOUT_DP */
|
||||
void lpt_disable_clkout_dp(struct drm_i915_private *dev_priv)
|
||||
void lpt_disable_clkout_dp(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
u32 reg, tmp;
|
||||
|
||||
intel_sbi_lock(dev_priv);
|
||||
@@ -364,15 +370,16 @@ static const u16 sscdivintphase[] = {
|
||||
* < 0 slow down the clock, > 0 speed up the clock, 0 == no bend (135MHz)
|
||||
* change in clock period = -(steps / 10) * 5.787 ps
|
||||
*/
|
||||
static void lpt_bend_clkout_dp(struct drm_i915_private *dev_priv, int steps)
|
||||
static void lpt_bend_clkout_dp(struct intel_display *display, int steps)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
u32 tmp;
|
||||
int idx = BEND_IDX(steps);
|
||||
|
||||
if (drm_WARN_ON(&dev_priv->drm, steps % 5 != 0))
|
||||
if (drm_WARN_ON(display->drm, steps % 5 != 0))
|
||||
return;
|
||||
|
||||
if (drm_WARN_ON(&dev_priv->drm, idx >= ARRAY_SIZE(sscdivintphase)))
|
||||
if (drm_WARN_ON(display->drm, idx >= ARRAY_SIZE(sscdivintphase)))
|
||||
return;
|
||||
|
||||
intel_sbi_lock(dev_priv);
|
||||
@@ -393,10 +400,10 @@ static void lpt_bend_clkout_dp(struct drm_i915_private *dev_priv, int steps)
|
||||
|
||||
#undef BEND_IDX
|
||||
|
||||
static bool spll_uses_pch_ssc(struct drm_i915_private *dev_priv)
|
||||
static bool spll_uses_pch_ssc(struct intel_display *display)
|
||||
{
|
||||
u32 fuse_strap = intel_de_read(dev_priv, FUSE_STRAP);
|
||||
u32 ctl = intel_de_read(dev_priv, SPLL_CTL);
|
||||
u32 fuse_strap = intel_de_read(display, FUSE_STRAP);
|
||||
u32 ctl = intel_de_read(display, SPLL_CTL);
|
||||
|
||||
if ((ctl & SPLL_PLL_ENABLE) == 0)
|
||||
return false;
|
||||
@@ -405,18 +412,17 @@ static bool spll_uses_pch_ssc(struct drm_i915_private *dev_priv)
|
||||
(fuse_strap & HSW_CPU_SSC_ENABLE) == 0)
|
||||
return true;
|
||||
|
||||
if (IS_BROADWELL(dev_priv) &&
|
||||
if (display->platform.broadwell &&
|
||||
(ctl & SPLL_REF_MASK) == SPLL_REF_PCH_SSC_BDW)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool wrpll_uses_pch_ssc(struct drm_i915_private *dev_priv,
|
||||
enum intel_dpll_id id)
|
||||
static bool wrpll_uses_pch_ssc(struct intel_display *display, enum intel_dpll_id id)
|
||||
{
|
||||
u32 fuse_strap = intel_de_read(dev_priv, FUSE_STRAP);
|
||||
u32 ctl = intel_de_read(dev_priv, WRPLL_CTL(id));
|
||||
u32 fuse_strap = intel_de_read(display, FUSE_STRAP);
|
||||
u32 ctl = intel_de_read(display, WRPLL_CTL(id));
|
||||
|
||||
if ((ctl & WRPLL_PLL_ENABLE) == 0)
|
||||
return false;
|
||||
@@ -424,7 +430,7 @@ static bool wrpll_uses_pch_ssc(struct drm_i915_private *dev_priv,
|
||||
if ((ctl & WRPLL_REF_MASK) == WRPLL_REF_PCH_SSC)
|
||||
return true;
|
||||
|
||||
if ((IS_BROADWELL(dev_priv) || IS_HASWELL_ULT(dev_priv)) &&
|
||||
if ((display->platform.broadwell || display->platform.haswell_ult) &&
|
||||
(ctl & WRPLL_REF_MASK) == WRPLL_REF_MUXED_SSC_BDW &&
|
||||
(fuse_strap & HSW_CPU_SSC_ENABLE) == 0)
|
||||
return true;
|
||||
@@ -432,12 +438,12 @@ static bool wrpll_uses_pch_ssc(struct drm_i915_private *dev_priv,
|
||||
return false;
|
||||
}
|
||||
|
||||
static void lpt_init_pch_refclk(struct drm_i915_private *dev_priv)
|
||||
static void lpt_init_pch_refclk(struct intel_display *display)
|
||||
{
|
||||
struct intel_encoder *encoder;
|
||||
bool has_fdi = false;
|
||||
|
||||
for_each_intel_encoder(&dev_priv->drm, encoder) {
|
||||
for_each_intel_encoder(display->drm, encoder) {
|
||||
switch (encoder->type) {
|
||||
case INTEL_OUTPUT_ANALOG:
|
||||
has_fdi = true;
|
||||
@@ -462,37 +468,37 @@ static void lpt_init_pch_refclk(struct drm_i915_private *dev_priv)
|
||||
* clock hierarchy. That would also allow us to do
|
||||
* clock bending finally.
|
||||
*/
|
||||
dev_priv->display.dpll.pch_ssc_use = 0;
|
||||
display->dpll.pch_ssc_use = 0;
|
||||
|
||||
if (spll_uses_pch_ssc(dev_priv)) {
|
||||
drm_dbg_kms(&dev_priv->drm, "SPLL using PCH SSC\n");
|
||||
dev_priv->display.dpll.pch_ssc_use |= BIT(DPLL_ID_SPLL);
|
||||
if (spll_uses_pch_ssc(display)) {
|
||||
drm_dbg_kms(display->drm, "SPLL using PCH SSC\n");
|
||||
display->dpll.pch_ssc_use |= BIT(DPLL_ID_SPLL);
|
||||
}
|
||||
|
||||
if (wrpll_uses_pch_ssc(dev_priv, DPLL_ID_WRPLL1)) {
|
||||
drm_dbg_kms(&dev_priv->drm, "WRPLL1 using PCH SSC\n");
|
||||
dev_priv->display.dpll.pch_ssc_use |= BIT(DPLL_ID_WRPLL1);
|
||||
if (wrpll_uses_pch_ssc(display, DPLL_ID_WRPLL1)) {
|
||||
drm_dbg_kms(display->drm, "WRPLL1 using PCH SSC\n");
|
||||
display->dpll.pch_ssc_use |= BIT(DPLL_ID_WRPLL1);
|
||||
}
|
||||
|
||||
if (wrpll_uses_pch_ssc(dev_priv, DPLL_ID_WRPLL2)) {
|
||||
drm_dbg_kms(&dev_priv->drm, "WRPLL2 using PCH SSC\n");
|
||||
dev_priv->display.dpll.pch_ssc_use |= BIT(DPLL_ID_WRPLL2);
|
||||
if (wrpll_uses_pch_ssc(display, DPLL_ID_WRPLL2)) {
|
||||
drm_dbg_kms(display->drm, "WRPLL2 using PCH SSC\n");
|
||||
display->dpll.pch_ssc_use |= BIT(DPLL_ID_WRPLL2);
|
||||
}
|
||||
|
||||
if (dev_priv->display.dpll.pch_ssc_use)
|
||||
if (display->dpll.pch_ssc_use)
|
||||
return;
|
||||
|
||||
if (has_fdi) {
|
||||
lpt_bend_clkout_dp(dev_priv, 0);
|
||||
lpt_enable_clkout_dp(dev_priv, true, true);
|
||||
lpt_bend_clkout_dp(display, 0);
|
||||
lpt_enable_clkout_dp(display, true, true);
|
||||
} else {
|
||||
lpt_disable_clkout_dp(dev_priv);
|
||||
lpt_disable_clkout_dp(display);
|
||||
}
|
||||
}
|
||||
|
||||
static void ilk_init_pch_refclk(struct drm_i915_private *dev_priv)
|
||||
static void ilk_init_pch_refclk(struct intel_display *display)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct intel_encoder *encoder;
|
||||
struct intel_shared_dpll *pll;
|
||||
int i;
|
||||
@@ -607,7 +613,7 @@ static void ilk_init_pch_refclk(struct drm_i915_private *dev_priv)
|
||||
|
||||
/* SSC must be turned on before enabling the CPU output */
|
||||
if (intel_panel_use_ssc(display) && can_ssc) {
|
||||
drm_dbg_kms(&dev_priv->drm, "Using SSC on panel\n");
|
||||
drm_dbg_kms(display->drm, "Using SSC on panel\n");
|
||||
val |= DREF_SSC1_ENABLE;
|
||||
} else {
|
||||
val &= ~DREF_SSC1_ENABLE;
|
||||
@@ -623,7 +629,7 @@ static void ilk_init_pch_refclk(struct drm_i915_private *dev_priv)
|
||||
/* Enable CPU source on CPU attached eDP */
|
||||
if (has_cpu_edp) {
|
||||
if (intel_panel_use_ssc(display) && can_ssc) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Using SSC on eDP\n");
|
||||
val |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD;
|
||||
} else {
|
||||
@@ -670,10 +676,12 @@ static void ilk_init_pch_refclk(struct drm_i915_private *dev_priv)
|
||||
/*
|
||||
* Initialize reference clocks when the driver loads
|
||||
*/
|
||||
void intel_init_pch_refclk(struct drm_i915_private *dev_priv)
|
||||
void intel_init_pch_refclk(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
if (HAS_PCH_IBX(dev_priv) || HAS_PCH_CPT(dev_priv))
|
||||
ilk_init_pch_refclk(dev_priv);
|
||||
ilk_init_pch_refclk(display);
|
||||
else if (HAS_PCH_LPT(dev_priv))
|
||||
lpt_init_pch_refclk(dev_priv);
|
||||
lpt_init_pch_refclk(display);
|
||||
}
|
||||
|
||||
@@ -8,25 +8,25 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_crtc_state;
|
||||
struct intel_display;
|
||||
|
||||
#ifdef I915
|
||||
void lpt_program_iclkip(const struct intel_crtc_state *crtc_state);
|
||||
void lpt_disable_iclkip(struct drm_i915_private *dev_priv);
|
||||
int lpt_get_iclkip(struct drm_i915_private *dev_priv);
|
||||
void lpt_disable_iclkip(struct intel_display *display);
|
||||
int lpt_get_iclkip(struct intel_display *display);
|
||||
int lpt_iclkip(const struct intel_crtc_state *crtc_state);
|
||||
|
||||
void intel_init_pch_refclk(struct drm_i915_private *dev_priv);
|
||||
void lpt_disable_clkout_dp(struct drm_i915_private *dev_priv);
|
||||
void intel_init_pch_refclk(struct intel_display *display);
|
||||
void lpt_disable_clkout_dp(struct intel_display *display);
|
||||
#else
|
||||
static inline void lpt_program_iclkip(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
}
|
||||
static inline void lpt_disable_iclkip(struct drm_i915_private *dev_priv)
|
||||
static inline void lpt_disable_iclkip(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
static inline int lpt_get_iclkip(struct drm_i915_private *dev_priv)
|
||||
static inline int lpt_get_iclkip(struct intel_display *display)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -34,10 +34,10 @@ static inline int lpt_iclkip(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void intel_init_pch_refclk(struct drm_i915_private *dev_priv)
|
||||
static inline void intel_init_pch_refclk(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
static inline void lpt_disable_clkout_dp(struct drm_i915_private *dev_priv)
|
||||
static inline void lpt_disable_clkout_dp(struct intel_display *display)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -75,7 +75,7 @@ static int i8xx_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv,
|
||||
static void i9xx_pipe_crc_auto_source(struct intel_display *display,
|
||||
enum pipe pipe,
|
||||
enum intel_pipe_crc_source *source)
|
||||
{
|
||||
@@ -85,8 +85,8 @@ static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv,
|
||||
|
||||
*source = INTEL_PIPE_CRC_SOURCE_PIPE;
|
||||
|
||||
drm_modeset_lock_all(&dev_priv->drm);
|
||||
for_each_intel_encoder(&dev_priv->drm, encoder) {
|
||||
drm_modeset_lock_all(display->drm);
|
||||
for_each_intel_encoder(display->drm, encoder) {
|
||||
if (!encoder->base.crtc)
|
||||
continue;
|
||||
|
||||
@@ -113,7 +113,7 @@ static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv,
|
||||
*source = INTEL_PIPE_CRC_SOURCE_DP_D;
|
||||
break;
|
||||
default:
|
||||
drm_WARN(&dev_priv->drm, 1, "nonexisting DP port %c\n",
|
||||
drm_WARN(display->drm, 1, "nonexisting DP port %c\n",
|
||||
port_name(dig_port->base.port));
|
||||
break;
|
||||
}
|
||||
@@ -122,10 +122,10 @@ static void i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv,
|
||||
break;
|
||||
}
|
||||
}
|
||||
drm_modeset_unlock_all(&dev_priv->drm);
|
||||
drm_modeset_unlock_all(display->drm);
|
||||
}
|
||||
|
||||
static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
static int vlv_pipe_crc_ctl_reg(struct intel_display *display,
|
||||
enum pipe pipe,
|
||||
enum intel_pipe_crc_source *source,
|
||||
u32 *val)
|
||||
@@ -133,7 +133,7 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
bool need_stable_symbols = false;
|
||||
|
||||
if (*source == INTEL_PIPE_CRC_SOURCE_AUTO)
|
||||
i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
|
||||
i9xx_pipe_crc_auto_source(display, pipe, source);
|
||||
|
||||
switch (*source) {
|
||||
case INTEL_PIPE_CRC_SOURCE_PIPE:
|
||||
@@ -148,7 +148,7 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
need_stable_symbols = true;
|
||||
break;
|
||||
case INTEL_PIPE_CRC_SOURCE_DP_D:
|
||||
if (!IS_CHERRYVIEW(dev_priv))
|
||||
if (!display->platform.cherryview)
|
||||
return -EINVAL;
|
||||
*val = PIPE_CRC_ENABLE | PIPE_CRC_SOURCE_DP_D_VLV;
|
||||
need_stable_symbols = true;
|
||||
@@ -170,7 +170,7 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
* - DisplayPort scrambling: used for EMI reduction
|
||||
*/
|
||||
if (need_stable_symbols) {
|
||||
u32 tmp = intel_de_read(dev_priv, PORT_DFT2_G4X(dev_priv));
|
||||
u32 tmp = intel_de_read(display, PORT_DFT2_G4X(display));
|
||||
|
||||
tmp |= DC_BALANCE_RESET_VLV;
|
||||
switch (pipe) {
|
||||
@@ -186,26 +186,26 @@ static int vlv_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
intel_de_write(dev_priv, PORT_DFT2_G4X(dev_priv), tmp);
|
||||
intel_de_write(display, PORT_DFT2_G4X(display), tmp);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int i9xx_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
static int i9xx_pipe_crc_ctl_reg(struct intel_display *display,
|
||||
enum pipe pipe,
|
||||
enum intel_pipe_crc_source *source,
|
||||
u32 *val)
|
||||
{
|
||||
if (*source == INTEL_PIPE_CRC_SOURCE_AUTO)
|
||||
i9xx_pipe_crc_auto_source(dev_priv, pipe, source);
|
||||
i9xx_pipe_crc_auto_source(display, pipe, source);
|
||||
|
||||
switch (*source) {
|
||||
case INTEL_PIPE_CRC_SOURCE_PIPE:
|
||||
*val = PIPE_CRC_ENABLE | PIPE_CRC_SOURCE_PIPE_I9XX;
|
||||
break;
|
||||
case INTEL_PIPE_CRC_SOURCE_TV:
|
||||
if (!SUPPORTS_TV(dev_priv))
|
||||
if (!SUPPORTS_TV(display))
|
||||
return -EINVAL;
|
||||
*val = PIPE_CRC_ENABLE | PIPE_CRC_SOURCE_TV_PRE;
|
||||
break;
|
||||
@@ -229,10 +229,10 @@ static int i9xx_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void vlv_undo_pipe_scramble_reset(struct drm_i915_private *dev_priv,
|
||||
static void vlv_undo_pipe_scramble_reset(struct intel_display *display,
|
||||
enum pipe pipe)
|
||||
{
|
||||
u32 tmp = intel_de_read(dev_priv, PORT_DFT2_G4X(dev_priv));
|
||||
u32 tmp = intel_de_read(display, PORT_DFT2_G4X(display));
|
||||
|
||||
switch (pipe) {
|
||||
case PIPE_A:
|
||||
@@ -249,7 +249,7 @@ static void vlv_undo_pipe_scramble_reset(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
if (!(tmp & PIPE_SCRAMBLE_RESET_MASK))
|
||||
tmp &= ~DC_BALANCE_RESET_VLV;
|
||||
intel_de_write(dev_priv, PORT_DFT2_G4X(dev_priv), tmp);
|
||||
intel_de_write(display, PORT_DFT2_G4X(display), tmp);
|
||||
}
|
||||
|
||||
static int ilk_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source,
|
||||
@@ -281,18 +281,18 @@ static int ilk_pipe_crc_ctl_reg(enum intel_pipe_crc_source *source,
|
||||
static void
|
||||
intel_crtc_crc_setup_workarounds(struct intel_crtc *crtc, bool enable)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct intel_crtc_state *pipe_config;
|
||||
struct drm_atomic_state *state;
|
||||
struct drm_modeset_acquire_ctx ctx;
|
||||
int ret;
|
||||
|
||||
if (IS_I945GM(dev_priv) || IS_I915GM(dev_priv))
|
||||
i915gm_irq_cstate_wa(dev_priv, enable);
|
||||
if (display->platform.i945gm || display->platform.i915gm)
|
||||
i915gm_irq_cstate_wa(display, enable);
|
||||
|
||||
drm_modeset_acquire_init(&ctx, 0);
|
||||
|
||||
state = drm_atomic_state_alloc(&dev_priv->drm);
|
||||
state = drm_atomic_state_alloc(display->drm);
|
||||
if (!state) {
|
||||
ret = -ENOMEM;
|
||||
goto unlock;
|
||||
@@ -311,7 +311,7 @@ retry:
|
||||
pipe_config->uapi.mode_changed = pipe_config->has_psr;
|
||||
pipe_config->crc_enabled = enable;
|
||||
|
||||
if (IS_HASWELL(dev_priv) &&
|
||||
if (display->platform.haswell &&
|
||||
pipe_config->hw.active && crtc->pipe == PIPE_A &&
|
||||
pipe_config->cpu_transcoder == TRANSCODER_EDP)
|
||||
pipe_config->uapi.mode_changed = true;
|
||||
@@ -327,13 +327,13 @@ put_state:
|
||||
|
||||
drm_atomic_state_put(state);
|
||||
unlock:
|
||||
drm_WARN(&dev_priv->drm, ret,
|
||||
drm_WARN(display->drm, ret,
|
||||
"Toggling workaround to %i returns %i\n", enable, ret);
|
||||
drm_modeset_drop_locks(&ctx);
|
||||
drm_modeset_acquire_fini(&ctx);
|
||||
}
|
||||
|
||||
static int ivb_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
static int ivb_pipe_crc_ctl_reg(struct intel_display *display,
|
||||
enum pipe pipe,
|
||||
enum intel_pipe_crc_source *source,
|
||||
u32 *val)
|
||||
@@ -361,7 +361,7 @@ static int ivb_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int skl_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
static int skl_pipe_crc_ctl_reg(struct intel_display *display,
|
||||
enum pipe pipe,
|
||||
enum intel_pipe_crc_source *source,
|
||||
u32 *val)
|
||||
@@ -404,22 +404,22 @@ static int skl_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_new_crc_ctl_reg(struct drm_i915_private *dev_priv,
|
||||
static int get_new_crc_ctl_reg(struct intel_display *display,
|
||||
enum pipe pipe,
|
||||
enum intel_pipe_crc_source *source, u32 *val)
|
||||
{
|
||||
if (DISPLAY_VER(dev_priv) == 2)
|
||||
if (DISPLAY_VER(display) == 2)
|
||||
return i8xx_pipe_crc_ctl_reg(source, val);
|
||||
else if (DISPLAY_VER(dev_priv) < 5)
|
||||
return i9xx_pipe_crc_ctl_reg(dev_priv, pipe, source, val);
|
||||
else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
|
||||
return vlv_pipe_crc_ctl_reg(dev_priv, pipe, source, val);
|
||||
else if (IS_IRONLAKE(dev_priv) || IS_SANDYBRIDGE(dev_priv))
|
||||
else if (DISPLAY_VER(display) < 5)
|
||||
return i9xx_pipe_crc_ctl_reg(display, pipe, source, val);
|
||||
else if (display->platform.valleyview || display->platform.cherryview)
|
||||
return vlv_pipe_crc_ctl_reg(display, pipe, source, val);
|
||||
else if (display->platform.ironlake || display->platform.sandybridge)
|
||||
return ilk_pipe_crc_ctl_reg(source, val);
|
||||
else if (DISPLAY_VER(dev_priv) < 9)
|
||||
return ivb_pipe_crc_ctl_reg(dev_priv, pipe, source, val);
|
||||
else if (DISPLAY_VER(display) < 9)
|
||||
return ivb_pipe_crc_ctl_reg(display, pipe, source, val);
|
||||
else
|
||||
return skl_pipe_crc_ctl_reg(dev_priv, pipe, source, val);
|
||||
return skl_pipe_crc_ctl_reg(display, pipe, source, val);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -447,7 +447,7 @@ void intel_crtc_crc_init(struct intel_crtc *crtc)
|
||||
spin_lock_init(&pipe_crc->lock);
|
||||
}
|
||||
|
||||
static int i8xx_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
static int i8xx_crc_source_valid(struct intel_display *display,
|
||||
const enum intel_pipe_crc_source source)
|
||||
{
|
||||
switch (source) {
|
||||
@@ -459,7 +459,7 @@ static int i8xx_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
}
|
||||
|
||||
static int i9xx_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
static int i9xx_crc_source_valid(struct intel_display *display,
|
||||
const enum intel_pipe_crc_source source)
|
||||
{
|
||||
switch (source) {
|
||||
@@ -472,7 +472,7 @@ static int i9xx_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
}
|
||||
|
||||
static int vlv_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
static int vlv_crc_source_valid(struct intel_display *display,
|
||||
const enum intel_pipe_crc_source source)
|
||||
{
|
||||
switch (source) {
|
||||
@@ -487,7 +487,7 @@ static int vlv_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
}
|
||||
|
||||
static int ilk_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
static int ilk_crc_source_valid(struct intel_display *display,
|
||||
const enum intel_pipe_crc_source source)
|
||||
{
|
||||
switch (source) {
|
||||
@@ -501,7 +501,7 @@ static int ilk_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
}
|
||||
|
||||
static int ivb_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
static int ivb_crc_source_valid(struct intel_display *display,
|
||||
const enum intel_pipe_crc_source source)
|
||||
{
|
||||
switch (source) {
|
||||
@@ -515,7 +515,7 @@ static int ivb_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
}
|
||||
|
||||
static int skl_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
static int skl_crc_source_valid(struct intel_display *display,
|
||||
const enum intel_pipe_crc_source source)
|
||||
{
|
||||
switch (source) {
|
||||
@@ -535,21 +535,21 @@ static int skl_crc_source_valid(struct drm_i915_private *dev_priv,
|
||||
}
|
||||
|
||||
static int
|
||||
intel_is_valid_crc_source(struct drm_i915_private *dev_priv,
|
||||
intel_is_valid_crc_source(struct intel_display *display,
|
||||
const enum intel_pipe_crc_source source)
|
||||
{
|
||||
if (DISPLAY_VER(dev_priv) == 2)
|
||||
return i8xx_crc_source_valid(dev_priv, source);
|
||||
else if (DISPLAY_VER(dev_priv) < 5)
|
||||
return i9xx_crc_source_valid(dev_priv, source);
|
||||
else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
|
||||
return vlv_crc_source_valid(dev_priv, source);
|
||||
else if (IS_IRONLAKE(dev_priv) || IS_SANDYBRIDGE(dev_priv))
|
||||
return ilk_crc_source_valid(dev_priv, source);
|
||||
else if (DISPLAY_VER(dev_priv) < 9)
|
||||
return ivb_crc_source_valid(dev_priv, source);
|
||||
if (DISPLAY_VER(display) == 2)
|
||||
return i8xx_crc_source_valid(display, source);
|
||||
else if (DISPLAY_VER(display) < 5)
|
||||
return i9xx_crc_source_valid(display, source);
|
||||
else if (display->platform.valleyview || display->platform.cherryview)
|
||||
return vlv_crc_source_valid(display, source);
|
||||
else if (display->platform.ironlake || display->platform.sandybridge)
|
||||
return ilk_crc_source_valid(display, source);
|
||||
else if (DISPLAY_VER(display) < 9)
|
||||
return ivb_crc_source_valid(display, source);
|
||||
else
|
||||
return skl_crc_source_valid(dev_priv, source);
|
||||
return skl_crc_source_valid(display, source);
|
||||
}
|
||||
|
||||
const char *const *intel_crtc_get_crc_sources(struct drm_crtc *crtc,
|
||||
@@ -562,16 +562,16 @@ const char *const *intel_crtc_get_crc_sources(struct drm_crtc *crtc,
|
||||
int intel_crtc_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
|
||||
size_t *values_cnt)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->dev);
|
||||
struct intel_display *display = to_intel_display(crtc->dev);
|
||||
enum intel_pipe_crc_source source;
|
||||
|
||||
if (display_crc_ctl_parse_source(source_name, &source) < 0) {
|
||||
drm_dbg(&dev_priv->drm, "unknown source %s\n", source_name);
|
||||
drm_dbg_kms(display->drm, "unknown source %s\n", source_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (source == INTEL_PIPE_CRC_SOURCE_AUTO ||
|
||||
intel_is_valid_crc_source(dev_priv, source) == 0) {
|
||||
intel_is_valid_crc_source(display, source) == 0) {
|
||||
*values_cnt = 5;
|
||||
return 0;
|
||||
}
|
||||
@@ -583,7 +583,6 @@ int intel_crtc_set_crc_source(struct drm_crtc *_crtc, const char *source_name)
|
||||
{
|
||||
struct intel_crtc *crtc = to_intel_crtc(_crtc);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_pipe_crc *pipe_crc = &crtc->pipe_crc;
|
||||
enum intel_display_power_domain power_domain;
|
||||
enum intel_pipe_crc_source source;
|
||||
@@ -594,14 +593,14 @@ int intel_crtc_set_crc_source(struct drm_crtc *_crtc, const char *source_name)
|
||||
bool enable;
|
||||
|
||||
if (display_crc_ctl_parse_source(source_name, &source) < 0) {
|
||||
drm_dbg(&dev_priv->drm, "unknown source %s\n", source_name);
|
||||
drm_dbg_kms(display->drm, "unknown source %s\n", source_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
power_domain = POWER_DOMAIN_PIPE(pipe);
|
||||
wakeref = intel_display_power_get_if_enabled(display, power_domain);
|
||||
if (!wakeref) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Trying to capture CRC while pipe is off\n");
|
||||
return -EIO;
|
||||
}
|
||||
@@ -610,17 +609,17 @@ int intel_crtc_set_crc_source(struct drm_crtc *_crtc, const char *source_name)
|
||||
if (enable)
|
||||
intel_crtc_crc_setup_workarounds(crtc, true);
|
||||
|
||||
ret = get_new_crc_ctl_reg(dev_priv, pipe, &source, &val);
|
||||
ret = get_new_crc_ctl_reg(display, pipe, &source, &val);
|
||||
if (ret != 0)
|
||||
goto out;
|
||||
|
||||
pipe_crc->source = source;
|
||||
intel_de_write(dev_priv, PIPE_CRC_CTL(dev_priv, pipe), val);
|
||||
intel_de_posting_read(dev_priv, PIPE_CRC_CTL(dev_priv, pipe));
|
||||
intel_de_write(display, PIPE_CRC_CTL(display, pipe), val);
|
||||
intel_de_posting_read(display, PIPE_CRC_CTL(display, pipe));
|
||||
|
||||
if (!source) {
|
||||
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
|
||||
vlv_undo_pipe_scramble_reset(dev_priv, pipe);
|
||||
if (display->platform.valleyview || display->platform.cherryview)
|
||||
vlv_undo_pipe_scramble_reset(display, pipe);
|
||||
}
|
||||
|
||||
pipe_crc->skipped = 0;
|
||||
@@ -636,7 +635,7 @@ out:
|
||||
|
||||
void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct intel_pipe_crc *pipe_crc = &crtc->pipe_crc;
|
||||
enum pipe pipe = crtc->pipe;
|
||||
u32 val = 0;
|
||||
@@ -644,19 +643,20 @@ void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc)
|
||||
if (!crtc->base.crc.opened)
|
||||
return;
|
||||
|
||||
if (get_new_crc_ctl_reg(dev_priv, pipe, &pipe_crc->source, &val) < 0)
|
||||
if (get_new_crc_ctl_reg(display, pipe, &pipe_crc->source, &val) < 0)
|
||||
return;
|
||||
|
||||
/* Don't need pipe_crc->lock here, IRQs are not generated. */
|
||||
pipe_crc->skipped = 0;
|
||||
|
||||
intel_de_write(dev_priv, PIPE_CRC_CTL(dev_priv, pipe), val);
|
||||
intel_de_posting_read(dev_priv, PIPE_CRC_CTL(dev_priv, pipe));
|
||||
intel_de_write(display, PIPE_CRC_CTL(display, pipe), val);
|
||||
intel_de_posting_read(display, PIPE_CRC_CTL(display, pipe));
|
||||
}
|
||||
|
||||
void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct intel_pipe_crc *pipe_crc = &crtc->pipe_crc;
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
@@ -665,7 +665,7 @@ void intel_crtc_disable_pipe_crc(struct intel_crtc *crtc)
|
||||
pipe_crc->skipped = INT_MIN;
|
||||
spin_unlock_irq(&pipe_crc->lock);
|
||||
|
||||
intel_de_write(dev_priv, PIPE_CRC_CTL(dev_priv, pipe), 0);
|
||||
intel_de_posting_read(dev_priv, PIPE_CRC_CTL(dev_priv, pipe));
|
||||
intel_de_write(display, PIPE_CRC_CTL(display, pipe), 0);
|
||||
intel_de_posting_read(display, PIPE_CRC_CTL(display, pipe));
|
||||
intel_synchronize_irq(dev_priv);
|
||||
}
|
||||
|
||||
@@ -52,44 +52,55 @@ intel_reuse_initial_plane_obj(struct intel_crtc *this,
|
||||
return false;
|
||||
}
|
||||
|
||||
static enum intel_memory_type
|
||||
initial_plane_memory_type(struct drm_i915_private *i915)
|
||||
{
|
||||
if (IS_DGFX(i915))
|
||||
return INTEL_MEMORY_LOCAL;
|
||||
else if (HAS_LMEMBAR_SMEM_STOLEN(i915))
|
||||
return INTEL_MEMORY_STOLEN_LOCAL;
|
||||
else
|
||||
return INTEL_MEMORY_STOLEN_SYSTEM;
|
||||
}
|
||||
|
||||
static bool
|
||||
initial_plane_phys_lmem(struct intel_display *display,
|
||||
struct intel_initial_plane_config *plane_config)
|
||||
initial_plane_phys(struct intel_display *display,
|
||||
struct intel_initial_plane_config *plane_config)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
gen8_pte_t __iomem *gte = to_gt(i915)->ggtt->gsm;
|
||||
struct i915_ggtt *ggtt = to_gt(i915)->ggtt;
|
||||
struct intel_memory_region *mem;
|
||||
enum intel_memory_type mem_type;
|
||||
bool is_present, is_local;
|
||||
dma_addr_t dma_addr;
|
||||
gen8_pte_t pte;
|
||||
u32 base;
|
||||
|
||||
mem_type = initial_plane_memory_type(i915);
|
||||
mem = intel_memory_region_by_type(i915, mem_type);
|
||||
if (!mem) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"Initial plane memory region (type %s) not initialized\n",
|
||||
intel_memory_type_str(mem_type));
|
||||
return false;
|
||||
}
|
||||
|
||||
base = round_down(plane_config->base, I915_GTT_MIN_ALIGNMENT);
|
||||
|
||||
gte += base / I915_GTT_PAGE_SIZE;
|
||||
dma_addr = intel_ggtt_read_entry(&ggtt->vm, base, &is_present, &is_local);
|
||||
|
||||
pte = ioread64(gte);
|
||||
if (!(pte & GEN12_GGTT_PTE_LM)) {
|
||||
if (!is_present) {
|
||||
drm_err(display->drm,
|
||||
"Initial plane programming missing PTE_LM bit\n");
|
||||
"Initial plane FB PTE not present\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
dma_addr = pte & GEN12_GGTT_PTE_ADDR_MASK;
|
||||
|
||||
if (IS_DGFX(i915))
|
||||
mem = i915->mm.regions[INTEL_REGION_LMEM_0];
|
||||
else
|
||||
mem = i915->mm.stolen_region;
|
||||
if (!mem) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"Initial plane memory region not initialized\n");
|
||||
if (intel_memory_type_is_local(mem->type) != is_local) {
|
||||
drm_err(display->drm,
|
||||
"Initial plane FB PTE unsuitable for %s\n",
|
||||
mem->region.name);
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* On lmem we don't currently expect this to
|
||||
* ever be placed in the stolen portion.
|
||||
*/
|
||||
if (dma_addr < mem->region.start || dma_addr > mem->region.end) {
|
||||
drm_err(display->drm,
|
||||
"Initial plane programming using invalid range, dma_addr=%pa (%s [%pa-%pa])\n",
|
||||
@@ -107,42 +118,6 @@ initial_plane_phys_lmem(struct intel_display *display,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
initial_plane_phys_smem(struct intel_display *display,
|
||||
struct intel_initial_plane_config *plane_config)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
struct intel_memory_region *mem;
|
||||
u32 base;
|
||||
|
||||
base = round_down(plane_config->base, I915_GTT_MIN_ALIGNMENT);
|
||||
|
||||
mem = i915->mm.stolen_region;
|
||||
if (!mem) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"Initial plane memory region not initialized\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* FIXME get and validate the dma_addr from the PTE */
|
||||
plane_config->phys_base = base;
|
||||
plane_config->mem = mem;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
initial_plane_phys(struct intel_display *display,
|
||||
struct intel_initial_plane_config *plane_config)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(display->drm);
|
||||
|
||||
if (IS_DGFX(i915) || HAS_LMEMBAR_SMEM_STOLEN(i915))
|
||||
return initial_plane_phys_lmem(display, plane_config);
|
||||
else
|
||||
return initial_plane_phys_smem(display, plane_config);
|
||||
}
|
||||
|
||||
static struct i915_vma *
|
||||
initial_plane_vma(struct intel_display *display,
|
||||
struct intel_initial_plane_config *plane_config)
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_reg.h"
|
||||
#include "i915_utils.h"
|
||||
#include "intel_atomic.h"
|
||||
|
||||
@@ -91,7 +91,6 @@ static void
|
||||
vlv_power_sequencer_kick(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||
enum pipe pipe = intel_dp->pps.vlv_pps_pipe;
|
||||
bool pll_enabled, release_cl_override = false;
|
||||
@@ -134,7 +133,7 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp)
|
||||
release_cl_override = display->platform.cherryview &&
|
||||
!chv_phy_powergate_ch(display, phy, ch, true);
|
||||
|
||||
if (vlv_force_pll_on(dev_priv, pipe, vlv_get_dpll(display))) {
|
||||
if (vlv_force_pll_on(display, pipe, vlv_get_dpll(display))) {
|
||||
drm_err(display->drm,
|
||||
"Failed to force on PLL for pipe %c!\n",
|
||||
pipe_name(pipe));
|
||||
@@ -158,7 +157,7 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp)
|
||||
intel_de_posting_read(display, intel_dp->output_reg);
|
||||
|
||||
if (!pll_enabled) {
|
||||
vlv_force_pll_off(dev_priv, pipe);
|
||||
vlv_force_pll_off(display, pipe);
|
||||
|
||||
if (release_cl_override)
|
||||
chv_phy_powergate_ch(display, phy, ch, false);
|
||||
@@ -744,11 +743,11 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)
|
||||
i915_reg_t pp_stat_reg, pp_ctrl_reg;
|
||||
bool need_to_disable = !intel_dp->pps.want_panel_vdd;
|
||||
|
||||
lockdep_assert_held(&display->pps.mutex);
|
||||
|
||||
if (!intel_dp_is_edp(intel_dp))
|
||||
return false;
|
||||
|
||||
lockdep_assert_held(&display->pps.mutex);
|
||||
|
||||
cancel_delayed_work(&intel_dp->pps.panel_vdd_work);
|
||||
intel_dp->pps.want_panel_vdd = true;
|
||||
|
||||
@@ -925,11 +924,11 @@ void intel_pps_vdd_off_unlocked(struct intel_dp *intel_dp, bool sync)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
|
||||
lockdep_assert_held(&display->pps.mutex);
|
||||
|
||||
if (!intel_dp_is_edp(intel_dp))
|
||||
return;
|
||||
|
||||
lockdep_assert_held(&display->pps.mutex);
|
||||
|
||||
INTEL_DISPLAY_STATE_WARN(display, !intel_dp->pps.want_panel_vdd,
|
||||
"[ENCODER:%d:%s] %s VDD not forced on",
|
||||
dp_to_dig_port(intel_dp)->base.base.base.id,
|
||||
@@ -1855,7 +1854,7 @@ void assert_pps_unlocked(struct intel_display *display, enum pipe pipe)
|
||||
|
||||
switch (port_sel) {
|
||||
case PANEL_PORT_SELECT_LVDS:
|
||||
intel_lvds_port_enabled(dev_priv, PCH_LVDS, &panel_pipe);
|
||||
intel_lvds_port_enabled(display, PCH_LVDS, &panel_pipe);
|
||||
break;
|
||||
case PANEL_PORT_SELECT_DPA:
|
||||
g4x_dp_port_enabled(display, DP_A, PORT_A, &panel_pipe);
|
||||
@@ -1883,7 +1882,7 @@ void assert_pps_unlocked(struct intel_display *display, enum pipe pipe)
|
||||
|
||||
drm_WARN_ON(display->drm,
|
||||
port_sel != PANEL_PORT_SELECT_LVDS);
|
||||
intel_lvds_port_enabled(dev_priv, LVDS, &panel_pipe);
|
||||
intel_lvds_port_enabled(display, LVDS, &panel_pipe);
|
||||
}
|
||||
|
||||
val = intel_de_read(display, pp_reg);
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "intel_ddi.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_irq.h"
|
||||
#include "intel_display_rpm.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_dp.h"
|
||||
#include "intel_dp_aux.h"
|
||||
@@ -463,8 +464,8 @@ void intel_psr_irq_handler(struct intel_dp *intel_dp, u32 psr_iir)
|
||||
if (DISPLAY_VER(display) >= 9) {
|
||||
u32 val;
|
||||
|
||||
val = intel_de_rmw(dev_priv,
|
||||
PSR_EVENT(dev_priv, cpu_transcoder),
|
||||
val = intel_de_rmw(display,
|
||||
PSR_EVENT(display, cpu_transcoder),
|
||||
0, 0);
|
||||
|
||||
psr_event_print(display, val, intel_dp->psr.sel_update_enabled);
|
||||
@@ -689,7 +690,6 @@ void intel_psr_init_dpcd(struct intel_dp *intel_dp)
|
||||
static void hsw_psr_setup_aux(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
|
||||
u32 aux_clock_divider, aux_ctl;
|
||||
/* write DP_SET_POWER=D0 */
|
||||
@@ -704,7 +704,7 @@ static void hsw_psr_setup_aux(struct intel_dp *intel_dp)
|
||||
|
||||
BUILD_BUG_ON(sizeof(aux_msg) > 20);
|
||||
for (i = 0; i < sizeof(aux_msg); i += 4)
|
||||
intel_de_write(dev_priv,
|
||||
intel_de_write(display,
|
||||
psr_aux_data_reg(display, cpu_transcoder, i >> 2),
|
||||
intel_dp_aux_pack(&aux_msg[i], sizeof(aux_msg) - i));
|
||||
|
||||
@@ -839,7 +839,6 @@ static u32 intel_psr1_get_tp_time(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct intel_connector *connector = intel_dp->attached_connector;
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
u32 val = 0;
|
||||
|
||||
if (DISPLAY_VER(display) >= 11)
|
||||
@@ -873,7 +872,7 @@ static u32 intel_psr1_get_tp_time(struct intel_dp *intel_dp)
|
||||
* WA 0479: hsw,bdw
|
||||
* "Do not skip both TP1 and TP2/TP3"
|
||||
*/
|
||||
if (DISPLAY_VER(dev_priv) < 9 &&
|
||||
if (DISPLAY_VER(display) < 9 &&
|
||||
connector->panel.vbt.psr.tp1_wakeup_time_us == 0 &&
|
||||
connector->panel.vbt.psr.tp2_tp3_wakeup_time_us == 0)
|
||||
val |= EDP_PSR_TP2_TP3_TIME_100us;
|
||||
@@ -909,7 +908,6 @@ static u8 psr_compute_idle_frames(struct intel_dp *intel_dp)
|
||||
static void hsw_activate_psr1(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
|
||||
u32 max_sleep_time = 0x1f;
|
||||
u32 val = EDP_PSR_ENABLE;
|
||||
@@ -919,7 +917,7 @@ static void hsw_activate_psr1(struct intel_dp *intel_dp)
|
||||
if (DISPLAY_VER(display) < 20)
|
||||
val |= EDP_PSR_MAX_SLEEP_TIME(max_sleep_time);
|
||||
|
||||
if (IS_HASWELL(dev_priv))
|
||||
if (display->platform.haswell)
|
||||
val |= EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES;
|
||||
|
||||
if (intel_dp->psr.link_standby)
|
||||
@@ -1013,14 +1011,13 @@ static void dg2_activate_panel_replay(struct intel_dp *intel_dp)
|
||||
static void hsw_activate_psr2(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
|
||||
u32 val = EDP_PSR2_ENABLE;
|
||||
u32 psr_val = 0;
|
||||
|
||||
val |= EDP_PSR2_IDLE_FRAMES(psr_compute_idle_frames(intel_dp));
|
||||
|
||||
if (DISPLAY_VER(display) < 14 && !IS_ALDERLAKE_P(dev_priv))
|
||||
if (DISPLAY_VER(display) < 14 && !display->platform.alderlake_p)
|
||||
val |= EDP_SU_TRACK_ENABLE;
|
||||
|
||||
if (DISPLAY_VER(display) >= 10 && DISPLAY_VER(display) < 13)
|
||||
@@ -1038,7 +1035,7 @@ static void hsw_activate_psr2(struct intel_dp *intel_dp)
|
||||
}
|
||||
|
||||
/* Wa_22012278275:adl-p */
|
||||
if (IS_ALDERLAKE_P(dev_priv) && IS_DISPLAY_STEP(display, STEP_A0, STEP_E0)) {
|
||||
if (display->platform.alderlake_p && IS_DISPLAY_STEP(display, STEP_A0, STEP_E0)) {
|
||||
static const u8 map[] = {
|
||||
2, /* 5 lines */
|
||||
1, /* 6 lines */
|
||||
@@ -1103,9 +1100,7 @@ static void hsw_activate_psr2(struct intel_dp *intel_dp)
|
||||
static bool
|
||||
transcoder_has_psr2(struct intel_display *display, enum transcoder cpu_transcoder)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
if (IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER(display) >= 14)
|
||||
if (display->platform.alderlake_p || DISPLAY_VER(display) >= 14)
|
||||
return cpu_transcoder == TRANSCODER_A || cpu_transcoder == TRANSCODER_B;
|
||||
else if (DISPLAY_VER(display) >= 12)
|
||||
return cpu_transcoder == TRANSCODER_A;
|
||||
@@ -1183,10 +1178,9 @@ dc3co_is_pipe_port_compatible(struct intel_dp *intel_dp,
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
|
||||
enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe;
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum port port = dig_port->base.port;
|
||||
|
||||
if (IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER(display) >= 14)
|
||||
if (display->platform.alderlake_p || DISPLAY_VER(display) >= 14)
|
||||
return pipe <= PIPE_B && port <= PORT_B;
|
||||
else
|
||||
return pipe == PIPE_A && port == PORT_A;
|
||||
@@ -1197,7 +1191,6 @@ tgl_dc3co_exitline_compute_config(struct intel_dp *intel_dp,
|
||||
struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
const u32 crtc_vdisplay = crtc_state->uapi.adjusted_mode.crtc_vdisplay;
|
||||
struct i915_power_domains *power_domains = &display->power.domains;
|
||||
u32 exit_scanlines;
|
||||
@@ -1223,7 +1216,7 @@ tgl_dc3co_exitline_compute_config(struct intel_dp *intel_dp,
|
||||
return;
|
||||
|
||||
/* Wa_16011303918:adl-p */
|
||||
if (IS_ALDERLAKE_P(dev_priv) && IS_DISPLAY_STEP(display, STEP_A0, STEP_B0))
|
||||
if (display->platform.alderlake_p && IS_DISPLAY_STEP(display, STEP_A0, STEP_B0))
|
||||
return;
|
||||
|
||||
/*
|
||||
@@ -1264,7 +1257,6 @@ static bool psr2_granularity_check(struct intel_dp *intel_dp,
|
||||
struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
|
||||
const int crtc_hdisplay = crtc_state->hw.adjusted_mode.crtc_hdisplay;
|
||||
const int crtc_vdisplay = crtc_state->hw.adjusted_mode.crtc_vdisplay;
|
||||
@@ -1286,7 +1278,7 @@ static bool psr2_granularity_check(struct intel_dp *intel_dp,
|
||||
* For other platforms with SW tracking we can adjust the y coordinates
|
||||
* to match sink requirement if multiple of 4.
|
||||
*/
|
||||
if (IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER(display) >= 14)
|
||||
if (display->platform.alderlake_p || DISPLAY_VER(display) >= 14)
|
||||
y_granularity = intel_dp->psr.su_y_granularity;
|
||||
else if (intel_dp->psr.su_y_granularity <= 2)
|
||||
y_granularity = 4;
|
||||
@@ -1412,7 +1404,6 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
|
||||
struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
int crtc_hdisplay = crtc_state->hw.adjusted_mode.crtc_hdisplay;
|
||||
int crtc_vdisplay = crtc_state->hw.adjusted_mode.crtc_vdisplay;
|
||||
int psr_max_h = 0, psr_max_v = 0, max_bpp = 0;
|
||||
@@ -1421,20 +1412,20 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
|
||||
return false;
|
||||
|
||||
/* JSL and EHL only supports eDP 1.3 */
|
||||
if (IS_JASPERLAKE(dev_priv) || IS_ELKHARTLAKE(dev_priv)) {
|
||||
if (display->platform.jasperlake || display->platform.elkhartlake) {
|
||||
drm_dbg_kms(display->drm, "PSR2 not supported by phy\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Wa_16011181250 */
|
||||
if (IS_ROCKETLAKE(dev_priv) || IS_ALDERLAKE_S(dev_priv) ||
|
||||
IS_DG2(dev_priv)) {
|
||||
if (display->platform.rocketlake || display->platform.alderlake_s ||
|
||||
display->platform.dg2) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"PSR2 is defeatured for this platform\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IS_ALDERLAKE_P(dev_priv) && IS_DISPLAY_STEP(display, STEP_A0, STEP_B0)) {
|
||||
if (display->platform.alderlake_p && IS_DISPLAY_STEP(display, STEP_A0, STEP_B0)) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"PSR2 not completely functional in this stepping\n");
|
||||
return false;
|
||||
@@ -1453,7 +1444,7 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
|
||||
* over PSR2.
|
||||
*/
|
||||
if (crtc_state->dsc.compression_enable &&
|
||||
(DISPLAY_VER(display) < 14 && !IS_ALDERLAKE_P(dev_priv))) {
|
||||
(DISPLAY_VER(display) < 14 && !display->platform.alderlake_p)) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"PSR2 cannot be enabled since DSC is enabled\n");
|
||||
return false;
|
||||
@@ -1486,7 +1477,7 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
|
||||
|
||||
/* Wa_16011303918:adl-p */
|
||||
if (crtc_state->vrr.enable &&
|
||||
IS_ALDERLAKE_P(dev_priv) && IS_DISPLAY_STEP(display, STEP_A0, STEP_B0)) {
|
||||
display->platform.alderlake_p && IS_DISPLAY_STEP(display, STEP_A0, STEP_B0)) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"PSR2 not enabled, not compatible with HW stepping + VRR\n");
|
||||
return false;
|
||||
@@ -1604,6 +1595,12 @@ _panel_replay_compute_config(struct intel_dp *intel_dp,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (crtc_state->crc_enabled) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"Panel Replay not enabled because it would inhibit pipe CRC calculation\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!intel_dp_is_edp(intel_dp))
|
||||
return true;
|
||||
|
||||
@@ -1634,12 +1631,6 @@ _panel_replay_compute_config(struct intel_dp *intel_dp,
|
||||
if (!alpm_config_valid(intel_dp, crtc_state, true))
|
||||
return false;
|
||||
|
||||
if (crtc_state->crc_enabled) {
|
||||
drm_dbg_kms(display->drm,
|
||||
"Panel Replay not enabled because it would inhibit pipe CRC calculation\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1827,7 +1818,6 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp,
|
||||
const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
|
||||
u32 mask = 0;
|
||||
|
||||
@@ -1866,7 +1856,7 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp,
|
||||
* As a workaround leave LPSP unmasked to prevent PSR entry
|
||||
* when external displays are active.
|
||||
*/
|
||||
if (DISPLAY_VER(display) >= 8 || IS_HASWELL_ULT(dev_priv))
|
||||
if (DISPLAY_VER(display) >= 8 || display->platform.haswell_ult)
|
||||
mask |= EDP_PSR_DEBUG_MASK_LPSP;
|
||||
|
||||
if (DISPLAY_VER(display) < 20)
|
||||
@@ -1880,7 +1870,7 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp,
|
||||
mask |= EDP_PSR_DEBUG_MASK_DISP_REG_WRITE;
|
||||
|
||||
/* allow PSR with sprite enabled */
|
||||
if (IS_HASWELL(dev_priv))
|
||||
if (display->platform.haswell)
|
||||
mask |= EDP_PSR_DEBUG_MASK_SPRITE_ENABLE;
|
||||
}
|
||||
|
||||
@@ -1925,7 +1915,7 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp,
|
||||
*/
|
||||
if (!intel_dp->psr.panel_replay_enabled &&
|
||||
(IS_DISPLAY_VERx100_STEP(display, 1400, STEP_A0, STEP_B0) ||
|
||||
IS_ALDERLAKE_P(dev_priv)))
|
||||
display->platform.alderlake_p))
|
||||
intel_de_rmw(display, CHICKEN_TRANS(display, cpu_transcoder),
|
||||
0, ADLP_1_BASED_X_GRANULARITY);
|
||||
|
||||
@@ -1936,7 +1926,7 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp,
|
||||
MTL_CLKGATE_DIS_TRANS(display, cpu_transcoder),
|
||||
0,
|
||||
MTL_CLKGATE_DIS_TRANS_DMASC_GATING_DIS);
|
||||
else if (IS_ALDERLAKE_P(dev_priv))
|
||||
else if (display->platform.alderlake_p)
|
||||
intel_de_rmw(display, CLKGATE_DIS_MISC, 0,
|
||||
CLKGATE_DIS_MISC_DMASC_GATING_DIS);
|
||||
}
|
||||
@@ -2024,7 +2014,7 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
|
||||
|
||||
intel_psr_enable_source(intel_dp, crtc_state);
|
||||
intel_dp->psr.enabled = true;
|
||||
intel_dp->psr.paused = false;
|
||||
intel_dp->psr.pause_counter = 0;
|
||||
|
||||
/*
|
||||
* Link_ok is sticky and set here on PSR enable. We can assume link
|
||||
@@ -2104,7 +2094,6 @@ static void intel_psr_wait_exit_locked(struct intel_dp *intel_dp)
|
||||
static void intel_psr_disable_locked(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
|
||||
|
||||
lockdep_assert_held(&intel_dp->psr.lock);
|
||||
@@ -2136,7 +2125,7 @@ static void intel_psr_disable_locked(struct intel_dp *intel_dp)
|
||||
intel_de_rmw(display,
|
||||
MTL_CLKGATE_DIS_TRANS(display, cpu_transcoder),
|
||||
MTL_CLKGATE_DIS_TRANS_DMASC_GATING_DIS, 0);
|
||||
else if (IS_ALDERLAKE_P(dev_priv))
|
||||
else if (display->platform.alderlake_p)
|
||||
intel_de_rmw(display, CLKGATE_DIS_MISC,
|
||||
CLKGATE_DIS_MISC_DMASC_GATING_DIS, 0);
|
||||
}
|
||||
@@ -2210,7 +2199,6 @@ void intel_psr_disable(struct intel_dp *intel_dp,
|
||||
*/
|
||||
void intel_psr_pause(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct intel_psr *psr = &intel_dp->psr;
|
||||
|
||||
if (!CAN_PSR(intel_dp) && !CAN_PANEL_REPLAY(intel_dp))
|
||||
@@ -2223,12 +2211,10 @@ void intel_psr_pause(struct intel_dp *intel_dp)
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we ever hit this, we will need to add refcount to pause/resume */
|
||||
drm_WARN_ON(display->drm, psr->paused);
|
||||
|
||||
intel_psr_exit(intel_dp);
|
||||
intel_psr_wait_exit_locked(intel_dp);
|
||||
psr->paused = true;
|
||||
if (intel_dp->psr.pause_counter++ == 0) {
|
||||
intel_psr_exit(intel_dp);
|
||||
intel_psr_wait_exit_locked(intel_dp);
|
||||
}
|
||||
|
||||
mutex_unlock(&psr->lock);
|
||||
|
||||
@@ -2244,6 +2230,7 @@ void intel_psr_pause(struct intel_dp *intel_dp)
|
||||
*/
|
||||
void intel_psr_resume(struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct intel_psr *psr = &intel_dp->psr;
|
||||
|
||||
if (!CAN_PSR(intel_dp) && !CAN_PANEL_REPLAY(intel_dp))
|
||||
@@ -2251,13 +2238,18 @@ void intel_psr_resume(struct intel_dp *intel_dp)
|
||||
|
||||
mutex_lock(&psr->lock);
|
||||
|
||||
if (!psr->paused)
|
||||
goto unlock;
|
||||
if (!psr->enabled)
|
||||
goto out;
|
||||
|
||||
psr->paused = false;
|
||||
intel_psr_activate(intel_dp);
|
||||
if (!psr->pause_counter) {
|
||||
drm_warn(display->drm, "Unbalanced PSR pause/resume!\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
unlock:
|
||||
if (--intel_dp->psr.pause_counter == 0)
|
||||
intel_psr_activate(intel_dp);
|
||||
|
||||
out:
|
||||
mutex_unlock(&psr->lock);
|
||||
}
|
||||
|
||||
@@ -2314,35 +2306,27 @@ void intel_psr_trigger_frame_change_event(struct intel_dsb *dsb,
|
||||
|
||||
static u32 man_trk_ctl_enable_bit_get(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
return IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER(display) >= 14 ? 0 :
|
||||
return display->platform.alderlake_p || DISPLAY_VER(display) >= 14 ? 0 :
|
||||
PSR2_MAN_TRK_CTL_ENABLE;
|
||||
}
|
||||
|
||||
static u32 man_trk_ctl_single_full_frame_bit_get(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
return IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER(display) >= 14 ?
|
||||
return display->platform.alderlake_p || DISPLAY_VER(display) >= 14 ?
|
||||
ADLP_PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME :
|
||||
PSR2_MAN_TRK_CTL_SF_SINGLE_FULL_FRAME;
|
||||
}
|
||||
|
||||
static u32 man_trk_ctl_partial_frame_bit_get(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
return IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER(display) >= 14 ?
|
||||
return display->platform.alderlake_p || DISPLAY_VER(display) >= 14 ?
|
||||
ADLP_PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE :
|
||||
PSR2_MAN_TRK_CTL_SF_PARTIAL_FRAME_UPDATE;
|
||||
}
|
||||
|
||||
static u32 man_trk_ctl_continuos_full_frame(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
return IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER(display) >= 14 ?
|
||||
return display->platform.alderlake_p || DISPLAY_VER(display) >= 14 ?
|
||||
ADLP_PSR2_MAN_TRK_CTL_SF_CONTINUOS_FULL_FRAME :
|
||||
PSR2_MAN_TRK_CTL_SF_CONTINUOS_FULL_FRAME;
|
||||
}
|
||||
@@ -2405,8 +2389,6 @@ static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state,
|
||||
bool full_update)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
u32 val = man_trk_ctl_enable_bit_get(display);
|
||||
|
||||
/* SF partial frame enable has to be set even on full update */
|
||||
@@ -2420,7 +2402,7 @@ static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state,
|
||||
if (crtc_state->psr2_su_area.y1 == -1)
|
||||
goto exit;
|
||||
|
||||
if (IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER(display) >= 14) {
|
||||
if (display->platform.alderlake_p || DISPLAY_VER(display) >= 14) {
|
||||
val |= ADLP_PSR2_MAN_TRK_CTL_SU_REGION_START_ADDR(crtc_state->psr2_su_area.y1);
|
||||
val |= ADLP_PSR2_MAN_TRK_CTL_SU_REGION_END_ADDR(crtc_state->psr2_su_area.y2 - 1);
|
||||
} else {
|
||||
@@ -2474,13 +2456,12 @@ static void clip_area_update(struct drm_rect *overlap_damage_area,
|
||||
static void intel_psr2_sel_fetch_pipe_alignment(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
|
||||
const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
|
||||
u16 y_alignment;
|
||||
|
||||
/* ADLP aligns the SU region to vdsc slice height in case dsc is enabled */
|
||||
if (crtc_state->dsc.compression_enable &&
|
||||
(IS_ALDERLAKE_P(dev_priv) || DISPLAY_VER(display) >= 14))
|
||||
(display->platform.alderlake_p || DISPLAY_VER(display) >= 14))
|
||||
y_alignment = vdsc_cfg->slice_height;
|
||||
else
|
||||
y_alignment = crtc_state->su_y_granularity;
|
||||
@@ -2601,12 +2582,11 @@ static void
|
||||
intel_psr_apply_su_area_workarounds(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
|
||||
|
||||
/* Wa_14014971492 */
|
||||
if (!crtc_state->has_panel_replay &&
|
||||
((IS_DISPLAY_VERx100_STEP(display, 1400, STEP_A0, STEP_B0) ||
|
||||
IS_ALDERLAKE_P(i915) || IS_TIGERLAKE(i915))) &&
|
||||
display->platform.alderlake_p || display->platform.tigerlake)) &&
|
||||
crtc_state->splitter.enable)
|
||||
crtc_state->psr2_su_area.y1 = 0;
|
||||
|
||||
@@ -2807,7 +2787,6 @@ void intel_psr_pre_plane_update(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
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 =
|
||||
@@ -2839,7 +2818,7 @@ void intel_psr_pre_plane_update(struct intel_atomic_state *state,
|
||||
new_crtc_state->has_sel_update != psr->sel_update_enabled ||
|
||||
new_crtc_state->enable_psr2_su_region_et != psr->su_region_et_enabled ||
|
||||
new_crtc_state->has_panel_replay != psr->panel_replay_enabled ||
|
||||
(DISPLAY_VER(i915) < 11 && new_crtc_state->wm_level_disabled))
|
||||
(DISPLAY_VER(display) < 11 && new_crtc_state->wm_level_disabled))
|
||||
intel_psr_disable_locked(intel_dp);
|
||||
else if (new_crtc_state->wm_level_disabled)
|
||||
/* Wa_14015648006 */
|
||||
@@ -3322,7 +3301,7 @@ void intel_psr_flush(struct intel_display *display,
|
||||
* we have to ensure that the PSR is not activated until
|
||||
* intel_psr_resume() is called.
|
||||
*/
|
||||
if (intel_dp->psr.paused)
|
||||
if (intel_dp->psr.pause_counter)
|
||||
goto unlock;
|
||||
|
||||
if (origin == ORIGIN_FLIP ||
|
||||
@@ -3634,8 +3613,8 @@ psr_source_status(struct intel_dp *intel_dp, struct seq_file *m)
|
||||
const char *status = "unknown";
|
||||
u32 val, status_val;
|
||||
|
||||
if (intel_dp_is_edp(intel_dp) && (intel_dp->psr.sel_update_enabled ||
|
||||
intel_dp->psr.panel_replay_enabled)) {
|
||||
if ((intel_dp_is_edp(intel_dp) || DISPLAY_VER(display) >= 30) &&
|
||||
(intel_dp->psr.sel_update_enabled || intel_dp->psr.panel_replay_enabled)) {
|
||||
static const char * const live_status[] = {
|
||||
"IDLE",
|
||||
"CAPTURE",
|
||||
@@ -3728,10 +3707,9 @@ static void intel_psr_print_mode(struct intel_dp *intel_dp,
|
||||
static int intel_psr_status(struct seq_file *m, struct intel_dp *intel_dp)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
|
||||
struct intel_psr *psr = &intel_dp->psr;
|
||||
intel_wakeref_t wakeref;
|
||||
struct ref_tracker *wakeref;
|
||||
bool enabled;
|
||||
u32 val, psr2_ctl;
|
||||
|
||||
@@ -3740,7 +3718,7 @@ static int intel_psr_status(struct seq_file *m, struct intel_dp *intel_dp)
|
||||
if (!(psr->sink_support || psr->sink_panel_replay_support))
|
||||
return 0;
|
||||
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
wakeref = intel_display_rpm_get(display);
|
||||
mutex_lock(&psr->lock);
|
||||
|
||||
intel_psr_print_mode(intel_dp, m);
|
||||
@@ -3822,7 +3800,7 @@ static int intel_psr_status(struct seq_file *m, struct intel_dp *intel_dp)
|
||||
|
||||
unlock:
|
||||
mutex_unlock(&psr->lock);
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
intel_display_rpm_put(display, wakeref);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3853,9 +3831,7 @@ static int
|
||||
i915_edp_psr_debug_set(void *data, u64 val)
|
||||
{
|
||||
struct intel_display *display = data;
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
struct intel_encoder *encoder;
|
||||
intel_wakeref_t wakeref;
|
||||
int ret = -ENODEV;
|
||||
|
||||
if (!HAS_PSR(display))
|
||||
@@ -3866,12 +3842,9 @@ i915_edp_psr_debug_set(void *data, u64 val)
|
||||
|
||||
drm_dbg_kms(display->drm, "Setting PSR debug to %llx\n", val);
|
||||
|
||||
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
|
||||
|
||||
// TODO: split to each transcoder's PSR debug state
|
||||
ret = intel_psr_debug_set(intel_dp, val);
|
||||
|
||||
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
|
||||
with_intel_display_rpm(display)
|
||||
ret = intel_psr_debug_set(intel_dp, val);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -2036,7 +2036,7 @@ static u16 intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo)
|
||||
struct intel_display *display = to_intel_display(&intel_sdvo->base);
|
||||
u16 hotplug;
|
||||
|
||||
if (!I915_HAS_HOTPLUG(display))
|
||||
if (!HAS_HOTPLUG(display))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <linux/math.h>
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_reg.h"
|
||||
#include "i915_utils.h"
|
||||
#include "intel_ddi.h"
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
* Copyright © 2019 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_reg.h"
|
||||
#include "i915_utils.h"
|
||||
#include "intel_atomic.h"
|
||||
#include "intel_cx0_phy_regs.h"
|
||||
#include "intel_ddi.h"
|
||||
@@ -92,11 +94,6 @@ static struct intel_tc_port *to_tc_port(struct intel_digital_port *dig_port)
|
||||
return dig_port->tc;
|
||||
}
|
||||
|
||||
static struct drm_i915_private *tc_to_i915(struct intel_tc_port *tc)
|
||||
{
|
||||
return to_i915(tc->dig_port->base.base.dev);
|
||||
}
|
||||
|
||||
static bool intel_tc_port_in_mode(struct intel_digital_port *dig_port,
|
||||
enum tc_port_mode mode)
|
||||
{
|
||||
@@ -219,10 +216,11 @@ __tc_cold_unblock(struct intel_tc_port *tc, enum intel_display_power_domain doma
|
||||
static void
|
||||
tc_cold_unblock(struct intel_tc_port *tc, intel_wakeref_t wakeref)
|
||||
{
|
||||
struct intel_display __maybe_unused *display = to_intel_display(tc->dig_port);
|
||||
enum intel_display_power_domain domain = tc_phy_cold_off_domain(tc);
|
||||
|
||||
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
|
||||
drm_WARN_ON(&tc_to_i915(tc)->drm, tc->lock_power_domain != domain);
|
||||
drm_WARN_ON(display->drm, tc->lock_power_domain != domain);
|
||||
#endif
|
||||
__tc_cold_unblock(tc, domain, wakeref);
|
||||
}
|
||||
@@ -266,13 +264,13 @@ assert_tc_port_power_enabled(struct intel_tc_port *tc)
|
||||
|
||||
static u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(dig_port);
|
||||
struct intel_tc_port *tc = to_tc_port(dig_port);
|
||||
u32 lane_mask;
|
||||
|
||||
lane_mask = intel_de_read(i915, PORT_TX_DFLEXDPSP(tc->phy_fia));
|
||||
lane_mask = intel_de_read(display, PORT_TX_DFLEXDPSP(tc->phy_fia));
|
||||
|
||||
drm_WARN_ON(&i915->drm, lane_mask == 0xffffffff);
|
||||
drm_WARN_ON(display->drm, lane_mask == 0xffffffff);
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
lane_mask &= DP_LANE_ASSIGNMENT_MASK(tc->phy_fia_idx);
|
||||
@@ -281,13 +279,13 @@ static u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port)
|
||||
|
||||
u32 intel_tc_port_get_pin_assignment_mask(struct intel_digital_port *dig_port)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(dig_port);
|
||||
struct intel_tc_port *tc = to_tc_port(dig_port);
|
||||
u32 pin_mask;
|
||||
|
||||
pin_mask = intel_de_read(i915, PORT_TX_DFLEXPA1(tc->phy_fia));
|
||||
pin_mask = intel_de_read(display, PORT_TX_DFLEXPA1(tc->phy_fia));
|
||||
|
||||
drm_WARN_ON(&i915->drm, pin_mask == 0xffffffff);
|
||||
drm_WARN_ON(display->drm, pin_mask == 0xffffffff);
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
return (pin_mask & DP_PIN_ASSIGNMENT_MASK(tc->phy_fia_idx)) >>
|
||||
@@ -297,13 +295,12 @@ u32 intel_tc_port_get_pin_assignment_mask(struct intel_digital_port *dig_port)
|
||||
static int lnl_tc_port_get_max_lane_count(struct intel_digital_port *dig_port)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(dig_port);
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
enum tc_port tc_port = intel_encoder_to_tc(&dig_port->base);
|
||||
intel_wakeref_t wakeref;
|
||||
u32 val, pin_assignment;
|
||||
|
||||
with_intel_display_power(display, POWER_DOMAIN_DISPLAY_CORE, wakeref)
|
||||
val = intel_de_read(i915, TCSS_DDI_STATUS(tc_port));
|
||||
val = intel_de_read(display, TCSS_DDI_STATUS(tc_port));
|
||||
|
||||
pin_assignment =
|
||||
REG_FIELD_GET(TCSS_DDI_STATUS_PIN_ASSIGNMENT_MASK, val);
|
||||
@@ -369,7 +366,7 @@ static int intel_tc_port_get_max_lane_count(struct intel_digital_port *dig_port)
|
||||
|
||||
int intel_tc_port_max_lane_count(struct intel_digital_port *dig_port)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(dig_port);
|
||||
struct intel_tc_port *tc = to_tc_port(dig_port);
|
||||
|
||||
if (!intel_encoder_is_tc(&dig_port->base) || tc->mode != TC_PORT_DP_ALT)
|
||||
@@ -377,10 +374,10 @@ int intel_tc_port_max_lane_count(struct intel_digital_port *dig_port)
|
||||
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
if (DISPLAY_VER(i915) >= 20)
|
||||
if (DISPLAY_VER(display) >= 20)
|
||||
return lnl_tc_port_get_max_lane_count(dig_port);
|
||||
|
||||
if (DISPLAY_VER(i915) >= 14)
|
||||
if (DISPLAY_VER(display) >= 14)
|
||||
return mtl_tc_port_get_max_lane_count(dig_port);
|
||||
|
||||
return intel_tc_port_get_max_lane_count(dig_port);
|
||||
@@ -389,20 +386,20 @@ int intel_tc_port_max_lane_count(struct intel_digital_port *dig_port)
|
||||
void intel_tc_port_set_fia_lane_count(struct intel_digital_port *dig_port,
|
||||
int required_lanes)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(dig_port);
|
||||
struct intel_tc_port *tc = to_tc_port(dig_port);
|
||||
bool lane_reversal = dig_port->lane_reversal;
|
||||
u32 val;
|
||||
|
||||
if (DISPLAY_VER(i915) >= 14)
|
||||
if (DISPLAY_VER(display) >= 14)
|
||||
return;
|
||||
|
||||
drm_WARN_ON(&i915->drm,
|
||||
drm_WARN_ON(display->drm,
|
||||
lane_reversal && tc->mode != TC_PORT_LEGACY);
|
||||
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
val = intel_de_read(i915, PORT_TX_DFLEXDPMLE1(tc->phy_fia));
|
||||
val = intel_de_read(display, PORT_TX_DFLEXDPMLE1(tc->phy_fia));
|
||||
val &= ~DFLEXDPMLE1_DPMLETC_MASK(tc->phy_fia_idx);
|
||||
|
||||
switch (required_lanes) {
|
||||
@@ -423,16 +420,16 @@ void intel_tc_port_set_fia_lane_count(struct intel_digital_port *dig_port,
|
||||
MISSING_CASE(required_lanes);
|
||||
}
|
||||
|
||||
intel_de_write(i915, PORT_TX_DFLEXDPMLE1(tc->phy_fia), val);
|
||||
intel_de_write(display, PORT_TX_DFLEXDPMLE1(tc->phy_fia), val);
|
||||
}
|
||||
|
||||
static void tc_port_fixup_legacy_flag(struct intel_tc_port *tc,
|
||||
u32 live_status_mask)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
u32 valid_hpd_mask;
|
||||
|
||||
drm_WARN_ON(&i915->drm, tc->mode != TC_PORT_DISCONNECTED);
|
||||
drm_WARN_ON(display->drm, tc->mode != TC_PORT_DISCONNECTED);
|
||||
|
||||
if (hweight32(live_status_mask) != 1)
|
||||
return;
|
||||
@@ -447,7 +444,7 @@ static void tc_port_fixup_legacy_flag(struct intel_tc_port *tc,
|
||||
return;
|
||||
|
||||
/* If live status mismatches the VBT flag, trust the live status. */
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: live status %08x mismatches the legacy port flag %08x, fixing flag\n",
|
||||
tc->port_name, live_status_mask, valid_hpd_mask);
|
||||
|
||||
@@ -490,21 +487,20 @@ icl_tc_phy_cold_off_domain(struct intel_tc_port *tc)
|
||||
static u32 icl_tc_phy_hpd_live_status(struct intel_tc_port *tc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_digital_port *dig_port = tc->dig_port;
|
||||
u32 isr_bit = i915->display.hotplug.pch_hpd[dig_port->base.hpd_pin];
|
||||
u32 isr_bit = display->hotplug.pch_hpd[dig_port->base.hpd_pin];
|
||||
intel_wakeref_t wakeref;
|
||||
u32 fia_isr;
|
||||
u32 pch_isr;
|
||||
u32 mask = 0;
|
||||
|
||||
with_intel_display_power(display, tc_phy_cold_off_domain(tc), wakeref) {
|
||||
fia_isr = intel_de_read(i915, PORT_TX_DFLEXDPSP(tc->phy_fia));
|
||||
pch_isr = intel_de_read(i915, SDEISR);
|
||||
fia_isr = intel_de_read(display, PORT_TX_DFLEXDPSP(tc->phy_fia));
|
||||
pch_isr = intel_de_read(display, SDEISR);
|
||||
}
|
||||
|
||||
if (fia_isr == 0xffffffff) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: PHY in TCCOLD, nothing connected\n",
|
||||
tc->port_name);
|
||||
return mask;
|
||||
@@ -531,14 +527,14 @@ static u32 icl_tc_phy_hpd_live_status(struct intel_tc_port *tc)
|
||||
*/
|
||||
static bool icl_tc_phy_is_ready(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
u32 val;
|
||||
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
val = intel_de_read(i915, PORT_TX_DFLEXDPPMS(tc->phy_fia));
|
||||
val = intel_de_read(display, PORT_TX_DFLEXDPPMS(tc->phy_fia));
|
||||
if (val == 0xffffffff) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: PHY in TCCOLD, assuming not ready\n",
|
||||
tc->port_name);
|
||||
return false;
|
||||
@@ -550,14 +546,14 @@ static bool icl_tc_phy_is_ready(struct intel_tc_port *tc)
|
||||
static bool icl_tc_phy_take_ownership(struct intel_tc_port *tc,
|
||||
bool take)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
u32 val;
|
||||
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
val = intel_de_read(i915, PORT_TX_DFLEXDPCSSS(tc->phy_fia));
|
||||
val = intel_de_read(display, PORT_TX_DFLEXDPCSSS(tc->phy_fia));
|
||||
if (val == 0xffffffff) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: PHY in TCCOLD, can't %s ownership\n",
|
||||
tc->port_name, take ? "take" : "release");
|
||||
|
||||
@@ -568,21 +564,21 @@ static bool icl_tc_phy_take_ownership(struct intel_tc_port *tc,
|
||||
if (take)
|
||||
val |= DP_PHY_MODE_STATUS_NOT_SAFE(tc->phy_fia_idx);
|
||||
|
||||
intel_de_write(i915, PORT_TX_DFLEXDPCSSS(tc->phy_fia), val);
|
||||
intel_de_write(display, PORT_TX_DFLEXDPCSSS(tc->phy_fia), val);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool icl_tc_phy_is_owned(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
u32 val;
|
||||
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
val = intel_de_read(i915, PORT_TX_DFLEXDPCSSS(tc->phy_fia));
|
||||
val = intel_de_read(display, PORT_TX_DFLEXDPCSSS(tc->phy_fia));
|
||||
if (val == 0xffffffff) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: PHY in TCCOLD, assume not owned\n",
|
||||
tc->port_name);
|
||||
return false;
|
||||
@@ -619,30 +615,30 @@ static void icl_tc_phy_get_hw_state(struct intel_tc_port *tc)
|
||||
static bool tc_phy_verify_legacy_or_dp_alt_mode(struct intel_tc_port *tc,
|
||||
int required_lanes)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct intel_digital_port *dig_port = tc->dig_port;
|
||||
int max_lanes;
|
||||
|
||||
max_lanes = intel_tc_port_max_lane_count(dig_port);
|
||||
if (tc->mode == TC_PORT_LEGACY) {
|
||||
drm_WARN_ON(&i915->drm, max_lanes != 4);
|
||||
drm_WARN_ON(display->drm, max_lanes != 4);
|
||||
return true;
|
||||
}
|
||||
|
||||
drm_WARN_ON(&i915->drm, tc->mode != TC_PORT_DP_ALT);
|
||||
drm_WARN_ON(display->drm, tc->mode != TC_PORT_DP_ALT);
|
||||
|
||||
/*
|
||||
* Now we have to re-check the live state, in case the port recently
|
||||
* became disconnected. Not necessary for legacy mode.
|
||||
*/
|
||||
if (!(tc_phy_hpd_live_status(tc) & BIT(TC_PORT_DP_ALT))) {
|
||||
drm_dbg_kms(&i915->drm, "Port %s: PHY sudden disconnect\n",
|
||||
drm_dbg_kms(display->drm, "Port %s: PHY sudden disconnect\n",
|
||||
tc->port_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (max_lanes < required_lanes) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: PHY max lanes %d < required lanes %d\n",
|
||||
tc->port_name,
|
||||
max_lanes, required_lanes);
|
||||
@@ -655,7 +651,7 @@ static bool tc_phy_verify_legacy_or_dp_alt_mode(struct intel_tc_port *tc,
|
||||
static bool icl_tc_phy_connect(struct intel_tc_port *tc,
|
||||
int required_lanes)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
|
||||
tc->lock_wakeref = tc_cold_block(tc);
|
||||
|
||||
@@ -664,8 +660,8 @@ static bool icl_tc_phy_connect(struct intel_tc_port *tc,
|
||||
|
||||
if ((!tc_phy_is_ready(tc) ||
|
||||
!icl_tc_phy_take_ownership(tc, true)) &&
|
||||
!drm_WARN_ON(&i915->drm, tc->mode == TC_PORT_LEGACY)) {
|
||||
drm_dbg_kms(&i915->drm, "Port %s: can't take PHY ownership (ready %s)\n",
|
||||
!drm_WARN_ON(display->drm, tc->mode == TC_PORT_LEGACY)) {
|
||||
drm_dbg_kms(display->drm, "Port %s: can't take PHY ownership (ready %s)\n",
|
||||
tc->port_name,
|
||||
str_yes_no(tc_phy_is_ready(tc)));
|
||||
goto out_unblock_tc_cold;
|
||||
@@ -733,14 +729,13 @@ tgl_tc_phy_cold_off_domain(struct intel_tc_port *tc)
|
||||
static void tgl_tc_phy_init(struct intel_tc_port *tc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
intel_wakeref_t wakeref;
|
||||
u32 val;
|
||||
|
||||
with_intel_display_power(display, tc_phy_cold_off_domain(tc), wakeref)
|
||||
val = intel_de_read(i915, PORT_TX_DFLEXDPSP(FIA1));
|
||||
val = intel_de_read(display, PORT_TX_DFLEXDPSP(FIA1));
|
||||
|
||||
drm_WARN_ON(&i915->drm, val == 0xffffffff);
|
||||
drm_WARN_ON(display->drm, val == 0xffffffff);
|
||||
|
||||
tc_phy_load_fia_params(tc, val & MODULAR_FIA_MASK);
|
||||
}
|
||||
@@ -775,19 +770,18 @@ adlp_tc_phy_cold_off_domain(struct intel_tc_port *tc)
|
||||
static u32 adlp_tc_phy_hpd_live_status(struct intel_tc_port *tc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_digital_port *dig_port = tc->dig_port;
|
||||
enum hpd_pin hpd_pin = dig_port->base.hpd_pin;
|
||||
u32 cpu_isr_bits = i915->display.hotplug.hpd[hpd_pin];
|
||||
u32 pch_isr_bit = i915->display.hotplug.pch_hpd[hpd_pin];
|
||||
u32 cpu_isr_bits = display->hotplug.hpd[hpd_pin];
|
||||
u32 pch_isr_bit = display->hotplug.pch_hpd[hpd_pin];
|
||||
intel_wakeref_t wakeref;
|
||||
u32 cpu_isr;
|
||||
u32 pch_isr;
|
||||
u32 mask = 0;
|
||||
|
||||
with_intel_display_power(display, POWER_DOMAIN_DISPLAY_CORE, wakeref) {
|
||||
cpu_isr = intel_de_read(i915, GEN11_DE_HPD_ISR);
|
||||
pch_isr = intel_de_read(i915, SDEISR);
|
||||
cpu_isr = intel_de_read(display, GEN11_DE_HPD_ISR);
|
||||
pch_isr = intel_de_read(display, SDEISR);
|
||||
}
|
||||
|
||||
if (cpu_isr & (cpu_isr_bits & GEN11_DE_TC_HOTPLUG_MASK))
|
||||
@@ -810,15 +804,15 @@ static u32 adlp_tc_phy_hpd_live_status(struct intel_tc_port *tc)
|
||||
*/
|
||||
static bool adlp_tc_phy_is_ready(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
enum tc_port tc_port = intel_encoder_to_tc(&tc->dig_port->base);
|
||||
u32 val;
|
||||
|
||||
assert_display_core_power_enabled(tc);
|
||||
|
||||
val = intel_de_read(i915, TCSS_DDI_STATUS(tc_port));
|
||||
val = intel_de_read(display, TCSS_DDI_STATUS(tc_port));
|
||||
if (val == 0xffffffff) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: PHY in TCCOLD, assuming not ready\n",
|
||||
tc->port_name);
|
||||
return false;
|
||||
@@ -830,12 +824,12 @@ static bool adlp_tc_phy_is_ready(struct intel_tc_port *tc)
|
||||
static bool adlp_tc_phy_take_ownership(struct intel_tc_port *tc,
|
||||
bool take)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
enum port port = tc->dig_port->base.port;
|
||||
|
||||
assert_tc_port_power_enabled(tc);
|
||||
|
||||
intel_de_rmw(i915, DDI_BUF_CTL(port), DDI_BUF_CTL_TC_PHY_OWNERSHIP,
|
||||
intel_de_rmw(display, DDI_BUF_CTL(port), DDI_BUF_CTL_TC_PHY_OWNERSHIP,
|
||||
take ? DDI_BUF_CTL_TC_PHY_OWNERSHIP : 0);
|
||||
|
||||
return true;
|
||||
@@ -843,13 +837,13 @@ static bool adlp_tc_phy_take_ownership(struct intel_tc_port *tc,
|
||||
|
||||
static bool adlp_tc_phy_is_owned(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
enum port port = tc->dig_port->base.port;
|
||||
u32 val;
|
||||
|
||||
assert_tc_port_power_enabled(tc);
|
||||
|
||||
val = intel_de_read(i915, DDI_BUF_CTL(port));
|
||||
val = intel_de_read(display, DDI_BUF_CTL(port));
|
||||
return val & DDI_BUF_CTL_TC_PHY_OWNERSHIP;
|
||||
}
|
||||
|
||||
@@ -872,7 +866,6 @@ static void adlp_tc_phy_get_hw_state(struct intel_tc_port *tc)
|
||||
static bool adlp_tc_phy_connect(struct intel_tc_port *tc, int required_lanes)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
enum intel_display_power_domain port_power_domain =
|
||||
tc_port_power_domain(tc);
|
||||
intel_wakeref_t port_wakeref;
|
||||
@@ -885,15 +878,15 @@ static bool adlp_tc_phy_connect(struct intel_tc_port *tc, int required_lanes)
|
||||
port_wakeref = intel_display_power_get(display, port_power_domain);
|
||||
|
||||
if (!adlp_tc_phy_take_ownership(tc, true) &&
|
||||
!drm_WARN_ON(&i915->drm, tc->mode == TC_PORT_LEGACY)) {
|
||||
drm_dbg_kms(&i915->drm, "Port %s: can't take PHY ownership\n",
|
||||
!drm_WARN_ON(display->drm, tc->mode == TC_PORT_LEGACY)) {
|
||||
drm_dbg_kms(display->drm, "Port %s: can't take PHY ownership\n",
|
||||
tc->port_name);
|
||||
goto out_put_port_power;
|
||||
}
|
||||
|
||||
if (!tc_phy_is_ready(tc) &&
|
||||
!drm_WARN_ON(&i915->drm, tc->mode == TC_PORT_LEGACY)) {
|
||||
drm_dbg_kms(&i915->drm, "Port %s: PHY not ready\n",
|
||||
!drm_WARN_ON(display->drm, tc->mode == TC_PORT_LEGACY)) {
|
||||
drm_dbg_kms(display->drm, "Port %s: PHY not ready\n",
|
||||
tc->port_name);
|
||||
goto out_release_phy;
|
||||
}
|
||||
@@ -965,19 +958,18 @@ static const struct intel_tc_phy_ops adlp_tc_phy_ops = {
|
||||
static u32 xelpdp_tc_phy_hpd_live_status(struct intel_tc_port *tc)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_digital_port *dig_port = tc->dig_port;
|
||||
enum hpd_pin hpd_pin = dig_port->base.hpd_pin;
|
||||
u32 pica_isr_bits = i915->display.hotplug.hpd[hpd_pin];
|
||||
u32 pch_isr_bit = i915->display.hotplug.pch_hpd[hpd_pin];
|
||||
u32 pica_isr_bits = display->hotplug.hpd[hpd_pin];
|
||||
u32 pch_isr_bit = display->hotplug.pch_hpd[hpd_pin];
|
||||
intel_wakeref_t wakeref;
|
||||
u32 pica_isr;
|
||||
u32 pch_isr;
|
||||
u32 mask = 0;
|
||||
|
||||
with_intel_display_power(display, POWER_DOMAIN_DISPLAY_CORE, wakeref) {
|
||||
pica_isr = intel_de_read(i915, PICAINTERRUPT_ISR);
|
||||
pch_isr = intel_de_read(i915, SDEISR);
|
||||
pica_isr = intel_de_read(display, PICAINTERRUPT_ISR);
|
||||
pch_isr = intel_de_read(display, SDEISR);
|
||||
}
|
||||
|
||||
if (pica_isr & (pica_isr_bits & XELPDP_DP_ALT_HOTPLUG_MASK))
|
||||
@@ -994,22 +986,22 @@ static u32 xelpdp_tc_phy_hpd_live_status(struct intel_tc_port *tc)
|
||||
static bool
|
||||
xelpdp_tc_phy_tcss_power_is_enabled(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
enum port port = tc->dig_port->base.port;
|
||||
i915_reg_t reg = XELPDP_PORT_BUF_CTL1(i915, port);
|
||||
i915_reg_t reg = XELPDP_PORT_BUF_CTL1(display, port);
|
||||
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
return intel_de_read(i915, reg) & XELPDP_TCSS_POWER_STATE;
|
||||
return intel_de_read(display, reg) & XELPDP_TCSS_POWER_STATE;
|
||||
}
|
||||
|
||||
static bool
|
||||
xelpdp_tc_phy_wait_for_tcss_power(struct intel_tc_port *tc, bool enabled)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
|
||||
if (wait_for(xelpdp_tc_phy_tcss_power_is_enabled(tc) == enabled, 5)) {
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: timeout waiting for TCSS power to get %s\n",
|
||||
str_enabled_disabled(enabled),
|
||||
tc->port_name);
|
||||
@@ -1069,7 +1061,7 @@ static void __xelpdp_tc_phy_enable_tcss_power(struct intel_tc_port *tc, bool ena
|
||||
|
||||
static bool xelpdp_tc_phy_enable_tcss_power(struct intel_tc_port *tc, bool enable)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
|
||||
__xelpdp_tc_phy_enable_tcss_power(tc, enable);
|
||||
|
||||
@@ -1082,7 +1074,7 @@ static bool xelpdp_tc_phy_enable_tcss_power(struct intel_tc_port *tc, bool enabl
|
||||
return true;
|
||||
|
||||
out_disable:
|
||||
if (drm_WARN_ON(&i915->drm, tc->mode == TC_PORT_LEGACY))
|
||||
if (drm_WARN_ON(display->drm, tc->mode == TC_PORT_LEGACY))
|
||||
return false;
|
||||
|
||||
if (!enable)
|
||||
@@ -1096,35 +1088,35 @@ out_disable:
|
||||
|
||||
static void xelpdp_tc_phy_take_ownership(struct intel_tc_port *tc, bool take)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
enum port port = tc->dig_port->base.port;
|
||||
i915_reg_t reg = XELPDP_PORT_BUF_CTL1(i915, port);
|
||||
i915_reg_t reg = XELPDP_PORT_BUF_CTL1(display, port);
|
||||
u32 val;
|
||||
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
val = intel_de_read(i915, reg);
|
||||
val = intel_de_read(display, reg);
|
||||
if (take)
|
||||
val |= XELPDP_TC_PHY_OWNERSHIP;
|
||||
else
|
||||
val &= ~XELPDP_TC_PHY_OWNERSHIP;
|
||||
intel_de_write(i915, reg, val);
|
||||
intel_de_write(display, reg, val);
|
||||
}
|
||||
|
||||
static bool xelpdp_tc_phy_is_owned(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
enum port port = tc->dig_port->base.port;
|
||||
i915_reg_t reg = XELPDP_PORT_BUF_CTL1(i915, port);
|
||||
i915_reg_t reg = XELPDP_PORT_BUF_CTL1(display, port);
|
||||
|
||||
assert_tc_cold_blocked(tc);
|
||||
|
||||
return intel_de_read(i915, reg) & XELPDP_TC_PHY_OWNERSHIP;
|
||||
return intel_de_read(display, reg) & XELPDP_TC_PHY_OWNERSHIP;
|
||||
}
|
||||
|
||||
static void xelpdp_tc_phy_get_hw_state(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
intel_wakeref_t tc_cold_wref;
|
||||
enum intel_display_power_domain domain;
|
||||
|
||||
@@ -1134,7 +1126,7 @@ static void xelpdp_tc_phy_get_hw_state(struct intel_tc_port *tc)
|
||||
if (tc->mode != TC_PORT_DISCONNECTED)
|
||||
tc->lock_wakeref = tc_cold_block(tc);
|
||||
|
||||
drm_WARN_ON(&i915->drm,
|
||||
drm_WARN_ON(display->drm,
|
||||
(tc->mode == TC_PORT_DP_ALT || tc->mode == TC_PORT_LEGACY) &&
|
||||
!xelpdp_tc_phy_tcss_power_is_enabled(tc));
|
||||
|
||||
@@ -1207,13 +1199,13 @@ tc_phy_cold_off_domain(struct intel_tc_port *tc)
|
||||
|
||||
static u32 tc_phy_hpd_live_status(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
u32 mask;
|
||||
|
||||
mask = tc->phy_ops->hpd_live_status(tc);
|
||||
|
||||
/* The sink can be connected only in a single mode. */
|
||||
drm_WARN_ON_ONCE(&i915->drm, hweight32(mask) > 1);
|
||||
drm_WARN_ON_ONCE(display->drm, hweight32(mask) > 1);
|
||||
|
||||
return mask;
|
||||
}
|
||||
@@ -1236,9 +1228,9 @@ static void tc_phy_get_hw_state(struct intel_tc_port *tc)
|
||||
static bool tc_phy_is_ready_and_owned(struct intel_tc_port *tc,
|
||||
bool phy_is_ready, bool phy_is_owned)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
|
||||
drm_WARN_ON(&i915->drm, phy_is_owned && !phy_is_ready);
|
||||
drm_WARN_ON(display->drm, phy_is_owned && !phy_is_ready);
|
||||
|
||||
return phy_is_ready && phy_is_owned;
|
||||
}
|
||||
@@ -1246,8 +1238,7 @@ static bool tc_phy_is_ready_and_owned(struct intel_tc_port *tc,
|
||||
static bool tc_phy_is_connected(struct intel_tc_port *tc,
|
||||
enum icl_port_dpll_id port_pll_type)
|
||||
{
|
||||
struct intel_encoder *encoder = &tc->dig_port->base;
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
bool phy_is_ready = tc_phy_is_ready(tc);
|
||||
bool phy_is_owned = tc_phy_is_owned(tc);
|
||||
bool is_connected;
|
||||
@@ -1257,7 +1248,7 @@ static bool tc_phy_is_connected(struct intel_tc_port *tc,
|
||||
else
|
||||
is_connected = port_pll_type == ICL_PORT_DPLL_DEFAULT;
|
||||
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: PHY connected: %s (ready: %s, owned: %s, pll_type: %s)\n",
|
||||
tc->port_name,
|
||||
str_yes_no(is_connected),
|
||||
@@ -1270,10 +1261,10 @@ static bool tc_phy_is_connected(struct intel_tc_port *tc,
|
||||
|
||||
static bool tc_phy_wait_for_ready(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
|
||||
if (wait_for(tc_phy_is_ready(tc), 500)) {
|
||||
drm_err(&i915->drm, "Port %s: timeout waiting for PHY ready\n",
|
||||
drm_err(display->drm, "Port %s: timeout waiting for PHY ready\n",
|
||||
tc->port_name);
|
||||
|
||||
return false;
|
||||
@@ -1343,7 +1334,7 @@ get_tc_mode_in_phy_not_owned_state(struct intel_tc_port *tc,
|
||||
static enum tc_port_mode
|
||||
tc_phy_get_current_mode(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
enum tc_port_mode live_mode = tc_phy_hpd_live_mode(tc);
|
||||
bool phy_is_ready;
|
||||
bool phy_is_owned;
|
||||
@@ -1363,11 +1354,11 @@ tc_phy_get_current_mode(struct intel_tc_port *tc)
|
||||
if (!tc_phy_is_ready_and_owned(tc, phy_is_ready, phy_is_owned)) {
|
||||
mode = get_tc_mode_in_phy_not_owned_state(tc, live_mode);
|
||||
} else {
|
||||
drm_WARN_ON(&i915->drm, live_mode == TC_PORT_TBT_ALT);
|
||||
drm_WARN_ON(display->drm, live_mode == TC_PORT_TBT_ALT);
|
||||
mode = get_tc_mode_in_phy_owned_state(tc, live_mode);
|
||||
}
|
||||
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: PHY mode: %s (ready: %s, owned: %s, HPD: %s)\n",
|
||||
tc->port_name,
|
||||
tc_port_mode_name(mode),
|
||||
@@ -1407,7 +1398,7 @@ tc_phy_get_target_mode(struct intel_tc_port *tc)
|
||||
|
||||
static void tc_phy_connect(struct intel_tc_port *tc, int required_lanes)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
u32 live_status_mask = tc_phy_hpd_live_status(tc);
|
||||
bool connected;
|
||||
|
||||
@@ -1421,7 +1412,7 @@ static void tc_phy_connect(struct intel_tc_port *tc, int required_lanes)
|
||||
connected = tc->phy_ops->connect(tc, required_lanes);
|
||||
}
|
||||
|
||||
drm_WARN_ON(&i915->drm, !connected);
|
||||
drm_WARN_ON(display->drm, !connected);
|
||||
}
|
||||
|
||||
static void tc_phy_disconnect(struct intel_tc_port *tc)
|
||||
@@ -1491,12 +1482,12 @@ static void __intel_tc_port_put_link(struct intel_tc_port *tc)
|
||||
|
||||
static bool tc_port_is_enabled(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct intel_digital_port *dig_port = tc->dig_port;
|
||||
|
||||
assert_tc_port_power_enabled(tc);
|
||||
|
||||
return intel_de_read(i915, DDI_BUF_CTL(dig_port->base.port)) &
|
||||
return intel_de_read(display, DDI_BUF_CTL(dig_port->base.port)) &
|
||||
DDI_BUF_CTL_ENABLE;
|
||||
}
|
||||
|
||||
@@ -1509,15 +1500,15 @@ static bool tc_port_is_enabled(struct intel_tc_port *tc)
|
||||
*/
|
||||
void intel_tc_port_init_mode(struct intel_digital_port *dig_port)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(dig_port);
|
||||
struct intel_tc_port *tc = to_tc_port(dig_port);
|
||||
bool update_mode = false;
|
||||
|
||||
mutex_lock(&tc->lock);
|
||||
|
||||
drm_WARN_ON(&i915->drm, tc->mode != TC_PORT_DISCONNECTED);
|
||||
drm_WARN_ON(&i915->drm, tc->lock_wakeref);
|
||||
drm_WARN_ON(&i915->drm, tc->link_refcount);
|
||||
drm_WARN_ON(display->drm, tc->mode != TC_PORT_DISCONNECTED);
|
||||
drm_WARN_ON(display->drm, tc->lock_wakeref);
|
||||
drm_WARN_ON(display->drm, tc->link_refcount);
|
||||
|
||||
tc_phy_get_hw_state(tc);
|
||||
/*
|
||||
@@ -1540,8 +1531,8 @@ void intel_tc_port_init_mode(struct intel_digital_port *dig_port)
|
||||
if (!tc_port_is_enabled(tc)) {
|
||||
update_mode = true;
|
||||
} else if (tc->mode == TC_PORT_DISCONNECTED) {
|
||||
drm_WARN_ON(&i915->drm, !tc->legacy_port);
|
||||
drm_err(&i915->drm,
|
||||
drm_WARN_ON(display->drm, !tc->legacy_port);
|
||||
drm_err(display->drm,
|
||||
"Port %s: PHY disconnected on enabled port, connecting it\n",
|
||||
tc->port_name);
|
||||
update_mode = true;
|
||||
@@ -1556,28 +1547,28 @@ void intel_tc_port_init_mode(struct intel_digital_port *dig_port)
|
||||
mutex_unlock(&tc->lock);
|
||||
}
|
||||
|
||||
static bool tc_port_has_active_links(struct intel_tc_port *tc,
|
||||
const struct intel_crtc_state *crtc_state)
|
||||
static bool tc_port_has_active_streams(struct intel_tc_port *tc,
|
||||
const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct intel_digital_port *dig_port = tc->dig_port;
|
||||
enum icl_port_dpll_id pll_type = ICL_PORT_DPLL_DEFAULT;
|
||||
int active_links = 0;
|
||||
int active_streams = 0;
|
||||
|
||||
if (dig_port->dp.is_mst) {
|
||||
/* TODO: get the PLL type for MST, once HW readout is done for it. */
|
||||
active_links = intel_dp_mst_encoder_active_links(dig_port);
|
||||
active_streams = intel_dp_mst_active_streams(&dig_port->dp);
|
||||
} else if (crtc_state && crtc_state->hw.active) {
|
||||
pll_type = intel_ddi_port_pll_type(&dig_port->base, crtc_state);
|
||||
active_links = 1;
|
||||
active_streams = 1;
|
||||
}
|
||||
|
||||
if (active_links && !tc_phy_is_connected(tc, pll_type))
|
||||
drm_err(&i915->drm,
|
||||
"Port %s: PHY disconnected with %d active link(s)\n",
|
||||
tc->port_name, active_links);
|
||||
if (active_streams && !tc_phy_is_connected(tc, pll_type))
|
||||
drm_err(display->drm,
|
||||
"Port %s: PHY disconnected with %d active stream(s)\n",
|
||||
tc->port_name, active_streams);
|
||||
|
||||
return active_links;
|
||||
return active_streams;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1595,13 +1586,13 @@ static bool tc_port_has_active_links(struct intel_tc_port *tc,
|
||||
void intel_tc_port_sanitize_mode(struct intel_digital_port *dig_port,
|
||||
const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(dig_port);
|
||||
struct intel_tc_port *tc = to_tc_port(dig_port);
|
||||
|
||||
mutex_lock(&tc->lock);
|
||||
|
||||
drm_WARN_ON(&i915->drm, tc->link_refcount != 1);
|
||||
if (!tc_port_has_active_links(tc, crtc_state)) {
|
||||
drm_WARN_ON(display->drm, tc->link_refcount != 1);
|
||||
if (!tc_port_has_active_streams(tc, crtc_state)) {
|
||||
/*
|
||||
* TBT-alt is the default mode in any case the PHY ownership is not
|
||||
* held (regardless of the sink's connected live state), so
|
||||
@@ -1610,7 +1601,7 @@ void intel_tc_port_sanitize_mode(struct intel_digital_port *dig_port,
|
||||
*/
|
||||
if (tc->init_mode != TC_PORT_TBT_ALT &&
|
||||
tc->init_mode != TC_PORT_DISCONNECTED)
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: PHY left in %s mode on disabled port, disconnecting it\n",
|
||||
tc->port_name,
|
||||
tc_port_mode_name(tc->init_mode));
|
||||
@@ -1618,7 +1609,7 @@ void intel_tc_port_sanitize_mode(struct intel_digital_port *dig_port,
|
||||
__intel_tc_port_put_link(tc);
|
||||
}
|
||||
|
||||
drm_dbg_kms(&i915->drm, "Port %s: sanitize mode (%s)\n",
|
||||
drm_dbg_kms(display->drm, "Port %s: sanitize mode (%s)\n",
|
||||
tc->port_name,
|
||||
tc_port_mode_name(tc->mode));
|
||||
|
||||
@@ -1637,12 +1628,12 @@ void intel_tc_port_sanitize_mode(struct intel_digital_port *dig_port,
|
||||
*/
|
||||
bool intel_tc_port_connected(struct intel_encoder *encoder)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
struct intel_tc_port *tc = to_tc_port(dig_port);
|
||||
u32 mask = ~0;
|
||||
|
||||
drm_WARN_ON(&i915->drm, !intel_tc_port_ref_held(dig_port));
|
||||
drm_WARN_ON(display->drm, !intel_tc_port_ref_held(dig_port));
|
||||
|
||||
if (tc->mode != TC_PORT_DISCONNECTED)
|
||||
mask = BIT(tc->mode);
|
||||
@@ -1677,14 +1668,14 @@ static int reset_link_commit(struct intel_tc_port *tc,
|
||||
struct intel_atomic_state *state,
|
||||
struct drm_modeset_acquire_ctx *ctx)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct intel_digital_port *dig_port = tc->dig_port;
|
||||
struct intel_dp *intel_dp = enc_to_intel_dp(&dig_port->base);
|
||||
struct intel_crtc *crtc;
|
||||
u8 pipe_mask;
|
||||
int ret;
|
||||
|
||||
ret = drm_modeset_lock(&i915->drm.mode_config.connection_mutex, ctx);
|
||||
ret = drm_modeset_lock(&display->drm->mode_config.connection_mutex, ctx);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1695,7 +1686,7 @@ static int reset_link_commit(struct intel_tc_port *tc,
|
||||
if (!pipe_mask)
|
||||
return 0;
|
||||
|
||||
for_each_intel_crtc_in_pipe_mask(&i915->drm, crtc, pipe_mask) {
|
||||
for_each_intel_crtc_in_pipe_mask(display->drm, crtc, pipe_mask) {
|
||||
struct intel_crtc_state *crtc_state;
|
||||
|
||||
crtc_state = intel_atomic_get_crtc_state(&state->base, crtc);
|
||||
@@ -1713,13 +1704,13 @@ static int reset_link_commit(struct intel_tc_port *tc,
|
||||
|
||||
static int reset_link(struct intel_tc_port *tc)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
struct drm_modeset_acquire_ctx ctx;
|
||||
struct drm_atomic_state *_state;
|
||||
struct intel_atomic_state *state;
|
||||
int ret;
|
||||
|
||||
_state = drm_atomic_state_alloc(&i915->drm);
|
||||
_state = drm_atomic_state_alloc(display->drm);
|
||||
if (!_state)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1738,21 +1729,21 @@ static void intel_tc_port_link_reset_work(struct work_struct *work)
|
||||
{
|
||||
struct intel_tc_port *tc =
|
||||
container_of(work, struct intel_tc_port, link_reset_work.work);
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
int ret;
|
||||
|
||||
if (!__intel_tc_port_link_needs_reset(tc))
|
||||
return;
|
||||
|
||||
mutex_lock(&i915->drm.mode_config.mutex);
|
||||
mutex_lock(&display->drm->mode_config.mutex);
|
||||
|
||||
drm_dbg_kms(&i915->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"Port %s: TypeC DP-alt sink disconnected, resetting link\n",
|
||||
tc->port_name);
|
||||
ret = reset_link(tc);
|
||||
drm_WARN_ON(&i915->drm, ret);
|
||||
drm_WARN_ON(display->drm, ret);
|
||||
|
||||
mutex_unlock(&i915->drm.mode_config.mutex);
|
||||
mutex_unlock(&display->drm->mode_config.mutex);
|
||||
}
|
||||
|
||||
bool intel_tc_port_link_reset(struct intel_digital_port *dig_port)
|
||||
@@ -1780,7 +1771,7 @@ void intel_tc_port_link_cancel_reset_work(struct intel_digital_port *dig_port)
|
||||
static void __intel_tc_port_lock(struct intel_tc_port *tc,
|
||||
int required_lanes)
|
||||
{
|
||||
struct drm_i915_private *i915 = tc_to_i915(tc);
|
||||
struct intel_display *display = to_intel_display(tc->dig_port);
|
||||
|
||||
mutex_lock(&tc->lock);
|
||||
|
||||
@@ -1790,9 +1781,8 @@ static void __intel_tc_port_lock(struct intel_tc_port *tc,
|
||||
intel_tc_port_update_mode(tc, required_lanes,
|
||||
false);
|
||||
|
||||
drm_WARN_ON(&i915->drm, tc->mode == TC_PORT_DISCONNECTED);
|
||||
drm_WARN_ON(&i915->drm, tc->mode != TC_PORT_TBT_ALT &&
|
||||
!tc_phy_is_owned(tc));
|
||||
drm_WARN_ON(display->drm, tc->mode == TC_PORT_DISCONNECTED);
|
||||
drm_WARN_ON(display->drm, tc->mode != TC_PORT_TBT_ALT && !tc_phy_is_owned(tc));
|
||||
}
|
||||
|
||||
void intel_tc_port_lock(struct intel_digital_port *dig_port)
|
||||
@@ -1885,12 +1875,12 @@ void intel_tc_port_put_link(struct intel_digital_port *dig_port)
|
||||
|
||||
int intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
|
||||
struct intel_display *display = to_intel_display(dig_port);
|
||||
struct intel_tc_port *tc;
|
||||
enum port port = dig_port->base.port;
|
||||
enum tc_port tc_port = intel_encoder_to_tc(&dig_port->base);
|
||||
|
||||
if (drm_WARN_ON(&i915->drm, tc_port == TC_PORT_NONE))
|
||||
if (drm_WARN_ON(display->drm, tc_port == TC_PORT_NONE))
|
||||
return -EINVAL;
|
||||
|
||||
tc = kzalloc(sizeof(*tc), GFP_KERNEL);
|
||||
@@ -1900,11 +1890,11 @@ int intel_tc_port_init(struct intel_digital_port *dig_port, bool is_legacy)
|
||||
dig_port->tc = tc;
|
||||
tc->dig_port = dig_port;
|
||||
|
||||
if (DISPLAY_VER(i915) >= 14)
|
||||
if (DISPLAY_VER(display) >= 14)
|
||||
tc->phy_ops = &xelpdp_tc_phy_ops;
|
||||
else if (DISPLAY_VER(i915) >= 13)
|
||||
else if (DISPLAY_VER(display) >= 13)
|
||||
tc->phy_ops = &adlp_tc_phy_ops;
|
||||
else if (DISPLAY_VER(i915) >= 12)
|
||||
else if (DISPLAY_VER(display) >= 12)
|
||||
tc->phy_ops = &tgl_tc_phy_ops;
|
||||
else
|
||||
tc->phy_ops = &icl_tc_phy_ops;
|
||||
|
||||
@@ -1594,7 +1594,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
|
||||
/* Disable TV interrupts around load detect or we'll recurse */
|
||||
if (connector->polled & DRM_CONNECTOR_POLL_HPD) {
|
||||
spin_lock_irq(&dev_priv->irq_lock);
|
||||
i915_disable_pipestat(dev_priv, 0,
|
||||
i915_disable_pipestat(display, 0,
|
||||
PIPE_HOTPLUG_INTERRUPT_STATUS |
|
||||
PIPE_HOTPLUG_TV_INTERRUPT_STATUS);
|
||||
spin_unlock_irq(&dev_priv->irq_lock);
|
||||
@@ -1669,7 +1669,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
|
||||
/* Restore interrupt config */
|
||||
if (connector->polled & DRM_CONNECTOR_POLL_HPD) {
|
||||
spin_lock_irq(&dev_priv->irq_lock);
|
||||
i915_enable_pipestat(dev_priv, 0,
|
||||
i915_enable_pipestat(display, 0,
|
||||
PIPE_HOTPLUG_INTERRUPT_STATUS |
|
||||
PIPE_HOTPLUG_TV_INTERRUPT_STATUS);
|
||||
spin_unlock_irq(&dev_priv->irq_lock);
|
||||
|
||||
@@ -224,12 +224,13 @@ int intel_crtc_scanline_offset(const struct intel_crtc_state *crtc_state)
|
||||
*/
|
||||
if (DISPLAY_VER(display) >= 20 || display->platform.battlemage)
|
||||
return 1;
|
||||
else if (DISPLAY_VER(display) == 2)
|
||||
return -1;
|
||||
else if (HAS_DDI(display) && intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
|
||||
return 2;
|
||||
else
|
||||
else if (DISPLAY_VER(display) >= 9 ||
|
||||
display->platform.broadwell || display->platform.haswell)
|
||||
return intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) ? 2 : 1;
|
||||
else if (DISPLAY_VER(display) >= 3)
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <drm/display/drm_dsc_helper.h>
|
||||
#include <drm/drm_fixed.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_utils.h"
|
||||
#include "intel_crtc.h"
|
||||
@@ -259,6 +260,15 @@ static int intel_dsc_slice_dimensions_valid(struct intel_crtc_state *pipe_config
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool is_dsi_dsc_1_1(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
|
||||
|
||||
return vdsc_cfg->dsc_version_major == 1 &&
|
||||
vdsc_cfg->dsc_version_minor == 1 &&
|
||||
intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI);
|
||||
}
|
||||
|
||||
int intel_dsc_compute_params(struct intel_crtc_state *pipe_config)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(pipe_config);
|
||||
@@ -317,8 +327,19 @@ int intel_dsc_compute_params(struct intel_crtc_state *pipe_config)
|
||||
* From XE_LPD onwards we supports compression bpps in steps of 1
|
||||
* upto uncompressed bpp-1, hence add calculations for all the rc
|
||||
* parameters
|
||||
*
|
||||
* We don't want to calculate all rc parameters when the panel
|
||||
* is MIPI DSI and it's using DSC 1.1. The reason being that some
|
||||
* DSI panels vendors have hardcoded PPS params in the VBT causing
|
||||
* the parameters sent from the source which are derived through
|
||||
* interpolation to differ from the params the panel expects.
|
||||
* This causes a noise in the display.
|
||||
* Furthermore for DSI panels we are currently using bits_per_pixel
|
||||
* (compressed bpp) hardcoded from VBT, (unlike other encoders where we
|
||||
* find the optimum compressed bpp) so dont need to rely on interpolation,
|
||||
* as we can get the required rc parameters from the tables.
|
||||
*/
|
||||
if (DISPLAY_VER(display) >= 13) {
|
||||
if (DISPLAY_VER(display) >= 13 && !is_dsi_dsc_1_1(pipe_config)) {
|
||||
calculate_rc_params(vdsc_cfg);
|
||||
} else {
|
||||
if ((compressed_bpp == 8 ||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_reg.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_types.h"
|
||||
@@ -32,6 +34,8 @@ bool intel_vrr_is_capable(struct intel_connector *connector)
|
||||
return false;
|
||||
fallthrough;
|
||||
case DRM_MODE_CONNECTOR_DisplayPort:
|
||||
if (connector->mst.dp)
|
||||
return false;
|
||||
intel_dp = intel_attached_dp(connector);
|
||||
|
||||
if (!drm_dp_sink_can_do_video_without_timing_msa(intel_dp->dpcd))
|
||||
@@ -182,7 +186,8 @@ is_cmrr_frac_required(struct intel_crtc_state *crtc_state)
|
||||
int calculated_refresh_k, actual_refresh_k, pixel_clock_per_line;
|
||||
struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
|
||||
|
||||
if (!HAS_CMRR(display))
|
||||
/* Avoid CMRR for now till we have VRR with fixed timings working */
|
||||
if (!HAS_CMRR(display) || true)
|
||||
return false;
|
||||
|
||||
actual_refresh_k =
|
||||
@@ -222,6 +227,121 @@ cmrr_get_vtotal(struct intel_crtc_state *crtc_state, bool video_mode_required)
|
||||
return vtotal;
|
||||
}
|
||||
|
||||
static
|
||||
void intel_vrr_compute_cmrr_timings(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
crtc_state->cmrr.enable = true;
|
||||
/*
|
||||
* TODO: Compute precise target refresh rate to determine
|
||||
* if video_mode_required should be true. Currently set to
|
||||
* false due to uncertainty about the precise target
|
||||
* refresh Rate.
|
||||
*/
|
||||
crtc_state->vrr.vmax = cmrr_get_vtotal(crtc_state, false);
|
||||
crtc_state->vrr.vmin = crtc_state->vrr.vmax;
|
||||
crtc_state->vrr.flipline = crtc_state->vrr.vmin;
|
||||
crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
|
||||
}
|
||||
|
||||
static
|
||||
void intel_vrr_compute_vrr_timings(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
crtc_state->vrr.enable = true;
|
||||
crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
|
||||
}
|
||||
|
||||
/*
|
||||
* For fixed refresh rate mode Vmin, Vmax and Flipline all are set to
|
||||
* Vtotal value.
|
||||
*/
|
||||
static
|
||||
int intel_vrr_fixed_rr_vtotal(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
int crtc_vtotal = crtc_state->hw.adjusted_mode.crtc_vtotal;
|
||||
|
||||
if (DISPLAY_VER(display) >= 13)
|
||||
return crtc_vtotal;
|
||||
else
|
||||
return crtc_vtotal -
|
||||
intel_vrr_real_vblank_delay(crtc_state);
|
||||
}
|
||||
|
||||
static
|
||||
int intel_vrr_fixed_rr_vmax(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
return intel_vrr_fixed_rr_vtotal(crtc_state);
|
||||
}
|
||||
|
||||
static
|
||||
int intel_vrr_fixed_rr_vmin(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
|
||||
return intel_vrr_fixed_rr_vtotal(crtc_state) -
|
||||
intel_vrr_flipline_offset(display);
|
||||
}
|
||||
|
||||
static
|
||||
int intel_vrr_fixed_rr_flipline(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
return intel_vrr_fixed_rr_vtotal(crtc_state);
|
||||
}
|
||||
|
||||
void intel_vrr_set_fixed_rr_timings(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
|
||||
|
||||
if (!intel_vrr_possible(crtc_state))
|
||||
return;
|
||||
|
||||
intel_de_write(display, TRANS_VRR_VMIN(display, cpu_transcoder),
|
||||
intel_vrr_fixed_rr_vmin(crtc_state) - 1);
|
||||
intel_de_write(display, TRANS_VRR_VMAX(display, cpu_transcoder),
|
||||
intel_vrr_fixed_rr_vmax(crtc_state) - 1);
|
||||
intel_de_write(display, TRANS_VRR_FLIPLINE(display, cpu_transcoder),
|
||||
intel_vrr_fixed_rr_flipline(crtc_state) - 1);
|
||||
}
|
||||
|
||||
static
|
||||
void intel_vrr_compute_fixed_rr_timings(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
/*
|
||||
* For fixed rr, vmin = vmax = flipline.
|
||||
* vmin is already set to crtc_vtotal set vmax and flipline the same.
|
||||
*/
|
||||
crtc_state->vrr.vmax = crtc_state->hw.adjusted_mode.crtc_vtotal;
|
||||
crtc_state->vrr.flipline = crtc_state->hw.adjusted_mode.crtc_vtotal;
|
||||
}
|
||||
|
||||
static
|
||||
int intel_vrr_compute_vmin(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
/*
|
||||
* To make fixed rr and vrr work seamless the guardband/pipeline full
|
||||
* should be set such that it satisfies both the fixed and variable
|
||||
* timings.
|
||||
* For this set the vmin as crtc_vtotal. With this we never need to
|
||||
* change anything to do with the guardband.
|
||||
*/
|
||||
return crtc_state->hw.adjusted_mode.crtc_vtotal;
|
||||
}
|
||||
|
||||
static
|
||||
int intel_vrr_compute_vmax(struct intel_connector *connector,
|
||||
const struct drm_display_mode *adjusted_mode)
|
||||
{
|
||||
const struct drm_display_info *info = &connector->base.display_info;
|
||||
int vmax;
|
||||
|
||||
vmax = adjusted_mode->crtc_clock * 1000 /
|
||||
(adjusted_mode->crtc_htotal * info->monitor_range.min_vfreq);
|
||||
vmax = max_t(int, vmax, adjusted_mode->crtc_vtotal);
|
||||
|
||||
return vmax;
|
||||
}
|
||||
|
||||
void
|
||||
intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
|
||||
struct drm_connector_state *conn_state)
|
||||
@@ -232,14 +352,9 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
|
||||
struct intel_dp *intel_dp = intel_attached_dp(connector);
|
||||
bool is_edp = intel_dp_is_edp(intel_dp);
|
||||
struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
|
||||
const struct drm_display_info *info = &connector->base.display_info;
|
||||
int vmin, vmax;
|
||||
|
||||
/*
|
||||
* FIXME all joined pipes share the same transcoder.
|
||||
* Need to account for that during VRR toggle/push/etc.
|
||||
*/
|
||||
if (crtc_state->joiner_pipes)
|
||||
if (!HAS_VRR(display))
|
||||
return;
|
||||
|
||||
if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE)
|
||||
@@ -247,28 +362,40 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
|
||||
|
||||
crtc_state->vrr.in_range =
|
||||
intel_vrr_is_in_range(connector, drm_mode_vrefresh(adjusted_mode));
|
||||
if (!crtc_state->vrr.in_range)
|
||||
return;
|
||||
|
||||
if (HAS_LRR(display))
|
||||
crtc_state->update_lrr = true;
|
||||
/*
|
||||
* Allow fixed refresh rate with VRR Timing Generator.
|
||||
* For now set the vrr.in_range to 0, to allow fixed_rr but skip actual
|
||||
* VRR and LRR.
|
||||
* #TODO For actual VRR with joiner, we need to figure out how to
|
||||
* correctly sequence transcoder level stuff vs. pipe level stuff
|
||||
* in the commit.
|
||||
*/
|
||||
if (crtc_state->joiner_pipes)
|
||||
crtc_state->vrr.in_range = false;
|
||||
|
||||
vmin = DIV_ROUND_UP(adjusted_mode->crtc_clock * 1000,
|
||||
adjusted_mode->crtc_htotal * info->monitor_range.max_vfreq);
|
||||
vmax = adjusted_mode->crtc_clock * 1000 /
|
||||
(adjusted_mode->crtc_htotal * info->monitor_range.min_vfreq);
|
||||
vmin = intel_vrr_compute_vmin(crtc_state);
|
||||
|
||||
vmin = max_t(int, vmin, adjusted_mode->crtc_vtotal);
|
||||
vmax = max_t(int, vmax, adjusted_mode->crtc_vtotal);
|
||||
|
||||
if (vmin >= vmax)
|
||||
return;
|
||||
if (crtc_state->vrr.in_range) {
|
||||
if (HAS_LRR(display))
|
||||
crtc_state->update_lrr = true;
|
||||
vmax = intel_vrr_compute_vmax(connector, adjusted_mode);
|
||||
} else {
|
||||
vmax = vmin;
|
||||
}
|
||||
|
||||
crtc_state->vrr.vmin = vmin;
|
||||
crtc_state->vrr.vmax = vmax;
|
||||
|
||||
crtc_state->vrr.flipline = crtc_state->vrr.vmin;
|
||||
|
||||
if (crtc_state->uapi.vrr_enabled && vmin < vmax)
|
||||
intel_vrr_compute_vrr_timings(crtc_state);
|
||||
else if (is_cmrr_frac_required(crtc_state) && is_edp)
|
||||
intel_vrr_compute_cmrr_timings(crtc_state);
|
||||
else
|
||||
intel_vrr_compute_fixed_rr_timings(crtc_state);
|
||||
|
||||
/*
|
||||
* flipline determines the min vblank length the hardware will
|
||||
* generate, and on ICL/TGL flipline>=vmin+1, hence we reduce
|
||||
@@ -276,29 +403,6 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,
|
||||
*/
|
||||
crtc_state->vrr.vmin -= intel_vrr_flipline_offset(display);
|
||||
|
||||
/*
|
||||
* When panel is VRR capable and userspace has
|
||||
* not enabled adaptive sync mode then Fixed Average
|
||||
* Vtotal mode should be enabled.
|
||||
*/
|
||||
if (crtc_state->uapi.vrr_enabled) {
|
||||
crtc_state->vrr.enable = true;
|
||||
crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
|
||||
} else if (is_cmrr_frac_required(crtc_state) && is_edp) {
|
||||
crtc_state->vrr.enable = true;
|
||||
crtc_state->cmrr.enable = true;
|
||||
/*
|
||||
* TODO: Compute precise target refresh rate to determine
|
||||
* if video_mode_required should be true. Currently set to
|
||||
* false due to uncertainty about the precise target
|
||||
* refresh Rate.
|
||||
*/
|
||||
crtc_state->vrr.vmax = cmrr_get_vtotal(crtc_state, false);
|
||||
crtc_state->vrr.vmin = crtc_state->vrr.vmax;
|
||||
crtc_state->vrr.flipline = crtc_state->vrr.vmin;
|
||||
crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
|
||||
}
|
||||
|
||||
if (HAS_AS_SDP(display)) {
|
||||
crtc_state->vrr.vsync_start =
|
||||
(crtc_state->hw.adjusted_mode.crtc_vtotal -
|
||||
@@ -380,14 +484,11 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state)
|
||||
lower_32_bits(crtc_state->cmrr.cmrr_n));
|
||||
}
|
||||
|
||||
intel_de_write(display, TRANS_VRR_VMIN(display, cpu_transcoder),
|
||||
crtc_state->vrr.vmin - 1);
|
||||
intel_de_write(display, TRANS_VRR_VMAX(display, cpu_transcoder),
|
||||
crtc_state->vrr.vmax - 1);
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
|
||||
trans_vrr_ctl(crtc_state));
|
||||
intel_de_write(display, TRANS_VRR_FLIPLINE(display, cpu_transcoder),
|
||||
crtc_state->vrr.flipline - 1);
|
||||
intel_vrr_set_fixed_rr_timings(crtc_state);
|
||||
|
||||
if (!intel_vrr_always_use_vrr_tg(display) && !crtc_state->vrr.enable)
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
|
||||
trans_vrr_ctl(crtc_state));
|
||||
|
||||
if (HAS_AS_SDP(display))
|
||||
intel_de_write(display,
|
||||
@@ -461,6 +562,17 @@ bool intel_vrr_is_push_sent(const struct intel_crtc_state *crtc_state)
|
||||
return intel_de_read(display, TRANS_PUSH(display, cpu_transcoder)) & TRANS_PUSH_SEND;
|
||||
}
|
||||
|
||||
bool intel_vrr_always_use_vrr_tg(struct intel_display *display)
|
||||
{
|
||||
if (!HAS_VRR(display))
|
||||
return false;
|
||||
|
||||
if (DISPLAY_VER(display) >= 30)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void intel_vrr_enable(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
@@ -469,16 +581,25 @@ void intel_vrr_enable(const struct intel_crtc_state *crtc_state)
|
||||
if (!crtc_state->vrr.enable)
|
||||
return;
|
||||
|
||||
intel_de_write(display, TRANS_VRR_VMIN(display, cpu_transcoder),
|
||||
crtc_state->vrr.vmin - 1);
|
||||
intel_de_write(display, TRANS_VRR_VMAX(display, cpu_transcoder),
|
||||
crtc_state->vrr.vmax - 1);
|
||||
intel_de_write(display, TRANS_VRR_FLIPLINE(display, cpu_transcoder),
|
||||
crtc_state->vrr.flipline - 1);
|
||||
|
||||
intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
|
||||
TRANS_PUSH_EN);
|
||||
|
||||
if (crtc_state->cmrr.enable) {
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
|
||||
VRR_CTL_VRR_ENABLE | VRR_CTL_CMRR_ENABLE |
|
||||
trans_vrr_ctl(crtc_state));
|
||||
} else {
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
|
||||
VRR_CTL_VRR_ENABLE | trans_vrr_ctl(crtc_state));
|
||||
if (!intel_vrr_always_use_vrr_tg(display)) {
|
||||
if (crtc_state->cmrr.enable) {
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
|
||||
VRR_CTL_VRR_ENABLE | VRR_CTL_CMRR_ENABLE |
|
||||
trans_vrr_ctl(crtc_state));
|
||||
} else {
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
|
||||
VRR_CTL_VRR_ENABLE | trans_vrr_ctl(crtc_state));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,24 +611,77 @@ void intel_vrr_disable(const struct intel_crtc_state *old_crtc_state)
|
||||
if (!old_crtc_state->vrr.enable)
|
||||
return;
|
||||
|
||||
if (!intel_vrr_always_use_vrr_tg(display)) {
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
|
||||
trans_vrr_ctl(old_crtc_state));
|
||||
intel_de_wait_for_clear(display,
|
||||
TRANS_VRR_STATUS(display, cpu_transcoder),
|
||||
VRR_STATUS_VRR_EN_LIVE, 1000);
|
||||
intel_de_write(display, TRANS_PUSH(display, cpu_transcoder), 0);
|
||||
}
|
||||
|
||||
intel_vrr_set_fixed_rr_timings(old_crtc_state);
|
||||
}
|
||||
|
||||
void intel_vrr_transcoder_enable(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
|
||||
|
||||
if (!HAS_VRR(display))
|
||||
return;
|
||||
|
||||
if (!intel_vrr_possible(crtc_state))
|
||||
return;
|
||||
|
||||
if (!intel_vrr_always_use_vrr_tg(display)) {
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
|
||||
trans_vrr_ctl(crtc_state));
|
||||
return;
|
||||
}
|
||||
|
||||
intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
|
||||
TRANS_PUSH_EN);
|
||||
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
|
||||
trans_vrr_ctl(old_crtc_state));
|
||||
intel_de_wait_for_clear(display,
|
||||
TRANS_VRR_STATUS(display, cpu_transcoder),
|
||||
VRR_CTL_VRR_ENABLE | trans_vrr_ctl(crtc_state));
|
||||
}
|
||||
|
||||
void intel_vrr_transcoder_disable(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
|
||||
|
||||
if (!HAS_VRR(display))
|
||||
return;
|
||||
|
||||
if (!intel_vrr_possible(crtc_state))
|
||||
return;
|
||||
|
||||
intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder), 0);
|
||||
|
||||
intel_de_wait_for_clear(display, TRANS_VRR_STATUS(display, cpu_transcoder),
|
||||
VRR_STATUS_VRR_EN_LIVE, 1000);
|
||||
intel_de_write(display, TRANS_PUSH(display, cpu_transcoder), 0);
|
||||
}
|
||||
|
||||
bool intel_vrr_is_fixed_rr(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
return crtc_state->vrr.flipline &&
|
||||
crtc_state->vrr.flipline == crtc_state->vrr.vmax &&
|
||||
crtc_state->vrr.flipline == intel_vrr_vmin_flipline(crtc_state);
|
||||
}
|
||||
|
||||
void intel_vrr_get_config(struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
|
||||
u32 trans_vrr_ctl, trans_vrr_vsync;
|
||||
bool vrr_enable;
|
||||
|
||||
trans_vrr_ctl = intel_de_read(display,
|
||||
TRANS_VRR_CTL(display, cpu_transcoder));
|
||||
|
||||
crtc_state->vrr.enable = trans_vrr_ctl & VRR_CTL_VRR_ENABLE;
|
||||
if (HAS_CMRR(display))
|
||||
crtc_state->cmrr.enable = (trans_vrr_ctl & VRR_CTL_CMRR_ENABLE);
|
||||
|
||||
@@ -536,6 +710,16 @@ void intel_vrr_get_config(struct intel_crtc_state *crtc_state)
|
||||
crtc_state->vrr.vmin = intel_de_read(display,
|
||||
TRANS_VRR_VMIN(display, cpu_transcoder)) + 1;
|
||||
|
||||
/*
|
||||
* For platforms that always use VRR Timing Generator, the VTOTAL.Vtotal
|
||||
* bits are not filled. Since for these platforms TRAN_VMIN is always
|
||||
* filled with crtc_vtotal, use TRAN_VRR_VMIN to get the vtotal for
|
||||
* adjusted_mode.
|
||||
*/
|
||||
if (intel_vrr_always_use_vrr_tg(display))
|
||||
crtc_state->hw.adjusted_mode.crtc_vtotal =
|
||||
intel_vrr_vmin_vtotal(crtc_state);
|
||||
|
||||
if (HAS_AS_SDP(display)) {
|
||||
trans_vrr_vsync =
|
||||
intel_de_read(display,
|
||||
@@ -547,6 +731,18 @@ void intel_vrr_get_config(struct intel_crtc_state *crtc_state)
|
||||
}
|
||||
}
|
||||
|
||||
vrr_enable = trans_vrr_ctl & VRR_CTL_VRR_ENABLE;
|
||||
|
||||
if (intel_vrr_always_use_vrr_tg(display))
|
||||
crtc_state->vrr.enable = vrr_enable && !intel_vrr_is_fixed_rr(crtc_state);
|
||||
else
|
||||
crtc_state->vrr.enable = vrr_enable;
|
||||
|
||||
/*
|
||||
* #TODO: For Both VRR and CMRR the flag I915_MODE_FLAG_VRR is set for mode_flags.
|
||||
* Since CMRR is currently disabled, set this flag for VRR for now.
|
||||
* Need to keep this in mind while re-enabling CMRR.
|
||||
*/
|
||||
if (crtc_state->vrr.enable)
|
||||
crtc_state->mode_flags |= I915_MODE_FLAG_VRR;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ struct intel_atomic_state;
|
||||
struct intel_connector;
|
||||
struct intel_crtc_state;
|
||||
struct intel_dsb;
|
||||
struct intel_display;
|
||||
|
||||
bool intel_vrr_is_capable(struct intel_connector *connector);
|
||||
bool intel_vrr_is_in_range(struct intel_connector *connector, int vrefresh);
|
||||
@@ -35,5 +36,10 @@ int intel_vrr_vmin_vtotal(const struct intel_crtc_state *crtc_state);
|
||||
int intel_vrr_vmax_vblank_start(const struct intel_crtc_state *crtc_state);
|
||||
int intel_vrr_vmin_vblank_start(const struct intel_crtc_state *crtc_state);
|
||||
int intel_vrr_vblank_delay(const struct intel_crtc_state *crtc_state);
|
||||
bool intel_vrr_is_fixed_rr(const struct intel_crtc_state *crtc_state);
|
||||
void intel_vrr_transcoder_enable(const struct intel_crtc_state *crtc_state);
|
||||
void intel_vrr_transcoder_disable(const struct intel_crtc_state *crtc_state);
|
||||
void intel_vrr_set_fixed_rr_timings(const struct intel_crtc_state *crtc_state);
|
||||
bool intel_vrr_always_use_vrr_tg(struct intel_display *display);
|
||||
|
||||
#endif /* __INTEL_VRR_H__ */
|
||||
|
||||
@@ -5,15 +5,18 @@
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
|
||||
#include "i915_drv.h"
|
||||
#include <drm/drm_file.h>
|
||||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i9xx_wm.h"
|
||||
#include "intel_display_core.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_wm.h"
|
||||
#include "skl_watermark.h"
|
||||
|
||||
/**
|
||||
* intel_update_watermarks - update FIFO watermark values based on current modes
|
||||
* @i915: i915 device
|
||||
* @display: display device
|
||||
*
|
||||
* Calculate watermark values for the various WM regs based on current mode
|
||||
* and plane configuration.
|
||||
@@ -44,10 +47,10 @@
|
||||
* We don't use the sprite, so we can ignore that. And on Crestline we have
|
||||
* to set the non-SR watermarks to 8.
|
||||
*/
|
||||
void intel_update_watermarks(struct drm_i915_private *i915)
|
||||
void intel_update_watermarks(struct intel_display *display)
|
||||
{
|
||||
if (i915->display.funcs.wm->update_wm)
|
||||
i915->display.funcs.wm->update_wm(i915);
|
||||
if (display->funcs.wm->update_wm)
|
||||
display->funcs.wm->update_wm(display);
|
||||
}
|
||||
|
||||
int intel_wm_compute(struct intel_atomic_state *state,
|
||||
@@ -64,10 +67,10 @@ int intel_wm_compute(struct intel_atomic_state *state,
|
||||
bool intel_initial_watermarks(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
|
||||
if (i915->display.funcs.wm->initial_watermarks) {
|
||||
i915->display.funcs.wm->initial_watermarks(state, crtc);
|
||||
if (display->funcs.wm->initial_watermarks) {
|
||||
display->funcs.wm->initial_watermarks(state, crtc);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -77,41 +80,41 @@ bool intel_initial_watermarks(struct intel_atomic_state *state,
|
||||
void intel_atomic_update_watermarks(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
|
||||
if (i915->display.funcs.wm->atomic_update_watermarks)
|
||||
i915->display.funcs.wm->atomic_update_watermarks(state, crtc);
|
||||
if (display->funcs.wm->atomic_update_watermarks)
|
||||
display->funcs.wm->atomic_update_watermarks(state, crtc);
|
||||
}
|
||||
|
||||
void intel_optimize_watermarks(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
|
||||
if (i915->display.funcs.wm->optimize_watermarks)
|
||||
i915->display.funcs.wm->optimize_watermarks(state, crtc);
|
||||
if (display->funcs.wm->optimize_watermarks)
|
||||
display->funcs.wm->optimize_watermarks(state, crtc);
|
||||
}
|
||||
|
||||
int intel_compute_global_watermarks(struct intel_atomic_state *state)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(state->base.dev);
|
||||
struct intel_display *display = to_intel_display(state);
|
||||
|
||||
if (i915->display.funcs.wm->compute_global_watermarks)
|
||||
return i915->display.funcs.wm->compute_global_watermarks(state);
|
||||
if (display->funcs.wm->compute_global_watermarks)
|
||||
return display->funcs.wm->compute_global_watermarks(state);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void intel_wm_get_hw_state(struct drm_i915_private *i915)
|
||||
void intel_wm_get_hw_state(struct intel_display *display)
|
||||
{
|
||||
if (i915->display.funcs.wm->get_hw_state)
|
||||
return i915->display.funcs.wm->get_hw_state(i915);
|
||||
if (display->funcs.wm->get_hw_state)
|
||||
return display->funcs.wm->get_hw_state(display);
|
||||
}
|
||||
|
||||
void intel_wm_sanitize(struct drm_i915_private *i915)
|
||||
void intel_wm_sanitize(struct intel_display *display)
|
||||
{
|
||||
if (i915->display.funcs.wm->sanitize)
|
||||
return i915->display.funcs.wm->sanitize(i915);
|
||||
if (display->funcs.wm->sanitize)
|
||||
return display->funcs.wm->sanitize(display);
|
||||
}
|
||||
|
||||
bool intel_wm_plane_visible(const struct intel_crtc_state *crtc_state,
|
||||
@@ -137,16 +140,16 @@ bool intel_wm_plane_visible(const struct intel_crtc_state *crtc_state,
|
||||
return plane_state->uapi.visible;
|
||||
}
|
||||
|
||||
void intel_print_wm_latency(struct drm_i915_private *dev_priv,
|
||||
void intel_print_wm_latency(struct intel_display *display,
|
||||
const char *name, const u16 wm[])
|
||||
{
|
||||
int level;
|
||||
|
||||
for (level = 0; level < dev_priv->display.wm.num_levels; level++) {
|
||||
for (level = 0; level < display->wm.num_levels; level++) {
|
||||
unsigned int latency = wm[level];
|
||||
|
||||
if (latency == 0) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"%s WM%d latency not provided\n",
|
||||
name, level);
|
||||
continue;
|
||||
@@ -156,43 +159,43 @@ void intel_print_wm_latency(struct drm_i915_private *dev_priv,
|
||||
* - latencies are in us on gen9.
|
||||
* - before then, WM1+ latency values are in 0.5us units
|
||||
*/
|
||||
if (DISPLAY_VER(dev_priv) >= 9)
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
latency *= 10;
|
||||
else if (level > 0)
|
||||
latency *= 5;
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
drm_dbg_kms(display->drm,
|
||||
"%s WM%d latency %u (%u.%u usec)\n", name, level,
|
||||
wm[level], latency / 10, latency % 10);
|
||||
}
|
||||
}
|
||||
|
||||
void intel_wm_init(struct drm_i915_private *i915)
|
||||
void intel_wm_init(struct intel_display *display)
|
||||
{
|
||||
if (DISPLAY_VER(i915) >= 9)
|
||||
skl_wm_init(i915);
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
skl_wm_init(display);
|
||||
else
|
||||
i9xx_wm_init(i915);
|
||||
i9xx_wm_init(display);
|
||||
}
|
||||
|
||||
static void wm_latency_show(struct seq_file *m, const u16 wm[8])
|
||||
{
|
||||
struct drm_i915_private *dev_priv = m->private;
|
||||
struct intel_display *display = m->private;
|
||||
int level;
|
||||
|
||||
drm_modeset_lock_all(&dev_priv->drm);
|
||||
drm_modeset_lock_all(display->drm);
|
||||
|
||||
for (level = 0; level < dev_priv->display.wm.num_levels; level++) {
|
||||
for (level = 0; level < display->wm.num_levels; level++) {
|
||||
unsigned int latency = wm[level];
|
||||
|
||||
/*
|
||||
* - WM1+ latency values in 0.5us units
|
||||
* - latencies are in us on gen9/vlv/chv
|
||||
*/
|
||||
if (DISPLAY_VER(dev_priv) >= 9 ||
|
||||
IS_VALLEYVIEW(dev_priv) ||
|
||||
IS_CHERRYVIEW(dev_priv) ||
|
||||
IS_G4X(dev_priv))
|
||||
if (DISPLAY_VER(display) >= 9 ||
|
||||
display->platform.valleyview ||
|
||||
display->platform.cherryview ||
|
||||
display->platform.g4x)
|
||||
latency *= 10;
|
||||
else if (level > 0)
|
||||
latency *= 5;
|
||||
@@ -201,18 +204,18 @@ static void wm_latency_show(struct seq_file *m, const u16 wm[8])
|
||||
level, wm[level], latency / 10, latency % 10);
|
||||
}
|
||||
|
||||
drm_modeset_unlock_all(&dev_priv->drm);
|
||||
drm_modeset_unlock_all(display->drm);
|
||||
}
|
||||
|
||||
static int pri_wm_latency_show(struct seq_file *m, void *data)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = m->private;
|
||||
struct intel_display *display = m->private;
|
||||
const u16 *latencies;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 9)
|
||||
latencies = dev_priv->display.wm.skl_latency;
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
latencies = display->wm.skl_latency;
|
||||
else
|
||||
latencies = dev_priv->display.wm.pri_latency;
|
||||
latencies = display->wm.pri_latency;
|
||||
|
||||
wm_latency_show(m, latencies);
|
||||
|
||||
@@ -221,13 +224,13 @@ static int pri_wm_latency_show(struct seq_file *m, void *data)
|
||||
|
||||
static int spr_wm_latency_show(struct seq_file *m, void *data)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = m->private;
|
||||
struct intel_display *display = m->private;
|
||||
const u16 *latencies;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 9)
|
||||
latencies = dev_priv->display.wm.skl_latency;
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
latencies = display->wm.skl_latency;
|
||||
else
|
||||
latencies = dev_priv->display.wm.spr_latency;
|
||||
latencies = display->wm.spr_latency;
|
||||
|
||||
wm_latency_show(m, latencies);
|
||||
|
||||
@@ -236,13 +239,13 @@ static int spr_wm_latency_show(struct seq_file *m, void *data)
|
||||
|
||||
static int cur_wm_latency_show(struct seq_file *m, void *data)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = m->private;
|
||||
struct intel_display *display = m->private;
|
||||
const u16 *latencies;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 9)
|
||||
latencies = dev_priv->display.wm.skl_latency;
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
latencies = display->wm.skl_latency;
|
||||
else
|
||||
latencies = dev_priv->display.wm.cur_latency;
|
||||
latencies = display->wm.cur_latency;
|
||||
|
||||
wm_latency_show(m, latencies);
|
||||
|
||||
@@ -251,39 +254,39 @@ static int cur_wm_latency_show(struct seq_file *m, void *data)
|
||||
|
||||
static int pri_wm_latency_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = inode->i_private;
|
||||
struct intel_display *display = inode->i_private;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) < 5 && !IS_G4X(dev_priv))
|
||||
if (DISPLAY_VER(display) < 5 && !display->platform.g4x)
|
||||
return -ENODEV;
|
||||
|
||||
return single_open(file, pri_wm_latency_show, dev_priv);
|
||||
return single_open(file, pri_wm_latency_show, display);
|
||||
}
|
||||
|
||||
static int spr_wm_latency_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = inode->i_private;
|
||||
struct intel_display *display = inode->i_private;
|
||||
|
||||
if (HAS_GMCH(dev_priv))
|
||||
if (HAS_GMCH(display))
|
||||
return -ENODEV;
|
||||
|
||||
return single_open(file, spr_wm_latency_show, dev_priv);
|
||||
return single_open(file, spr_wm_latency_show, display);
|
||||
}
|
||||
|
||||
static int cur_wm_latency_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = inode->i_private;
|
||||
struct intel_display *display = inode->i_private;
|
||||
|
||||
if (HAS_GMCH(dev_priv))
|
||||
if (HAS_GMCH(display))
|
||||
return -ENODEV;
|
||||
|
||||
return single_open(file, cur_wm_latency_show, dev_priv);
|
||||
return single_open(file, cur_wm_latency_show, display);
|
||||
}
|
||||
|
||||
static ssize_t wm_latency_write(struct file *file, const char __user *ubuf,
|
||||
size_t len, loff_t *offp, u16 wm[8])
|
||||
{
|
||||
struct seq_file *m = file->private_data;
|
||||
struct drm_i915_private *dev_priv = m->private;
|
||||
struct intel_display *display = m->private;
|
||||
u16 new[8] = {};
|
||||
int level;
|
||||
int ret;
|
||||
@@ -300,15 +303,15 @@ static ssize_t wm_latency_write(struct file *file, const char __user *ubuf,
|
||||
ret = sscanf(tmp, "%hu %hu %hu %hu %hu %hu %hu %hu",
|
||||
&new[0], &new[1], &new[2], &new[3],
|
||||
&new[4], &new[5], &new[6], &new[7]);
|
||||
if (ret != dev_priv->display.wm.num_levels)
|
||||
if (ret != display->wm.num_levels)
|
||||
return -EINVAL;
|
||||
|
||||
drm_modeset_lock_all(&dev_priv->drm);
|
||||
drm_modeset_lock_all(display->drm);
|
||||
|
||||
for (level = 0; level < dev_priv->display.wm.num_levels; level++)
|
||||
for (level = 0; level < display->wm.num_levels; level++)
|
||||
wm[level] = new[level];
|
||||
|
||||
drm_modeset_unlock_all(&dev_priv->drm);
|
||||
drm_modeset_unlock_all(display->drm);
|
||||
|
||||
return len;
|
||||
}
|
||||
@@ -317,13 +320,13 @@ static ssize_t pri_wm_latency_write(struct file *file, const char __user *ubuf,
|
||||
size_t len, loff_t *offp)
|
||||
{
|
||||
struct seq_file *m = file->private_data;
|
||||
struct drm_i915_private *dev_priv = m->private;
|
||||
struct intel_display *display = m->private;
|
||||
u16 *latencies;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 9)
|
||||
latencies = dev_priv->display.wm.skl_latency;
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
latencies = display->wm.skl_latency;
|
||||
else
|
||||
latencies = dev_priv->display.wm.pri_latency;
|
||||
latencies = display->wm.pri_latency;
|
||||
|
||||
return wm_latency_write(file, ubuf, len, offp, latencies);
|
||||
}
|
||||
@@ -332,13 +335,13 @@ static ssize_t spr_wm_latency_write(struct file *file, const char __user *ubuf,
|
||||
size_t len, loff_t *offp)
|
||||
{
|
||||
struct seq_file *m = file->private_data;
|
||||
struct drm_i915_private *dev_priv = m->private;
|
||||
struct intel_display *display = m->private;
|
||||
u16 *latencies;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 9)
|
||||
latencies = dev_priv->display.wm.skl_latency;
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
latencies = display->wm.skl_latency;
|
||||
else
|
||||
latencies = dev_priv->display.wm.spr_latency;
|
||||
latencies = display->wm.spr_latency;
|
||||
|
||||
return wm_latency_write(file, ubuf, len, offp, latencies);
|
||||
}
|
||||
@@ -347,13 +350,13 @@ static ssize_t cur_wm_latency_write(struct file *file, const char __user *ubuf,
|
||||
size_t len, loff_t *offp)
|
||||
{
|
||||
struct seq_file *m = file->private_data;
|
||||
struct drm_i915_private *dev_priv = m->private;
|
||||
struct intel_display *display = m->private;
|
||||
u16 *latencies;
|
||||
|
||||
if (DISPLAY_VER(dev_priv) >= 9)
|
||||
latencies = dev_priv->display.wm.skl_latency;
|
||||
if (DISPLAY_VER(display) >= 9)
|
||||
latencies = display->wm.skl_latency;
|
||||
else
|
||||
latencies = dev_priv->display.wm.cur_latency;
|
||||
latencies = display->wm.cur_latency;
|
||||
|
||||
return wm_latency_write(file, ubuf, len, offp, latencies);
|
||||
}
|
||||
@@ -385,18 +388,18 @@ static const struct file_operations i915_cur_wm_latency_fops = {
|
||||
.write = cur_wm_latency_write
|
||||
};
|
||||
|
||||
void intel_wm_debugfs_register(struct drm_i915_private *i915)
|
||||
void intel_wm_debugfs_register(struct intel_display *display)
|
||||
{
|
||||
struct drm_minor *minor = i915->drm.primary;
|
||||
struct drm_minor *minor = display->drm->primary;
|
||||
|
||||
debugfs_create_file("i915_pri_wm_latency", 0644, minor->debugfs_root,
|
||||
i915, &i915_pri_wm_latency_fops);
|
||||
display, &i915_pri_wm_latency_fops);
|
||||
|
||||
debugfs_create_file("i915_spr_wm_latency", 0644, minor->debugfs_root,
|
||||
i915, &i915_spr_wm_latency_fops);
|
||||
display, &i915_spr_wm_latency_fops);
|
||||
|
||||
debugfs_create_file("i915_cur_wm_latency", 0644, minor->debugfs_root,
|
||||
i915, &i915_cur_wm_latency_fops);
|
||||
display, &i915_cur_wm_latency_fops);
|
||||
|
||||
skl_watermark_debugfs_register(i915);
|
||||
skl_watermark_debugfs_register(display);
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_atomic_state;
|
||||
struct intel_crtc;
|
||||
struct intel_crtc_state;
|
||||
struct intel_display;
|
||||
struct intel_plane_state;
|
||||
|
||||
void intel_update_watermarks(struct drm_i915_private *i915);
|
||||
void intel_update_watermarks(struct intel_display *display);
|
||||
int intel_wm_compute(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc);
|
||||
bool intel_initial_watermarks(struct intel_atomic_state *state,
|
||||
@@ -24,13 +24,13 @@ void intel_atomic_update_watermarks(struct intel_atomic_state *state,
|
||||
void intel_optimize_watermarks(struct intel_atomic_state *state,
|
||||
struct intel_crtc *crtc);
|
||||
int intel_compute_global_watermarks(struct intel_atomic_state *state);
|
||||
void intel_wm_get_hw_state(struct drm_i915_private *i915);
|
||||
void intel_wm_sanitize(struct drm_i915_private *i915);
|
||||
void intel_wm_get_hw_state(struct intel_display *display);
|
||||
void intel_wm_sanitize(struct intel_display *display);
|
||||
bool intel_wm_plane_visible(const struct intel_crtc_state *crtc_state,
|
||||
const struct intel_plane_state *plane_state);
|
||||
void intel_print_wm_latency(struct drm_i915_private *i915,
|
||||
void intel_print_wm_latency(struct intel_display *display,
|
||||
const char *name, const u16 wm[]);
|
||||
void intel_wm_init(struct drm_i915_private *i915);
|
||||
void intel_wm_debugfs_register(struct drm_i915_private *i915);
|
||||
void intel_wm_init(struct intel_display *display);
|
||||
void intel_wm_debugfs_register(struct intel_display *display);
|
||||
|
||||
#endif /* __INTEL_WM_H__ */
|
||||
|
||||
@@ -2689,22 +2689,24 @@ static const struct drm_plane_funcs tgl_plane_funcs = {
|
||||
static void
|
||||
skl_plane_enable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
enum pipe pipe = plane->pipe;
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
bdw_enable_pipe_irq(i915, pipe, GEN9_PIPE_PLANE_FLIP_DONE(plane->id));
|
||||
bdw_enable_pipe_irq(display, pipe, GEN9_PIPE_PLANE_FLIP_DONE(plane->id));
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
skl_plane_disable_flip_done(struct intel_plane *plane)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(plane);
|
||||
struct drm_i915_private *i915 = to_i915(plane->base.dev);
|
||||
enum pipe pipe = plane->pipe;
|
||||
|
||||
spin_lock_irq(&i915->irq_lock);
|
||||
bdw_disable_pipe_irq(i915, pipe, GEN9_PIPE_PLANE_FLIP_DONE(plane->id));
|
||||
bdw_disable_pipe_irq(display, pipe, GEN9_PIPE_PLANE_FLIP_DONE(plane->id));
|
||||
spin_unlock_irq(&i915->irq_lock);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,6 @@
|
||||
#include "intel_global_state.h"
|
||||
#include "intel_wm_types.h"
|
||||
|
||||
struct drm_i915_private;
|
||||
struct intel_atomic_state;
|
||||
struct intel_bw_state;
|
||||
struct intel_crtc;
|
||||
@@ -27,11 +26,12 @@ u8 intel_enabled_dbuf_slices_mask(struct intel_display *display);
|
||||
|
||||
void intel_sagv_pre_plane_update(struct intel_atomic_state *state);
|
||||
void intel_sagv_post_plane_update(struct intel_atomic_state *state);
|
||||
bool intel_can_enable_sagv(struct drm_i915_private *i915,
|
||||
bool intel_crtc_can_enable_sagv(const struct intel_crtc_state *crtc_state);
|
||||
bool intel_can_enable_sagv(struct intel_display *display,
|
||||
const struct intel_bw_state *bw_state);
|
||||
bool intel_has_sagv(struct drm_i915_private *i915);
|
||||
bool intel_has_sagv(struct intel_display *display);
|
||||
|
||||
u32 skl_ddb_dbuf_slice_mask(struct drm_i915_private *i915,
|
||||
u32 skl_ddb_dbuf_slice_mask(struct intel_display *display,
|
||||
const struct skl_ddb_entry *entry);
|
||||
|
||||
bool skl_ddb_allocation_overlaps(const struct skl_ddb_entry *ddb,
|
||||
@@ -45,14 +45,14 @@ void skl_wm_crtc_disable_noatomic(struct intel_crtc *crtc);
|
||||
void skl_wm_plane_disable_noatomic(struct intel_crtc *crtc,
|
||||
struct intel_plane *plane);
|
||||
|
||||
void skl_watermark_ipc_init(struct drm_i915_private *i915);
|
||||
void skl_watermark_ipc_update(struct drm_i915_private *i915);
|
||||
bool skl_watermark_ipc_enabled(struct drm_i915_private *i915);
|
||||
void skl_watermark_debugfs_register(struct drm_i915_private *i915);
|
||||
void skl_watermark_ipc_init(struct intel_display *display);
|
||||
void skl_watermark_ipc_update(struct intel_display *display);
|
||||
bool skl_watermark_ipc_enabled(struct intel_display *display);
|
||||
void skl_watermark_debugfs_register(struct intel_display *display);
|
||||
|
||||
unsigned int skl_watermark_max_latency(struct drm_i915_private *i915,
|
||||
unsigned int skl_watermark_max_latency(struct intel_display *display,
|
||||
int initial_wm_level);
|
||||
void skl_wm_init(struct drm_i915_private *i915);
|
||||
void skl_wm_init(struct intel_display *display);
|
||||
|
||||
const struct skl_wm_level *skl_plane_wm_level(const struct skl_pipe_wm *pipe_wm,
|
||||
enum plane_id plane_id,
|
||||
@@ -86,13 +86,13 @@ intel_atomic_get_dbuf_state(struct intel_atomic_state *state);
|
||||
#define intel_atomic_get_new_dbuf_state(state) \
|
||||
to_intel_dbuf_state(intel_atomic_get_new_global_obj_state(state, &to_intel_display(state)->dbuf.obj))
|
||||
|
||||
int intel_dbuf_init(struct drm_i915_private *i915);
|
||||
int intel_dbuf_init(struct intel_display *display);
|
||||
int intel_dbuf_state_set_mdclk_cdclk_ratio(struct intel_atomic_state *state,
|
||||
int ratio);
|
||||
|
||||
void intel_dbuf_pre_plane_update(struct intel_atomic_state *state);
|
||||
void intel_dbuf_post_plane_update(struct intel_atomic_state *state);
|
||||
void intel_dbuf_mdclk_cdclk_ratio_update(struct drm_i915_private *i915,
|
||||
void intel_dbuf_mdclk_cdclk_ratio_update(struct intel_display *display,
|
||||
int ratio, bool joined_mbus);
|
||||
void intel_dbuf_mbus_pre_ddb_update(struct intel_atomic_state *state);
|
||||
void intel_dbuf_mbus_post_ddb_update(struct intel_atomic_state *state);
|
||||
|
||||
@@ -251,8 +251,10 @@ static int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void band_gap_reset(struct drm_i915_private *dev_priv)
|
||||
static void band_gap_reset(struct intel_display *display)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(display->drm);
|
||||
|
||||
vlv_flisdsi_get(dev_priv);
|
||||
|
||||
vlv_flisdsi_write(dev_priv, 0x08, 0x0001);
|
||||
@@ -269,13 +271,13 @@ static int intel_dsi_compute_config(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *pipe_config,
|
||||
struct drm_connector_state *conn_state)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
struct intel_connector *intel_connector = intel_dsi->attached_connector;
|
||||
struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
|
||||
int ret;
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "\n");
|
||||
drm_dbg_kms(display->drm, "\n");
|
||||
pipe_config->sink_format = INTEL_OUTPUT_FORMAT_RGB;
|
||||
pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB;
|
||||
|
||||
@@ -298,7 +300,7 @@ static int intel_dsi_compute_config(struct intel_encoder *encoder,
|
||||
else
|
||||
pipe_config->pipe_bpp = 18;
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.geminilake || display->platform.broxton) {
|
||||
/* Enable Frame time stamp based scanline reporting */
|
||||
pipe_config->mode_flags |=
|
||||
I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP;
|
||||
@@ -468,7 +470,7 @@ static void vlv_dsi_device_ready(struct intel_encoder *encoder)
|
||||
vlv_flisdsi_put(dev_priv);
|
||||
|
||||
/* bandgap reset is needed after everytime we do power gate */
|
||||
band_gap_reset(dev_priv);
|
||||
band_gap_reset(display);
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
|
||||
@@ -495,11 +497,11 @@ static void vlv_dsi_device_ready(struct intel_encoder *encoder)
|
||||
|
||||
static void intel_dsi_device_ready(struct intel_encoder *encoder)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv))
|
||||
if (display->platform.geminilake)
|
||||
glk_dsi_device_ready(encoder);
|
||||
else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
|
||||
else if (display->platform.geminilake || display->platform.broxton)
|
||||
bxt_dsi_device_ready(encoder);
|
||||
else
|
||||
vlv_dsi_device_ready(encoder);
|
||||
@@ -559,23 +561,22 @@ static void glk_dsi_clear_device_ready(struct intel_encoder *encoder)
|
||||
glk_dsi_disable_mipi_io(encoder);
|
||||
}
|
||||
|
||||
static i915_reg_t port_ctrl_reg(struct drm_i915_private *i915, enum port port)
|
||||
static i915_reg_t port_ctrl_reg(struct intel_display *display, enum port port)
|
||||
{
|
||||
return IS_GEMINILAKE(i915) || IS_BROXTON(i915) ?
|
||||
return display->platform.geminilake || display->platform.broxton ?
|
||||
BXT_MIPI_PORT_CTRL(port) : VLV_MIPI_PORT_CTRL(port);
|
||||
}
|
||||
|
||||
static void vlv_dsi_clear_device_ready(struct intel_encoder *encoder)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
enum port port;
|
||||
|
||||
drm_dbg_kms(display->drm, "\n");
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
/* Common bit for both MIPI Port A & MIPI Port C on VLV/CHV */
|
||||
i915_reg_t port_ctrl = IS_BROXTON(dev_priv) ?
|
||||
i915_reg_t port_ctrl = display->platform.broxton ?
|
||||
BXT_MIPI_PORT_CTRL(port) : VLV_MIPI_PORT_CTRL(PORT_A);
|
||||
|
||||
intel_de_write(display, MIPI_DEVICE_READY(display, port),
|
||||
@@ -594,7 +595,7 @@ static void vlv_dsi_clear_device_ready(struct intel_encoder *encoder)
|
||||
* On VLV/CHV, wait till Clock lanes are in LP-00 state for MIPI
|
||||
* Port A only. MIPI Port C has no similar bit for checking.
|
||||
*/
|
||||
if ((IS_BROXTON(dev_priv) || port == PORT_A) &&
|
||||
if ((display->platform.broxton || port == PORT_A) &&
|
||||
intel_de_wait_for_clear(display, port_ctrl,
|
||||
AFE_LATCHOUT, 30))
|
||||
drm_err(display->drm, "DSI LP not going Low\n");
|
||||
@@ -612,7 +613,6 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
enum port port;
|
||||
@@ -620,7 +620,7 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder,
|
||||
if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) {
|
||||
u32 temp = intel_dsi->pixel_overlap;
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.geminilake || display->platform.broxton) {
|
||||
for_each_dsi_port(port, intel_dsi->ports)
|
||||
intel_de_rmw(display, MIPI_CTRL(display, port),
|
||||
BXT_PIXEL_OVERLAP_CNT_MASK,
|
||||
@@ -633,7 +633,7 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder,
|
||||
}
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
i915_reg_t port_ctrl = port_ctrl_reg(dev_priv, port);
|
||||
i915_reg_t port_ctrl = port_ctrl_reg(display, port);
|
||||
u32 temp;
|
||||
|
||||
temp = intel_de_read(display, port_ctrl);
|
||||
@@ -644,7 +644,7 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder,
|
||||
if (intel_dsi->ports == (BIT(PORT_A) | BIT(PORT_C))) {
|
||||
temp |= (intel_dsi->dual_link - 1)
|
||||
<< DUAL_LINK_MODE_SHIFT;
|
||||
if (IS_BROXTON(dev_priv))
|
||||
if (display->platform.broxton)
|
||||
temp |= LANE_CONFIGURATION_DUAL_LINK_A;
|
||||
else
|
||||
temp |= crtc->pipe ?
|
||||
@@ -664,12 +664,11 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder,
|
||||
static void intel_dsi_port_disable(struct intel_encoder *encoder)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
enum port port;
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
i915_reg_t port_ctrl = port_ctrl_reg(dev_priv, port);
|
||||
i915_reg_t port_ctrl = port_ctrl_reg(display, port);
|
||||
|
||||
/* de-assert ip_tg_enable signal */
|
||||
intel_de_rmw(display, port_ctrl, DPI_ENABLE, 0);
|
||||
@@ -730,7 +729,6 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
enum pipe pipe = crtc->pipe;
|
||||
enum port port;
|
||||
bool glk_cold_boot = false;
|
||||
@@ -745,7 +743,7 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
|
||||
* The BIOS may leave the PLL in a wonky state where it doesn't
|
||||
* lock. It needs to be fully powered down to fix it.
|
||||
*/
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.geminilake || display->platform.broxton) {
|
||||
bxt_dsi_pll_disable(encoder);
|
||||
bxt_dsi_pll_enable(encoder, pipe_config);
|
||||
} else {
|
||||
@@ -753,7 +751,7 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
|
||||
vlv_dsi_pll_enable(encoder, pipe_config);
|
||||
}
|
||||
|
||||
if (IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.broxton) {
|
||||
/* Add MIPI IO reset programming for modeset */
|
||||
intel_de_rmw(display, BXT_P_CR_GT_DISP_PWRON, 0, MIPIO_RST_CTRL);
|
||||
|
||||
@@ -762,13 +760,13 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
|
||||
intel_de_write(display, BXT_P_DSI_REGULATOR_TX_CTRL, 0);
|
||||
}
|
||||
|
||||
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
|
||||
if (display->platform.valleyview || display->platform.cherryview) {
|
||||
/* Disable DPOunit clock gating, can stall pipe */
|
||||
intel_de_rmw(display, DSPCLK_GATE_D(dev_priv),
|
||||
intel_de_rmw(display, DSPCLK_GATE_D(display),
|
||||
0, DPOUNIT_CLOCK_GATE_DISABLE);
|
||||
}
|
||||
|
||||
if (!IS_GEMINILAKE(dev_priv))
|
||||
if (!display->platform.geminilake)
|
||||
intel_dsi_prepare(encoder, pipe_config);
|
||||
|
||||
/* Give the panel time to power-on and then deassert its reset */
|
||||
@@ -776,7 +774,7 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
|
||||
msleep(intel_dsi->panel_on_delay);
|
||||
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET);
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv)) {
|
||||
if (display->platform.geminilake) {
|
||||
glk_cold_boot = glk_dsi_enable_io(encoder);
|
||||
|
||||
/* Prepare port in cold boot(s3/s4) scenario */
|
||||
@@ -788,7 +786,7 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
|
||||
intel_dsi_device_ready(encoder);
|
||||
|
||||
/* Prepare port in normal boot scenario */
|
||||
if (IS_GEMINILAKE(dev_priv) && !glk_cold_boot)
|
||||
if (display->platform.geminilake && !glk_cold_boot)
|
||||
intel_dsi_prepare(encoder, pipe_config);
|
||||
|
||||
/* Send initialization commands in LP mode */
|
||||
@@ -836,11 +834,11 @@ static void intel_dsi_disable(struct intel_atomic_state *state,
|
||||
const struct intel_crtc_state *old_crtc_state,
|
||||
const struct drm_connector_state *old_conn_state)
|
||||
{
|
||||
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
enum port port;
|
||||
|
||||
drm_dbg_kms(&i915->drm, "\n");
|
||||
drm_dbg_kms(display->drm, "\n");
|
||||
|
||||
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_BACKLIGHT_OFF);
|
||||
intel_backlight_disable(old_conn_state);
|
||||
@@ -860,9 +858,9 @@ static void intel_dsi_disable(struct intel_atomic_state *state,
|
||||
|
||||
static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv))
|
||||
if (display->platform.geminilake)
|
||||
glk_dsi_clear_device_ready(encoder);
|
||||
else
|
||||
vlv_dsi_clear_device_ready(encoder);
|
||||
@@ -874,13 +872,12 @@ static void intel_dsi_post_disable(struct intel_atomic_state *state,
|
||||
const struct drm_connector_state *old_conn_state)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
enum port port;
|
||||
|
||||
drm_dbg_kms(display->drm, "\n");
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.geminilake || display->platform.broxton) {
|
||||
intel_crtc_vblank_off(old_crtc_state);
|
||||
|
||||
skl_scaler_disable(old_crtc_state);
|
||||
@@ -907,7 +904,7 @@ static void intel_dsi_post_disable(struct intel_atomic_state *state,
|
||||
/* Transition to LP-00 */
|
||||
intel_dsi_clear_device_ready(encoder);
|
||||
|
||||
if (IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.broxton) {
|
||||
/* Power down DSI regulator to save power */
|
||||
intel_de_write(display, BXT_P_DSI_REGULATOR_CFG, STAP_SELECT);
|
||||
intel_de_write(display, BXT_P_DSI_REGULATOR_TX_CTRL,
|
||||
@@ -917,12 +914,12 @@ static void intel_dsi_post_disable(struct intel_atomic_state *state,
|
||||
intel_de_rmw(display, BXT_P_CR_GT_DISP_PWRON, MIPIO_RST_CTRL, 0);
|
||||
}
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.geminilake || display->platform.broxton) {
|
||||
bxt_dsi_pll_disable(encoder);
|
||||
} else {
|
||||
vlv_dsi_pll_disable(encoder);
|
||||
|
||||
intel_de_rmw(display, DSPCLK_GATE_D(dev_priv),
|
||||
intel_de_rmw(display, DSPCLK_GATE_D(display),
|
||||
DPOUNIT_CLOCK_GATE_DISABLE, 0);
|
||||
}
|
||||
|
||||
@@ -939,7 +936,6 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
|
||||
enum pipe *pipe)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
intel_wakeref_t wakeref;
|
||||
enum port port;
|
||||
@@ -957,13 +953,13 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
|
||||
* configuration, otherwise accessing DSI registers will hang the
|
||||
* machine. See BSpec North Display Engine registers/MIPI[BXT].
|
||||
*/
|
||||
if ((IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) &&
|
||||
!bxt_dsi_pll_is_enabled(dev_priv))
|
||||
if ((display->platform.geminilake || display->platform.broxton) &&
|
||||
!bxt_dsi_pll_is_enabled(display))
|
||||
goto out_put_power;
|
||||
|
||||
/* XXX: this only works for one DSI output */
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
i915_reg_t port_ctrl = port_ctrl_reg(dev_priv, port);
|
||||
i915_reg_t port_ctrl = port_ctrl_reg(display, port);
|
||||
bool enabled = intel_de_read(display, port_ctrl) & DPI_ENABLE;
|
||||
|
||||
/*
|
||||
@@ -971,10 +967,10 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
|
||||
* bit in port C control register does not get set. As a
|
||||
* workaround, check pipe B conf instead.
|
||||
*/
|
||||
if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
|
||||
if ((display->platform.valleyview || display->platform.cherryview) &&
|
||||
port == PORT_C)
|
||||
enabled = intel_de_read(display,
|
||||
TRANSCONF(dev_priv, PIPE_B)) & TRANSCONF_ENABLE;
|
||||
TRANSCONF(display, PIPE_B)) & TRANSCONF_ENABLE;
|
||||
|
||||
/* Try command mode if video mode not enabled */
|
||||
if (!enabled) {
|
||||
@@ -989,7 +985,7 @@ static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
|
||||
if (!(intel_de_read(display, MIPI_DEVICE_READY(display, port)) & DEVICE_READY))
|
||||
continue;
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.geminilake || display->platform.broxton) {
|
||||
u32 tmp = intel_de_read(display, MIPI_CTRL(display, port));
|
||||
tmp &= BXT_PIPE_SELECT_MASK;
|
||||
tmp >>= BXT_PIPE_SELECT_SHIFT;
|
||||
@@ -1177,15 +1173,15 @@ static void bxt_dsi_get_pipe_config(struct intel_encoder *encoder,
|
||||
static void intel_dsi_get_config(struct intel_encoder *encoder,
|
||||
struct intel_crtc_state *pipe_config)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
u32 pclk;
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "\n");
|
||||
drm_dbg_kms(display->drm, "\n");
|
||||
|
||||
pipe_config->output_types |= BIT(INTEL_OUTPUT_DSI);
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.geminilake || display->platform.broxton) {
|
||||
bxt_dsi_get_pipe_config(encoder, pipe_config);
|
||||
pclk = bxt_dsi_get_pclk(encoder, pipe_config);
|
||||
} else {
|
||||
@@ -1218,7 +1214,6 @@ static void set_dsi_timings(struct intel_encoder *encoder,
|
||||
const struct drm_display_mode *adjusted_mode)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
enum port port;
|
||||
unsigned int bpp = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format);
|
||||
@@ -1253,7 +1248,7 @@ static void set_dsi_timings(struct intel_encoder *encoder,
|
||||
hbp = txbyteclkhs(hbp, bpp, lane_count, intel_dsi->burst_mode_ratio);
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.geminilake || display->platform.broxton) {
|
||||
/*
|
||||
* Program hdisplay and vdisplay on MIPI transcoder.
|
||||
* This is different from calculated hactive and
|
||||
@@ -1307,7 +1302,6 @@ static void intel_dsi_prepare(struct intel_encoder *encoder,
|
||||
const struct intel_crtc_state *pipe_config)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
|
||||
@@ -1327,7 +1321,7 @@ static void intel_dsi_prepare(struct intel_encoder *encoder,
|
||||
}
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
|
||||
if (display->platform.valleyview || display->platform.cherryview) {
|
||||
/*
|
||||
* escape clock divider, 20MHz, shared for A and C.
|
||||
* device ready must be off when doing this! txclkesc?
|
||||
@@ -1342,7 +1336,7 @@ static void intel_dsi_prepare(struct intel_encoder *encoder,
|
||||
tmp &= ~READ_REQUEST_PRIORITY_MASK;
|
||||
intel_de_write(display, MIPI_CTRL(display, port),
|
||||
tmp | READ_REQUEST_PRIORITY_HIGH);
|
||||
} else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
} else if (display->platform.geminilake || display->platform.broxton) {
|
||||
enum pipe pipe = crtc->pipe;
|
||||
|
||||
intel_de_rmw(display, MIPI_CTRL(display, port),
|
||||
@@ -1377,7 +1371,7 @@ static void intel_dsi_prepare(struct intel_encoder *encoder,
|
||||
if (intel_dsi->clock_stop)
|
||||
tmp |= CLOCKSTOP;
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
|
||||
if (display->platform.geminilake || display->platform.broxton) {
|
||||
tmp |= BXT_DPHY_DEFEATURE_EN;
|
||||
if (!is_cmd_mode(intel_dsi))
|
||||
tmp |= BXT_DEFEATURE_DPI_FIFO_CTR;
|
||||
@@ -1424,7 +1418,7 @@ static void intel_dsi_prepare(struct intel_encoder *encoder,
|
||||
intel_de_write(display, MIPI_INIT_COUNT(display, port),
|
||||
txclkesc(intel_dsi->escape_clk_div, 100));
|
||||
|
||||
if ((IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) &&
|
||||
if ((display->platform.geminilake || display->platform.broxton) &&
|
||||
!intel_dsi->dual_link) {
|
||||
/*
|
||||
* BXT spec says write MIPI_INIT_COUNT for
|
||||
@@ -1461,7 +1455,7 @@ static void intel_dsi_prepare(struct intel_encoder *encoder,
|
||||
intel_de_write(display, MIPI_LP_BYTECLK(display, port),
|
||||
intel_dsi->lp_byte_clk);
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv)) {
|
||||
if (display->platform.geminilake) {
|
||||
intel_de_write(display, MIPI_TLPX_TIME_COUNT(display, port),
|
||||
intel_dsi->lp_byte_clk);
|
||||
/* Shadow of DPHY reg */
|
||||
@@ -1513,18 +1507,17 @@ static void intel_dsi_prepare(struct intel_encoder *encoder,
|
||||
static void intel_dsi_unprepare(struct intel_encoder *encoder)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(encoder);
|
||||
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
|
||||
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
|
||||
enum port port;
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv))
|
||||
if (display->platform.geminilake)
|
||||
return;
|
||||
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
/* Panel commands can be sent when clock is in LP11 */
|
||||
intel_de_write(display, MIPI_DEVICE_READY(display, port), 0x0);
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
|
||||
if (display->platform.geminilake || display->platform.broxton)
|
||||
bxt_dsi_reset_clocks(encoder, port);
|
||||
else
|
||||
vlv_dsi_reset_clocks(encoder, port);
|
||||
@@ -1596,8 +1589,8 @@ static void vlv_dsi_add_properties(struct intel_connector *connector)
|
||||
|
||||
static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev);
|
||||
struct intel_connector *connector = intel_dsi->attached_connector;
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
struct mipi_config *mipi_config = connector->panel.vbt.dsi.config;
|
||||
u32 tlpx_ns, extra_byte_count, tlpx_ui;
|
||||
u32 ui_num, ui_den;
|
||||
@@ -1645,7 +1638,7 @@ static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
|
||||
* For GEMINILAKE dphy_param_reg will be programmed in terms of
|
||||
* HS byte clock count for other platform in HS ddr clock count
|
||||
*/
|
||||
mul = IS_GEMINILAKE(dev_priv) ? 8 : 2;
|
||||
mul = display->platform.geminilake ? 8 : 2;
|
||||
ths_prepare_ns = max(mipi_config->ths_prepare,
|
||||
mipi_config->tclk_prepare);
|
||||
|
||||
@@ -1653,7 +1646,7 @@ static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
|
||||
prepare_cnt = DIV_ROUND_UP(ths_prepare_ns * ui_den, ui_num * mul);
|
||||
|
||||
if (prepare_cnt > PREPARE_CNT_MAX) {
|
||||
drm_dbg_kms(&dev_priv->drm, "prepare count too high %u\n",
|
||||
drm_dbg_kms(display->drm, "prepare count too high %u\n",
|
||||
prepare_cnt);
|
||||
prepare_cnt = PREPARE_CNT_MAX;
|
||||
}
|
||||
@@ -1674,7 +1667,7 @@ static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
|
||||
exit_zero_cnt += 1;
|
||||
|
||||
if (exit_zero_cnt > EXIT_ZERO_CNT_MAX) {
|
||||
drm_dbg_kms(&dev_priv->drm, "exit zero count too high %u\n",
|
||||
drm_dbg_kms(display->drm, "exit zero count too high %u\n",
|
||||
exit_zero_cnt);
|
||||
exit_zero_cnt = EXIT_ZERO_CNT_MAX;
|
||||
}
|
||||
@@ -1685,7 +1678,7 @@ static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
|
||||
* ui_den, ui_num * mul);
|
||||
|
||||
if (clk_zero_cnt > CLK_ZERO_CNT_MAX) {
|
||||
drm_dbg_kms(&dev_priv->drm, "clock zero count too high %u\n",
|
||||
drm_dbg_kms(display->drm, "clock zero count too high %u\n",
|
||||
clk_zero_cnt);
|
||||
clk_zero_cnt = CLK_ZERO_CNT_MAX;
|
||||
}
|
||||
@@ -1695,7 +1688,7 @@ static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
|
||||
trail_cnt = DIV_ROUND_UP(tclk_trail_ns * ui_den, ui_num * mul);
|
||||
|
||||
if (trail_cnt > TRAIL_CNT_MAX) {
|
||||
drm_dbg_kms(&dev_priv->drm, "trail count too high %u\n",
|
||||
drm_dbg_kms(display->drm, "trail count too high %u\n",
|
||||
trail_cnt);
|
||||
trail_cnt = TRAIL_CNT_MAX;
|
||||
}
|
||||
@@ -1761,7 +1754,7 @@ static void vlv_dphy_param_init(struct intel_dsi *intel_dsi)
|
||||
|
||||
int vlv_dsi_min_cdclk(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
|
||||
struct intel_display *display = to_intel_display(crtc_state);
|
||||
|
||||
if (!intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DSI))
|
||||
return 0;
|
||||
@@ -1770,7 +1763,7 @@ int vlv_dsi_min_cdclk(const struct intel_crtc_state *crtc_state)
|
||||
* On Valleyview some DSI panels lose (v|h)sync when the clock is lower
|
||||
* than 320000KHz.
|
||||
*/
|
||||
if (IS_VALLEYVIEW(dev_priv))
|
||||
if (display->platform.valleyview)
|
||||
return 320000;
|
||||
|
||||
/*
|
||||
@@ -1778,7 +1771,7 @@ int vlv_dsi_min_cdclk(const struct intel_crtc_state *crtc_state)
|
||||
* picture gets unstable, despite that values are
|
||||
* correct for DSI PLL and DE PLL.
|
||||
*/
|
||||
if (IS_GEMINILAKE(dev_priv))
|
||||
if (display->platform.geminilake)
|
||||
return 158400;
|
||||
|
||||
return 0;
|
||||
@@ -1903,9 +1896,8 @@ static const struct dmi_system_id vlv_dsi_dmi_quirk_table[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
void vlv_dsi_init(struct drm_i915_private *dev_priv)
|
||||
void vlv_dsi_init(struct intel_display *display)
|
||||
{
|
||||
struct intel_display *display = &dev_priv->display;
|
||||
struct intel_dsi *intel_dsi;
|
||||
struct intel_encoder *encoder;
|
||||
struct intel_connector *connector;
|
||||
@@ -1914,16 +1906,16 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
|
||||
enum port port;
|
||||
enum pipe pipe;
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "\n");
|
||||
drm_dbg_kms(display->drm, "\n");
|
||||
|
||||
/* There is no detection method for MIPI so rely on VBT */
|
||||
if (!intel_bios_is_dsi_present(display, &port))
|
||||
return;
|
||||
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
|
||||
dev_priv->display.dsi.mmio_base = BXT_MIPI_BASE;
|
||||
if (display->platform.geminilake || display->platform.broxton)
|
||||
display->dsi.mmio_base = BXT_MIPI_BASE;
|
||||
else
|
||||
dev_priv->display.dsi.mmio_base = VLV_MIPI_BASE;
|
||||
display->dsi.mmio_base = VLV_MIPI_BASE;
|
||||
|
||||
intel_dsi = kzalloc(sizeof(*intel_dsi), GFP_KERNEL);
|
||||
if (!intel_dsi)
|
||||
@@ -1938,12 +1930,12 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
|
||||
encoder = &intel_dsi->base;
|
||||
intel_dsi->attached_connector = connector;
|
||||
|
||||
drm_encoder_init(&dev_priv->drm, &encoder->base, &intel_dsi_funcs,
|
||||
drm_encoder_init(display->drm, &encoder->base, &intel_dsi_funcs,
|
||||
DRM_MODE_ENCODER_DSI, "DSI %c", port_name(port));
|
||||
|
||||
encoder->compute_config = intel_dsi_compute_config;
|
||||
encoder->pre_enable = intel_dsi_pre_enable;
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
|
||||
if (display->platform.geminilake || display->platform.broxton)
|
||||
encoder->enable = bxt_dsi_enable;
|
||||
encoder->disable = intel_dsi_disable;
|
||||
encoder->post_disable = intel_dsi_post_disable;
|
||||
@@ -1963,7 +1955,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
|
||||
* On BYT/CHV, pipe A maps to MIPI DSI port A, pipe B maps to MIPI DSI
|
||||
* port C. BXT isn't limited like this.
|
||||
*/
|
||||
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
|
||||
if (display->platform.geminilake || display->platform.broxton)
|
||||
encoder->pipe_mask = ~0;
|
||||
else if (port == PORT_A)
|
||||
encoder->pipe_mask = BIT(PIPE_A);
|
||||
@@ -1979,10 +1971,10 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
|
||||
else
|
||||
intel_dsi->ports = BIT(port);
|
||||
|
||||
if (drm_WARN_ON(&dev_priv->drm, connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports))
|
||||
if (drm_WARN_ON(display->drm, connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports))
|
||||
connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports;
|
||||
|
||||
if (drm_WARN_ON(&dev_priv->drm, connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports))
|
||||
if (drm_WARN_ON(display->drm, connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports))
|
||||
connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports;
|
||||
|
||||
/* Create a DSI host (and a device) for each port. */
|
||||
@@ -1998,18 +1990,18 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
|
||||
}
|
||||
|
||||
if (!intel_dsi_vbt_init(intel_dsi, MIPI_DSI_GENERIC_PANEL_ID)) {
|
||||
drm_dbg_kms(&dev_priv->drm, "no device found\n");
|
||||
drm_dbg_kms(display->drm, "no device found\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Use clock read-back from current hw-state for fastboot */
|
||||
current_mode = intel_encoder_current_mode(encoder);
|
||||
if (current_mode) {
|
||||
drm_dbg_kms(&dev_priv->drm, "Calculated pclk %d GOP %d\n",
|
||||
drm_dbg_kms(display->drm, "Calculated pclk %d GOP %d\n",
|
||||
intel_dsi->pclk, current_mode->clock);
|
||||
if (intel_fuzzy_clock_check(intel_dsi->pclk,
|
||||
current_mode->clock)) {
|
||||
drm_dbg_kms(&dev_priv->drm, "Using GOP pclk\n");
|
||||
drm_dbg_kms(display->drm, "Using GOP pclk\n");
|
||||
intel_dsi->pclk = current_mode->clock;
|
||||
}
|
||||
|
||||
@@ -2021,7 +2013,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
|
||||
intel_dsi_vbt_gpio_init(intel_dsi,
|
||||
intel_dsi_get_hw_state(encoder, &pipe));
|
||||
|
||||
drm_connector_init(&dev_priv->drm, &connector->base, &intel_dsi_connector_funcs,
|
||||
drm_connector_init(display->drm, &connector->base, &intel_dsi_connector_funcs,
|
||||
DRM_MODE_CONNECTOR_DSI);
|
||||
|
||||
drm_connector_helper_add(&connector->base, &intel_dsi_connector_helper_funcs);
|
||||
@@ -2030,12 +2022,12 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
|
||||
|
||||
intel_connector_attach_encoder(connector, encoder);
|
||||
|
||||
mutex_lock(&dev_priv->drm.mode_config.mutex);
|
||||
mutex_lock(&display->drm->mode_config.mutex);
|
||||
intel_panel_add_vbt_lfp_fixed_mode(connector);
|
||||
mutex_unlock(&dev_priv->drm.mode_config.mutex);
|
||||
mutex_unlock(&display->drm->mode_config.mutex);
|
||||
|
||||
if (!intel_panel_preferred_fixed_mode(connector)) {
|
||||
drm_dbg_kms(&dev_priv->drm, "no fixed mode\n");
|
||||
drm_dbg_kms(display->drm, "no fixed mode\n");
|
||||
goto err_cleanup_connector;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user