drm/i915: Baytrail MIPI DSI support
Subsystems (3)
cover drm/i915: Baytrail MIPI DSI support
Hi all -
This series adds rudimentary MIPI DSI support to Baytrail. It's been built around the idea of panel specific sub-encoders, similar to the DVO support we have. This work is by no means complete; there are plenty of rough edges, but it should be a somewhat sane start to build upon.
I'm aware of the Common Display Framework and drm_bridge patches. In the future, I expect our DSI support to be ported over to whatever eventually comes out of them. In the mean time, we can't wait for them to be completed, and I believe it would be helpful for that effort to have our bits and pieces upstream.
The last patch is provided as an (incomplete) example of a sub-encoder, or a panel driver. It should *not* be merged. There's no proper detection or VBT handling yet, so that will cause warnings about inconsistent crtc/pll states...
BR,
Jani.
Jani Nikula (9):
drm/i915: add more VLV IOSF sideband ports accessors drm/i915: add VLV pipeconf bit definition for DSI PLL lock drm/i915: add MIPI DSI register definitions drm/i915: add MIPI DSI output type and subtypes drm/i915: add structs for MIPI DSI output drm/i915: add MIPI DSI command sending routines drm/i915: add basic MIPI DSI output support drm/i915: don't enable DPLL for DSI
drm/i915: initialize DSI output on VLV
Shobhit Kumar (4):
drm: add MIPI DSI encoder and connector types
drm/i915: Band Gap WA
drm/i915: Parse the MIPI related VBT Block and store relevant info drm/i915: add AUO MIPI DSI display sub-encoder
ymohanma (1):
drm/i915: add VLV DSI PLL Calculations
drivers/gpu/drm/drm_crtc.c | 2 + drivers/gpu/drm/i915/Makefile | 4 + drivers/gpu/drm/i915/auo_dsi_display.c | 182 ++++++++++ drivers/gpu/drm/i915/i915_drv.h | 13 + drivers/gpu/drm/i915/i915_reg.h | 424 ++++++++++++++++++++++ drivers/gpu/drm/i915/intel_bios.c | 16 + drivers/gpu/drm/i915/intel_bios.h | 41 +++ drivers/gpu/drm/i915/intel_display.c | 52 ++- drivers/gpu/drm/i915/intel_drv.h | 7 +- drivers/gpu/drm/i915/intel_dsi.c | 606 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dsi.h | 104 ++++++ drivers/gpu/drm/i915/intel_dsi_cmd.c | 442 +++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dsi_cmd.h | 109 ++++++ drivers/gpu/drm/i915/intel_dsi_pll.c | 290 +++++++++++++++ drivers/gpu/drm/i915/intel_sideband.c | 56 +++ include/uapi/drm/drm_mode.h | 2 + 16 files changed, 2330 insertions(+), 20 deletions(-) create mode 100644 drivers/gpu/drm/i915/auo_dsi_display.c create mode 100644 drivers/gpu/drm/i915/intel_dsi.c create mode 100644 drivers/gpu/drm/i915/intel_dsi.h create mode 100644 drivers/gpu/drm/i915/intel_dsi_cmd.c create mode 100644 drivers/gpu/drm/i915/intel_dsi_cmd.h create mode 100644 drivers/gpu/drm/i915/intel_dsi_pll.c
Signature · 1 line
1.7.9.5
PATCH 1/14 drm: add MIPI DSI encoder and connector types
From: Shobhit Kumar <[email protected]>
--- drivers/gpu/drm/drm_crtc.c | 2 ++ include/uapi/drm/drm_mode.h | 2 ++ 2 files changed, 4 insertions(+)
drivers/gpu/drm/drm_crtc.c +2 -0
@@ -209,6 +209,7 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] = { DRM_MODE_CONNECTOR_TV, "TV", 0 }, { DRM_MODE_CONNECTOR_eDP, "eDP", 0 }, { DRM_MODE_CONNECTOR_VIRTUAL, "Virtual", 0}, + { DRM_MODE_CONNECTOR_DSI, "DSI", 0}, }; static const struct drm_prop_enum_list drm_encoder_enum_list[] =
@@ -218,6 +219,7 @@ static const struct drm_prop_enum_list drm_encoder_enum_list[] = { DRM_MODE_ENCODER_LVDS, "LVDS" }, { DRM_MODE_ENCODER_TVDAC, "TV" }, { DRM_MODE_ENCODER_VIRTUAL, "Virtual" }, + { DRM_MODE_ENCODER_DSI, "DSI" }, };const char *drm_get_encoder_name (const struct drm_encoder *encoder)
include/uapi/drm/drm_mode.h +2 -0
@@ -165,6 +165,7 @@ struct drm_mode_get_plane_res {#define DRM_MODE_ENCODER_LVDS 3#define DRM_MODE_ENCODER_TVDAC 4#define DRM_MODE_ENCODER_VIRTUAL 5 +#define DRM_MODE_ENCODER_DSI 6struct drm_mode_get_encoder {__u32 encoder_id;
@@ -203,6 +204,7 @@ struct drm_mode_get_encoder {#define DRM_MODE_CONNECTOR_TV 13#define DRM_MODE_CONNECTOR_eDP 14#define DRM_MODE_CONNECTOR_VIRTUAL 15 +#define DRM_MODE_CONNECTOR_DSI 16struct drm_mode_get_connector {
Signature · 1 line
1.7.9.5
PATCH 2/14 drm/i915: add more VLV IOSF sideband ports accessors
In reply to Jani NikulaFor GPIO NC, CCK, CCU, and GPS CORE.
--- drivers/gpu/drm/i915/i915_drv.h | 8 +++++ drivers/gpu/drm/i915/i915_reg.h | 4 +++ drivers/gpu/drm/i915/intel_sideband.c | 56 +++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +8 -0
@@ -2164,6 +2164,14 @@ int sandybridge_pcode_write(struct drm_i915_private *dev_priv, u8 mbox, u32 val)u32 vlv_punit_read (struct drm_i915_private *dev_priv,u8 addr);void vlv_punit_write (struct drm_i915_private *dev_priv,u8 addr,u32 val);u32 vlv_nc_read (struct drm_i915_private *dev_priv,u8 addr); +u32 vlv_gpio_nc_read (struct drm_i915_private *dev_priv,u32 reg); +void vlv_gpio_nc_write (struct drm_i915_private *dev_priv,u32 reg,u32 val); +u32 vlv_cck_read (struct drm_i915_private *dev_priv,u32 reg); +void vlv_cck_write (struct drm_i915_private *dev_priv,u32 reg,u32 val); +u32 vlv_ccu_read (struct drm_i915_private *dev_priv,u32 reg); +void vlv_ccu_write (struct drm_i915_private *dev_priv,u32 reg,u32 val); +u32 vlv_gps_core_read (struct drm_i915_private *dev_priv,u32 reg); +void vlv_gps_core_write (struct drm_i915_private *dev_priv,u32 reg,u32 val);u32 vlv_dpio_read (struct drm_i915_private *dev_priv,int reg);void vlv_dpio_write (struct drm_i915_private *dev_priv,int reg,u32 val); u32 intel_sbi_read(struct drm_i915_private *dev_priv, u16 reg,
drivers/gpu/drm/i915/i915_reg.h +4 -0
@@ -360,6 +360,10 @@#define IOSF_PORT_PUNIT 0x4#define IOSF_PORT_NC 0x11#define IOSF_PORT_DPIO 0x12 +#define IOSF_PORT_GPIO_NC 0x13 +#define IOSF_PORT_CCK 0x14 +#define IOSF_PORT_CCU 0xA9 +#define IOSF_PORT_GPS_CORE 0x48#define VLV_IOSF_DATA (VLV_DISPLAY_BASE + 0x2104)#define VLV_IOSF_ADDR (VLV_DISPLAY_BASE + 0x2108)
drivers/gpu/drm/i915/intel_sideband.c +56 -0
62 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 3/14 drm/i915: add VLV pipeconf bit definition for DSI PLL lock
In reply to Jani Nikula--- drivers/gpu/drm/i915/i915_reg.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2972,6 +2972,7 @@#define PIPECONF_DISABLE 0#define PIPECONF_DOUBLE_WIDE (1<<30)#define I965_PIPECONF_ACTIVE (1<<30) +#define PIPECONF_DSI_PLL_LOCKED (1<<29)/* vlv only */ #define PIPECONF_FRAME_START_DELAY_MASK (3<<27)#define PIPECONF_SINGLE_WIDE 0#define PIPECONF_PIPE_UNLOCKED 0
Signature · 1 line
1.7.9.5
PATCH 4/14 drm/i915: add MIPI DSI register definitions
In reply to Jani NikulaAdd definitions for VLV MIPI DSI registers.
--- drivers/gpu/drm/i915/i915_reg.h | 409 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 409 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +409 -0
@@ -5104,4 +5104,413 @@#define PIPE_CSC_POSTOFF_ME (pipe) _PIPE(pipe, _PIPE_A_CSC_POSTOFF_ME, _PIPE_B_CSC_POSTOFF_ME)#define PIPE_CSC_POSTOFF_LO (pipe) _PIPE(pipe, _PIPE_A_CSC_POSTOFF_LO, _PIPE_B_CSC_POSTOFF_LO) +/* VLV MIPI registers */ + +/* XXX: This register seems very messy. MIPIB has only enable and delay. */ +#define _MIPIA_PORT_CTRL (VLV_DISPLAY_BASE + 0x61190) +#define _MIPIB_PORT_CTRL (VLV_DISPLAY_BASE + 0x61700) +#define MIPI_PORT_CTRL (pipe) _PIPE(pipe, _MIPIA_PORT_CTRL, _MIPIB_PORT_CTRL) +#define DPI_ENABLE (1 << 31)/* A + B */ +#define MIPIA_MIPI4DPHY_DELAY_COUNT_SHIFT 27 +#define MIPIA_MIPI4DPHY_DELAY_COUNT_MASK (0xf << 27) +#define DUAL_LINK_MODE_MASK (1 << 26) +#define DUAL_LINK_MODE_FRONT_BACK (0 << 26) +#define DUAL_LINK_MODE_PIXEL_ALTERNATIVE (1 << 26) +#define FLOPPED_HSTX (1 << 23) +#define DE_INVERT (1 << 19)/* XXX */ +#define MIPIA_FLISDSI_DELAY_COUNT_SHIFT 18 +#define MIPIA_FLISDSI_DELAY_COUNT_MASK (0xf << 18) +#define AFE_LATCHOUT (1 << 17) +#define MIPIB_FLISDSI_DELAY_COUNT_HIGH_SHIFT 15 +#define MIPIB_FLISDSI_DELAY_COUNT_HIGH_MASK (1 << 15) +#define MIPIB_MIPI4DPHY_DELAY_COUNT_SHIFT 11 +#define MIPIB_MIPI4DPHY_DELAY_COUNT_MASK (0xf << 11) +#define CSB_SHIFT 9 +#define CSB_MASK (3 << 9) +#define CSB_20MHZ (0 << 9) +#define CSB_10MHZ (1 << 9) +#define CSB_40MHZ (2 << 9) +#define BANDGAP_MASK (1 << 8) +#define BANDGAP_PNW_CIRCUIT (0 << 8) +#define BANDGAP_LNC_CIRCUIT (1 << 8) +#define MIPIB_FLISDSI_DELAY_COUNT_LOW_SHIFT 5 +#define MIPIB_FLISDSI_DELAY_COUNT_LOW_MASK (7 << 5) +#define TEARING_EFFECT_DELAY (1 << 4)/* A + B */ +#define TEARING_EFFECT_SHIFT 2/* A + B */ +#define TEARING_EFFECT_MASK (3 << 2) +#define TEARING_EFFECT_OFF (0 << 2) +#define TEARING_EFFECT_DSI (1 << 2) +#define TEARING_EFFECT_GPIO (2 << 2) +#define LANE_CONFIGURATION_SHIFT 0 +#define LANE_CONFIGURATION_MASK (3 << 0) +#define LANE_CONFIGURATION_4LANE (0 << 0) +#define LANE_CONFIGURATION_DUAL_LINK_A (1 << 0) +#define LANE_CONFIGURATION_DUAL_LINK_B (2 << 0) + +#define _MIPIA_TEARING_CTRL (VLV_DISPLAY_BASE + 0x61194) +#define _MIPIB_TEARING_CTRL (VLV_DISPLAY_BASE + 0x61704) +#define MIPI_TEARING_CTRL (pipe) _PIPE(pipe, _MIPIA_TEARING_CTRL, _MIPIB_TEARING_CTRL) +#define TEARING_EFFECT_DELAY_SHIFT 0 +#define TEARING_EFFECT_DELAY_MASK (0xffff << 0) + +/* XXX */ +#define _MIPIA_AUTOPWG (VLV_DISPLAY_BASE + 0x611a0) + +/* MIPI DSI Controller and D-PHY registers */ + +#define _MIPIA_DEVICE_READY (VLV_DISPLAY_BASE + 0xb000) +#define _MIPIB_DEVICE_READY (VLV_DISPLAY_BASE + 0xb800) +#define MIPI_DEVICE_READY (pipe) _PIPE(pipe, _MIPIA_DEVICE_READY, _MIPIB_DEVICE_READY) +#define BUS_POSSESSION (1 << 3)/* set to give bus to receiver */ +#define ULPS_STATE_MASK (3 << 1) +#define ULPS_STATE_ENTER (2 << 1)/* XXX */ +#define ULPS_STATE_EXIT (1 << 1)/* XXX */ +#define DEVICE_READY (1 << 0) + +#define _MIPIA_INTR_STAT (VLV_DISPLAY_BASE + 0xb004) +#define _MIPIB_INTR_STAT (VLV_DISPLAY_BASE + 0xb804) +#define MIPI_INTR_STAT (pipe) _PIPE(pipe, _MIPIA_INTR_STAT, _MIPIB_INTR_STAT) +#define _MIPIA_INTR_EN (VLV_DISPLAY_BASE + 0xb008) +#define _MIPIB_INTR_EN (VLV_DISPLAY_BASE + 0xb808) +#define MIPI_INTR_EN (pipe) _PIPE(pipe, _MIPIA_INTR_EN, _MIPIB_INTR_EN) +#define TEARING_EFFECT (1 << 31) +#define SPL_PKT_SENT_INTERRUPT (1 << 30) +#define GEN_READ_DATA_AVAIL (1 << 29) +#define LP_GENERIC_WR_FIFO_FULL (1 << 28) +#define HS_GENERIC_WR_FIFO_FULL (1 << 27) +#define RX_PROT_VIOLATION (1 << 26) +#define RX_INVALID_TX_LENGTH (1 << 25) +#define ACK_WITH_NO_ERROR (1 << 24) +#define TURN_AROUND_ACK_TIMEOUT (1 << 23) +#define LP_RX_TIMEOUT (1 << 22) +#define HS_TX_TIMEOUT (1 << 21) +#define DPI_FIFO_UNDERRUN (1 << 20) +#define LOW_CONTENTION (1 << 19) +#define HIGH_CONTENTION (1 << 18) +#define TXDSI_VC_ID_INVALID (1 << 17) +#define TXDSI_DATA_TYPE_NOT_RECOGNISED (1 << 16) +#define TXCHECKSUM_ERROR (1 << 15) +#define TXECC_MULTIBIT_ERROR (1 << 14) +#define TXECC_SINGLE_BIT_ERROR (1 << 13) +#define TXFALSE_CONTROL_ERROR (1 << 12) +#define RXDSI_VC_ID_INVALID (1 << 11) +#define RXDSI_DATA_TYPE_NOT_REGOGNISED (1 << 10) +#define RXCHECKSUM_ERROR (1 << 9) +#define RXECC_MULTIBIT_ERROR (1 << 8) +#define RXECC_SINGLE_BIT_ERROR (1 << 7) +#define RXFALSE_CONTROL_ERROR (1 << 6) +#define RXHS_RECEIVE_TIMEOUT_ERROR (1 << 5) +#define RX_LP_TX_SYNC_ERROR (1 << 4) +#define RXEXCAPE_MODE_ENTRY_ERROR (1 << 3) +#define RXEOT_SYNC_ERROR (1 << 2) +#define RXSOT_SYNC_ERROR (1 << 1) +#define RXSOT_ERROR (1 << 0) + +#define _MIPIA_DSI_FUNC_PRG (VLV_DISPLAY_BASE + 0xb00c) +#define _MIPIB_DSI_FUNC_PRG (VLV_DISPLAY_BASE + 0xb80c) +#define MIPI_DSI_FUNC_PRG (pipe) _PIPE(pipe, _MIPIA_DSI_FUNC_PRG, _MIPIB_DSI_FUNC_PRG) +#define CMD_MODE_DATA_WIDTH_MASK (7 << 13) +#define CMD_MODE_NOT_SUPPORTED (0 << 13) +#define CMD_MODE_DATA_WIDTH_16_BIT (1 << 13) +#define CMD_MODE_DATA_WIDTH_9_BIT (2 << 13) +#define CMD_MODE_DATA_WIDTH_8_BIT (3 << 13) +#define CMD_MODE_DATA_WIDTH_OPTION1 (4 << 13) +#define CMD_MODE_DATA_WIDTH_OPTION2 (5 << 13) +#define VID_MODE_FORMAT_MASK (0xf << 7) +#define VID_MODE_NOT_SUPPORTED (0 << 7) +#define VID_MODE_FORMAT_RGB565 (1 << 7) +#define VID_MODE_FORMAT_RGB666 (2 << 7) +#define VID_MODE_FORMAT_RGB666_LOOSE (3 << 7) +#define VID_MODE_FORMAT_RGB888 (4 << 7) +#define CMD_MODE_CHANNEL_NUMBER_SHIFT 5 +#define CMD_MODE_CHANNEL_NUMBER_MASK (3 << 5) +#define VID_MODE_CHANNEL_NUMBER_SHIFT 3 +#define VID_MODE_CHANNEL_NUMBER_MASK (3 << 3) +#define DATA_LANES_PRG_REG_SHIFT 0 +#define DATA_LANES_PRG_REG_MASK (7 << 0) + +#define _MIPIA_HS_TX_TIMEOUT (VLV_DISPLAY_BASE + 0xb010) +#define _MIPIB_HS_TX_TIMEOUT (VLV_DISPLAY_BASE + 0xb810) +#define MIPI_HS_TX_TIMEOUT (pipe) _PIPE(pipe, _MIPIA_HS_TX_TIMEOUT, _MIPIB_HS_TX_TIMEOUT) +#define HIGH_SPEED_TX_TIMEOUT_COUNTER_MASK 0xffffff + +#define _MIPIA_LP_RX_TIMEOUT (VLV_DISPLAY_BASE + 0xb014) +#define _MIPIB_LP_RX_TIMEOUT (VLV_DISPLAY_BASE + 0xb814) +#define MIPI_LP_RX_TIMEOUT (pipe) _PIPE(pipe, _MIPIA_LP_RX_TIMEOUT, _MIPIB_LP_RX_TIMEOUT) +#define LOW_POWER_RX_TIMEOUT_COUNTER_MASK 0xffffff + +#define _MIPIA_TURN_AROUND_TIMEOUT (VLV_DISPLAY_BASE + 0xb018) +#define _MIPIB_TURN_AROUND_TIMEOUT (VLV_DISPLAY_BASE + 0xb818) +#define MIPI_TURN_AROUND_TIMEOUT (pipe) _PIPE(pipe, _MIPIA_TURN_AROUND_TIMEOUT, _MIPIB_TURN_AROUND_TIMEOUT) +#define TURN_AROUND_TIMEOUT_MASK 0x3f + +#define _MIPIA_DEVICE_RESET_TIMER (VLV_DISPLAY_BASE + 0xb01c) +#define _MIPIB_DEVICE_RESET_TIMER (VLV_DISPLAY_BASE + 0xb81c) +#define MIPI_DEVICE_RESET_TIMER (pipe) _PIPE(pipe, _MIPIA_DEVICE_RESET_TIMER, _MIPIB_DEVICE_RESET_TIMER) +#define DEVICE_RESET_TIMER_MASK 0xffff + +#define _MIPIA_DPI_RESOLUTION (VLV_DISPLAY_BASE + 0xb020) +#define _MIPIB_DPI_RESOLUTION (VLV_DISPLAY_BASE + 0xb820) +#define MIPI_DPI_RESOLUTION (pipe) _PIPE(pipe, _MIPIA_DPI_RESOLUTION, _MIPIB_DPI_RESOLUTION) +#define VERTICAL_ADDRESS_SHIFT 16 +#define VERTICAL_ADDRESS_MASK (0xffff << 16) +#define HORIZONTAL_ADDRESS_SHIFT 0 +#define HORIZONTAL_ADDRESS_MASK 0xffff + +/* XXX */ +#define _MIPIA_DBI_FIFO_THROTTLE (VLV_DISPLAY_BASE + 0xb024) +#define _MIPIB_DBI_FIFO_THROTTLE (VLV_DISPLAY_BASE + 0xb824) +#define MIPI_DBI_FIFO_THROTTLE (pipe) _PIPE(pipe, _MIPIA_DBI_FIFO_THROTTLE, _MIPIB_DBI_FIFO_THROTTLE) +#define DBI_FIFO_EMPTY_HALF (0 << 0) +#define DBI_FIFO_EMPTY_QUARTER (1 << 0) +#define DBI_FIFO_EMPTY_7_LOCATIONS (2 << 0) + +/* regs below are bits 15:0 */ +#define _MIPIA_HSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb028) +#define _MIPIB_HSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb828) +#define MIPI_HSYNC_PADDING_COUNT (pipe) _PIPE(pipe, _MIPIA_HSYNC_PADDING_COUNT, _MIPIB_HSYNC_PADDING_COUNT) + +#define _MIPIA_HBP_COUNT (VLV_DISPLAY_BASE + 0xb02c) +#define _MIPIB_HBP_COUNT (VLV_DISPLAY_BASE + 0xb82c) +#define MIPI_HBP_COUNT (pipe) _PIPE(pipe, _MIPIA_HBP_COUNT, _MIPIB_HBP_COUNT) + +#define _MIPIA_HFP_COUNT (VLV_DISPLAY_BASE + 0xb030) +#define _MIPIB_HFP_COUNT (VLV_DISPLAY_BASE + 0xb830) +#define MIPI_HFP_COUNT (pipe) _PIPE(pipe, _MIPIA_HFP_COUNT, _MIPIB_HFP_COUNT) + +#define _MIPIA_HACTIVE_AREA_COUNT (VLV_DISPLAY_BASE + 0xb034) +#define _MIPIB_HACTIVE_AREA_COUNT (VLV_DISPLAY_BASE + 0xb834) +#define MIPI_HACTIVE_AREA_COUNT (pipe) _PIPE(pipe, _MIPIA_HACTIVE_AREA_COUNT, _MIPIB_HACTIVE_AREA_COUNT) + +#define _MIPIA_VSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb038) +#define _MIPIB_VSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb838) +#define MIPI_VSYNC_PADDING_COUNT (pipe) _PIPE(pipe, _MIPIA_VSYNC_PADDING_COUNT, _MIPIB_VSYNC_PADDING_COUNT) + +#define _MIPIA_VBP_COUNT (VLV_DISPLAY_BASE + 0xb03c) +#define _MIPIB_VBP_COUNT (VLV_DISPLAY_BASE + 0xb83c) +#define MIPI_VBP_COUNT (pipe) _PIPE(pipe, _MIPIA_VBP_COUNT, _MIPIB_VBP_COUNT) + +#define _MIPIA_VFP_COUNT (VLV_DISPLAY_BASE + 0xb040) +#define _MIPIB_VFP_COUNT (VLV_DISPLAY_BASE + 0xb840) +#define MIPI_VFP_COUNT (pipe) _PIPE(pipe, _MIPIA_VFP_COUNT, _MIPIB_VFP_COUNT) + +#define _MIPIA_HIGH_LOW_SWITCH_COUNT (VLV_DISPLAY_BASE + 0xb044) +#define _MIPIB_HIGH_LOW_SWITCH_COUNT (VLV_DISPLAY_BASE + 0xb844) +#define MIPI_HIGH_LOW_SWITCH_COUNT (pipe) _PIPE(pipe, _MIPIA_HIGH_LOW_SWITCH_COUNT, _MIPIB_HIGH_LOW_SWITCH_COUNT) +/* regs above are bits 15:0 */ + +#define _MIPIA_DPI_CONTROL (VLV_DISPLAY_BASE + 0xb048) +#define _MIPIB_DPI_CONTROL (VLV_DISPLAY_BASE + 0xb848) +#define MIPI_DPI_CONTROL (pipe) _PIPE(pipe, _MIPIA_DPI_CONTROL, _MIPIB_DPI_CONTROL) +#define DPI_HS_MODE (1 << 6) +#define BACKLIGHT_OFF (1 << 5) +#define BACKLIGHT_ON (1 << 4) +#define COLOR_MODE_OFF (1 << 3) +#define COLOR_MODE_ON (1 << 2) +#define TURN_ON (1 << 1) +#define SHUTDOWN (1 << 0) + +#define _MIPIA_DPI_DATA (VLV_DISPLAY_BASE + 0xb04c) +#define _MIPIB_DPI_DATA (VLV_DISPLAY_BASE + 0xb84c) +#define MIPI_DPI_DATA (pipe) _PIPE(pipe, _MIPIA_DPI_DATA, _MIPIB_DPI_DATA) +#define COMMAND_BYTE_SHIFT 0 +#define COMMAND_BYTE_MASK (0x3f << 0) + +#define _MIPIA_INIT_COUNT (VLV_DISPLAY_BASE + 0xb050) +#define _MIPIB_INIT_COUNT (VLV_DISPLAY_BASE + 0xb850) +#define MIPI_INIT_COUNT (pipe) _PIPE(pipe, _MIPIA_INIT_COUNT, _MIPIB_INIT_COUNT) +#define MASTER_INIT_TIMER_SHIFT 0 +#define MASTER_INIT_TIMER_MASK (0xffff << 0) + +#define _MIPIA_MAX_RETURN_PKT_SIZE (VLV_DISPLAY_BASE + 0xb054) +#define _MIPIB_MAX_RETURN_PKT_SIZE (VLV_DISPLAY_BASE + 0xb854) +#define MIPI_MAX_RETURN_PKT_SIZE (pipe) _PIPE(pipe, _MIPIA_MAX_RETURN_PKT_SIZE, _MIPIB_MAX_RETURN_PKT_SIZE) +#define MAX_RETURN_PKT_SIZE_SHIFT 0 +#define MAX_RETURN_PKT_SIZE_MASK (0x3ff << 0) + +#define _MIPIA_VIDEO_MODE_FORMAT (VLV_DISPLAY_BASE + 0xb058) +#define _MIPIB_VIDEO_MODE_FORMAT (VLV_DISPLAY_BASE + 0xb858) +#define MIPI_VIDEO_MODE_FORMAT (pipe) _PIPE(pipe, _MIPIA_VIDEO_MODE_FORMAT, _MIPIB_VIDEO_MODE_FORMAT) +#define RANDOM_DPI_DISPLAY_RESOLUTION (1 << 4) +#define DISABLE_VIDEO_BTA (1 << 3) +#define IP_TG_CONFIG (1 << 2) +#define VIDEO_MODE_NON_BURST_WITH_SYNC_PULSE (1 << 0) +#define VIDEO_MODE_NON_BURST_WITH_SYNC_EVENTS (2 << 0) +#define VIDEO_MODE_BURST (3 << 0) + +#define _MIPIA_EOT_DISABLE (VLV_DISPLAY_BASE + 0xb05c) +#define _MIPIB_EOT_DISABLE (VLV_DISPLAY_BASE + 0xb85c) +#define MIPI_EOT_DISABLE (pipe) _PIPE(pipe, _MIPIA_EOT_DISABLE, _MIPIB_EOT_DISABLE) +#define LP_RX_TIMEOUT_ERROR_RECOVERY_DISABLE (1 << 7) +#define HS_RX_TIMEOUT_ERROR_RECOVERY_DISABLE (1 << 6) +#define LOW_CONTENTION_RECOVERY_DISABLE (1 << 5) +#define HIGH_CONTENTION_RECOVERY_DISABLE (1 << 4) +#define TXDSI_TYPE_NOT_RECOGNISED_ERROR_RECOVERY_DISABLE (1 << 3) +#define TXECC_MULTIBIT_ERROR_RECOVERY_DISABLE (1 << 2) +#define CLOCKSTOP (1 << 1) +#define EOT_DISABLE (1 << 0) + +#define _MIPIA_LP_BYTECLK (VLV_DISPLAY_BASE + 0xb060) +#define _MIPIB_LP_BYTECLK (VLV_DISPLAY_BASE + 0xb860) +#define MIPI_LP_BYTECLK (pipe) _PIPE(pipe, _MIPIA_LP_BYTECLK, _MIPIB_LP_BYTECLK) +#define LP_BYTECLK_SHIFT 0 +#define LP_BYTECLK_MASK (0xffff << 0) + +/* bits 31:0 */ +#define _MIPIA_LP_GEN_DATA (VLV_DISPLAY_BASE + 0xb064) +#define _MIPIB_LP_GEN_DATA (VLV_DISPLAY_BASE + 0xb864) +#define MIPI_LP_GEN_DATA (pipe) _PIPE(pipe, _MIPIA_LP_GEN_DATA, _MIPIB_LP_GEN_DATA) + +/* bits 31:0 */ +#define _MIPIA_HS_GEN_DATA (VLV_DISPLAY_BASE + 0xb068) +#define _MIPIB_HS_GEN_DATA (VLV_DISPLAY_BASE + 0xb868) +#define MIPI_HS_GEN_DATA (pipe) _PIPE(pipe, _MIPIA_HS_GEN_DATA, _MIPIB_HS_GEN_DATA) + +#define _MIPIA_LP_GEN_CTRL (VLV_DISPLAY_BASE + 0xb06c) +#define _MIPIB_LP_GEN_CTRL (VLV_DISPLAY_BASE + 0xb86c) +#define MIPI_LP_GEN_CTRL (pipe) _PIPE(pipe, _MIPIA_LP_GEN_CTRL, _MIPIB_LP_GEN_CTRL) +#define _MIPIA_HS_GEN_CTRL (VLV_DISPLAY_BASE + 0xb070) +#define _MIPIB_HS_GEN_CTRL (VLV_DISPLAY_BASE + 0xb870) +#define MIPI_HS_GEN_CTRL (pipe) _PIPE(pipe, _MIPIA_HS_GEN_CTRL, _MIPIB_HS_GEN_CTRL) +#define LONG_PACKET_WORD_COUNT_SHIFT 8 +#define LONG_PACKET_WORD_COUNT_MASK (0xffff << 8) +#define SHORT_PACKET_PARAM_SHIFT 8 +#define SHORT_PACKET_PARAM_MASK (0xffff << 8) +#define VIRTUAL_CHANNEL_SHIFT 6 +#define VIRTUAL_CHANNEL_MASK (3 << 6) +#define DATA_TYPE_SHIFT 0 +#define DATA_TYPE_MASK (3f << 0) +/* data type values, see include/video/mipi_display.h */ + +#define _MIPIA_GEN_FIFO_STAT (VLV_DISPLAY_BASE + 0xb074) +#define _MIPIB_GEN_FIFO_STAT (VLV_DISPLAY_BASE + 0xb874) +#define MIPI_GEN_FIFO_STAT (pipe) _PIPE(pipe, _MIPIA_GEN_FIFO_STAT, _MIPIB_GEN_FIFO_STAT) +#define DPI_FIFO_EMPTY (1 << 28) +#define DBI_FIFO_EMPTY (1 << 27) +#define LP_CTRL_FIFO_EMPTY (1 << 26) +#define LP_CTRL_FIFO_HALF_EMPTY (1 << 25) +#define LP_CTRL_FIFO_FULL (1 << 24) +#define HS_CTRL_FIFO_EMPTY (1 << 18) +#define HS_CTRL_FIFO_HALF_EMPTY (1 << 17) +#define HS_CTRL_FIFO_FULL (1 << 16) +#define LP_DATA_FIFO_EMPTY (1 << 10) +#define LP_DATA_FIFO_HALF_EMPTY (1 << 9) +#define LP_DATA_FIFO_FULL (1 << 8) +#define HS_DATA_FIFO_EMPTY (1 << 2) +#define HS_DATA_FIFO_HALF_EMPTY (1 << 1) +#define HS_DATA_FIFO_FULL (1 << 0) + +#define _MIPIA_HS_LS_DBI_ENABLE (VLV_DISPLAY_BASE + 0xb078) +#define _MIPIB_HS_LS_DBI_ENABLE (VLV_DISPLAY_BASE + 0xb878) +#define MIPI_HS_LP_DBI_ENABLE (pipe) _PIPE(pipe, _MIPIA_HS_LS_DBI_ENABLE, _MIPIB_HS_LS_DBI_ENABLE) +#define DBI_HS_LP_MODE_MASK (1 << 0) +#define DBI_LP_MODE (1 << 0) +#define DBI_HS_MODE (0 << 0) + +#define _MIPIA_DPHY_PARAM (VLV_DISPLAY_BASE + 0xb080) +#define _MIPIB_DPHY_PARAM (VLV_DISPLAY_BASE + 0xb880) +#define MIPI_DPHY_PARAM (pipe) _PIPE(pipe, _MIPIA_DPHY_PARAM, _MIPIB_DPHY_PARAM) +#define EXIT_ZERO_COUNT_SHIFT 24 +#define EXIT_ZERO_COUNT_MASK (0x3f << 24) +#define TRAIL_COUNT_SHIFT 16 +#define TRAIL_COUNT_MASK (0x1f << 16) +#define CLK_ZERO_COUNT_SHIFT 8 +#define CLK_ZERO_COUNT_MASK (0xff << 8) +#define PREPARE_COUNT_SHIFT 0 +#define PREPARE_COUNT_MASK (0x3f << 0) + +/* bits 31:0 */ +#define _MIPIA_DBI_BW_CTRL (VLV_DISPLAY_BASE + 0xb084) +#define _MIPIB_DBI_BW_CTRL (VLV_DISPLAY_BASE + 0xb884) +#define MIPI_DBI_BW_CTRL (pipe) _PIPE(pipe, _MIPIA_DBI_BW_CTRL, _MIPIB_DBI_BW_CTRL) + +#define _MIPIA_CLK_LANE_SWITCH_TIME_CNT (VLV_DISPLAY_BASE + 0xb088) +#define _MIPIB_CLK_LANE_SWITCH_TIME_CNT (VLV_DISPLAY_BASE + 0xb888) +#define MIPI_CLK_LANE_SWITCH_TIME_CNT (pipe) _PIPE(pipe, _MIPIA_CLK_LANE_SWITCH_TIME_CNT, _MIPIB_CLK_LANE_SWITCH_TIME_CNT) +#define LP_HS_SSW_CNT_SHIFT 16 +#define LP_HS_SSW_CNT_MASK (0xffff << 16) +#define HS_LP_PWR_SW_CNT_SHIFT 0 +#define HS_LP_PWR_SW_CNT_MASK (0xffff << 0) + +#define _MIPIA_STOP_STATE_STALL (VLV_DISPLAY_BASE + 0xb08c) +#define _MIPIB_STOP_STATE_STALL (VLV_DISPLAY_BASE + 0xb88c) +#define MIPI_STOP_STATE_STALL (pipe) _PIPE(pipe, _MIPIA_STOP_STATE_STALL, _MIPIB_STOP_STATE_STALL) +#define STOP_STATE_STALL_COUNTER_SHIFT 0 +#define STOP_STATE_STALL_COUNTER_MASK (0xff << 0) + +#define _MIPIA_INTR_STAT_REG_1 (VLV_DISPLAY_BASE + 0xb090) +#define _MIPIB_INTR_STAT_REG_1 (VLV_DISPLAY_BASE + 0xb890) +#define MIPI_INTR_STAT_REG_1 (pipe) _PIPE(pipe, _MIPIA_INTR_STAT_REG_1, _MIPIB_INTR_STAT_REG_1) +#define _MIPIA_INTR_EN_REG_1 (VLV_DISPLAY_BASE + 0xb094) +#define _MIPIB_INTR_EN_REG_1 (VLV_DISPLAY_BASE + 0xb894) +#define MIPI_INTR_EN_REG_1 (pipe) _PIPE(pipe, _MIPIA_INTR_EN_REG_1, _MIPIB_INTR_EN_REG_1) +#define RX_CONTENTION_DETECTED (1 << 0) + +/* XXX: only pipe A ?!? */ +#define MIPIA_DBI_TYPEC_CTRL (VLV_DISPLAY_BASE + 0xb100) +#define DBI_TYPEC_ENABLE (1 << 31) +#define DBI_TYPEC_WIP (1 << 30) +#define DBI_TYPEC_OPTION_SHIFT 28 +#define DBI_TYPEC_OPTION_MASK (3 << 28) +#define DBI_TYPEC_FREQ_SHIFT 24 +#define DBI_TYPEC_FREQ_MASK (0xf << 24) +#define DBI_TYPEC_OVERRIDE (1 << 8) +#define DBI_TYPEC_OVERRIDE_COUNTER_SHIFT 0 +#define DBI_TYPEC_OVERRIDE_COUNTER_MASK (0xff << 0) + + +/* MIPI adapter registers */ + +#define _MIPIA_CTRL (VLV_DISPLAY_BASE + 0xb104) +#define _MIPIB_CTRL (VLV_DISPLAY_BASE + 0xb904) +#define MIPI_CTRL (pipe) _PIPE(pipe, _MIPIA_CTRL, _MIPIB_CTRL) +#define ESCAPE_CLOCK_DIVIDER_SHIFT 5/* A only */ +#define ESCAPE_CLOCK_DIVIDER_MASK (3 << 5) +#define ESCAPE_CLOCK_DIVIDER_1 (0 << 5) +#define ESCAPE_CLOCK_DIVIDER_2 (1 << 5) +#define ESCAPE_CLOCK_DIVIDER_4 (2 << 5) +#define READ_REQUEST_PRIORITY_SHIFT 3 +#define READ_REQUEST_PRIORITY_MASK (3 << 3) +#define READ_REQUEST_PRIORITY_LOW (0 << 3) +#define READ_REQUEST_PRIORITY_HIGH (3 << 3) +#define RGB_FLIP_TO_BGR (1 << 2) + +#define _MIPIA_DATA_ADDRESS (VLV_DISPLAY_BASE + 0xb108) +#define _MIPIB_DATA_ADDRESS (VLV_DISPLAY_BASE + 0xb908) +#define MIPI_DATA_ADDRESS (pipe) _PIPE(pipe, _MIPIA_DATA_ADDRESS, _MIPIB_DATA_ADDRESS) +#define DATA_MEM_ADDRESS_SHIFT 5 +#define DATA_MEM_ADDRESS_MASK (0x7ffffff << 5) +#define DATA_VALID (1 << 0) + +#define _MIPIA_DATA_LENGTH (VLV_DISPLAY_BASE + 0xb10c) +#define _MIPIB_DATA_LENGTH (VLV_DISPLAY_BASE + 0xb90c) +#define MIPI_DATA_LENGTH (pipe) _PIPE(pipe, _MIPIA_DATA_LENGTH, _MIPIB_DATA_LENGTH) +#define DATA_LENGTH_SHIFT 0 +#define DATA_LENGTH_MASK (0xfffff << 0) + +#define _MIPIA_COMMAND_ADDRESS (VLV_DISPLAY_BASE + 0xb110) +#define _MIPIB_COMMAND_ADDRESS (VLV_DISPLAY_BASE + 0xb910) +#define MIPI_COMMAND_ADDRESS (pipe) _PIPE(pipe, _MIPIA_COMMAND_ADDRESS, _MIPIB_COMMAND_ADDRESS) +#define COMMAND_MEM_ADDRESS_SHIFT 5 +#define COMMAND_MEM_ADDRESS_MASK (0x7ffffff << 5) +#define AUTO_PWG_ENABLE (1 << 2) +#define MEMORY_WRITE_DATA_FROM_PIPE_RENDERING (1 << 1) +#define COMMAND_VALID (1 << 0) + +#define _MIPIA_COMMAND_LENGTH (VLV_DISPLAY_BASE + 0xb114) +#define _MIPIB_COMMAND_LENGTH (VLV_DISPLAY_BASE + 0xb914) +#define MIPI_COMMAND_LENGTH (pipe) _PIPE(pipe, _MIPIA_COMMAND_LENGTH, _MIPIB_COMMAND_LENGTH) +#define COMMAND_LENGTH_SHIFT (n) (8 * (n))/* n: 0...3 */ +#define COMMAND_LENGTH_MASK (n) (0xff << (8 * (n))) + +#define _MIPIA_READ_DATA_RETURN0 (VLV_DISPLAY_BASE + 0xb118) +#define _MIPIB_READ_DATA_RETURN0 (VLV_DISPLAY_BASE + 0xb918) +#define MIPI_READ_DATA_RETURN (pipe, n) \ + (_PIPE(pipe, _MIPIA_READ_DATA_RETURN0, _MIPIB_READ_DATA_RETURN0) + 4 * (n))/* n: 0...7 */ + +#define _MIPIA_READ_DATA_VALID (VLV_DISPLAY_BASE + 0xb138) +#define _MIPIB_READ_DATA_VALID (VLV_DISPLAY_BASE + 0xb938) +#define MIPI_READ_DATA_VALID (pipe) _PIPE(pipe, _MIPIA_READ_DATA_VALID, _MIPIB_READ_DATA_VALID) +#define READ_DATA_VALID (n) (1 << (n)) +#endif /* _I915_REG_H_ */
Signature · 1 line
1.7.9.5
PATCH 5/14 drm/i915: add MIPI DSI output type and subtypes
In reply to Jani Nikula--- drivers/gpu/drm/i915/intel_drv.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_drv.h +5 -1
@@ -93,13 +93,17 @@#define INTEL_OUTPUT_HDMI 6#define INTEL_OUTPUT_DISPLAYPORT 7#define INTEL_OUTPUT_EDP 8 -#define INTEL_OUTPUT_UNKNOWN 9 +#define INTEL_OUTPUT_DSI 9 +#define INTEL_OUTPUT_UNKNOWN 10#define INTEL_DVO_CHIP_NONE 0#define INTEL_DVO_CHIP_LVDS 1#define INTEL_DVO_CHIP_TMDS 2#define INTEL_DVO_CHIP_TVOUT 4 +#define INTEL_DSI_COMMAND_MODE 0 +#define INTEL_DSI_VIDEO_MODE 1 +struct intel_framebuffer {struct drm_framebuffer base;struct drm_i915_gem_object *obj;
Signature · 1 line
1.7.9.5
PATCH 6/14 drm/i915: add structs for MIPI DSI output
In reply to Jani NikulaThe sub-encoder model is copied from DVO.
--- drivers/gpu/drm/i915/intel_dsi.h | 99 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 drivers/gpu/drm/i915/intel_dsi.h
drivers/gpu/drm/i915/intel_dsi.h new file +99 -0
@@ -0,0 +1,99 @@ +/* +* Copyright © 2013 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +*/ + +#ifndef _INTEL_DSI_H +#define _INTEL_DSI_H + +#include <drm/drmP.h> +#include <drm/drm_crtc.h> +#include "intel_drv.h" + +struct intel_dsi_device { +unsigned int panel_id; +const char *name; +int type; +const struct intel_dsi_dev_ops *dev_ops; +void *dev_priv; +}; + +struct intel_dsi_dev_ops { +bool (*init)(struct intel_dsi_device *dsi); + +/* This callback must be able to assume DSI commands can be sent */ +void (*enable)(struct intel_dsi_device *dsi); + +/* This callback must be able to assume DSI commands can be sent */ +void (*disable)(struct intel_dsi_device *dsi); + +int (*mode_valid)(struct intel_dsi_device *dsi, +struct drm_display_mode *mode); + +bool (*mode_fixup)(struct intel_dsi_device *dsi, +const struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode); + +void (*mode_set)(struct intel_dsi_device *dsi, +struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode); + +enum drm_connector_status (*detect)(struct intel_dsi_device *dsi); + +bool (*get_hw_state)(struct intel_dsi_device *dev); + +struct drm_display_mode *(*get_modes)(struct intel_dsi_device *dsi); + +void (*destroy) (struct intel_dsi_device *dsi); +}; + +struct intel_dsi { +struct intel_encoder base; + +struct intel_dsi_device dev; + +struct drm_display_mode *panel_fixed_mode; + +/* if true, use HS mode, otherwise LP */ +bool hs; + +/* virtual channel */ +int channel; + +/* number of DSI lanes */ +unsigned int lane_count; + +/* video mode pixel format for MIPI_DSI_FUNC_PRG register */ +u32 pixel_format; + +/* video mode format for MIPI_VIDEO_MODE_FORMAT register */ +u32 video_mode_format; + +/* eot for MIPI_EOT_DISABLE register */ +u32 eot_disable; +}; + +static inline struct intel_dsi *enc_to_intel_dsi (struct drm_encoder *encoder) +{ + return container_of(encoder, struct intel_dsi, base.base); +} + +#endif /* _INTEL_DSI_H */
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/14 drm/i915: add MIPI DSI command sending routines
In reply to Jani Nikula--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_dsi_cmd.c | 442 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dsi_cmd.h | 109 +++++++++ 3 files changed, 552 insertions(+) create mode 100644 drivers/gpu/drm/i915/intel_dsi_cmd.c create mode 100644 drivers/gpu/drm/i915/intel_dsi_cmd.h
drivers/gpu/drm/i915/Makefile +1 -0
@@ -21,6 +21,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \ intel_display.o \ intel_crt.o \ intel_lvds.o \ + intel_dsi_cmd.o \ intel_bios.o \ intel_ddi.o \ intel_dp.o \
drivers/gpu/drm/i915/intel_dsi_cmd.c new file +442 -0
442 lines not on this page · raw message
drivers/gpu/drm/i915/intel_dsi_cmd.h new file +109 -0
109 lines not on this page · raw message
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/14 drm/i915: add basic MIPI DSI output support
In reply to Jani NikulaThis does not include any panel specific sub-encoders yet.
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_dsi.c | 548 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 550 insertions(+) create mode 100644 drivers/gpu/drm/i915/intel_dsi.c
drivers/gpu/drm/i915/Makefile +1 -0
@@ -21,6 +21,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \ intel_display.o \ intel_crt.o \ intel_lvds.o \ + intel_dsi.o \ intel_dsi_cmd.o \ intel_bios.o \ intel_ddi.o \
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -525,6 +525,7 @@ extern void intel_mark_fb_busy(struct drm_i915_gem_object *obj, struct intel_ring_buffer *ring);extern void intel_mark_idle (struct drm_device *dev);extern void intel_lvds_init (struct drm_device *dev); +extern bool intel_dsi_init (struct drm_device *dev);extern bool intel_is_dual_link_lvds (struct drm_device *dev);extern void intel_dp_init (struct drm_device *dev,int output_reg,enum port port);
drivers/gpu/drm/i915/intel_dsi.c new file +548 -0
548 lines not on this page · raw message
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/14 drm/i915: add VLV DSI PLL Calculations
In reply to Jani NikulaFrom: ymohanma <[email protected]>
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_reg.h | 10 ++ drivers/gpu/drm/i915/intel_display.c | 2 + drivers/gpu/drm/i915/intel_dsi.c | 5 + drivers/gpu/drm/i915/intel_dsi.h | 2 + drivers/gpu/drm/i915/intel_dsi_pll.c | 290 ++++++++++++++++++++++++++++++++++ 6 files changed, 310 insertions(+) create mode 100644 drivers/gpu/drm/i915/intel_dsi_pll.c
drivers/gpu/drm/i915/Makefile +1 -0
@@ -23,6 +23,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \ intel_lvds.o \ intel_dsi.o \ intel_dsi_cmd.o \ + intel_dsi_pll.o \ intel_bios.o \ intel_ddi.o \ intel_dp.o \
drivers/gpu/drm/i915/i915_reg.h +10 -0
@@ -390,6 +390,16 @@#define FB_FMAX_VMIN_FREQ_LO_SHIFT 27#define FB_FMAX_VMIN_FREQ_LO_MASK 0xf8000000 +/* vlv2 north clock has */ +#define CCK_REG_DSI_PLL_FUSE 0x44 +#define CCK_REG_DSI_PLL_CONTROL 0x48 +#define DSI_PLL_VCO_EN (1 << 31) +#define DSI_PLL_LDO_GATE (1 << 30) +#define DSI_PLL_P1_POST_DIV_SHIFT 17 +#define DSI_PLL_P1_POST_DIV_MASK (0x1ff << 17) +#define DSI_PLL_LOCK (1 << 0) +#define CCK_REG_DSI_PLL_DIVIDER 0x4c +/* * DPIO - a special bus for various display related registers to hide behind *
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -1683,6 +1683,7 @@ static void intel_enable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe,* need the check. */ if (!HAS_PCH_SPLIT (dev_priv->dev)) +/* XXX: Fix for DSI PLL */ assert_pll_enabled (dev_priv, pipe);else {if (pch_port) {
@@ -6495,6 +6496,7 @@ void intel_crtc_load_lut(struct drm_crtc *crtc)return ;if (!HAS_PCH_SPLIT (dev_priv->dev)) +/* XXX: Fix for DSI PLL */ assert_pll_enabled (dev_priv, pipe);/* use legacy palette for Ironlake */
drivers/gpu/drm/i915/intel_dsi.c +5 -0
@@ -68,6 +68,8 @@ static bool intel_dsi_compute_config(struct intel_encoder *encoder,static void intel_dsi_pre_pll_enable (struct intel_encoder *encoder) {DRM_DEBUG_KMS ("\n" ); + +vlv_enable_dsi_pll (encoder); }static void intel_dsi_pre_enable (struct intel_encoder *encoder)
@@ -294,6 +296,9 @@ static void intel_dsi_mode_set(struct intel_encoder *intel_encoder)DRM_DEBUG_KMS ("pipe %d\n" , pipe); +/* Update the DSI PLL */ +vlv_enable_dsi_pll (intel_encoder); +/* escape clock divider, 20MHz, shared for A and C. device ready must be * off when doing this! txclkesc? */ tmp =I915_READ (MIPI_CTRL (0 ));
drivers/gpu/drm/i915/intel_dsi.h +2 -0
@@ -96,4 +96,6 @@ static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder) return container_of(encoder, struct intel_dsi, base.base); } +extern void vlv_enable_dsi_pll (struct intel_encoder *encoder); +#endif /* _INTEL_DSI_H */
drivers/gpu/drm/i915/intel_dsi_pll.c new file +290 -0
290 lines not on this page · raw message
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/14 drm/i915: don't enable DPLL for DSI
In reply to Jani NikulaDPLL is not needed for DSI
--- drivers/gpu/drm/i915/intel_display.c | 48 ++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 19 deletions(-)
drivers/gpu/drm/i915/intel_display.c +29 -19
@@ -3660,7 +3660,8 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc)if (encoder->pre_pll_enable) encoder->pre_pll_enable (encoder); -vlv_enable_pll (intel_crtc); +if (!intel_pipe_has_type (crtc,INTEL_OUTPUT_DSI )) +vlv_enable_pll (intel_crtc);for_each_encoder_on_crtc (dev, crtc, encoder)if (encoder->pre_enable)
@@ -3775,7 +3776,8 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)if (encoder->post_disable) encoder->post_disable (encoder); -i9xx_disable_pll (dev_priv, pipe); +if (!intel_pipe_has_type (crtc,INTEL_OUTPUT_DSI )) +i9xx_disable_pll (dev_priv, pipe); intel_crtc->active = false;intel_update_fbc (dev);
@@ -4843,7 +4845,7 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,intel_clock_t clock, reduced_clock;u32 dspcntr;bool ok, has_reduced_clock = false; -bool is_lvds = false; +bool is_lvds = false, is_dsi = false;struct intel_encoder *encoder;const intel_limit_t *limit;int ret;
@@ -4853,6 +4855,9 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc,case INTEL_OUTPUT_LVDS : is_lvds = true;break ; +case INTEL_OUTPUT_DSI : + is_dsi = true; +break ; } num_connectors++;
@@ -4860,18 +4865,21 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, refclk =i9xx_get_refclk (crtc, num_connectors); -/* -* Returns a set of divisors for the desired target clock with the given -* refclk, or FALSE. The returned values represent the clock equation: -* reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + 2) / p1 / p2. -*/ - limit =intel_limit (crtc, refclk); - ok = dev_priv->display.find_dpll (limit, crtc, - intel_crtc->config.port_clock, - refclk,NULL , &clock); -if (!ok && !intel_crtc->config.clock_set) { -DRM_ERROR ("Couldn't find PLL settings for mode!\n" ); -return -EINVAL ; +if (!is_dsi) { +/* +* Returns a set of divisors for the desired target clock with +* the given refclk, or FALSE. The returned values represent +* the clock equation: reflck * (5 * (m1 + 2) + (m2 + 2)) / (n + +* 2) / p1 / p2. +*/ + limit =intel_limit (crtc, refclk); + ok = dev_priv->display.find_dpll (limit, crtc, + intel_crtc->config.port_clock, + refclk,NULL , &clock); +if (!ok && !intel_crtc->config.clock_set) { +DRM_ERROR ("Couldn't find PLL settings for mode!\n" ); +return -EINVAL ; + } }/* Ensure that the cursor is valid for the new mode before changing... */
@@ -4899,16 +4907,18 @@ static int i9xx_crtc_mode_set(struct drm_crtc *crtc, intel_crtc->config.dpll.p2 = clock.p2; } -if (IS_GEN2 (dev)) +if (IS_GEN2 (dev)) {i8xx_update_pll (intel_crtc, has_reduced_clock ? &reduced_clock :NULL , num_connectors); -else if (IS_VALLEYVIEW (dev)) -vlv_update_pll (intel_crtc); -else + }else if (IS_VALLEYVIEW (dev)) { +if (!is_dsi) +vlv_update_pll (intel_crtc); + }else {i9xx_update_pll (intel_crtc, has_reduced_clock ? &reduced_clock :NULL , num_connectors); + }/* Set up the display plane register */ dspcntr =DISPPLANE_GAMMA_ENABLE ;
Signature · 1 line
1.7.9.5
PATCH 11/14 drm/i915: Band Gap WA
In reply to Jani NikulaFrom: Shobhit Kumar <[email protected]>
--- drivers/gpu/drm/i915/intel_dsi.c | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
drivers/gpu/drm/i915/intel_dsi.c +48 -0
@@ -37,6 +37,51 @@static const struct intel_dsi_device intel_dsi_devices[] = { }; + +static void vlv_cck_modify (struct drm_i915_private *dev_priv,u32 reg,u32 val, +u32 mask) +{ +u32 tmp =vlv_cck_read (dev_priv, reg); + tmp &= ~mask; + tmp |= val; +vlv_cck_write (dev_priv, reg, tmp); +} + +static void band_gap_wa (struct drm_i915_private *dev_priv) +{ +mutex_lock (&dev_priv->dpio_lock); + +/* Enable bandgap fix in GOP driver */ +vlv_cck_modify (dev_priv,0x6D ,0x00010000 ,0x00030000 ); +msleep (20 ); +vlv_cck_modify (dev_priv,0x6E ,0x00010000 ,0x00030000 ); +msleep (20 ); +vlv_cck_modify (dev_priv,0x6F ,0x00010000 ,0x00030000 ); +msleep (20 ); +vlv_cck_modify (dev_priv,0x00 ,0x00008000 ,0x00008000 ); +msleep (20 ); +vlv_cck_modify (dev_priv,0x00 ,0x00000000 ,0x00008000 ); +msleep (20 ); + +/* Turn Display Trunk on */ +vlv_cck_modify (dev_priv,0x6B ,0x00020000 ,0x00030000 ); +msleep (20 ); + +vlv_cck_modify (dev_priv,0x6C ,0x00020000 ,0x00030000 ); +msleep (20 ); + +vlv_cck_modify (dev_priv,0x6D ,0x00020000 ,0x00030000 ); +msleep (20 ); +vlv_cck_modify (dev_priv,0x6E ,0x00020000 ,0x00030000 ); +msleep (20 ); +vlv_cck_modify (dev_priv,0x6F ,0x00020000 ,0x00030000 ); + +mutex_unlock (&dev_priv->dpio_lock); + +/* Need huge delay, otherwise clock is not stable */ +msleep (100 ); +} +static struct intel_dsi *intel_attached_dsi (struct drm_connector *connector) { return container_of(intel_attached_encoder(connector),
@@ -299,6 +344,9 @@ static void intel_dsi_mode_set(struct intel_encoder *intel_encoder)/* Update the DSI PLL */ vlv_enable_dsi_pll (intel_encoder); +/* XXX: Location of the call */ +band_gap_wa (dev_priv); +/* escape clock divider, 20MHz, shared for A and C. device ready must be * off when doing this! txclkesc? */ tmp =I915_READ (MIPI_CTRL (0 ));
Signature · 1 line
1.7.9.5
PATCH 12/14 drm/i915: Parse the MIPI related VBT Block and store relevant info
In reply to Jani NikulaFrom: Shobhit Kumar <[email protected]>
Initial parsing of the VBT MIPI block. For now, just store the panel id if found.
--- drivers/gpu/drm/i915/i915_drv.h | 5 +++++ drivers/gpu/drm/i915/intel_bios.c | 16 +++++++++++++++ drivers/gpu/drm/i915/intel_bios.h | 41 +++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +5 -0
@@ -1053,6 +1053,11 @@ struct intel_vbt_data {int edp_bpp;struct edp_power_seq edp_pps; +/* MIPI DSI */ +struct { +u16 panel_id; + } dsi; +int crt_ddc_pin;int child_dev_num;
drivers/gpu/drm/i915/intel_bios.c +16 -0
@@ -569,6 +569,21 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb) }static void +parse_mipi (struct drm_i915_private *dev_priv,struct bdb_header *bdb) +{ +struct bdb_mipi *mipi; + + mipi =find_section (bdb,BDB_MIPI ); +if (!mipi) { +DRM_DEBUG_KMS ("No MIPI BDB found" ); +return ; + } + +/* XXX: add more info */ + dev_priv->vbt.dsi.panel_id = mipi->panel_id; +} + +static void parse_device_mapping (struct drm_i915_private *dev_priv,struct bdb_header *bdb) {
@@ -745,6 +760,7 @@ intel_parse_bios(struct drm_device *dev)parse_device_mapping (dev_priv, bdb);parse_driver_features (dev_priv, bdb);parse_edp (dev_priv, bdb); +parse_mipi (dev_priv, bdb);if (bios)pci_unmap_rom (pdev, bios);
drivers/gpu/drm/i915/intel_bios.h +41 -0
51 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 13/14 drm/i915: initialize DSI output on VLV
In reply to Jani Nikula--- drivers/gpu/drm/i915/intel_display.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -9357,6 +9357,8 @@ static void intel_setup_outputs(struct drm_device *dev)if (I915_READ (VLV_DISPLAY_BASE +DP_B ) &DP_DETECTED )intel_dp_init (dev,VLV_DISPLAY_BASE +DP_B ,PORT_B ); } + +intel_dsi_init (dev); }else if (SUPPORTS_DIGITAL_OUTPUTS (dev)) {bool found = false;
Signature · 1 line
1.7.9.5
PATCH 14/14 drm/i915: add AUO MIPI DSI display sub-encoder
In reply to Jani NikulaFrom: Shobhit Kumar <[email protected]>
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/auo_dsi_display.c | 182 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_dsi.c | 5 + drivers/gpu/drm/i915/intel_dsi.h | 3 + 4 files changed, 191 insertions(+) create mode 100644 drivers/gpu/drm/i915/auo_dsi_display.c
drivers/gpu/drm/i915/Makefile +1 -0
@@ -42,6 +42,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \ intel_opregion.o \ intel_sideband.o \ intel_uncore.o \ + auo_dsi_display.o \ dvo_ch7xxx.o \ dvo_ch7017.o \ dvo_ivch.o \
drivers/gpu/drm/i915/auo_dsi_display.c new file +182 -0
182 lines not on this page · raw message
drivers/gpu/drm/i915/intel_dsi.c +5 -0
@@ -35,6 +35,11 @@/* the sub-encoders aka panel drivers */ static const struct intel_dsi_device intel_dsi_devices[] = { + { + .type =INTEL_DSI_VIDEO_MODE , + .name ="auo-dsi-vid-mode-display" , + .dev_ops = &auo_dsi_display_ops, + }, };
drivers/gpu/drm/i915/intel_dsi.h +3 -0
@@ -98,4 +98,7 @@ static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder)extern void vlv_enable_dsi_pll (struct intel_encoder *encoder); +/* the panel drivers */ +extern struct intel_dsi_dev_ops auo_dsi_display_ops; +#endif /* _INTEL_DSI_H */
Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 08/14] drm/i915: add basic MIPI DSI output support
In reply to Jani NikulaQuoted 4 lines · Jani Nikula
This does not include any panel specific sub-encoders yet.
Signed-off-by Jani Nikula <[email protected]>Signed-off-by Shobhit Kumar <[email protected]>
Quick bikesheed on how you wire up the get_modes stuff, mostly because I'm just discussing this on irc with Rob:
- We now have intel_connector->panel.fixed_mode
- And I think it's better to route all the get_modes stuff entirely through the connector layer, leaving the dsi encoder entirely out of the picture. Maybe we should even go as far as registering the drm_connector from the dsi sink device since that one really knows all the details (like all the properties of the panel, what mode it supports or whether maybe this DSI thingy is actually some transcoder with a totally different output attached ...).
Cheers, Daniel
Quoted 592 lines
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_dsi.c | 548 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 550 insertions(+) create mode 100644 drivers/gpu/drm/i915/intel_dsi.cdrivers/gpu/drm/i915/Makefile +1
-0@@ -21,6 +21,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \ intel_display.o \ intel_crt.o \ intel_lvds.o \ + intel_dsi.o \ intel_dsi_cmd.o \ intel_bios.o \ intel_ddi.o \drivers/gpu/drm/i915/intel_drv.h +1
-0@@ -525,6 +525,7 @@ extern void intel_mark_fb_busy(struct drm_i915_gem_object *obj, struct intel_ring_buffer *ring);extern void intel_mark_idle (struct drm_device *dev);extern void intel_lvds_init (struct drm_device *dev); +extern bool intel_dsi_init (struct drm_device *dev);extern bool intel_is_dual_link_lvds (struct drm_device *dev);extern void intel_dp_init (struct drm_device *dev,int output_reg,enum port port);drivers/gpu/drm/i915/intel_dsi.c new file +548
-0@@ -0,0 +1,548 @@ +/* +* Copyright © 2013 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +* Author: Jani Nikula <[email protected]> +*/ + +#include <drm/drmP.h> +#include <drm/drm_crtc.h> +#include <drm/drm_edid.h> +#include <drm/i915_drm.h> +#include <linux/slab.h> +#include "i915_drv.h" +#include "intel_drv.h" +#include "intel_dsi.h" +#include "intel_dsi_cmd.h" + +/* the sub-encoders aka panel drivers */ +static const struct intel_dsi_device intel_dsi_devices[] = { +}; + +static struct intel_dsi *intel_attached_dsi (struct drm_connector *connector) +{ +return container_of (intel_attached_encoder (connector), + struct intel_dsi, base); +} + +static inline bool is_vid_mode (struct intel_dsi *intel_dsi) +{ +return intel_dsi->dev.type ==INTEL_DSI_VIDEO_MODE ; +} + +static inline bool is_cmd_mode (struct intel_dsi *intel_dsi) +{ +return intel_dsi->dev.type ==INTEL_DSI_COMMAND_MODE ; +} + +static void intel_dsi_hot_plug (struct intel_encoder *encoder) +{ +DRM_DEBUG_KMS ("\n" ); +} + +static bool intel_dsi_compute_config (struct intel_encoder *encoder, +struct intel_crtc_config *config) +{ +DRM_DEBUG_KMS ("\n" ); +return true; +} + +static void intel_dsi_pre_pll_enable (struct intel_encoder *encoder) +{ +DRM_DEBUG_KMS ("\n" ); +} + +static void intel_dsi_pre_enable (struct intel_encoder *encoder) +{ +DRM_DEBUG_KMS ("\n" ); +} + +static void intel_dsi_enable (struct intel_encoder *encoder) +{ +struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; +struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc); +struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base); +int pipe = intel_crtc->pipe; +u32 temp; + +DRM_DEBUG_KMS ("\n" ); + + temp =I915_READ (MIPI_DEVICE_READY (pipe)); + temp &= ~ULPS_STATE_MASK ; + temp &= ~DEVICE_READY ;/* XXX: assuming it's already !ready */ +I915_WRITE (MIPI_DEVICE_READY (pipe), temp |ULPS_STATE_EXIT ); +msleep (20 );/* XXX */ +I915_WRITE (MIPI_DEVICE_READY (pipe), temp); +msleep (20 );/* XXX */ +I915_WRITE (MIPI_DEVICE_READY (pipe), temp |DEVICE_READY ); + +if (is_cmd_mode (intel_dsi)) +I915_WRITE (MIPI_MAX_RETURN_PKT_SIZE (pipe),8 *4 ); + +/* Do this here, or let the slave encoder do it in ->dpms? */ +if (is_vid_mode (intel_dsi)) { +dpi_send_cmd (intel_dsi,TURN_ON ); +msleep (100 ); + } + +/* assert ip_tg_enable signal */ + temp =I915_READ (MIPI_PORT_CTRL (pipe)); +I915_WRITE (MIPI_PORT_CTRL (pipe), temp |DPI_ENABLE ); +POSTING_READ (MIPI_PORT_CTRL (pipe)); + + intel_dsi->dev.dev_ops->enable (&intel_dsi->dev); +} + +static void intel_dsi_disable (struct intel_encoder *encoder) +{ +struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; +struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc); +struct intel_dsi *intel_dsi =enc_to_intel_dsi (&encoder->base); +int pipe = intel_crtc->pipe; +u32 temp; + +DRM_DEBUG_KMS ("\n" ); + + intel_dsi->dev.dev_ops->disable (&intel_dsi->dev); + +if (is_vid_mode (intel_dsi)) +dpi_send_cmd (intel_dsi,SHUTDOWN ); + +if (is_vid_mode (intel_dsi)) { +/* de-assert ip_tg_enable signal */ + temp =I915_READ (MIPI_PORT_CTRL (pipe)); +I915_WRITE (MIPI_PORT_CTRL (pipe), temp & ~DPI_ENABLE ); +POSTING_READ (MIPI_PORT_CTRL (pipe)); + } + +/* XXX: wait for fifos before ulps entry */ + + temp =I915_READ (MIPI_DEVICE_READY (pipe)); + temp &= ~ULPS_STATE_MASK ; + temp &= ~DEVICE_READY ; +I915_WRITE (MIPI_DEVICE_READY (pipe), temp); +msleep (5 ); +I915_WRITE (MIPI_DEVICE_READY (pipe), temp |ULPS_STATE_ENTER ); +} + +static void intel_dsi_post_disable (struct intel_encoder *encoder) +{ +DRM_DEBUG_KMS ("\n" ); + +/* XXX: disable dsi pll */ +} + +static bool intel_dsi_get_hw_state (struct intel_encoder *encoder, +enum pipe *pipe) +{ +struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc); + +DRM_DEBUG_KMS ("\n" ); + +/* XXX: this is wrong */ +if (intel_crtc) { + *pipe = intel_crtc->pipe; +return true; + } + +/* XXX: do we also need to call +* intel_dsi->dev.dev_ops->get_hw_state(&intel_dsi->dev); +*/ + +return false; +} + +static void intel_dsi_get_config (struct intel_encoder *encoder, +struct intel_crtc_config *pipe_config) +{ +DRM_DEBUG_KMS ("\n" ); +} + +static int intel_dsi_mode_valid (struct drm_connector *connector, +struct drm_display_mode *mode) +{ +struct intel_dsi *intel_dsi =intel_attached_dsi (connector); + +DRM_DEBUG_KMS ("\n" ); + +if (mode->flags &DRM_MODE_FLAG_DBLSCAN ) { +DRM_DEBUG_KMS ("MODE_NO_DBLESCAN\n" ); +return MODE_NO_DBLESCAN ; + } + +if (intel_dsi->panel_fixed_mode) { +if (mode->hdisplay > intel_dsi->panel_fixed_mode->hdisplay) +return MODE_PANEL ; +if (mode->vdisplay > intel_dsi->panel_fixed_mode->vdisplay) +return MODE_PANEL ; + } + +return intel_dsi->dev.dev_ops->mode_valid (&intel_dsi->dev, mode); +} + +static bool intel_dsi_mode_fixup (struct drm_encoder *encoder, +const struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode) +{ +struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); + +DRM_DEBUG_KMS ("\n" ); + +/* If we have timings from the BIOS for the panel, put them in +* to the adjusted mode. The CRTC will be set up for this mode, +* with the panel scaling set up to source from the H/VDisplay +* of the original mode. +*/ +if (intel_dsi->panel_fixed_mode !=NULL ) { +#define C (x) adjusted_mode->x = intel_dsi->panel_fixed_mode->x +C (hdisplay); +C (hsync_start); +C (hsync_end); +C (htotal); +C (vdisplay); +C (vsync_start); +C (vsync_end); +C (vtotal); +C (clock); +#undef C + } + +if (intel_dsi->dev.dev_ops->mode_fixup) +return intel_dsi->dev.dev_ops->mode_fixup (&intel_dsi->dev, mode, adjusted_mode); + +return true; +} + +/* return pixels in terms of txbyteclkhs */ +static u16 txbyteclkhs (u16 pixels,int bpp,int lane_count) +{ +return DIV_ROUND_UP (DIV_ROUND_UP (pixels * bpp,8 ), lane_count); +} + +static void set_dsi_timings (struct drm_encoder *encoder, +const struct drm_display_mode *mode) +{ +struct drm_device *dev = encoder->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *intel_crtc =to_intel_crtc (encoder->crtc); +struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); +int pipe = intel_crtc->pipe; +unsigned int bpp = intel_crtc->config.pipe_bpp; +unsigned int lane_count = intel_dsi->lane_count; + +u16 hactive, hfp, hsync, hbp, vfp, vsync, vbp; + + hactive = mode->hdisplay; + hfp = mode->hsync_start - mode->hdisplay; + hsync = mode->hsync_end - mode->hsync_start; + hbp = mode->htotal - mode->hsync_end; + + vfp = mode->vsync_start - mode->vdisplay; + vsync = mode->vsync_end - mode->vsync_start; + vbp = mode->vtotal - mode->vsync_end; + +/* horizontal values are in terms of high speed byte clock */ + hactive =txbyteclkhs (hactive, bpp, lane_count); + hfp =txbyteclkhs (hfp, bpp, lane_count); + hsync =txbyteclkhs (hsync, bpp, lane_count); + hbp =txbyteclkhs (hbp, bpp, lane_count); + +I915_WRITE (MIPI_HACTIVE_AREA_COUNT (pipe), hactive); +I915_WRITE (MIPI_HFP_COUNT (pipe), hfp); + +/* meaningful for video mode non-burst sync pulse mode only, can be zero +* for non-burst sync events and burst modes */ +I915_WRITE (MIPI_HSYNC_PADDING_COUNT (pipe), hsync); +I915_WRITE (MIPI_HBP_COUNT (pipe), hbp); + +/* vertical values are in terms of lines */ +I915_WRITE (MIPI_VFP_COUNT (pipe), vfp); +I915_WRITE (MIPI_VSYNC_PADDING_COUNT (pipe), vsync); +I915_WRITE (MIPI_VBP_COUNT (pipe), vbp); +} + +static void intel_dsi_mode_set (struct intel_encoder *intel_encoder) +{ +struct drm_encoder *encoder = &intel_encoder->base; +struct drm_device *dev = encoder->dev; +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_crtc *intel_crtc =to_intel_crtc (encoder->crtc); +struct intel_dsi *intel_dsi =enc_to_intel_dsi (encoder); +struct drm_display_mode *adjusted_mode = + &intel_crtc->config.adjusted_mode; +int pipe = intel_crtc->pipe; +unsigned int bpp = intel_crtc->config.pipe_bpp; +u32 val, tmp; + +DRM_DEBUG_KMS ("pipe %d\n" , pipe); + +/* escape clock divider, 20MHz, shared for A and C. device ready must be +* off when doing this! txclkesc? */ + tmp =I915_READ (MIPI_CTRL (0 )); + tmp &= ~ESCAPE_CLOCK_DIVIDER_MASK ; +I915_WRITE (MIPI_CTRL (0 ), tmp |ESCAPE_CLOCK_DIVIDER_1 ); + +/* read request priority is per pipe */ + tmp =I915_READ (MIPI_CTRL (pipe)); + tmp &= ~READ_REQUEST_PRIORITY_MASK ; +I915_WRITE (MIPI_CTRL (pipe), tmp |READ_REQUEST_PRIORITY_HIGH ); + +/* XXX: why here, why like this? handling in irq handler?! */ +I915_WRITE (MIPI_INTR_STAT (pipe),0xffffffff ); +I915_WRITE (MIPI_INTR_EN (pipe),0xffffffff ); + +I915_WRITE (MIPI_DPHY_PARAM (pipe), +0x3c <<EXIT_ZERO_COUNT_SHIFT | +0x1f <<TRAIL_COUNT_SHIFT | +0xc5 <<CLK_ZERO_COUNT_SHIFT | +0x1f <<PREPARE_COUNT_SHIFT ); + +I915_WRITE (MIPI_DPI_RESOLUTION (pipe), + adjusted_mode->vdisplay <<VERTICAL_ADDRESS_SHIFT | + adjusted_mode->hdisplay <<HORIZONTAL_ADDRESS_SHIFT ); + +set_dsi_timings (encoder, adjusted_mode); + + val = intel_dsi->lane_count <<DATA_LANES_PRG_REG_SHIFT ; +if (is_cmd_mode (intel_dsi)) { + val |= intel_dsi->channel <<CMD_MODE_CHANNEL_NUMBER_SHIFT ; + val |=CMD_MODE_DATA_WIDTH_8_BIT ;/* XXX */ + }else { + val |= intel_dsi->channel <<VID_MODE_CHANNEL_NUMBER_SHIFT ; + +/* XXX: cross-check bpp vs. pixel format? */ + val |= intel_dsi->pixel_format; + } +I915_WRITE (MIPI_DSI_FUNC_PRG (pipe), val); + +/* timeouts for recovery. one frame IIUC. if counter expires, EOT and +* stop state. */ + +if (is_vid_mode (intel_dsi) && + intel_dsi->video_mode_format ==VIDEO_MODE_BURST ) { +I915_WRITE (MIPI_HS_TX_TIMEOUT (pipe), +txbyteclkhs (adjusted_mode->htotal +1 , bpp, + intel_dsi->lane_count)); + }else { +I915_WRITE (MIPI_HS_TX_TIMEOUT (pipe), +txbyteclkhs (adjusted_mode->vtotal * + adjusted_mode->htotal, + bpp, intel_dsi->lane_count)); + } +I915_WRITE (MIPI_LP_RX_TIMEOUT (pipe),0xffff ); +I915_WRITE (MIPI_TURN_AROUND_TIMEOUT (pipe),0x14 ); + +I915_WRITE (MIPI_DEVICE_RESET_TIMER (pipe),0xffff ); + +/* dphy stuff */ + +/* in terms of low power clock */ +I915_WRITE (MIPI_INIT_COUNT (pipe),0x7d0 ); + +/* recovery disables */ +I915_WRITE (MIPI_EOT_DISABLE (pipe), intel_dsi->eot_disable); + +/* in terms of txbyteclkhs. actual high to low switch + +* MIPI_STOP_STATE_STALL * MIPI_LP_BYTECLK. +* +* XXX: write MIPI_STOP_STATE_STALL? +*/ +I915_WRITE (MIPI_HIGH_LOW_SWITCH_COUNT (pipe),0x46 ); + +/* XXX: low power clock equivalence in terms of byte clock. the number +* of byte clocks occupied in one low power clock. based on txbyteclkhs +* and txclkesc. txclkesc time / txbyteclk time * (105 + +* MIPI_STOP_STATE_STALL) / 105.??? +*/ +I915_WRITE (MIPI_LP_BYTECLK (pipe),4 ); + +/* the bw essential for transmitting 16 long packets containing 252 +* bytes meant for dcs write memory command is programmed in this +* register in terms of byte clocks. based on dsi transfer rate and the +* number of lanes configured the time taken to transmit 16 long packets +* in a dsi stream varies. */ +I915_WRITE (MIPI_DBI_BW_CTRL (pipe),0x820 ); + +I915_WRITE (MIPI_CLK_LANE_SWITCH_TIME_CNT (pipe), +0xa <<LP_HS_SSW_CNT_SHIFT | +0x14 <<HS_LP_PWR_SW_CNT_SHIFT ); + +if (is_vid_mode (intel_dsi)) +I915_WRITE (MIPI_VIDEO_MODE_FORMAT (pipe), + intel_dsi->video_mode_format); +} + +static enum drm_connector_status +intel_dsi_detect (struct drm_connector *connector,bool force) +{ +struct intel_dsi *intel_dsi =intel_attached_dsi (connector); +DRM_DEBUG_KMS ("\n" ); +return intel_dsi->dev.dev_ops->detect (&intel_dsi->dev); +} + +static int intel_dsi_get_modes (struct drm_connector *connector) +{ +struct intel_dsi *intel_dsi =intel_attached_dsi (connector); +struct drm_display_mode *mode; + +DRM_DEBUG_KMS ("\n" ); + +if (!intel_dsi->panel_fixed_mode) { +DRM_DEBUG_KMS ("no fixed mode\n" ); +return 0 ; + } + + mode =drm_mode_duplicate (connector->dev, intel_dsi->panel_fixed_mode); +if (!mode) { +DRM_DEBUG_KMS ("dupe failed\n" ); +return 0 ; + } + +drm_mode_probed_add (connector, mode); +return 1 ; +} + +static void intel_dsi_destroy (struct drm_connector *connector) +{ +DRM_DEBUG_KMS ("\n" ); +drm_sysfs_connector_remove (connector); +drm_connector_cleanup (connector); +kfree (connector); +} + +static const struct drm_encoder_helper_funcs intel_dsi_helper_funcs = { + .mode_fixup = intel_dsi_mode_fixup, +}; + +static const struct drm_encoder_funcs intel_dsi_funcs = { + .destroy = intel_encoder_destroy, +}; + +static const struct drm_connector_helper_funcs intel_dsi_connector_helper_funcs = { + .get_modes = intel_dsi_get_modes, + .mode_valid = intel_dsi_mode_valid, + .best_encoder = intel_best_encoder, +}; + +static const struct drm_connector_funcs intel_dsi_connector_funcs = { + .dpms = intel_connector_dpms, + .detect = intel_dsi_detect, + .destroy = intel_dsi_destroy, + .fill_modes = drm_helper_probe_single_connector_modes, +}; + +bool intel_dsi_init (struct drm_device *dev) +{ +struct intel_dsi *intel_dsi; +struct intel_encoder *intel_encoder; +struct drm_encoder *encoder; +struct intel_connector *intel_connector; +struct drm_connector *connector; +struct drm_display_mode *fixed_mode =NULL ; +const struct intel_dsi_device *dsi; +unsigned int i; + +DRM_DEBUG_KMS ("\n" ); + + intel_dsi =kzalloc (sizeof (*intel_dsi),GFP_KERNEL ); +if (!intel_dsi) +return false; + + intel_connector =kzalloc (sizeof (*intel_connector),GFP_KERNEL ); +if (!intel_connector) { +kfree (intel_dsi); +return false; + } + + intel_encoder = &intel_dsi->base; + encoder = &intel_encoder->base; + + connector = &intel_connector->base; + +drm_encoder_init (dev, encoder, &intel_dsi_funcs,DRM_MODE_ENCODER_DSI ); + +/* XXX: very likely not all of these are needed */ + intel_encoder->hot_plug = intel_dsi_hot_plug; + intel_encoder->compute_config = intel_dsi_compute_config; + intel_encoder->pre_pll_enable = intel_dsi_pre_pll_enable; + intel_encoder->pre_enable = intel_dsi_pre_enable; + intel_encoder->enable = intel_dsi_enable; + intel_encoder->mode_set = intel_dsi_mode_set; + intel_encoder->disable = intel_dsi_disable; + intel_encoder->post_disable = intel_dsi_post_disable; + intel_encoder->get_hw_state = intel_dsi_get_hw_state; + intel_encoder->get_config = intel_dsi_get_config; + + intel_connector->get_hw_state = intel_connector_get_hw_state; + +for (i =0 ; i <ARRAY_SIZE (intel_dsi_devices); i++) { + dsi = &intel_dsi_devices[i]; + intel_dsi->dev = *dsi; + +if (dsi->dev_ops->init (&intel_dsi->dev)) +break ; + } + +if (i ==ARRAY_SIZE (intel_dsi_devices)) { +DRM_DEBUG_KMS ("no device found\n" ); + goto err; + } + + intel_encoder->type =INTEL_OUTPUT_DSI ; + intel_encoder->crtc_mask = (1 <<0 );/* XXX */ + + intel_encoder->cloneable = false; +drm_connector_init (dev, connector, &intel_dsi_connector_funcs, +DRM_MODE_CONNECTOR_DSI ); + +drm_connector_helper_add (connector, &intel_dsi_connector_helper_funcs); + + connector->display_info.subpixel_order = SubPixelHorizontalRGB;/*XXX*/ + connector->interlace_allowed = false; + connector->doublescan_allowed = false; + +drm_encoder_helper_add (encoder, &intel_dsi_helper_funcs); + +intel_connector_attach_encoder (intel_connector, intel_encoder); + +drm_sysfs_connector_add (connector); + + fixed_mode = dsi->dev_ops->get_modes (&intel_dsi->dev); +if (!fixed_mode) { +DRM_DEBUG_KMS ("no fixed mode\n" ); + goto err; + } + + fixed_mode->type |=DRM_MODE_TYPE_PREFERRED ; + + intel_dsi->panel_fixed_mode = fixed_mode; + +intel_panel_init (&intel_connector->panel, fixed_mode); + +return true; + +err: +drm_encoder_cleanup (&intel_encoder->base); +kfree (intel_dsi); +kfree (intel_connector); + +return false; +}Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Re: [PATCH 04/14] drm/i915: add MIPI DSI register definitions
In reply to Jani NikulaQuoted 17 lines · Jani Nikula
Add definitions for VLV MIPI DSI registers.
Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 409 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 409 insertions(+)drivers/gpu/drm/i915/i915_reg.h +2
-0@@ -5104,4 +5104,413 @@#define PIPE_CSC_POSTOFF_ME (pipe) _PIPE(pipe, _PIPE_A_CSC_POSTOFF_ME, _PIPE_B_CSC_POSTOFF_ME)#define PIPE_CSC_POSTOFF_LO (pipe) _PIPE(pipe, _PIPE_A_CSC_POSTOFF_LO, _PIPE_B_CSC_POSTOFF_LO) +/* VLV MIPI registers */ +
drivers/gpu/drm/i915/i915_reg.h line 5118
Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +10
-0+/* XXX: This register seems very messy. MIPIB has only enable and delay. */ +#define _MIPIA_PORT_CTRL (VLV_DISPLAY_BASE + 0x61190) +#define _MIPIB_PORT_CTRL (VLV_DISPLAY_BASE + 0x61700) +#define MIPI_PORT_CTRL (pipe) _PIPE(pipe, _MIPIA_PORT_CTRL, _MIPIB_PORT_CTRL) +#define DPI_ENABLE (1 << 31)/* A + B */ +#define MIPIA_MIPI4DPHY_DELAY_COUNT_SHIFT 27 +#define MIPIA_MIPI4DPHY_DELAY_COUNT_MASK (0xf << 27) +#define DUAL_LINK_MODE_MASK (1 << 26) +#define DUAL_LINK_MODE_FRONT_BACK (0 << 26) +#define DUAL_LINK_MODE_PIXEL_ALTERNATIVE (1 << 26)
25 is "Dither Enable" according to my docs.
drivers/gpu/drm/i915/i915_reg.h line 5120
Quoted 2 lines
drivers/gpu/drm/i915/i915_reg.h +2
-0+#define FLOPPED_HSTX (1 << 23) +#define DE_INVERT (1 << 19)/* XXX */
One doc has DE_INVERT (and HS/VS invert and border enable bits), another has the FLISDSI stuff. I guess that's the XXX here.
drivers/gpu/drm/i915/i915_reg.h line 5123
Quoted 3 lines
drivers/gpu/drm/i915/i915_reg.h +3
-0+#define MIPIA_FLISDSI_DELAY_COUNT_SHIFT 18 +#define MIPIA_FLISDSI_DELAY_COUNT_MASK (0xf << 18) +#define AFE_LATCHOUT (1 << 17)
16 is "LPOutput Hold"
Quoted 24 lines
drivers/gpu/drm/i915/i915_reg.h +24
-0+#define MIPIB_FLISDSI_DELAY_COUNT_HIGH_SHIFT 15 +#define MIPIB_FLISDSI_DELAY_COUNT_HIGH_MASK (1 << 15) +#define MIPIB_MIPI4DPHY_DELAY_COUNT_SHIFT 11 +#define MIPIB_MIPI4DPHY_DELAY_COUNT_MASK (0xf << 11) +#define CSB_SHIFT 9 +#define CSB_MASK (3 << 9) +#define CSB_20MHZ (0 << 9) +#define CSB_10MHZ (1 << 9) +#define CSB_40MHZ (2 << 9) +#define BANDGAP_MASK (1 << 8) +#define BANDGAP_PNW_CIRCUIT (0 << 8) +#define BANDGAP_LNC_CIRCUIT (1 << 8) +#define MIPIB_FLISDSI_DELAY_COUNT_LOW_SHIFT 5 +#define MIPIB_FLISDSI_DELAY_COUNT_LOW_MASK (7 << 5) +#define TEARING_EFFECT_DELAY (1 << 4)/* A + B */ +#define TEARING_EFFECT_SHIFT 2/* A + B */ +#define TEARING_EFFECT_MASK (3 << 2) +#define TEARING_EFFECT_OFF (0 << 2) +#define TEARING_EFFECT_DSI (1 << 2) +#define TEARING_EFFECT_GPIO (2 << 2) +#define LANE_CONFIGURATION_SHIFT 0 +#define LANE_CONFIGURATION_MASK (3 << 0) +#define LANE_CONFIGURATION_4LANE (0 << 0) +#define LANE_CONFIGURATION_DUAL_LINK_A (1 << 0)
drivers/gpu/drm/i915/i915_reg.h line 5157
Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +10
-0+#define LANE_CONFIGURATION_DUAL_LINK_B (2 << 0) + +#define _MIPIA_TEARING_CTRL (VLV_DISPLAY_BASE + 0x61194) +#define _MIPIB_TEARING_CTRL (VLV_DISPLAY_BASE + 0x61704) +#define MIPI_TEARING_CTRL (pipe) _PIPE(pipe, _MIPIA_TEARING_CTRL, _MIPIB_TEARING_CTRL) +#define TEARING_EFFECT_DELAY_SHIFT 0 +#define TEARING_EFFECT_DELAY_MASK (0xffff << 0) + +/* XXX */ +#define _MIPIA_AUTOPWG (VLV_DISPLAY_BASE + 0x611a0)
Is the XXX here because the spec says the contents are all "reserved"?
drivers/gpu/drm/i915/i915_reg.h line 5167
Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +10
-0+ +/* MIPI DSI Controller and D-PHY registers */ + +#define _MIPIA_DEVICE_READY (VLV_DISPLAY_BASE + 0xb000) +#define _MIPIB_DEVICE_READY (VLV_DISPLAY_BASE + 0xb800) +#define MIPI_DEVICE_READY (pipe) _PIPE(pipe, _MIPIA_DEVICE_READY, _MIPIB_DEVICE_READY) +#define BUS_POSSESSION (1 << 3)/* set to give bus to receiver */ +#define ULPS_STATE_MASK (3 << 1) +#define ULPS_STATE_ENTER (2 << 1)/* XXX */ +#define ULPS_STATE_EXIT (1 << 1)/* XXX */
Maybe we should have the (0 << 1) "normal operation" listed here as well?
Quoted 85 lines
drivers/gpu/drm/i915/i915_reg.h +85
-0+#define DEVICE_READY (1 << 0) + +#define _MIPIA_INTR_STAT (VLV_DISPLAY_BASE + 0xb004) +#define _MIPIB_INTR_STAT (VLV_DISPLAY_BASE + 0xb804) +#define MIPI_INTR_STAT (pipe) _PIPE(pipe, _MIPIA_INTR_STAT, _MIPIB_INTR_STAT) +#define _MIPIA_INTR_EN (VLV_DISPLAY_BASE + 0xb008) +#define _MIPIB_INTR_EN (VLV_DISPLAY_BASE + 0xb808) +#define MIPI_INTR_EN (pipe) _PIPE(pipe, _MIPIA_INTR_EN, _MIPIB_INTR_EN) +#define TEARING_EFFECT (1 << 31) +#define SPL_PKT_SENT_INTERRUPT (1 << 30) +#define GEN_READ_DATA_AVAIL (1 << 29) +#define LP_GENERIC_WR_FIFO_FULL (1 << 28) +#define HS_GENERIC_WR_FIFO_FULL (1 << 27) +#define RX_PROT_VIOLATION (1 << 26) +#define RX_INVALID_TX_LENGTH (1 << 25) +#define ACK_WITH_NO_ERROR (1 << 24) +#define TURN_AROUND_ACK_TIMEOUT (1 << 23) +#define LP_RX_TIMEOUT (1 << 22) +#define HS_TX_TIMEOUT (1 << 21) +#define DPI_FIFO_UNDERRUN (1 << 20) +#define LOW_CONTENTION (1 << 19) +#define HIGH_CONTENTION (1 << 18) +#define TXDSI_VC_ID_INVALID (1 << 17) +#define TXDSI_DATA_TYPE_NOT_RECOGNISED (1 << 16) +#define TXCHECKSUM_ERROR (1 << 15) +#define TXECC_MULTIBIT_ERROR (1 << 14) +#define TXECC_SINGLE_BIT_ERROR (1 << 13) +#define TXFALSE_CONTROL_ERROR (1 << 12) +#define RXDSI_VC_ID_INVALID (1 << 11) +#define RXDSI_DATA_TYPE_NOT_REGOGNISED (1 << 10) +#define RXCHECKSUM_ERROR (1 << 9) +#define RXECC_MULTIBIT_ERROR (1 << 8) +#define RXECC_SINGLE_BIT_ERROR (1 << 7) +#define RXFALSE_CONTROL_ERROR (1 << 6) +#define RXHS_RECEIVE_TIMEOUT_ERROR (1 << 5) +#define RX_LP_TX_SYNC_ERROR (1 << 4) +#define RXEXCAPE_MODE_ENTRY_ERROR (1 << 3) +#define RXEOT_SYNC_ERROR (1 << 2) +#define RXSOT_SYNC_ERROR (1 << 1) +#define RXSOT_ERROR (1 << 0) + +#define _MIPIA_DSI_FUNC_PRG (VLV_DISPLAY_BASE + 0xb00c) +#define _MIPIB_DSI_FUNC_PRG (VLV_DISPLAY_BASE + 0xb80c) +#define MIPI_DSI_FUNC_PRG (pipe) _PIPE(pipe, _MIPIA_DSI_FUNC_PRG, _MIPIB_DSI_FUNC_PRG) +#define CMD_MODE_DATA_WIDTH_MASK (7 << 13) +#define CMD_MODE_NOT_SUPPORTED (0 << 13) +#define CMD_MODE_DATA_WIDTH_16_BIT (1 << 13) +#define CMD_MODE_DATA_WIDTH_9_BIT (2 << 13) +#define CMD_MODE_DATA_WIDTH_8_BIT (3 << 13) +#define CMD_MODE_DATA_WIDTH_OPTION1 (4 << 13) +#define CMD_MODE_DATA_WIDTH_OPTION2 (5 << 13) +#define VID_MODE_FORMAT_MASK (0xf << 7) +#define VID_MODE_NOT_SUPPORTED (0 << 7) +#define VID_MODE_FORMAT_RGB565 (1 << 7) +#define VID_MODE_FORMAT_RGB666 (2 << 7) +#define VID_MODE_FORMAT_RGB666_LOOSE (3 << 7) +#define VID_MODE_FORMAT_RGB888 (4 << 7) +#define CMD_MODE_CHANNEL_NUMBER_SHIFT 5 +#define CMD_MODE_CHANNEL_NUMBER_MASK (3 << 5) +#define VID_MODE_CHANNEL_NUMBER_SHIFT 3 +#define VID_MODE_CHANNEL_NUMBER_MASK (3 << 3) +#define DATA_LANES_PRG_REG_SHIFT 0 +#define DATA_LANES_PRG_REG_MASK (7 << 0) + +#define _MIPIA_HS_TX_TIMEOUT (VLV_DISPLAY_BASE + 0xb010) +#define _MIPIB_HS_TX_TIMEOUT (VLV_DISPLAY_BASE + 0xb810) +#define MIPI_HS_TX_TIMEOUT (pipe) _PIPE(pipe, _MIPIA_HS_TX_TIMEOUT, _MIPIB_HS_TX_TIMEOUT) +#define HIGH_SPEED_TX_TIMEOUT_COUNTER_MASK 0xffffff + +#define _MIPIA_LP_RX_TIMEOUT (VLV_DISPLAY_BASE + 0xb014) +#define _MIPIB_LP_RX_TIMEOUT (VLV_DISPLAY_BASE + 0xb814) +#define MIPI_LP_RX_TIMEOUT (pipe) _PIPE(pipe, _MIPIA_LP_RX_TIMEOUT, _MIPIB_LP_RX_TIMEOUT) +#define LOW_POWER_RX_TIMEOUT_COUNTER_MASK 0xffffff + +#define _MIPIA_TURN_AROUND_TIMEOUT (VLV_DISPLAY_BASE + 0xb018) +#define _MIPIB_TURN_AROUND_TIMEOUT (VLV_DISPLAY_BASE + 0xb818) +#define MIPI_TURN_AROUND_TIMEOUT (pipe) _PIPE(pipe, _MIPIA_TURN_AROUND_TIMEOUT, _MIPIB_TURN_AROUND_TIMEOUT) +#define TURN_AROUND_TIMEOUT_MASK 0x3f + +#define _MIPIA_DEVICE_RESET_TIMER (VLV_DISPLAY_BASE + 0xb01c) +#define _MIPIB_DEVICE_RESET_TIMER (VLV_DISPLAY_BASE + 0xb81c) +#define MIPI_DEVICE_RESET_TIMER (pipe) _PIPE(pipe, _MIPIA_DEVICE_RESET_TIMER, _MIPIB_DEVICE_RESET_TIMER) +#define DEVICE_RESET_TIMER_MASK 0xffff + +#define _MIPIA_DPI_RESOLUTION (VLV_DISPLAY_BASE + 0xb020)
drivers/gpu/drm/i915/i915_reg.h line 5262
Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +10
-0+#define _MIPIB_DPI_RESOLUTION (VLV_DISPLAY_BASE + 0xb820) +#define MIPI_DPI_RESOLUTION (pipe) _PIPE(pipe, _MIPIA_DPI_RESOLUTION, _MIPIB_DPI_RESOLUTION) +#define VERTICAL_ADDRESS_SHIFT 16 +#define VERTICAL_ADDRESS_MASK (0xffff << 16) +#define HORIZONTAL_ADDRESS_SHIFT 0 +#define HORIZONTAL_ADDRESS_MASK 0xffff + +/* XXX */ +#define _MIPIA_DBI_FIFO_THROTTLE (VLV_DISPLAY_BASE + 0xb024) +#define _MIPIB_DBI_FIFO_THROTTLE (VLV_DISPLAY_BASE + 0xb824)
Is the XXX about the register name here? Spec lists it as MIPIA_DBI_RESOLUTION, which doesn't make much sense based on the contents.
Quoted 33 lines
drivers/gpu/drm/i915/i915_reg.h +33
-0+#define MIPI_DBI_FIFO_THROTTLE (pipe) _PIPE(pipe, _MIPIA_DBI_FIFO_THROTTLE, _MIPIB_DBI_FIFO_THROTTLE) +#define DBI_FIFO_EMPTY_HALF (0 << 0) +#define DBI_FIFO_EMPTY_QUARTER (1 << 0) +#define DBI_FIFO_EMPTY_7_LOCATIONS (2 << 0) + +/* regs below are bits 15:0 */ +#define _MIPIA_HSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb028) +#define _MIPIB_HSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb828) +#define MIPI_HSYNC_PADDING_COUNT (pipe) _PIPE(pipe, _MIPIA_HSYNC_PADDING_COUNT, _MIPIB_HSYNC_PADDING_COUNT) + +#define _MIPIA_HBP_COUNT (VLV_DISPLAY_BASE + 0xb02c) +#define _MIPIB_HBP_COUNT (VLV_DISPLAY_BASE + 0xb82c) +#define MIPI_HBP_COUNT (pipe) _PIPE(pipe, _MIPIA_HBP_COUNT, _MIPIB_HBP_COUNT) + +#define _MIPIA_HFP_COUNT (VLV_DISPLAY_BASE + 0xb030) +#define _MIPIB_HFP_COUNT (VLV_DISPLAY_BASE + 0xb830) +#define MIPI_HFP_COUNT (pipe) _PIPE(pipe, _MIPIA_HFP_COUNT, _MIPIB_HFP_COUNT) + +#define _MIPIA_HACTIVE_AREA_COUNT (VLV_DISPLAY_BASE + 0xb034) +#define _MIPIB_HACTIVE_AREA_COUNT (VLV_DISPLAY_BASE + 0xb834) +#define MIPI_HACTIVE_AREA_COUNT (pipe) _PIPE(pipe, _MIPIA_HACTIVE_AREA_COUNT, _MIPIB_HACTIVE_AREA_COUNT) + +#define _MIPIA_VSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb038) +#define _MIPIB_VSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb838) +#define MIPI_VSYNC_PADDING_COUNT (pipe) _PIPE(pipe, _MIPIA_VSYNC_PADDING_COUNT, _MIPIB_VSYNC_PADDING_COUNT) + +#define _MIPIA_VBP_COUNT (VLV_DISPLAY_BASE + 0xb03c) +#define _MIPIB_VBP_COUNT (VLV_DISPLAY_BASE + 0xb83c) +#define MIPI_VBP_COUNT (pipe) _PIPE(pipe, _MIPIA_VBP_COUNT, _MIPIB_VBP_COUNT) + +#define _MIPIA_VFP_COUNT (VLV_DISPLAY_BASE + 0xb040) +#define _MIPIB_VFP_COUNT (VLV_DISPLAY_BASE + 0xb840) +#define MIPI_VFP_COUNT (pipe) _PIPE(pipe, _MIPIA_VFP_COUNT, _MIPIB_VFP_COUNT)
drivers/gpu/drm/i915/i915_reg.h line 5305
Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +10
-0+ +#define _MIPIA_HIGH_LOW_SWITCH_COUNT (VLV_DISPLAY_BASE + 0xb044) +#define _MIPIB_HIGH_LOW_SWITCH_COUNT (VLV_DISPLAY_BASE + 0xb844) +#define MIPI_HIGH_LOW_SWITCH_COUNT (pipe) _PIPE(pipe, _MIPIA_HIGH_LOW_SWITCH_COUNT, _MIPIB_HIGH_LOW_SWITCH_COUNT) +/* regs above are bits 15:0 */ + +#define _MIPIA_DPI_CONTROL (VLV_DISPLAY_BASE + 0xb048) +#define _MIPIB_DPI_CONTROL (VLV_DISPLAY_BASE + 0xb848) +#define MIPI_DPI_CONTROL (pipe) _PIPE(pipe, _MIPIA_DPI_CONTROL, _MIPIB_DPI_CONTROL) +#define DPI_HS_MODE (1 << 6)
Spec says 0=HS 1=LP, so this seems a bit backwards.
Quoted 218 lines
drivers/gpu/drm/i915/i915_reg.h +210
-0+#define BACKLIGHT_OFF (1 << 5) +#define BACKLIGHT_ON (1 << 4) +#define COLOR_MODE_OFF (1 << 3) +#define COLOR_MODE_ON (1 << 2) +#define TURN_ON (1 << 1) +#define SHUTDOWN (1 << 0) + +#define _MIPIA_DPI_DATA (VLV_DISPLAY_BASE + 0xb04c) +#define _MIPIB_DPI_DATA (VLV_DISPLAY_BASE + 0xb84c) +#define MIPI_DPI_DATA (pipe) _PIPE(pipe, _MIPIA_DPI_DATA, _MIPIB_DPI_DATA) +#define COMMAND_BYTE_SHIFT 0 +#define COMMAND_BYTE_MASK (0x3f << 0) + +#define _MIPIA_INIT_COUNT (VLV_DISPLAY_BASE + 0xb050) +#define _MIPIB_INIT_COUNT (VLV_DISPLAY_BASE + 0xb850) +#define MIPI_INIT_COUNT (pipe) _PIPE(pipe, _MIPIA_INIT_COUNT, _MIPIB_INIT_COUNT) +#define MASTER_INIT_TIMER_SHIFT 0 +#define MASTER_INIT_TIMER_MASK (0xffff << 0) + +#define _MIPIA_MAX_RETURN_PKT_SIZE (VLV_DISPLAY_BASE + 0xb054) +#define _MIPIB_MAX_RETURN_PKT_SIZE (VLV_DISPLAY_BASE + 0xb854) +#define MIPI_MAX_RETURN_PKT_SIZE (pipe) _PIPE(pipe, _MIPIA_MAX_RETURN_PKT_SIZE, _MIPIB_MAX_RETURN_PKT_SIZE) +#define MAX_RETURN_PKT_SIZE_SHIFT 0 +#define MAX_RETURN_PKT_SIZE_MASK (0x3ff << 0) + +#define _MIPIA_VIDEO_MODE_FORMAT (VLV_DISPLAY_BASE + 0xb058) +#define _MIPIB_VIDEO_MODE_FORMAT (VLV_DISPLAY_BASE + 0xb858) +#define MIPI_VIDEO_MODE_FORMAT (pipe) _PIPE(pipe, _MIPIA_VIDEO_MODE_FORMAT, _MIPIB_VIDEO_MODE_FORMAT) +#define RANDOM_DPI_DISPLAY_RESOLUTION (1 << 4) +#define DISABLE_VIDEO_BTA (1 << 3) +#define IP_TG_CONFIG (1 << 2) +#define VIDEO_MODE_NON_BURST_WITH_SYNC_PULSE (1 << 0) +#define VIDEO_MODE_NON_BURST_WITH_SYNC_EVENTS (2 << 0) +#define VIDEO_MODE_BURST (3 << 0) + +#define _MIPIA_EOT_DISABLE (VLV_DISPLAY_BASE + 0xb05c) +#define _MIPIB_EOT_DISABLE (VLV_DISPLAY_BASE + 0xb85c) +#define MIPI_EOT_DISABLE (pipe) _PIPE(pipe, _MIPIA_EOT_DISABLE, _MIPIB_EOT_DISABLE) +#define LP_RX_TIMEOUT_ERROR_RECOVERY_DISABLE (1 << 7) +#define HS_RX_TIMEOUT_ERROR_RECOVERY_DISABLE (1 << 6) +#define LOW_CONTENTION_RECOVERY_DISABLE (1 << 5) +#define HIGH_CONTENTION_RECOVERY_DISABLE (1 << 4) +#define TXDSI_TYPE_NOT_RECOGNISED_ERROR_RECOVERY_DISABLE (1 << 3) +#define TXECC_MULTIBIT_ERROR_RECOVERY_DISABLE (1 << 2) +#define CLOCKSTOP (1 << 1) +#define EOT_DISABLE (1 << 0) + +#define _MIPIA_LP_BYTECLK (VLV_DISPLAY_BASE + 0xb060) +#define _MIPIB_LP_BYTECLK (VLV_DISPLAY_BASE + 0xb860) +#define MIPI_LP_BYTECLK (pipe) _PIPE(pipe, _MIPIA_LP_BYTECLK, _MIPIB_LP_BYTECLK) +#define LP_BYTECLK_SHIFT 0 +#define LP_BYTECLK_MASK (0xffff << 0) + +/* bits 31:0 */ +#define _MIPIA_LP_GEN_DATA (VLV_DISPLAY_BASE + 0xb064) +#define _MIPIB_LP_GEN_DATA (VLV_DISPLAY_BASE + 0xb864) +#define MIPI_LP_GEN_DATA (pipe) _PIPE(pipe, _MIPIA_LP_GEN_DATA, _MIPIB_LP_GEN_DATA) + +/* bits 31:0 */ +#define _MIPIA_HS_GEN_DATA (VLV_DISPLAY_BASE + 0xb068) +#define _MIPIB_HS_GEN_DATA (VLV_DISPLAY_BASE + 0xb868) +#define MIPI_HS_GEN_DATA (pipe) _PIPE(pipe, _MIPIA_HS_GEN_DATA, _MIPIB_HS_GEN_DATA) + +#define _MIPIA_LP_GEN_CTRL (VLV_DISPLAY_BASE + 0xb06c) +#define _MIPIB_LP_GEN_CTRL (VLV_DISPLAY_BASE + 0xb86c) +#define MIPI_LP_GEN_CTRL (pipe) _PIPE(pipe, _MIPIA_LP_GEN_CTRL, _MIPIB_LP_GEN_CTRL) +#define _MIPIA_HS_GEN_CTRL (VLV_DISPLAY_BASE + 0xb070) +#define _MIPIB_HS_GEN_CTRL (VLV_DISPLAY_BASE + 0xb870) +#define MIPI_HS_GEN_CTRL (pipe) _PIPE(pipe, _MIPIA_HS_GEN_CTRL, _MIPIB_HS_GEN_CTRL) +#define LONG_PACKET_WORD_COUNT_SHIFT 8 +#define LONG_PACKET_WORD_COUNT_MASK (0xffff << 8) +#define SHORT_PACKET_PARAM_SHIFT 8 +#define SHORT_PACKET_PARAM_MASK (0xffff << 8) +#define VIRTUAL_CHANNEL_SHIFT 6 +#define VIRTUAL_CHANNEL_MASK (3 << 6) +#define DATA_TYPE_SHIFT 0 +#define DATA_TYPE_MASK (3f << 0) +/* data type values, see include/video/mipi_display.h */ + +#define _MIPIA_GEN_FIFO_STAT (VLV_DISPLAY_BASE + 0xb074) +#define _MIPIB_GEN_FIFO_STAT (VLV_DISPLAY_BASE + 0xb874) +#define MIPI_GEN_FIFO_STAT (pipe) _PIPE(pipe, _MIPIA_GEN_FIFO_STAT, _MIPIB_GEN_FIFO_STAT) +#define DPI_FIFO_EMPTY (1 << 28) +#define DBI_FIFO_EMPTY (1 << 27) +#define LP_CTRL_FIFO_EMPTY (1 << 26) +#define LP_CTRL_FIFO_HALF_EMPTY (1 << 25) +#define LP_CTRL_FIFO_FULL (1 << 24) +#define HS_CTRL_FIFO_EMPTY (1 << 18) +#define HS_CTRL_FIFO_HALF_EMPTY (1 << 17) +#define HS_CTRL_FIFO_FULL (1 << 16) +#define LP_DATA_FIFO_EMPTY (1 << 10) +#define LP_DATA_FIFO_HALF_EMPTY (1 << 9) +#define LP_DATA_FIFO_FULL (1 << 8) +#define HS_DATA_FIFO_EMPTY (1 << 2) +#define HS_DATA_FIFO_HALF_EMPTY (1 << 1) +#define HS_DATA_FIFO_FULL (1 << 0) + +#define _MIPIA_HS_LS_DBI_ENABLE (VLV_DISPLAY_BASE + 0xb078) +#define _MIPIB_HS_LS_DBI_ENABLE (VLV_DISPLAY_BASE + 0xb878) +#define MIPI_HS_LP_DBI_ENABLE (pipe) _PIPE(pipe, _MIPIA_HS_LS_DBI_ENABLE, _MIPIB_HS_LS_DBI_ENABLE) +#define DBI_HS_LP_MODE_MASK (1 << 0) +#define DBI_LP_MODE (1 << 0) +#define DBI_HS_MODE (0 << 0) + +#define _MIPIA_DPHY_PARAM (VLV_DISPLAY_BASE + 0xb080) +#define _MIPIB_DPHY_PARAM (VLV_DISPLAY_BASE + 0xb880) +#define MIPI_DPHY_PARAM (pipe) _PIPE(pipe, _MIPIA_DPHY_PARAM, _MIPIB_DPHY_PARAM) +#define EXIT_ZERO_COUNT_SHIFT 24 +#define EXIT_ZERO_COUNT_MASK (0x3f << 24) +#define TRAIL_COUNT_SHIFT 16 +#define TRAIL_COUNT_MASK (0x1f << 16) +#define CLK_ZERO_COUNT_SHIFT 8 +#define CLK_ZERO_COUNT_MASK (0xff << 8) +#define PREPARE_COUNT_SHIFT 0 +#define PREPARE_COUNT_MASK (0x3f << 0) + +/* bits 31:0 */ +#define _MIPIA_DBI_BW_CTRL (VLV_DISPLAY_BASE + 0xb084) +#define _MIPIB_DBI_BW_CTRL (VLV_DISPLAY_BASE + 0xb884) +#define MIPI_DBI_BW_CTRL (pipe) _PIPE(pipe, _MIPIA_DBI_BW_CTRL, _MIPIB_DBI_BW_CTRL) + +#define _MIPIA_CLK_LANE_SWITCH_TIME_CNT (VLV_DISPLAY_BASE + 0xb088) +#define _MIPIB_CLK_LANE_SWITCH_TIME_CNT (VLV_DISPLAY_BASE + 0xb888) +#define MIPI_CLK_LANE_SWITCH_TIME_CNT (pipe) _PIPE(pipe, _MIPIA_CLK_LANE_SWITCH_TIME_CNT, _MIPIB_CLK_LANE_SWITCH_TIME_CNT) +#define LP_HS_SSW_CNT_SHIFT 16 +#define LP_HS_SSW_CNT_MASK (0xffff << 16) +#define HS_LP_PWR_SW_CNT_SHIFT 0 +#define HS_LP_PWR_SW_CNT_MASK (0xffff << 0) + +#define _MIPIA_STOP_STATE_STALL (VLV_DISPLAY_BASE + 0xb08c) +#define _MIPIB_STOP_STATE_STALL (VLV_DISPLAY_BASE + 0xb88c) +#define MIPI_STOP_STATE_STALL (pipe) _PIPE(pipe, _MIPIA_STOP_STATE_STALL, _MIPIB_STOP_STATE_STALL) +#define STOP_STATE_STALL_COUNTER_SHIFT 0 +#define STOP_STATE_STALL_COUNTER_MASK (0xff << 0) + +#define _MIPIA_INTR_STAT_REG_1 (VLV_DISPLAY_BASE + 0xb090) +#define _MIPIB_INTR_STAT_REG_1 (VLV_DISPLAY_BASE + 0xb890) +#define MIPI_INTR_STAT_REG_1 (pipe) _PIPE(pipe, _MIPIA_INTR_STAT_REG_1, _MIPIB_INTR_STAT_REG_1) +#define _MIPIA_INTR_EN_REG_1 (VLV_DISPLAY_BASE + 0xb094) +#define _MIPIB_INTR_EN_REG_1 (VLV_DISPLAY_BASE + 0xb894) +#define MIPI_INTR_EN_REG_1 (pipe) _PIPE(pipe, _MIPIA_INTR_EN_REG_1, _MIPIB_INTR_EN_REG_1) +#define RX_CONTENTION_DETECTED (1 << 0) + +/* XXX: only pipe A ?!? */ +#define MIPIA_DBI_TYPEC_CTRL (VLV_DISPLAY_BASE + 0xb100) +#define DBI_TYPEC_ENABLE (1 << 31) +#define DBI_TYPEC_WIP (1 << 30) +#define DBI_TYPEC_OPTION_SHIFT 28 +#define DBI_TYPEC_OPTION_MASK (3 << 28) +#define DBI_TYPEC_FREQ_SHIFT 24 +#define DBI_TYPEC_FREQ_MASK (0xf << 24) +#define DBI_TYPEC_OVERRIDE (1 << 8) +#define DBI_TYPEC_OVERRIDE_COUNTER_SHIFT 0 +#define DBI_TYPEC_OVERRIDE_COUNTER_MASK (0xff << 0) + + +/* MIPI adapter registers */ + +#define _MIPIA_CTRL (VLV_DISPLAY_BASE + 0xb104) +#define _MIPIB_CTRL (VLV_DISPLAY_BASE + 0xb904) +#define MIPI_CTRL (pipe) _PIPE(pipe, _MIPIA_CTRL, _MIPIB_CTRL) +#define ESCAPE_CLOCK_DIVIDER_SHIFT 5/* A only */ +#define ESCAPE_CLOCK_DIVIDER_MASK (3 << 5) +#define ESCAPE_CLOCK_DIVIDER_1 (0 << 5) +#define ESCAPE_CLOCK_DIVIDER_2 (1 << 5) +#define ESCAPE_CLOCK_DIVIDER_4 (2 << 5) +#define READ_REQUEST_PRIORITY_SHIFT 3 +#define READ_REQUEST_PRIORITY_MASK (3 << 3) +#define READ_REQUEST_PRIORITY_LOW (0 << 3) +#define READ_REQUEST_PRIORITY_HIGH (3 << 3) +#define RGB_FLIP_TO_BGR (1 << 2) + +#define _MIPIA_DATA_ADDRESS (VLV_DISPLAY_BASE + 0xb108) +#define _MIPIB_DATA_ADDRESS (VLV_DISPLAY_BASE + 0xb908) +#define MIPI_DATA_ADDRESS (pipe) _PIPE(pipe, _MIPIA_DATA_ADDRESS, _MIPIB_DATA_ADDRESS) +#define DATA_MEM_ADDRESS_SHIFT 5 +#define DATA_MEM_ADDRESS_MASK (0x7ffffff << 5) +#define DATA_VALID (1 << 0) + +#define _MIPIA_DATA_LENGTH (VLV_DISPLAY_BASE + 0xb10c) +#define _MIPIB_DATA_LENGTH (VLV_DISPLAY_BASE + 0xb90c) +#define MIPI_DATA_LENGTH (pipe) _PIPE(pipe, _MIPIA_DATA_LENGTH, _MIPIB_DATA_LENGTH) +#define DATA_LENGTH_SHIFT 0 +#define DATA_LENGTH_MASK (0xfffff << 0) + +#define _MIPIA_COMMAND_ADDRESS (VLV_DISPLAY_BASE + 0xb110) +#define _MIPIB_COMMAND_ADDRESS (VLV_DISPLAY_BASE + 0xb910) +#define MIPI_COMMAND_ADDRESS (pipe) _PIPE(pipe, _MIPIA_COMMAND_ADDRESS, _MIPIB_COMMAND_ADDRESS) +#define COMMAND_MEM_ADDRESS_SHIFT 5 +#define COMMAND_MEM_ADDRESS_MASK (0x7ffffff << 5) +#define AUTO_PWG_ENABLE (1 << 2) +#define MEMORY_WRITE_DATA_FROM_PIPE_RENDERING (1 << 1) +#define COMMAND_VALID (1 << 0) + +#define _MIPIA_COMMAND_LENGTH (VLV_DISPLAY_BASE + 0xb114) +#define _MIPIB_COMMAND_LENGTH (VLV_DISPLAY_BASE + 0xb914) +#define MIPI_COMMAND_LENGTH (pipe) _PIPE(pipe, _MIPIA_COMMAND_LENGTH, _MIPIB_COMMAND_LENGTH) +#define COMMAND_LENGTH_SHIFT (n) (8 * (n))/* n: 0...3 */ +#define COMMAND_LENGTH_MASK (n) (0xff << (8 * (n))) + +#define _MIPIA_READ_DATA_RETURN0 (VLV_DISPLAY_BASE + 0xb118) +#define _MIPIB_READ_DATA_RETURN0 (VLV_DISPLAY_BASE + 0xb918) +#define MIPI_READ_DATA_RETURN (pipe, n) \ + (_PIPE(pipe, _MIPIA_READ_DATA_RETURN0, _MIPIB_READ_DATA_RETURN0) + 4 * (n))/* n: 0...7 */ + +#define _MIPIA_READ_DATA_VALID (VLV_DISPLAY_BASE + 0xb138) +#define _MIPIB_READ_DATA_VALID (VLV_DISPLAY_BASE + 0xb938) +#define MIPI_READ_DATA_VALID (pipe) _PIPE(pipe, _MIPIA_READ_DATA_VALID, _MIPIB_READ_DATA_VALID) +#define READ_DATA_VALID (n) (1 << (n)) +#endif /* _I915_REG_H_ */ Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä Intel OTC
Re: [PATCH 04/14] drm/i915: add MIPI DSI register definitions
Quoted 16 lines · Ville Syrjälä
Quoted 15 lines · Jani Nikula
Add definitions for VLV MIPI DSI registers.
Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 409 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 409 insertions(+)drivers/gpu/drm/i915/i915_reg.h +0
-0@@ -5104,4 +5104,413 @@#define PIPE_CSC_POSTOFF_ME (pipe) _PIPE(pipe, _PIPE_A_CSC_POSTOFF_ME, _PIPE_B_CSC_POSTOFF_ME)#define PIPE_CSC_POSTOFF_LO (pipe) _PIPE(pipe, _PIPE_A_CSC_POSTOFF_LO, _PIPE_B_CSC_POSTOFF_LO)
Quoted 14 lines
drivers/gpu/drm/i915/i915_reg.h line 5118
Quoted 12 lines
drivers/gpu/drm/i915/i915_reg.h +12
-0+/* VLV MIPI registers */ + +/* XXX: This register seems very messy. MIPIB has only enable and delay. */ +#define _MIPIA_PORT_CTRL (VLV_DISPLAY_BASE + 0x61190) +#define _MIPIB_PORT_CTRL (VLV_DISPLAY_BASE + 0x61700) +#define MIPI_PORT_CTRL (pipe) _PIPE(pipe, _MIPIA_PORT_CTRL, _MIPIB_PORT_CTRL) +#define DPI_ENABLE (1 << 31)/* A + B */ +#define MIPIA_MIPI4DPHY_DELAY_COUNT_SHIFT 27 +#define MIPIA_MIPI4DPHY_DELAY_COUNT_MASK (0xf << 27) +#define DUAL_LINK_MODE_MASK (1 << 26) +#define DUAL_LINK_MODE_FRONT_BACK (0 << 26) +#define DUAL_LINK_MODE_PIXEL_ALTERNATIVE (1 << 26)25 is "Dither Enable" according to my docs.
Fixed.
Quoted 5 lines
drivers/gpu/drm/i915/i915_reg.h line 5120
Quoted 2 lines
drivers/gpu/drm/i915/i915_reg.h +2
-0+#define FLOPPED_HSTX (1 << 23) +#define DE_INVERT (1 << 19)/* XXX */ One doc has
DE_INVERT(and HS/VS invert and border enable bits), another has the FLISDSI stuff. I guess that's the XXX here.
Yeah, and as you can see the two are overlapping. I'd like to keep it like this as a memory aid.
Quoted 5 lines
drivers/gpu/drm/i915/i915_reg.h line 5123
Quoted 3 lines
drivers/gpu/drm/i915/i915_reg.h +3
-0+#define MIPIA_FLISDSI_DELAY_COUNT_SHIFT 18 +#define MIPIA_FLISDSI_DELAY_COUNT_MASK (0xf << 18) +#define AFE_LATCHOUT (1 << 17)16 is "LPOutput Hold"
Added.
Quoted 28 lines
Quoted 28 lines
drivers/gpu/drm/i915/i915_reg.h +28
-0+#define MIPIB_FLISDSI_DELAY_COUNT_HIGH_SHIFT 15 +#define MIPIB_FLISDSI_DELAY_COUNT_HIGH_MASK (1 << 15) +#define MIPIB_MIPI4DPHY_DELAY_COUNT_SHIFT 11 +#define MIPIB_MIPI4DPHY_DELAY_COUNT_MASK (0xf << 11) +#define CSB_SHIFT 9 +#define CSB_MASK (3 << 9) +#define CSB_20MHZ (0 << 9) +#define CSB_10MHZ (1 << 9) +#define CSB_40MHZ (2 << 9) +#define BANDGAP_MASK (1 << 8) +#define BANDGAP_PNW_CIRCUIT (0 << 8) +#define BANDGAP_LNC_CIRCUIT (1 << 8) +#define MIPIB_FLISDSI_DELAY_COUNT_LOW_SHIFT 5 +#define MIPIB_FLISDSI_DELAY_COUNT_LOW_MASK (7 << 5) +#define TEARING_EFFECT_DELAY (1 << 4)/* A + B */ +#define TEARING_EFFECT_SHIFT 2/* A + B */ +#define TEARING_EFFECT_MASK (3 << 2) +#define TEARING_EFFECT_OFF (0 << 2) +#define TEARING_EFFECT_DSI (1 << 2) +#define TEARING_EFFECT_GPIO (2 << 2) +#define LANE_CONFIGURATION_SHIFT 0 +#define LANE_CONFIGURATION_MASK (3 << 0) +#define LANE_CONFIGURATION_4LANE (0 << 0) +#define LANE_CONFIGURATION_DUAL_LINK_A (1 << 0) +#define LANE_CONFIGURATION_DUAL_LINK_B (2 << 0) + +#define _MIPIA_TEARING_CTRL (VLV_DISPLAY_BASE + 0x61194) +#define _MIPIB_TEARING_CTRL (VLV_DISPLAY_BASE + 0x61704)
Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h line 5157
Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +6
-0+#define MIPI_TEARING_CTRL (pipe) _PIPE(pipe, _MIPIA_TEARING_CTRL, _MIPIB_TEARING_CTRL) +#define TEARING_EFFECT_DELAY_SHIFT 0 +#define TEARING_EFFECT_DELAY_MASK (0xffff << 0) + +/* XXX */ +#define _MIPIA_AUTOPWG (VLV_DISPLAY_BASE + 0x611a0)Is the XXX here because the spec says the contents are all "reserved"?
Yes; do you prefer adding that to the comment, or dropping the register altogether?
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +4
-0+ +/* MIPI DSI Controller and D-PHY registers */ + +#define _MIPIA_DEVICE_READY (VLV_DISPLAY_BASE + 0xb000)
Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h line 5167
Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +6
-0+#define _MIPIB_DEVICE_READY (VLV_DISPLAY_BASE + 0xb800) +#define MIPI_DEVICE_READY (pipe) _PIPE(pipe, _MIPIA_DEVICE_READY, _MIPIB_DEVICE_READY) +#define BUS_POSSESSION (1 << 3)/* set to give bus to receiver */ +#define ULPS_STATE_MASK (3 << 1) +#define ULPS_STATE_ENTER (2 << 1)/* XXX */ +#define ULPS_STATE_EXIT (1 << 1)/* XXX */ Maybe we should have the (0 << 1) "normal operation" listed here as well?
Added.
Quoted 91 lines
Quoted 91 lines
drivers/gpu/drm/i915/i915_reg.h +91
-0+#define DEVICE_READY (1 << 0) + +#define _MIPIA_INTR_STAT (VLV_DISPLAY_BASE + 0xb004) +#define _MIPIB_INTR_STAT (VLV_DISPLAY_BASE + 0xb804) +#define MIPI_INTR_STAT (pipe) _PIPE(pipe, _MIPIA_INTR_STAT, _MIPIB_INTR_STAT) +#define _MIPIA_INTR_EN (VLV_DISPLAY_BASE + 0xb008) +#define _MIPIB_INTR_EN (VLV_DISPLAY_BASE + 0xb808) +#define MIPI_INTR_EN (pipe) _PIPE(pipe, _MIPIA_INTR_EN, _MIPIB_INTR_EN) +#define TEARING_EFFECT (1 << 31) +#define SPL_PKT_SENT_INTERRUPT (1 << 30) +#define GEN_READ_DATA_AVAIL (1 << 29) +#define LP_GENERIC_WR_FIFO_FULL (1 << 28) +#define HS_GENERIC_WR_FIFO_FULL (1 << 27) +#define RX_PROT_VIOLATION (1 << 26) +#define RX_INVALID_TX_LENGTH (1 << 25) +#define ACK_WITH_NO_ERROR (1 << 24) +#define TURN_AROUND_ACK_TIMEOUT (1 << 23) +#define LP_RX_TIMEOUT (1 << 22) +#define HS_TX_TIMEOUT (1 << 21) +#define DPI_FIFO_UNDERRUN (1 << 20) +#define LOW_CONTENTION (1 << 19) +#define HIGH_CONTENTION (1 << 18) +#define TXDSI_VC_ID_INVALID (1 << 17) +#define TXDSI_DATA_TYPE_NOT_RECOGNISED (1 << 16) +#define TXCHECKSUM_ERROR (1 << 15) +#define TXECC_MULTIBIT_ERROR (1 << 14) +#define TXECC_SINGLE_BIT_ERROR (1 << 13) +#define TXFALSE_CONTROL_ERROR (1 << 12) +#define RXDSI_VC_ID_INVALID (1 << 11) +#define RXDSI_DATA_TYPE_NOT_REGOGNISED (1 << 10) +#define RXCHECKSUM_ERROR (1 << 9) +#define RXECC_MULTIBIT_ERROR (1 << 8) +#define RXECC_SINGLE_BIT_ERROR (1 << 7) +#define RXFALSE_CONTROL_ERROR (1 << 6) +#define RXHS_RECEIVE_TIMEOUT_ERROR (1 << 5) +#define RX_LP_TX_SYNC_ERROR (1 << 4) +#define RXEXCAPE_MODE_ENTRY_ERROR (1 << 3) +#define RXEOT_SYNC_ERROR (1 << 2) +#define RXSOT_SYNC_ERROR (1 << 1) +#define RXSOT_ERROR (1 << 0) + +#define _MIPIA_DSI_FUNC_PRG (VLV_DISPLAY_BASE + 0xb00c) +#define _MIPIB_DSI_FUNC_PRG (VLV_DISPLAY_BASE + 0xb80c) +#define MIPI_DSI_FUNC_PRG (pipe) _PIPE(pipe, _MIPIA_DSI_FUNC_PRG, _MIPIB_DSI_FUNC_PRG) +#define CMD_MODE_DATA_WIDTH_MASK (7 << 13) +#define CMD_MODE_NOT_SUPPORTED (0 << 13) +#define CMD_MODE_DATA_WIDTH_16_BIT (1 << 13) +#define CMD_MODE_DATA_WIDTH_9_BIT (2 << 13) +#define CMD_MODE_DATA_WIDTH_8_BIT (3 << 13) +#define CMD_MODE_DATA_WIDTH_OPTION1 (4 << 13) +#define CMD_MODE_DATA_WIDTH_OPTION2 (5 << 13) +#define VID_MODE_FORMAT_MASK (0xf << 7) +#define VID_MODE_NOT_SUPPORTED (0 << 7) +#define VID_MODE_FORMAT_RGB565 (1 << 7) +#define VID_MODE_FORMAT_RGB666 (2 << 7) +#define VID_MODE_FORMAT_RGB666_LOOSE (3 << 7) +#define VID_MODE_FORMAT_RGB888 (4 << 7) +#define CMD_MODE_CHANNEL_NUMBER_SHIFT 5 +#define CMD_MODE_CHANNEL_NUMBER_MASK (3 << 5) +#define VID_MODE_CHANNEL_NUMBER_SHIFT 3 +#define VID_MODE_CHANNEL_NUMBER_MASK (3 << 3) +#define DATA_LANES_PRG_REG_SHIFT 0 +#define DATA_LANES_PRG_REG_MASK (7 << 0) + +#define _MIPIA_HS_TX_TIMEOUT (VLV_DISPLAY_BASE + 0xb010) +#define _MIPIB_HS_TX_TIMEOUT (VLV_DISPLAY_BASE + 0xb810) +#define MIPI_HS_TX_TIMEOUT (pipe) _PIPE(pipe, _MIPIA_HS_TX_TIMEOUT, _MIPIB_HS_TX_TIMEOUT) +#define HIGH_SPEED_TX_TIMEOUT_COUNTER_MASK 0xffffff + +#define _MIPIA_LP_RX_TIMEOUT (VLV_DISPLAY_BASE + 0xb014) +#define _MIPIB_LP_RX_TIMEOUT (VLV_DISPLAY_BASE + 0xb814) +#define MIPI_LP_RX_TIMEOUT (pipe) _PIPE(pipe, _MIPIA_LP_RX_TIMEOUT, _MIPIB_LP_RX_TIMEOUT) +#define LOW_POWER_RX_TIMEOUT_COUNTER_MASK 0xffffff + +#define _MIPIA_TURN_AROUND_TIMEOUT (VLV_DISPLAY_BASE + 0xb018) +#define _MIPIB_TURN_AROUND_TIMEOUT (VLV_DISPLAY_BASE + 0xb818) +#define MIPI_TURN_AROUND_TIMEOUT (pipe) _PIPE(pipe, _MIPIA_TURN_AROUND_TIMEOUT, _MIPIB_TURN_AROUND_TIMEOUT) +#define TURN_AROUND_TIMEOUT_MASK 0x3f + +#define _MIPIA_DEVICE_RESET_TIMER (VLV_DISPLAY_BASE + 0xb01c) +#define _MIPIB_DEVICE_RESET_TIMER (VLV_DISPLAY_BASE + 0xb81c) +#define MIPI_DEVICE_RESET_TIMER (pipe) _PIPE(pipe, _MIPIA_DEVICE_RESET_TIMER, _MIPIB_DEVICE_RESET_TIMER) +#define DEVICE_RESET_TIMER_MASK 0xffff + +#define _MIPIA_DPI_RESOLUTION (VLV_DISPLAY_BASE + 0xb020) +#define _MIPIB_DPI_RESOLUTION (VLV_DISPLAY_BASE + 0xb820) +#define MIPI_DPI_RESOLUTION (pipe) _PIPE(pipe, _MIPIA_DPI_RESOLUTION, _MIPIB_DPI_RESOLUTION) +#define VERTICAL_ADDRESS_SHIFT 16 +#define VERTICAL_ADDRESS_MASK (0xffff << 16) +#define HORIZONTAL_ADDRESS_SHIFT 0 +#define HORIZONTAL_ADDRESS_MASK 0xffff
Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h line 5262
Quoted 4 lines
drivers/gpu/drm/i915/i915_reg.h +4
-0+ +/* XXX */ +#define _MIPIA_DBI_FIFO_THROTTLE (VLV_DISPLAY_BASE + 0xb024) +#define _MIPIB_DBI_FIFO_THROTTLE (VLV_DISPLAY_BASE + 0xb824)Is the XXX about the register name here? Spec lists it as
MIPIA_DBI_RESOLUTION, which doesn't make much sense based on the contents.
Yes. I dropped the XXX comment. Another spec names the reg as DBI_FIFO_THROTTLE, which I'm inclided to trust as it matches the contents.
Quoted 37 lines
Quoted 37 lines
drivers/gpu/drm/i915/i915_reg.h +37
-0+#define MIPI_DBI_FIFO_THROTTLE (pipe) _PIPE(pipe, _MIPIA_DBI_FIFO_THROTTLE, _MIPIB_DBI_FIFO_THROTTLE) +#define DBI_FIFO_EMPTY_HALF (0 << 0) +#define DBI_FIFO_EMPTY_QUARTER (1 << 0) +#define DBI_FIFO_EMPTY_7_LOCATIONS (2 << 0) + +/* regs below are bits 15:0 */ +#define _MIPIA_HSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb028) +#define _MIPIB_HSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb828) +#define MIPI_HSYNC_PADDING_COUNT (pipe) _PIPE(pipe, _MIPIA_HSYNC_PADDING_COUNT, _MIPIB_HSYNC_PADDING_COUNT) + +#define _MIPIA_HBP_COUNT (VLV_DISPLAY_BASE + 0xb02c) +#define _MIPIB_HBP_COUNT (VLV_DISPLAY_BASE + 0xb82c) +#define MIPI_HBP_COUNT (pipe) _PIPE(pipe, _MIPIA_HBP_COUNT, _MIPIB_HBP_COUNT) + +#define _MIPIA_HFP_COUNT (VLV_DISPLAY_BASE + 0xb030) +#define _MIPIB_HFP_COUNT (VLV_DISPLAY_BASE + 0xb830) +#define MIPI_HFP_COUNT (pipe) _PIPE(pipe, _MIPIA_HFP_COUNT, _MIPIB_HFP_COUNT) + +#define _MIPIA_HACTIVE_AREA_COUNT (VLV_DISPLAY_BASE + 0xb034) +#define _MIPIB_HACTIVE_AREA_COUNT (VLV_DISPLAY_BASE + 0xb834) +#define MIPI_HACTIVE_AREA_COUNT (pipe) _PIPE(pipe, _MIPIA_HACTIVE_AREA_COUNT, _MIPIB_HACTIVE_AREA_COUNT) + +#define _MIPIA_VSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb038) +#define _MIPIB_VSYNC_PADDING_COUNT (VLV_DISPLAY_BASE + 0xb838) +#define MIPI_VSYNC_PADDING_COUNT (pipe) _PIPE(pipe, _MIPIA_VSYNC_PADDING_COUNT, _MIPIB_VSYNC_PADDING_COUNT) + +#define _MIPIA_VBP_COUNT (VLV_DISPLAY_BASE + 0xb03c) +#define _MIPIB_VBP_COUNT (VLV_DISPLAY_BASE + 0xb83c) +#define MIPI_VBP_COUNT (pipe) _PIPE(pipe, _MIPIA_VBP_COUNT, _MIPIB_VBP_COUNT) + +#define _MIPIA_VFP_COUNT (VLV_DISPLAY_BASE + 0xb040) +#define _MIPIB_VFP_COUNT (VLV_DISPLAY_BASE + 0xb840) +#define MIPI_VFP_COUNT (pipe) _PIPE(pipe, _MIPIA_VFP_COUNT, _MIPIB_VFP_COUNT) + +#define _MIPIA_HIGH_LOW_SWITCH_COUNT (VLV_DISPLAY_BASE + 0xb044) +#define _MIPIB_HIGH_LOW_SWITCH_COUNT (VLV_DISPLAY_BASE + 0xb844) +#define MIPI_HIGH_LOW_SWITCH_COUNT (pipe) _PIPE(pipe, _MIPIA_HIGH_LOW_SWITCH_COUNT, _MIPIB_HIGH_LOW_SWITCH_COUNT)
Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h line 5305
Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +6
-0+/* regs above are bits 15:0 */ + +#define _MIPIA_DPI_CONTROL (VLV_DISPLAY_BASE + 0xb048) +#define _MIPIB_DPI_CONTROL (VLV_DISPLAY_BASE + 0xb848) +#define MIPI_DPI_CONTROL (pipe) _PIPE(pipe, _MIPIA_DPI_CONTROL, _MIPIB_DPI_CONTROL) +#define DPI_HS_MODE (1 << 6)Spec says 0=HS 1=LP, so this seems a bit backwards.
*blush* Fixed.
Thanks for the review,
Jani.
Quoted 226 lines
Quoted 218 lines
drivers/gpu/drm/i915/i915_reg.h +210
-0+#define BACKLIGHT_OFF (1 << 5) +#define BACKLIGHT_ON (1 << 4) +#define COLOR_MODE_OFF (1 << 3) +#define COLOR_MODE_ON (1 << 2) +#define TURN_ON (1 << 1) +#define SHUTDOWN (1 << 0) + +#define _MIPIA_DPI_DATA (VLV_DISPLAY_BASE + 0xb04c) +#define _MIPIB_DPI_DATA (VLV_DISPLAY_BASE + 0xb84c) +#define MIPI_DPI_DATA (pipe) _PIPE(pipe, _MIPIA_DPI_DATA, _MIPIB_DPI_DATA) +#define COMMAND_BYTE_SHIFT 0 +#define COMMAND_BYTE_MASK (0x3f << 0) + +#define _MIPIA_INIT_COUNT (VLV_DISPLAY_BASE + 0xb050) +#define _MIPIB_INIT_COUNT (VLV_DISPLAY_BASE + 0xb850) +#define MIPI_INIT_COUNT (pipe) _PIPE(pipe, _MIPIA_INIT_COUNT, _MIPIB_INIT_COUNT) +#define MASTER_INIT_TIMER_SHIFT 0 +#define MASTER_INIT_TIMER_MASK (0xffff << 0) + +#define _MIPIA_MAX_RETURN_PKT_SIZE (VLV_DISPLAY_BASE + 0xb054) +#define _MIPIB_MAX_RETURN_PKT_SIZE (VLV_DISPLAY_BASE + 0xb854) +#define MIPI_MAX_RETURN_PKT_SIZE (pipe) _PIPE(pipe, _MIPIA_MAX_RETURN_PKT_SIZE, _MIPIB_MAX_RETURN_PKT_SIZE) +#define MAX_RETURN_PKT_SIZE_SHIFT 0 +#define MAX_RETURN_PKT_SIZE_MASK (0x3ff << 0) + +#define _MIPIA_VIDEO_MODE_FORMAT (VLV_DISPLAY_BASE + 0xb058) +#define _MIPIB_VIDEO_MODE_FORMAT (VLV_DISPLAY_BASE + 0xb858) +#define MIPI_VIDEO_MODE_FORMAT (pipe) _PIPE(pipe, _MIPIA_VIDEO_MODE_FORMAT, _MIPIB_VIDEO_MODE_FORMAT) +#define RANDOM_DPI_DISPLAY_RESOLUTION (1 << 4) +#define DISABLE_VIDEO_BTA (1 << 3) +#define IP_TG_CONFIG (1 << 2) +#define VIDEO_MODE_NON_BURST_WITH_SYNC_PULSE (1 << 0) +#define VIDEO_MODE_NON_BURST_WITH_SYNC_EVENTS (2 << 0) +#define VIDEO_MODE_BURST (3 << 0) + +#define _MIPIA_EOT_DISABLE (VLV_DISPLAY_BASE + 0xb05c) +#define _MIPIB_EOT_DISABLE (VLV_DISPLAY_BASE + 0xb85c) +#define MIPI_EOT_DISABLE (pipe) _PIPE(pipe, _MIPIA_EOT_DISABLE, _MIPIB_EOT_DISABLE) +#define LP_RX_TIMEOUT_ERROR_RECOVERY_DISABLE (1 << 7) +#define HS_RX_TIMEOUT_ERROR_RECOVERY_DISABLE (1 << 6) +#define LOW_CONTENTION_RECOVERY_DISABLE (1 << 5) +#define HIGH_CONTENTION_RECOVERY_DISABLE (1 << 4) +#define TXDSI_TYPE_NOT_RECOGNISED_ERROR_RECOVERY_DISABLE (1 << 3) +#define TXECC_MULTIBIT_ERROR_RECOVERY_DISABLE (1 << 2) +#define CLOCKSTOP (1 << 1) +#define EOT_DISABLE (1 << 0) + +#define _MIPIA_LP_BYTECLK (VLV_DISPLAY_BASE + 0xb060) +#define _MIPIB_LP_BYTECLK (VLV_DISPLAY_BASE + 0xb860) +#define MIPI_LP_BYTECLK (pipe) _PIPE(pipe, _MIPIA_LP_BYTECLK, _MIPIB_LP_BYTECLK) +#define LP_BYTECLK_SHIFT 0 +#define LP_BYTECLK_MASK (0xffff << 0) + +/* bits 31:0 */ +#define _MIPIA_LP_GEN_DATA (VLV_DISPLAY_BASE + 0xb064) +#define _MIPIB_LP_GEN_DATA (VLV_DISPLAY_BASE + 0xb864) +#define MIPI_LP_GEN_DATA (pipe) _PIPE(pipe, _MIPIA_LP_GEN_DATA, _MIPIB_LP_GEN_DATA) + +/* bits 31:0 */ +#define _MIPIA_HS_GEN_DATA (VLV_DISPLAY_BASE + 0xb068) +#define _MIPIB_HS_GEN_DATA (VLV_DISPLAY_BASE + 0xb868) +#define MIPI_HS_GEN_DATA (pipe) _PIPE(pipe, _MIPIA_HS_GEN_DATA, _MIPIB_HS_GEN_DATA) + +#define _MIPIA_LP_GEN_CTRL (VLV_DISPLAY_BASE + 0xb06c) +#define _MIPIB_LP_GEN_CTRL (VLV_DISPLAY_BASE + 0xb86c) +#define MIPI_LP_GEN_CTRL (pipe) _PIPE(pipe, _MIPIA_LP_GEN_CTRL, _MIPIB_LP_GEN_CTRL) +#define _MIPIA_HS_GEN_CTRL (VLV_DISPLAY_BASE + 0xb070) +#define _MIPIB_HS_GEN_CTRL (VLV_DISPLAY_BASE + 0xb870) +#define MIPI_HS_GEN_CTRL (pipe) _PIPE(pipe, _MIPIA_HS_GEN_CTRL, _MIPIB_HS_GEN_CTRL) +#define LONG_PACKET_WORD_COUNT_SHIFT 8 +#define LONG_PACKET_WORD_COUNT_MASK (0xffff << 8) +#define SHORT_PACKET_PARAM_SHIFT 8 +#define SHORT_PACKET_PARAM_MASK (0xffff << 8) +#define VIRTUAL_CHANNEL_SHIFT 6 +#define VIRTUAL_CHANNEL_MASK (3 << 6) +#define DATA_TYPE_SHIFT 0 +#define DATA_TYPE_MASK (3f << 0) +/* data type values, see include/video/mipi_display.h */ + +#define _MIPIA_GEN_FIFO_STAT (VLV_DISPLAY_BASE + 0xb074) +#define _MIPIB_GEN_FIFO_STAT (VLV_DISPLAY_BASE + 0xb874) +#define MIPI_GEN_FIFO_STAT (pipe) _PIPE(pipe, _MIPIA_GEN_FIFO_STAT, _MIPIB_GEN_FIFO_STAT) +#define DPI_FIFO_EMPTY (1 << 28) +#define DBI_FIFO_EMPTY (1 << 27) +#define LP_CTRL_FIFO_EMPTY (1 << 26) +#define LP_CTRL_FIFO_HALF_EMPTY (1 << 25) +#define LP_CTRL_FIFO_FULL (1 << 24) +#define HS_CTRL_FIFO_EMPTY (1 << 18) +#define HS_CTRL_FIFO_HALF_EMPTY (1 << 17) +#define HS_CTRL_FIFO_FULL (1 << 16) +#define LP_DATA_FIFO_EMPTY (1 << 10) +#define LP_DATA_FIFO_HALF_EMPTY (1 << 9) +#define LP_DATA_FIFO_FULL (1 << 8) +#define HS_DATA_FIFO_EMPTY (1 << 2) +#define HS_DATA_FIFO_HALF_EMPTY (1 << 1) +#define HS_DATA_FIFO_FULL (1 << 0) + +#define _MIPIA_HS_LS_DBI_ENABLE (VLV_DISPLAY_BASE + 0xb078) +#define _MIPIB_HS_LS_DBI_ENABLE (VLV_DISPLAY_BASE + 0xb878) +#define MIPI_HS_LP_DBI_ENABLE (pipe) _PIPE(pipe, _MIPIA_HS_LS_DBI_ENABLE, _MIPIB_HS_LS_DBI_ENABLE) +#define DBI_HS_LP_MODE_MASK (1 << 0) +#define DBI_LP_MODE (1 << 0) +#define DBI_HS_MODE (0 << 0) + +#define _MIPIA_DPHY_PARAM (VLV_DISPLAY_BASE + 0xb080) +#define _MIPIB_DPHY_PARAM (VLV_DISPLAY_BASE + 0xb880) +#define MIPI_DPHY_PARAM (pipe) _PIPE(pipe, _MIPIA_DPHY_PARAM, _MIPIB_DPHY_PARAM) +#define EXIT_ZERO_COUNT_SHIFT 24 +#define EXIT_ZERO_COUNT_MASK (0x3f << 24) +#define TRAIL_COUNT_SHIFT 16 +#define TRAIL_COUNT_MASK (0x1f << 16) +#define CLK_ZERO_COUNT_SHIFT 8 +#define CLK_ZERO_COUNT_MASK (0xff << 8) +#define PREPARE_COUNT_SHIFT 0 +#define PREPARE_COUNT_MASK (0x3f << 0) + +/* bits 31:0 */ +#define _MIPIA_DBI_BW_CTRL (VLV_DISPLAY_BASE + 0xb084) +#define _MIPIB_DBI_BW_CTRL (VLV_DISPLAY_BASE + 0xb884) +#define MIPI_DBI_BW_CTRL (pipe) _PIPE(pipe, _MIPIA_DBI_BW_CTRL, _MIPIB_DBI_BW_CTRL) + +#define _MIPIA_CLK_LANE_SWITCH_TIME_CNT (VLV_DISPLAY_BASE + 0xb088) +#define _MIPIB_CLK_LANE_SWITCH_TIME_CNT (VLV_DISPLAY_BASE + 0xb888) +#define MIPI_CLK_LANE_SWITCH_TIME_CNT (pipe) _PIPE(pipe, _MIPIA_CLK_LANE_SWITCH_TIME_CNT, _MIPIB_CLK_LANE_SWITCH_TIME_CNT) +#define LP_HS_SSW_CNT_SHIFT 16 +#define LP_HS_SSW_CNT_MASK (0xffff << 16) +#define HS_LP_PWR_SW_CNT_SHIFT 0 +#define HS_LP_PWR_SW_CNT_MASK (0xffff << 0) + +#define _MIPIA_STOP_STATE_STALL (VLV_DISPLAY_BASE + 0xb08c) +#define _MIPIB_STOP_STATE_STALL (VLV_DISPLAY_BASE + 0xb88c) +#define MIPI_STOP_STATE_STALL (pipe) _PIPE(pipe, _MIPIA_STOP_STATE_STALL, _MIPIB_STOP_STATE_STALL) +#define STOP_STATE_STALL_COUNTER_SHIFT 0 +#define STOP_STATE_STALL_COUNTER_MASK (0xff << 0) + +#define _MIPIA_INTR_STAT_REG_1 (VLV_DISPLAY_BASE + 0xb090) +#define _MIPIB_INTR_STAT_REG_1 (VLV_DISPLAY_BASE + 0xb890) +#define MIPI_INTR_STAT_REG_1 (pipe) _PIPE(pipe, _MIPIA_INTR_STAT_REG_1, _MIPIB_INTR_STAT_REG_1) +#define _MIPIA_INTR_EN_REG_1 (VLV_DISPLAY_BASE + 0xb094) +#define _MIPIB_INTR_EN_REG_1 (VLV_DISPLAY_BASE + 0xb894) +#define MIPI_INTR_EN_REG_1 (pipe) _PIPE(pipe, _MIPIA_INTR_EN_REG_1, _MIPIB_INTR_EN_REG_1) +#define RX_CONTENTION_DETECTED (1 << 0) + +/* XXX: only pipe A ?!? */ +#define MIPIA_DBI_TYPEC_CTRL (VLV_DISPLAY_BASE + 0xb100) +#define DBI_TYPEC_ENABLE (1 << 31) +#define DBI_TYPEC_WIP (1 << 30) +#define DBI_TYPEC_OPTION_SHIFT 28 +#define DBI_TYPEC_OPTION_MASK (3 << 28) +#define DBI_TYPEC_FREQ_SHIFT 24 +#define DBI_TYPEC_FREQ_MASK (0xf << 24) +#define DBI_TYPEC_OVERRIDE (1 << 8) +#define DBI_TYPEC_OVERRIDE_COUNTER_SHIFT 0 +#define DBI_TYPEC_OVERRIDE_COUNTER_MASK (0xff << 0) + + +/* MIPI adapter registers */ + +#define _MIPIA_CTRL (VLV_DISPLAY_BASE + 0xb104) +#define _MIPIB_CTRL (VLV_DISPLAY_BASE + 0xb904) +#define MIPI_CTRL (pipe) _PIPE(pipe, _MIPIA_CTRL, _MIPIB_CTRL) +#define ESCAPE_CLOCK_DIVIDER_SHIFT 5/* A only */ +#define ESCAPE_CLOCK_DIVIDER_MASK (3 << 5) +#define ESCAPE_CLOCK_DIVIDER_1 (0 << 5) +#define ESCAPE_CLOCK_DIVIDER_2 (1 << 5) +#define ESCAPE_CLOCK_DIVIDER_4 (2 << 5) +#define READ_REQUEST_PRIORITY_SHIFT 3 +#define READ_REQUEST_PRIORITY_MASK (3 << 3) +#define READ_REQUEST_PRIORITY_LOW (0 << 3) +#define READ_REQUEST_PRIORITY_HIGH (3 << 3) +#define RGB_FLIP_TO_BGR (1 << 2) + +#define _MIPIA_DATA_ADDRESS (VLV_DISPLAY_BASE + 0xb108) +#define _MIPIB_DATA_ADDRESS (VLV_DISPLAY_BASE + 0xb908) +#define MIPI_DATA_ADDRESS (pipe) _PIPE(pipe, _MIPIA_DATA_ADDRESS, _MIPIB_DATA_ADDRESS) +#define DATA_MEM_ADDRESS_SHIFT 5 +#define DATA_MEM_ADDRESS_MASK (0x7ffffff << 5) +#define DATA_VALID (1 << 0) + +#define _MIPIA_DATA_LENGTH (VLV_DISPLAY_BASE + 0xb10c) +#define _MIPIB_DATA_LENGTH (VLV_DISPLAY_BASE + 0xb90c) +#define MIPI_DATA_LENGTH (pipe) _PIPE(pipe, _MIPIA_DATA_LENGTH, _MIPIB_DATA_LENGTH) +#define DATA_LENGTH_SHIFT 0 +#define DATA_LENGTH_MASK (0xfffff << 0) + +#define _MIPIA_COMMAND_ADDRESS (VLV_DISPLAY_BASE + 0xb110) +#define _MIPIB_COMMAND_ADDRESS (VLV_DISPLAY_BASE + 0xb910) +#define MIPI_COMMAND_ADDRESS (pipe) _PIPE(pipe, _MIPIA_COMMAND_ADDRESS, _MIPIB_COMMAND_ADDRESS) +#define COMMAND_MEM_ADDRESS_SHIFT 5 +#define COMMAND_MEM_ADDRESS_MASK (0x7ffffff << 5) +#define AUTO_PWG_ENABLE (1 << 2) +#define MEMORY_WRITE_DATA_FROM_PIPE_RENDERING (1 << 1) +#define COMMAND_VALID (1 << 0) + +#define _MIPIA_COMMAND_LENGTH (VLV_DISPLAY_BASE + 0xb114) +#define _MIPIB_COMMAND_LENGTH (VLV_DISPLAY_BASE + 0xb914) +#define MIPI_COMMAND_LENGTH (pipe) _PIPE(pipe, _MIPIA_COMMAND_LENGTH, _MIPIB_COMMAND_LENGTH) +#define COMMAND_LENGTH_SHIFT (n) (8 * (n))/* n: 0...3 */ +#define COMMAND_LENGTH_MASK (n) (0xff << (8 * (n))) + +#define _MIPIA_READ_DATA_RETURN0 (VLV_DISPLAY_BASE + 0xb118) +#define _MIPIB_READ_DATA_RETURN0 (VLV_DISPLAY_BASE + 0xb918) +#define MIPI_READ_DATA_RETURN (pipe, n) \ + (_PIPE(pipe, _MIPIA_READ_DATA_RETURN0, _MIPIB_READ_DATA_RETURN0) + 4 * (n))/* n: 0...7 */ + +#define _MIPIA_READ_DATA_VALID (VLV_DISPLAY_BASE + 0xb138) +#define _MIPIB_READ_DATA_VALID (VLV_DISPLAY_BASE + 0xb938) +#define MIPI_READ_DATA_VALID (pipe) _PIPE(pipe, _MIPIA_READ_DATA_VALID, _MIPIB_READ_DATA_VALID) +#define READ_DATA_VALID (n) (1 << (n)) +#endif /* _I915_REG_H_ */ Signature · 6 lines
1.7.9.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 04/14] drm/i915: add MIPI DSI register definitions
In reply to Jani NikulaQuoted 6 lines · Jani Nikula
Add definitions for VLV MIPI DSI registers.
Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 409 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 409 insertions(+)
I wonder if it'd be the right time to spawn another header instead of adding more to i915_reg.h? or people are fine with that big i915_reg.h?
Signature · 1 line
Damien
Re: [PATCH 04/14] drm/i915: add MIPI DSI register definitions
Quoted 10 lines · Damien Lespiau
Quoted 6 lines · Jani Nikula
Add definitions for VLV MIPI DSI registers.
Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 409 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 409 insertions(+)I wonder if it'd be the right time to spawn another header instead of adding more to
i915_reg.h? or people are fine with that bigi915_reg.h?
cscope can still keep track of it, so imo it's ok. Stuff we care more about (function declarations, structs, ...) are already in other files, so personally I don't mind really.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch