Skip to content

Commit 846c698

Browse files
gary_gengary_gen
authored andcommitted
Hdmi: add workaround to avoid blank screen for acer KG221Q monitor
When detect acer KG221Q monitor, adjust npll to double pixel clock.(1920x1080@75) Change-Id: Ibe5323678f10b319bf9d3e2057638f4cbec7bbf6
1 parent 6fdbe7d commit 846c698

File tree

6 files changed

+33
-0
lines changed

6 files changed

+33
-0
lines changed

drivers/clk/rockchip/clk-pll.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,10 @@ static const struct rockchip_pll_rate_table *rockchip_get_pll_settings(
367367
const struct rockchip_pll_rate_table *rate_table = pll->rate_table;
368368
int i;
369369
bool iex_monitor = false;
370+
bool acer_kg221q_monitor = false;
370371

371372
iex_monitor = detect_iex_monitor();
373+
acer_kg221q_monitor = detect_acer_kg221q_monitor();
372374

373375
for (i = 0; i < pll->rate_count; i++) {
374376
if( (rate == 85750000) && !iex_monitor)
@@ -377,6 +379,8 @@ static const struct rockchip_pll_rate_table *rockchip_get_pll_settings(
377379
continue;
378380
if( (rate == 78750000) && !iex_monitor)
379381
continue;
382+
if( (rate == 170000000) && !acer_kg221q_monitor)
383+
continue;
380384
if (rate == rate_table[i].rate) {
381385
if (i < pll->sel) {
382386
pll->scaling = rate;

drivers/clk/rockchip/clk-rk3288.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ static struct rockchip_pll_rate_table rk3288_npll_rates[] = {
142142
RK3066_PLL_RATE_NB(297000000, 2, 198, 8, 16),
143143
RK3066_PLL_RATE_NB(270000000, 1, 135, 12, 32),
144144
RK3066_PLL_RATE_NB(260000000, 1, 130, 12, 32),
145+
RK3066_PLL_RATE_NB(170000000, 1, 170, 12, 32),//1920*1080@75 acer KG221Q
145146
RK3066_PLL_RATE_NB(148500000, 1, 99, 16, 32),
146147
RK3066_PLL_RATE_NB(146250000, 6, 585, 16, 32),
147148
RK3066_PLL_RATE_NB(108000000, 1, 54, 12, 32),

drivers/clk/rockchip/clk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ struct clk;
186186
#define RK3399_PMU_GATEDIS_CON(x) ((x) * 0x4 + 0x130)
187187

188188
extern bool detect_iex_monitor(void);
189+
extern bool detect_acer_kg221q_monitor(void);
189190

190191
enum rockchip_pll_type {
191192
pll_rk3036,

drivers/gpu/drm/drm_edid.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,9 @@ static const u8 iex_edid[] = {
12681268
0x24, 0xb8, 0x85, 0x01
12691269
};
12701270

1271+
static const u8 acer_kg221q_edid[] = {
1272+
0x04, 0x72, 0x8e, 0x05
1273+
};
12711274
/**
12721275
* drm_edid_header_is_valid - sanity check the header of the base EDID block
12731276
* @raw_edid: pointer to raw base EDID block
@@ -1303,6 +1306,21 @@ bool drm_dect_iex_edid(struct edid *edid)
13031306
}
13041307
EXPORT_SYMBOL(drm_dect_iex_edid);
13051308

1309+
bool drm_dect_acer_kg221q_edid(struct edid *edid)
1310+
{
1311+
int i, score = 0;
1312+
u8 *raw_edid = (u8 *)edid;
1313+
for (i = 0; i < sizeof(acer_kg221q_edid); i++)
1314+
if (raw_edid[8+i] == acer_kg221q_edid[i])
1315+
score++;
1316+
1317+
if (score == 4)
1318+
return true;
1319+
else
1320+
return false;
1321+
}
1322+
EXPORT_SYMBOL(drm_dect_acer_kg221q_edid);
1323+
13061324
static int edid_fixup __read_mostly = 6;
13071325
module_param_named(edid_fixup, edid_fixup, int, 0400);
13081326
MODULE_PARM_DESC(edid_fixup,

drivers/gpu/drm/drm_probe_helper.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
static bool drm_kms_helper_poll = true;
5959
static bool drm_iex_monitor = false;
60+
static bool drm_acer_kg221q_monitor = false;
6061
module_param_named(poll, drm_kms_helper_poll, bool, 0600);
6162

6263
static enum drm_mode_status
@@ -265,6 +266,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
265266
if (!strcmp(connector->name, "HDMI-A-1")) {
266267
edid_manufacturer = (struct edid *) connector->edid_blob_ptr->data;
267268
drm_iex_monitor = drm_dect_iex_edid(edid_manufacturer);
269+
drm_acer_kg221q_monitor = drm_dect_acer_kg221q_edid(edid_manufacturer);
268270
}
269271
list_for_each_entry(mode, &connector->modes, head) {
270272
drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
@@ -280,6 +282,12 @@ bool detect_iex_monitor(void)
280282
}
281283
EXPORT_SYMBOL(detect_iex_monitor);
282284

285+
bool detect_acer_kg221q_monitor(void)
286+
{
287+
return drm_acer_kg221q_monitor;
288+
}
289+
EXPORT_SYMBOL(detect_acer_kg221q_monitor);
290+
283291
/**
284292
* drm_helper_probe_single_connector_modes - get complete set of display modes
285293
* @connector: connector to probe

include/drm/drm_crtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,6 +2012,7 @@ extern void drm_set_preferred_mode(struct drm_connector *connector,
20122012

20132013
extern int drm_edid_header_is_valid(const u8 *raw_edid);
20142014
extern bool drm_dect_iex_edid(struct edid *edid);
2015+
extern bool drm_dect_acer_kg221q_edid(struct edid *edid);
20152016
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
20162017
bool *edid_corrupt);
20172018
extern bool drm_edid_is_valid(struct edid *edid);

0 commit comments

Comments
 (0)