Skip to content

Commit 7f25db7

Browse files
committed
HDMI: VGG804838 HDMI panel porting
if clock is not equal to request_clock in vop_crtc_mode_valid(), check if request_clock is 33260 and match EDID, then don't set mode to MODE_CLOCK_RANGE to prevent blank screen, this solution is WAR Signed-off-by: bross1_kuo <bross1_kuo@asus.com> Change-Id: I90dd5349a2c55be320592ef971fb5c4601aae928
1 parent 62a7200 commit 7f25db7

4 files changed

Lines changed: 45 additions & 3 deletions

File tree

drivers/gpu/drm/drm_edid.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,10 @@ static const u8 acer_kg221q_edid[] = {
12751275
static const u8 asus_vz229h_edid[] = {
12761276
0x06, 0xB3, 0xCC, 0x22
12771277
};
1278+
1279+
static const u8 eve_vgg804838_edid[] = {
1280+
0x16, 0xC5, 0x01, 0x10
1281+
};
12781282
/**
12791283
* drm_edid_header_is_valid - sanity check the header of the base EDID block
12801284
* @raw_edid: pointer to raw base EDID block
@@ -1340,6 +1344,20 @@ bool drm_dect_asus_vz229h_edid(struct edid *edid)
13401344
}
13411345
EXPORT_SYMBOL(drm_dect_asus_vz229h_edid);
13421346

1347+
bool drm_dect_eve_vgg804838_edid(struct edid *edid)
1348+
{
1349+
int i, score = 0;
1350+
u8 *raw_edid = (u8 *)edid;
1351+
for (i = 0; i < sizeof(eve_vgg804838_edid); i++) {
1352+
if (raw_edid[8+i] == eve_vgg804838_edid[i])
1353+
score++;
1354+
}
1355+
if (score == 4)
1356+
return true;
1357+
else
1358+
return false;
1359+
}
1360+
EXPORT_SYMBOL(drm_dect_eve_vgg804838_edid);
13431361

13441362
static int edid_fixup __read_mostly = 6;
13451363
module_param_named(edid_fixup, edid_fixup, int, 0400);

drivers/gpu/drm/drm_probe_helper.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static bool drm_kms_helper_poll = true;
5959
static bool drm_iex_monitor = false;
6060
static bool drm_acer_kg221q_monitor = false;
6161
static bool drm_asus_vz229h_monitor = false;
62+
static bool drm_eve_vgg804838_panel = false;
6263
module_param_named(poll, drm_kms_helper_poll, bool, 0600);
6364

6465
static enum drm_mode_status
@@ -232,6 +233,13 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
232233
if (connector->stereo_allowed)
233234
mode_flags |= DRM_MODE_FLAG_3D_MASK;
234235

236+
if (!strcmp(connector->name, "HDMI-A-1")) {
237+
if( (*connector_funcs->check_edid)(connector) ) {
238+
edid_manufacturer = (struct edid *) connector->edid_blob_ptr->data;
239+
drm_eve_vgg804838_panel = drm_dect_eve_vgg804838_edid(edid_manufacturer);
240+
}
241+
}
242+
235243
list_for_each_entry(mode, &connector->modes, head) {
236244
if (mode->status == MODE_OK)
237245
mode->status = drm_mode_validate_basic(mode);
@@ -298,6 +306,12 @@ bool detect_asus_vz229h_monitor(void)
298306
}
299307
EXPORT_SYMBOL(detect_asus_vz229h_monitor);
300308

309+
bool detect_eve_vgg804838_panel (void)
310+
{
311+
return drm_eve_vgg804838_panel;
312+
}
313+
EXPORT_SYMBOL(detect_eve_vgg804838_panel);
314+
301315
/**
302316
* drm_helper_probe_single_connector_modes - get complete set of display modes
303317
* @connector: connector to probe

drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,6 +2304,9 @@ vop_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode,
23042304
const struct vop_data *vop_data = vop->data;
23052305
int request_clock = mode->clock;
23062306
int clock;
2307+
bool eve_vgg804838_panel = false;
2308+
2309+
eve_vgg804838_panel = detect_eve_vgg804838_panel();
23072310

23082311
if (mode->clock >= 300000)
23092312
return MODE_CLOCK_RANGE;
@@ -2325,9 +2328,14 @@ vop_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode,
23252328
*/
23262329
if (output_type == DRM_MODE_CONNECTOR_HDMIA ||
23272330
output_type == DRM_MODE_CONNECTOR_DisplayPort)
2328-
if (clock != request_clock)
2329-
return MODE_CLOCK_RANGE;
2330-
2331+
if (clock != request_clock) {
2332+
if(request_clock == 33260 && eve_vgg804838_panel) {
2333+
pr_err("%s: don't block pixel clock %d KHz", __func__, request_clock);
2334+
return MODE_OK;
2335+
}
2336+
else
2337+
return MODE_CLOCK_RANGE;
2338+
}
23312339
return MODE_OK;
23322340
}
23332341

include/drm/drm_crtc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,6 +2032,8 @@ extern int drm_edid_header_is_valid(const u8 *raw_edid);
20322032
extern bool drm_dect_iex_edid(struct edid *edid);
20332033
extern bool drm_dect_acer_kg221q_edid(struct edid *edid);
20342034
extern bool drm_dect_asus_vz229h_edid(struct edid *edid);
2035+
extern bool drm_dect_eve_vgg804838_edid(struct edid *edid);
2036+
extern bool detect_eve_vgg804838_panel(void);
20352037
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
20362038
bool *edid_corrupt);
20372039
extern bool drm_edid_is_valid(struct edid *edid);

0 commit comments

Comments
 (0)