@@ -1241,10 +1241,9 @@ void dw_hdmi_phy_i2c_write(struct dw_hdmi *hdmi, unsigned short data,
1241
1241
EXPORT_SYMBOL_GPL (dw_hdmi_phy_i2c_write );
1242
1242
1243
1243
/* Filter out invalid setups to avoid configuring SCDC and scrambling */
1244
- static bool dw_hdmi_support_scdc (struct dw_hdmi * hdmi )
1244
+ static bool dw_hdmi_support_scdc (struct dw_hdmi * hdmi ,
1245
+ const struct drm_display_info * display )
1245
1246
{
1246
- struct drm_display_info * display = & hdmi -> connector .display_info ;
1247
-
1248
1247
/* Completely disable SCDC support for older controllers */
1249
1248
if (hdmi -> version < 0x200a )
1250
1249
return false;
@@ -1282,12 +1281,13 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi)
1282
1281
* helper should called right before enabling the TMDS Clock and Data in
1283
1282
* the PHY configuration callback.
1284
1283
*/
1285
- void dw_hdmi_set_high_tmds_clock_ratio (struct dw_hdmi * hdmi )
1284
+ void dw_hdmi_set_high_tmds_clock_ratio (struct dw_hdmi * hdmi ,
1285
+ const struct drm_display_info * display )
1286
1286
{
1287
1287
unsigned long mtmdsclock = hdmi -> hdmi_data .video_mode .mtmdsclock ;
1288
1288
1289
1289
/* Control for TMDS Bit Period/TMDS Clock-Period Ratio */
1290
- if (dw_hdmi_support_scdc (hdmi )) {
1290
+ if (dw_hdmi_support_scdc (hdmi , display )) {
1291
1291
if (mtmdsclock > HDMI14_MAX_TMDSCLK )
1292
1292
drm_scdc_set_high_tmds_clock_ratio (hdmi -> ddc , 1 );
1293
1293
else
@@ -1490,7 +1490,8 @@ static int hdmi_phy_configure_dwc_hdmi_3d_tx(struct dw_hdmi *hdmi,
1490
1490
return 0 ;
1491
1491
}
1492
1492
1493
- static int hdmi_phy_configure (struct dw_hdmi * hdmi )
1493
+ static int hdmi_phy_configure (struct dw_hdmi * hdmi ,
1494
+ const struct drm_display_info * display )
1494
1495
{
1495
1496
const struct dw_hdmi_phy_data * phy = hdmi -> phy .data ;
1496
1497
const struct dw_hdmi_plat_data * pdata = hdmi -> plat_data ;
@@ -1500,7 +1501,7 @@ static int hdmi_phy_configure(struct dw_hdmi *hdmi)
1500
1501
1501
1502
dw_hdmi_phy_power_off (hdmi );
1502
1503
1503
- dw_hdmi_set_high_tmds_clock_ratio (hdmi );
1504
+ dw_hdmi_set_high_tmds_clock_ratio (hdmi , display );
1504
1505
1505
1506
/* Leave low power consumption mode by asserting SVSRET. */
1506
1507
if (phy -> has_svsret )
@@ -1531,6 +1532,7 @@ static int hdmi_phy_configure(struct dw_hdmi *hdmi)
1531
1532
}
1532
1533
1533
1534
static int dw_hdmi_phy_init (struct dw_hdmi * hdmi , void * data ,
1535
+ const struct drm_display_info * display ,
1534
1536
const struct drm_display_mode * mode )
1535
1537
{
1536
1538
int i , ret ;
@@ -1540,7 +1542,7 @@ static int dw_hdmi_phy_init(struct dw_hdmi *hdmi, void *data,
1540
1542
dw_hdmi_phy_sel_data_en_pol (hdmi , 1 );
1541
1543
dw_hdmi_phy_sel_interface_control (hdmi , 0 );
1542
1544
1543
- ret = hdmi_phy_configure (hdmi );
1545
+ ret = hdmi_phy_configure (hdmi , display );
1544
1546
if (ret )
1545
1547
return ret ;
1546
1548
}
@@ -1846,10 +1848,11 @@ static void hdmi_config_drm_infoframe(struct dw_hdmi *hdmi)
1846
1848
}
1847
1849
1848
1850
static void hdmi_av_composer (struct dw_hdmi * hdmi ,
1851
+ const struct drm_display_info * display ,
1849
1852
const struct drm_display_mode * mode )
1850
1853
{
1851
1854
u8 inv_val , bytes ;
1852
- struct drm_hdmi_info * hdmi_info = & hdmi -> connector . display_info . hdmi ;
1855
+ const struct drm_hdmi_info * hdmi_info = & display -> hdmi ;
1853
1856
struct hdmi_vmode * vmode = & hdmi -> hdmi_data .video_mode ;
1854
1857
int hblank , vblank , h_de_hs , v_de_vs , hsync_len , vsync_len ;
1855
1858
unsigned int vdisplay , hdisplay ;
@@ -1882,7 +1885,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
1882
1885
1883
1886
/* Set up HDMI_FC_INVIDCONF */
1884
1887
inv_val = (hdmi -> hdmi_data .hdcp_enable ||
1885
- (dw_hdmi_support_scdc (hdmi ) &&
1888
+ (dw_hdmi_support_scdc (hdmi , display ) &&
1886
1889
(vmode -> mtmdsclock > HDMI14_MAX_TMDSCLK ||
1887
1890
hdmi_info -> scdc .scrambling .low_rates )) ?
1888
1891
HDMI_FC_INVIDCONF_HDCP_KEEPOUT_ACTIVE :
@@ -1950,7 +1953,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,
1950
1953
}
1951
1954
1952
1955
/* Scrambling Control */
1953
- if (dw_hdmi_support_scdc (hdmi )) {
1956
+ if (dw_hdmi_support_scdc (hdmi , display )) {
1954
1957
if (vmode -> mtmdsclock > HDMI14_MAX_TMDSCLK ||
1955
1958
hdmi_info -> scdc .scrambling .low_rates ) {
1956
1959
/*
@@ -2116,6 +2119,7 @@ static void hdmi_disable_overflow_interrupts(struct dw_hdmi *hdmi)
2116
2119
static int dw_hdmi_setup (struct dw_hdmi * hdmi ,
2117
2120
const struct drm_display_mode * mode )
2118
2121
{
2122
+ struct drm_connector * connector = & hdmi -> connector ;
2119
2123
int ret ;
2120
2124
2121
2125
hdmi_disable_overflow_interrupts (hdmi );
@@ -2161,10 +2165,12 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi,
2161
2165
hdmi -> hdmi_data .video_mode .mdataenablepolarity = true;
2162
2166
2163
2167
/* HDMI Initialization Step B.1 */
2164
- hdmi_av_composer (hdmi , mode );
2168
+ hdmi_av_composer (hdmi , & connector -> display_info , mode );
2165
2169
2166
2170
/* HDMI Initializateion Step B.2 */
2167
- ret = hdmi -> phy .ops -> init (hdmi , hdmi -> phy .data , & hdmi -> previous_mode );
2171
+ ret = hdmi -> phy .ops -> init (hdmi , hdmi -> phy .data ,
2172
+ & connector -> display_info ,
2173
+ & hdmi -> previous_mode );
2168
2174
if (ret )
2169
2175
return ret ;
2170
2176
hdmi -> phy .enabled = true;
0 commit comments