Skip to content

Commit ea9a6ba

Browse files
Shobhit Kumardanvet
Shobhit Kumar
authored andcommitted
drm/i915: Update VBT data structures to have MIPI block enhancements
MIPI Block #52 which provides configuration details for the MIPI panel including dphy settings as per panel and tcon specs Block #53 gives information on panel enable sequences v2: Address review comemnts from Jani - Move panel ids from intel_dsi.h to intel_bios.h - bdb_mipi_config structure improvements for cleaner code - Adding units for the pps delays, all in ms - change data structure to be more cleaner and simple v3: Corrected the unit for pps delays as 100us Signed-off-by: Shobhit Kumar <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
1 parent 8232644 commit ea9a6ba

File tree

2 files changed

+147
-31
lines changed

2 files changed

+147
-31
lines changed

drivers/gpu/drm/i915/intel_bios.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,14 +599,14 @@ parse_mipi(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
599599
{
600600
struct bdb_mipi *mipi;
601601

602-
mipi = find_section(bdb, BDB_MIPI);
602+
mipi = find_section(bdb, BDB_MIPI_CONFIG);
603603
if (!mipi) {
604604
DRM_DEBUG_KMS("No MIPI BDB found");
605605
return;
606606
}
607607

608608
/* XXX: add more info */
609-
dev_priv->vbt.dsi.panel_id = mipi->panel_id;
609+
dev_priv->vbt.dsi.panel_id = MIPI_DSI_GENERIC_PANEL_ID;
610610
}
611611

612612
static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,

drivers/gpu/drm/i915/intel_bios.h

Lines changed: 145 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ struct vbios_data {
104104
#define BDB_LVDS_LFP_DATA 42
105105
#define BDB_LVDS_BACKLIGHT 43
106106
#define BDB_LVDS_POWER 44
107-
#define BDB_MIPI 50
107+
#define BDB_MIPI_CONFIG 52
108+
#define BDB_MIPI_SEQUENCE 53
108109
#define BDB_SKIP 254 /* VBIOS private block, ignore */
109110

110111
struct bdb_general_features {
@@ -711,44 +712,159 @@ int intel_parse_bios(struct drm_device *dev);
711712
#define DVO_PORT_DPD 9
712713
#define DVO_PORT_DPA 10
713714

714-
/* MIPI DSI panel info */
715-
struct bdb_mipi {
716-
u16 panel_id;
717-
u16 bridge_revision;
718-
719-
/* General params */
720-
u32 dithering:1;
721-
u32 bpp_pixel_format:1;
722-
u32 rsvd1:1;
723-
u32 dphy_valid:1;
724-
u32 resvd2:28;
715+
/* Block 52 contains MIPI Panel info
716+
* 6 such enteries will there. Index into correct
717+
* entery is based on the panel_index in #40 LFP
718+
*/
719+
#define MAX_MIPI_CONFIGURATIONS 6
725720

726-
u16 port_info;
727-
u16 rsvd3:2;
728-
u16 num_lanes:2;
729-
u16 rsvd4:12;
721+
#define MIPI_DSI_UNDEFINED_PANEL_ID 0
722+
#define MIPI_DSI_GENERIC_PANEL_ID 1
730723

731-
/* DSI config */
732-
u16 virt_ch_num:2;
733-
u16 vtm:2;
734-
u16 rsvd5:12;
724+
struct mipi_config {
725+
u16 panel_id;
735726

736-
u32 dsi_clock;
727+
/* General Params */
728+
u32 enable_dithering:1;
729+
u32 rsvd1:1;
730+
u32 is_bridge:1;
731+
732+
u32 panel_arch_type:2;
733+
u32 is_cmd_mode:1;
734+
735+
#define NON_BURST_SYNC_PULSE 0x1
736+
#define NON_BURST_SYNC_EVENTS 0x2
737+
#define BURST_MODE 0x3
738+
u32 video_transfer_mode:2;
739+
740+
u32 cabc_supported:1;
741+
u32 pwm_blc:1;
742+
743+
/* Bit 13:10 */
744+
#define PIXEL_FORMAT_RGB565 0x1
745+
#define PIXEL_FORMAT_RGB666 0x2
746+
#define PIXEL_FORMAT_RGB666_LOOSELY_PACKED 0x3
747+
#define PIXEL_FORMAT_RGB888 0x4
748+
u32 videomode_color_format:4;
749+
750+
/* Bit 15:14 */
751+
#define ENABLE_ROTATION_0 0x0
752+
#define ENABLE_ROTATION_90 0x1
753+
#define ENABLE_ROTATION_180 0x2
754+
#define ENABLE_ROTATION_270 0x3
755+
u32 rotation:2;
756+
u32 bta_enabled:1;
757+
u32 rsvd2:15;
758+
759+
/* 2 byte Port Description */
760+
#define DUAL_LINK_NOT_SUPPORTED 0
761+
#define DUAL_LINK_FRONT_BACK 1
762+
#define DUAL_LINK_PIXEL_ALT 2
763+
u16 dual_link:2;
764+
u16 lane_cnt:2;
765+
u16 rsvd3:12;
766+
767+
u16 rsvd4;
768+
769+
u8 rsvd5[5];
770+
u32 dsi_ddr_clk;
737771
u32 bridge_ref_clk;
738-
u16 rsvd_pwr;
739772

740-
/* Dphy Params */
741-
u32 prepare_cnt:5;
742-
u32 rsvd6:3;
773+
#define BYTE_CLK_SEL_20MHZ 0
774+
#define BYTE_CLK_SEL_10MHZ 1
775+
#define BYTE_CLK_SEL_5MHZ 2
776+
u8 byte_clk_sel:2;
777+
778+
u8 rsvd6:6;
779+
780+
/* DPHY Flags */
781+
u16 dphy_param_valid:1;
782+
u16 eot_pkt_disabled:1;
783+
u16 enable_clk_stop:1;
784+
u16 rsvd7:13;
785+
786+
u32 hs_tx_timeout;
787+
u32 lp_rx_timeout;
788+
u32 turn_around_timeout;
789+
u32 device_reset_timer;
790+
u32 master_init_timer;
791+
u32 dbi_bw_timer;
792+
u32 lp_byte_clk_val;
793+
794+
/* 4 byte Dphy Params */
795+
u32 prepare_cnt:6;
796+
u32 rsvd8:2;
743797
u32 clk_zero_cnt:8;
744798
u32 trail_cnt:5;
745-
u32 rsvd7:3;
799+
u32 rsvd9:3;
746800
u32 exit_zero_cnt:6;
747-
u32 rsvd8:2;
801+
u32 rsvd10:2;
748802

749-
u32 hl_switch_cnt;
750-
u32 lp_byte_clk;
751803
u32 clk_lane_switch_cnt;
804+
u32 hl_switch_cnt;
805+
806+
u32 rsvd11[6];
807+
808+
/* timings based on dphy spec */
809+
u8 tclk_miss;
810+
u8 tclk_post;
811+
u8 rsvd12;
812+
u8 tclk_pre;
813+
u8 tclk_prepare;
814+
u8 tclk_settle;
815+
u8 tclk_term_enable;
816+
u8 tclk_trail;
817+
u16 tclk_prepare_clkzero;
818+
u8 rsvd13;
819+
u8 td_term_enable;
820+
u8 teot;
821+
u8 ths_exit;
822+
u8 ths_prepare;
823+
u16 ths_prepare_hszero;
824+
u8 rsvd14;
825+
u8 ths_settle;
826+
u8 ths_skip;
827+
u8 ths_trail;
828+
u8 tinit;
829+
u8 tlpx;
830+
u8 rsvd15[3];
831+
832+
/* GPIOs */
833+
u8 panel_enable;
834+
u8 bl_enable;
835+
u8 pwm_enable;
836+
u8 reset_r_n;
837+
u8 pwr_down_r;
838+
u8 stdby_r_n;
839+
752840
} __packed;
753841

842+
/* Block 52 contains MIPI configuration block
843+
* 6 * bdb_mipi_config, followed by 6 pps data
844+
* block below
845+
*
846+
* all delays has a unit of 100us
847+
*/
848+
struct mipi_pps_data {
849+
u16 panel_on_delay;
850+
u16 bl_enable_delay;
851+
u16 bl_disable_delay;
852+
u16 panel_off_delay;
853+
u16 panel_power_cycle_delay;
854+
};
855+
856+
struct bdb_mipi_config {
857+
struct mipi_config config[MAX_MIPI_CONFIGURATIONS];
858+
struct mipi_pps_data pps[MAX_MIPI_CONFIGURATIONS];
859+
};
860+
861+
/* Block 53 contains MIPI sequences as needed by the panel
862+
* for enabling it. This block can be variable in size and
863+
* can be maximum of 6 blocks
864+
*/
865+
struct bdb_mipi_sequence {
866+
u8 version;
867+
u8 data[0];
868+
};
869+
754870
#endif /* _I830_BIOS_H_ */

0 commit comments

Comments
 (0)