Skip to content

Commit 819d807

Browse files
Archit Tanejatomba
authored andcommitted
OMAP2PLUS: DSS2: FEATURES: Function to Provide the max fck supported
The maximum supported frequency for DSS has increased from 173 to 186 Mhz on OMAP4. Introduce a dss feature function to get the max_fck to replace DISPC_MAX_FCK macro. Signed-off-by: Archit Taneja <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
1 parent 87a7484 commit 819d807

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

drivers/video/omap2/dss/dsi.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <plat/clock.h>
3939

4040
#include "dss.h"
41+
#include "dss_features.h"
4142

4243
/*#define VERBOSE_IRQ*/
4344
#define DSI_CATCH_MISSING_TE
@@ -856,10 +857,12 @@ int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck,
856857
struct dispc_clock_info best_dispc;
857858
int min_fck_per_pck;
858859
int match = 0;
859-
unsigned long dss_clk_fck2;
860+
unsigned long dss_clk_fck2, max_dss_fck;
860861

861862
dss_clk_fck2 = dss_clk_get_rate(DSS_CLK_SYSCK);
862863

864+
max_dss_fck = dss_feat_get_max_dss_fck();
865+
863866
if (req_pck == dsi.cache_req_pck &&
864867
dsi.cache_cinfo.clkin == dss_clk_fck2) {
865868
DSSDBG("DSI clock info found from cache\n");
@@ -872,7 +875,7 @@ int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck,
872875
min_fck_per_pck = CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK;
873876

874877
if (min_fck_per_pck &&
875-
req_pck * min_fck_per_pck > DISPC_MAX_FCK) {
878+
req_pck * min_fck_per_pck > max_dss_fck) {
876879
DSSERR("Requested pixel clock not possible with the current "
877880
"OMAP2_DSS_MIN_FCK_PER_PCK setting. Turning "
878881
"the constraint off.\n");
@@ -925,7 +928,7 @@ int dsi_pll_calc_clock_div_pck(bool is_tft, unsigned long req_pck,
925928
if (cur.dsi1_pll_fclk < req_pck)
926929
break;
927930

928-
if (cur.dsi1_pll_fclk > DISPC_MAX_FCK)
931+
if (cur.dsi1_pll_fclk > max_dss_fck)
929932
continue;
930933

931934
if (min_fck_per_pck &&

drivers/video/omap2/dss/dss.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
387387
struct dss_clock_info best_dss;
388388
struct dispc_clock_info best_dispc;
389389

390-
unsigned long fck;
390+
unsigned long fck, max_dss_fck;
391391

392392
u16 fck_div;
393393

@@ -396,6 +396,8 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
396396

397397
prate = dss_get_dpll4_rate();
398398

399+
max_dss_fck = dss_feat_get_max_dss_fck();
400+
399401
fck = dss_clk_get_rate(DSS_CLK_FCK);
400402
if (req_pck == dss.cache_req_pck &&
401403
((cpu_is_omap34xx() && prate == dss.cache_prate) ||
@@ -409,7 +411,7 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
409411
min_fck_per_pck = CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK;
410412

411413
if (min_fck_per_pck &&
412-
req_pck * min_fck_per_pck > DISPC_MAX_FCK) {
414+
req_pck * min_fck_per_pck > max_dss_fck) {
413415
DSSERR("Requested pixel clock not possible with the current "
414416
"OMAP2_DSS_MIN_FCK_PER_PCK setting. Turning "
415417
"the constraint off.\n");
@@ -445,7 +447,7 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
445447
else
446448
fck = prate / fck_div * 2;
447449

448-
if (fck > DISPC_MAX_FCK)
450+
if (fck > max_dss_fck)
449451
continue;
450452

451453
if (min_fck_per_pck &&

drivers/video/omap2/dss/dss.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ extern unsigned int dss_debug;
9797
#define FLD_MOD(orig, val, start, end) \
9898
(((orig) & ~FLD_MASK(start, end)) | FLD_VAL(val, start, end))
9999

100-
#define DISPC_MAX_FCK 173000000
101-
102100
enum omap_burst_size {
103101
OMAP_DSS_BURST_4x32 = 0,
104102
OMAP_DSS_BURST_8x32 = 1,

drivers/video/omap2/dss/dss_features.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct omap_dss_features {
4141

4242
const int num_mgrs;
4343
const int num_ovls;
44+
const unsigned long max_dss_fck;
4445
const enum omap_display_type *supported_displays;
4546
const enum omap_color_mode *supported_color_modes;
4647
};
@@ -168,6 +169,7 @@ static struct omap_dss_features omap2_dss_features = {
168169

169170
.num_mgrs = 2,
170171
.num_ovls = 3,
172+
.max_dss_fck = 173000000,
171173
.supported_displays = omap2_dss_supported_displays,
172174
.supported_color_modes = omap2_dss_supported_color_modes,
173175
};
@@ -185,6 +187,7 @@ static struct omap_dss_features omap3430_dss_features = {
185187

186188
.num_mgrs = 2,
187189
.num_ovls = 3,
190+
.max_dss_fck = 173000000,
188191
.supported_displays = omap3430_dss_supported_displays,
189192
.supported_color_modes = omap3_dss_supported_color_modes,
190193
};
@@ -202,6 +205,7 @@ static struct omap_dss_features omap3630_dss_features = {
202205

203206
.num_mgrs = 2,
204207
.num_ovls = 3,
208+
.max_dss_fck = 173000000,
205209
.supported_displays = omap3630_dss_supported_displays,
206210
.supported_color_modes = omap3_dss_supported_color_modes,
207211
};
@@ -217,6 +221,7 @@ static struct omap_dss_features omap4_dss_features = {
217221

218222
.num_mgrs = 3,
219223
.num_ovls = 3,
224+
.max_dss_fck = 186000000,
220225
.supported_displays = omap4_dss_supported_displays,
221226
.supported_color_modes = omap3_dss_supported_color_modes,
222227
};
@@ -232,6 +237,12 @@ int dss_feat_get_num_ovls(void)
232237
return omap_current_dss_features->num_ovls;
233238
}
234239

240+
/* Max supported DSS FCK in Hz */
241+
unsigned long dss_feat_get_max_dss_fck(void)
242+
{
243+
return omap_current_dss_features->max_dss_fck;
244+
}
245+
235246
enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel)
236247
{
237248
return omap_current_dss_features->supported_displays[channel];

drivers/video/omap2/dss/dss_features.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ enum dss_feat_reg_field {
5252
/* DSS Feature Functions */
5353
int dss_feat_get_num_mgrs(void);
5454
int dss_feat_get_num_ovls(void);
55+
unsigned long dss_feat_get_max_dss_fck(void);
5556
enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel);
5657
enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane);
5758
bool dss_feat_color_mode_supported(enum omap_plane plane,

0 commit comments

Comments
 (0)