Skip to content

Commit 774b0e3

Browse files
committed
HDMI: waveshare 5 inch HDMI panel porting
if clock is not equal to request_clock in vop_crtc_mode_valid(), check if request_clock is 33900 and match EDID, then don't set mode to MODE_CLOCK_RANGE, this solution is WAR panel ID is DWE2100 Change-Id: Ie7edf81ffdac36ae35e888676dcf296cd6c4147b Signed-off-by: bross1_kuo <bross1_kuo@asus.com>
1 parent 7f25db7 commit 774b0e3

4 files changed

Lines changed: 32 additions & 1 deletion

File tree

drivers/gpu/drm/drm_edid.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,10 @@ static const u8 asus_vz229h_edid[] = {
12791279
static const u8 eve_vgg804838_edid[] = {
12801280
0x16, 0xC5, 0x01, 0x10
12811281
};
1282+
1283+
static const u8 dwe2100_edid[] = {
1284+
0x12, 0xE5, 0x00, 0x21
1285+
};
12821286
/**
12831287
* drm_edid_header_is_valid - sanity check the header of the base EDID block
12841288
* @raw_edid: pointer to raw base EDID block
@@ -1359,6 +1363,21 @@ bool drm_dect_eve_vgg804838_edid(struct edid *edid)
13591363
}
13601364
EXPORT_SYMBOL(drm_dect_eve_vgg804838_edid);
13611365

1366+
bool drm_dect_dwe2100_edid(struct edid *edid)
1367+
{
1368+
int i, score = 0;
1369+
u8 *raw_edid = (u8 *)edid;
1370+
for (i = 0; i < sizeof(dwe2100_edid); i++) {
1371+
if (raw_edid[8+i] == dwe2100_edid[i])
1372+
score++;
1373+
}
1374+
if (score == 4)
1375+
return true;
1376+
else
1377+
return false;
1378+
}
1379+
EXPORT_SYMBOL(drm_dect_dwe2100_edid);
1380+
13621381
static int edid_fixup __read_mostly = 6;
13631382
module_param_named(edid_fixup, edid_fixup, int, 0400);
13641383
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
@@ -60,6 +60,7 @@ static bool drm_iex_monitor = false;
6060
static bool drm_acer_kg221q_monitor = false;
6161
static bool drm_asus_vz229h_monitor = false;
6262
static bool drm_eve_vgg804838_panel = false;
63+
static bool drm_dwe2100_panel = false;
6364
module_param_named(poll, drm_kms_helper_poll, bool, 0600);
6465

6566
static enum drm_mode_status
@@ -237,6 +238,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
237238
if( (*connector_funcs->check_edid)(connector) ) {
238239
edid_manufacturer = (struct edid *) connector->edid_blob_ptr->data;
239240
drm_eve_vgg804838_panel = drm_dect_eve_vgg804838_edid(edid_manufacturer);
241+
drm_dwe2100_panel = drm_dect_dwe2100_edid(edid_manufacturer);
240242
}
241243
}
242244

@@ -312,6 +314,12 @@ bool detect_eve_vgg804838_panel (void)
312314
}
313315
EXPORT_SYMBOL(detect_eve_vgg804838_panel);
314316

317+
bool detect_dwe2100_panel (void)
318+
{
319+
return drm_dwe2100_panel;
320+
}
321+
EXPORT_SYMBOL(detect_dwe2100_panel);
322+
315323
/**
316324
* drm_helper_probe_single_connector_modes - get complete set of display modes
317325
* @connector: connector to probe

drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2305,8 +2305,10 @@ vop_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode,
23052305
int request_clock = mode->clock;
23062306
int clock;
23072307
bool eve_vgg804838_panel = false;
2308+
bool dwe2100_panel = false;
23082309

23092310
eve_vgg804838_panel = detect_eve_vgg804838_panel();
2311+
dwe2100_panel = detect_dwe2100_panel();
23102312

23112313
if (mode->clock >= 300000)
23122314
return MODE_CLOCK_RANGE;
@@ -2329,7 +2331,7 @@ vop_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode,
23292331
if (output_type == DRM_MODE_CONNECTOR_HDMIA ||
23302332
output_type == DRM_MODE_CONNECTOR_DisplayPort)
23312333
if (clock != request_clock) {
2332-
if(request_clock == 33260 && eve_vgg804838_panel) {
2334+
if((request_clock == 33260 && eve_vgg804838_panel) || (request_clock == 33900 && dwe2100_panel)) {
23332335
pr_err("%s: don't block pixel clock %d KHz", __func__, request_clock);
23342336
return MODE_OK;
23352337
}

include/drm/drm_crtc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,8 @@ extern bool drm_dect_acer_kg221q_edid(struct edid *edid);
20342034
extern bool drm_dect_asus_vz229h_edid(struct edid *edid);
20352035
extern bool drm_dect_eve_vgg804838_edid(struct edid *edid);
20362036
extern bool detect_eve_vgg804838_panel(void);
2037+
extern bool drm_dect_dwe2100_edid(struct edid *edid);
2038+
extern bool detect_dwe2100_panel(void);
20372039
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
20382040
bool *edid_corrupt);
20392041
extern bool drm_edid_is_valid(struct edid *edid);

0 commit comments

Comments
 (0)