Skip to content

Commit 9535e00

Browse files
gary_genasus-leslieyu
authored andcommitted
Hdmi: add workaround to avoid screen unstable for asus VZ229h monitor
when detect asus vz229h monitor, adjust npll frequency equall to pixel clock.(640x480@75 640x480@72.81) Auto caculate npll frequency when using 720x400 resolution.(720x400@70) Change-Id: I7f1bb70eaaab1460198aa8b157ee7523f3c744c2
1 parent 4ea09e6 commit 9535e00

File tree

6 files changed

+37
-0
lines changed

6 files changed

+37
-0
lines changed

drivers/clk/rockchip/clk-pll.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,11 @@ static const struct rockchip_pll_rate_table *rockchip_get_pll_settings(
368368
int i;
369369
bool iex_monitor = false;
370370
bool acer_kg221q_monitor = false;
371+
bool asus_vz229h_monitor = false;
371372

372373
iex_monitor = detect_iex_monitor();
373374
acer_kg221q_monitor = detect_acer_kg221q_monitor();
375+
asus_vz229h_monitor = detect_asus_vz229h_monitor();
374376

375377
for (i = 0; i < pll->rate_count; i++) {
376378
if( (rate == 85750000) && !iex_monitor)
@@ -381,6 +383,10 @@ static const struct rockchip_pll_rate_table *rockchip_get_pll_settings(
381383
continue;
382384
if( (rate == 170000000) && !acer_kg221q_monitor)
383385
continue;
386+
if( (rate == 28320000) && asus_vz229h_monitor)
387+
continue;
388+
if( (rate == 31500000) && (rate_table[i].nr == 1) && !asus_vz229h_monitor)
389+
continue;
384390
if (rate == rate_table[i].rate) {
385391
if (i < pll->sel) {
386392
pll->scaling = rate;

drivers/clk/rockchip/clk-rk3288.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ static struct rockchip_pll_rate_table rk3288_npll_rates[] = {
152152
RK3066_PLL_RATE_NB(85500000, 2, 171, 12, 32),//1360*768@60 iex
153153
RK3066_PLL_RATE_NB(78750000, 4, 210, 16, 32),//1024*768@75 iex
154154
RK3066_PLL_RATE_NB(74250000, 4, 198, 16, 32),
155+
RK3066_PLL_RATE_NB(31500000, 1, 21, 16, 32),//640x480@75 @72.81 ASUS VZ229H
155156
};
156157

157158
#define RK3288_DIV_ACLK_CORE_M0_MASK 0xf

drivers/clk/rockchip/clk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ struct clk;
187187

188188
extern bool detect_iex_monitor(void);
189189
extern bool detect_acer_kg221q_monitor(void);
190+
extern bool detect_asus_vz229h_monitor(void);
190191

191192
enum rockchip_pll_type {
192193
pll_rk3036,

drivers/gpu/drm/drm_edid.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,10 @@ static const u8 iex_edid[] = {
12711271
static const u8 acer_kg221q_edid[] = {
12721272
0x04, 0x72, 0x8e, 0x05
12731273
};
1274+
1275+
static const u8 asus_vz229h_edid[] = {
1276+
0x06, 0xB3, 0xCC, 0x22
1277+
};
12741278
/**
12751279
* drm_edid_header_is_valid - sanity check the header of the base EDID block
12761280
* @raw_edid: pointer to raw base EDID block
@@ -1321,6 +1325,22 @@ bool drm_dect_acer_kg221q_edid(struct edid *edid)
13211325
}
13221326
EXPORT_SYMBOL(drm_dect_acer_kg221q_edid);
13231327

1328+
bool drm_dect_asus_vz229h_edid(struct edid *edid)
1329+
{
1330+
int i, score = 0;
1331+
u8 *raw_edid = (u8 *)edid;
1332+
for (i = 0; i < sizeof(asus_vz229h_edid); i++)
1333+
if (raw_edid[8+i] == asus_vz229h_edid[i])
1334+
score++;
1335+
1336+
if (score == 4)
1337+
return true;
1338+
else
1339+
return false;
1340+
}
1341+
EXPORT_SYMBOL(drm_dect_asus_vz229h_edid);
1342+
1343+
13241344
static int edid_fixup __read_mostly = 6;
13251345
module_param_named(edid_fixup, edid_fixup, int, 0400);
13261346
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
@@ -58,6 +58,7 @@
5858
static bool drm_kms_helper_poll = true;
5959
static bool drm_iex_monitor = false;
6060
static bool drm_acer_kg221q_monitor = false;
61+
static bool drm_asus_vz229h_monitor = false;
6162
module_param_named(poll, drm_kms_helper_poll, bool, 0600);
6263

6364
static enum drm_mode_status
@@ -267,6 +268,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
267268
edid_manufacturer = (struct edid *) connector->edid_blob_ptr->data;
268269
drm_iex_monitor = drm_dect_iex_edid(edid_manufacturer);
269270
drm_acer_kg221q_monitor = drm_dect_acer_kg221q_edid(edid_manufacturer);
271+
drm_asus_vz229h_monitor = drm_dect_asus_vz229h_edid(edid_manufacturer);
270272
}
271273
list_for_each_entry(mode, &connector->modes, head) {
272274
drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
@@ -288,6 +290,12 @@ bool detect_acer_kg221q_monitor(void)
288290
}
289291
EXPORT_SYMBOL(detect_acer_kg221q_monitor);
290292

293+
bool detect_asus_vz229h_monitor(void)
294+
{
295+
return drm_asus_vz229h_monitor;
296+
}
297+
EXPORT_SYMBOL(detect_asus_vz229h_monitor);
298+
291299
/**
292300
* drm_helper_probe_single_connector_modes - get complete set of display modes
293301
* @connector: connector to probe

include/drm/drm_crtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,7 @@ extern void drm_set_preferred_mode(struct drm_connector *connector,
20132013
extern int drm_edid_header_is_valid(const u8 *raw_edid);
20142014
extern bool drm_dect_iex_edid(struct edid *edid);
20152015
extern bool drm_dect_acer_kg221q_edid(struct edid *edid);
2016+
extern bool drm_dect_asus_vz229h_edid(struct edid *edid);
20162017
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
20172018
bool *edid_corrupt);
20182019
extern bool drm_edid_is_valid(struct edid *edid);

0 commit comments

Comments
 (0)